Week
- Unable to enumerate in tagged lualatexby Miloop on January 14, 2026 at 7:12 am
I am trying to make an inline list using enumerate*, but it isn't working when trying to make a tagged document. I want the output to look like this: , but I am getting lonely item errors. Here is my minimal code that generates the error: \DocumentMetadata{lang=en-UK, tagging=on, pdfstandard=UA-2} \documentclass[a4paper,12pt,oneside]{book} \usepackage[inline]{enumitem} \begin{document} Therefore such ideas are expressed as: \begin{enumerate*}[label=(\roman*)] \item Suggestions \item Compulsions \item Delusions \item Pertrusions \item Overwhelming sense of righteousness \item Own by themselves where every entity is largely linked to another for its own survival. \end{enumerate*} \end{document} and here is the first bit of the the error in the .log: ! LaTeX Error: Lonely \item--perhaps a missing list environment. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.11 \item S uggestions Try typing <return> to proceed. If that doesn't work, type X <return> to quit.
- Acro package: Use long form for pdfcommentby miile7 on January 13, 2026 at 10:05 am
I am using the (awesome) acro package to manage my acronyms. Therefore, I want acronyms to be displayed in the pdf when hovering over them. acro supports this out of the box by using the pdfcomment package and the pdfcomments/use=true option. I always want to display the long form of the acronym, which is (in my case) always just text. So currently I'm using the following (for MWE see below): \DeclareAcronym{AI}{ short=AI, long=artificial intelligence, pdfcomment=artificial intelligence, } While this creates exactly the output I'm looking for (and I'll continue to use it, if not otherwise possible), it feels weird to insert the same text twice. As acro has served with perfect solutions to all my problems until now, I'm wondering whether there is a more elegant way to just use the long form for the pdf comments. Thank you in advance. Minimal Working Example (MWE): \documentclass{article} \usepackage{acro} \usepackage{pdfcomment} \acsetup{ pdfcomments/use=true, } \DeclareAcronym{AI}{ short=AI, long=artificial intelligence, pdfcomment=artificial intelligence, } \begin{document} Currently, the big thing is \ac{AI}. \end{document} Results in the following intended behavior:
- Put a text in the middle of a path move operation in Tikzby Harald on January 12, 2026 at 4:24 pm
I know how to use \draw (0,0) -- node[below]{X} (10,0); to put the text X in the middle below the line between the coordinates. What I would like to have is the very same, but without drawing the line, yet the following does not work (somewhat to my surprise :-/) \draw (0,0) node[below]{X} (10,0); I figured out a way involving node at ($ ...!.5!... $) yet \draw would sometimes be a bit more natural and I would in particular like to understand why it does not work, as I seem to miss some fundamental knowledge here.
- In ltx-talk make text body not vertically centeredby Jim Hefferon on January 12, 2026 at 3:44 pm
In ltx-talk the default is for body text to be vertically centered. How to instead make it display always starting from the page top? Vertical centering makes the text jump around when I use the \only<..>{} command. That is, how to achieve what in Beamer I get with \beamer@centeredfalse? Here is an MWE. Between slides 1 and 2 the first paragraph jumps up. \DocumentMetadata{tagging = on} \documentclass{ltx-talk} \usepackage{blindtext} \begin{document} \begin{frame} \frametitle{Frame title} \blindtext \only<2>\blindtext \end{frame} \end{document}
- Can no longer change BoldFont with New Computer Modernby mbert on January 12, 2026 at 3:13 pm
Until a recent update, the following example used New Computer Modern book weight in the first paragraph and Latin Modern demibold in the second paragraph (confirmed with an older texlive in Overleaf). After the update, the BoldFont setting no longer seems to work and New Computer Modern bold is used. \documentclass{article} \usepackage{fontspec} \usepackage{kantlipsum} \setmainfont{NewCM10-Book.otf}[ BoldFont=lmromandemi10-regular.otf, ] \begin{document} \kant[1][1-2] \bfseries \kant[1][1-2] \end{document} I know there was some recent discussion around NewCM defaulting to Harf mode and not being able to override this due to the provided .fontspec files. Did something change so that setting BoldFont is no longer possible? Note that if NewCM10-Book.otf is changed to another font, say TeX Gyre Pagella, then the example works as expected.
- Cyrillic script letter el with tailby moorooduc on January 11, 2026 at 11:19 pm
I am trying to typeset a text in the Khanty language, whose orthography uses the Cyrillic script. I know how to make Cyrillic script work in the book project, but Khanty has the letter Ӆ ӆ (that's a Cyrillic lower case "L" with a tail: https://en.wikipedia.org/wiki/El_with_tail). I don't find a way to typeset this correctly. Does anyone have advice?
- Why is my pgffor loop not iterating as expected? \foreach \i[parse=true] in {0,pi/18,...,2*pi-pi/18} {works \i\\}by Jasper on January 11, 2026 at 10:47 pm
Why is my pgffor loop not iterating as expected? \documentclass{article} \usepackage{pgffor} \begin{document} \foreach \i[parse=true] in {0,pi/18,...,2*pi-pi/18} {works \i\\} \end{document} It only prints the first two elements of the sequence, but not the rest. It does however work when I evaluate the numbers first: \documentclass{article} \usepackage{pgffor} \usepackage{pgfmath} \begin{document} \pgfmathsetmacro{\a}{pi/18} \pgfmathsetmacro{\b}{2*pi-\a} \foreach \i[parse=true] in {0,\a,...,\b} {works \i\\} \end{document} I would expect parse = true to do this for me. Am I mistaken?
- tikz: using the pos key to place nodes along a plotby Jasper on January 11, 2026 at 7:39 pm
In this tikz MWE, why is the node placement not even close to pos=0.7 on a plotted curve? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain = 0:2, samples = 100, variable = \y ] plot (\y*\y,\y) node[pos = 0.7, above left] {\(x=y^2\)} ; \end{tikzpicture} \end{document}
- Problem with \ifxby user209882 on January 11, 2026 at 6:32 pm
\def\drawDSID#1#2{ \def\trP{#2}\def\rpT{R}\def\trV{\ifx{\trP}{\rpT}3\else2\fi} \trV} The result is always 2, irrespective of #2, eg \drawDSID{(0,-7)}{R};
- label referencing problem in tcolorboxby mmjt on January 11, 2026 at 5:38 am
I am trying to use tcolorboxes to highlight exercises in a math tutorial (book document class) for a course I teach. I use a \label in the box hoping to reference the exercise by number in the solutions manual. However, the label does not "attach" to the colorbox; instead it returns the section number. Thus, Exercise "17" is referenced as "2.2.3" because that is the chapter section it is in. This behavior is different to that of a normal LaTeX environment and I am going in circles trying to resolve the issue. The tcolorbox manual is very detailed, but I cannot sort out this (seemingly) simple issue. What I want to accomplish is this: (1) create a box and put a \label{mylabel} in it. (2) \ref{mylabel} returns the box (exercise) number. (3) I want to reset the box numbering at the start of each chapter, with no "cross-talk" between the similarly numbered boxes in each chapter. I hope somebody can help restore my sanity and reveal the secret to doing this! Here is a MWE: \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{most} \begin{document} \section{Introduction} This document contains labeled tcolorboxes in Section \ref{sec:example}. The first box is numbered as \ref{box:label1}. \section{An Example Section} \label{sec:example} \newcounter{myboxcounter} \newtcolorbox[auto counter]{mybox}[1][]{ enhanced, colback=blue!5!white, colframe=blue!75!black, fonttitle=\bfseries, before title={\refstepcounter{myboxcounter}}, title={Exercise~\arabic{myboxcounter}\ifx#1\empty\else\ (#1)\fi}, fonttitle=\bfseries, breakable } \begin{mybox}[] \label{box:label1} This is box \ref{box:label1}. \end{mybox} \begin{mybox}[] \label{box:label2} This is box \ref{box:label2}. \end{mybox} \subsection{An Example Section} \begin{mybox}[] \label{box:label3} This is box \ref{box:label3}. The first two are boxes \ref{box:label1} and \ref{box:label2}. \end{mybox} \end{document}
- How get ISO math style with lua-unicode-math package?by murray on January 11, 2026 at 12:26 am
The commented-out line in the source below, if used instead of the line preceding it, produces ISO-style for upper-case Greek math letters, namely, Italic insead of upright. How does one get the same result with lua-unicode-math instead of just unicode-math? % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage{fontspec,lua-unicode-math} %\usepackage[math-style=ISO]{unicode-math} % Italic upper-case Greek math \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] \begin{document} $a, z, B, X, \quad \alpha, \beta, \Gamma, \Xi $ \end{document}
- How to move an equations system letter to midline height?by graograman on January 10, 2026 at 6:36 pm
I'd like to move the letter H below so it's at a midline height in between the two equations, please. Here's a MWE. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \left.\begin{matrix} \frac{x-h}{a}=\sec\theta\Rightarrow x-h=a\sec\theta\Rightarrow x=a\sec\theta+h \\ \frac{y-k}{b}=\tan\theta\Rightarrow y-k=b\tan\theta\Rightarrow y=b\tan\theta+k \end{matrix}\right\}\Rightarrow \mbox{\Huge$\mathcal{H}$:} \begin{matrix} x=a\sec\theta+h \\ y=b\tan\theta+k \end{matrix} \end{equation*} \end{document} This code produces the equations system thus:
- Redefine `$...$` to `\(...\)`by weisj on January 10, 2026 at 2:44 pm
The mathtools package can automatically insert italics correction when using \(...\) for inline math mode. See this answer. However, I much prefer $...$ for inline math as I find it more readable and comfortable to type on my keyboard layout. I am currently using the following hack to keep using the $...$ syntax while preserving the italics correction. \catcode`\$=13% \def$#1${\(#1\)}% I haven't had issues with it in my current document, but I was wondering whether there are reasons this might be a bad idea. I would image that if this was harmless the mathtools package would use it to also patch the $...$ syntax for the mathic feature. So my question is: Is this safe and are there any caveats I might be overseeing?
- Degree character breaks compilation with latex+dvipdfmx and fourier packageby user691586 on January 10, 2026 at 10:56 am
I have encountered a build breakage which I could reduce to the following document: \documentclass[dvipdfmx]{article} \usepackage{fourier} \begin{document} \thispagestyle{empty} \showoutput n°1 \end{document} After executing latex, the dvipdfmx step crashes $ dvipdfmx test test.dvi -> test.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx test I had a similar issue at some point with xelatex (not using dvipdfmx class option) while I was reducing from the real-life document but I could not reproduce it later on once reaching the above mwe, so it may have been a process error on my part. Examining fourier.sty I have reduced it to this even more minimal reproducer: \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} \thispagestyle{empty} \showoutput n°1 \end{document} $ latex testminimal.tex This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./testminimal.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-29> (/usr/local/texlive/202x/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/202x/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/fontenc.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/textcomp.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/t1futs.fd) (/usr/local/texlive/202x/texmf-dist/tex/latex/l3backend/l3backend-dvipdfmx.def) (./testminimal.aux) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/ts1futs.fd) Completed box being shipped out [1] \vbox(633.0+0.0)x407.0 .\glue 16.0 .\vbox(617.0+0.0)x345.0, shifted 62.0 ..\vbox(12.0+0.0)x345.0, glue set 12.0fil ...\glue 0.0 plus 1.0fil ...\hbox(0.0+0.0)x345.0 ....\hbox(0.0+0.0)x345.0 ..\glue 25.0 ..\glue(\lineskip) 0.0 ..\vbox(550.0+0.0)x345.0, glue set 539.94232fil ...\write-{} ...\glue(\topskip) 3.65001 ...\hbox(6.34999+0.0)x345.0, glue set 316.21002fil ....\hbox(0.0+0.0)x15.0 ....\T1/futs/m/n/10 n ....\TS1/futs/m/n/10 ? ....\T1/futs/m/n/10 1 ....\penalty 10000 ....\glue(\parfillskip) 0.0 plus 1.0fil ....\glue(\rightskip) 0.0 ...\glue 0.0 plus 1.0fil ...\glue 0.0 ...\glue 0.0 plus 0.0001fil ..\glue(\baselineskip) 30.0 ..\hbox(0.0+0.0)x345.0 ...\hbox(0.0+0.0)x345.0 (./testminimal.aux) ) Output written on testminimal.dvi (1 page, 256 bytes). Transcript written on testminimal.log. $ dvipdfmx testminimal.dvi testminimal.dvi -> testminimal.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx testminimal.dvi I am using TL2025, fully updated as of today. The problem goes away if one removes the ° character. The problem is not only one of that character it is also triggered by the \thanks macro. \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \title{A} \author{B\thanks{C}} \date{} \begin{document} \maketitle \end{document} $ dvipdfmx test2 test2.dvi -> test2.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx test2 Actually the culprit here is \textasteriskcentered. Same problem with \textdagger. \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} % A\textasteriskcentered % \ifcase#1\or \TextOrMath\textasteriskcentered *\or % \TextOrMath \textdagger \dagger\or % \TextOrMath \textdaggerdbl \ddagger \or % \TextOrMath \textsection \mathsection\or % \TextOrMath \textparagraph \mathparagraph\or % \TextOrMath \textbardbl \|\or % \TextOrMath {\textasteriskcentered\textasteriskcentered}{**}\or % \TextOrMath {\textdagger\textdagger}{\dagger\dagger}\or % \TextOrMath {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}\else \textdagger \end{document} Same with xelatex. Use \documentclass{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} \textdagger \end{document} Then $ xelatex testxelatex This is XeTeX, Version 3.141592653-2.6-0.999997 (TeX Live 2025) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode (./testxelatex.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-29> (/usr/local/texlive/202x/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/202x/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/fontenc.sty (/usr/local/texlive/202x/texmf-dist/tex/latex/lm/t1lmr.fd)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/textcomp.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/t1futs.fd) (/usr/local/texlive/202x/texmf-dist/tex/latex/l3backend/l3backend-xetex.def) (./testxelatex.aux) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/ts1futs.fd) [1] (./testxelatex.aux)Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. ) Error 6 (driver return code) generating output; file testxelatex.pdf may not be valid. Transcript written on testxelatex.log. (not so surprising as xelatex uses xdvipdfmx; and xelatex --no-pdf testxelatex compiles without error.)
- How to split the value of a macro into elements using LaTeX3?by lukascbossert on January 10, 2026 at 10:24 am
I would like to have separate values for the content of the macro. In the example below they should be considered as two elements (splitted at the ,). \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \seq_new:N \l_inst_seq \newcommand{\institutions}{ins1,ins2} \begin{document} \ExplSyntaxOn % Split the macro contents at commas \seq_set_split:Nnn \l_inst_seq { , } { \institutions } % Use the sequence Count:~\seq_count:N \l_inst_seq\par Items:~\seq_use:Nn \l_inst_seq {~|~} \ExplSyntaxOff \end{document}
- LaTeX enumeration: two-digit numbering with prefix (FR-01)by Markus M on January 10, 2026 at 10:21 am
I currently fail to create an referenceable enumeration in LaTeX where each item is labeled and numbered with a fixed string prefix, and a two-digit number with leading zeros Example: FR-01, FR-02, FR-03, … References using \ref / \cref should reproduce the item prefix+number (e.g. FR-01). What already works This minimal example works for one-digit numbers: \documentclass[12pt,a4paper,twoside,openright]{scrbook} \usepackage{enumitem} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \begin{enumerate}[ label=\textbf{FR-\arabic*}, ref=FR-\arabic*, leftmargin=*, ] \item\label{fr:upload-data} The system shall allow a user to upload data. \end{enumerate} This task addresses \cref{fr:upload-data}. \end{document} This produces FR-1 This task addresses FR-1. What I want FR-01 This task addresses FR-01. My attempts to use commands such as \twodigits fail. Does anyone have a good solution and can help?
- How to tweak the distance of resistor's "+"/"-" label's vertical distance when `raised` is set?by Explorer on January 10, 2026 at 10:09 am
I have the following code: \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \ctikzset{voltage=raised}%<- \draw (0,0) -- ++(1,0) to[R=R,label distance=3pt, v=$\mathrm{u_R}$] ++(0,+3) -- ++(-1,0); \end{circuitikz} \end{document} However, I want the "+" and "-" to get closer with "u_R"(that is: shift "+" up and shift "-" down), I have tried shift and label distance and voltage/distance from node, but all failed, because they justs tweak the distance between the wire. It's hard for me to dig it out from the manual, is that exists elegant method?
- What is the symbol/macro for `$(\!\!)$` (symbol that looks like opening and closing paretheses that overlap each other)?by Dima Pasechnik on January 10, 2026 at 1:05 am
In 100+ years old algebraic geometry texts one sees notation like $(a(\!\!)A,B,C)^2=0$. How does one properly typeset $(\!\!)$ in (La)TeX? for some reason I can't seem to be able to post proper TeX here. Edited The symbol's usage and example screenshot is shown in x-post at here and in the comment:
- How to improve graphs of functions of two variables with jagged edges in pgfplots?by orion2112 on January 9, 2026 at 10:19 pm
In the spirit of creating "beautiful plots" of functions of two variables, I am reaching out to this community to try and find possible improvements in the way I have been using pgfplots and \addplot3. Here are 3 attempts at graphing the paraboloid $f(x,y)=x^2+y^2$. Attempt 1: plotting {x^2+y^2} in cartesian coordinates with no restriction on the z domain yields a plot that "hides part of itself" and doesn't readily show the "bowl" shape we all love: \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Smooth and ugly} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, domain=-3:3, y domain=-3:3, opacity=0.5 ] {x^2+y^2}; \end{axis} \end{tikzpicture} \end{document} Attempt 2: adding the "restrict z to domain=-3:3" option, but this produces a very jagged top edge to the paraboloid, and not a nice smooth circle. Adding samples reduces the jaggedness slightly but there is a limit to how many samples I can put before I get an error, and that isn't enough to get a smooth circle. \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Jagged edges at top} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, domain=-3:3, y domain=-3:3, restrict z to domain={-3:3}, opacity=0.5 ] {x^2+y^2}; \end{axis} \end{tikzpicture} \end{document} Attempt 3: using data cs=polar and a domain of 0:360 instead of -3:3 gets me to an acceptable graph that doesn't hide itself and that has a smooth border: \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Not jagged, but polar coords} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, data cs=polar, domain=0:360, y domain=-3:3, restrict z to domain={-3:3}, opacity=0.5 ] ({x},{y},{y^2}); \end{axis} \end{tikzpicture} \end{document} Problem solved? Not really. What if now I want to plot f(x,y)=x/(y-x)? If done in cartesian coordinates without restricting the z domain, the graph "hides itself". If done in cartesian coordinates and restricting the z domain, some of the edges are jagged. For instance: (I seem to notice that if the mesh line is parallel to one of the "walls" of the plot box, there is no jagged edge, but if a "square" of the mesh is outside the z domain, the whole square is erased, and not just the part that is outside the z domain). And here I don't see how polar coordinates would be usable to bypass that problem. "But, this is not a nice function, of course the graph will be ugly". Fair enough, but seeing that Desmos does it instantly and even allows you to rotate the plot smoothly, I was hoping that maybe it's possible to do better here: So, is there anything that can be done about this? Am I using this wrong? Or is it just a limitation of plotting surfaces in LaTeX? Thanks in advance for all the insight. Note: I am aware of the topic here and that it seems there are only rectangular (and not triangular) surface elements, but I am not sure the issue is the same nor how \clip and \begin{scope} were used to fix the issue. If this is the way to go, can someone explain what those commands do exactly?
- I would like to create a graph paper documentby Brion C on January 9, 2026 at 4:36 pm
I'm trying to create a graph paper document and have the text align to the grid (Not just superimposed on it). The text should at least align with baseline of the grid, but better yet, each character should be placed inside the grid like if you were handwriting on graph paper.
- Simple way to show/hide controls points in a Tikz line?by YaGoi Root on January 9, 2026 at 2:18 pm
In Tikz diagrams, one of the best ways to make controlled curved lines (such as pointing arrows in a flow chart) is using \draw with control points. For example, \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{shapes.arrows, arrows.meta} \begin{document} \begin{figure} \begin{tikzpicture} \draw[thick,->,>=Stealth, show controls] (0,0) .. controls (0.5,3) and (4.5,0).. (5,5); \end{tikzpicture} \end{figure} \end{document} However, I feel like it ends up being a sort of guessing game when trying to determine where to actually place the control points, because I have a hard time visualizing where the points are, but once I know where they are I know how their position affects the curved line. I understand how the points effect the line very intuitively, but moving said points to the desired location is easier when you can see the points as well. Is there any simple way to "toggle" on a display of the control points, so that you can see them while editing the diagram, and then hide them when you've got the line that you want?
- circuitikz: how to get all in the same line width thicknessby cis on January 9, 2026 at 1:37 pm
Is there an easy way to get all in the same line width thickness? I tried to calc some things but I do not think this was correct: \pgfmathsetlengthmacro\lw{2.1pt}% wanted linewidth (circuitikz default 0.8pt) \pgfmathsetlengthmacro\lwc{0.8pt}% circuitikz default linewidth 0.8pt % ----> could this be read out somehow? \pgfmathsetmacro\th{\lwc/\lw}% needed bipoles/thickness % ---> do not think, this is correct \documentclass[margin=5pt]{standalone} \usepackage{tikz} \usepackage[]{circuitikz} %\ctikzset{bipoles/thickness=3} \pgfmathsetlengthmacro\lw{2.1pt}% wanted linewidth (circuitikz default 0.8pt) \pgfmathsetlengthmacro\lwc{0.8pt}% circuitikz default linewidth 0.8pt % ----> could this be read out somehow? \pgfmathsetmacro\th{\lwc/\lw}% needed bipoles/thickness % ---> do not think, this is correct \begin{document} \begin{tikzpicture}[european, line width=\lw, circuitikz/bipoles/thickness=\th,% default 2 %circuitikz/sources/symbol/thickness=\th,% default 1 ] \draw (0,3) to [sinusoidal voltage source, v=$u(t)$, ] (0,0); \draw (0,3) to[C=$C$] (4,3) to[resistor={$R$}] (4,0) to[battery1, invert] (0,0); \node[align=left, anchor=north west, fill=yellow!25] at (0,-1) { \textbf{Values}: \\ lw: \lw \\ th: \th \\ bipoles/thickness: \ctikzvalof{bipoles/thickness} \\ circuitikz/sources/symbol/thickness: \ctikzvalof{circuitikz/sources/symbol/thickness} ? \\ ...... }; \end{tikzpicture} \end{document}
- Create a textbox with a figure insideby Mike on January 9, 2026 at 1:34 pm
I would like to create a textbox that includes a figure. The text should wrap around the figure. I tried the following. \documentclass[11pt]{book} % --- 1. Essential Packages --- \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{caption} \usepackage{calc} \usepackage[most]{tcolorbox} \usepackage{helvet} \usepackage{lipsum} \tcbset{ figbox/.style={ enhanced, colback=white, colframe=blue, arc=0mm, fonttitle=\bfseries\sffamily, before skip=15pt, after skip=15pt, boxrule=0.5pt, } } % New environment: wrapbox % Arguments: 1=Side (l or r), 2=Width of figure, 3=Image path, 4=Caption \newenvironment{wrapbox}[4]{ \begin{tcolorbox}[figbox] \begin{wrapfigure}{#1}{#2} \centering \includegraphics[width=#2]{#3} \captionof{figure}{#4} \end{wrapfigure} \leavevmode }{ \par \vspace{0.5pt} % Minimal spacing \end{tcolorbox} } % --- 4. Document Content --- \begin{document} \chapter{Chapter} \section{Section} \begin{wrapbox}{r}{0.35\textwidth}{example-image-a}{Title} Some text to describe an example. \end{wrapbox} \lipsum[5] \end{document} However, the figure is not in the box and even overlaps with my other text that should come after the box. If I have enough text (meaning more than the picture size) it works.However, if I do not have enough text to cover the picture the box is too small and the text below overwrites the figure.
- How to stop PDF readers from reading wordy labels of hyperlinks?by Niranjan on January 9, 2026 at 10:34 am
I am working on a project that creates tagged PDFs. I am using latest TeX Live and standard methods prescribed by the project team. The PDF created is pretty good, but suppose there is a hyperlink with label mypkg-internal-label-1, NVDA with Acrobat reads it aloud (i.e., "Go to mypkg-internal-label-1". Generally package generated labels are cryptic and do not contribute to the general content of the document. Is there any way to suppress it? \DocumentMetadata{tagging=on} \documentclass{article} \usepackage{hyperref} \begin{document} \section{abc}\label{some-cryptic-text} \ref{some-cryptic-text} \end{document} Note that this is already answered in chat, posting it here for future reference.
- Rafael Bombelli's mathematical power notationby Eff on January 9, 2026 at 12:02 am
In the 1572 algebra book L'Algebra by Rafael Bombelli, he uses his own notation for powers. I want to reproduce this notation in LaTeX. Below is a screenshot from the book that shows how he wrote to the sixth power, the fifth power, etc. In general, x to the power of n is written as n above a kind of circular arc. I have found a good example where it is made nicely in LaTeX. But I don't know how to reproduce it. Can anyone offer a solution to writing this power notation in LaTeX?
- PDF/A and PDF/X compatibility: Color questionsby schade96 on January 8, 2026 at 5:43 pm
In my previous question I attempted to make my PDF PDF/A-2B and PDF/X-4 conform. I went a bit further with this and discovered another issue: PDF/X-4 does not support bookmarks, which I definitely want. As a consequence, I actually need PDF/X-6 (which also seems to make external links easier to handle) and thus, because it is based on PDF 2.0, also need to bump the A-conformity to PDF/A-4. This is my current version of the latex code: \documentclass[a4paper]{article} \RequirePackage{pdfmanagement} % Bug patch, see https://github.com/latex3/pdfresources/issues/110#issue-3789290014 \ExplSyntaxOn \keys_define:nn { document / metadata } { _pdfstandard / X-6 .code:n = { \AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6} \__pdfmeta_xmp_add_pdfxid: } } \ExplSyntaxOff % Now set the actual metadata \SetKeys[document/metadata]{ pdfstandard = {A-4,X-6}, lang = en-US, pdfversion = 2.0, colorprofiles = { A = FOGRA39L_coated.icc,% X = FOGRA39L_coated.icc% } } % For now, keep it RGB. \usepackage[rgb]{xcolor} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{fontspec} \usepackage{hyperref} \hypersetup{ colorlinks=true,% urlcolor={blue},% linkcolor={blue},% citecolor={blue},% pdfauthor={me},% pdftitle={pdfxtest},% pdfsubject={subject},% pdfversionid={someversion},% pdfkeywords={a,b,c}% } \ExplSyntaxOn \pdfmeta_xmp_add:n{<xmpMM:RenditionClass>default</xmpMM:RenditionClass>} \__pdfmeta_xmp_schema_new:nnn {Adobe~PDF~Schema} {pdf} {http://ns.adobe.com/pdf/1.3/} \__pdfmeta_xmp_property_new:nnnnn {pdf} {Trapped} {Text} {internal} {Indicates~whether~the~document~has~been~trapped.} \pdfmeta_xmp_add:n{<pdf:Trapped>True</pdf:Trapped>} \pdfmanagement_add:nnn{Info}{Trapped}{/True} % Don't forget to set the page size to A4. \pdfmanagement_add:nnx{Page}{TrimBox} {[0~0~595.276~841.89]} \pdfmanagement_add:nnx{Page}{BleedBox} {[0~0~595.276~841.89]} \ExplSyntaxOff \begin{document} document \\ \href{mailto:nobody}{mail to nobody} % % Construct the image for example like this: % python3 -c "import matplotlib.pyplot as p; p.scatter([0, 1], [0, 1], s=1, rasterized=True); p.savefig('testimage.pgf')" % sed -i '' 's/interpolate=true/interpolate=false/g' testimage.pgf \par\input{testimage.pgf} \end{document} As shown above, the final document only has one remaining compliance issue with the colors: RGB used but PDF/X OutputIntent not RGB If the destination profile of the OutputIntent in a PDF is not RGB, PDF/X prohibits that an object uses DeviceRGB. for all instances where any color is used. This applies to both PDF/A and PDF/X compliance. First of all, it seems that RGB is not generally forbidden by PDF/X, as long it is not DeviceRGB. So the first question is: Do I have an "alternative RGB" available here that is supported by (lua)latex? Sidenote: If it turns out there is no way around CMYK, the question is how I would convert the png files in a compatible way. One solution I found was converting them to pdfs using imagemagick: $ magick image.png -profile FOGRA39L_coated.icc -colorspace CMYK output.pdf More generally, one issue here is: For PDF/X-6 (and predecessors), the color profile must be a prtr (Printer) color profile. The second question is therefore: Are there any RGB printer profiles? I would assume that, if there are any, that these are very rare. Thus, for the moment, I need to assume that I need to make all colors CMYK and load \usepackage[cmyk]{xcolor} instead of \usepackage[rgb]{xcolor} or \usepackage{xcolor}. This however means that all colors now look different. This is of course somewhat expected, since those are different color models. However, I find that the difference is a bit too obvious. Consider this example: \documentclass{article} % Testing these two options: %\usepackage[rgb]{xcolor} \usepackage[cmyk]{xcolor} \definecolor{bluecmyk}{cmyk}{1, 1, 0, 0} \definecolor{bluergb}{rgb}{0, 0, 1} \begin{document} \color{blue}{\rule{1cm}{1cm}} \color{bluecmyk}{\rule{1cm}{1cm}} \color{bluergb}{\rule{1cm}{1cm}} \end{document} which becomes these two: As I understand it, what happens here and how close these colors match is very much device-dependent. After all, the monitor I am viewing this on is ultimately RGB. Is there anything I can do to get a better match between these two colors that I am missing? My ultimate goal is to keep the on-screen colors as close to the ones I am seeing with RGB. Of course, when printed, it may be that the colors are not fully reproduced, since printers are CMYK. Still, the digital version is slightly more important here. In principle I would be open to recompute all colors manually in terms of CMYK if necessary, but then I need to know if I can get a closer match.
- Mixing LTR and RTL languages with lualatex, babel and \lettrineby Daniel Flipo on January 8, 2026 at 2:31 pm
The \lettrine command works as expected in documents written in monolingual LTR or RTL languages, but fails in multilingual documents in English and Hebrew as shown by the following example: \documentclass{article} \usepackage[bidi=basic, hebrew, english]{babel} \babelfont{rm}{Times New Roman} \babeltags{he = hebrew} \usepackage{lettrine} \renewcommand{\LettrineTextFont}{\upshape} % No small caps \begin{document} \lettrine{H}{ello} world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world. \begin{he} \lettrine[lines=3, refstring]{ב} שנות הששים הושפעתי מקליגרפיה עתיקה כמו זו של מגילות ים המלח והעתקתי ידנית פסקאות מן התנ"ך בסגנון הקליגרפיה של מגילות ים המלח. כשגרתי בישראל התחלתי לפתח סגנון משלי בקליגרפיה עברית. לפני כעשר שנים, לאחר שפרשתי, גליתי שיש תוכנות מחשב נגישות לעצוב פונטים. בערבי החורף הארוכים של צפון-מזרח ארה"ב, שפרתי בהדרגה את הגופן על המחשב. אחרי מספר שנים הצגתי על האינטרנט גופן True Type שקראתי לו "Mike Hebrew". דף הגופן הזה זכה ל- 58,000 בקורים ו- 25,250 הורדות של הגופן. הצעד הבא היה לעצב את הגופן על רמה מקצועית בטכנולוגיה עדכנית של Open Type. לגופן הזה קראתי "שונית," על שם רעייתי. \end{he} \lettrine[lines=3,lhang=.5]{H}{ello} world Hello world Hello world Hello Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world. \end{document} and its output: The Hebrew dropped cap is pushed into the right margin (as if option lhang=1 was passed to \lettrine)… Replacing the \begin{he} ... \end{he} environment by {\selectlanguage{hebrew} ... } doesn't fix the dropped cap placement.
- How to use turn coordinate specification in combination with global transforms like scale and shift?by dsacre on January 8, 2026 at 1:54 pm
Scenario Consider the following: One needs to draw from a point on a curve following its tangent direction. TikZ provides for this scenario the ([turn]<ANGLE>:<DISTANCE>) syntax. As one continues the image, it becomes too big for the page layout. In order to prevent having to recreate the complete image with a smaller size, one tries to use the scale parameter (globally on the tikzpicture or via scope does not make a difference for this scenario). MWE \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % DESCRIPTION: Plain, no modification % STATUS: WORKING \draw[black] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{plain} ; % DESCRIPTION: Scale % STATUS: FAIL \begin{scope}[scale=0.5] \draw[red] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{scale} ; \end{scope} % DESCRIPTION: Shift % STATUS: FAIL \begin{scope}[xshift=5cm] \draw[red] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{xshift} ; \end{scope} \end{tikzpicture} \end{document} Result As soon as transformation are applied, the result of the ([turn]<ANGLE>:<DISTANCE>) specification is wrong. Research so far It was tried to encapsulate the \draw command into a TikZ pic, hoping that this might act as a wrapper, but the result was identical. The corresponding section 13.4.2: Rotational Relative Coordinates of the TikZ manual specifies: The effect of this key is to locally shift the coordinate system so that the last point reached is at the origin and the coordinate system is “turned” so that the (x)-axis points in the direction of a tangent entering the last point. From that, I would assume that certain global transforms cannot/will not be taken into account properly. Question Is it possible to use the ([turn]<ANGLE>:<DISTANCE>) syntax under (global) transformations? If not, is there another option to achieve the same functionality or an easy way to implement it? UPDATE: 2026-01-12 I have opened a GitHub Issue, since this behavior seems to be a bug.
- How can I make a multi-line table structure with repeated parameter values more visually appealing?by mingabua on January 7, 2026 at 6:07 pm
I have the following table. I am particularly interested in columns 1-2. There, I have three different values of \mathcal{T} for each value of \mathcal{J}. Unfortunately, I find the current display somewhat meaningless. How can I optimize it and make it look better? \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs} \usepackage{multirow} \usepackage{array} \usepackage{rotating} % für sidewaystable \usepackage{lipsum} % für Blindtext \usepackage{geometry} \geometry{a4paper, margin=2.5cm} \begin{document} \section{Introduction} \lipsum[1-3] \begin{sidewaystable}[p] \centering \footnotesize \caption{Comprehensive performance analysis over 25 scenarios per instance. Values denote: \textbf{Min / Median / Max} (top) and \textbf{Std. Dev.} (bottom). Time components MP, SP, Heur, Branch are reported as percentages of Total Time.} \label{tab:comp_results_comprehensive} \setlength{\tabcolsep}{2pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{cc cc c cccccc c ccc c ccccc} \toprule % HEADER ROW 1 \multicolumn{2}{c}{\textbf{Inst.}} & \multicolumn{2}{c}{\textbf{Compact}} & & \multicolumn{6}{c}{\textbf{B\&P: Solution \& Reliability}} & & \multicolumn{3}{c}{\textbf{B\&P: Tree}} & & \multicolumn{5}{c}{\textbf{B\&P: Time Breakdown}} \\ \cmidrule(r){1-2} \cmidrule(lr){3-4} \cmidrule(lr){6-11} \cmidrule(lr){13-15} \cmidrule(l){17-21} % HEADER ROW 2 $|\mathcal{J}|$ & $|\mathcal{T}|$ & Time [s] & Gap [\%] & & $t_{tot}$ [s] & Gap [\%] & $t_{1st}$ [s] & $N_{Sol}$ & Opt? & Root Int. & & $D_{max}$ & Root Gap & Nodes & & $t_{MP} [\%]$ & $t_{SP} [\%]$ & $t_{Heur} [\%]$ & $t_{Root} [s]$ & $t_{Br} [\%]$ \\ \midrule % --- Block J = 5 --- \multirow{3}{*}{5} & 7 & \shortstack{10/12/15\\1.2} & \shortstack{0/0/0\\0} & & \shortstack{2/3/5\\0.8} & \shortstack{0/0/0\\0} & \shortstack{0.5/0.8/1\\0.2} & \shortstack{2/3/5\\1.1} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.2} & & \shortstack{1/1/1\\0} & \shortstack{0.5/1/2\\0.4} & \shortstack{1/1/1\\0} & & \shortstack{5/10/15\\2} & \shortstack{40/45/50\\3} & \shortstack{10/15/20\\4} & \shortstack{1/2/3\\0.5} & \shortstack{0/0/0\\0} \\ \addlinespace & 14 & \shortstack{40/45/55\\4.1} & \shortstack{0/0/0\\0} & & \shortstack{6/8/11\\1.5} & \shortstack{0/0/0\\0} & \shortstack{1/2/3\\0.5} & \shortstack{3/5/8\\1.5} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/5\\1} & \shortstack{0.2/0.8/1.5\\0.3} & \shortstack{1/5/12\\3} & & \shortstack{8/12/18\\3} & \shortstack{55/60/65\\4} & \shortstack{10/12/15\\2} & \shortstack{3/4/5\\1} & \shortstack{1/2/5\\1} \\ \addlinespace & 28 & \shortstack{150/180/210\\15} & \shortstack{0/0/0\\0} & & \shortstack{18/22/29\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{5/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/8/12\\3} & \shortstack{0/0.5/1\\0.2} & \shortstack{10/25/45\\10} & & \shortstack{10/15/20\\3} & \shortstack{70/75/80\\5} & \shortstack{5/8/10\\2} & \shortstack{10/12/15\\2} & \shortstack{2/5/8\\2} \\ \midrule % --- Block J = 10 (Base Case) --- \multirow{3}{*}{10} & 7 & \shortstack{90/110/140\\12} & \shortstack{0/0/0\\0} & & \shortstack{10/12/18\\2} & \shortstack{0/0/0\\0} & \shortstack{2/3/5\\1} & \shortstack{4/6/9\\2} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.1} & & \shortstack{1/1/3\\0.5} & \shortstack{1/1.5/2.5\\0.5} & \shortstack{1/1/3\\0.5} & & \shortstack{15/20/25\\4} & \shortstack{35/40/55\\6} & \shortstack{15/20/25\\3} & \shortstack{5/6/8\\1} & \shortstack{0/1/2\\0.5} \\ \addlinespace & 14 & \shortstack{1.1k/1.2k/1.5k\\150} & \shortstack{0/0/2\\0.5} & & \shortstack{35/45/60\\6} & \shortstack{0/0/0\\0} & \shortstack{10/15/20\\4} & \shortstack{8/12/18\\4} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/10/15\\4} & \shortstack{0.5/1.1/1.8\\0.4} & \shortstack{20/55/110\\25} & & \shortstack{12/18/22\\4} & \shortstack{50/58/65\\5} & \shortstack{8/10/15\\2} & \shortstack{15/20/25\\4} & \shortstack{5/10/15\\3} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{2/4.5/8\\1.8} & & \shortstack{95/115/145\\14} & \shortstack{0/0/0\\0} & \shortstack{30/45/60\\10} & \shortstack{15/25/40\\8} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{20/35/60\\12} & \shortstack{0.1/0.4/0.9\\0.2} & \shortstack{150/320/580\\110} & & \shortstack{10/15/20\\3} & \shortstack{65/72/85\\8} & \shortstack{2/5/8\\2} & \shortstack{40/55/70\\10} & \shortstack{10/15/20\\5} \\ \midrule % --- Block J = 15 --- \multirow{3}{*}{15} & 7 & \shortstack{480/540/650\\55} & \shortstack{0/0/1.5\\0.3} & & \shortstack{22/29/40\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{6/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/8\\2} & \shortstack{1.5/2.2/3.5\\0.8} & \shortstack{1/5/12\\3} & & \shortstack{20/25/30\\4} & \shortstack{40/45/55\\4} & \shortstack{15/20/25\\3} & \shortstack{10/12/18\\3} & \shortstack{1/3/5\\1} \\ \addlinespace & 14 & \shortstack{TL/TL/TL\\0} & \shortstack{5/8/12\\2} & & \shortstack{80/98/130\\12} & \shortstack{0/0/0\\0} & \shortstack{25/35/50\\8} & \shortstack{20/30/50\\10} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{10/25/45\\10} & \shortstack{0.8/1.5/2.2\\0.6} & \shortstack{80/150/280\\45} & & \shortstack{10/15/20\\3} & \shortstack{55/65/75\\7} & \shortstack{5/8/12\\2} & \shortstack{35/45/60\\8} & \shortstack{8/12/18\\4} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{12/18/25\\4} & & \shortstack{210/245/320\\35} & \shortstack{0/0/0.1\\0.02} & \shortstack{80/120/180\\25} & \shortstack{40/60/90\\15} & \shortstack{0/1/1\\0.2} & \shortstack{0/0/0\\0} & & \shortstack{45/80/120\\25} & \shortstack{0.2/0.6/1.2\\0.3} & \shortstack{500/1.2k/3.5k\\850} & & \shortstack{5/10/15\\3} & \shortstack{70/80/90\\9} & \shortstack{1/3/5\\1} & \shortstack{80/110/150\\20} & \shortstack{15/20/25\\5} \\ \bottomrule \end{tabular} \end{sidewaystable} \section{Results Discussion} \lipsum[4-6] \section{Conclusion} \lipsum[7-8] \end{document}
- TikZ overlay alignment issues in nested tcolorboxes using absolute page coordinatesby user416144 on January 7, 2026 at 5:37 pm
I am designing a complex document layout using tcolorbox. The main container (BoxDars) has specific vertical strips (margins) defined in its overlay. I have created custom commands (\mrhala, \Time, \rems) to place content into these specific strips using TikZ overlays. The Problem: These commands work fine in the main box. However, when I use them inside nested boxes (e.g., inside box2 or box3), the horizontal positioning shifts incorrectly. I tried to compensate for the nesting depth using \value{tcblayer}, but the alignment is still inconsistent. Goal: I want the content of \mrhala, \Time, and \rems to strictly stick to their respective vertical columns defined in the parent BoxDars, regardless of how deep the nesting is. Here is my MWE: \documentclass[a4paper]{article} \usepackage[margin=1cm]{geometry} \usepackage[most]{tcolorbox} \usepackage{amsmath,amssymb,mathtools,,tikz,pifont,fontawesome,array,colortbl,varwidth,yagusylo,lipsum} \usetikzlibrary{calc,shapes.geometric,backgrounds} \renewcommand{\baselinestretch}{1.2} \pagestyle{empty} \parindent=0mm \def\marahil{1.25cm} \def\modat{1cm} \def\REMS{2.5cm} \newtcolorbox{BoxDars}{ enhanced,breakable, blanker,top=10mm, leftupper=\marahil+1mm, rightupper=\modat+\REMS+1mm, colback=white, bottom=3mm, before skip=3pt, after skip=10pt, parbox=false, overlay={ \draw[very thick,fill=orange!45] (interior.north west) rectangle ([yshift=-8mm]interior.north east); \draw[very thick,red!50!black] (interior.south west) rectangle (interior.north east); % Vertical lines (from RIGHT to LEFT for RTL labeling) % Rightmost divider: stages | rest \draw[very thick,red!50!black] ([xshift=\marahil]interior.north west) -- ([xshift=\marahil]interior.south west); % Next: stages | elemes cours | rest \draw[very thick,red!50!black] ([xshift={-\REMS}]interior.north east) -- ([xshift={-\REMS}]interior.south east); % Next: stages | elemes cours | times | rems \draw[very thick,red!50!black] ([xshift={-\modat - \REMS}]interior.north east) -- ([xshift={-\modat - \REMS}]interior.south east); \node[yshift=-4mm] at ([xshift=0.5*\marahil]interior.north west |- interior.north east) {stages}; \node[yshift=-4mm] at ([xshift={0.5*\linewidth +\marahil - \modat-\REMS}]interior.north west |- interior.north east) {elemes cours}; \node[yshift=-4mm] at ([xshift={ -(0.5*\modat+\REMS)}]interior.north east |- interior.north west) {times}; \node[yshift=-4mm] at ([xshift={-0.5*\REMS}]interior.north east |- interior.north west) {rems}; }} \newcommand{\whichbox}{% \ifnum\value{tcblayer}=0 Outside any box% \else Box \Roman{tcblayer}% \fi } \newcommand{\Time}[2][0]{\leavevmode% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{-5.3} \pgfmathsetmacro{\timeShift}{\baseDist - 0.65 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north east |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { \begin{minipage}{1cm}\centering {\large\yagding[ifsymclock]{148}}\\ \normalsize {#2} \end{minipage} }; \end{tikzpicture}% } \newcommand{\rems}[2][0]{\leavevmode% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{-3.6} \pgfmathsetmacro{\timeShift}{\baseDist - 0.55 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north east |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { {\begin{minipage}{2cm}\small\centering #2 \end{minipage}} }; \end{tikzpicture}% } \newcommand{\mrhala}[2][0]{\leavevmode% \tikz[overlay,remember picture,baseline=0pt]{% \def\baseDist{0.3} \pgfmathsetmacro{\newX}{\baseDist - (\value{tcblayer}-1)*0.3} \coordinate (A) at (0,0); \ifnum\value{tcblayer}>0 \coordinate (Edge) at (current page.north west |- A); \node[inner sep=0] at ([xshift=\newX cm, yshift=#1 mm]Edge) {\rotatebox{90}{#2}}; \fi }% } \newtcolorbox{box1}{ title=Title: \whichbox, colframe=blue!50!black, colback=blue!5 } \newtcolorbox{box2}{ title=Title: \whichbox, colframe=red!50!black, colback=red!5 } \newtcolorbox{box3}{ title=Title: \whichbox, colframe=green!50!black, colback=green!5 } \begin{document} helow \begin{BoxDars} Inside box1: \whichbox \mrhala{arg2} \Time{20} \begin{box2} Inside box2: \whichbox \mrhala{arg2} Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox \begin{box3} Inside box3: \whichbox \Time{20} \end{box3} \end{box2} \rems{text text text} \begin{box3} Inside box3: \whichbox \rems{text text text} \end{box3} \end{BoxDars} \end{document} Question: How can I define the coordinates in my custom commands so that they ignore the indentation of nested boxes and align perfectly with the BoxDars vertical strips?