• How to rotate an illustration created using an environment generated using the newfloat command?
    by forrest on July 19, 2026 at 3:49 pm

    In my book I have two kinds of illustrations: photographs and sketches. These should be named respectively and should have distinct counters. This task can be done with the use of the \newfloat command of the memoir package. Great. Now, among both kinds of illustrations are present big graphics which should be rotated by the angle of 90 degrees - together with their captions. The tool aimed to perform this operation is sidewayfigure environment which is included in the rotating package. Fine. The remaining task is to integrate these two environments, but I am failed by it. Code: \documentclass[11pt,twoside]{memoir} \usepackage{mwe} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{rotating} \setstocksize{180mm}{120mm} \settrimmedsize{180mm}{120mm}{*} \settypeblocksize{160mm}{100mm}{*} \setlrmargins{10mm}{*}{*} \setulmargins{10mm}{*}{*} \setheadfoot{0pt}{0pt} \settypeoutlayoutunit{mm} \checkandfixthelayout \newfloat{photo}{lop}{Photograph} \newfloat{sketch}{los}{Sketch} \begin{document} \begin{photo}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-a}% \caption{First photo}\label{photo:first} \end{photo} \begin{sketch}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-b}% \caption{First sketch}\label{sketch:first} \end{sketch} \begin{sidewaysfigure} \includegraphics[width=\textwidth,height=.5\textheight]{example-image-c}% \caption{First figure}\label{figure:second} \end{sidewaysfigure} \begin{photo} \begin{sideways} \includegraphics[width=\textwidth,height=.5\textheight]{example-image-a}% \caption{Second photo}\label{photo:second} \end{sideways} \end{photo} \end{document} By the way: How width and height optional arguments of \includegraphics work while are called within sidewaysfigure environment?

  • I want to learn on tex4ht based on oolatex but cannot find
    by user2609605 on July 19, 2026 at 1:59 am

    I remember strongly that there was a script called oolatex in texlive. Also in the documentation of tex4ht it is mentioned. Still I cannot find it in texlive any more. Is it available only in old releases? I don't want to use make4ht since I need full control. I prefer oolatex because it is closer to elementary. My intention is just to learn.

  • Fine-tuning the box surrounding a bar plot
    by Muhannad Al Ayoubi on July 18, 2026 at 5:22 pm

    This is my first time making a bar plot using pgfplots. I am happy so far with what I have, but I still need some points. How can I make the top-most tick (14) coincide with the top boundary of the box? I do not like the tiny space between the top-most gridline and the top boundary of the box. I've already tried removing 14 from the key ytick but I don't like the result. I think the 14 has to stay. Suppose instead I decided to completely remove the top and right boundaries of the box. I know I can do that using the options axis x line*=bottom and axis y line*=left, but then I'd like to include arrowheads, at least for the y-axis. How to do that? Finally, I've managed to adjust the distance between successive bars by playing with the option x=0.8 cm. Is there a better way? Here is my code. I've also attached the figure. \documentclass[10pt]{book} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture}[every node/.style={font=\footnotesize}] \begin{axis}[ clip=false, ybar, ymajorgrids, grid style={dashed}, ymin=0, %axis x line*=bottom, %axis y line*=left, xlabel=Number of siblings, ylabel=Frequency, ytick pos=left, xtick pos=left, xtick=data, ytick={0,2,4,...,12,14}, bar width=.4cm, x=0.8cm, y=0.3cm, label style={font={\footnotesize \itshape}}, tick label style={font={\footnotesize \itshape}}, nodes near coords, nodes near coords align={vertical}, ] \addplot [fill=orange,] coordinates { (0,3) (1,13) (2,8) (3,3) (4,1) }; \end{axis} \end{tikzpicture} \end{document}

  • Adjusting TikZ code example to create clock faces for modular arithmetic graphics
    by Bryan-StackExchange on July 18, 2026 at 4:30 pm

    The following Stack Exchange answers describe two sort of clock faces which are very close to what I need : Chords between nodes on a clock-like diagram using TikZ As seen in the two examples, I would like to : keep the digits on exterior of circle control whether to display the arrows or lines - or, especially, not display them. I have been able to adjust the code of the two answers (details below) in order to : increase the divisions e.g. from 12 to 98 (but see below) obtain any single face and print it using most of size 8.5 x 11 paper I still would like : display only certain values around perimeter - e.g. 12, 3, 6, 9 as might be seen on a normal clock increase the total to 98 but ideally any value. The purpose is generally for looking at symmetry in modular arithmetic. LaTeX seems ideally suited for this vs. e.g. Gnuplot. omit the lines between "nodes" (or markings) potentially create hash marks on the circle at any increment I do not understand many parts of the two code examples, and I believe this is necessary to adjust the examples to my requirements. e.g. the function of modtweleve and TikZMGClockMath. I am using https://tikz.dev/ as a reference - so I suspect I am overlooking a number of resources. The small adjustments to the two answers in the link are IMHO trivial, and I do not think they need to be reproduced here unless requested. some details : in the accepted answer by user Jake, in \newcommand replace 12 with e.g. 50. However, this approach runs into memory problems as the value increases. adjust stepsize in {1,...,12} to e.g. stepsize in {5} gives the fifth clock face only. This is good. in the answer by user percusse I adjusted 12 to 13 and used a single \begin{scope} to control how many pictures are displayed. The resultant image(s) are closest to what I need ; however, I do not understand how the macro is working - e.g. the \modtwelve part. However, the value can be increased to 98 without any memory problems, and create a nice image. In fact, my exact goal is met by adjusting \TikZMGClockMath{3}{28} - giving a 7-fold pattern. Specifically, the drawing would be perfect if the integers between e.g. 0 and 28 were omitted. in that answer, I commented out line 19-29 - from \draw and the first } that appears - to 'omit' the lines (vectors). This seems good. UPDATE: I added hashmarks with this code: \foreach \angle / \label in {90/0, 38.6/14, -12.8/28, -64.2/42, -115.6/56, -167/70, -218.4/84} ... which is good to show 7-fold symmetry, but they are not on the perimeter. The \draw commands adjust the position of a node or line width by the \angle. This is easy to adjust. See https://tikz.dev/pgffor UPDATE I found an inelegant way to add hashmarks - right after the above code, put this in: \draw[line width=0.5pt] (\angle:8.0cm) -- (\angle:8.5cm); } \foreach \angle in {86.3265, 86.3265, 82.6531, [.. skipping...] -258.98, -262.653, -266.327} the values are pre-calculated using awk. It would be nice to reduce that into a \foreach, multiplying the value of the example (360/98). Then, (360/98) could be any division of the circle. I tried asking on the original post, but I do not have the requisite reputation. If there is a better approach, I'd be glad to change this question.

  • An original cover of my book for a broken clock
    by Sebastiano on July 17, 2026 at 8:21 pm

    I have tried to create a cover for my book that is beautiful and visually appealing. Since the book deals with topics such as relativity, clocks, four-vectors, spacetime, the calculus of variations, and many other fascinating ideas, I imagined clocks being sucked into an unknown spacetime and deformed in the style of Salvador Dalí. The clocks become distorted until they break apart into many fragments, including the smallest and most symbolic components, such as the central pin and the internal spring. Question: How can you improve the broken clock that loses pieces to make it look more beautiful? \documentclass[12pt,a4paper]{book} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{geometry} \begin{document} \pagestyle{empty} \begin{tikzpicture}[remember picture, overlay] \coordinate (Centro) at (current page.center); \coordinate (TopRight) at (current page.north east); \coordinate (TopLeft) at (current page.north west); \definecolor{bglight}{RGB}{172, 206, 184} \fill[bglight] (current page.south west) rectangle (current page.north east); \definecolor{clockgold}{RGB}{230, 177, 43} \definecolor{clockgreen}{RGB}{166, 209, 108} \definecolor{clockorange}{RGB}{240, 133, 41} \definecolor{clockgrey}{RGB}{140, 155, 145} \definecolor{gridblue}{RGB}{110, 150, 135} \definecolor{authorgreen}{RGB}{18, 92, 79} \node[anchor=north east, align=right, text width=7cm] at ($(TopRight)+(-1.5,-1.5)$) { {\fontfamily{ptm}\selectfont\LARGE\color{authorgreen}\textbf{Name Surname 1}}\\[0.2cm] {\fontfamily{ptm}\selectfont\LARGE\color{authorgreen}\textbf{Name Surname 2}} }; \node[anchor=north west, align=justify, text width=16cm] at ($(TopLeft)+(1.5,-3.5)$) { {\fontfamily{pnc}\selectfont\huge\itshape\color{white}Lezioni di}\\[0.3cm] {\fontfamily{pnc}\fontseries{b}\fontsize{44pt}{46pt}\selectfont\spaceskip=0.5em\color{white} LONGGGGGGGGGGG\\ [.4cm] LONGGGGGGGGGGG} }; \begin{scope}[shift={(Centro)}, scale=1.6] \begin{scope}[gridblue, opacity=0.5, line width=0.8pt] \foreach \k in {-4.5,-3.7,-2.9,-2.1,-1.3,-0.5,0.5,1.3,2.9,3.7,4.5} { \draw[smooth, samples=40] plot[domain=-5.5:4.5] ({ \k * (1 - 0.6 / (1 + 0.2*\k*\k + 0.2*\x*\x)) }, { \x * (1 - 0.6 / (1 + 0.2*\k*\k + 0.2*\x*\x)) }); } \foreach \k in {-5,-4.1,-3.2,-2.3,-1.4,-0.5,0.5,1.4,2.3,3.2,4} { \draw[smooth, samples=40] plot[domain=-4.8:4.8] ({ \x * (1 - 0.6 / (1 + 0.2*\x*\x + 0.2*\k*\k)) }, { \k * (1 - 0.6 / (1 + 0.2*\x*\x + 0.2*\k*\k)) }); } \end{scope} \fill[white, opacity=0.25, rotate around={12:(3.2,-1.5)}] (1.8,-3) rectangle (4,0); \fill[white, opacity=0.25, rotate around={-15:(-3,2)}] (-4.2,0.8) rectangle (-1.8,3.2); \begin{scope}[shift={(-2.8,2)}, rotate=-15, scale=0.95] \draw[white, fill=white, line width=4pt, line join=round] plot[smooth cycle, tension=0.5] coordinates {(-1,1.1) (1,0.9) (0.9,-1) (-1.1,-0.8)}; \draw[gray!60!black, line width=2pt, line join=round] plot[smooth cycle, tension=0.5] coordinates {(-1,1.1) (1,0.9) (0.9,-1) (-1.1,-0.8)}; \fill[clockgold] plot[smooth cycle, tension=0.5] coordinates {(-0.7,0.8) (0.7,0.7) (0.6,-0.7) (-0.7,-0.5)}; \fill[black] (0,0) circle (2.5pt); \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(0,0) (0.05, 0.25) (0.15,0.5)}; \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(0,0) (-0.2, -0.05) (-0.4,-0.1)}; \foreach \a in {0,90,180,270} \draw[white, thick] (\a:0.55) -- (\a:0.7); \end{scope} \begin{scope}[shift={(-2.6,-0.8)}, rotate=22, scale=1.05] \draw[white, fill=white, line width=4pt, line join=round] plot[smooth cycle, tension=0.7] coordinates {(-0.6,1.4) (0.8,0.4) (0.2,-1.5) (-0.9,-0.8)}; \draw[gray!60!black, line width=2.2pt, line join=round] plot[smooth cycle, tension=0.7] coordinates {(-0.6,1.4) (0.8,0.4) (0.2,-1.5) (-0.9,-0.8)}; \fill[clockgreen] plot[smooth cycle, tension=0.7] coordinates {(-0.4,1.1) (0.5,0.2) (0.1,-1.2) (-0.6,-0.6)}; \fill[black] (-0.1,-0.1) circle (2.5pt); \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(-0.1,-0.1) (0, 0.2) (0.15,0.6)}; \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(-0.1,-0.1) (0.05, -0.3) (0.2,-0.5)}; \draw[black!70, thick] (0.1,0.9) -- (0.2,1.1); \draw[black!70, thick] (-0.4,-0.8) -- (-0.5,-1.0); \end{scope} \begin{scope}[shift={(-.5,-3.6)}, rotate=-15, scale=0.9] \draw[white, fill=white, line width=4pt, line join=round] plot[smooth cycle, tension=0.7] coordinates {(-0.7,1.4) (0.8,1.2) (1.1,-2.2) (-0.9,-2.4)}; \draw[gray!60!black, line width=2pt, line join=round] plot[smooth cycle, tension=0.7] coordinates {(-0.7,1.4) (0.8,1.2) (1.1,-2.2) (-0.9,-2.4)}; \fill[clockgrey!70!clockgreen] plot[smooth cycle, tension=0.7] coordinates {(-0.5,1.1) (0.6,1.0) (0.8,-1.9) (-0.6,-2.0)}; \fill[black] (0.05,-0.1) circle (2.5pt); \draw[black, ultra thick, ->] plot[smooth, tension=1.2] coordinates{(0.05,-0.1) (-0.2, 0.4) (0.3,0.9)}; \draw[black, ultra thick, ->] plot[smooth, tension=1.2] coordinates{(0.05,-0.1) (0.4, -0.6) (0.1,-1.5)}; \draw[black!80, thick] (90:0.6) -- (90:0.8); \draw[black!80, thick] (0:0.5) -- (0:0.7); \draw[black!80, thick] (180:0.4) -- (180:0.6); \draw[black!80, thick] (270:0.6) -- (270:1.3); \end{scope} \begin{scope}[shift={(2.5,-3.8)}, rotate=-35, scale=1.1] \draw[white, fill=white, line width=4pt, line join=round] plot[smooth cycle, tension=0.4] coordinates {(-1.3,0.6) (1.3,0.7) (0.9,-0.6) (-1.1,-0.5)}; \draw[clockorange, line width=2.5pt, line join=round] plot[smooth cycle, tension=0.4] coordinates {(-1.3,0.6) (1.3,0.7) (0.9,-0.6) (-1.1,-0.5)}; \fill[black] (0,0) circle (2.5pt); \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(0,0) (0.3, 0.1) (0.7,0.2)}; \draw[black, ultra thick, ->] plot[smooth, tension=1] coordinates{(0,0) (-0.2, -0.05) (-0.5,-0.1)}; \draw[black!70, thick] (1,0.2) -- (1.2,0.2); \draw[black!70, thick] (-0.9,-0.2) -- (-1.1,-0.2); \end{scope} \begin{scope}[shift={(2.5,2.5)}, rotate=15, scale=0.85] \begin{scope}[shift={(-0.3, 0.2)}, rotate=5] \draw[white, fill=white, line width=3pt] (0,0) -- (110:1.2) arc(110:200:1.2) -- cycle; \fill[clockgrey!70!clockgreen] (0,0) -- (110:1.0) arc(110:200:1.0) -- cycle; \draw[black!80, thick] (180:0.7) -- (180:0.9); \draw[black!80, thick] (120:0.7) -- (120:0.9); \end{scope} \begin{scope}[shift={(0.2, 0.4)}, rotate=-8] \draw[white, fill=white, line width=3pt] (0,0) -- (10:1.3) arc(10:85:1.3) -- cycle; \fill[clockgrey!70!clockgreen] (0,0) -- (10:1.1) arc(10:85:1.1) -- cycle; \draw[black!80, thick] (0:0.8) -- (0:1.0); \draw[black!80, thick] (60:0.8) -- (60:1.0); \draw[black, ultra thick] (30:0.2) -- (45:0.7); \end{scope} \begin{scope}[shift={(0.0, -0.4)}, rotate=12] \draw[white, fill=white, line width=3pt] (0,0) -- (220:1.2) arc(220:340:1.2) -- cycle; \fill[clockgrey!70!clockgreen] (0,0) -- (220:1.0) arc(220:340:1.0) -- cycle; \draw[black!80, thick] (270:0.7) -- (270:0.9); \draw[black!80, thick] (300:0.7) -- (300:0.9); \end{scope} \begin{scope}[shift={(-0.8, -0.9)}, rotate=-30] \draw[white, fill=gray!40, line width=1.5pt] (0,0) -- (0.3,0.4) -- (-0.1,0.5) -- cycle; \end{scope} \begin{scope}[shift={(0.9, -0.2)}, rotate=45] \draw[white, fill=white, line width=2pt] (0,0) -- (0.4,0.1) -- (0.2,0.3) -- cycle; \end{scope} \fill[black] (-0.1,0.05) circle (2.5pt); \begin{scope}[shift={(-0.5, 0.8)}, rotate=25] \draw[black, ultra thick, ->] (0,0) -- (-0.4, 0.5); \end{scope} \draw[gray!80!black, thick, smooth] plot[domain=0:540, samples=40] (\x:{\x*0.001 + 0.05}); \end{scope} \begin{scope}[shift={(2.6,-1.4)}, rotate=45, scale=1.2] \draw[clockorange, line width=5pt, line join=round, fill=white, fill opacity=0.1] plot[smooth cycle, tension=0.2] coordinates {(-1.1,0.5) (1.1,0.5) (0.7,-0.5) (-0.7,-0.5)}; \end{scope} \end{scope} \end{tikzpicture} \clearpage \end{document}

  • TeX Live 2026 make4ht MathJax MathML rendering of math following a \tikz command not enclosed in tikzpicture
    by krone on July 17, 2026 at 1:01 pm

    This is a follow up from Another mathjax/mathml question. MWE test.tex: \documentclass{book} \usepackage{tikz} \begin{document} \chapter{A test} \section{A section in the chapter} \begin{center} \tikz{ \draw (0,0) -- (1,0); } % \begin{tikzpicture} % \draw (0,0) -- (1,0); % \end{tikzpicture} \end{center} \[ a = b \] \begin{equation} \chi = \int_{-\infty}^{\infty} a(x) \exp{\left[ i 2 \pi x f \right]} dx \end{equation} \end{document} and test.cfg \Preamble{xhtml,mathml,mathjax} \catcode`\:11 \Configure{IMG} {\ht:special{t4ht=\ifmathml <\a:mathml semantics><\a:mathml annotation-xml encoding="application/xhtml+xml">\fi<img\Hnewline \ifmathml xmlns="http://www.w3.org/1999/xhtml"\fi\Hnewline src="\a:imgdir }\PauseMathClass} {\ht:special{t4ht=" alt="}} {" } {\ht:special{t4ht=" }} {\EndPauseMathClass\ht:special{t4ht=\xml:empty>\ifmathml </\a:mathml annotation-xml></\a:mathml semantics>\fi}} \catcode`\:12 \begin{document} \EndPreamble The config is probably unnecessary for users of vanilla texlive, but required in my case (see link to original question). make4ht is called as make4ht -l -c test.cfg test.tex As written, both equations after the \tikz{...} render as Math input error. If replaced by the code commented out i.e. \begin{tikzpicture} \draw{...} \end{tikzpicture} the rendering is normal. Thanks for your attention.

  • How unicode accents combining character convert to LaTeX accent commands?
    by mathrm alpha on July 17, 2026 at 4:18 am

    Although the newcomputermodern usepackages in LaTeX offer more Unicode accents, when I tried to convert them to (like \Vecbelow{a}), I found that Unicode accents must be placed after the letter, while LaTeX accents are placed before the letter and enclose it. It cannot directly enclose letters like the native LaTeX accents command to this letter here: . \documentclass{article} \usepackage{newcomputermodern} \begin{document} \t{a} a\symbol{"0362} \symbol{"0362}a \end{document}

  • Calculation number leak out with `businessman` in `tikzpeople`?
    by Explorer on July 17, 2026 at 1:48 am

    With the following MWE: \documentclass[tikz,border=5pt]{standalone} \usepackage{tikzpeople} \begin{document} \begin{tikzpicture} \node[businessman, minimum size=1.5cm] {}; \end{tikzpicture} \end{document} However, in the terminal output, we know that: Missing character: There is no * in font nullfont! Missing character: There is no 4 in font nullfont! Missing character: There is no . in font nullfont! Missing character: There is no 7 in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no 2 in font nullfont! Missing character: There is no 9 in font nullfont! Missing character: There is no 4 in font nullfont! Missing character: There is no p in font nullfont! Missing character: There is no t in font nullfont! Is that a bug with tikzpeople? Any quick fix to prevent this?

  • How to clip at the edge of a *drawn* line?
    by karlh on July 17, 2026 at 1:01 am

    I am attempting to do a faded (partially-transparent) picture that is "outlined" at three different levels of opacity/color mixing. These should form the "convex boundary" (similar to that called for in "padded boundary of convex hull") of the original path with several different values of the "padding." The shape will, in general, be very complex (i.e., composed of many, many segments). Essentially, I want (almost) the inverse of this: \documentclass[tikz]{standalone} \usepackage{worldflags} \begin{document} \begin{tikzpicture} \pic [country=PT,length=4cm,width=4.5cm,framewidth=0pt] at (0.5,1.25) {worldflag}; \path [save path=\mypath] (0,0) -- (1,0.5) -- (1.5,1) -- (1,2) -- (0.5,1.5) -- (-0.25,2.5) -- (-0.5,0.5) -- cycle; \path [use path=\mypath,draw=black,line width=1.5cm,line join=round,opacity=0.05]; \path [use path=\mypath,draw=black,line width=0.4cm,line join=round,opacity=0.2]; \path [use path=\mypath,draw=black,line width=0.1cm,line join=round,opacity=0.4]; \path [use path=\mypath,fill=black,opacity=1]; \end{tikzpicture} \end{document} By "inverse" I mean that everywhere that is black in this image should be transparent, everything that is gray should be that % transparent, and everything outside the outermost boundary (the very slightly shaded region around the outside) should be clipped away or be filled with a background color. Note that I used the flag of Portugal as my picture here, but it can be any arbitrary image or drawing (assuming what I want to do is possible). I have tried using the nfold library (technically the offsetpath PGF library), but it has issues with concave shapes that are offset: \documentclass[tikz]{standalone} \usetikzlibrary{nfold} \usepackage{worldflags} \begin{document} \begin{tikzpicture} \coordinate (a) at (2,1); \coordinate (b) at (2.5,0.25); \coordinate (c) at (3,0.75); \coordinate (d) at (3.5,0); \coordinate (e) at (4,1); \coordinate (f) at (3,2); \path [save path=\island] (a) -- (b) -- (c) -- (d) -- (e) -- (f) -- cycle; \begin{scope} \pgfsetroundjoin \pgfoffsetpath{\island}{-5cm} \pgfpathclose \pgfusepath{clip} \pic [country=PT,width=12cm,at={(5cm,1cm)}] {worldflag}; \end{scope} \end{tikzpicture} I have also tried using the soft path (via spath3 and a subroutine I wrote myself using it), and that has similar issues with self-intersecting/overlapping offsets that occur with concave paths. Is there some way to say "use this drawing as a transparency mask" in TikZ? If not, I would appreciate referrals to libraries for which I should look through documentation. The final result should look something like this (without having to draw the outer path by hand, which I did to make this one): EDIT At the suggestion of Qrrbrbirlbel, I tried a variant using fadings. Issues: (a) it requires the path to be drawn explicitly twice (once in the preamble/fading definition and once in the body of the document) due to the definition of the fading; (b) I find that I have to rescale and/or translate the fit so it's in the right place, even though the fading and the path are drawn from the same coordinates, and (c) it requires scope fadings, which some PDF viewers (including evince/papers) do not display correctly for strokes, as shown below. \documentclass[tikz]{standalone} \usetikzlibrary{calc} \usepackage{worldflags} \begin{tikzfadingfrompicture}[name=island] \coordinate (a) at (2,1); \coordinate (b) at (2.5,0.25); \coordinate (c) at (3,0.75); \coordinate (d) at (3.5,0); \coordinate (e) at (4,1); \coordinate (f) at (3,2); \path [fill=transparent!100] (0,-2) rectangle (6,4); \path [save path=\island] (a) -- (b) -- (c) -- (d) -- (e) -- (f) -- cycle; \path [draw=transparent!95,line width=2cm,use path=\island]; \path [draw=transparent!80,line width=0.5cm,use path=\island]; \path [draw=transparent!60,line width=0.1cm,use path=\island]; \path [fill=transparent!0,use path=\island]; \end{tikzfadingfrompicture} \begin{document} \begin{tikzpicture} \coordinate (a) at (2,1); \coordinate (b) at (2.5,0.25); \coordinate (c) at (3,0.75); \coordinate (d) at (3.5,0); \coordinate (e) at (4,1); \coordinate (f) at (3,2); \path [fill=cyan] (0,-2) rectangle (6,4); \path [save path=\island] (a) -- (b) -- (c) -- (d) -- (e) -- (f) -- cycle; \begin{scope}[transparency group] % \path [scope fading=island,fit fading=true, % fading transform={scale=0.29}] (0,-2) rectangle (6,4); \path [scope fading=island,fit fading=false, fading transform={shift={(3cm,1cm)}}] (0,-2) rectangle (6,4); \pic [country=PT,width=6cm,length=6cm] at (3,1) {worldflag}; \end{scope} \path [draw=black,use path=\island]; \end{tikzpicture} \end{document} This looks OK in Xpdf, viz., but it is not displayed correctly in Evince or Papers, viz.,

  • Why placing the tikzpeople node in vertical order creates a large vertical space below the 3rd level?
    by Raja on July 16, 2026 at 6:26 pm

    I am trying to create a 3 hierarchy levels using maninblack at level 1, businessman at level 2 and dave at level 3, create empty vertical space below the 3rd level, which pushes the caption out of page. I want to know why this is happening and how to resolve it? \documentclass{article} \usepackage{tikz} \usepackage{tikzpeople} \usetikzlibrary{patterns} \usepgflibrary{patterns.meta} \usetikzlibrary{shapes,arrows, shadows, fadings} \usetikzlibrary{calc} \usetikzlibrary{decorations.text} \usetikzlibrary{intersections,backgrounds} \usetikzlibrary{decorations.pathreplacing} \begin{document} Introduction\\ \begin{figure}[htbp] \centering \begin{tikzpicture}[transform shape, scale=1] \draw (0,4.5)node[maninblack, anchor=center, minimum size=1.5cm](da){} (da.south)++(0,-0.01)node[below, align=center, fill=white](m){\small \texttt{CreditDefinitions.tex}} (da.south)++(0,-1.5)node[businessman, anchor=north, minimum size=1.5cm](hod2){} (hod2.south)++(0,-0.01)node[below, align=center](m) {\small Compile: Main.tex $\rightarrow$ $<$course-code1$>$, $<$course-code2$>$, $\cdots$, $<$course-codeN$>$} ++(0.05,-0.06)node(r){}++(-0.1,-0.045)node(t){} (hod2.east)++(0.5,0)node[businessman, fill opacity=0.8, anchor=west, minimum size=1.5cm](hod3){} (hod2.west)++(-0.5,0)node[businessman, fill opacity=0.8, anchor=east, minimum size=1.5cm](hod1){} ; \foreach \x in {1,2,3}{ \ifnum\x=2 \draw[-stealth] (da.south)++(0,-0.1)to($(hod\x.north)+(0,0.1)$); \else \draw [dashed, -stealth] (da.south)++(0,-0.1)to($(hod\x.north)+(0,0.1)$); \fi } \foreach \x in {1,...,5}{ \pgfmathparse{(2*\x-6)}\xdef\res{\pgfmathresult} \pgfmathparse{int(\x==3 || \x==4)} \ifnum\pgfmathresult=1 \draw (m.center)++(\res,-1)node[circle, fill=black, scale=0.2](d\x){}; \else \draw(m.center)++(\res,-1)node[dave, anchor=north, minimum size=1.2cm](exp\x){} ; \ifnum\x=5 \draw (exp\x.south)++(0,-0.25)node[below, align=center]{\small Expert N}; \pgfmathparse{(0.5+0.25)} \draw[-stealth]($(m.center)+(0,-0.1)$) to node[pos=\pgfmathresult, align=center, fill=white](ab\x){}(exp\x.north); \draw[-stealth, dashed](exp\x.north)++(-0.1,-0.1) to node[pos=\pgfmathresult, align=center, fill=white](ba\x){}($(m.center)+(0,-0.2)$); \draw[magenta, rounded corners, -stealth] (ab\x.center)node[circle, fill=magenta, scale=0.2]{}|-(r.center); \draw[violet, rounded corners, dashed, -stealth] (ab\x.center)++(0,-0.15)node[circle, fill=violet, scale=0.2]{}|-(t.center); \draw (ab\x-|r)++(0,0.2)node[right, color=magenta!80!black]{\small$<$course-codeN.tex$+$.bib$>$ $+$ Main.aux}; \draw (ab\x-|t)++(0,-0.4)node[left, color=violet!90!black]{\small$<$course-codeN.tex$+$.bib$>$}; \else \draw (exp\x.south)++(0,-0.25)node[below, align=center]{\small Expert \x}; \pgfmathparse{((\x*0.2)+0.2)} \draw[-stealth]($(m.center)+(0,-0.1)$) to node[pos=\pgfmathresult, align=center, fill=white](ab\x){} (exp\x.north); \draw[-stealth, dashed](exp\x.north)++(0.1,-0.1) to ($(m.center)+(0,-0.2)$); \draw[magenta, rounded corners, -stealth] (ab\x.center)node[circle, fill=magenta, scale=0.2]{}|-(r.center); \draw[violet, rounded corners, dashed, -stealth] (ab\x.center)++(0,-0.1)node[circle, fill=violet, scale=0.2]{}|-(t.center); \draw (ab\x.center-|r)++(0,0.5)node[right, color=magenta!80!black]{\small$<$course-code\x.tex$+$.bib$>$}; \draw (ab\x.center-|t)++(0,-0.1)node[left, color=violet!90!black]{\small$<$course-code\x.tex$+$.bib$>$}; \fi \fi } \end{tikzpicture} \caption{Illustration of Syllabus.cls Usage between HOD and subject experts}\label{fig:usage-illustration} \end{figure} \end{document}

  • Drawing and defining functions in tikz
    by Medulla Oblongata on July 16, 2026 at 2:48 pm

    I am trying to draw a graph (function of the form sin()*exp(-x^2)) inside an ellipse. How do I fit the graph inside the ellipse? I don't know how to scale and position it correctly. \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[line width=1.2,fill=white] (1.5,0.5) ellipse (1.5 and 0.5); \draw[scale=0.1, domain=-20:20, samples=500, smooth, variable=\x, blue] (1.5,0.5) plot ({\x}, {0.5*sin(\x) * exp(-0.02*(\x)*(\x))}); \end{tikzpicture} \end{document} I want to produce something like:

  • A little mystery about array and math mode
    by invictus on July 16, 2026 at 1:05 pm

    As far as I know, the array environment needs to be in math mode. Not surprisingly, the following code fails on TeXlive 2025 on Overleaf with the error message "missing $ inserted". \documentclass{article} \begin{document} \begin{array}{c} x \end{array} \end{document} However, the same code compiles without any errors on my local TeXlive 2026. I haven't found any documentation on the change of the behavior of array from 2025 to 2026, so I am curious how it is able to run outside of math mode here. kpsewhich latex.ltx returns /usr/local/texlive/2026basic/texmf-dist/tex/latex/base/latex.ltx and kpsewhich array.sty returns /usr/local/texlive/2026basic/texmf-dist/tex/latex/tools/array.sty The file resides alone in a separate folder of its own. So, it seems that the standard texlive distribution is used and nothing else. Any ideas?

  • Custom link text with cleveref
    by Namal on July 16, 2026 at 9:53 am

    I am referencing a table with label = {tblr:reference1} and \cref{tblr:reference1}. With nameinlink in options I have a link: Table 1. How can I set a custom link text, like you do it with hypertarget: \hypertarget{pointsto}{Actual text.} \documentclass[ngerman]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{babel} \usepackage[landscape, margin=0.5cm]{geometry} \usepackage{xcolor} \usepackage{hyperref} \hypersetup{ colorlinks=true, linkcolor=red } \usepackage{tabularray, tblr-extras} %% the longtable that we neeed %% \UseTblrLibrary{babel,amsmath,varwidth} %% load these modules for tabularray %% \usepackage[]{cleveref} \begin{document} \centering \begin{longtblr}[ caption = {Caption}, label = {tblr:reference1} ] { colspec={Q[l,m] Q[l,m] X[l,m] X[3,c] l l X[l,m]}, vlines, cell{1}{1-Z}={bg=azure8, font=\sffamily}, cell{2}{1-Z}={red9}, rowhead = 2, measure=vbox, vspan=even } \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline \end{longtblr} \newpage This is a text, this is a link to \cref{tblr:reference1}. \end{document}

  • Styling Headings in Chinese
    by Climber of Mount. LaTeX on July 16, 2026 at 3:11 am

    Is there a macro or something out there to convert the style of headings into Chinese? By which I mean, to make something like \documentclass{article} \usepackage{xeCJK} \setCJKmainfont{Noto Sans CJK TC} \begin{document} \section{甲章} \subsection{甲節} \subsection{乙節} \end{document} display 壹、甲章 一、甲節 二、乙節 Preferably, the numberings should be customizable between 壹貳, 一二, 甲乙, (一)(二), 1 2, and so on. For reference, I am using XeLaTeX and the xeCJK package on the Overleaf platform.

  • IEEETran is not giving me the correct format for multiple citations
    by ali bab613 on July 16, 2026 at 1:21 am

    I have this MWE I extracted from my document on Overleaf (compiled in LuaLaTeX, which is necessary for my project): \documentclass[]{report} \begin{document} see here \cite{ref1,ref2} \bibliographystyle{IEEEtran} \bibliography{references} \end{document} and its giving me the citations as "see here [1,2]", instead of "see here [1], [2]". This is the exact opposite of the problem found in this question, though it seems both of us have our packages at their default. Thanks in advance for any suggestions EDIT: The original question had it written that I wanted no brackets (i.e. 'see here 1,2'). This was due to shoddy editing of the question on my part. I've updated my required citation format is of the form [1], [2], i.e., with square brackets around each and every citation call-out. Thank you. EDIT 2: I have accepted the answer by Mico for now, as it more closely conforms to the question, though Explorer's is also valid and should be looked at. In the comments of the latter answer, Explorer and I agreed that a simpler solution than both probably should exist, considering my ask is 1) apparently the default in the question I linked to above (though that question has no MWE and is quite old), and 2) it is apparently the more correct way to currently cite IEEE, as according to the most updated reference guide (2025) -- see Section 1. Also see here. As such, I suppose the question is still open to discussion, though both current answers are valid (and both answerers are kindly thanked for their time!).

  • Canvas 3D effect for vectors flattened along an axis or plane
    by Sebastiano on July 15, 2026 at 7:39 pm

    I would like to realize the following image in TikZ, which I had created very roughly in Adobe Illustrator. I am interested in understanding how to use TikZ 3d canvas to squash vectors along planes or lines. I would also like to see how it is used for labels. Here my attempt. See after the missing pieces. \documentclass{article} \usepackage{amsmath} \usepackage{bm} \usepackage{tikz} \usetikzlibrary{arrows.meta, angles, calc} \tikzset{rhtip/.tip={Triangle[line width=1pt, fill=white, length=9pt, width=9pt]}} \definecolor{vectorgreen}{RGB}{76, 181, 93} \definecolor{vectororange}{RGB}{235, 104, 38} \definecolor{vectorbrown}{RGB}{175, 110, 52} \definecolor{ellipseblue}{RGB}{112, 196, 172} \definecolor{spherepurple}{RGB}{155, 120, 200} \begin{document} \begin{tikzpicture}[>=latex] \coordinate (O) at (0,0); \draw[thin, black!70] (O) -- (0, 4.2) node[right, font=\Large] {$z$}; \draw[thin, black!70] (O) -- (5.5, -1.0) node[below right, font=\Large] {$y$}; \draw[thin, black!70] (O) -- (-4.8, -1.9) node[left, font=\Large] {$x$}; \coordinate (C) at (-2.2, -0.88); \fill[black] (C) circle (3.5pt) node[below=8pt, font=\Large] {$C$}; \begin{scope}[shift={(C)}, rotate=12] \draw[ellipseblue, line width=1.5pt] (0,0) ellipse (1.1 and 2.5); \draw[ellipseblue, line width=1.5pt, ->, >=latex] (131:1.1 and 2.5) -- (130:1.1 and 2.5); \draw[thin, black!60] (0,0) -- (225:1.1 and 2.5) node[midway, below right, font=\Large] {$r$}; \shade[ball color=spherepurple] (155:1.1 and 2.5) circle (0.18); \end{scope} \coordinate (P) at (4.0, 2.3); \coordinate (P_proj) at (4.0, -1.6); \draw[dashed, thick, black!80] (P) -- (P_proj); \draw[dashed, thick, black!80] (O) -- (P_proj); \draw[-rhtip, vectororange, line width=2pt] (O) -- (0, 1.9); \node[above right=2pt, font=\Large] at (0, 1.9) {$\bm{\beta}$}; \draw[-rhtip, vectorbrown, line width=2pt] (O) -- (-1.4, -0.56); \node[above=6pt, font=\Large] at (-0.7, -0.15) {$\mathbf{a}$}; \draw[-rhtip, vectorgreen, line width=2pt] (O) -- (3.9, 2.2); \node[below right=4pt, font=\Large] at (1.8, 1.1) {$\mathbf{R}$}; \fill[black] (P) circle (3.5pt) node[above right=4pt, font=\Large] {$P$}; \shade[ball color=spherepurple] (O) circle (0.22); \node[above left=6pt, font=\Large] at (O) {$q$}; \draw[<->, >=latex, semithick, black!80] (30:1.3) arc (30:90:1.3); \node[font=\Large] at (60:1.65) {$\theta$}; \node[font=\Large, below left=6pt] at (1, 0, 1) {$\varphi$}; \end{tikzpicture} \end{document}

  • Displaying an Elliptical Ring of Segments with Angular Adjustments
    by DDS on July 15, 2026 at 5:37 pm

    Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \fill[red!55!black] rectangle (6,8); \draw[ decoration={markings, mark=between positions 0 and 1 step 1/12 with { \node {\textcolor{yellow}{\rule{0.35in}{.65mm}}}; } }, decorate ] (3,4) ellipse (2cm and 3cm); \end{tikzpicture} \end{center} \end{document} which produces QUESTION: How may I display each of these twelve line segments so that they are pointed in their relative angular direction from the center? In other words, if we call the line segment farthest to the right the first line segment---it will be displayed as is. The second line segment (being the one immediately above it) will be pointed in a direction 30 degrees above the horizontal. Proceeding in a counterclockwise direction, the next angle will be pointed 60 degrees ... and so forth. I compile the code with xelatex. Thank you.

  • List of theorems in HTML using tex4ht + thmtools
    by Stephen Powell on July 15, 2026 at 12:19 pm

    The following (listoftheorems.tex) uses the command \listoftheorems provided by the thmtools package: \documentclass{article} \usepackage{hyperref} \usepackage{amsthm} \usepackage{thmtools} \declaretheorem{theorem} \begin{document} \begin{theorem}[Euclid] For every prime $p$, there is a prime $p'>p$. \end{theorem} \listoftheorems \end{document} Compiled to PDF, it gives a \section* containing a numbered list of theorems. But when I compile the document to HTML (make4ht listoftheorems.tex), the list of theorems is empty.

  • Inconsistent font feature rendering with plain luatex
    by niru on July 15, 2026 at 11:08 am

    For some reasons, I have to work with plain LuaTeX. All this while, I have used LuaLaTeX with fontspec and moving to LuaTeX is not exactly easy. I am getting surprised by LuaTeX's behaviour. For example, let's have a look at the following code: \input luaotfload.sty \font\main={NewCM10-Book:+onum,+cv06,+liga} \font\deva={Mukta-Light:Language=Marathi,Script=Devanagari} \main hello world 1234567890 {\deva निरंजन ल श} \bye When I run the exact same code multiple times (with the same terminal command, i.e., luatex test.tex), I sometimes get: which is incorrect. Sometimes I get: which is partly correct (the special linguistic forms of Marathi are not rendered). Sometimes, with the same code, I have gotten the following which is fully correct: I mean, what? I chose this particular MWE because this is a typical setup in most of my PDF files. NewCM10-Book with old style numbers and old style one (provided by +cv06) and Mukta-Light for Marathi text. I added the features on purpose to show that in both the screenshots, multiple features are working correctly for NewCM10, but in some compilations, it is breaking for Mukta. I compared the log of both correct and incorrect output and the only difference was in the byte size reported by "Output written on test.pdf (1 page, 17621 bytes)". Rest everything was okay. What exactly could be happening? Note that this is happening with a fully updated TeX Live 2026 on a GNU Linux machine.

  • "(Continued)" text should come at the end of page tcolorbox
    by MadyYuvi on July 15, 2026 at 9:50 am

    I need a breaking box with all side frames even it breaks, I tried with \documentclass{book} \usepackage[most,skins,breakable]{tcolorbox}% \tcbuselibrary{skins,breakable}% \tcbset{enhanced,breakable}% \usepackage{lipsum} \begin{document} \begin{tcolorbox}[enhanced,colback=white,colframe=black!80,arc=9pt, skin first=enhanced, skin middle=enhanced, skin last=enhanced, ]% \sffamily\normalsize% \lipsum[1-5] \end{tcolorbox} \end{document} This produced the output as: But, need to add the text (Continued) at the end of page when the box breaks

  • Using expl3 syntax in my command. How to fix my code that uses a command to set fonts for foreign scripts in math mode in LuaLaTeX?
    by Sageof6Paths on July 14, 2026 at 4:59 pm

    From my previous question here, I wanted a way to be able to write foreign scripts directly in math mode in LuaLaTeX while having different fonts for rm, sf, and tt. niru's answer provided what I wanted, but I wanted to wrap it all in a command like egreg's answer. When I rewrote niru's answer in the style of egreg's, foreign fonts don't render in text mode. I believe the problem lies here: \babelfont[#1]{rm}[NFSSFamily = {#1rm},#3]{#2} \babelfont[#1]{sf}[NFSSFamily = {#1sf},#5]{#4} \babelfont[#1]{tt}[NFSSFamily = {#1tt},#7]{#6} Anyhow, here is the code I'm using: \documentclass{article} \usepackage{babel} \usepackage{unicode-math} \usepackage{xcolor} \ExplSyntaxOn % Resetting math fonts with \rmfamily \hook_gput_code:nnn { cmd / rmfamily / before } { . } { % English \mathversion { rm } } % Resetting math fonts with \sffamily \hook_gput_code:nnn { cmd / sffamily / before } { . } { % English \mathversion { sf } } % Resetting math fonts with \ttfamily \hook_gput_code:nnn { cmd / ttfamily / before } { . } { % English \mathversion { tt } } \hook_gput_code:nnn { begindocument / end } { . } { \mathversion { rm } } % \enableblockformath{symbolic name}{rm font}[rm further options]{sf font}[sf further options]{tt font}[tt further options]{blocks} \NewDocumentCommand{\enableblockformath}{mmO{}mO{}mO{}m} {% #1 = symbolic name % #2 = rm font % #3 = rm further options % #4 = sf font % #5 = sf further options % #6 = tt font % #7 = tt further options % #8 = blocks % Loading language \babelprovide[import,onchar={ids fonts}]{#1} % Loading fonts \babelfont[#1]{rm}[NFSSFamily = {#1rm},#3]{#2} \babelfont[#1]{sf}[NFSSFamily = {#1sf},#5]{#4} \babelfont[#1]{tt}[NFSSFamily = {#1tt},#7]{#6} % Resetting math fonts with \rmfamily \hook_gput_code:nnn { cmd / rmfamily / before } { . } { \clist_map_inline:nn {#8} { \__egreg_blocksformath:nnn {#1} {##1} {rm} } } % Resetting math fonts with \sffamily \hook_gput_code:nnn { cmd / sffamily / before } { . } { \clist_map_inline:nn {#8} { \__egreg_blocksformath:nnn {#1} {##1} {sf} } } % Resetting math fonts with \ttfamily \hook_gput_code:nnn { cmd / ttfamily / before } { . } { \clist_map_inline:nn {#8} { \__egreg_blocksformath:nnn {#1} {##1} {tt} } } \hook_gput_code:nnn { begindocument / end } { . } { \clist_map_inline:nn {#8} { \__egreg_blocksformath:nnn {#1} {##1} {rm} } } \DeclareSymbolFont{#1rm}{TU}{#1rm}{m}{n} \DeclareSymbolFont{#1sf}{TU}{#1sf}{m}{n} \DeclareSymbolFont{#1tt}{TU}{#1tt}{m}{n} } \cs_new_protected:Nn \__egreg_blocksformath:nnn { \seq_set_split:Nnn \l_tmpa_seq {-} {#2} \int_step_inline:nnn {\seq_item:Nn \l_tmpa_seq {1}} {\seq_item:Nn \l_tmpa_seq {2}} { \Umathcode ##1 = "0 ~ \use:c {sym#1#3} ~ ##1 } } \ExplSyntaxOff \babelprovide[import,main,onchar={ids fonts}]{english} \babelfont{rm}[Color = {red}]{NewCM10-Book.otf} \babelfont{sf}[Color = {green}]{NewCMSans10-Book.otf} \babelfont{tt}[Color = {blue}]{NewCMMono10-Book.otf} \setmathfont[version = {rm}, Color = {red}]{NewCMMath-Book.otf} \setmathfont[version = {sf}, Color = {green}]{NewCMSansMath-Regular.otf} \setmathfont[version = {tt}, Color = {blue}]{NewCMSansMath-Regular.otf} \enableblockformath{japanese}{HaranoAjiMincho-Regular.otf}[Color = {red}]{HaranoAjiGothic-Regular.otf}[Color = {green}]{HaranoAjiGothic-Regular.otf}[Color = {blue}]{"3040-"30FF,"4E00-"9FFF} \enableblockformath{thai}{NotoSerifThai-Regular.ttf}[Color = {red}]{NotoSansThai-Regular.ttf}[Color = {green}]{NotoSansThai-Regular.ttf}[Color = {blue}]{"0E00-"0E7F} \begin{document} English language ภาษาไทย 日本語 $x+y=ก+ข=あ+い$ \sffamily English language ภาษาไทย 日本語 $x+y=ก+ข=あ+い$ \ttfamily English language ภาษาไทย 日本語 $x+y=ก+ข=あ+い$ \end{document}

  • Is possible using Rscript in listings with tcolorbox combined with listings (code/in AND execution/out)?
    by Mika Ike on July 14, 2026 at 7:43 am

    With tcolorbox you can code LaTeX and shot the result, as you can see in the first box. Is that possible with Rscript?. \documentclass[12pt]{article} \usepackage{geometry} \usepackage{parskip} \usepackage{amsmath,mathtools} \usepackage{tcolorbox} \tcbuselibrary{listings} \tcbset{listing engine=listings} \tcbuselibrary{minted} \begin{document} \begin{tcblisting}{colback=red!5!white,colframe=red!75!black} This is a \LaTeX\ example which displays the text as source code and in compiled form. \hfill $x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}$ \end{tcblisting} %\tcbset{listing engine=Rscript} \begin{tcblisting}{colback=red!5!white,colframe=red!75!black}[language=Rscript] a<-sample(1:24,5,replace=TRUE) mean(a) barplot(a) \end{tcblisting} \end{document}

  • how to make local table of contents using etoc all start without shifting to the right?
    by Nasser on July 14, 2026 at 4:00 am

    I am not using \cftsubsubsecindent 0pt so the following question did not help me figure why How to correctly indent a local table of contents with etoc? This is my MWE \documentclass[12pt,titlepage]{article}% \usepackage[titles]{tocloft} \usepackage{etoc} \newcommand{\makeLocalSectionToc} { \begingroup % Keeps layout changes isolated to just this local TOC \etocsetnexttocdepth{2} \etocsettocstyle{}{}% Completely removes "Local contents" and saves space \localtableofcontents \endgroup % Restores standard settings immediately after printing } \newcommand{\makeLocalSubsectionToc} { \begingroup % Keeps layout changes isolated to just this local TOC \etocsetnexttocdepth{3} \etocsettocstyle{}{}% Completely removes "Local contents" and saves space \localtableofcontents \endgroup % Restores standard settings immediately after printing } \newcommand{\makeLocalSubsubsectionToc} { \begingroup % Keeps layout changes isolated to just this local TOC \etocsetnexttocdepth{4} \etocsettocstyle{}{}% Completely removes "Local contents" and saves space \localtableofcontents \endgroup % Restores standard settings immediately after printing } \begin{document} \section{First order differential equations}% \makeLocalSectionToc \subsection{Algorithm charts} \makeLocalSubsectionToc \subsubsection{First chart}% \makeLocalSubsubsectionToc \paragraph{A} text \paragraph{B} text \end{document} compiled with lualatex Is the way the commands are defined not correct? Update Thanks to answers below. Here is the after and before result. I find having local toc's start at same offset better to look at it. Ofcourse this is personal choice. Someone else might think the way it was looks better. This uses \setlength{\cftparaindent}{20pt} for everyting.

  • Text overflowing in tabular cell with makecell
    by Matias Aznar on July 13, 2026 at 11:05 pm

    I'm creating a table in LaTeX with images and multi-line text in one column. The text in the "Observaciones" (Observations) column is overflowing outside the table boundaries and not wrapping properly within the cell. The third row's text wraps correctly, but the first two rows' text extends beyond the table width. I'm using \makecell[l] but it's not containing the text properly. How can I ensure the text stays within the cell boundaries and wraps properly regardless of content length? All rows should align at the top with text contained within the column width. The images sizes are 1257x1262 px \documentclass{article} \usepackage{geometry} \usepackage{makecell} \usepackage{graphicx} \geometry{ letterpaper, margin=3cm } \setlength{\marginparwidth}{2cm} \begin{document} \begin{table}[H] \centering \small \begin{tabular}{ >{\raggedright\arraybackslash}m{2cm} >{\centering\arraybackslash}m{3.4cm} >{\centering\arraybackslash}m{3.4cm} >{\raggedright\arraybackslash}m{6cm} } \hline \textbf{Fase} & \textbf{$L_1$} & \textbf{$L_3$} & \textbf{Observaciones} \\ \hline Poros & \includegraphics[width=3.3cm]{example-image} & \includegraphics[width=3.3cm]{example-image} & \makecell[tl]{ $N$: 127,090\\ $P_j$: 1.52\\ $T_G$: -1.16\\ Fuerte linealidad vertical } \\ \hline Óxido & \includegraphics[width=3.3cm]{example-image} & \includegraphics[width=3.3cm]{example-image} & \makecell[tl]{ $N$: 2,228\\ $P_j$: 1.09\\ $T_G$: -0.18\\ Débil anisotropía } \\ \hline Plagioclasa & \includegraphics[width=3.3cm]{example-image} & \includegraphics[width=3.3cm]{example-image} & \makecell[tl]{ $N$: 1,065\\ $P_j$: 1.29\\ $T_G$: -0.73\\ Orientación preferencial moderada sin embargo, se concentra en el eje Z } \\ \hline \end{tabular} \caption{Análisis de orientación de fases de la muestra L187.} \label{tab:stereonets_l187} \end{table} \end{document}

  • Hollowed-out sphere effect
    by Sebastiano on July 13, 2026 at 10:49 pm

    How can I obtain the hollowed-out sphere effect? The drawing above is my original done many years before. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, calc, positioning, shapes.geometric} \begin{document} \begin{tikzpicture}[ scale=1.2, axis/.style={thick, ->} ] \coordinate (O) at (0, 0); \coordinate (X) at (-2, -2.3); \coordinate (Y) at (5.5, 0); \coordinate (Z) at (0, 4); \coordinate (P) at (3.1, 1.3); \draw[axis] (O) -- (X) node[left, font=\large, xshift=-3pt] {$x$}; \draw[axis] (O) -- (Y) node[below, font=\large, yshift=-3pt] {$y$}; \draw[axis] (O) -- (Z) node[left, font=\large, xshift=-3pt] {$z$}; \begin{scope} \shade[ball color=gray!30!white, opacity=0.85] (O) circle (0.9); \draw[gray!60, thin] (O) circle (0.9); \fill[gray!60!black, opacity=0.9] plot[smooth cycle, tension=0.7] coordinates { ($(O)+(-0.2, 0.4)$) ($(O)+(0.5, 0.5)$) ($(O)+(0.6, -0.4)$) ($(O)+(0.1, -0.6)$) ($(O)+(-0.3, -0.3)$) }; \shade[inner color=black!80, outer color=gray!70!black, opacity=0.5] plot[smooth cycle, tension=0.7] coordinates { ($(O)+(-0.2, 0.4)$) ($(O)+(0.5, 0.5)$) ($(O)+(0.6, -0.4)$) ($(O)+(0.1, -0.6)$) ($(O)+(-0.3, -0.3)$) }; \end{scope} \fill[black] (O) circle (0.07) node[below, yshift=-4pt, font=\large] {$O$}; \draw[->, >=Stealth, shorten >= 2.5pt, shorten <= 2pt] (O) -- (P) node[midway, above, yshift=2pt, font=\large] {$r$}; \fill[black] (P) circle (0.08) node[above, yshift=3pt, font=\large] {$P$}; \node[right, font=\Large\itshape, xshift=2pt, yshift=-2pt] at (P) {$m$}; \node[below, font=\large] at (0.2, -0.95) {$M$}; \end{tikzpicture} \end{document}

  • Why does cycle produce a diagonal?
    by D G on July 13, 2026 at 7:11 pm

    I don't understand why there is a diagonal. \documentclass[tikz,border=12pt]{standalone} \begin{document} \begin{tikzpicture} \node [draw=red] (A) at (1,1) {A}; \draw (0,0) |- (A) |- cycle; \end{tikzpicture} \end{document} Expected output \begin{tikzpicture} \node [draw=red] (A) at (1,1) {A}; \draw (0,0) |- (A) |- (0,0); \end{tikzpicture} Edit Considering the following code. \begin{tikzpicture} \node [draw=red] (A) at (1,1) {A}; \draw (0,0) |- (A) |- cycle; \end{tikzpicture} Suppose there were two separate paths within a single \draw command: first path: (0,0) |- (A.west) second path: (A.south) |- cycle In that interpretation, cycle seems to have two contradictory behaviors: It remembers (0,0) from the first path and uses it as the destination of |- in the second path. However, it also treats (A.south) as the starting point of the second path instead of (0,0). Am I misunderstanding how cycle is supposed to work?

  • texlive 2026 make4ht input.tex "mathml,mathjax" rendering fails for user-defined macros
    by krone on July 13, 2026 at 2:38 pm

    Using texlive 2025 (distributed by archlinux) user-defined macros are rendered 'correctly' calling make4ht -ul test.tex "mathml,mathjax" With texlive 2026 (again archlinux package) and the same call, some things render correctly and others don't. MWE: \documentclass{article} \usepackage{siunitx} \usepackage{amssymb} \newcommand{\ilfrac}[2]{{}\sp{#1}\!/\!\sb{#2}} \newcommand{\ft}{\mathop{\mathcal{FT}}} \newcommand{\ift}{\mathop{\mathcal{FT}\sp{-1}}} \begin{document} %%% first equation %%% \[ \ift{\left[a(x)\right](f)} \] %%% second equation %%% \[ \ft \neq \ift \] %%% third equation %%% \[ \ift \neq \ft \] %%% fourth equation %%% \[ \chi(f) = \ift{\left[a(x)\right](f)} = \int_{-\infty}^{\infty} a(x) \exp{\left[i 2 \pi x f \right]} dx \] %%% fifth equation %%% \[ \ilfrac{a}{b} = \qty{3}{\mm} \] \end{document} In the above, the first, third and fourth equations render correctly, while the second displays as 'Math input error' (unexpected text node -1) and the fifth renders 'msup'. I do get a domfilter warning about an Unbalanced Tag (/msup). If I comment out the fifth equation this warning is suppressed, but the second equation still displays 'Math input error'. I can do more test but am unsure where to start. Edit As per my comments below and to the solution from Michael.h21 I've dug further into the problem. It turns out that in my real document, near all the maths were rendered as 'Math Input Error' due to how I (re)-configure \chapter to include an image file. I've created an MWE with a test.tex file: \documentclass{book} \usepackage{graphicx} \makeatletter \global\let\loutcme\@empty \global\let\expphoto\@empty \newcommand{\loutcome}[1]{\gdef\loutcme{#1}} \newcommand{\experimentphoto}[1]{\gdef\expphoto{#1}} \makeatother \begin{document} \loutcome{This is the learning outcome} \experimentphoto{./path/to/pdf/or/png/or/jpeg} \chapter{A test} \section{A section in the chapter} \[ a = b \] \end{document} and a test.cfg file \Preamble{xhtml,mathml,mathjax} \Configure{chapter} {\ifvmode\IgnorePar\fi\EndP\HCode{<section class="chapter">}} {\ifvmode\IgnorePar\fi\EndP\HCode{</section>}} {% \ifvmode\IgnorePar\fi\EndP\HCode{<div class="expphoto">} %%% The line below is the culprit %%% %%% If it is commented out and 'some text' is commented in %%% %%% the conversion renders the subsequent equation w/o error %%% \ifvmode\IgnorePar\fi\EndP\includegraphics{\expphoto} % Some text. \ifvmode\IgnorePar\fi\EndP\HCode{</div>} \ifvmode\IgnorePar\fi\EndP\HCode{<h2 class="chapterHead">} \TitleMark \HCode{<br />}} {\HCode{</h2>} \ifvmode\IgnorePar\fi\EndP\HCode{<div class="learningoutcome">}\par\ShowPar \loutcme \ifvmode\IgnorePar\fi\EndP\HCode{</div><br />}\par\ShowPar} \Css{.learningoutcome { font-family: sans-serif; padding-top: 1ex; padding-bottom: 1ex; border-top-style: solid; border-bottom-style: solid; }} \Css{.expphoto img { width: 100\%; aspect-ratio: 5 / 2; object-fit: cover; } } \begin{document} \EndPreamble and make4ht is called with make4ht -l -c test.cfg test.tex "mathml,mathjax" I've liberally applied \ifvmode\IgnorePar\fi trying to avoid warnings, but admit I have no idea if I am doing this correctly. To summarize: using \includegraphics in the configuration of the chapter makes subsequent math(jax) render as 'Math Input Error'. Thanks for your attention.

  • Automate adding to pdf outline but hiding from toc
    by Zlog on July 13, 2026 at 11:36 am

    Below is my MWE: \documentclass{article} \usepackage{hyperref} \newcommand{\nocontentsline}[3]{} \newcommand{\tocless}[2]{\bgroup% \let\addcontentsline=\nocontentsline#1{#2}% \egroup} \begin{document} \tableofcontents \newpage \section{test} \subsection{test1} \subsubsection{test2} \subsubsection{test3} \subsection{test4} \pdfbookmark[3]{test5}{mark1} \tocless\subsubsection{test5} \subsection{test6} \section{test7} \tocless\subsection{test8} \newpage a \end{document} The code above makes the toc without sections (and sub...sections) that have \tocless command before them. Thanks to \pdfbookmark subsubsection "test5" appears in pdf outline. I want to have it automatically bookmarked in \tocless, I think I would need to add a counter and the like (to increment "mark1"). However the most difficult part is [3] in \pdfbookmark, as it needs to be appropriate for command (subsection -> 2, subsubsection -> 3). I think my question boils down to: Can I - from command (subsection, subsubsection) - get correct number (2, 3). If not, is it possible at all to automate adding it to pdf outline without appearing in toc. In my use case documentclass is set to book, however I am interested in broader picture if possible.

  • CJK fonts not working without \text{}
    by Climber of Mount. LaTeX on July 13, 2026 at 10:34 am

    Sorry if anything I ask or provide is inappropriate; I am new to TeX Stack Exchange. I am writing a Traditional Chinese LaTeX document. Sometimes I will need commentary in either align or equation, which is, of course, in Chinese. I usually use \text{} for the commentary, but they look cluttered and hard to read. However, removing the \text{} around the commentary simply makes the commentary disappear in the output. Is there a workaround? Re-defining \text{} won't help me, 'cause it'll still look cluttered. For reference I am on https://overleaf.com, using XeLaTeX. \documentclass{article} \usepackage{xeCJK} \setCJKmainfont{Noto Sans CJK TC} \usepackage{amsmath} \begin{document} This works: \begin{align} 1 + 1 &= 2 \text{ 一個人和一隻狗合起來是兩個東西}\\ 2 + 3 &= 5 \text{ 兩個人和三隻狗合起來是五個東西} \end{align} This doesn't: \begin{align} 1 + 1 &= 2 \quad 一個人和一隻狗合起來是兩個東西\\ 2 + 3 &= 5 \quad 兩個人和三隻狗合起來是五個東西 \end{align} \end{document} EDIT By "cluttered" I mean the code, not the output. Also, I would like to clarify that without \text{}, the commentary simply doesn't get displayed in the output at all, and I am looking for a way to de-clutter my code while getting the output to also work. UPDATE @Explorer suggested that I use LuaLaTeX to compile, but free Overleaf only gives 20 seconds of compile time, and LuaLaTeX exceeds that time even for small documents. Is there a workaround? Or do I have to stick to cluttered code?

  • Glitch with the UnderWavy example in `lua-ul` package?
    by Explorer on July 13, 2026 at 10:09 am

    I have the following code example taken from texdoc lua-ul: \documentclass{article} \usepackage[paperheight=5cm,paperwidth=10cm]{geometry} \usepackage{lipsum} \usepackage{xcolor,luacolor} \usepackage[soul]{lua-ul} \newunderlinetype\beginUnderWavy[\number\dimexpr1ex]{\cleaders\hbox{% \setlength\unitlength{.3ex}% \begin{picture}(4,0)(0,1) \thicklines \color{magenta}% \qbezier(0,0)(1,1)(2,0) \qbezier(2,0)(3,-1)(4,0) \end{picture}% }} \NewDocumentCommand\underWavy{+m}{{\beginUnderWavy#1}} \pagestyle{empty} \begin{document} \lipsum[2][1-5] \underWavy{Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world} \lipsum[2][1-3] \end{document} However, when we zoom in, there exists glitch, but in texdoc lua-ul, the wavyline were smooth? Is this a bug or feature? Or maybe I missed some parameters setting?