• \refstepcounter in hyperref does not work with \offinterlineskip
    by Alex Degtyarev on February 22, 2026 at 12:34 am

    I have discovered a weirdest behavior of \refstepcounter in hyperref: it does not work with \offinterlineskip. Here is a minimal example: %Format: latex \documentclass{amsart} \usepackage{hyperref} \begin{document} text \newpage \begingroup \offinterlineskip \ialign{\strut\refstepcounter{section}\thesection#\hss\cr \label1\cr \label2\cr \label3\cr \label4\cr \crcr} \endgroup \ref1 \ref2 \ref3 \ref4 \newpage refs will lead here \end{document} All links lead to random places in the text. Can this be fixed? My current workaround is spelling out \offinterlaneskip with the baselineskip part removed.

  • What is the best way to draw a potato (like found in vector analysis/continuum mechanics courses)
    by Dimitrios ANAGNOSTOU on February 21, 2026 at 11:34 pm

    I apologized if this is a duplicate. What is the best way to draw such figures with tikz (or other packages)? For the time being just the potato like figure. I do not care for the vectors and the infinitesimal mass element. I do not want someone to do the work for me. Just some advice or suggestions.

  • Remove \\ from a value/command
    by ViToni on February 21, 2026 at 7:49 pm

    For a paper I have a rather long title which is setup as \title{Some very long text\\which\\needed line breaks} so that it looks fine on the cover page. However I get an error from hyperref: Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\\' on input line 944. which I assume is due to: \hypersetup{ ... pdftitle={\thetitle}, .... } Can I somehow remove the line breaks from \thetitle to allow usage with hyperref?

  • Top right math kern value not being used with \directlua code (bug?)
    by Apoorv Potnis on February 21, 2026 at 7:30 pm

    I want to add a topright math kern (aka cut-in or staircase kerning) to DOUBLE-STRUCK CAPITAL R (Hex value: 0x211D, Code point: U+211D). I tried the method as shown in this answer of mickep, but it does not seem to work here. \documentclass{article} \usepackage{fontsetup} \directlua{ local kerns = { ["NewCMMath-Book"] = { [0x211D] = { topright = { { kern = -500 } } }, } } local function addkerns(tfmdata) if tfmdata.mathparameters then local kerns = kerns[tfmdata.properties.fontname] if kerns then local characters = tfmdata.characters for unicode, specification in pairs(kerns) do local character = characters[unicode] if character and not character.mathkerns then character.mathkerns = specification end end end end end fonts.handlers.otf.features.register { name = "mathkerns", description = "additional math kerns", default = true, initializers = { position = 1, base = addkerns, node = addkerns, } } } \usepackage{lua-visual-debug} % The absence of a red rectangle between the doublestruck R and the superscript n seems to indicate that math kerning is not being used, if I understand correctly. \begin{document} \(\symbb{R}^n\) \end{document} While I am using LuaLaTeX with unicode-math, answers for other engines such as ConTeXt and OpTeX are also welcome, if the resulting code is different. Edit: I have tried loading the fonts manually, but that also does not seem to work. \documentclass{article} \directlua{ local kerns = { ["NewCMMath-Book"] = { [0x211D] = { topright = { { kern = -100 } } } } } local function addkerns(tfmdata) if tfmdata.mathparameters then local kerns = kerns[tfmdata.properties.fontname] if kerns then local characters = tfmdata.characters for unicode, specification in pairs(kerns) do local character = characters[unicode] if character and not character.mathkerns then character.mathkerns = specification end end end end end fonts.handlers.otf.features.register { name = "mathkerns", description = "additional math kerns", initializers = { position = 1, base = addkerns, node = addkerns, } } } \usepackage{unicode-math} \setmainfont{NewCM10-Book.otf} \setmathfont[ StylisticSet={3}, BoldFont = NewCMMath-Bold.otf, RawFeature=+mathkerns ]{NewCMMath-Book.otf} \usepackage{lua-visual-debug} \lvdset{glyph={show=true}} \begin{document} \(\symbb{R}^n\) \end{document}

  • Using OpenType MATH typesetting features with glyphs from a traditional math font
    by Apoorv Potnis on February 21, 2026 at 7:13 pm

    Can I set manually and use features of OpenType MATH fonts while using glyphs from traditional fonts? For example, as shown below, suppose I want to use the traditional Knuth calligraphic letters with the New Computer Modern fonts. The calligraphic letters provided by NewCM have math kern (aka cut-in or staircase kerning) data with them, which the Knuth calligraphic letters (and matching lowercase calligraphic letters provided by Anthony Phan) lack, as they are not a part of an OpenType MATH font. Is it possible to use Knuth/Phan letters with math kerns? \documentclass{article} \usepackage[newcmbb]{fontsetup} % Below code copied from here: https://tex.stackexchange.com/a/373539/128462. \DeclareFontFamily{U}{mathc}{} \DeclareFontShape{U}{mathc}{m}{it}% {<->s*[1.03] mathc10}{} \DeclareMathAlphabet{\lmathccal}{U}{mathc}{m}{it} % \DeclareMathAlphabet\cmmathcal{OMS}{cmsy}{m}{n} % \renewcommand{\symcal}{\lmathccal} \usepackage{lua-visual-debug} % The red square between NewCM calligrahpic O and the subscript italic i shows that this much amount math kerning is being used, if I understand correctly. \begin{document} \(\symcal{O}_i\lmathccal{O}_i\) \end{document} While I am using LuaLaTeX with unicode-math, answers for other engines such as ConTeXt and OpTeX are also welcome.

  • How to manually install packages in a standard texmf directory structure?
    by Explorer on February 21, 2026 at 6:13 pm

    I want to install mtpro2 fonts into my texmf-local directory, here below are two directory files: texmf-local: $ tree -L 3 . |-- bibtex | |-- bib | | `-- local | `-- bst | `-- local |-- doc | |-- local | `-- lualatex | `-- luadraw |-- dvips | `-- local |-- fonts | |-- source | | `-- local | |-- tfm | | `-- local | |-- type1 | | `-- local | `-- vf | `-- local |-- ls-R |-- metapost | `-- local |-- tex | |-- latex | | `-- local | |-- lualatex | | `-- luadraw | `-- plain | `-- local |-- tlpkg `-- web2c And what I get, the mtpro2-fonts directory: $ tree . |-- doc | `-- fonts | `-- mtpro2 | |-- EULA.txt | |-- Test_latex.pdf | |-- Test_latex.tex | |-- guide2.pdf | `-- mtpro2.pdf |-- dvips | `-- mtpro2 | `-- mtpro2.map |-- fonts | |-- map | | `-- dvips | | `-- mtpro2 | | `-- mtpro2.map | |-- tfm | | `-- pctex | | `-- mtpro2 | | |-- mt2bbdf.tfm | | |-- mt2bbds.tfm | | |-- mt2bbdt.tfm | | |-- mt2bbf.tfm | | |-- mt2bbif.tfm | | |-- mt2bbis.tfm | | |-- mt2bbit.tfm | | |-- mt2bbs.tfm | | |-- mt2bbt.tfm | | |-- mt2bexa.tfm | | |-- mt2bmff.tfm | | |-- mt2bmfs.tfm | | |-- mt2bmft.tfm | | |-- mt2bmif.tfm | | |-- mt2bmis.tfm | | |-- mt2bmit.tfm | | |-- mt2bmsf.tfm | | |-- mt2bmss.tfm | | |-- mt2bmst.tfm | | |-- mt2bsyaf.tfm | | |-- mt2bsyas.tfm | | |-- mt2bsyat.tfm | | |-- mt2bsyf.tfm | | |-- mt2bsys.tfm | | |-- mt2bsyt.tfm | | |-- mt2exa.tfm | | |-- mt2exe.tfm | | |-- mt2exf.tfm | | |-- mt2exg.tfm | | |-- mt2hbif.tfm | | |-- mt2hbis.tfm | | |-- mt2hbit.tfm | | |-- mt2hexa.tfm | | |-- mt2hrbdf.tfm | | |-- mt2hrbds.tfm | | |-- mt2hrbdt.tfm | | |-- mt2hrbf.tfm | | |-- mt2hrbs.tfm | | |-- mt2hrbt.tfm | | |-- mt2hsyaf.tfm | | |-- mt2hsyas.tfm | | |-- mt2hsyat.tfm | | |-- mt2hsyf.tfm | | |-- mt2hsys.tfm | | |-- mt2hsyt.tfm | | |-- mt2mbf.tfm | | |-- mt2mbs.tfm | | |-- mt2mbt.tfm | | |-- mt2mcf.tfm | | |-- mt2mcs.tfm | | |-- mt2mct.tfm | | |-- mt2mff.tfm | | |-- mt2mfs.tfm | | |-- mt2mft.tfm | | |-- mt2mif.tfm | | |-- mt2mis.tfm | | |-- mt2mit.tfm | | |-- mt2msf.tfm | | |-- mt2mss.tfm | | |-- mt2mst.tfm | | |-- mt2syaf.tfm | | |-- mt2syas.tfm | | |-- mt2syat.tfm | | |-- mt2syf.tfm | | |-- mt2sys.tfm | | |-- mt2syt.tfm | | |-- mt2xl.tfm | | `-- mt2xxxl.tfm | `-- type1 | `-- pctex | `-- mtpro2 | |-- mt2bbdf.pfb | |-- mt2bbdf.pfm | |-- mt2bbds.pfb | |-- mt2bbds.pfm | |-- mt2bbdt.pfb | |-- mt2bbdt.pfm | |-- mt2bbf.pfb | |-- mt2bbf.pfm | |-- mt2bbif.pfb | |-- mt2bbif.pfm | |-- mt2bbis.pfb | |-- mt2bbis.pfm | |-- mt2bbit.pfb | |-- mt2bbit.pfm | |-- mt2bbs.pfb | |-- mt2bbs.pfm | |-- mt2bbt.pfb | |-- mt2bbt.pfm | |-- mt2bexa.pfb | |-- mt2bexa.pfm | |-- mt2bmff.pfb | |-- mt2bmff.pfm | |-- mt2bmfs.pfb | |-- mt2bmfs.pfm | |-- mt2bmft.pfb | |-- mt2bmft.pfm | |-- mt2bmif.pfb | |-- mt2bmif.pfm | |-- mt2bmis.pfb | |-- mt2bmis.pfm | |-- mt2bmit.pfb | |-- mt2bmit.pfm | |-- mt2bmsf.pfb | |-- mt2bmsf.pfm | |-- mt2bmss.pfb | |-- mt2bmss.pfm | |-- mt2bmst.pfb | |-- mt2bmst.pfm | |-- mt2bsyaf.pfb | |-- mt2bsyaf.pfm | |-- mt2bsyas.pfb | |-- mt2bsyas.pfm | |-- mt2bsyat.pfb | |-- mt2bsyat.pfm | |-- mt2bsyf.pfb | |-- mt2bsyf.pfm | |-- mt2bsys.pfb | |-- mt2bsys.pfm | |-- mt2bsyt.pfb | |-- mt2bsyt.pfm | |-- mt2exa.pfb | |-- mt2exa.pfm | |-- mt2exe.pfb | |-- mt2exe.pfm | |-- mt2exf.pfb | |-- mt2exf.pfm | |-- mt2exg.pfb | |-- mt2exg.pfm | |-- mt2hbif.pfb | |-- mt2hbif.pfm | |-- mt2hbis.pfb | |-- mt2hbis.pfm | |-- mt2hbit.pfb | |-- mt2hbit.pfm | |-- mt2hexa.pfb | |-- mt2hexa.pfm | |-- mt2hrbdf.pfb | |-- mt2hrbdf.pfm | |-- mt2hrbds.pfb | |-- mt2hrbds.pfm | |-- mt2hrbdt.pfb | |-- mt2hrbdt.pfm | |-- mt2hrbf.pfb | |-- mt2hrbf.pfm | |-- mt2hrbs.pfb | |-- mt2hrbs.pfm | |-- mt2hrbt.pfb | |-- mt2hrbt.pfm | |-- mt2hsyaf.pfb | |-- mt2hsyaf.pfm | |-- mt2hsyas.pfb | |-- mt2hsyas.pfm | |-- mt2hsyat.pfb | |-- mt2hsyat.pfm | |-- mt2hsyf.pfb | |-- mt2hsyf.pfm | |-- mt2hsys.pfb | |-- mt2hsys.pfm | |-- mt2hsyt.pfb | |-- mt2hsyt.pfm | |-- mt2mbf.pfb | |-- mt2mbf.pfm | |-- mt2mbs.pfb | |-- mt2mbs.pfm | |-- mt2mbt.pfb | |-- mt2mbt.pfm | |-- mt2mcf.pfb | |-- mt2mcf.pfm | |-- mt2mcs.pfb | |-- mt2mcs.pfm | |-- mt2mct.pfb | |-- mt2mct.pfm | |-- mt2mff.pfb | |-- mt2mff.pfm | |-- mt2mfs.pfb | |-- mt2mfs.pfm | |-- mt2mft.pfb | |-- mt2mft.pfm | |-- mt2mif.pfb | |-- mt2mif.pfm | |-- mt2mis.pfb | |-- mt2mis.pfm | |-- mt2mit.pfb | |-- mt2mit.pfm | |-- mt2msf.pfb | |-- mt2msf.pfm | |-- mt2mss.pfb | |-- mt2mss.pfm | |-- mt2mst.pfb | |-- mt2mst.pfm | |-- mt2syaf.pfb | |-- mt2syaf.pfm | |-- mt2syas.pfb | |-- mt2syas.pfm | |-- mt2syat.pfb | |-- mt2syat.pfm | |-- mt2syf.pfb | |-- mt2syf.pfm | |-- mt2sys.pfb | |-- mt2sys.pfm | |-- mt2syt.pfb | |-- mt2syt.pfm | |-- mt2xl.pfb | |-- mt2xl.pfm | |-- mt2xxxl.pfb | `-- mt2xxxl.pfm |-- source | `-- latex | `-- mtpro2 | |-- mtpro2.dtx | `-- mtpro2.ins |-- tex | |-- latex | | `-- mtpro2 | | |-- mtpro2.sty | | |-- omslbm.fd | | |-- umt2bb.fd | | |-- umt2hrb.fd | | |-- umt2mf.fd | | `-- umt2ms.fd | `-- plain | `-- mtpro2 | `-- mtp2.tex `-- tpm `-- package `-- mtp2fonts.tpm What I need to do, is moving these files into texmf-local with proper file-system hierarchy. Now I have the following folder to move: tree -L 1 . |-- doc |-- dvips |-- fonts |-- source |-- tex `-- tpm while texmf-local, that is: $ tree -L 1 . |-- bibtex |-- doc |-- dvips |-- fonts |-- ls-R |-- metapost |-- tex |-- tlpkg `-- web2c Now turns to my first-step question: There is no source and tpm folder in my texmf-local, to install, should I just add these two folders to ./texmf-local? And the other fours folders, is my remaining second question: For example, take doc into consideration, I have: $ tree . |-- doc | `-- fonts | `-- mtpro2 | |-- EULA.txt | |-- Test_latex.pdf | |-- Test_latex.tex | |-- guide2.pdf | `-- mtpro2.pdf ... while the targeted texmf-local/doc: $ tree . |-- doc | |-- local | `-- lualatex | `-- luadraw Should I just copy /doc/fonts into /texmf-local/doc? or inside /texmf-local/doc/local? What is the folder local here for(Accroding to texdoc tds, section2.3, that is for local add packages, but lualatex/luadraw which installed by l3build install do something looks not very standard)? Or in a word, how could I copy the mtpro2-fonts files into my texmf-local with the proper directory location properly according to related TDS standard?

  • Restricting the area in which text is typeset in letters
    by Stefan Müller on February 21, 2026 at 4:07 pm

    I want to write a letter template. The code below works but has the disadvantage that one has to state how many lines a paragraph has, so that it does not spill over into the margin where the details about the university are. This is done by \pshape. The second page is supposed to use all the available space. So no \pshape is necessary here. I think there is a conceptual mistake in this code. LaTeX should know about the region it can use. Is there a way to do this with paper size or something so that \pshapeis not necessary any longer? \documentclass[% a4paper, foldmarks=true, foldmarks=blmTP, fromlogo=true, locfield=wide, refline=nodate, firstfoot=false, pagenumber=headright ]{scrlttr2} \setlength{\textwidth}{160mm}% \addtolength{\textheight}{5\baselineskip} \addtoplength{toaddrvpos}{-16mm} \setplength{refvpos}{9,5cm} %\addtoplength{refhpos}{15mm} \setplength{locvpos}{50mm} \setplength{locwidth}{50mm} %\setplength{refhpos}{6mm} % it doesn't work for left margin \setplength{lochpos}{4mm} % right margin \setplength{locheight}{22,2cm} \usepackage{libertine} % XeLaTeX + libertine + MnSymbol (math symbols) create problems \renewcommand\ttdefault{lmtt} % change typewriter font to lmodern (smaller than tt in libertine)mtt} \usepackage{lipsum} %%%%%%%%%%%%%%%%%%%%%%% %%% Author's Metadata \newcommand*\sender{Stefan Müller} % sender's name \newcommand*\degree{Prof. Dr.} % sender's degree \newcommand*\authortitle{\degree\ \sender } % sender: degree + name \newcommand*\mail{St.Mueller@hu-berlin.de} % sender's e-mail \newcommand*\website{https://hpsg.hu-berlin.de/\~{}stefan/} % sender's website \newcommand*\officehour{Montag, 14:00–15:00} % office hours \newcommand*\telf{$+$49\,30\,2093-9631} \newcommand*\addressee{Prüfungsbüro\\ -- im Hause --} \def\pshape#1{% \parshape #1 \pshapexiicm{#1} 0pt 16cm } \def\pshapexiicm#1{% \ifnum#1>1 0pt 12,5cm \expandafter \pshapexiicm\expandafter{\the\numexpr#1-1\expandafter\relax\expandafter}\fi} \setkomavar{location}{\begin{tabular}[t]{l@{}} % Faculty {\footnotesize \textbf{Sprach- und}}\\[-1mm] {\footnotesize \textbf{literaturwissenschaftliche}}\\[-1mm] {\footnotesize \textbf{Fakultät}}\\[3mm] % Institute {\footnotesize Institut für deutsche Sprache}\\[-1mm] {\footnotesize und Linguistik}\\[3mm] {\scriptsize Sprachwissenschaft des Deutschen,}\\[-1mm] % Area {\scriptsize Syntax}\\[3mm] % Author {\scriptsize \textbf{\authortitle}}\\[-1mm] {\scriptsize \mail }\\[-1mm] {\scriptsize \website }\\[8mm] % Date {\scriptsize \textbf{Datum:}}\\[-1mm] {\scriptsize \usekomavar{date}}\\[37mm] % Address post {\scriptsize \textbf{Postanschrift:}}\\[-1mm] {\scriptsize Humboldt-Universität zu Berlin }\\[-1mm] {\scriptsize Unter den Linden 6 }\\[-1mm] {\scriptsize 10099 Berlin }\\[-1mm] {\scriptsize Telefon 030 54321 }\\[20mm] % Address office {\scriptsize \textbf{Sitz:}}\\[-1mm] {\scriptsize Seminargebäude am Hegelplatz }\\[-1mm] {\scriptsize hegelplatz 1 }\\[-1mm] {\scriptsize 1115 Berlin }\\[-1mm] {\scriptsize Raum R1411}\\[44,5mm] % Consultation hours {\scriptsize \textbf{Sprechzeiten:}}\\[-1mm] {\scriptsize Mo: 23:00--23:15}\\[-1mm] %% Bank account % {\scriptsize \textbf{Bankverbindung:}}\\[-1mm] % {\scriptsize Deutsche Bank PGK AG}\\[-1mm] % {\scriptsize BIC/SWIFT: DEUTDED110}\\[-1mm] % {\scriptsize IBAN: DE 95 1007 0848 0512 620601} \end{tabular} } \begin{document} \begin{letter}{ %% ADDRESS (see texfiles/localmetadata for the commands) \tiny{ HU | Sprach- und literaturwissenschaftliche Fakultät,\\ Institut für deutsche Sprache und Linguistik | 10099 Berlin}% % \\ \vspace{1cm} % %%ADDRESSEE (specify above) \footnotesize{ \addressee} } \setkomavar{subject}{Some subject/Betreff} %% OPENING \opening{Sehr geehrte Damen und Herren,} %\opening{To whom it may concern,} %% CONTENT OF LETTER \pshape{24} \lipsum[1] \pshape{18} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, 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. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. \closing{Best wishes} \end{letter} \end{document}

  • Latex: Tikz - rectangle to inherit the width of another rectangle
    by GJW on February 21, 2026 at 1:44 pm

    I would like node B to have exactly the same width as node A, without explicitly specifying a fixed dimension, with the following constraints: The two nodes are not adjacent in the source code. I do not want to hard-code a width (e.g., minimum width=3cm). Node A will always be at least as wide as node B. I would prefer a solution that does not rely on manually computing dimensions via \path let unless necessary. Here is a minimal example illustrating what I currently have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node [draw] (A) {Some text}; \path let \p1 = (A.south west), \p2 = (A.north east) in node [draw, minimum width=\x2-\x1-\pgflinewidth, minimum height=\y2-\y1-\pgflinewidth, below right] at ([yshift={\pgflinewidth}]A.south west) {more}; \end{tikzpicture} \end{document}

  • How to set anchor for chemove in the right place?
    by Solarflares on February 21, 2026 at 12:55 pm

    I want to draw an arrow with chemmove to represent the movement of an electron pair. \documentclass{article} \usepackage{chemfig} \begin{document} \setchemfig{atom sep=7mm} \setchemfig{ arrow style={,,,thick} } \schemestart[][] \chemfig{\charge{90=\|,180=\|,270=\|}{Br}-@{end}H} \+ \arrow{0}[,0] \chemfig{H-[:52]@{start}\charge{45=\|,135=\|}{O}-[:-52]H} \arrow \chemfig{\chemabove[0pt]{\charge{45=\|}{O}}{\hspace{-4mm}\scriptstyle\oplus}(-[:-30]H)(-[:90]H)(-[:-150]H)} \+ \chemabove[2pt]{\chemfig{\charge{0=\|,90=\|,180=\|,270=\|}{Br}}}{\hspace{7mm}\scriptstyle\ominus} % \chemmove{ \draw[thick, ->,shorten <=2pt, shorten >=2pt] (start).. controls +(north west:1.5cm) and +(north:1cm).. (end); } \schemestop \end{document} The output is not as expected (expected: red arrow): What is the problem? Do I set the anchors (@start / @end ) in the wrong place? Edit: My MWE works with pdftex (see picture below ), but not with xelatex (see picture above)

  • Directlua can not add options to tikz node
    by Norodix on February 21, 2026 at 12:37 pm

    I'm trying to set up some parameters of nodes from lua code. I don't understand why the first version works but not the second. \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [ color=\directlua{ tex.print("red") } ] {A}; \node [ \directlua{ tex.print("color=red") } ] {B}; \end{tikzpicture} \end{document} To me it looks like that these two directlua sections should produce the exact same output, but B fails with the following error message: ! Package pgfkeys Error: I do not know the key '/tikz/color=red' and I am going to ignore it. Perhaps you misspelled it.

  • QED symbol at end of align blocks final equation number
    by Niles on February 21, 2026 at 9:56 am

    I'm trying to use \qedhere with the ams classes to set a proof endmark at the end of an align environment. But doing so removes the number from that equation! This problem doesn't happen with a single numbered equation. Here are some examples. In the last one, I have a sort of hack from this question that adds a paragraph break and then a negative \vspace. But, the spacing isn't quite right and I wouldn't want to manually adjust it for each different environment. I've also seen a similar suggestion for a multi-line display. Is there not a better way? \documentclass{amsart} \begin{document} \begin{proof} Numbered equation, qedhere at right. \begin{equation} x+y\qedhere \end{equation} \end{proof} \begin{proof} Align environment; qed on newline \begin{align} x & = 2\\ y & = 3 \end{align} \end{proof} \begin{proof} Align environment; using qedhere blocks the final equation number \begin{align} x & = 2\\ y & = 3\qedhere % <---- want a number here too \end{align} \end{proof} \begin{proof} Align environment; paragraph break and negative vspace \begin{align} x & = 2\\ y & = 3 \end{align} \par\nopagebreak\vspace{-\baselineskip}\mbox{} \end{proof} \end{document} Note: Several related questions, like this one for the cases environment, have comments suggesting that it's just bad style to end a proof with a displayed equation. Leaving that aside, I'm really interested in different endmarks for different environments. The proof environment is just the simplest way to display the issue with \qedhere and align. Note 2: I also see suggestions that ntheorem handles endmarks better. I've used ntheorem for many years, but it hasn't been updated since 2011. I'm looking for a better solution using the new begin/end environment hooks. I had hoped \qedhere in the appropriate hook could do the job.

  • Strange intersection glitch of knots package?
    by Explorer on February 21, 2026 at 9:20 am

    This question based on the previous question: % Source - https://tex.stackexchange.com/a/759998 % Posted by Andrew Stacey % Retrieved 2026-02-21, License - CC BY-SA 4.0 \documentclass[tikz, border=1cm]{standalone} \usetikzlibrary{decorations.pathreplacing,knots} %\url{https://tex.stackexchange.com/q/759978/86} \begin{document} \begin{tikzpicture}[ basic strand/.style={ black, double=gray!10, double distance=1pt, line cap=round, thick, }, crossing strand/.style={ line width=2pt, only when rendering/.style={% draw=gray!10,% line width=1pt, double=none, } }, rounded corners=1pt, ] \begin{knot}[ consider self intersections=true, ignore endpoint intersections=false, background colour=black, every intersection/.style={ crossing strand }, only when rendering/.style={ basic strand }, clip width=1, flip crossing=1, ] \strand (7.5,7.5)--(6.5,5.5)--(7.5,3.5)--(6.5,1.5)--(4.5,0.5)--(2.5,1.5)--(0.5,0.5)--(1.5,2.5)--(0.5,4.5)--(1.5,6.5)--(3.5,7.5)--(5.5,6.5)--(7.5,5.5)--(6.5,3.5)--(7.5,1.5)--(5.5,0.5)--(3.5,1.5)--(1.5,0.5)--(0.5,2.5)--(1.5,4.5)--(0.5,6.5)--(2.5,7.5)--(4.5,6.5)--(6.5,7.5)--(5.5,5.5)--(7.5,4.5)--(6.5,2.5)--(7.5,0.5)--(5.5,1.5) --(3.5,0.5)--(1.5,1.5)--(0.5,3.5)--(1.5,5.5) --(0.5,7.5)--(2.5,6.5)--(4.5,7.5)--(6.5,6.5) --(4.5,5.5)--(5.5,3.5) % --(7.5,2.5) ; \end{knot} \end{tikzpicture} \end{document} With --(7.5,2.5) commented, it behaves good: However, if I uncommented that line, thing changed: Is that a bug or feature? Any possibility to improve this?

  • Using tikz's backgrounds library to draw something behind text
    by Werner on February 21, 2026 at 7:20 am

    Consider the following minimal example where I want to draw a rectangle behind a sequence of numbers (to highlight them): \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds,calc} \NewDocumentCommand{\tikzmark}{ m }{\tikz[overlay, remember picture] \node (#1) {};} \newcounter{seq} \NewDocumentCommand{\seqstart}{}{% \stepcounter{seq}% Start a new sequence \tikzmark{seq-start-\theseq}}% Set start marker \NewDocumentCommand{\seqend}{}{% \tikzmark{seq-end-\theseq}% Set end marker \tikz[remember picture, overlay] \scoped [on background layer] \fill [fill=blue!10!white] ($(seq-start-\theseq.south west) + (-0.5pt,1pt)$) rectangle ($(seq-end-\theseq.south east) + (0.5pt,1.1\normalbaselineskip)$);% } \begin{document} \[ 12, 15, 8, 11, 4, 7, 0, 3, 16, 19, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \[ \seqstart{}12, 15, 8, 11, 4, 7, 0, 3, 16, 19\seqend{}, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \end{document} The idea is that \seqstart would set a (counter-driven) \tikzmark representing the start of the sequence to be marked. Then \seqend would set a \tikzmark at the end and highlight it using the background layer. The counter allows for multiple such sequence marking within a larger document. However, the output shows that the rectangle highlighting a part of the sequence is not being drawn on background layer as requested. Why is that? How can I ensure the rectangle is drawn on the background layer behind document/text elements? The backgrounds library documentation (in the tikz documentation, section 45) mentions that on background layer can only be used inside a {scope} or \scoped, which is done above.

  • When I use \hl inside of a longtable, the file says it's building forever but never builds
    by Tyler on February 21, 2026 at 12:02 am

    First off, here is my setup because I am certain that must be part of the problem. I'm using: texlive 2025 VS Code with these extensions: LaTeX by Mathematic Inc LaTeX Workshop by James Yu I have a LaTeX document that used to build just fine. I recently tried switching over to using the tcolorbox package instead of the soul package for highlighting in that document. As part of that process, I was getting some errors, and from reading various posts online for similiar issues I suspected I had an outdated texlive distribution so ended up trying to update everything with this on my command line: tlmgr update --all This appeared to fix the errors with tcolorbox, but I then realized that tcolorbox does not break across lines nicely so switched back to using soul. But now my document will not build. It is stuck in an infinite loop or something, the status at the bottom of VS code has the spinning circular arrows next to "Build" and it just spins forever. I have narrowed the problem down to when I use \hl inside of a longtable. Minimum working code is below. If I uncomment the commented line, I get the building-forever behavior. \documentclass{article} \usepackage{longtable} \usepackage{soul} \usepackage{xcolor} \begin{document} \sethlcolor{yellow}\hl{Test text} \begin{longtable}{ll} Column 1 & Column 2\\ % \hl{Test text} & Entry 2 \\ \end{longtable} \end{document} I have completely removed and re-installed my texlive installation and am still getting the same result. When I click "Kill LaTeX compiler process" twice to stop the infinite build, I get a popup saying "Recipe terminated with error". I click on "Open Compiler log" and get this: Initial Win CP for (console input, console output, system): (CP437, CP437, CP1252) I changed them all to CP1252 Rc files read: NONE Latexmk: This is Latexmk, John Collins, 15 June 2025. Version 4.87. No existing .aux file, so I'll make a simple one, and require run of *latex. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Category 'other': Rerun of 'pdflatex' forced or previously required: Reason or flag: 'Initial setup' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:/Users/REDACTED/test/test.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (c:/Users/REDACTED/test/test.tex LaTeX2e <2025-11-01> L3 programming layer <2026-01-19> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size10.clo)) (c:/texlive/2025/texmf-dist/tex/latex/tools/longtable.sty) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul.sty (c:/texlive/2025/texmf-dist/tex/generic/soul/soul-ori.sty) (c:/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (c:/texlive/2025/texmf-dist/tex/generic/etexcmds/etexcmds.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty))) (c:/texlive/2025/texmf-dist/tex/latex/xcolor/xcolor.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/color.cfg) (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def) (c:/texlive/2025/texmf-dist/tex/latex/graphics/mathcolor.ltx)) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./test.aux) (c:/texlive/2025/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) Here is my test.log file: This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex 2026.2.20) 20 FEB 2026 17:50 entering extended mode restricted \write18 enabled. file:line:error style messages enabled. %&-line parsing enabled. **c:/Users/REDACTED/test/test.tex (c:/Users/REDACTED/test/test.tex LaTeX2e <2025-11-01> L3 programming layer <2026-01-19> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count275 \c@section=\count276 \c@subsection=\count277 \c@subsubsection=\count278 \c@paragraph=\count279 \c@subparagraph=\count280 \c@figure=\count281 \c@table=\count282 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen148 ) (c:/texlive/2025/texmf-dist/tex/latex/tools/longtable.sty Package: longtable 2025-10-13 v4.24 Multi-page Table package (DPC) \LTleft=\skip51 \LTright=\skip52 \LTpre=\skip53 \LTpost=\skip54 \LTchunksize=\count283 \LTcapwidth=\dimen149 \LT@head=\box53 \LT@firsthead=\box54 \LT@foot=\box55 \LT@lastfoot=\box56 \LT@gbox=\box57 \LT@cols=\count284 \LT@rows=\count285 \c@LT@tables=\count286 \c@LT@chunks=\count287 \LT@p@ftn=\toks17 ) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul.sty Package: soul 2023-06-14 v3.1 Permit use of UTF-8 characters in soul (HO) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul-ori.sty Package: soul-ori 2023-06-14 v3.1 letterspacing/underlining (mf) \SOUL@word=\toks18 \SOUL@lasttoken=\toks19 \SOUL@syllable=\toks20 \SOUL@cmds=\toks21 \SOUL@buffer=\toks22 \SOUL@token=\toks23 \SOUL@syllgoal=\dimen150 \SOUL@syllwidth=\dimen151 \SOUL@charkern=\dimen152 \SOUL@hyphkern=\dimen153 \SOUL@dimen=\dimen154 \SOUL@dimeni=\dimen155 \SOUL@minus=\count288 \SOUL@comma=\count289 \SOUL@apo=\count290 \SOUL@grave=\count291 \SOUL@spaceskip=\skip55 \SOUL@ttwidth=\dimen156 \SOUL@uldp=\dimen157 \SOUL@ulht=\dimen158 ) (c:/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (c:/texlive/2025/texmf-dist/tex/generic/etexcmds/etexcmds.sty Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO) (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2024/12/12 v1.0g TeX engine tests ))) (c:/texlive/2025/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2024/09/29 v3.02 LaTeX color extensions (UK) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: pdftex.def on input line 274. (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2025/09/29 v1.2d Graphics/color driver for pdftex ) (c:/texlive/2025/texmf-dist/tex/latex/graphics/mathcolor.ltx) Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1349. Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1353. Package xcolor Info: Model `RGB' extended on input line 1365. Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1367. Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1368. Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1369. Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1370. Package xcolor Info: Model `Gray' substituted by `gray' on input line 1371. Package xcolor Info: Model `wave' substituted by `hsb' on input line 1372. ) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count292 ) (./test.aux) \openout1 = `test.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checki Yes, it just cuts off in the middle of a line there. I can't decipher anything from these outputs, and I'm not sure what else to check. Please let me know whatever file you need to see to help figure this out. Thanks!

  • How to make tcbox doing linebreak automatically in LuaLaTeX?
    by YCH817 on February 20, 2026 at 11:52 pm

    I am using LuaLaTeX. I use tcbox with \mintinline to display inline code, but \tcbox does not support automatic linebreaking. I have found this post https://tex.stackexchange.com/a/697157/242598 and try to imitate it, but my code didn't work. Also I noticed that the solution provided in the link I've mentioned above does not support Chinese characters. I am using ctex package. Here is my MWE. \documentclass[10pt,a5paper]{article} \usepackage[showframe]{geometry} \usepackage[ 10pt, % fontset=fandol, ]{ctex} % Chinese support \usepackage{calc} % For Calculation \usepackage[ dvipsnames, svgnames, table ]{xcolor} % colors \usepackage{minted} % code highlighting \usepackage[ all ]{tcolorbox} % for boxes % \usepackage{soulpos} % soul % \usepackage{soulutf8} % not sure it is useful \usepackage{lua-ul} % for underlining text in LuaLaTeX \usepackage{relsize} % relative font size \setmonofont[ % set monofont Contextuals={Alternate} ]{Fira Code} \usemintedstyle{material} % set minted style \setminted{ breaklines=true, breakanywhere=true, % escapeinside=脎吡,% encoding=utf8, tabsize=2, } \tcbset{ mycode/base/.style={ fontupper=\relscale{.7}, breakable, enhanced, skin first=enhanced, skin middle=enhanced, skin last=enhanced, colframe=Gray, colback=Black!80!DarkBlue, colbacklower=LightGray!50, boxrule=.4pt, arc=5pt, top=2.5mm, bottom=2mm, center lower, }, mycode/inline/.style={ mycode/base, colupper=white!25!LightSteelBlue, nobeforeafter, boxsep=1.5pt, left=2pt, right=2pt, top=0pt, bottom=0pt, on line, % position settings } } \renewcommand\FancyVerbFormatText[1]{% \textcolor{white!25!LightSteelBlue}{#1} }% \fvset{breaksymbolleft=\textcolor{white!25!LightSteelBlue}{\tiny\ensuremath{\hookrightarrow}}} \makeatletter \newcommand{\tclstbox}[2][latex]{ \tcbox[mycode/inline]{\vphantom{\ttfamily (Fg)}\mintinline{#1}{#2}}% } \newcommand{\tcblst}[2][latex]{% \def\tcblst@cache{#1} \tcblst@ul } \ulposdef\tcblst@ul[xoffset-start=2pt]{% \tclstbox[\tcblst@cache]{\rule{\ulwidth}{0pt}}% } \makeatother \begin{document} 你好!我是 YCH817!下面是一段长测试文字:% \tcblst[haskell]{lst = [x| x <- ['a'..'g']] -- 代码来自 YCH817 }\ \tcblst{tcolorbox} \end{document} And this is what it suppose to look like ( I did the linebreak manually ) :

  • How to include list of abbreviations of journal titles
    by rensemil on February 20, 2026 at 10:47 pm

    I am using Zotero with better BibLaTeX to make my bibliography. I have the names of journals abbreviated. Is there any way to make LaTeX print a list of these abbreviations? So just before the bibliography, I would like a list that basically says something like: ALL = Archiv für Lateinische Lexikographie DLZ = Deutsche Literaturzeitung and so on. Thanks in advance!

  • How to colour only the first box in a \multicolumn table row with fixed height
    by Jon on February 20, 2026 at 7:33 pm

    I have included the full document because the behaviour only occurs in this context. In the final \multicolumn row of the table, I am constructing a row that visually consists of several fixed-width boxes separated by vertical rules. I want only the first box in that row to have a background colour, with: a consistent row height, the colour filling the box exactly (no padding), the colour reaching the vertical rule, and no colour bleed into adjacent boxes. At the moment, attempts to enforce row height using struts or rules either do not affect the height or cause alignment/bleed issues when combined with colour. What is the correct and robust way to colour only the first fixed-width box in this kind of composite table row while maintaining consistent height and clean rule alignment? (I am open to restructuring the table if there is a better construction.) % !TeX program = xelatex % !TeX spellcheck = en_GB \documentclass[12pt,addpoints]{exam} % ----------------------------- % Maths % ----------------------------- \usepackage{amsmath, amssymb} \usepackage{bm} % ----------------------------- % Graphics & layout % ----------------------------- \usepackage{graphicx} \usepackage{float} \usepackage{pdfpages} \usepackage{geometry} \usepackage{parskip} \usepackage{multicol} % ----------------------------- % TikZ / plots (kept, but minimal) % ----------------------------- \usepackage{tikz} \usetikzlibrary{math, calc} \usepackage{pgfplots} \usepackage{tkz-base} \usepackage{tkz-euclide} \usepackage{tikz-3dplot} \usepackage{tikzlings} \usepackage{tikzpeople} \usepackage{geometry} % ----------------------------- % Fonts (LuaLaTeX) % ----------------------------- \usepackage{fontspec} \setmainfont{Aptos} \usepackage{unicode-math} \setmathfont{Cambria Math} % ----------------------------- % Tables & colour % ----------------------------- \usepackage{xcolor} \usepackage{array} \usepackage{colortbl} % ----------------------------- % Exam class configuration % ----------------------------- \marksnotpoints \qformat{\textbf{Task \thequestion\hfill (\thepoints)}} % ----------------------------- % Page geometry & header % ----------------------------- \newgeometry{ left=2.25cm, right=2cm, top=1.4cm, bottom=0cm } % ----------------------------- % Utility commands % ----------------------------- \newcommand{\uline}[1]{\rule[0pt]{#1}{0.4pt}} \newcommand\dunderline[3][-1pt]{% \sbox0{#3}% \ooalign{\copy0\cr\rule[\dimexpr#1-#2\relax]{\wd0}{#2}}% } \renewcommand{\arraystretch}{2} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} % ----------------------------- % Footer % ----------------------------- \footer{}{\textbf{End of Questions}}{\scriptsize Page \thepage\ / \numpages} \firstpagefooter{}{}{} \extraheadheight[20pt]{20pt}% addded <<<<<<<<<<<<<<<<<< \definecolor{wordgrey}{RGB}{166,166,166} \usepackage[table]{xcolor} \hyphenpenalty=10000 \exhyphenpenalty=10000 \begin{document} \renewcommand{\arraystretch}{1.8} \setlength{\arrayrulewidth}{1pt} \vspace*{-0.25cm} \noindent \setlength{\arrayrulewidth}{0.5pt} \noindent\hspace*{-0.19cm} \begin{tabular}{|p{3.7cm}|p{12.8cm}|} \hline \fontsize{12pt}{14pt}\selectfont\textbf{Something} & Something \\ \hline \fontsize{12pt}{14pt}\selectfont\textbf{Something} & Something \\ \hline \fontsize{12pt}{14pt}\selectfont\textbf{Time Allowed} & \\ \hline \fontsize{12pt}{14pt}\selectfont\textbf{Something} & \\ \hline \fontsize{12pt}{14pt}\selectfont\textbf{Something } & {\fontsize{11}{13}\selectfont \setlength{\labelsep}{1.7em} \setlength{\leftmargini}{3.6em} \begin{itemize} \item One \item \item \item \item \item \item \end{itemize} } \\ \hline \textbf{Something} & \cellcolor{wordgrey} \fontsize{11pt}{13pt}\selectfont \textbullet\ \hspace{0.4cm} Section \\ \cline{2-2} & \fontsize{11pt}{13pt}\selectfont \textbullet\ \hspace{0.4cm} Section \\ \cline{2-2} \hline \textbf{\mbox{ Something}} & \fontsize{11pt}{13pt}\selectfont \textbullet\ \hspace{0.4cm} \\ \hline \multicolumn{2}{|l|}{\hspace*{3.95cm}\fontsize{12pt}{14pt}\selectfont [ something]} \\ \hline \multicolumn{2}{|l|}{% \fontsize{11pt}{13pt}\selectfont \colorbox{wordgrey}{\makebox[3.0cm][l]{\textbf{1. No AI}}}% \vrule width 0.5pt\hspace{0.4em}% \colorbox{white}{\makebox[3.2cm][l]{\textbf{2. AI Planning}}}% \vrule width 0.5pt\hspace{0.4em}% \colorbox{white}{\makebox[4.3cm][l]{\textbf{3. AI Collaboration}}}% \vrule width 0.5pt\hspace{0.4em}% \colorbox{white}{\makebox[2.7cm][l]{\textbf{4. Full AI}}}% \vrule width 0.5pt\hspace{0.4em}% \colorbox{red}{\makebox[3.0cm][l]{\textbf{5. AI Exploration}}}% } \\ \hline \multicolumn{2}{|l|}{% \fontsize{11pt}{13pt}\selectfont {\cellcolor{wordgrey}\makebox[3.0cm][l]{\textbf{1. No AI}}}% \vrule width 0.5pt\hspace{0.4em}% {\cellcolor{white}\makebox[3.2cm][l]{\textbf{2. AI Planning}}}% \vrule width 0.5pt\hspace{0.4em}% {\cellcolor{white}\makebox[4.3cm][l]{\textbf{3. AI Collaboration}}}% \vrule width 0.5pt\hspace{0.4em}% {\cellcolor{white}\makebox[2.7cm][l]{\textbf{4. Full AI}}}% \vrule width 0.5pt\hspace{0.4em}% {\cellcolor{red}\makebox[3.0cm][l]{\textbf{5. AI Exploration}}}% } \\ \hline \multicolumn{2}{|l|}{% % Match your font settings for the whole inner row \fontsize{11pt}{13pt}\selectfont % Inner table that actually draws the five boxes with rules \setlength{\arrayrulewidth}{0.5pt}% make rules 0.5pt as in your \vrule \arrayrulecolor{black}% \begin{tabular}{@{} >{\raggedright\arraybackslash}p{2.8cm} | >{\raggedright\arraybackslash}p{3.2cm} | >{\raggedright\arraybackslash}p{4.1cm} | >{\raggedright\arraybackslash}p{2.7cm} | >{\raggedright\arraybackslash}p{3.0cm} @{}} \cellcolor{wordgrey}\textbf{1. No AI} & \textbf{2. AI Planning} & \textbf{3. AI Collaboration} & \textbf{4. Full AI} & \textbf{5. AI Exploration} \end{tabular}% } \\ \multicolumn{2}{|l|}{% \fontsize{11pt}{13pt}\selectfont \cellcolor{wordgrey}\makebox[3.0cm][l]{\textbf{1. No AI}}% \vrule width 0.5pt\hspace{0.4em}% \cellcolor{red} \makebox[3.2cm][l]{\textbf{2. AI Planning}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[4.3cm][l]{\textbf{3. AI Collaboration}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[2.7cm][l]{\textbf{4. Full AI}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[3.0cm][l]{\textbf{5. AI Exploration}}% } \\ \hline \multicolumn{2}{|l|}{% \fontsize{11pt}{13pt}\selectfont % First box: grey background only for this box \begingroup\setlength{\fboxsep}{0pt}% \colorbox{wordgrey}{% \makebox[3.0cm][l]{\textbf{1. No AI}}% }% \endgroup \vrule width 0.5pt\hspace{0.4em}% % Remove the red — it was causing the bleed \makebox[3.2cm][l]{\textbf{2. AI Planning}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[4.3cm][l]{\textbf{3. AI Collaboration}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[2.7cm][l]{\textbf{4. Full AI}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[3.0cm][l]{\textbf{5. AI Exploration}}% } \\ \hline \multicolumn{2}{|l|}{% \fontsize{11pt}{13pt}\selectfont % ---- First box: solid grey, exactly 3.0cm, with enforced height ---- \begingroup \setlength{\fboxsep}{0pt}% no padding so it fills exactly 3.0cm \colorbox{wordgrey}{% % The inner makebox *sets the width*. The \rule sets the row height. \makebox[3.0cm][l]{\rule{0pt}{3.2ex}\textbf{1. No AI}\rule[-1.2ex]{0pt}{0pt}}% }% \endgroup % Immediately draw the vertical rule so the grey reaches it \vrule width 0.8pt\hspace{0.5em}% % ---- Remaining boxes: unchanged, uncolored ---- \makebox[3.2cm][l]{\textbf{2. AI Planning}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[4.3cm][l]{\textbf{3. AI Collaboration}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[2.7cm][l]{\textbf{4. Full AI}}% \vrule width 0.5pt\hspace{0.4em}% \makebox[3.0cm][l]{\textbf{5. AI Exploration}}% } \\ \hline \end{tabular} \newpage \begin{questions} \question \end{questions} \end{document}

  • Make all subtables 'textheight' and 'textwidth' (table spanning multiple pages)
    by cis on February 20, 2026 at 6:54 pm

    A table spans multiple pages and should have the same textwidth and textheight in all subtables. Text-width is achieved using xltabular = "tabularx + longtable" (and yes, I need pgfplotstable at the end). How do I ensure that all the headers are at the very top and all the footers are at the very bottom? That the table has textheight. Note: The number of rows in the original table is calculated automatically, depending on the values ​​chosen for the columns p1, p2,... I have no control over this. Hint: I set paperheight=58mm to better illustrate the problem. \documentclass[paper=a5]{scrreprt} \usepackage[margin=14mm, showframe=true, paperheight=58mm, ]{geometry} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \usepackage{xltabular} \newcolumntype{Y}{>{\centering\arraybackslash}X@{\hspace{5pt}}} \begin{document} % Create some table-data ===================== \def\OutFilename{\jobname-data.csv} \newwrite\MyFile \immediate\openout\MyFile=\OutFilename % \foreach[count=\No from 0] \n in {1,...,4}{%% \foreach \k in {0,...,\n}{ \immediate\write\MyFile{\n, \k, 0.1111, 0.2222, 0.3333, 0.4444, 0.5555, 0.6666, 0.7777, \k, \No} }%% } \immediate\closeout\MyFile % =================================== \noindent% \pgfplotstabletypeset[ precision=4, skip 0.,% number format header=true, font=\footnotesize, column type=, begin table=\begin{xltabular}{\textwidth}{c c | *{7}{Y} | c l}, end table=\end{xltabular}, col sep=comma, every head row/.style={%% output empty row, before row={% %% Very first Header ======================== \hline n & k & p1 & p2 & p3 & p4 & p5 & p6 & p7 & k & N \\ \hline \endfirsthead %% Header for subsequent pages ================ \hline n & k & P1 & P2 & P3 & P4 & P5 & P6 & P7 & k & N \\ \hline \endhead %% Footer for all pages except last ================ \hline n & k & q1 & q2 & q3 & q4 & q5 & q6 & q7 & k & N \\ \hline \endfoot %% Footer for the very last page ================ \hline n & k & Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & k & N \\ \hline \endlastfoot },% end of 'before row' %% },%% end of 'every head row/.style' %% ]{\OutFilename} \end{document}

  • How to draw self-overlapped path with double line style?
    by Explorer on February 20, 2026 at 4:52 pm

    The question is similar to this solution, but not the same: \documentclass[tikz, border=1cm]{standalone} \usetikzlibrary{decorations.pathreplacing} % https://tex.stackexchange.com/a/572738/322482 \begin{document} \begin{tikzpicture}[ rounded corners=1pt, path decomposition/.style={% postaction={decoration={show path construction, lineto code={ \draw[#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); }, curveto code={ \draw[#1] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) ..(\tikzinputsegmentlast) ; }, closepath code={ \draw[#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) {closepath};} } ,decorate}}] \draw[line cap=round, black, double=gray!10, thick, path decomposition={black, double=gray!10,thick}] (3,3) -- (1,1) -- (3,1) -- (1,3); % here below is what I want with only one path \begin{scope}[xshift=3cm] \draw[black, double=gray!10, thick, line cap=round] (3,3) -- (1,1) -- (1.5,1); \draw[black, double=gray!10, thick, line cap=round] (2.5,1) -- (3,1) -- (1,3); \draw[black, double=gray!10, thick] (1.3,1) -- (2.7,1); \end{scope} \end{tikzpicture} \end{document}

  • Memoize not working for certain equation environments
    by jayo8589 on February 20, 2026 at 4:32 pm

    Good day, thank you very much for taking the time to read this. I am working on a mathematics book for high school students, which is quite extensive (between 500 and 1000 pages). The project contains numerous equations and graphics using TikZ, annotate-equations, etc. My goal is to speed up the compilation time. My workflow is based on Windows, MiKTeX with Perl, VS Code with LaTeX Workshop, and LuaLaTeX with latexmk. To accelerate the compilation, I am using the memoize package, which externalizes not only graphics but also equation environments like align, etc. However, I am facing the following issues: Memoize does NOT externalize starred equation environments such as \begin{equation*}, \begin{align*}, etc. Only the unstarred versions (\begin{equation}, \begin{align}) appear as externalized. The displaymath environment [ ... ] is not being taken into account for externalization. In the actual project, I get a huge number of .memo files without their corresponding PDFs, which suggests that the externalization process is not being completed. What could be the problem? How should memoize be correctly configured? How can I ensure that all starred equation environments, including the displaymath [ ... ] shorthand, are properly externalized? \documentclass{book} \usepackage{docmute} \usepackage{memoize} \mmzset{ memo dir=Chapters/main, auto={tikzpicture}{memoize}, auto={tcolorbox}{nomemoize}, auto={mynote}{nomemoize}, % Entornos estándar y amsmath auto={displaymath}{memoize, capture=vbox}, auto={equation}{memoize, capture=vbox}, auto={eqnarray}{memoize, capture=vbox}, auto={align}{memoize, capture=vbox}, auto={gather}{memoize, capture=vbox}, auto={alignat}{memoize, capture=vbox}, auto={multline}{memoize, capture=vbox}, auto={flalign}{memoize, capture=vbox}, } \usepackage{tikz} \usepackage{tcolorbox} \usepackage{amsmath, amssymb, amsthm} \begin{document} Document Body ... \begin{align} a + b & = c \\ d + e & = f \quad \text{Align environment NOT (*)} \end{align} \begin{align*} 5x + 6y & = -55m \\ -9z + 2w & = -99n \quad \text{Align environment with (*)} \end{align*} \begin{equation} -5x^2+4y^2=-3 \quad \text{Equation environment with NOT (*)} \end{equation} \begin{equation*} -5x^2+4y^2=-3 \quad \text{Equation environment WITH (*)} \end{equation*} \[ y=mx+b \quad \text{Display Math environment } \] \begin{multline} y=-4x^2+8x+8+4444444444 \quad \text{Multline environment NOT (*)} \end{multline} \begin{multline*} y=-8x^2+8x+8+8888888888 \quad \text{Multline environment WITH (*)} \end{multline*} \end{document} I would greatly appreciate any help you can provide. Thank you in advance.

  • Advantage of \csname over \makeatletter (inside \pgfkeys/\tikzset)?
    by Sammy on February 20, 2026 at 3:29 pm

    In this answer https://tex.stackexchange.com/a/133357 to a question regarding TikZ I found the following comment inside a \tikzset: % Use csname so catcode of @ doesn't have do be changed. This leaves me wondering if using \csname has any advantage over changing the catcode of @ by wrapping \tikzset with \makeatletter - which inside a package wouldn't even be neccesary since inside a package @ is of catcode letter by default. Is the use of \makeatletter potentially problematic (in general or inside pgfkeys)? If so: In which cases is it advisable to use \csname instead of \makeatletter? As far as I can imgine it (practically?) should be just a matter of taste, otherwise using such code inside a package where @ is of catcode letter would be problematic?!

  • `tcolorbox` + `lualineno`: line numbering disappears when a title is used
    by cjorssen on February 20, 2026 at 3:03 pm

    I am using LuaLaTeX together with tcolorbox and the new lualineno package. The intended behaviour is to apply line numbering exclusively to the upper part of a tcolorbox (the box body), while leaving the title unaffected. With the minimal example below, line numbering behaves differently depending on whether the box has a title. \documentclass{article} \usepackage{tcolorbox} \usepackage{pgffor} \usepackage{lualineno} \newcounter{lineno} \lualineno{% define = { name = default toks = {\stepcounter{lineno}} left = {\tiny\thelineno \kern.8em} } } \begin{document} Some text before the box. \begin{tcolorbox}[ % title = Test, before upper = {\lualineno{set = default}}, after upper = {\lualineno{unset}} ] \foreach \n in {1,...,30}{ \noindent This is line \n. \\ } \end{tcolorbox} Some text after the box. \end{document} Observed behavior: Without a title (title commented out): Line numbers appear correctly outside the box. With a title (title = Test uncommented): Line numbers disappear. No compilation error or warning is produced. If the box is made breakable, I observe a related but slightly different effect: with a titled breakable box, line numbers disappear in the first segment of the box (before the page break). Adding a title should not affect line numbering inside the box. I would expect identical numbering behavior with or without a title. Is this interaction between tcolorbox and lualineno expected? Should lualineno be applied differently when titles are used? Any explanation of the underlying mechanism or guidance on proper usage would be greatly appreciated.

  • Thinspace with babel french?
    by nowox on February 20, 2026 at 12:47 pm

    I love LaTeX, but I also love french typography and I noticed that babel does not really add a thin space before the colon/semicolon: \documentclass{article} \usepackage[french]{babel} \addto\extrasfrench{% \renewcommand{\FBcolonspace}{\nobreak\thinspace}% } \begin{document} \large Le canard: un animal avec deux pattes. \end{document} Built with: latexmk -lualatex test.tex If I manually do it, the result is visually much better. \begin{document} \large Le canard\nobreak\thinspace: un animal avec deux pattes. \end{document} Is there a way to tweak babel to do it right?

  • GitHub and LaTeX
    by Tanda on February 20, 2026 at 12:20 pm

    I need to be able to work on an Overleaf project while offline. I read that I had to create a link with a repository on GitHub, which is what I did. All files are there, but how do I run LaTeX?

  • Class to typeset a journal: is memoir a good choice?
    by alcuinus on February 20, 2026 at 9:32 am

    I normally use memoir to print my books. I am now editing a scholarly journal. Can I use memoir for this task? The main problem seems to redefine author for each chapter, Bibliography is at the end, I prefer a comprehensive list at the end of the journal. I saw the proc class but memoir seems much more developed.

  • Make a distorted circle a circle again, after rescaling in the `axis` environment
    by Máté Wierdl on February 20, 2026 at 3:53 am

    In the graph below the red "dots" get distorted due to unequal scaling. How can I make them circles again? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} % Parameter: epsilon \newcommand{\eps}{0.25} % Compute intersection x-values: \pgfmathsetmacro{\xint}{acos(1 - \eps)/360} \begin{axis}[xscale=2/3, yscale=0.4, width=10cm, % chose these to keep axis height=20cm, % from automatically rescaling to a square trig format=rad, domain = -1/2:1/2, axis y line=left, axis x line=bottom, axis line style = {-}, % makes arrow heads disappear; has to come % after "axis y line" and "axis x line" xtick = {-1/2, -\xint, 0, \xint, 1/2}, xticklabels = {$-1/2$, $-\delta$, $0$, $\delta$, $1/2$}, ytick = {-1, 1-\eps, 1}, yticklabels = {$-1$, $1-\epsilon$, $1$}, ] \addplot[smooth] { cos(2*pi*x) }; \draw[dashed] (-0.5, 1 - \eps) -- (0.5, 1 - \eps); \draw[dashed] (-\xint, -1) -- (-\xint, 1 - \eps); \draw[dashed] (\xint, -1) -- (\xint, 1 - \eps); \filldraw[red] (axis cs: -\xint,1 - \eps) circle (0.5cm); \filldraw[red] (axis cs: \xint,1 - \eps) circle (0.5cm); \end{axis} \end{tikzpicture} \end{document}

  • How to draw a half‑sphere with 5‑degree lines along the x‑axis in TikZ/PGF? [closed]
    by AruGip on February 19, 2026 at 8:40 pm

    I found this post and I'm trying to retrieve the version shown in the image below. Does anyone know how I can get that specific version? I've checked the documentation and explored the available properties, but I couldn't find anything that returns the same value shown there. Any ideas on how to achieve this?

  • Create a directed graph
    by Dimitrios ANAGNOSTOU on February 19, 2026 at 4:15 pm

    I want to create the following figure. Using the following code, I managed to get something close. But I cannot figure out how to get properly the diagonal vectors without too much trial and error. Any ideas? Thanks a lot! \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{tikz} \usetikzlibrary{positioning,arrows.meta} \begin{document} \begin{figure}[!htpb] \centering \begin{tikzpicture}[ node distance=3cm, box/.style={draw, rectangle, minimum size=1.2cm, font=\large}, arr/.style={->, >=Stealth, thick} ] % Nodes \node[box] (1) {1}; \node[box, below=of 1] (2) {2}; \node[box, right=of 1] (3) {3}; \node[box, below=of 3] (4) {4}; % Labels n_i \node[above=3mm of 1] {$n_1=3$}; \node[above=3mm of 3] {$n_3=1$}; \node[below=3mm of 2] {$n_2=2$}; \node[below=3mm of 4] {$n_4=2$}; % Horizontal 1 <-> 3 (two parallel arrows) \draw[arr] ([yshift=4pt]1.east) -- ([yshift=4pt]3.west); \draw[arr] ([yshift=-4pt]3.west) -- ([yshift=-4pt]1.east); % Vertical left \draw[arr] (1) -- (2); % Vertical right \draw[arr] (4) -- (3); % Bottom horizontal \draw[arr] (2) -- (4); % Diagonals \draw[arr] (2) -- (3); \draw[arr] ([xshift=-4pt]4.north) -- ([xshift=4pt]1.south); \draw[arr] ([xshift=-4pt]1.south) -- ([xshift=4pt]4.north); \end{tikzpicture} \end{figure} \end{document}

  • how to put a character between dollars
    by Jordi Pinyol on February 19, 2026 at 12:18 pm

    In texmaker how can you put a character (or more) between dollars automatically, just like you can do with emphasis. For example: x=y -> select and execute a command -> $x=y$

  • uneven commutative diagram
    by mappingmoe on February 18, 2026 at 11:33 am

    I want to draw the following commutative diagram in LaTeX: I have tried tikzcd, but I think I won't work, since the rows have different size. Is there a clean way to do it? EDIT: my first approach was the following: \documentclass[a4paper]{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} P \arrow{l}{pr} \arrow{d}{\pi} & TP \arrow{d}{T \pi}\\ I \arrow{ur}{\tilde{\gamma}} \arrow{r}{\dot{\gamma}} & M \arrow{l}{pr} & TM \end{tikzcd} \end{document}