• How to add fermata symbol to metre package?
    by rensemil on February 3, 2026 at 11:10 am

    I am using the package metre. It has the environment \metra{} used for typesetting latin (and greek) metre notation. This environment has almost all the special characters I need, except one: I need a character that looks somewhat like a fermata 𝄐 but preferrably in the same style as the other metrical symbols. This could, I believe, be achieved by simply taking the character breve that is produced by \documentclass{article} \usepackage[en]{metre} \begin{document} \metra{\a\m\b\bm} \end{document} and have it flipped upside down and a dot put underneath. In a book, this is what it looks like: It's the last symbol of each of the lines in the box. Does anyone know how this could be achieved? I even tried contacting the package's creator but his email address does not seem to exist anymore. My MWE produces the symbols in this picture (the ones inside the brackets): Thanks in advance!

  • How to make nested tabularx work
    by user2609605 on February 3, 2026 at 10:00 am

    Example: \documentclass[a4paper]{article} \overfullrule=10mm \usepackage{tabularx} \begin{document} \maketitle This document is for experimenting around \texttt{tabularx}. \begin{tabularx}{\linewidth}{|XX}%p{5cm} \begin{minipage}{\linewidth} \begin{tabularx}{\linewidth}{|X}% long text to be \newline long text to be \newline long text to be \newline long text to be \newline long text to be \newline % \the\hsize % \the\linewidth % \the\textwidth long text to be \end{tabularx} \end{minipage} & %\begin{tabularx}{0.25\linewidth}{|X}% 2nd %\end{tabularx} \end{tabularx} \end{document} results in: ! Extra }, or forgotten \endgroup. \TX@trial ...er \tabular \the \toks@ \endtabular } \TX@ckpt \TX@typeout@ {\@s... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ...\csname endtabular*\endcsname } \global \TX@ftn \expandaft... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ... }\the \TX@ftn \ifnum 0=`{\fi } \expandafter \expandafter ... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \@endpbox ...trutbox \par \color@endgroup \egroup \hfil l.80 \end{tabularx} ! Missing \endgroup inserted. <inserted text> \endgroup l.80 \end{tabularx} ... If I replace the inner tabularx by tabular (dropping \linewidth and changing X) it works. I would even like to use without minipage, but that it does not work with minipage, it means that minipage encapsulation is not very strict. I will have a look I think I remember an example where nested tabularx worked.

  • Scoping the value of a l3keys option to the place it is used (part 2)
    by Denis Bitouzé on February 3, 2026 at 8:32 am

    (Sorry again for the vague title of this question (which is a follow-up of another question of mine), I can't think of a more appropriate one.) Suppose I'd like to augment the key set of keytheorems with a Title key which isn't exactly an alias of its title (or its alias name) key but which makes uppercase the first character of its value before passing it to keytheorems' title (or name). In the following MCE, I rely for this on an auxiliary token list which, unfortunately, is not limited to the definition of each defined theorem: only the last value it took is used each time one of the defined theorems is used, so instead of: Abc 1. Foo. Xyz 1. Baz. I get: Xyz 1. Foo. Xyz 1. Baz. How can I work around this problem? \documentclass{article} \usepackage{keytheorems} \ExplSyntaxOn \keys_define:nn { keytheorems/thm } { Title .code:n = { \tl_set:Nn \l_tmpa_tl {\text_titlecase_first:n{#1}} \keys_set:nn { keytheorems/thm } { name=\l_tmpa_tl} } } \NewDocumentCommand{\mynewtheorem}{O{} m} { \newkeytheorem{#2}[#1] } \ExplSyntaxOff \mynewtheorem[Title=abc]{foo} \mynewtheorem[Title=xyz]{baz} \begin{document} \begin{foo} Foo. \end{foo} \begin{baz} Baz. \end{baz} \end{document}

  • Drawing a crystal latice with tikz
    by Nicolas on February 2, 2026 at 9:27 pm

    I'd like to draw crystal structures using TikZ-3Dplot'''. I saw that solutions exist with Asymptote, but for some reason, I can't install it (and I admit I had trouble understanding how the package works). I started with TikZ 3D Plot, which seems to work. I just have one question: I can't keep some lines horizontal, which I find unsightly (I've tried several angle values ​​in the command \tdplotsetmaincoords, but without success). \documentclass{standalone} \usepackage{tikz,tikz-3dplot} \usepackage{xcolor} \begin{document} \tdplotsetmaincoords{75}{10} \begin{tikzpicture}[tdplot_main_coords, scale = 5] % ---- Tracé des traits du réseau ---- \draw[thin] (0,0,0) -- (1,0,0) -- (1,1,0) -- (0,1,0) -- (0,0,0); \draw[thin] (0,0,1) -- (1,0,1) -- (1,1,1) -- (0,1,1) -- (0,0,1); \draw[thin] (0,0,0) -- (0,0,1); \draw[thin] (1,0,0) -- (1,0,1); \draw[thin] (1,1,0) -- (1,1,1); \draw[thin] (0,1,0) -- (0,1,1); \tdplottransformmainscreen{0}{0}{0} \shadedraw[tdplot_screen_coords, ball color = blue] (\tdplotresx,\tdplotresy) circle (0.10); \end{tikzpicture} \end{document}

  • How to fade the background image with multiple opacity?
    by Explorer on February 2, 2026 at 5:58 pm

    I have the following code to add background for the document: \documentclass{article} \usepackage{lipsum} \usepackage{geometry} \usepackage{graphicx} \usepackage{tikz,tikzpagenodes} \usetikzlibrary{calc,fadings} \AddToHook{shipout/background}{ \begin{tikzpicture}[remember picture,overlay] \node[ % path fading=north, inner sep=0pt,outer sep=0pt, anchor=south,opacity=.3, ] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % \path[path picture={ % \node[inner sep=0pt,outer sep=0pt,anchor=south,scope fading=south] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % }]; \coordinate (L) at ($(current page.north west)!.5! (current page text area.north west)$); \coordinate (R) at ($(current page.south east)!.5! (current page text area.south east)$); \fill[white,opacity=.5] (L) rectangle (R); \end{tikzpicture} } \begin{document} \lipsum[1-6] \end{document} It produced: However, the intersection border's color transformation is too sharp! I want the image could smoothly fade to white, with multiple opacity, I have consulted this link, but it doesn't work. The bg.png could be accessed as below(maybe example-image is okay, but its background is pure gray, I would prefer to show that on bg.png):

  • How to resume an enumitem list at lower level
    by mm96 on February 2, 2026 at 4:52 pm

    Similar to this question: similar question I don't know, why the 'resume*=series' approach does not work here. \documentclass{scrartcl} \usepackage{enumitem} \begin{document} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[leftmargin=*] \item asdfg \item afhaf \begin{enumerate}[series=_test] \item adslfa \item adsfadsf \end{enumerate} \end{enumerate} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[resume*=_test] \item adfa \end{enumerate} \end{document}

  • Bug or feature: unexpected behavior of \bar with subscript first and superscript second
    by user470904 on February 2, 2026 at 1:28 pm

    As a physicist, I often need to typeset tensor indices where it matters whether the subscript is to the left or to the right of the superscript. My usual solution is to use {t_A}^B, which puts the superscript B to the right of the subscript A, compared to t_A^B which puts the superscript B vertically aligned with the subscript A. However, I recently noticed that if I use \bar{t} or \tilde{t} instead of t above, the output no longer differs whether I enclose the (xxx)_A part with braces or not. But, \overline{t} still behaves as I expect. Then I tried \widetilde{t}, which still ignores the braces. Is this a bug or a feature? If it's a feature, how should I classify which commands ignore the braces and which do not? In particular, is there a "tilde" command that behaves like \overline that can put the superscript to the right of the subscript? Minimal working example: \documentclass{article} \begin{document} \begin{equation} \begin{array}{lllll} t_A^B & \tilde{t}_A^B & \widetilde{t}_A^B & \bar{t}_A^B & \overline{t}_A^B \\ {t_A}^B & {\tilde{t}_A}^B & {\widetilde{t}_A}^B & {\bar{t}_A}^B & {\overline{t}_A}^B \end{array} \end{equation} \end{document} Output:

  • Spacing with mathematical symbols in brakets
    by Danya Zh on February 1, 2026 at 9:38 pm

    In the braket package I have noticed a spacing issue with mathematical operators; plus and minus symbols after | will be treated as binary operators, even if they represent an ordinary operator. For example $\braket{+45|+45}$ will have no spacing for the first + symbol (treated as class 0), but will have the operator spacing for the second + symbol (treated as class 2). \documentclass{article} \usepackage{braket} \begin{document} How can we fix spacing in $\braket{+45|+45}$ without invoking \verb+\!+ \end{document} I would like to have a solution that does not involve inline spacing fixes. I am confident that the command can be redefined in a way that would resolve this issue.

  • How to transform canvas with `grid` and not to affect the `node`'s content at the same time?
    by Explorer on February 1, 2026 at 5:24 pm

    Description As the successor of my prevoius not-supported l3draw attempt, I try with plain-tikz: \documentclass[tikz,border=5pt]{standalone} \usepackage{mathpazo} \usepackage{amsmath} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}, ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}] \fill[orange!10] (-2,-2) rectangle (5,5); % \draw[orange] (-2,-2) grid (5,5); \foreach \i in {-2,-1,...,5} {\draw[orange] (\i,-2) -- ++(0,7) (-2,\i) -- ++(7,0);} \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ transform canvas={cm={1.5, 0.5, 0.5, 2, (0,0)}} ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \end{document} Here, I have three proposals: FIRST: the grid doesn't transform by x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}. SECOND: the manual \foreach gives what I want, but I don't think manually mimic what feature grid do is the best practice. THIRD: with transform canvas, it affected the grid, but all on the canvas, the text and arrow are both sheared, that is not I want. Question: Is there better approach without manually plot the grid? I would make good use of feature grid in my case as possible.

  • In 2026, what kind of plot requirement is suitable with `l3draw`(such as "arrow")?
    by Explorer on February 1, 2026 at 3:38 pm

    I want to mimic the following figure with l3draw, the \draw_transform_matrix:nnnn feature to apply transformation matrix. Here below is my attempt: \documentclass[border=5pt]{standalone} \usepackage{l3draw} \usepackage{amsmath} \begin{document} \ExplSyntaxOn \draw_begin: \color_set:nnn { orange } {RGB} {255, 128, 0} \draw_scope_begin: \draw_transform_matrix:nnnn { 2.5 } { 0.5 } { 0.5 } { 3 } \draw_set_cap_round: \draw_path_rectangle_corners:nn { -5mm , -5mm } { 35mm , 35mm } \color_fill:n { orange!15 } \draw_path_use_clear:n { fill } \draw_path_grid:nnnn { 1cm } { 1cm } { -5mm , -5mm } { 35mm , 35mm } \color_stroke:n { orange } \draw_path_use_clear:n { stroke, fill } \draw_set_linewidth:n { .1cm } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 0cm, 1cm } \draw_path_use_clear:n { stroke } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 1cm, 0cm } \draw_path_use_clear:n { stroke } \color_stroke:n { black } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 2cm, 2cm } \draw_path_use_clear:n { stroke } \draw_scope_end: \draw_end: \ExplSyntaxOff \end{document} My question is: Is that possible to plot the image of "arrow" in l3draw's code framework? In 2026, when to choose l3draw? (I found that there are only 17 posts on this site was tagged l3draw since now) By reading the post on this site, l3draw is more used to constuct symbols(without arrow), or apply some transformations with l3box.... (Notes: I don't think my second question is a quite different one, in my state now, it's quite natural to ask if some features didn't provide by l3draw, while I have written the code shown above) Edited: Since Joseph has commented that: Currently arrows are not implemented, partly as I've not had a need to do it - the priority is really to get the code stable ATM I still wonder what kind of plotting requirement is suitable to play with l3draw in the current state(2026.02)?

  • Write the "gradings" under a map
    by Jinwen on February 1, 2026 at 11:43 am

    How should one write the term-by-term "grading" under the equation, as in the following pictures? There should be various ways to achieve this. But at least, I would like to know how to do this in the usual situation, and with tikz-cd. Here is an example code of the above two equations: \documentclass{article} \usepackage{mathtools,amssymb,tikz-cd} \def\A{\mathbb{A}} \begin{document} Situation 1 (2 places): \[ H_X \colon [X \times \A^1] \to [X] \] Situation 2 (3 places): \[ [U \cap V] \xrightarrow{[j']-[i']} [U] \oplus [V] \xrightarrow{[i]+[j]} [X] \] Situation 2' (with \texttt{tikz-cd}): \[ \begin{tikzcd}[column sep=large] {[U \cap V]} & {[U] \oplus [V]} & {[X]} \arrow["{[j']-[i']}", from=1-1, to=1-2] \arrow["{[i]+[j]}", from=1-2, to=1-3] \end{tikzcd} \] \end{document}

  • Drawing a pulley system
    by Fatai Bakare on February 1, 2026 at 8:32 am

    I need to draw a pulley system as in the figure. How can I do that? Specific information about the figure: A block of mass Mo is on a horizontal surface and attached by a string to a hanging block, also of mass Mo , as shown in the figure. Friction between the block and the horizontal surface is negligible. The masses of the string and pulley are negligible, and the pulley can rotate with negligible friction around its axle.

  • Redefine `\item` so its first "argument" is a full word
    by mathbekunkus on February 1, 2026 at 5:37 am

    I defined a Tikz macro and I want to use it so the item of an inline itemize is passed as its argument. So far, my solution is this: \documentclass{article} \usepackage[inline]{enumitem} \usepackage{tikz} \newcommand\itemvalue[1]{ \tikz[baseline=(o.base)] { \node[ inner xsep=0pt, inner ysep = 1pt, outer xsep=2pt, outer ysep=2pt ] (o) at (0,0) {\textcolor{blue!80!black}{\fontsize{10}{16}\textbf{#1}}}; \draw[color=gray!50, thick] ([xshift=(-1.3)]o.south west) -- ([xshift=(1.3)]o.south east); } } \begin{document} \let\olditem\item \renewcommand\item[1]{\olditem\itemvalue{#1}} \begin{itemize*}[label={}, labelsep=2em, parsep=2ex] \item {First} \item {Second} \item {Third} \end{itemize*} \end{document} The output looks like this: This is what I want but I was wondering if there was a way of redefining \item so it reads the full word (not only its first letter). If I remove the braces on each item, the output looks like this: This makes sense as far as I can tell how \item works, but I'd like a workaround that doesn't use braces on each item. Thanks!

  • Wrapping a circle on a torus
    by M. Al Jumaily on February 1, 2026 at 4:19 am

    I have used the sample code from latexdraw that draws a torus. I am trying to draw a filled circle and a dashed circle where they should be wrap around the torus instead of being drawn uniformly at z=0. I am looking for a TikZ solution. The closest I have seen is this solution but it is too difficult for me to decipher. Any help would be appreciated! \documentclass[margin=4pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz-3dplot} \usepgfplotslibrary{colormaps} \pgfplotsset{ compat=newest, colormap={manifoldmap}{color=(lightgray) color=(white) color=(lightgray)} } \begin{document} \begin{tikzpicture} \def\R{2.75} % Major radius (distance from torus centre to tube centre) \def\offset{0.5} % Radial displacement from the torus centre circle \def\thetaB{2.5} % Angular position (in radians) for highlighted point \begin{axis}[ width=12cm, axis equal image, hide axis, z buffer=sort, view={125}{35}, clip=false ] % Parametric torus equations: % x = (R + cos(x)) cos(y) % y = (R + cos(x)) sin(y) % z = sin(x) \addplot3[ surf, shader = faceted interp, samples = 30, samples y = 40, domain = 0:2*pi, domain y = 0:2*pi, colormap name = manifoldmap, thin, opacity=0.75 ] ( {(\R + cos(deg(x))) * cos(deg(y))}, {(\R + cos(deg(x))) * sin(deg(y))}, {sin(deg(x))} ); \begin{scope}[canvas is xy plane at z=0, transform shape] \coordinate (p) at ({(\R + \offset) * cos(deg(\thetaB))}, {(\R + \offset) * sin(deg(\thetaB))}); \draw[fill=red, draw=none] (p) circle (4pt); \draw[blue, dashed, thick] (p) circle (16pt); \end{scope} \end{axis} \end{tikzpicture} \end{document}

  • The choice between pdflatex and xelatex, and the use of newcomputermodern
    by Ho Man-Ho on January 31, 2026 at 9:07 am

    Let me provide some background for my question: I am compiling a latex project, which involves a main tex file and more than 100 other tex files with no figures (except for a few simple diagrams) or pictures. The resulting pdf file has more than 600 pages. Initially, I was using pdflatex and newtxtext for font. However, recently I am more inclined to use NewComputerModern, in particular I like the slightly thicker font. As we know, to use NewComputerModern, we must either use xelatex or luatex. I chose xelatex because it seems to be slightly faster than using luatex, but it is slower than pdflatex. So I ended up spending more time for compilation, especially when I am editing the tex files for the pages of the end of the pdf file. The packages I am using are: amsfonts, amsmath, amscd, amssymb, euscript, amsthm, fancyhdr, pgf, tikz, pgfplots, caption, subcaption, enumitem, thmtools, color, centernot, mathtools, afterpage, amsbsy, systeme, sectsty, multirow, float, tikz-cd, etoolbox, microtype, mathrsfs, fontspec, fncychap, xy, appendix My question is: is there any way to use NewComputerModern and get faster compilation? I want to minimize the time for compilation while keep looking at NewComputerModern rather than newtxtext. I considered using pdflatex and newtxtext during editing, and xelatex and NewComputerModern right before finish editing. But I think we should be able to do better than this.

  • How to tweak this inline chemical equation in a uniform framework?
    by Explorer on January 30, 2026 at 2:52 pm

    What I want to typeset is something as below inline: Here below is my (ugly) attempt: \documentclass{article} \usepackage{lipsum} \usepackage{chemfig} \usepackage[version=4]{mhchem} \usepackage{extarrows} % https://tex.stackexchange.com/a/267541/322482 \makeatletter \DeclareRobustCommand{\textsupsub}[2]{{% \m@th\ensuremath{% ^{\mbox{\fontsize\sf@size\z@#1}}% _{\mbox{\fontsize\sf@size\z@#2}}% }% }} \makeatother \begin{document} \lipsum[2][1-6] HCHO + SO\textsupsub{2--}{3} + H\textsuperscript{+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[3][1-5] \ce{HCHO + SO_3^2- + H^+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[2] \end{document} which combined with: text mode's formula abruptly \xlongequal with abrupt \phantom chemfig which is not properly coordinated in length I wonder is that mechem or chemfig that could typeset this chemical equation in a uniform package framework, instead of composed of multiple isolated parts.

  • Too much space after prime
    by bubba on January 30, 2026 at 10:38 am

    When I write M'(t) or H''(t) to denote derivatives, I get an unpleasantly large space between the "prime" symbol and the parenthesis. I'm wondering if I perhaps have a corrupted font. Or do people think the output is good and as expected, and my tastes are weird? Second question: what's the best way to fix this? \documentclass{article} \begin{document} $$ \mathbf{M}'(t) = \mathbf{H}''(t) $$ \end{document}

  • Make certain item "titles" of enumerate bold text
    by Roberto Rastapopoulos on January 30, 2026 at 10:06 am

    For my homework I would like to make the hand in exercises in bold text, and the practice exercises in normal text. Currently, I have: \documentclass[12pt]{exam} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=Exercise \arabic*.] \item \item \end{enumerate} \end{document} Which results in . But I would like to be able to say something like this: \begin{enumerate}[label=Exercise \arabic*.] \item* \item \end{enumerate} to give . Is there a way to edit the enumerate environment to achieve this in this simple manner?

  • Calculate values ​of standard normal distribution table as macro
    by cis on January 30, 2026 at 9:18 am

    I calc values of the Standard normal table (with 5-digit accuracy). So I wrote a calculation with numerica.sty (using approximate values ​​of the error function). This works so far; if I put in a concrete value like ... [..., x=0.61]. But I would like to have this as a macro, say \sn{<#1>}, for example \sn{0.61} → 0.72907. I tried to put the whole thing into a newcommand, but this seems to be not that easy. I'd like to implement this inside pdflatex, using a package (not Lua, Mathematica, etc.). I've implemented it here using the numerica package because it worked without problems (including the use of the help-variable h, see MWE). However, I'm not sure if numerica is the best choice. The xintexpr package seems promising, but I'm currently unclear on its syntax. In any case: if anyone knows of a better implementation using a different package (e.g., xint.sty), it would be nice too. \documentclass[margin=10mm, varwidth]{standalone} \usepackage{numerica} \begin{document} \section{Test with \texttt{numerica}} \xdef\x{0.61} sn(\x) = \eval*{% 0.5 (2-h \exp( -0.5 x^2 -1.26551223 +1.00002368 h +0.37409196 h^2 +0.09678418 h^3 -0.18628806 h^4 +0.27886807 h^5 -1.13520398 h^6 +1.48851587* h^7 -0.82215223 h^8 +0.17087277 h^9)) }[h=1/(1+0.25*\sqrt{2}*x), x=0.61% cannot use \x here 🙁 ][5] \section{Test with \texttt{xint}} ... ? .... \end{document}

  • Diagbox in a table: how to align elements to the right or below
    by cis on January 30, 2026 at 6:11 am

    Is it possible to configure \diagbox[*]{*}{*} so that the elements to the right or below are aligned? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{diagbox} \begin{document} \begin{tabular}{c | c | *{3}{c}} \hline a & \diagbox{$b$}{$c$} & 0.1 & 0.2 & 0.3 \\ \hline 2 & 0 & 0.1 & 0.2 & 0.3 \\ 2 & 1 & 2.1 & 2.2 & 2.3 \\ 2 & 2 & 4.1 & 4.2 & 4.3 \\ \end{tabular} \end{document}

  • Fail to construct spiral gradually with beamer frames
    by D G on January 30, 2026 at 2:40 am

    Objective: The spiral construction is shown gradually. Each iteration is on a separate frame. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{frame}{step by step spiral construction} \begin{tikzpicture} \draw (0,0) foreach \a in {1,...,120} { \only<\a->{ -- ++({10*\a}:{pow(0.99,\a)}) } }; \end{tikzpicture} \end{frame} \end{document} Error: No file test.nav. ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.16 \end{frame} ?

  • Fill plot area with rainbow colors
    by Brasil on January 29, 2026 at 11:53 pm

    I would like to fill the plot area with the rainbow colors. The wavelength of the colors corresponds to the wavelength of the x-axis. I have the MWE example below. It works fine uless for the line \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); How can I fix it, please? \documentclass[tikz, border=1mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \usepackage{color} \begin{document} \begin{tikzpicture} \small \begin{axis}[% width = 70mm, height = 50mm, % grid = both, xmin = 0.41, xmax = 0.73, % xtick = \empty, % xtick distance = 100, ymin = 1.4, ymax = 2.0, ytick distance = 0.2, xlabel = Wavelength ($\mu$m), ylabel = Refractive index, ] %--> FILL PLOT AREA \foreach \wl in {410,...,729}{ \definecolor{tmpcol}{wave}{\wl} \colorlet{mycol}[rgb]{tmpcol} \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); } %--> Borosilicate glass BK7 \addplot[thick, domain=0.41:0.73] {1.5046 + 0.00420/x^2}; \node at (axis cs: 0.7, 1.57) [above]{BK7}; %--> Barium crown glass BaK4 \addplot[thick, domain=0.41:0.73] {1.5690 + 0.00531/x^2}; \node at (axis cs: 0.7, 1.52) [below]{BaK4}; %--> Dense flint glass SF10 \addplot[thick, domain=0.41:0.73] {1.7280 + 0.01342/x^2}; \node at (axis cs: 0.7, 1.745) [above]{SF10}; \end{axis} \end{tikzpicture} \end{document}

  • How to Make Trajan Text Bold Using Pdflatex?
    by Jethro on January 29, 2026 at 8:34 pm

    MWE: \documentclass[12pt]{book} \usepackage{trajan} \begin{document} \thispagestyle{empty} \LARGE \noindent\trjnfamily{HOW TO MAKE TRAJAN TEXT BOLD?}\\[20pt] \noindent\textbf{\trjnfamily{BUT THIS DOESN'T WORK}} \end{document} The output: Using pdflatex, I would like to make text bold using the trajan font; however, \textbf and \bfseries seem not to work. Is there a way to do this?

  • Unicode math + LuaLatex issue with fractions in exponents
    by MagiicMushroom on January 29, 2026 at 12:45 pm

    I am having a bug with Unicode math, where fractions in exponents do not behave well if there are multiple fonts loaded. Here is a MWE demonstration (LuaLatex 2025, replicated locally and on Overleaf): \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath}[version=NCMM] \setmathfont{XITS Math}[range = {}, version = XITS] % edit: the `version = XITS` is not required to replicate the bug \mathversion{NCMM} \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} This results in the following output: From testing, all exponents after the \lim seem to be fixed, though on my larger documents this disgrace of a workaround seems to have no effect. Interestingly, it has something to do with the \mathversion, because \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \setmathfont{XITS Math}[range = {}] \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} Produces two bugged exponents: For context, if I remove the \setmathfont{XITS Math}... line or compile either MWE in XeLaTeX, there is no sizing bug with the exponents. I am not experienced with the internals of Unicode math, this range thing was to solve an issue with \mathcal (see here). Any temporary workaround would be appreciated.

  • make datatool sort numerically
    by Leo on January 29, 2026 at 11:50 am

    I've got a problem with datatool. I already know a little about datatool, but couldn't find any answer in the documentation. The problem is the following: I read a csv file and want to sort the database by a column, which contains numbers (integers in fact, but it could be also real ones). The following mwe illustrates the problem: \documentclass{scrarticle} \begin{filecontents*}{data.csv} A, 20, 15 B, 21, 3 C, 6, 0 \end{filecontents*} \usepackage{datatool} \newcommand{\diff}{} \begin{document} \section*{initial csv} \DTLloaddb[noheader]{data}{data.csv} \DTLdisplaydb{data} \section*{sorted by Column2 (descending)} \DTLsort{Column2=descending}{data} \DTLdisplaydb{data} \section*{add Column4 as difference of C2 and C3} \DTLaddcolumn{data}{Column4} \DTLforeach{data}{ \x=Column2, \y=Column3 }{ \DTLgsub{\diff}{\x}{\y} \DTLappendtorow{Column4}{\diff} } \DTLdisplaydb{data} \section*{Sorted by Column4 (descending)} \DTLsort{Column4=descending}{data} \DTLdisplaydb{data} \end{document} Here the sorting by column 2 works just fine, but the sorting by column 4 doesn't. The logs give a warning, that there is no associated datatype for column 4, so datatool assumes a string and compares by letter. I couldn't find a way to add a datatype to that column (the docs say nothing, or I didn't find it). How can I add a datatype to the column?

  • Adjusting text next to a wrapfig environment [closed]
    by Perch on January 29, 2026 at 10:35 am

    Is there a way of getting the text starting from '1.3...' back to its position? This is how I coded it: \begin{wrapfigure}{l}{4cm} \begin{tikzpicture} \draw [thick ,->] (-2,0) -- (2,0); \draw [thick,->] (0,-2) -- (0,2); \draw [thick] (0,0) circle (1.5); \draw[thick,->] (0,0) -- (1.08,1.08); \draw (0.7,0.3) node {$r$}; \end{tikzpicture} \end{wrapfigure} \hspace{-5pt} Tomamos la parametrización de la circunferencia de centro $(0,0)$ y radio $r$ dada por $\alpha: t \in [0,2\pi] \mapsto (r\cos t, r \sin t)$. \\Se tiene que $\alpha'(t) = (-r\sin t,r\cos t)$, así, $$L(\alpha|_{[a,b]}) = \int_0^{2\pi} || \alpha'(t)|| dt = \int_0^{2\pi} \sqrt{(-r \sin t)^2 + (r \cos t)^2}dt = r \int _0^{2\pi}dt = 2\pi r,$$lo que coincide con la intuición. Cabe preguntarse ahora si la longitud depende de nuestra parametrización (que no debería). \subsection{Reparametrización de una curva.} \begin{defi}[]{} Supongamos que tenemos una curva parametrizada $\alpha:I \subset \R \to \R^n$. Se $f: I \subset \R \to I \subset \R$ un difeomorfismo (diferenciable, biyectiva y con inversa diferenciable). Decimos que $\beta:= \alpha \circ f$ es una \textbf{reparametrización } de $\alpha$. \end{defi} Note: the environment 'defi' is a newtcolorbox custom environment.

  • White space is missing in Chinese typesetting if hyperref package is loaded
    by W.J on January 29, 2026 at 1:34 am

    [cfr: The original question concerned cleveref together with hyperref. Further analysis shows the problem can be reproduced without cleveref.] When I use cleveref and hyperref packages together, the white space between the number label and the following Chinese character is missing, while the output is normal if loading cleveref alone. Here is a MWE which uses xelatex and is compiled in TeXstudio with texlive2024. \documentclass{ctexbook} \usepackage{mathtools} %\usepackage[hidelinks]{hyperref} \usepackage{cleveref} \crefname{figure}{图}{图} \begin{document} \begin{figure}[t] \centering This is a figure! \caption{Text figure.\label{fig}} \end{figure} 结果由\cref{fig}给出, which means the result is shown in Fig. 1. \end{document} The output when loading cleveref package alone is given by However, if loading hyperref package before (necessary condition when loading cleveref and hyperref together), the output is given by which can be seen that the white space is missing. I don't know how to handle this problem. Could someone do me a favor? Thanks a lottt! This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex 2025.7.3) 29 JAN 2026 12:38 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **document.tex (./document.tex LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-02-20> (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexbook.cls (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg File: ctexbackend.cfg 2022/07/14 v2.5.10 Backend configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty Package: expl3 2024-02-20 L3 programming layer (loader) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def File: l3backend-xetex.def 2024-02-20 L3 backend support: XeTeX \g__graphics_track_int=\count184 \l__pdf_internal_box=\box51 \g__pdf_backend_object_int=\count185 \g__pdf_backend_annotation_int=\count186 \g__pdf_backend_link_int=\count187 )) Document Class: ctexbook 2022/07/14 v2.5.10 Chinese adapter for class book (CTE X) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty Package: ctexhook 2022/07/14 v2.5.10 Document and package hooks (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty Package: ctexpatch 2022/07/14 v2.5.10 Patching commands (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty Package: fix-cm 2020/11/24 v1.1t fixes to LaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file LaTeX Font Info: Redeclaring font encoding TS1 on input line 47. )) \l__ctex_tmp_int=\count188 \l__ctex_tmp_box=\box52 \l__ctex_tmp_dim=\dimen140 \g__ctex_section_depth_int=\count189 \g__ctex_font_size_int=\count190 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg File: ctexopts.cfg 2022/07/14 v2.5.10 Option configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/book.cls Document Class: book 2023/05/17 v1.4n Standard LaTeX document class (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/bk10.clo File: bk10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) ) \c@part=\count191 \c@chapter=\count192 \c@section=\count193 \c@subsection=\count194 \c@subsubsection=\count195 \c@paragraph=\count196 \c@subparagraph=\count197 \c@figure=\count198 \c@table=\count199 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \bibindent=\dimen141 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def File: ctex-engine-xetex.def 2022/07/14 v2.5.10 XeLaTeX adapter (CTEX) (c:/wswApps/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.sty Package: xeCJK 2022/08/05 v3.9.1 Typesetting CJK scripts with XeLaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st y (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate-20 23-10-10.sty Package: xtemplate 2023-10-10 L3 Experimental prototype document functions \l__xtemplate_tmp_dim=\dimen142 \l__xtemplate_tmp_int=\count266 \l__xtemplate_tmp_muskip=\muskip16 \l__xtemplate_tmp_skip=\skip50 )) \l__xeCJK_tmp_int=\count267 \l__xeCJK_tmp_box=\box53 \l__xeCJK_tmp_dim=\dimen143 \l__xeCJK_tmp_skip=\skip51 \g__xeCJK_space_factor_int=\count268 \l__xeCJK_begin_int=\count269 \l__xeCJK_end_int=\count270 \c__xeCJK_CJK_class_int=\XeTeXcharclass1 \c__xeCJK_FullLeft_class_int=\XeTeXcharclass2 \c__xeCJK_FullRight_class_int=\XeTeXcharclass3 \c__xeCJK_HalfLeft_class_int=\XeTeXcharclass4 \c__xeCJK_HalfRight_class_int=\XeTeXcharclass5 \c__xeCJK_NormalSpace_class_int=\XeTeXcharclass6 \c__xeCJK_CM_class_int=\XeTeXcharclass7 \c__xeCJK_HangulJamo_class_int=\XeTeXcharclass8 \l__xeCJK_last_skip=\skip52 \c__xeCJK_none_node=\count271 \g__xeCJK_node_int=\count272 \c__xeCJK_CJK_node_dim=\dimen144 \c__xeCJK_CJK-space_node_dim=\dimen145 \c__xeCJK_default_node_dim=\dimen146 \c__xeCJK_CJK-widow_node_dim=\dimen147 \c__xeCJK_normalspace_node_dim=\dimen148 \c__xeCJK_default-space_node_skip=\skip53 \l__xeCJK_ccglue_skip=\skip54 \l__xeCJK_ecglue_skip=\skip55 \l__xeCJK_punct_kern_skip=\skip56 \l__xeCJK_indent_box=\box54 \l__xeCJK_last_penalty_int=\count273 \l__xeCJK_last_bound_dim=\dimen149 \l__xeCJK_last_kern_dim=\dimen150 \l__xeCJK_widow_penalty_int=\count274 Package xtemplate Info: Declaring object type 'xeCJK/punctuation' taking 0 (xtemplate) argument(s) on line 2396. \l__xeCJK_fixed_punct_width_dim=\dimen151 \l__xeCJK_mixed_punct_width_dim=\dimen152 \l__xeCJK_middle_punct_width_dim=\dimen153 \l__xeCJK_fixed_margin_width_dim=\dimen154 \l__xeCJK_mixed_margin_width_dim=\dimen155 \l__xeCJK_middle_margin_width_dim=\dimen156 \l__xeCJK_bound_punct_width_dim=\dimen157 \l__xeCJK_bound_margin_width_dim=\dimen158 \l__xeCJK_margin_minimum_dim=\dimen159 \l__xeCJK_kerning_total_width_dim=\dimen160 \l__xeCJK_same_align_margin_dim=\dimen161 \l__xeCJK_different_align_margin_dim=\dimen162 \l__xeCJK_kerning_margin_width_dim=\dimen163 \l__xeCJK_kerning_margin_minimum_dim=\dimen164 \l__xeCJK_bound_dim=\dimen165 \l__xeCJK_reverse_bound_dim=\dimen166 \l__xeCJK_margin_dim=\dimen167 \l__xeCJK_minimum_bound_dim=\dimen168 \l__xeCJK_kerning_margin_dim=\dimen169 \g__xeCJK_family_int=\count275 \l__xeCJK_fam_int=\count276 \g__xeCJK_fam_allocation_int=\count277 \l__xeCJK_verb_case_int=\count278 \l__xeCJK_verb_exspace_skip=\skip57 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty Package: xparse 2024-02-18 L3 Experimental document command parser ) Package: fontspec 2024/02/13 v2.9a Font selection for XeLaTeX and LuaLaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty Package: fontspec-xetex 2024/02/13 v2.9a Font selection for XeLaTeX and LuaLaTe X \l__fontspec_script_int=\count279 \l__fontspec_language_int=\count280 \l__fontspec_strnum_int=\count281 \l__fontspec_tmp_int=\count282 \l__fontspec_tmpa_int=\count283 \l__fontspec_tmpb_int=\count284 \l__fontspec_tmpc_int=\count285 \l__fontspec_em_int=\count286 \l__fontspec_emdef_int=\count287 \l__fontspec_strong_int=\count288 \l__fontspec_strongdef_int=\count289 \l__fontspec_tmpa_dim=\dimen170 \l__fontspec_tmpb_dim=\dimen171 \l__fontspec_tmpc_dim=\dimen172 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (c:/wswApps/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg File: xeCJK.cfg 2022/08/05 v3.9.1 Configuration file for xeCJK package )) \ccwd=\dimen173 \l__ctex_ccglue_skip=\skip58 ) \l__ctex_ziju_dim=\dimen174 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty Package: zhnumber 2022/07/14 v3.0 Typesetting numbers with Chinese glyphs \l__zhnum_scale_int=\count290 \l__zhnum_tmp_int=\count291 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg File: zhnumber-utf8.cfg 2022/07/14 v3.0 Chinese numerals with UTF8 encoding )) \l__ctex_heading_skip=\skip59 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-b ook.def File: ctex-scheme-chinese-book.def 2022/07/14 v2.5.10 Chinese scheme for book ( CTEX) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg File: ctex-name-utf8.cfg 2022/07/14 v2.5.10 Caption with encoding UTF-8 (CTEX) )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctex-c5size.clo File: ctex-c5size.clo 2022/07/14 v2.5.10 c5size option (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows .def File: ctex-fontset-windows.def 2022/07/14 v2.5.10 Windows fonts definition (CTE X) Package fontspec Info: Could not resolve font "KaiTi/B" (it probably doesn't (fontspec) exist). Package fontspec Info: Could not resolve font "SimHei/I" (it probably doesn't (fontspec) exist). Package fontspec Info: Could not resolve font "SimSun/BI" (it probably doesn't (fontspec) exist). Package fontspec Info: Font family 'SimSun(0)' created for font 'SimSun' with (fontspec) options (fontspec) [Script={CJK},BoldFont={SimHei},ItalicFont={KaiTi}]. (fontspec) (fontspec) This font family consists of the following NFSS (fontspec) series/shapes: (fontspec) (fontspec) - 'normal' (m/n) with NFSS spec.: (fontspec) <->"SimSun/OT:script=hani;language=dflt;" (fontspec) - 'small caps' (m/sc) with NFSS spec.: (fontspec) - 'bold' (b/n) with NFSS spec.: (fontspec) <->"SimHei/OT:script=hani;language=dflt;" (fontspec) - 'bold small caps' (b/sc) with NFSS spec.: (fontspec) - 'italic' (m/it) with NFSS spec.: (fontspec) <->"KaiTi/OT:script=hani;language=dflt;" (fontspec) - 'italic small caps' (m/scit) with NFSS spec.: )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex.cfg File: ctex.cfg 2022/07/14 v2.5.10 Configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/mathtools/mathtools.sty Package: mathtools 2024/03/11 v1.30 mathematical typesetting tools (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks17 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/tools/calc.sty Package: calc 2023/07/08 v4.3 Infix arithmetic (KKT,FJ) \calc@Acount=\count292 \calc@Bcount=\count293 \calc@Adimen=\dimen175 \calc@Bdimen=\dimen176 \calc@Askip=\skip60 \calc@Bskip=\skip61 LaTeX Info: Redefining \setlength on input line 80. LaTeX Info: Redefining \addtolength on input line 81. \calc@Ccount=\count294 \calc@Cskip=\skip62 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/mathtools/mhsetup.sty Package: mhsetup 2021/03/18 v1.4 programming setup (MH) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2023/05/13 v2.17o AMS math features \@mathmargin=\skip63 For additional information on amsmath, use the `?' option. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks18 \ex@=\dimen177 )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen178 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count295 LaTeX Info: Redefining \frac on input line 234. \uproot@=\count296 \leftroot@=\count297 LaTeX Info: Redefining \overline on input line 399. LaTeX Info: Redefining \colon on input line 410. \classnum@=\count298 \DOTSCASE@=\count299 LaTeX Info: Redefining \ldots on input line 496. LaTeX Info: Redefining \dots on input line 499. LaTeX Info: Redefining \cdots on input line 620. \Mathstrutbox@=\box55 \strutbox@=\box56 LaTeX Info: Redefining \big on input line 722. LaTeX Info: Redefining \Big on input line 723. LaTeX Info: Redefining \bigg on input line 724. LaTeX Info: Redefining \Bigg on input line 725. \big@size=\dimen179 LaTeX Font Info: Redeclaring font encoding OML on input line 743. LaTeX Font Info: Redeclaring font encoding OMS on input line 744. \macc@depth=\count300 LaTeX Info: Redefining \bmod on input line 905. LaTeX Info: Redefining \pmod on input line 910. LaTeX Info: Redefining \smash on input line 940. LaTeX Info: Redefining \relbar on input line 970. LaTeX Info: Redefining \Relbar on input line 971. \c@MaxMatrixCols=\count301 \dotsspace@=\muskip17 \c@parentequation=\count302 \dspbrk@lvl=\count303 \tag@help=\toks19 \row@=\count304 \column@=\count305 \maxfields@=\count306 \andhelp@=\toks20 \eqnshift@=\dimen180 \alignsep@=\dimen181 \tagshift@=\dimen182 \tagwidth@=\dimen183 \totwidth@=\dimen184 \lineht@=\dimen185 \@envbody=\toks21 \multlinegap=\skip64 \multlinetaggap=\skip65 \mathdisplay@stack=\toks22 LaTeX Info: Redefining \[ on input line 2953. LaTeX Info: Redefining \] on input line 2954. ) \g_MT_multlinerow_int=\count307 \l_MT_multwidth_dim=\dimen186 \origjot=\skip66 \l_MT_shortvdotswithinadjustabove_dim=\dimen187 \l_MT_shortvdotswithinadjustbelow_dim=\dimen188 \l_MT_above_intertext_sep=\dimen189 \l_MT_below_intertext_sep=\dimen190 \l_MT_above_shortintertext_sep=\dimen191 \l_MT_below_shortintertext_sep=\dimen192 \xmathstrut@box=\box57 \xmathstrut@dim=\dimen193 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/cleveref/cleveref.sty Package: cleveref 2018/03/27 v0.21.4 Intelligent cross-referencing ) (./document.aux) \openout1 = `document.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid (fontspec) this). \symlegacymaths=\mathgroup4 LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold' (Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 7. LaTeX Font Info: Redeclaring math accent \acute on input line 7. LaTeX Font Info: Redeclaring math accent \grave on input line 7. LaTeX Font Info: Redeclaring math accent \ddot on input line 7. LaTeX Font Info: Redeclaring math accent \tilde on input line 7. LaTeX Font Info: Redeclaring math accent \bar on input line 7. LaTeX Font Info: Redeclaring math accent \breve on input line 7. LaTeX Font Info: Redeclaring math accent \check on input line 7. LaTeX Font Info: Redeclaring math accent \hat on input line 7. LaTeX Font Info: Redeclaring math accent \dot on input line 7. LaTeX Font Info: Redeclaring math accent \mathring on input line 7. LaTeX Font Info: Redeclaring math symbol \Gamma on input line 7. LaTeX Font Info: Redeclaring math symbol \Delta on input line 7. LaTeX Font Info: Redeclaring math symbol \Theta on input line 7. LaTeX Font Info: Redeclaring math symbol \Lambda on input line 7. LaTeX Font Info: Redeclaring math symbol \Xi on input line 7. LaTeX Font Info: Redeclaring math symbol \Pi on input line 7. LaTeX Font Info: Redeclaring math symbol \Sigma on input line 7. LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 7. LaTeX Font Info: Redeclaring math symbol \Phi on input line 7. LaTeX Font Info: Redeclaring math symbol \Psi on input line 7. LaTeX Font Info: Redeclaring math symbol \Omega on input line 7. LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 7. LaTeX Font Info: Redeclaring symbol font `operators' on input line 7. LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font (Font) `operators' in the math version `normal' on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) OT1/cmr/m/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font (Font) `operators' in the math version `bold' on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) OT1/cmr/bx/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) TU/lmr/m/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' (Font) OT1/cmr/m/it --> TU/lmr/m/it on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' (Font) OT1/cmr/bx/n --> TU/lmr/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' (Font) OT1/cmss/m/n --> TU/lmss/m/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' (Font) OT1/cmtt/m/n --> TU/lmtt/m/n on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) TU/lmr/m/n --> TU/lmr/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' (Font) OT1/cmr/bx/it --> TU/lmr/b/it on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' (Font) OT1/cmss/bx/n --> TU/lmss/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> TU/lmtt/b/n on input line 7. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2021/08/11 v1.11 sin cos tan (DPC) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: xetex.def on input line 107. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics-def/xetex.def File: xetex.def 2022/09/22 v5.0n Graphics/color driver for xetex )) \Gin@req@height=\dimen194 \Gin@req@width=\dimen195 ) [1 ] (./document.aux) *********** LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2022/07/14> *********** ) Here is how much of TeX's memory you used: 10349 strings out of 474772 277375 string characters out of 5757709 1920842 words of memory out of 5000000 32429 multiletter control sequences out of 15000+600000 559831 words of font info for 53 fonts, out of 8000000 for 9000 1348 hyphenation exceptions out of 8191 93i,5n,97p,3268b,271s stack positions out of 10000i,1000n,20000p,200000b,200000s Output written on document.pdf (1 page). A shorter MWE without cleveref: \documentclass{ctexbook} % \usepackage{hyperref} %% Uncomment this line to reproduce \pagestyle{empty} \begin{document} \begin{figure}[h]\caption{caption\label{ref}}\end{figure} \clearpage \tracingoutput=1 \tracingonline=1 \showboxdepth=\maxdimen \showboxbreadth=\maxdimen \shipout\hbox{由\ref{ref}} \end{document} Correct output (with hyperrref commented out): \hbox(8.14693+1.65466)x19.31866 .\TU/FandolSong-Regular(0)/m/n/10.53937 由 .\glue 3.50961 plus 1.7548 minus 1.16986 .\TU/lmr/m/n/10.53937 1 .\kern -0.0002 .\kern 0.0002 .\hbox(0.0+0.0)x0.0 Incorrect output (with hyperrref enabled): \vbox(8.14693+1.65466)x15.80905 .\vbox(0.0+0.0)x0.0, glue set - 20.99626fil ..\kern 0.0 ..\kern 22.0 ..\kern -1.00374 ..\hbox(0.0+0.0)x0.0, glue set - 87.99626fil ...\kern 0.0 ...\kern 89.0 ...\kern -1.00374 ...\special{pdf:dest (page.2) [@thispage /XYZ @xpos @ypos null]} ...\penalty 10000 ...\glue 0.0 plus 1.0fil minus 1.0fil ..\glue 0.0 plus 1.0fil minus 1.0fil .\glue(\lineskip) 0.0 .\hbox(8.14693+1.65466)x15.80905 ..\TU/FandolSong-Regular(0)/m/n/10.53937 由 ..\kern -0.00017 ..\kern 0.00017 ..\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 1]/H/I/C[1 0 0]/A<</S/GoTo/D(figure.0.1)>>>>} ..\TU/lmr/m/n/10.53937 1 ..\kern -0.0002 ..\kern 0.0002 ..\special{pdf:eann}

  • Help align the numbers in this bespoke siunitx macro
    by Miloop on January 28, 2026 at 5:36 pm

    I am writing a document where I keep having to write variables that fall between two numbers, say, 10 < x \leq 3 or in some cases even between two quantities such as 12.5 mg < x \leq 3.5 mg. I wrote a macro named \nestednumrange and \nestedqtyrange. Here is my minimal example: \documentclass{article} \usepackage{siunitx} \newcommand{\nestednumrange}[3]{% \ensuremath{\num{#1} #2 \num{#3}}% } \newcommand{\nestedqtyrange}[4]{% \ensuremath{\qty{#1}{#4} #2 \qty{#3}{#4}}% } \begin{document} \nestednumrange{3}{\leq x}{<2} \nestedqtyrange{3}{\leq c}{\leq 3}{\milli\gram} \end{document} I'm happy that is (somehow) works, but the output is a bit ugly, imho: How do I "center" the variable correctly? Should I perhaps add two more {}s specifically for the signs, so that they aren't linked to any element in the macro? Unfortunately, I don't know how to make the macro only accept operators like <, >, \leq, \geq, and =, and throw errors at others.

  • Best ways to calculate sums in LaTeX
    by cis on January 28, 2026 at 2:13 pm

    In many computer algebra systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values ​​for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}

  • Is there a expl3 interface for lttemplate?
    by Noiv on January 28, 2026 at 1:26 am

    in developing a class I have come to use the so called templates documented in lttemplate. It is a expl3-Class therefore I looked at ways to define Template Types, Templates and Instances in expl3 Syntax but there are no such interfaces. Is there a particular reason why templates do not have a expl3 interface? Or was I not capable enough to find it?