• Draw simple figures: l3draw vs PGF performances
    by PHL on April 30, 2026 at 3:08 am

    I have some lua code that generates coordinates of many triangles/quadrilaterals I then want to draw/fill. See this answer about Penrose tilings for a concrete example. The drawing is actually done in TikZ via the luadraw package, but I am wondering if I can make the code faster by replacing TikZ with l3draw. Rewriting my actual code to remove TikZ and luadraw dependences (and use l3draw or any other drawing tool) is not a complex task, but will ask me some time due to my limited programming skills. So I would prefer to know in advance if this is a good idea or not. Apart possibly performance, is there any other reasons to use l3draw over pgf for this kind of task? Edit: I am not using TikZ/pgf for the rest of the document. Suggesting to use another environment (as picture) is a valid answer.

  • Incompatibility between PyLuaTeX and luadraw?
    by mathmandan on April 29, 2026 at 8:25 pm

    Consider this MWE: \documentclass{article} %\usepackage{luadraw} % Un-comment this line to get an error \usepackage[executable=python]{pyluatex} % May need to substitute: % \usepackage[executable=python3]{pyluatex} % \usepackage[executable=python.exe]{pyluatex} % (Or whatever works on your system) \begin{document} ok \end{document} The above compiles fine for me (using LuaLaTeX, with the --shell-escape option, from a TeXLive distribution in Windows 11 Enterprise). I get a document showing the text "ok" (without the quotes), as expected. However, if I uncomment the usepackage{luadraw} line, then I get an error: This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) system commands enabled. (./test100.tex LaTeX2e <2025-11-01> L3 programming layer <2026-03-20> (c:/texlive/2026/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2026/texmf-dist/tex/latex/base/size10.clo)) ... ... (Some more stuff that seems OK) ... (c:/texlive/2026/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty...xlive/2026/tex mf-dist/tex/lualatex/pyluatex/pyluatex.lua:58: attempt to index a function valu e (global 'set') stack traceback: ...xlive/2026/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua:58: in main chunk [C]: in function 'require' [\directlua]:1: in main chunk. l.23 } ? Note: if I uncomment the \usepackage{luadraw} and put it after the \usepackage{pyluatex}, then it actually does compile without error. However, if I then replace the ok with something that uses pyluatex, like \py{'ok'}, then I get another error. So simply switching the loading order does not really solve the issue. Note: I recently (April 29, 2026) ran tlmgr update --all, and also re-installed a current version (version 2.8) of luadraw (using l3build install as described at https://github.com/pfradin/luadraw). Question: Is it possible to use both pyluatex and luadraw together in one document? Secondary question: Is this a bug, and if so, is there one package that is at fault? I would be happy to file a bug report somewhere if that is appropriate. Neither package seems to cause problems for me on its own; it is only when both are loaded that I am experiencing a problem.

  • Creating a custom symbol in TikZ whose colour agrees with that of the surrounding text
    by varkor on April 29, 2026 at 11:36 am

    I have created a custom ⍟ symbol using TikZ, which works well, except that it ignores the colour of the surrounding text. MWE: \documentclass{article} \usepackage{tikz} \usepackage{scalerel} \newsavebox{\whitecircstar}\sbox{\whitecircstar}{\kern.075em\tikz{\node[draw, circle,line width=.36pt, inner sep=0]{$*$};}\kern.075em} \newcommand{\ostar}{\mathbin{\scalerel*{\usebox{\whitecircstar}}{\odot}}} \begin{document} \textcolor{red}{Before $\ostar$ After} \end{document} Output: How can I make \ostar the same colour as the surrounding text? My understanding was that . was a special symbol for the current colour in xcolor, but adding color=. to the node arguments had no effect.

  • $\implies$ makes "! Missing } inserted" error
    by Harry on April 29, 2026 at 11:17 am

    In my tex I have a sentence: No external torque $\implies$ Angular momentum $L$ is conserved: After I compile the tex file, it throws out "! Missing } inserted" error. If I delete the $\implies$ in the above sentence, all is fine. Why and how to solve it? The whole tex code (I run it with XeLatex+MakeIndex+BibTex): \documentclass{beamer} % 默认就是 4:3 \usetheme{Madrid} \usecolortheme{seahorse} \usepackage{amsmath} \usepackage{amssymb} \usepackage{physics} \usepackage{tikz} \usepackage{tikz-3dplot} \usetikzlibrary{calc, decorations.markings, arrows.meta, angles, quotes} \usetikzlibrary{patterns,decorations.pathmorphing} \usepackage{amsfonts} \usepackage[utf8]{inputenc} \usepackage[T3,T1]{fontenc} \usepackage{tipa} \usepackage{xcolor} \usepackage{booktabs} % 用于绘制专业的表格线 \usepackage{setspace} \usepackage{fontspec} % 如果你是 Windows 用户,通常 Arial 包含最全的音标字符 \setmainfont{Arial} \usepackage{siunitx} \begin{document} \begin{frame}{Exercise: Angular Momentum Conservation} \textbf{Problem:} \\ Two flywheels $A$ and $B$ share a common axis. Initially, $B$ is at rest, and $A$ rotates with angular velocity $\omega_A$. After they are coupled by clutch $C$, they rotate together with velocity $\omega$. Find $J_B$ if $A$'s moment of inertia is $J_A$. \textbf{Solution:} \\ No external torque $\implies$ Angular momentum $L$ is conserved: \begin{equation*} J_A \omega_A = (J_A + J_B) \omega \end{equation*} \pause \end{frame} \end{document}

  • LuaLatex fontspec problem
    by Stéphane Ducasse on April 29, 2026 at 9:28 am

    I face the following problem since I migrated to texlive 2025 with the deprecation of gentium-tug When I build my books on a minimnal installation I get the following error (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/home/runner/texlive/texmf-dist/tex/latex/base/fontenc.sty) (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "Gentium-Regular.ttf". ! Package fontspec Error: (fontspec) The font "Gentium-Regular" cannot be found; this (fontspec) may be but usually is not a fontspec bug. Either (fontspec) there is a typo in the font name/file, the font is (fontspec) not installed (correctly), or there is a bug in (fontspec) the underlying font loading engine (fontspec) (XeTeX/luaotfload). It is working locally on my LaTeX 2025 installation going from %%% %%% Fonts & paragraph typography %%% \RequirePackage{fontspec,gentiumbook,opensans,FiraMono} \setmainfont{Gentium Book Plus} \setsansfont{Open Sans}[ \@ifpackagelater{opensans}{2019/06/19}% test for font naming bug {}% 2019/06/20 fixed it {BoldFont = {* Bold},} Scale=MatchLowercase, Numbers=OldStyle ] \setmonofont{Fira Mono}[ Scale=MatchLowercase, HyphenChar={-} % enable hyphenation (disabled by default in mono fonts) % caveat: LuaLaTeX doesn't support changing the actual character % alternative solution: \usepackage[htt]{hyphenat} ] to %%% %%% Fonts & paragraph typography %%% \RequirePackage{fontspec,opensans,FiraMono} \setmainfont{GentiumBookPlus} \setsansfont{Open Sans}[ sBoldFont = {* Bold}, Scale=MatchLowercase, Numbers=OldStyle ] \setmonofont{Fira Mono}[ Scale=MatchLowercase, HyphenChar={-} % enable hyphenation (disabled by default in mono fonts) % caveat: LuaLaTeX doesn't support changing the actual character % alternative solution: \usepackage[htt]{hyphenat} ] It works but my problem is that I build a system that helps users to generate books written in markdown and automatically translated to LaTeX and I propose a smaller version of texlive and hosting it on github Here are the dependencies I extract from my builds. TeX Live 2025 is frozen and will no longer be routinely updated. This happens when a new release is made, or will be made shortly. For general status information about TeX Live, see its home page: https://tug.org/texlive tlmgr: package repository https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2025/tlnet-final/ (verified) tlmgr install: package already present: cm tlmgr install: package already present: graphics tlmgr install: package already present: graphics-cfg tlmgr install: package already present: graphics-def tlmgr install: package already present: l3backend tlmgr install: package already present: l3kernel tlmgr install: package already present: latex tlmgr install: package already present: latex-fonts tlmgr install: package already present: latexconfig tlmgr install: package already present: lua-uni-algos tlmgr install: package already present: lualibs tlmgr install: package already present: luaotfload tlmgr install: package already present: tex-ini-files tlmgr install: package already present: unicode-data [1/65, ??:??/??:??] install: atbegshi [5k] [2/65, 00:01/01:18:23] install: atveryend [2k] [3/65, 00:01/01:02:50] install: auxhook [2k] [4/65, 00:02/01:38:01] install: bigintcalc [7k] [5/65, 00:02/52:40] install: bitset [6k] [6/65, 00:02/37:28] install: booktabs [3k] [7/65, 00:03/50:34] install: environ [2k] [8/65, 00:03/46:34] install: epstopdf.x86_64-linux [1k] [9/65, 00:03/45:52] install: epstopdf [15k] [10/65, 00:04/37:52] install: epstopdf-pkg [5k] [11/65, 00:04/34:12] install: etexcmds [3k] [12/65, 00:05/40:27] install: etoolbox [9k] [13/65, 00:05/33:57] install: euenc [4k] [14/65, 00:05/32:02] install: filehook [5k] [15/65, 00:06/35:25] install: fira [15170k] [16/65, 00:09/00:12] install: fontaxes [5k] [17/65, 00:09/00:12] install: fontspec [27k] [18/65, 00:09/00:12] install: footmisc [8k] [19/65, 00:10/00:14] install: fp [19k] [20/65, 00:10/00:14] install: gentium-otf [3k] [21/65, 00:11/00:15] install: gettitlestring [3k] [22/65, 00:11/00:15] install: hycolor [4k] [23/65, 00:11/00:15] install: hyperref [88k] [24/65, 00:12/00:16] install: iftex [4k] [25/65, 00:12/00:16] install: import [3k] [26/65, 00:13/00:18] install: infwarerr [3k] [27/65, 00:13/00:18] install: intcalc [6k] [28/65, 00:13/00:18] install: kvdefinekeys [3k] [29/65, 00:14/00:19] install: kvoptions [8k] [30/65, 00:14/00:19] install: kvsetkeys [4k] [31/65, 00:14/00:19] install: l3packages [20k] [32/65, 00:15/00:21] install: letltxmacro [3k] [33/65, 00:15/00:21] install: listings [149k] [34/65, 00:16/00:22] install: ltxcmds [5k] [35/65, 00:16/00:22] install: makecmds [2k] [36/65, 00:17/00:23] install: memoir [68k] [37/65, 00:17/00:23] install: mptopdf.x86_64-linux [1k] [38/65, 00:18/00:25] install: mptopdf [37k] [39/65, 00:18/00:24] install: multirow [3k] [40/65, 00:18/00:24] install: opensans [1979k] [41/65, 00:20/00:24] install: pdfcol [3k] [42/65, 00:20/00:24] install: pdfescape [5k] [43/65, 00:21/00:25] install: pdftexcmds [7k] [44/65, 00:21/00:25] install: pgf [702k] [45/65, 00:22/00:26] install: polyglossia [123k] [46/65, 00:23/00:27] install: ragged2e [3k] [47/65, 00:23/00:27] install: refcount [3k] [48/65, 00:24/00:28] install: rerunfilecheck [4k] [49/65, 00:24/00:28] install: stringenc [23k] [50/65, 00:24/00:28] install: tcolorbox [230k] [51/65, 00:25/00:28] install: textcase [2k] [52/65, 00:26/00:30] install: tikzfill [5k] [53/65, 00:26/00:30] install: tipa [2809k] [54/65, 00:28/00:28] install: tools [47k] [55/65, 00:28/00:28] install: trimspaces [1k] [56/65, 00:29/00:29] install: ulem [7k] [57/65, 00:29/00:29] install: uniquecounter [3k] [58/65, 00:29/00:29] install: url [6k] [59/65, 00:30/00:30] install: varwidth [5k] [60/65, 00:30/00:30] install: xcolor [18k] [61/65, 00:30/00:30] install: xkeyval [9k] [62/65, 00:31/00:31] install: xpatch [2k] [63/65, 00:31/00:31] install: xtab [5k] [64/65, 00:32/00:32] install: xunicode [26k] [65/65, 00:32/00:32] install: zapfding [46k] running mktexlsr ... done running mktexlsr. running updmap-sys ... done running updmap-sys. regenerating fmtutil.cnf in /home/runner/texlive/texmf-dist running fmtutil-sys --byfmt mptopdf --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=/tmp/yCFX9JaktR/XWxxYEwl7V ... OK: mptopdf.fmt/pdftex tlmgr: package log updated: $TEXDIR/texmf-var/web2c/tlmgr.log tlmgr: command log updated: $TEXDIR/texmf-var/web2c/tlmgr-commands.log I tried \setmainfont[Ligatures=TeX,]{Gentium-Regular.ttf} as mentioned in another post. but did not work. I spent several days already trying to solve this problem but I miserably failed. Any

  • Multiple splits in Tikz rectangle with distinct lines
    by iago on April 29, 2026 at 9:24 am

    My goal is to get a rectangle like the one below, but with text in the nested rectangles. Line types could be for example the following: I saw tikz: Multiple splits of rectangle, but it does not answer the question on the line types. Beyond that, I am a beginner using Tikz, and I'd like the answer explained, since the linked answer is complex to understand. Thanks!

  • Unexpected spacing with negative coordinates in a command for projective coordinates using `expl3`
    by Antonio on April 29, 2026 at 6:57 am

    I have an issue with the following code, kindly provided by egreg some time ago answer by egreg. It worked well, but I recently noticed an unwanted behavior. I am not sufficiently familiar with expl3 to fix it myself, nor do I fully understand how the code works. \ExplSyntaxOn \NewDocumentCommand{\pc}{m} % projective coordinates { \seq_set_split:NVn \l_tmpa_seq \c_colon_str { #1 } ( \seq_use:Nn \l_tmpa_seq { \mspace{1\medmuskip}{:}\mspace{1\medmuskip} } ) } \ExplSyntaxOff \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{aligned} &(a:b:c) & & (1:-1:2) & &\qquad\verb|standard|\\ &\pc{a:b:c} & & \pc{1:-1:3} & &\qquad\verb|with \pc command|\\ &(a:-b:c) & & (1:-2:3) & &\qquad\verb|standard|\\ &\pc{a:-b:c}& & \pc{1:-2:3} & &\qquad\verb|with \pc command| \end{aligned} \] \[ \pc{a,b,c,d}\quad \pc{a;b;c;d,e,f:g:h:i,l} \] \end{document} Here is the output of the minimal working example: The actual issue appears when a coordinate other than the first is negative (for example \pc{a:-b:c} or \pc{1:-2:3}), where the spacing/output differs from the standard notation. As an aside, I also do not understand why commands such as \pc{a,b,c} or \pc{a;b;c:d} produce the output they do. Could someone explain what is happening here, and how to modify the macro so that it behaves correctly in all cases?

  • pstricks:circuit diagrams, using A4 paper landscape, how do I get a nice grid?
    by tangent on April 28, 2026 at 10:57 am

    This is my current effort: \documentclass{article} \usepackage{pstricks} \usepackage{graphicx} \begin{document} \rotatebox{90}{% \begin{pspicture}(5,4) \psgrid \end{pspicture} } \end{document} How do I persuade gv (and my printer), to present it in landscape? Of course I have to play with the actual numbers. Eventually something like conventional graph paper on it's side.

  • How to tweak the exact positon in the normal direction of the path by `anchor`?
    by Explorer on April 28, 2026 at 6:28 am

    As the follow-up of my previous question, the code below comes from cfr's solution: % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \pgfmathsetmacro\temp@angle{atan2(\temp@by-\temp@ay,\temp@bx-\temp@ax)} \draw[-foo,mystyle] (#4.{\temp@angle - 10}) -- % node[ % draw=blue, % % anchor={90+\temp@angle}, % sloped,inner sep=0pt,#1 % ] {#2} node[ draw, % draw=red, anchor={90+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#2} (#5.{190 + \temp@angle}); %%%%%%%%%%%%%%%%%%%% \draw[foo-,mystyle] (#4.{\temp@angle + 10}) -- node[ draw, anchor={270+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#3} (#5.{170 + \temp@angle}); } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]},scale=1.5, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \foreach \i in {0,20,...,340}{ \node[draw,circle,fill=teal] (In-\i) at (\i:3) {}; \node[draw,circle,fill=magenta] (Out-\i) at (\i:5) {}; \dualharpoon[scale=.8]{$\Delta$}{$\nabla$}{In-\i}{Out-\i} } \end{tikzpicture} \end{document} And I tweaked some label arguments, but I found that the label position is not exactly what I want with anchor={90+\temp@angle}, I want every angles gives the alignment with the normal direction: To show the anchor's behavior more clearly: % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \pgfmathsetmacro\temp@angle{atan2(\temp@by-\temp@ay,\temp@bx-\temp@ax)} \draw[-foo,mystyle] (#4.{\temp@angle - 10}) -- node[ draw=blue, % anchor={90+\temp@angle}, sloped,inner sep=0pt,#1 ] {#2} node[ draw=red, anchor={90+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#2} (#5.{190 + \temp@angle}); %%%%%%%%%%%%%%%%%%%% % \draw[foo-,mystyle] (#4.{\temp@angle + 10}) -- node[ % draw, % anchor={270+\temp@angle},%<- % sloped,inner sep=0pt,#1 % ] {#3} (#5.{170 + \temp@angle}); } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]},scale=1.5, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \foreach \i in {0,20,...,340}{ \node[draw,circle,fill=teal] (In-\i) at (\i:3) {}; \node[draw,circle,fill=magenta] (Out-\i) at (\i:5) {}; \dualharpoon[scale=.8]{$\Delta$}{$\nabla$}{In-\i}{Out-\i} } \end{tikzpicture} \end{document} It also reminded me of Jasper Habicht's another solution, but..., I found it not quite easy to decide the position of the midpoint of path from A to B... Any suggestions on this?

  • Alignment of vscodeicons and vectorlogos icons with respect to surrounding text
    by Sebastiano on April 27, 2026 at 6:47 pm

    I am using the vscodeicons and vectorlogos packages to include small icons in my document. Consider this MWE: \documentclass{article} \usepackage{vscodeicons,vectorlogos} \begin{document} Inline \vscodeicon[filetype]{wolfram} version Geogebra \vectorlogo[icon]{geogebra} \end{document} To my eyes, the icons appear slightly shifted downwards with respect to the surrounding text. Are they already correctly aligned in the packages, or would it be better to tweak them (e.g., with \raisebox or package options such as height=auto/dstrut=false) so that they sit exactly on the baseline like the surrounding text? If some adjustment is recommended, what would be a robust way to align them in inline text without breaking the line spacing?

  • How to add two-sided harpoon arrows with proper label position elegantly?
    by Explorer on April 27, 2026 at 5:14 pm

    Learning from the link here and here, I have the following code: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \draw[-foo,mystyle,transform canvas={xshift=-0.3ex}] (A) -- node[left] {$\Delta$} (B); \draw[foo-,mystyle,transform canvas={xshift=+0.3ex}] (A) -- node[right] {$\nabla$} (B); % \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); % ? \draw[-foo,mystyle,transform canvas={yshift=-0.3ex}] (B) -- node[below right=-3pt] {$f(x)$} (C); \draw[foo-,mystyle,transform canvas={yshift=+0.3ex}] (B) -- node[above left=-3pt] {$g(x)$} (C); % \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); % ? \end{tikzpicture} \end{document} I want more smartly syntax like: \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); which control exactly how much to xshift/yshift moved towards in the direction perpendicular to the connection between the two nodes, in addition, I also don't want to decide the node's position by above left=-3pt manually. Any suggestions on how to support such two-sided harpoon arrow with label? Edited after cfr's answer(first edition): % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \edef\temp@angle{\fpeval{(atan((\temp@by-\temp@ay)/(\temp@bx-\temp@ax)))*(180/pi)}} \draw[-foo,mystyle] (#4.{\temp@angle - 5}) -- coordinate (temp@1) (#5.{185 + \temp@angle}); \node[anchor={90+\temp@angle}] at (temp@1) {#2} ; \draw[foo-,mystyle] (#4.{\temp@angle + 5}) -- coordinate (temp@2) (#5.{175 + \temp@angle}); \node[anchor={270+\temp@angle}] at (temp@2) {#3}; } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \node[draw,circle,fill=olive] (D) at (-3,1) {D}; \dualharpoon{$\Delta$}{$\nabla$}{A}{B} \dualharpoon{$g(x)$}{$f(x)$}{B}{C} \dualharpoon{$p$}{$q$}{B}{D} \end{tikzpicture} \end{document}

  • Raise subscript position in lualatex
    by Alexander Voigt on April 27, 2026 at 8:25 am

    I am typesetting the following matrix equation (MWE): \documentclass[preview]{standalone} \usepackage{iftex} \ifLuaTeX \usepackage{unicode-math} \else \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \fi \begin{document} \[ \begin{pmatrix} \underline{v}_1^T \\ \underline{v}_3^T \\ \underline{v}_3^T \end{pmatrix} = \begin{pmatrix} v_{11} & v_{12} & v_{13} \\ v_{21} & v_{22} & v_{23} \\ v_{31} & v_{32} & v_{33} \end{pmatrix} \] \end{document} When I compile with pdflatex, the matrix elements on the l.h.s. look good to me. In particular, both the subscripts (indices) and the superscripts (T) are properly set and readable: However, when I compile with lualatex, the subscripts overlap with the succeeding line: I've also created a gif for a better comparison: My question is: How can I avoid the overlap? (My wish would be to consistently raise the subscripts. I'd like to avoid increasing the row distance, because then the rows on the l.h.s. would not properly align with the rows on the r.h.s.)

  • How can we obtain a smoother sphere when cutting it with a plane and moving the cut portion?
    by minthao_2011 on April 26, 2026 at 11:11 am

    I am using this code in luadraw to cut a sphere with a plane and move one of the cut parts to another position. Currently, the surface of the sphere is not really smooth. If I increase the number in this line local S = sphere(Origin, R, 60, 60) to a larger value, the compilation becomes slower. How can I make the sphere smoother? \documentclass[border=5pt]{standalone} \usepackage[svgnames]{xcolor} \usepackage[3d]{luadraw} \begin{document} \begin{luadraw}{name=sphere_clip3d_fixed} local R = 3 local g = graph3d:new{window={-R-2, R+1, -R-1, R}, viewdir={110, 60}, size={10, 10}} Hiddenlinestyle = "dashed" local S = sphere(Origin, R, 60, 60) local Box = parallelep(M(-5,-5,1.5), 10*vecI, 10*vecJ, 10*vecK) local S_top = clip3d(S, Box) local S_bottom = clip3d(S, Box, true) local vector = 2*vecK + 5*vecJ local S_top_shifted = shift3d(S_top, vector) local I_bottom = border(S_bottom) local I_top_shifted = border(S_top_shifted) g:Dscene3d( g:addFacet(S_bottom, {draw="ball color=orange", color="orange", backcull=true}), g:addFacet(S_top_shifted, {draw="ball color=orange", color="orange", backcull=true}), g:addPolyline(I_bottom, {color="Navy", hidden=true}), g:addPolyline(I_top_shifted, {color="Navy", hidden=true}) ) g:Show() \end{luadraw} \end{document}

  • Conflict between "siunitx" package and TikZ library "math"
    by pejsek on April 26, 2026 at 8:46 am

    I am using the code from this answer in my project. My project also uses the package siunitx. The code no longer works when siunitx is loaded. I am just a regular user with no knowledge of internals of siunitx or TikZ. What can I do to use the code and siunitx at the same time? In the code below, all I did was add \usepackage{siunitx}. % Source - https://tex.stackexchange.com/a/586432 % Posted by loved.by.Jesus, modified by community. See post 'Timeline' for change history % Retrieved 2026-04-26, License - CC BY-SA 4.0 \documentclass{article} \usepackage{siunitx} % if removed, the code works just fine \usepackage{tikz} \usetikzlibrary{math} \begin{document} \begin{tikzpicture} %Two points (A) and (B) \coordinate (A) at (0,0); \coordinate (B) at (2,2); %--Computing the distance between (A) and (B) %Creating a math coordinate \tikzmath{coordinate \C; %Storing coordinates difference \C = (B)-(A); %Computing the length of C = (Cx,Cy) from its components Cx and Cy %Note the length \distAB is in points (pt) \distAB = sqrt((\Cx)^2+(\Cy)^2); } %--Drawing %line A -- B \draw (A) node [above] {A} -- (B) node[above] {B} node[midway]{\distAB pt}; %Circle with center in (A) and radius \distAB points \draw (A) circle (\distAB pt); \end{tikzpicture} \end{document} Thank you for any help.

  • Changing greeks (in math mode) with XeLaTeX
    by Ryan Kong on April 26, 2026 at 7:22 am

    I want to change the greek font into STEP while keeping all other math font in TeX Gyre Termes Math and text font in Times New Roman. The following is my MWE: %! TEX program = xelatex \documentclass{article} \usepackage{amsmath,amssymb,amsthm} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{Times New Roman} \setmathfont{TeX Gyre Termes Math} \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] \begin{document} $\alpha \beta \Gamma \Delta$\\ $f(x) = x^2$ \end{document} It gives me some error messages: undefined Transcript written on test.log. Missing number, treated as zero. <to be read again> Use of \??? doesn't match its definition. <argument> \??? I don't know where went wrong. I downloaded all the fonts I need, and I can run the code if I remove the code: \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] but it gives me this instead. Any help would be much appreciated.

  • why \begin{align*}..\end{align*} spacing is different inside tikz Matrix node than outside?
    by Nasser on April 26, 2026 at 4:33 am

    I am learning how to use tikz Matrix to layout few things. Notice that inside tikz matrix node, the alignment is not the same as outside tikz using standard &= for align math environment. I had to to put align environment inside a minipage to make it work inside tikz matrix node. It will not let me just use align directly since not paragraph mode. But the issue is the spacing between left side of &= and right side is different than outside tikz. \documentclass[12pt,varwidth]{standalone} %need varwidth to use align inside standalon \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \fbox{\begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} } \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] { 1& 2& \begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} &4 \\ 5& 6 & 7 & 8 \\ }; \foreach \i in {1,2,3,4} \foreach \j in {1,2} \draw [help lines] (m-\j-\i.south west) rectangle (m-\j-\i.north east); \end{tikzpicture} \end{document} Compiled with lualatex gives lualatex, TL 2026

  • How to fully center text inside tikz Matrix node, which spans multiple columns?
    by Nasser on April 26, 2026 at 3:02 am

    I need to make a node in tikz matrix which spans multiple columns. After much struggle and trial and error, this is the result \documentclass[12pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] {1 & 2 & 3 & 4 \\ 5 & & & \\ 9 & 10 & 11 & 12\\ }; \node[fit=(m-2-2)(m-2-4),align=center,text centered,draw,fill=yellow]{spans cols 2 to 4}; \end{tikzpicture} \end{document} Compiled using lualatex gives Which is what I want, except I do not know how to make the text "spans cols 2 to 4" to be fully centered inside the node that spans the columns. I tried adding align=center and text centered as you see, but this had no effect on vertical centering inside the node. What is correct way to do this? Now the baseline as you see of the text inside, is not aligned with the baseline of the other nodes in the tikz matrix. TL 2026

  • Linebreak: Strange word protrusion into the margin without hyphenating word "impedance" interacted with `microtype`?
    by Explorer on April 26, 2026 at 1:58 am

    Claim: I believe that the code example could be simplified further. However, I don't find it easy to construct... : Here below is the original case: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe, ]{geometry} \RequirePackage{enumitem} \usepackage{txfonts} \usepackage[T1]{fontenc} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} If we add microtype, with lualatex, it works: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe ]{geometry} \RequirePackage{enumitem} %%%%%%%%% \usepackage{txfonts} \usepackage[T1]{fontenc} \usepackage{microtype} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} But with xelatex, it doesn't: I found it hard to remove the \documentclass[zihao=-4]{ctexbook} dependency to simplifiy the code, which change fontsize internally... Learning from this link, there are many better alternatives to txfonts: \usepackage{newtxtext} \usepackage{tgtermes} \usepackage[T1]{fontenc} \setmainfont{Times New Roman} \setmainfont{TeX Gyre Termes} But all confront with the word "Impedance" protrusion without microtype... My questions are: What caused the word "Impedance" protrusion here? Is this the expected bahavior? And is microtype the recommended package to tweak here (while failed with xelatex😔)?

  • Images plus spacer to fit exactly text width
    by user1850133 on April 25, 2026 at 11:34 am

    How can I fill horizontally the whole space with e.g. 2 images and a spacer in between? Here's my try using \textwidth, but it crosses the text area. \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[showframe]{geometry} \setlength\parindent{0pt} \begin{document} \includegraphics[width=.45\textwidth]{example-image-9x16} \hspace{.1\textwidth} \includegraphics[width=.45\textwidth]{example-image-9x16} \end{document}

  • How can I use Lua syntax inside a pgfkeys key, and load that from Lua so I can later print it's descendents to TeX?
    by Jasper on April 25, 2026 at 9:34 am

    How can I use Lua syntax inside a pgfkeys key, and load that from Lua so I can later print it's descendents to TeX? This MWE looks ridiculous, but don't laugh! It's actually designed to show the type of behaviour I want to enable. That is, I want to have lua syntax highlighting in certain keys when I set them, and lua category codes too. I think it would be a really beautiful thing. \documentclass{article} \usepackage{jasper} \begin{document} \setobject[nice = { -- this is some lua syntax local with = "a \\par!" local wow = "!" -- I want to use the % operator too local test = 5 % 2 tex.sprint(test) -- blah return 7 }] \end{document} \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesExplPackage{jasper}{1994/04/05}{v1.0.0}{ LuaLaTeX package for a question about pgfkeys and Lua. } \RequirePackage{tikz} \tikzset{ /jasper/.is~family ,/jasper/.cd ,nice/.code = {\protected@edef\jasper@nice{#1}} } \lua_load_module:n { George } \NewDocumentCommand { \setobject } {o} { \group_begin: \tikzset{ /jasper/.search~also = {/tikz} ,/jasper/.cd ,#1 } \__jasper_setobject: \group_end: } local function register_tex_cmd(name, func, args, protected) name = "__jasper_" .. name .. ":" .. ("n"):rep(#args) local scanners = {} for _, arg in ipairs(args) do scanners[#scanners+1] = token['scan_' .. arg] end local scanning_func = function() local values = {} for _, scanner in ipairs(scanners) do values[#values+1] = scanner() end func(table.unpack(values)) end local index = luatexbase.new_luafunction(name) lua.get_functions_table()[index] = scanning_func if protected then token.set_lua(name, index, "protected") else token.set_lua(name, index) end end local function body_expression(str) return load(str, "expression", "t", _G)() end local function set_object(hash) local object = body_expression(hash.object) local name = hash.name lua_tikz3dtools.math[name] = object end register_tex_cmd("setobject", function() set_object{ nice = token.get_macro("jasper@nice"), } end, { })

  • How to draw steographically projected Clifford parallels?
    by Jasper on April 25, 2026 at 2:11 am

    I want to draw that cool diagram by Penrose in twistor theor; it's supposed to be composed of steographically projected Clifford parallels. credit: https://www.eurekalert.org/multimedia/928836 Not this Clifford: But rather this one: I attempted to try it myself, as I am fond of stereographic projection. However, I have never studied Clifford tori. I have no basis to check is my work is actually based on Clifford parallels. I only made tori using regular old stereographic projection. I don't know if this is right. This is the MWE I made. It uses my package, which can be downloaded from github. \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \foreach \CCC in {5,10,...,25} { \begin{tikzpicture} \useasboundingbox (-5,-5) rectangle (5,5); \appendlight[v = {return Vector:new{1, 1, 1 , 1}}] \def\SSS{3} \foreach \AAA in {0,30,60} { \pgfmathsetmacro{\AAA}{\AAA+\CCC} \setobject[ name=a,object={\AAA*pi/180} ] \setobject[ name=R, object={1/cos(a)} ] \setobject[ name=r, object={sqrt(abs(1/cos(a)^2)-abs(cos(a)))} ] \setobject[ name=view, object = {Matrix.zyzrotation3(pi/2, pi/3, pi/6)} ] \pgfmathtruncatemacro{\BBB}{((\AAA-10)*10/7)} \appendsurface[ ustart={pi/2}, ustop={-pi}, usamples= 20, vstart=0, vstop=tau, vsamples= 50, transformation = {return view}, v = { return Vector.hsphere3(u, v, r) :hadd(Vector:new{R*cos(u), R*sin(u), 0, 1}) }, filter = { local M = A:hadd(B):hadd(C):hscale(1/3):multiply(view:inverse()) return abs(M[1]) < \SSS.001 and abs(M[2]) < \SSS.001 and abs(M[3]) < \SSS.001 }, fill options = {fill={gray!\BBB!black!50!ltdtbrightness},fill opacity = 1}, curve = { local segments = {} local domain_origin = pi/2 local branches = 7 local samples_per_branch = 40 local samples = branches*samples_per_branch local step = tau/samples local function append_segment(s0, s1) if s1 <= s0 then return end local wrap = floor(branches*s0/tau + 1e-9) local u0 = domain_origin - s0 local u1 = domain_origin - s1 local v0 = branches*s0 - wrap*tau local v1 = branches*s1 - wrap*tau table.insert(segments, { Vector:new{u0, v0}, Vector:new{u1, v1}, drawoptions = "draw = green!50!black, thick" }) end for i = 0, samples - 1 do local s0 = i*step local s1 = s0 + step local wrap0 = floor(branches*s0/tau + 1e-9) local wrap1 = floor(branches*s1/tau + 1e-9) if wrap0 == wrap1 then append_segment(s0, s1) else local seam = (wrap0 + 1)*tau/branches append_segment(s0, seam) append_segment(seam, s1) end end return segments } ] } % ends foreach \appendsolid[ ustart=-\SSS, ustop=\SSS, usamples= \SSS, vstart=-\SSS, vstop=\SSS, vsamples= \SSS, wstart=-\SSS, wstop=\SSS, wsamples= \SSS, transformation = {return view}, filter = {return false}, v = {return Vector:new{u, v, w, 1}} ] \displaysimplices \end{tikzpicture}} % ends \CCC \end{document}

  • Improved visualization of the domains of integration in ℝ³
    by Sebastiano on April 24, 2026 at 9:26 pm

    Before of this question, I would like to thank the authors of the answers and everyone who appreciated my question. I had previously created these two figures related to two triple integrals. Is there a better way to improve their presentation and make them clearer and more visually appealing? T={(x, y, z) ∈ ℝ³: (x²+y²)¹/² ≤ z ≤ 1}. \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{60}{130} \begin{tikzpicture}[tdplot_main_coords,scale=3] \pgfmathsetmacro{\h}{0.6} \pgfmathsetmacro{\raggio}{\h} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {\footnotesize$x$}; \draw[dashed] (0,0,0) -- (-1.5,0,0); \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {\footnotesize$y$}; \draw[dashed] (0,0,0) -- (0,-1.5,0); \draw[thick,->] (0,0,1.0) -- (0,0,1.5) node [above] {\footnotesize$z$}; \draw[dashed] (0,0,0) -- (0,0,1.0); \foreach \altura in {0.01,0.02,...,1.0}{ \draw[cyan,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\altura*cos(\t r)},{\altura*sin(\t r)},{\altura}); } \draw[blue,thick,fill=brown!50,opacity=0.6] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[dashed,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},0); \foreach \t in {0,10,30,60,90,120,150,250,280,310}{ \draw[black,dashed,thin,opacity=0.7] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \fill[gray,opacity=0.1] (-1.2,-1.2,\h) -- (1.2,-1.2,\h) -- (1.2,1.2,\h) -- (-1.2,1.2,\h) -- cycle; \draw[red,very thick] (0,0,\h) -- (0,\raggio,\h); \node at (0,1.5,\h) {\small $z=h$}; \node at (0,0.5,0.75) {\small $z$}; \node at (0,0.25,-0.35) {\small $T(z=0)$}; \node at (0,.75,1.3) {\small $T(z=h)=T(z)$}; \end{tikzpicture} \end{center} \end{document} C= {(x,y,z)∈ ℝ³: z∈ [0, 2], x²+ y²≤ z} \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{70}{130} \begin{tikzpicture}[tdplot_main_coords,scale=2.5] \pgfmathsetmacro{\h}{.6} \pgfmathsetmacro{\raggio}{sqrt(\h)} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {$x$}; \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {$y$}; \draw[thick,->] (0,0,0) -- (0,0,1.5) node [above] {$z$}; \draw[red,very thick] plot[domain=-1:1,smooth,variable=\t] (0,{\t},{\t*\t}); \draw[blue,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[fill=yellow,dashed,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{0}) node [above] {\tiny $C(z)$}; \foreach \t in {0,10,...,350}{ \draw[gray, dashed, thin,opacity=0.4] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \foreach \altura in {0.0125,0.025,...,1.0}{ \pgfmathsetmacro{\radio}{sqrt(\altura)} \draw[cyan,thick,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\radio*cos(\t r)},{\radio*sin(\t r)},{\altura}); } \fill[orange!30,opacity=0.4] (-1,-1,\h) -- (1,-1,\h) -- (1,1,\h) -- (-1,1,\h) -- cycle; \draw[blue,very thick] (0,0,\h) -- (0,{\raggio},\h); \node[black, above right] at (0,{\raggio/2},\h) {\tiny $\sqrt{z}$}; \draw[blue,fill=yellow,dotted,thick,opacity=0.4] plot[domain=0:360,smooth,variable=\t] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}); \draw[blue!80,thick] plot[domain=0:2*pi,smooth,variable=\t] ({cos(\t r)},{sin(\t r)},{1.0}); \end{tikzpicture} \end{center} \end{document}

  • Ungrouped alternatives to \foreach which are still canonical to use with tikz
    by Jasper on April 24, 2026 at 7:51 pm

    Are there ungrouped alternatives to \foreach which are still canonical to use with tikz? I need to define a color in a loop and use it outside. Maybe expl3? \documentclass{article} \usepackage{pgffor,xcolor} \begin{document} \foreach \i in {1,2} {\colorlet{blah}{blue!\i}} \textcolor{blah}{blah} \end{document}

  • Tikz pie chart with units
    by Thomas on April 24, 2026 at 1:07 pm

    I have a pie chart representing a distribution of hours, and I'm using the option sum=auto to display the chat by these values. But I'd like to add the unit of the values inside the plot. If I type 12~h/Maths it raises error because LaTeX tries to compute the percentages. How could I achieve it ? \documentclass{article} \usepackage{pgf-pie} \begin{document} \begin{tikzpicture} \pie[sum = auto]{ 12/Maths, 9/Physique-Chimie, 2/Informatique, 2/TIPE, 2/Français } \end{tikzpicture} \end{document}

  • European Computer Modern-like font that allows for bold italic smallcaps (textsc)?
    by canIchangethis on April 24, 2026 at 8:40 am

    I would love to have bold, italicised small caps in my LaTeX document, using T1 encoding and, ideally, a font as close as possible to European Computer Modern. And I would like to only redefine \textbf{\textit{\textsc{}}} so that I can use smallcaps in italic and bold from another font. Related, I found this older question: https://tex.stackexchange.com/a/746482/114622 Thus, this is my MWE, which doesn't work, as in, it produces the warning: Font shape `T1/cmr/bx/scit' undefined \documentclass{article} \usepackage[T1]{fontenc} begin{document} \begin{center} \textbf{\textit{\textsc{my text}}} \end{center} \end{document}

  • pgf-PeriodicTable: produce a gap at La and Ac
    by cis on April 24, 2026 at 1:36 am

    How could I create a gap here (as seen sometimes)? \documentclass[landscape]{article} \usepackage[margin=11mm]{geometry} \usepackage{pgf-PeriodicTable} \tikzset{every picture/.append style={remember picture}} \begin{document} \pgfPT[ show title=false, show legend=false, IUPAC=false,% puts La and Ac above ] % Test \begin{tikzpicture}[remember picture, overlay] \node[fill, inner sep=0pt, minimum size=2mm, cyan, text=red] at (3.center) {UL}; \end{tikzpicture} \end{document}

  • Is \textit now long, instead of short?
    by rallg on April 24, 2026 at 1:25 am

    In the past, something such as \textit{this\par that} would throw an error, because the \textit command was "short" (it could not span paragraphs). But I now see (TeXlive 2026) that is is "long" (can span paragraphs). This is verified by inspecting code in file latex.ltx even though that file is not necessarily loaded. Even AI did not know that! Or did I hack something, and forgot about it?

  • Next odd-numbered physical page
    by Elayson Abreu on April 23, 2026 at 7:19 pm

    I need to create a page break command called \nextoddphysicalpage that moves the current point to the next odd-numbered page, considering the physical numbering of the document, not the logical numbering. My near-solution was based on the \checkoddpage command, but it takes into account the logical numbering, not the physical one: \documentclass{article} \usepackage[strict]{changepage} \def\checkifodd{\checkoddpage \ifoddpage Odd\else Even\fi} \addtocounter{page}{1} \begin{document} Logical page: \checkifodd. \end{document}

  • Interaction (?) of AtBeginDocument hooks
    by campa on April 23, 2026 at 6:55 pm

    In trying to boil down my problem to a MWE, I came to the following code: \begin{filecontents}[overwrite]{foo.cls} \ProvidesClass{foo} \LoadClass{article} \AtBeginDocument{\relax}% <-- comment this line out \RequirePackage{icomma} \AtBeginDocument{\show\mathcomma} \end{filecontents} \documentclass{foo} \begin{document} Hello world! \end{document} Running pdftex on this yields > \mathcomma=undefined. \__hook begindocument ->\relax \show \mathcomma \mathchardef \mathcomma \mat... l.9 \begin{document} while commenting out the first \AtBeginDocument one gets (./mwe.aux) > \mathcomma=\mathchar"613B. \__hook begindocument ...,="8000 \show \mathcomma \__hook_toplevel begindocu... l.9 \begin{document} Background (in case it matters) After loading icomma I'd like to calculate the math code of a \mathord comma, something along the lines of \RequirePackage{icomma}% this defines \mathcomma \AtBeginDocument \AtBeginDocument{\edef\ordcomma{\the\numexpr\mathcomma-4096*(\mathcomma/4096)\relax}} and this kept failing until I found out something seems to interact with the hook used before loading icomma.

  • package ebproof, left label usage
    by Jasper on April 23, 2026 at 10:46 am

    I am trying to typeset the forall introduction rule using ebproof, as suggested here: https://tex.stackexchange.com/a/762165/319072. I am reading the manual, but the left label key is not producing the expected result. I am getting this: and what I expect is this (credit Constructivism in Mathematics): \documentclass[letterpaper]{article} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \usepackage{ebproof} \begin{document} \[ \begin{prooftree} \hypo[left label=\forall I]{\overset{D_1}{A}} \infer1{\forall yA[x/y]} \end{prooftree} \] \end{document}