• How can I accessibly make my pdf have an H1 heading?
    by Teepeemm on January 26, 2026 at 7:03 pm

    My accessibility checker (Ally) complains that the following "PDF does not have headings": \DocumentMetadata{tagging=on,lang=en-US,pdfstandard=ua-2, tagging-setup={ math/setup=mathml-SE, % role/new-tag=Title/H1, } } \documentclass{article} \usepackage{lipsum} \title{Title} \begin{document} \maketitle \lipsum[1-9] \end{document} I saw elsewhere that uncommenting the role line would cause the title to become an H1, satisfying the need for headings. This satisfies Ally, but now the compilation gives a warning Parent-Child 'pdf2:H1' --> 'pdf2:P'. Relation is not allowed! and VeraPDF says that the PDF is no longer UA-2. Is there a way to make the title become H1 and not P?

  • Simplifying an Asymptote figure for spherical coordinates
    by Sebastiano on January 26, 2026 at 12:58 pm

    I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:

  • Why is my METAFONT code wrong?
    by Grzegorz Brzęczyszczykiewicz on January 25, 2026 at 9:11 pm

    mode_setup; thick#:=10pt#; thin#:=5pt#; xoo#:=15pt#; yoo#:=20pt#; dot#:=4pt#; slant#:=0pt#; define_pixels(thick, thin, xoo, yoo, dot, slant); ascender:=3; descender:=1; def be(expr x, y) = (x*xoo+y*slant, y*yoo) enddef; path bowl; bowl := be(1, 0) .. controls be(1.6, 0) and be(2, 0.4) .. be(2, 1) .. controls be(2, 1.6) and be(1.6, 2) .. be(1, 2) .. controls be(0.4, 2) and be(0, 1.6) .. be(0, 1) .. controls be(0, 0.4) and be(0.4, 0) .. cycle; def stick(expr height, length) = be(0-length, height)--be(0, height)--be(0, 0) enddef; def serif(expr length) = be(0-length, 0)--be(length, 0) enddef; pen thinP; thinP := pencircle scaled thin; %a thin, circular pen pen thickP; thickP := pencircle xscaled thick yscaled thin; %a thick, elliptical pen numeric theta_v, theta_n, A, k; theta_v := angle(slant, yoo); A := theta_v / 2; theta_n := angle(yoo, -slant); k := sqrt( 25 - (2.5*sin(theta_n - A))**2 ) / ( 5*cos(theta_n - A) ); pen p; p := thickP xscaled k rotated A; beginchar("o", 3*xoo#, 2*yoo#, 0); pickup thickP; draw bowl; endchar; beginchar("l", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(ascender, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); endchar; beginchar("b", 3.2*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(ascender-1, 0.5)) shifted be(0.25, 1); pickup p; draw be(0.25, 1.5)--be(0.25, 0.1) endchar; beginchar("d", 3.3*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(1.5, ascender)--be(2, ascender)--be(2, 0)--be(2.5, 0); endchar; beginchar("p", 3.2*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(2+descender, 0.5)) shifted be(0.25, 0-descender); draw (serif(0.5)) shifted be(0.25, 0-descender); endchar; beginchar("q", 3.1*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(2, 1)--be(2, 0-descender); draw (serif(0.5)) shifted be(2, 0-descender); pickup p; draw be(2, 1.9)--be(2, 0.75) endchar; beginchar("i", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(2, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); pickup pencircle scaled (thick+dot); draw be(0.425, 2.75) endchar; beginchar("h", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(ascender, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; beginchar("n", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(2, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; end there are errors and it should be correct, it throws "Missing )" and "Extra tokens will be flushed" errors. For slant = 0, k should work out to sqrt(1.75) = 1.32287565553..., and A = 45°, however due to a bug, the k is a few eyelets shy of the expected sqrt(1.75), and the line becomes too thin. As for the A, it maybe is correct but I don't know if it is. There are bugs and I don't know how to fix them.

  • Different column alignment of first-row
    by Werner on January 25, 2026 at 5:19 pm

    I like my matrix indices to be center-aligned while numbers within the matrix should be right-aligned for better visual clarity of scale. However, none of my attempts to achieve both have been successful. In the example below, the first option is closest, but fails to align the lost column index. \documentclass{article} \usepackage{nicematrix,xcolor} \newcommand{\mc}{\multicolumn{1}{c}} \begin{document} Manual formatting without \texttt{first-row} - last column index not centered: \[ \begin{NiceArray}{ *{6}{r} } \mc{\color{red}\scriptstyle 0} & \mc{\color{red}\scriptstyle 1} & \mc{\color{red}\scriptstyle 2} & \mc{\color{red}\scriptstyle 3} & \mc{\color{red}\scriptstyle 4} & \mc{\color{red}\scriptstyle 5} \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{\string\RowStyle} - no centering of indices: \[ \begin{NiceArray}{ *{6}{r} } \RowStyle[nb-rows=1]{\color{red}\scriptstyle} 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{first-row} - no centering of indices: \[ \begin{NiceArray}{ *{6}{ r } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] Using \texttt{first-row} with \texttt{c}entered columns - no right-aligned matrix elements: \[ \begin{NiceArray}{ *{6}{ c } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] \end{document} How can I achieve a different alignment for the first row (indices) compared to the rest of the matrix?

  • Where does this 1pt extra space between paragraphs come from, and how to configure it?
    by H. Weirauch on January 25, 2026 at 2:09 pm

    In the MWE \documentclass{article} \usepackage{lua-visual-debug} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \begin{document} \rule{6mm}{6mm} \rule{7mm}{6mm} \end{document} the code contains an empty line (= new paragraph) between the two \rules. This is what it looks like in the output: Between the paragraphs, some vertical spacing is inserted. As far as I can tell, it is exactly 1pt. Where does this come from, and how am I supposed to modify it? This space does not occur when using minimal document class; it apparently is limited to article (or other high-level classes like KOMA).

  • How can I tag an l3pdftextfield?
    by cfr on January 25, 2026 at 6:53 am

    I'm trying to create a text field in a tagged PDF. My real document uses ltx-talk, which complicates things slightly, but the MWE below uses article. I mention ltx-talk in case somebody has a solution which would work for article, but not for ltx-talk, so that I do not waste people's time. \DocumentMetadata{% lang=en-GB, tagging=on, pdfversion=2.0, pdfstandard=UA-2, } \documentclass{article} \usepackage{bookmark} \usepackage{l3pdffield} \title{Tools} \ExplSyntaxOn \cs_new_eq:NN \textfield \pdffield_textfield:n \ExplSyntaxOff \begin{document} \Form \textfield { name=fieldA, width=50mm, height=12pt, depth=50pt, setfieldflags=Multiline, altname=a, } \end{document} I'm having some difficulty understanding how much I'm supposed to do here and how much I'm supposed to let happen. tagpdf.pdf suggests that form fields created with l3pdffield should be automatically added to the structure. I think this indeed happens1: <PDF> <StructTreeRoot> <Document xmlns="http://iso.org/pdf2/ssn" id="ID.02" > <text-unit xmlns="https://www.latex-project.org/ns/dflt" id="ID.05" rolemaps-to="Part" > <text xmlns="https://www.latex-project.org/ns/dflt" id="ID.06" xmlns:Layout="http://iso.org/pdf/ssn/Layout" Layout:TextAlign="Justify" rolemaps-to="P" > <Form xmlns="http://iso.org/pdf2/ssn" id="ID.07" > <?ReferencedObject type="Annot" page="1" ?> </Form> </text> </text-unit> </Document> </StructTreeRoot> </PDF> What I'm not sure about is how to configure a Contents entry for the field - or maybe where I am supposed to put altname, which is presumably in the wrong place at the moment? The document compiles without errors with either LuaLaTeX or pdfLaTeX. However, the PDF fails to validate against UA-22,3. verapdf says <?xml version="1.0" encoding="utf-8"?> <report> <buildInformation> <releaseDetails id="core" version="1.28.2" buildDate="2025-07-15T16:07:00+01:00"></releaseD etails> <releaseDetails id="validation-model" version="1.28.2" buildDate="2025-07-15T16:12:00+01:00 "></releaseDetails> <releaseDetails id="gui" version="1.28.2" buildDate="2025-07-15T16:59:00+01:00"></releaseDe tails> </buildInformation> <jobs> <job> <item size="23750"> <name>/path/to/test-file.pdf</name> </item> <validationReport jobEndStatus="normal" profileName="PDF/UA-2 + Tagged PDF validation pro file" statement="PDF file is not compliant with Validation Profile requirements." isCompliant=" false"> <details passedRules="1722" failedRules="1" passedChecks="175" failedChecks="1"> <rule specification="ISO 14289-2:2024" clause="8.10.2.3" testNumber="1" status="faile d" failedChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Accessibility validation p rofile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant ="false"> <details passedRules="1718" failedRules="1" passedChecks="171" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Reuse validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false" > <details passedRules="1705" failedRules="1" passedChecks="169" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <duration start="1769321531153" finish="1769321531866">00:00:00.713</duration> </job> </jobs> <batchSummary totalJobs="1" failedToParse="0" encrypted="0" outOfMemory="0" veraExceptions="0 "> <validationReports compliant="0" nonCompliant="1" failedJobs="0">1</validationReports> <featureReports failedJobs="0">0</featureReports> <repairReports failedJobs="0">0</repairReports> <duration start="1769321531030" finish="1769321531917">00:00:00.887</duration> </batchSummary> </report> From what I gathered from the PDF spec, I want to add a Contents here, because a label would correspond to a visible label in the PDF, which does not exist. 1 However, some parts of the documentation for l3pdfmanagement suggest that perhaps only link annotations, as opposed to widget annotations, are currently handled fully automatically by the tagging code. So I'm not sure that I do not need to do something additional here, but the problem does not seem to be adding the widget to the structure? 2 In fact, the text field here is not supposed to make sense on its own. It is only meant to make sense when I am standing there talking. It's just a place for me to type. Its purpose will make sense by the end of class, because it will then have content. 3 So marking the field up for accessibility is actually a bit strange. It isn't 'accessible' to sighted readers either in advance of the relevant class.

  • circuitikz: position and adjust current and voltage arrows
    by cis on January 24, 2026 at 7:17 pm

    I'm trying to recreate this image on 5mm grid paper using the original dimensions. It's not a big problem; I'm just looking for some fine-tunings inside the circuitikz-package. I've tested a few keys, but I'm wondering: What is the correct method: to add a longer voltage arrow that's a bit further away from the source? to add a current arrow at the shown position in a package-like way (regular TikZ is clear)? PS: I would also like to reduce the (global setting!) size of the arrowheads and the control points ("poles", I haven't quite understood chapter 6.1 yet); but that might be too much for one thread. MWE: [I've only set a small excerpt here to address the problems. I can easily add the rest later by myself.] \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[font=\footnotesize\sffamily, european resistors, circuitikz/resistors/width=0.425,% default 0.8 circuitikz/bipoles/generic/height=0.165,% default 0.3 circuitikz/bipoles/thickness=1.0, % default 2 circuitikz/bipoles/vsource/width=0.35, circuitikz/bipoles/vsource/height=0.35, %circuitikz/bipole/is voltage=false, %circuitikz/voltage/distance from node=5.0875,% old: 0.8 %circuitikz/voltage shift sources adjust=4.525,% default: 0.5 %voltage shift=0.125,% optional ] \draw[gray!25, step=5mm] (-1.5,0.5) grid (4,-4); \draw[] (0,-2) to[vsource, v<=12V, mirror] (0,0) -- (1.5,0); \draw[] (0.5,0) to[R=15, *-*] (0.5,-1) to[R, a=25, -*] (0.5,-2); \end{circuitikz} \end{document}

  • Can I add a symbol to indicate that a footnote has been split across pages?
    by Draconis on January 23, 2026 at 9:05 pm

    My university's thesis formatting guidelines are extremely stringent about margins, which means when a footnote gets split across pages (because the \footnotemark is on the bottom line of the page, so including the entire footnote would push the mark onto the next page), there's not much I can do to fix it. I can't, for example, expand the text box slightly, or insert some additional whitespace at the bottom. Proofreaders have found this confusing. So with the better typographical solutions being off-limits, I would like to at least indicate to the reader that the footnote continues on the next page. Is it possible to indicate some sort of symbol, such as a rightward-pointing arrow, at the point where a footnote has been split across pages, to indicate that it's continued elsewhere? I know some periodicals do this when an article is split across pages. MWE adapted from here: \documentclass[oneside]{book} \usepackage{lipsum} \usepackage[splitrule]{footmisc} \begin{document} \lipsum[1-3] \lipsum[1] New paragraph, which is really long, so long in fact that it spans more than one line. New paragraph, which is really long, so long in fact that it spans more than one line. \footnote{Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour.} % \lipsum \end{document} Current result: What I would like: some kind of symbol (perhaps a ➤?) at the end of the first page, showing that the footnote continues elsewhere and isn't just broken off. \usepackage[splitrule]{footmisc} indicates on the next page that there's a continuation, but I would like a marker on the first page as well. This question, this question, and this question ask the same thing, but none of them includes a MWE; I'm hoping that providing one will help find an answer.

  • Plotting a rational function in tikz
    by mf67 on January 21, 2026 at 9:17 pm

    I'm trying to plot a rational function, but I constantly get dimensions too large, even if the plot frame is within the page and the function is within limits. \documentclass{book} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture}[declare function={r(\x)=(-\x*\x*\x*\x+600*\x*\x*\x-135000*\x*\x+10125000*\x)/(2109375*(30000-200*\x));}] \begin{axis}[ x=0.05cm,y=1cm, xmin=0, xmax=160, ymin=0, ymax=1, xlabel={\(x\)}, ylabel={\(y\)} ] \draw[domain=0:160,smooth,samples=100] plot ({\x},{r(\x)}); \end{axis} \end{tikzpicture} \end{document} What could be wrong? TIA. This is how the graph looks in Mathematica

  • Define a font by file rather than by name?
    by Gary on January 18, 2026 at 10:13 pm

    I'm trying to follow pages 51-52 of the book Fonts out of ConTeXt to define a font by file: rather than name:; but I must be overlooking something. The path to the font file is /home/gary/programs/context/context-linux-64/tex/texmf/fonts/data/gust/tex-gyre/termes/texgyretermes-​regular.​otf By-name works as: \definefont[Times][name:texgyretermesregular*default at 11pt][line=2.8ex] But by-file does not load. \definefont[Times][file:texgyretermes-​regular.​otf*default at 11pt][line=2.8ex] I did not see an error in the CLI output but the font remains the body font when declared as \Times in an environment within the body. All I did was toggle between commenting the \definefont lines and did not change the body at all. One time the font loads, the other it does not. Thank you. Below is the result of mtxrun --script font --list --all termes and you have to scroll right to see the filename column. I guess I didn't read far enough to the next section that reads The first two columns mention the names that we can use to access a font. This explains why using only texgyretermes loads bold. But I do not understand the meaning of file versus name. identifier familyname fontname filename subfont instances texgyretermesbold texgyretermes texgyretermesbold texgyretermes-bold.otf texgyretermesbolditalic texgyretermes texgyretermesbolditalic texgyretermes-bolditalic.otf texgyretermesitalic texgyretermes texgyretermesitalic texgyretermes-italic.otf texgyretermesmath texgyretermesmath texgyretermesmathregular texgyretermes-math.otf texgyretermesmathcompanion texgyretermesmathcompanion texgyretermesmathcompanionregular TeXGyreTermesMathCompanion-Regular.otf texgyretermesmathcompanionnormal texgyretermesmathcompanion texgyretermesmathcompanionregular TeXGyreTermesMathCompanion-Regular.otf texgyretermesmathcompanionregular texgyretermesmathcompanion texgyretermesmathcompanionregular TeXGyreTermesMathCompanion-Regular.otf texgyretermesmathnormal texgyretermesmath texgyretermesmathregular texgyretermes-math.otf texgyretermesmathregular texgyretermesmath texgyretermesmathregular texgyretermes-math.otf texgyretermesnormal texgyretermes texgyretermesitalic texgyretermes-italic.otf texgyretermesregular texgyretermes texgyretermesregular texgyretermes-regular.otf

  • Is there a "hook" to expand a macro after the end of a path in TikZ?
    by Rmano on January 18, 2026 at 7:33 pm

    I am adding a new feature to circuitikz to simplify the usage of "user-defined" voltages (and currents and "flow"s). The question is not specific to circuitikz, although the MWE is — sorry for the complication. If I manage a smaller MWE I'll post here. The basic question is: when a TikZ \path command is processed (and a \draw, etc., which are basically the same), is it possible to add a hook to be expanded at the end of it? I mean, after the final ; is found. In the following MWE, I would like to add some code to the addcall key so that I do not need to add the final \DoAdvVoltages. Ideally, the macro should be called after each path is finished, but calling it before the end of the environment would be acceptable. In order of preference, the solution should: call \DoAdvVoltages at every end of the path, when in the path the to[..., addcall=...] is used; if that's not possible, call \DoAdvVoltages at the end of the tikzpicture, in every tikzpicture where at least one path used the addcall key; if that's not possible, call the \DoAdvVolteges at the end of every tikzpicture. The solution should be engine-independent (well, it should work in the engines supported by TikZ, basically LaTeX and ConTeXt). Option 3 is easy in LaTeX, I do not know if it's as easy in ConTeXt. Option 2 could be achievable in LaTeX: add a one-shot hook at env/tikzpicture/end the first time it's called, protected by an if, from the .code itself — I'm not sure if this is a use-case possible in the current hook code, I'll dig into it when I have time, but it would be an acceptable answer (Is \AddToHookNext what I'm looking for here?). \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[RPvoltages]{circuitikz} % just an example \ctikzset{voltage=raised, !v sym/.style={no v symbols}} \newcommand{\placesigns}[2]{% place the +- signs at a fixed distance \path (#1voltage.center) ++(-\ctikzgetdirection{#1}:0.5cm) node[]{$+$}; \path (#1voltage.center) ++(180-\ctikzgetdirection{#1}:0.5cm) node[]{$-$}; } % add a command queue to circuitikz \makeatletter \gdef\local@voltages{} \def\addcommand#1#2{%add to \commands the macro \#1{nodename}{#2} \begingroup \edef\@@name{\ctikzvalof{bipole/name}} \edef\@@temp{% \noexpand\pgfutil@g@addto@macro\noexpand\local@voltages{% \expandafter\noexpand\csname #1\endcsname {\@@name}{#2}% }% }% \@@temp \endgroup } \def\DoAdvVoltages{\local@voltages\relax\gdef\local@voltages{}\ctikz@hook@setfalse} \makeatother % This works, but just for LaTeX (or not?) % Moreover, I'd like to add this from the addcall keys, so that % I don't call it for *every* tikzpicture! % \AddToHook{env/tikzpicture/end}{\DoAdvVoltages} \ctikzset{addmyv/.style = {v={#1}, !v sym, addcall={#1}}} \ctikzset{addcall/.code ={\addcommand{placesigns}{#1}}} \begin{document} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \DoAdvVoltages \end{tikzpicture} \end{document} A partial solution (the option 2 above) could be something like this, that seems to work: \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[RPvoltages]{circuitikz} % just an example \ctikzset{voltage=raised, !v sym/.style={no v symbols}} \newcommand{\placesigns}[2]{% place the +- signs at a fixed distance \path (#1voltage.center) ++(-\ctikzgetdirection{#1}:0.5cm) node[]{$+$}; \path (#1voltage.center) ++(180-\ctikzgetdirection{#1}:0.5cm) node[]{$-$}; } % add a command queue to circuitikz \makeatletter \newif\ifctikz@hook@set\ctikz@hook@setfalse \gdef\local@voltages{} \def\addcommand#1#2{%add to \commands the macro \#1{nodename}{#2} \begingroup \edef\@@name{\ctikzvalof{bipole/name}} \edef\@@temp{% \noexpand\pgfutil@g@addto@macro\noexpand\local@voltages{% \expandafter\noexpand\csname #1\endcsname {\@@name}{#2}% }% }% \@@temp \endgroup } \def\DoAdvVoltages{\local@voltages\relax\gdef\local@voltages{}% \typeout{EXECUTE DoAdv} \global\ctikz@hook@setfalse } \def\ctikz@set@hook{% \ifctikz@hook@set \else \global\ctikz@hook@settrue % I have no idea if I can do this in context/plain... \ifpgfutil@format@is@latex \typeout{EXECUTE AddToHookNext} \AddToHookNext{env/tikzpicture/end}{\DoAdvVoltages}% \fi \fi } \ctikzset{addcall/.code ={\addcommand{placesigns}{#1}\ctikz@set@hook}} \makeatother % This works, but just for LaTeX (or not?) % \AddToHook{env/tikzpicture/end}{\DoAdvVoltages} \ctikzset{addmyv/.style = {v={#1}, !v sym, addcall={#1}}} \begin{document} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \end{tikzpicture} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \end{tikzpicture} \end{document} But clearly, this is not valid (I think) for ConTeXt at all.

  • Any possible method to handle for-loop more smartly in tikz?
    by Explorer on January 18, 2026 at 7:31 am

    I have the following codes to typeset following: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{decorations.pathreplacing} \ExplSyntaxOn \cs_new:Nn \__my_Aterm_tl:n { \tl_set:Nn \l_tmpa_tl { a \sb 1 } \int_step_inline:nnn {2} {#1} { \tl_put_right:Nn \l_tmpa_tl { + a \sb {##1} } } \tl_use:N \l_tmpa_tl } \NewDocumentCommand{\Aterm}{ m }{\__my_Aterm_tl:n{#1}} \ExplSyntaxOff \begin{document} \def\NN{5} \begin{tikzpicture} \foreach \i[evaluate=\i as \nexti using int(\i+1)] in {1,...,\NN}{ \draw (0,{-(\i-1)}) rectangle (\i,-\i); \ifnum\i<\NN\relax \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}-b_{\nexti}$} (\i,-\i); \else \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}$} (\i,-\i); \fi \draw[decorate,decoration={brace,mirror,amplitude=5pt}] (0,{-(\i-1)}) -- node[midway,below=3pt] { % $a_{\i}$ $\Aterm{\i}$ } (\i,{-(\i-1)}); } \end{tikzpicture} \end{document} It works! But the code looks not elegant, for the abrupt \ifnum and expl3-syntex(I have heard from that may cause unexpected result to mix tikz and expl3), is that possible to make good use of evaluate=<variable> as <macro> using <formula> or /remember=<variable> as <macro> (initially <value>)?

  • Is that possible to just fill=white for text in only one node?
    by Explorer on January 16, 2026 at 8:07 pm

    I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \ExplSyntaxOn \keys_define:nn {mykey} { foo .tl_set:N = \l_tmpa_tl } \keys_set:nn {mykey} { foo = {O\quad K},%<- } \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \ExplSyntaxOff \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner sep=0pt] at (.7,0) {O}; \node[fill=white,inner sep=0pt] at (1.3,0) {K}; \end{tikzpicture} \end{document} For the sake of the template settings, the text O\quad K should be put as a token list, as a whole, but I need the third picture's result. Is that possible to just fill=white to just shade the "text area"? Edited: Since cfr commented for the original template case, I would provide more information. Claims: The original package is exam-zh package It depends on xeCJK, so xelatex is must I was not sure that whether it's CJK fonts settings works on every OS. See here. What I want, is to achieve something sealline style as below: It appeared in the leftmargin of exam paper: Now I have the following code: \documentclass{exam-zh} \usepackage{zhlipsum} % \ExplSyntaxOn % % Line 1487 in exam-zh.cls % % https://github.com/xkwxdyy/exam-zh/blob/main/exam-zh.cls#L1487-L1496 % \cs_set:Npn \__examzh_sealline_odd_text_around_line: % { % \node [ anchor = east ] % at ([xshift = -\g__examzh_sealline_odd_text_xshift_dim, yshift = \g__examzh_sealline_odd_text_yshift_dim]current~page~text~area.west) % { % \g__examzh_sealline_odd_text_format_tl % \__examzh_sealline_odd_spread_box:nn { \g__examzh_sealline_odd_text_width_dim } % { \g__examzh_sealline_odd_text_tl } % }; % } % \ExplSyntaxOff \examsetup{ sealline={ show=true, circle-show=false, line-type={loosely-dotted}, text={密封线},%<- the text here is put as `\g__examzh_sealline_odd_text_tl' text-format={\huge\bfseries}, line-thickness={2.5pt}, text-xshift={.375cm} } } \begin{document} \zhlipsum[name=zhufu] \end{document} That is the original case. Noted that 密封线, the l3keys sealline/text is put into \g__examzh_sealline_odd_text_tl ands \g__examzh_sealline_even_text_tl here(why I say as a whole). Which need to be processed by \__examzh_sealline_odd_spread_box:nn here. I want to change the present settings of exam-zh's setting code to the minimal extent.(Of course, I can type text={}, leave it empty, and follow \__examzh_sealline_odd_circle: here to draw multiple \node[fill=white] {密}s) But that change too much the package's setting. So, I simplified it to my origianl post😊.

  • Best way to break up long equation to fit the IEEE format (double column)
    by TastyTurtle on January 16, 2026 at 12:41 pm

    I have a very long equation where the fraction line spans the whole equation, which makes it fit poorly in the IEEEtran format! Below is an image of the equation(s) in question, along with the current code I am using. Feel free to think creatively for a solution, I am open to almost anything. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsthm} \usepackage{geometry} \usepackage{empheq} \geometry{margin=1in} \begin{document} \begin{empheq}[left=\empheqlbrace]{alignat=2} \label{eq:EOM} &\ddot x_w &= \frac{ \dfrac{k_t}{R_m}V_m - \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) - r_w m_b l_b\!\left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) }{ \dfrac{I_w}{r_w}+r_w m_w + r_w m_b }, \\ &\ddot\theta_b &= \frac{ - \dfrac{k_t}{R_m}V_m + \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b }{ I_b + m_b l_b^{2} }. \end{empheq} \end{document} Any help would be awesome Edit: Its my first time working with the IEEEtran format but for this questions, it is just a double-column format. More information can be see here: https://www.overleaf.com/latex/templates/ieee-conference-template/grfzhhncsfqn Furthermore, I have updated the code above so that it's compilabl,e and below is a link to my set of equations in a IEEEtran document: https://www.overleaf.com/read/sqrtfcwfjygr#70ecc2 Edit 2: Three different "solutions" can be see in the image below, its probably best to drop the curly bracket and use ´\multline´: Here is the code to recreate the image above: \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage{mathtools} \usepackage{empheq} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \begin{verbatim} \splitfrac \end{verbatim} \begin{empheq}[left=\empheqlbrace]{align} \ddot{x}_w &= \frac{ \splitdfrac{ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) } }{ \frac{I_w}{r_w} + r_w (m_w + m_b) } \label{eq:EOM_xw} \\[1em] \ddot\theta_b &= \frac{ \splitdfrac{ -\frac{k_t}{R_m}V_m + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ + m_b l_b g \sin\theta_b - m_b l_b \ddot{x}_w \cos\theta_b } }{ I_b + m_b l_b^{2} } \label{eq:EOM_thetab} \end{empheq} Fraction and multline\\ \begin{empheq}[left=\empheqlbrace]{align} \begin{split} \ddot x_w &= \frac{1}{\frac{I_w}{r_w} + r_w (m_w + m_b)} \Bigg[ \frac{k_t}{R_m}V_m \\ &\quad - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{split} \label{eq:EOM_xw} \\[15pt] \begin{split} \ddot\theta_b &= \frac{1}{I_b + m_b l_b^{2}} \Bigg[ -\frac{k_t}{R_m}V_m \\ &\quad + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b \Bigg] \end{split} \label{eq:EOM_thetab} \end{empheq} Negative exponent and multline\\ \begin{multline}\label{eq:EOM_xw} \ddot x_w = \left( \frac{I_w}{r_w} + r_w (m_w + m_b) \right)^{-1} \\ \times \Bigg[ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{multline} \end{document}

  • Primes in Latex
    by legogubben on January 15, 2026 at 10:18 am

    I want to create a command \isthisprime{<number>} where it decides whether <number> is or is not prime, and if it is, it also returns the order of the prime (eg, 2 is the first, 3 is the second, and so on). Here is my attempt at a code (excuse my choice of naming the counters): \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \usepackage{lipsum,blindtext} \newcount\div \newcount\divs \newcount\somnum \newcount\yes \newcount\yess \newcount\numberofprimes \newcommand{\isthisprime}[1]{% %Decide if #1 is prime \div=2 \yes=0 \ifnum#1<2 \yes=1 \fi \loop \ifnum\div<#1 \ifnum#1=\numexpr(#1/\div)*\div\relax \yes=1 \fi \advance\div by 1 \repeat \numberofprimes=0 \somnum=2 \yess=0 \divs=2 %Checking every number less than or equal to #1 \ifnum\yes=0 \loop \ifnum\somnum<\numexpr#1+1\relax \loop%checking if somnum is prime \ifnum\divs<\somnum \ifnum\somnum=\numexpr(\somnum/\divs)*\divs\relax \yess=1 \fi \advance\divs by 1 \repeat \ifnum\yess=0 \advance\numberofprimes by 1 \fi \yess=0\divs=2\advance\somnum by 1 \repeat \fi \ifnum\yes=0 #1 is a prime with index~\the\numberofprimes. \else #1 is not a prime. \fi } \begin{document} \isthisprime{101}\newline \isthisprime{102} \end{document} The idea: the first part of the code decides whether or not <number> is a prime; if it is we set the counter \yes=1, otherwise it remains equal to 0. So if \yes=1 we check every number less than or equal to <number> to see if it is prime or not. At every occurrence of prime, we increase the counter \numberof primes. Hence \numberofprimes will determine the order of <number>, if it prime that is. The part where it decides whether or not the input is prime or not is fine. However, it cannot find its order. It just says that the order is 1 if the input is prime. It cannot see what is wrong with my code, so I would appreciate any advice! Thank you in advance.

  • Making geometric frieze (pattern) with tikz
    by Erwan on January 14, 2026 at 9:11 am

    i'm trying to do some geometric frieze with tikz. The last goal is to do a command to draw one of the 7 possible frieze (see wikipedia). But, first, i just do 1 frieze. Results: My code: \documentclass[tikz]{standalone} \begin{document} \newcommand{\footstep}[4]{ \begin{scope}[ xshift=#3cm, %for translation yshift=#4cm, %for translation xscale=#1, %for reflexion yscale=#2 %for reflexion ] \draw (1, 3) -- (1, 0); \draw (1, 0) -- (7, 0); \draw (6, 3) -- (7, 0); \draw (6, 3) -- (5, 0); \draw (5, 0) -- (4, 2); \draw (4, 2) -- (2, 0); \draw (2, 0) -- (1, 3); \end{scope} } \begin{tikzpicture}[rounded corners=1pt, very thick, scale=.75] \draw[help lines] (0,-1) grid (22,5); \footstep{1}{1}{0}{0} \footstep{1}{-1}{7}{3} \end{tikzpicture} \end{document} but i have to find the parameters by myself. I'd like something automatic. Something like : xshift = "scope width" yshift = "scope height" Thanks

  • tikz: using the pos key to place nodes along a plot
    by Jasper on January 11, 2026 at 7:39 pm

    In this tikz MWE, why is the node placement not even close to pos=0.7 on a plotted curve? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain = 0:2, samples = 100, variable = \y ] plot (\y*\y,\y) node[pos = 0.7, above left] {\(x=y^2\)} ; \end{tikzpicture} \end{document}

  • How get ISO math style with lua-unicode-math package?
    by murray on January 11, 2026 at 12:26 am

    The commented-out line in the source below, if used instead of the line preceding it, produces ISO-style for upper-case Greek math letters, namely, Italic insead of upright. How does one get the same result with lua-unicode-math instead of just unicode-math? % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage{fontspec,lua-unicode-math} %\usepackage[math-style=ISO]{unicode-math} % Italic upper-case Greek math \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] \begin{document} $a, z, B, X, \quad \alpha, \beta, \Gamma, \Xi $ \end{document}

  • Redefine `$...$` to `\(...\)`
    by weisj on January 10, 2026 at 2:44 pm

    The mathtools package can automatically insert italics correction when using \(...\) for inline math mode. See this answer. However, I much prefer $...$ for inline math as I find it more readable and comfortable to type on my keyboard layout. I am currently using the following hack to keep using the $...$ syntax while preserving the italics correction. \catcode`\$=13% \def$#1${\(#1\)}% I haven't had issues with it in my current document, but I was wondering whether there are reasons this might be a bad idea. I would image that if this was harmless the mathtools package would use it to also patch the $...$ syntax for the mathic feature. So my question is: Is this safe and are there any caveats I might be overseeing?

  • Rafael Bombelli's mathematical power notation
    by Eff on January 9, 2026 at 12:02 am

    In the 1572 algebra book L'Algebra by Rafael Bombelli, he uses his own notation for powers. I want to reproduce this notation in LaTeX. Below is a screenshot from the book that shows how he wrote to the sixth power, the fifth power, etc. In general, x to the power of n is written as n above a kind of circular arc. I have found a good example where it is made nicely in LaTeX. But I don't know how to reproduce it. Can anyone offer a solution to writing this power notation in LaTeX?

  • How can I make a multi-line table structure with repeated parameter values more visually appealing?
    by mingabua on January 7, 2026 at 6:07 pm

    I have the following table. I am particularly interested in columns 1-2. There, I have three different values of \mathcal{T} for each value of \mathcal{J}. Unfortunately, I find the current display somewhat meaningless. How can I optimize it and make it look better? \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs} \usepackage{multirow} \usepackage{array} \usepackage{rotating} % für sidewaystable \usepackage{lipsum} % für Blindtext \usepackage{geometry} \geometry{a4paper, margin=2.5cm} \begin{document} \section{Introduction} \lipsum[1-3] \begin{sidewaystable}[p] \centering \footnotesize \caption{Comprehensive performance analysis over 25 scenarios per instance. Values denote: \textbf{Min / Median / Max} (top) and \textbf{Std. Dev.} (bottom). Time components MP, SP, Heur, Branch are reported as percentages of Total Time.} \label{tab:comp_results_comprehensive} \setlength{\tabcolsep}{2pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{cc cc c cccccc c ccc c ccccc} \toprule % HEADER ROW 1 \multicolumn{2}{c}{\textbf{Inst.}} & \multicolumn{2}{c}{\textbf{Compact}} & & \multicolumn{6}{c}{\textbf{B\&P: Solution \& Reliability}} & & \multicolumn{3}{c}{\textbf{B\&P: Tree}} & & \multicolumn{5}{c}{\textbf{B\&P: Time Breakdown}} \\ \cmidrule(r){1-2} \cmidrule(lr){3-4} \cmidrule(lr){6-11} \cmidrule(lr){13-15} \cmidrule(l){17-21} % HEADER ROW 2 $|\mathcal{J}|$ & $|\mathcal{T}|$ & Time [s] & Gap [\%] & & $t_{tot}$ [s] & Gap [\%] & $t_{1st}$ [s] & $N_{Sol}$ & Opt? & Root Int. & & $D_{max}$ & Root Gap & Nodes & & $t_{MP} [\%]$ & $t_{SP} [\%]$ & $t_{Heur} [\%]$ & $t_{Root} [s]$ & $t_{Br} [\%]$ \\ \midrule % --- Block J = 5 --- \multirow{3}{*}{5} & 7 & \shortstack{10/12/15\\1.2} & \shortstack{0/0/0\\0} & & \shortstack{2/3/5\\0.8} & \shortstack{0/0/0\\0} & \shortstack{0.5/0.8/1\\0.2} & \shortstack{2/3/5\\1.1} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.2} & & \shortstack{1/1/1\\0} & \shortstack{0.5/1/2\\0.4} & \shortstack{1/1/1\\0} & & \shortstack{5/10/15\\2} & \shortstack{40/45/50\\3} & \shortstack{10/15/20\\4} & \shortstack{1/2/3\\0.5} & \shortstack{0/0/0\\0} \\ \addlinespace & 14 & \shortstack{40/45/55\\4.1} & \shortstack{0/0/0\\0} & & \shortstack{6/8/11\\1.5} & \shortstack{0/0/0\\0} & \shortstack{1/2/3\\0.5} & \shortstack{3/5/8\\1.5} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/5\\1} & \shortstack{0.2/0.8/1.5\\0.3} & \shortstack{1/5/12\\3} & & \shortstack{8/12/18\\3} & \shortstack{55/60/65\\4} & \shortstack{10/12/15\\2} & \shortstack{3/4/5\\1} & \shortstack{1/2/5\\1} \\ \addlinespace & 28 & \shortstack{150/180/210\\15} & \shortstack{0/0/0\\0} & & \shortstack{18/22/29\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{5/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/8/12\\3} & \shortstack{0/0.5/1\\0.2} & \shortstack{10/25/45\\10} & & \shortstack{10/15/20\\3} & \shortstack{70/75/80\\5} & \shortstack{5/8/10\\2} & \shortstack{10/12/15\\2} & \shortstack{2/5/8\\2} \\ \midrule % --- Block J = 10 (Base Case) --- \multirow{3}{*}{10} & 7 & \shortstack{90/110/140\\12} & \shortstack{0/0/0\\0} & & \shortstack{10/12/18\\2} & \shortstack{0/0/0\\0} & \shortstack{2/3/5\\1} & \shortstack{4/6/9\\2} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.1} & & \shortstack{1/1/3\\0.5} & \shortstack{1/1.5/2.5\\0.5} & \shortstack{1/1/3\\0.5} & & \shortstack{15/20/25\\4} & \shortstack{35/40/55\\6} & \shortstack{15/20/25\\3} & \shortstack{5/6/8\\1} & \shortstack{0/1/2\\0.5} \\ \addlinespace & 14 & \shortstack{1.1k/1.2k/1.5k\\150} & \shortstack{0/0/2\\0.5} & & \shortstack{35/45/60\\6} & \shortstack{0/0/0\\0} & \shortstack{10/15/20\\4} & \shortstack{8/12/18\\4} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/10/15\\4} & \shortstack{0.5/1.1/1.8\\0.4} & \shortstack{20/55/110\\25} & & \shortstack{12/18/22\\4} & \shortstack{50/58/65\\5} & \shortstack{8/10/15\\2} & \shortstack{15/20/25\\4} & \shortstack{5/10/15\\3} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{2/4.5/8\\1.8} & & \shortstack{95/115/145\\14} & \shortstack{0/0/0\\0} & \shortstack{30/45/60\\10} & \shortstack{15/25/40\\8} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{20/35/60\\12} & \shortstack{0.1/0.4/0.9\\0.2} & \shortstack{150/320/580\\110} & & \shortstack{10/15/20\\3} & \shortstack{65/72/85\\8} & \shortstack{2/5/8\\2} & \shortstack{40/55/70\\10} & \shortstack{10/15/20\\5} \\ \midrule % --- Block J = 15 --- \multirow{3}{*}{15} & 7 & \shortstack{480/540/650\\55} & \shortstack{0/0/1.5\\0.3} & & \shortstack{22/29/40\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{6/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/8\\2} & \shortstack{1.5/2.2/3.5\\0.8} & \shortstack{1/5/12\\3} & & \shortstack{20/25/30\\4} & \shortstack{40/45/55\\4} & \shortstack{15/20/25\\3} & \shortstack{10/12/18\\3} & \shortstack{1/3/5\\1} \\ \addlinespace & 14 & \shortstack{TL/TL/TL\\0} & \shortstack{5/8/12\\2} & & \shortstack{80/98/130\\12} & \shortstack{0/0/0\\0} & \shortstack{25/35/50\\8} & \shortstack{20/30/50\\10} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{10/25/45\\10} & \shortstack{0.8/1.5/2.2\\0.6} & \shortstack{80/150/280\\45} & & \shortstack{10/15/20\\3} & \shortstack{55/65/75\\7} & \shortstack{5/8/12\\2} & \shortstack{35/45/60\\8} & \shortstack{8/12/18\\4} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{12/18/25\\4} & & \shortstack{210/245/320\\35} & \shortstack{0/0/0.1\\0.02} & \shortstack{80/120/180\\25} & \shortstack{40/60/90\\15} & \shortstack{0/1/1\\0.2} & \shortstack{0/0/0\\0} & & \shortstack{45/80/120\\25} & \shortstack{0.2/0.6/1.2\\0.3} & \shortstack{500/1.2k/3.5k\\850} & & \shortstack{5/10/15\\3} & \shortstack{70/80/90\\9} & \shortstack{1/3/5\\1} & \shortstack{80/110/150\\20} & \shortstack{15/20/25\\5} \\ \bottomrule \end{tabular} \end{sidewaystable} \section{Results Discussion} \lipsum[4-6] \section{Conclusion} \lipsum[7-8] \end{document}

  • Is that possible to balance two columns `longtblr` with `tabularray` package?
    by Explorer on January 6, 2026 at 12:19 pm

    This question is nearly the same as this: \documentclass[twocolumn]{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{cuted} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \begin{strip} \lipsum[2] \bigskip \hrule \bigskip \end{strip} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]}} 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{document} which gives: Noted that I want to typeset something like a university transcript. Thus, unbalanced layout is not elegant, is that possible to hack with some tricks? Edited: longtblr solution conflicted with multicol: \documentclass{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{multicol} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \lipsum[2] \bigskip \hrule \bigskip \begin{multicols}{2} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]},rowhead=1} Header 1 & Header 2 & Header 3 \\ 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{multicols} \end{document} It failed resulted: Edited Again: Learning from David's comment, and this 13-years-old solution, I still found some drawbacks with longtable: \documentclass[11pt, a4paper]{article} \usepackage[paperheight=18cm]{geometry} \usepackage{lipsum} \usepackage{longtable} \usepackage{multicol} \newsavebox\ltmcbox \newcounter{entryno} \setcounter{entryno}{1} \def\tabline{Test & \the\value{entryno} & Description\addtocounter{entryno}{1}\\\hline} \def\tablines{\tabline\tabline\tabline\tabline} \def\tabliness{\tablines\tablines\tablines\tablines} \begin{document} \section{Test} \lipsum[1] \begin{multicols}{2} \medskip \setbox\ltmcbox\vbox{ \makeatletter\col@number\@ne \begin{longtable}{|l|l|l|} \hline \tabliness\tabliness\tabliness\tabliness\tabliness\tabliness \end{longtable} \unskip \unpenalty \unpenalty} \unvbox\ltmcbox \medskip \end{multicols} \lipsum[2] \end{document}

  • Where to post / read news about TeX/ LaTeX and similar?
    by topskip on January 5, 2026 at 9:52 am

    This is not a technical question about LaTeX or TeX. Imagine I have created a cool LaTeX package or a new TeX engine or something similar. Is there a good place to post this? I see special mailing lists (for example tex-live), these don't seem to fit. Where can / should I place announcements like this?

  • circuitikz: set 'rounded corners' of a 'oscopeshape' to a smaler value
    by cis on January 4, 2026 at 11:23 pm

    Due to a chat-talk with @Rmano, I asked myself wether there is a methode to set the rounded corners of a oscopeshape to 0pt or to a very small value. The rounded corners can become weird, if I set a small scale: \documentclass[margin=10pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[font=\footnotesize] \node[oscopeshape] (A){scale=1}; \node[oscopeshape, right of=A, scale=0.5](B) {scale=0.5}; \node[oscopeshape, right of=B, scale=0.35] {scale=0.35}; \end{circuitikz} \end{document}

  • Is there an incompatibility between the lettrine and beamer packages?
    by AndréC on January 4, 2026 at 8:24 pm

    The sentence below wraps to a new line too soon: the word "rapporteur" should not be on a new line. This problem occurs whenever the sentence is too long to fit on a single line. \documentclass[aspectratio=1610,12pt,french]{beamer} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage[locale=FR]{siunitx} \usepackage{lettrine} \usepackage{tikz} \usetikzlibrary{angles} \begin{document} \begin{frame}{} \lettrine[lraise=.25]{S}{ans} utiliser de rapporteur donner la mesure de chacun des angles sachant que $\widehat{xOz}=\ang{60}$. \bigskip \lettrine[lraise=.25]{S}{ans} utiliser de rapporteur donner la mesure de chacun des angles sachant que l'angle xOz mesure 60 degrés. \end{frame} \end{document} Here's what's displayed:

  • circuitikz: internal node annotations (maybe 'path picture'?) to a styled 'muxdemux'
    by cis on January 3, 2026 at 3:35 pm

    I need a styled muxdemux like this. I asked myself: is it possible to get some annotations with path picture here (as a style addition)? For example a line and a node, which I only was able to add outside the style definition in the usual way. PS: Using a pic is clear; but that's a different topic. \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \ctikzset{muxdemux/outer label font={\tiny\ttfamily\color{blue}}} \tikzset{ mychip/.style={muxdemux, muxdemux def={ Lh=4, Rh=4, w=6,% sizes NR=0, NL=0, NB=3, NT=3,}, muxdemux label={ T1=T1, T2=T2, T3=T3, B1=B1, B2=B2, B3=B3, BR1=br1, BL1=bl1, BR2=br2, BL2=bl2, BR3=br3, BL3=bl3,% TR1=tr1, TL1=tl1, TR2=tr2, TL2=tl2, TR3=tr3, TL3=tl3,% }, alias=FG, % Does not have any effect ====================== path picture={%% \draw[red] (FG.bbpin 2) -- (FG.btpin 1) node[font=\tiny, align=center, midway, below, sloped] {internal annotation \\ works not}; },%% }, } \node[mychip]{chip}; \draw[brown] (FG.bbpin 2) -- (FG.btpin 3) node[font=\tiny, align=center, midway, below, sloped] {external annotation \\ works}; \end{circuitikz} \end{document}

  • How can I make the marginnote appear on the margin side of the column they were called from in a two-column book? [closed]
    by stefaniecg on January 2, 2026 at 11:39 am

    My problem is that in a two-column book, when the marginnote is placed as the last word (or near the last word) of the left column line end, the note jumps to the right margin instead of being placed on the left margin. How can I make the marginnote appear on the margin side of the column they were called from in a two-column book? \documentclass{book} \usepackage{lipsum} \usepackage{geometry} \usepackage{marginnote} \begin{document} \newgeometry{left=20mm,right=20mm,top=20mm,bottom=20mm,twocolumn=true,marginparwidth=15mm} \edef\marginnotetextwidth{\the\textwidth} \chapter{A short story} Lorem ipsum ipsum \marginnote{ok1} OK1 dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, \marginnote{wrong1} WRONG1 placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. \marginnote{wrong2} WRONG2 Mauris utleo. Cras viverra metus rhoncus sem. Nulla et lectusvestibulum urna fringilla ultrices. Phasellus eu tellussit amet tortor gravida placerat. Integer sapien est,iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. \marginnote{ok2} OK2 Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollisac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \lipsum[1-3] Lorem ipsum dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam \marginnote{ok3} OK3 arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \marginnote{ok4} OK4 Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris utleo. Cras \marginnote{ok5} OK5 viverra metus rhoncus sem. Nulla et lectusvestibulum urna fringilla ultrices. Phasellus eu tellussit amet tortor gravida placerat. Integer sapien est,iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollisac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus \marginnote{ok6} OK6. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \end{document}

  • How to get spaced dots in unicode-math
    by dedded on December 31, 2025 at 3:10 pm

    The unicode-math package re-defines ellipsis to be the ellipsis character in whatever font you're using, instead of spaced dots. This looks bad in my opinion, and violates the guidance on ellipses in every style guide I own. A solution for \ldots is provided here: variations-in-ldots. But that solution does not fix \cdots, \vdots, or \ddots. I managed to find a solution for \cdots that works in this MWE, but seems to fail in other instances that I haven't figured out a reliable way to reproduce. And I can't figure out a solution for \vdots or \ddots at all. \documentclass{article} \usepackage{unicode-math} \AtBeginDocument{ % From https://tex.stackexchange.com/questions/120627/variations-in-ldots \renewcommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}} \renewcommand\cdots{\mathinner{\cdotp\cdotp\cdotp}} % sometimes works %\renewcommand\vdots{\mathinner{\vdotp\vdotp\vdotp}} % doesn't work %\renewcommand\ddots{\mathinner{\ddotp\ddotp\ddotp}} % doesn't work } \begin{document} $\dots, \ldots, \cdots, \vdots, \ddots$ \end{document} Found an example of where my solution for \cdots didn't work. It's when \dots is used instead of \cdots explicitly to centrally place dots: \documentclass{article} \usepackage{unicode-math} \AtBeginDocument{ \renewcommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}} \renewcommand\cdots{\mathinner{\cdotp\cdotp\cdotp}} % sometimes works } \begin{document} $x+\dots+ y$ % Do not get spaced dots $x+\cdots+ y$ % Do get spaced dots \end{document}

  • Bizarre interaction between `microtype` package and \eqref macro
    by John Pardon on December 30, 2025 at 11:14 pm

    I would have thought that if I declare \let\stdeqref\eqref, then the \stdeqref macro and the \eqref macro would be interchangeable. But here is an example where it fails! Moreover, this failure is (somehow) caused by the microtype package?! What is going on, and how to fix it? \documentclass{article} \usepackage{microtype} \usepackage{amsmath} \let\stdeqref\eqref \begin{document} \begin{equation}\label{a} A \end{equation} This is good spacing: \eqref{a}\allowbreak\eqref{a} This is bad spacing: \stdeqref{a}\allowbreak\stdeqref{a} But the bad spacing becomes good if we remove microtype! \end{document} The reason I'm asking is that I would like to redefine the \eqref macro in a way which uses the usual \eqref macro as a subcomponent, via the usual strategy I've seen time and time again on this site: \let\stdeqref\eqref \renewcommand\eqref[1]{Something fancy containing \stdeqref{#1} etc.} but that doesn't work anymore if \let isn't behaving as expected . . .

  • Use some characters from the text font instead of the corresponding ones from mtpro2
    by ncant on December 29, 2025 at 2:10 pm

    I'm typesetting my math document in Times New Roman using XeLaTeX and the fontspec package. I'm using mtpro2 as the math font, but I've noticed that certain letters, such as u, v and w, look quite different from their TNR italic counterparts (maybe because it's advertised as a Times-compatible font). Considering I'm already using the fontspec package, I tried ditching mtpro2 entirely and using other math fonts. I consulted the LaTeX Stack Exchange master list of maths fonts and tried XITS Math, TeX Gyre Termes Math and STIX Two Math. However, these fonts lack some features that I really like about mtpro2, such as round brackets (especially for matrices) and the letter z identical to the letter z in TNR. mtpro2 is here to stay. Next, I found the 'mathastext' package, which enables alphanumeric glyphs from the text font to be used in maths environments. For example, \usepackage[basic, italic]{mathastext} replaces all the alphanumeric characters in the maths font with the corresponding characters in the text font. However, this approach led me to another issue: the spacing between letters is awful, especially the subscripted ones. Since my only issue is with the letters u, v, and w, is there a way to just replace those three and use the rest of the mtpro2 glyphs? The code I'm using for my document is really bog standard: \documentclass{memoir} % Throw an error if this is not XeLaTeX. \usepackage{ifxetex} \RequireXeTeX \usepackage[lite]{mtpro2} \usepackage[no-math]{fontspec} \setmainfont{Times New Roman} \begin{document} \end{document} Any help would be appreciated.