• 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?

  • Weird issue with thmtools and hyperref / cleverref [duplicate]
    by ChesterX on January 8, 2026 at 8:32 am

    So I am having this issue with my setup. I am using hyperref and thmtools for referencing. It always shows the correct name and numbering in the compiled PDF, but for some of the references, clicking on it takes to a completely different one. If I don't use thmtools, at least the links work. But now it is not guessing the environment names correctly. The MWE explains it best. \documentclass{article} \usepackage{lipsum} \usepackage{hyperref} \usepackage[capitalize,nameinlink]{cleveref} \usepackage{thmtools} % Removing this solves the issue. \newtheorem{theorem}{Theorem}[section] \title{Very Important Stuff} \author{ John Doe\thanks{Department of Science, Scientific Institute of Science. \href{mailto:doe@doedle.com}{\texttt{doe@doedle.com}}} } \begin{document} \maketitle \begin{abstract} \lipsum[1] \end{abstract} \section{Introduction} \lipsum[1-3]\\[2em] See \autoref{thm:mainTheorem}. The autoref compiles correctly to ``Theorem 2.1", but clicking it takes to ``Theorem 1.1" (\autoref{thm:usefulTheorem}). The reference \autoref{thm:anotherUsefulTheorem} works exactly as intended. Similarly, \autoref{thm:anotherMainTheorem} compiles correctly to ``Theorem 2.2'', but points to ``Theorem 1.2'' (\autoref{thm:anotherUsefulTheorem}).\\[2em] \lipsum[1-2] \begin{theorem}\label{thm:usefulTheorem} \lipsum[1] \end{theorem} \lipsum[1-2] \begin{theorem}\label{thm:anotherUsefulTheorem} \lipsum[1] \end{theorem} \section{Main Stuff} \lipsum[1-2] \begin{theorem}\label{thm:mainTheorem} \lipsum[1] \end{theorem} \lipsum[1-2] \begin{theorem}\label{thm:anotherMainTheorem} \lipsum[1] \end{theorem} \lipsum[1-2]\\[2em] Even after ``Theorem 2.1'' has been defined, clicking on \autoref{thm:mainTheorem} takes to ``Theorem 1.1", while compiling correctly to ``Theorem 2.1''. Similarly \cref{thm:anotherMainTheorem} points to ``Theorem 1.2'', while compiling correctly to ``Theorem 2.2''.\\[2em] \lipsum[1-2]\\[2em] Cleverref has similar behavior as well : \cref{thm:mainTheorem} points to ``Theorem 1.1'', while printing ``Theorem 2.1''.\\[2em] \lipsum[1-2] \end{document} I have tried to compile the code on overleaf, with the same issue. But, if I change the TeX Live version to 2024, some of the issue goes away, but not all! This makes me think it has to be a some recently updated package. thmtools was last updated on 2023, so the culprit might be hyperref! Any help will be appreciated! Cheers.

  • Attempting to place section heads in the outer a margin resulting in undesired vertical spacing and indentation
    by Gary on January 8, 2026 at 3:15 am

    I'm trying to figure out my error in placing section heads in the outer margin. The result I'm getting is that there is too much vertical space before a Roman-numeral-annotated paragraph (indicated by \Rmnhd) that starts a section than one that does not start a section. That is shown in the first screen shot below. There is too much space between paragraphs I. and III.; for they should be just as II. and IV., both of which are slightly larger than the global white space. When I removed the \Rmnhd command, the vertical space appears correct but the indentation of paragraphs I. and III. is too short; yet II. and IV. appear to be indented according to the global \setupindenting. That is shown in the second screen shot below. I've tried experimenting with the options in \setuphead[section] but I have not been able to determine my error or omission. The example code is at the end. I do not doubt that I'm doing something very stupid and/or overlooking the obvious. Thank you for your assistance. \definepapersize[book][width=8.16in,height=10.66in][letter] \setuppapersize[book] \setuppagenumbering[alternative=doublesided,location=] \definelayout[main][ location=duplex, backspace=1.33in, topspace=0.33in, top=0.33in, topdistance=0in, width=5.0in, height=fit, headerdistance=0.125in, footerdistance=0.150in, header=\lineheight, footer=\lineheight, bottom=0.555in, bottomdistance=0in, leftedge=1.33in, rightmargin=1.375in, rightmargindistance=0.125in] \setupbodyfont[libertinus,12pt] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[justified,hyphenated,hanging,hz] \setupindenting[yes,medium,next] \setupinterlinespace[2.8ex] \define[0]\Rmnhd{\sc\blank[1ex]} % \define[0]\Rmnhd{\sc} \definetext[chapter][footer][pagenumber] \definepagebreak [ChapterPageBreak] [yes] \setuphead [chapter][ page=ChapterPageBreak, header=empty, footer=chapter, numbercommand=\sc, % command=\MyChapter, after=\blank[0.5ex], conversion=romannumerals] \definemargindata [inoutermargin] [outer][ margin=margin, width=\rightmarginwidth, line=2, location=outer, align=middle] \define[2]\MyHead{\inoutermargin{#1 #2}} \setuphead [section] [alternative=text, number=no, style=\MarginOuterFont, % See comment of Wolfgang Schuster at https://tex.stackexchange.com/q/757772/324837 % The default spacing (before={\blank[2*big]}) can be removed by using (before=,). before=, % after=, beforesection=, aftersection=, inbetween=, distance=0pt, textdistance=0pt, % insidesection=\indentation, indentnext=yes, command=\MyHead ] \definecommand Text \samplefile{ward} \starttext \startbodymatter[page=right] \startchapter[title={Inconsistent Added Spacing Before Rom. Nums.}] \samplefile{ward} \startsection[title={Section One}] {\Rmnhd I.\ An introductory sentence about Point One.}\Text \samplefile{ward} {\Rmnhd II.\ An introductory sentence about Point Two.}\Text \samplefile{ward} \stopsection \startsection[title={Section Two}] {\Rmnhd III.\ An introductory sentence about Point Three.}\Text \stopsection {\Rmnhd IV.\ An introductory sentence about Point Three.}\Text \stopchapter \startchapter[title={Consistent No Added Spacing Before Rom. Nums.}] \samplefile{ward} \startsection[title={Section One}] I.\ An introductory sentence about Point One. \Text \samplefile{ward} II.\ An introductory sentence about Point Two. \Text \samplefile{ward} \stopsection \startsection[title={Section Two}] III.\ An introductory sentence about Point Three. \Text \stopsection IV.\ An introductory sentence about Point Three. \Text \stopchapter \stopbodymatter \stoptext ADDED: I think I have the alternative wrong in \setuphead; and it should not be text or margin but margintext. Using that and setting before=\blank[1ex] (the same as in \Rmnhd) and adding \indentation to \Rmnhd appears to provide the desired result below. I assume that the \blank[1ex] is ignored in a \Rmnhd starting a section because the section is to control that white space following the title. Only changes to above example code are: \setuphead [section] [alternative=margintext, number=no, style=\MarginOuterFont, % See comment of Wolfgang Schuster at https://tex.stackexchange.com/q/757772/324837 % The default spacing (before={\blank[2*big]}) can be removed by using (before=,). before=\blank[1ex], %after=, beforesection=, aftersection=, inbetween=, %textdistance=0pt, % distance=0pt, % after=\indentation, % indentnext=yes, command=\MyHead ] \define[0]\Rmnhd{\sc\blank[1ex]\indentation}

  • 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 coordinates
    by Med Elhadi Kh 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?

  • Horizontal space between absolute value symbols
    by J.-E. Pin on January 7, 2026 at 2:53 pm

    Possibly related questions include Absolute values and height scaling on some symbols and Absolute Value Symbols but they do not seem to address my specific question. The code \documentclass[]{amsart} \begin{document} \LARGE $\lvert m_1 \rvert$ $\lvert m \rvert$ $|m_1|$ $|m|$ \end{document} produces the output in which $m$ is horizontally centred between the vertical bars, but $m_1$ is not. Wouldn't it be preferable for everything between the two bars to be automatically centred? In the meantime, is there any way to make my wish come true without too much work?

  • Error, non fatal with ordinary compilation, fatal with latexmk
    by Denis Bitouzé on January 7, 2026 at 2:16 pm

    Why an error which isn't fatal with ordinary compilation (pdflatex, say), is fatal with latexmk? For instance with the following MCE (say test.tex): \documentclass{article} \begin{document} \textb{Foo} \end{document} an output PDF file is produced with: pdflatex -interaction=nonstopmode test despite the error: ! Undefined control sequence. l.3 \textb {Foo} But, with: latexmk -pdf -interaction=nonstopmode test no output PDF file produced: ! Undefined control sequence. l.3 \textb {Foo} ! ==> Fatal error occurred, no output PDF file produced!

  • How to typeset 'proof DAGS'
    by seldon on January 7, 2026 at 9:28 am

    I'd like to render something like A ------------------------------ B C D ---------------- ------ E F ---------------------------- G In general, rather that rendering a proof tree I need to render a proof DAG, in which branches can sometimes rejoin. Is it possible with any of the existing packages?

  • How to correctly align a vertical margin note inside a complex tcolorbox layout with Arabic text?
    by Med Elhadi Kh on January 7, 2026 at 8:36 am

    I am designing a lesson plan layout using tcolorbox and TikZ in XeLaTeX with polyglossia (Arabic). The layout (BoxDars) has a specific right margin reserved for "Stages" (المراحل). I defined a command \mrhala to place vertical text in that specific strip. The Problem: The \mrhala command relies on current page coordinates and manual shifts, which makes it unstable. It does not land exactly in the reserved vertical strip defined in the BoxDars overlay, especially when I change nesting or margins. Goal: I want the vertical text generated by \mrhala to be absolutely positioned centered within the right margin strip (the white space between the red line and the right edge of the box), regardless of where the box is on the page. Here is a Minimal Working Example (MWE): \documentclass[a4paper]{article} \usepackage[margin=1cm]{geometry} \usepackage[most]{tcolorbox} \usepackage[explicit]{titlesec} \usepackage[tikz]{bclogo} \usepackage{amsmath,amssymb,mathtools,bidicontour,tikz,pifont,fontawesome,array,colortbl,varwidth,yagusylo} \usetikzlibrary{calc,shapes.geometric,backgrounds} \usepackage{polyglossia} \setdefaultlanguage[locale=algeria]{arabic} \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Amiri} \newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Sakkal Majalla} \newfontfamily\yot[Script=Arabic,Scale=1.4]{Arial} \def\EN#1{\textenglish{#1}} \def\AR#1{\textarabic{#1}} \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=\modat+\REMS+3mm, rightupper=\marahil+3mm, 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); \draw[very thick,red!50!black] ([xshift=\REMS+\modat]interior.north west) -- ([xshift=\REMS+\modat]interior.south west); \draw[very thick,red!50!black] ([xshift=\REMS]interior.north west) -- ([xshift=\REMS]interior.south west); \draw[very thick,red!50!black] ([xshift=-\marahil]interior.north east) -- ([xshift=-\marahil]interior.south east); \node[white] at ($(interior.north east)!0.5!([shift={(-\marahil,-8mm)}]interior.north east)$) {\RL{\bf\Large{\resizebox {!}{0.3cm}{\textcolor{green!65!black}% {\bidicontour{yellow}{\RL{المراحل }}}}}}}; \node[white] at ($([shift={(-\marahil,0)}]interior.north east)!0.5!([shift={(\modat,-8mm)}]interior.north west)$) {\RL{\bf\Large{\resizebox {!}{0.4cm} {\textcolor{green!65!black}% {\bidicontour{yellow}{\RL{عناصر الدرس }}}}}}}; \node[white] at ($([shift={(\REMS+\modat,0)}]interior.north west)!0.5!([shift={(\REMS,-8mm)}]interior.north west)$) {\RL{\bf\Large{\resizebox {!}{0.4cm}{\textcolor{green!65!black}% {\bidicontour{yellow}{\RL{المدّة }}}}}}}; \node[white] at ($([shift={(\REMS,0)}]interior.north west)!0.5!([shift={(0,-8mm)}]interior.north west)$) {\RL{\bf\Large{\resizebox {!}{0.4cm} {\textcolor{green!65!black}% {\bidicontour{yellow}{\RL{ الملاحظات }}}}}}}; }} \newcommand{\ondor}[1]{ \LR{\tikzpicture \begin{scope}[rotate=-90,smooth cycle, line width=2.3pt, scale=0.3] \draw[line join=miter, color=#1!80] (0,0) -- ++ (0.7,-0.5) -- ++ (0.7,0.5); \draw[line join=miter, color=#1!68] (0,-0.5) -- ++ (0.7,-0.5) -- ++ (0.7,0.5); \draw[line join=miter, color=#1!58] (0,-1) -- ++ (0.7,-0.5) -- ++ (0.7,0.5); \draw[line join=miter, color=#1!38] (0,-1.5) -- ++ (0.7,-0.5) -- ++ (0.7,0.5); \end{scope} \endtikzpicture}} \newcommand\rqm[1]{\ifnum #1 < 10 0\fi #1} \newcounter{exo} \newenvironment{exe}[1][]{ \vglue7mm\begin{tcolorbox}[breakable,enhanced,detach title,blanker,title={\RL{تطبيق}},coltitle=black, boxsep=3mm,top=2mm,bottom=2mm, overlay={ \scoped[on background layer]{ \draw[fill=blue!60!black!1,draw=none](interior.north west)rectangle (interior.south east); \draw[draw=blue!60!black,line width=1.2pt](interior.north east)|- (interior.south west);} \node[anchor=north east,above left,font=\bf\sffamily ,inner xsep=7mm,inner ysep=2mm] (1) at (interior.north east){\tcbtitle}; \scoped[on background layer]{ \draw[fill=blue!60!black!10,draw=blue!60!black,line width=1.2pt](1.north west)--(1.north east)[sharp corners]--(1.south east)--(1.south west)--cycle; \fill[blue!60!black]([xshift=-4mm]1.north east)-|([yshift=-4mm]1.north east)--cycle; \fill[blue!60!black](interior.north east)rectangle([yshift=3pt]1.south west); \fill[blue!60!black](interior.south west)rectangle([yshift=0.5mm]interior.south east); \fill[blue!60!black]([xshift=-0.5mm]interior.south east)rectangle(interior.north east); \coordinate (A) at (1.north west); \coordinate (B) at (1.south west); \coordinate (C) at ($(1.north west)!0.5!(1.south west)$); \draw[draw=blue!60!black,line width=1.2pt,fill=white,rounded corners=2pt] ([yshift=0.7mm]1.north west)--([xshift=5.8mm]C)--([yshift=-0.7mm]1.south west)-- ([xshift=-5.8mm]C)--cycle node (K){}; } \node at ([xshift=-0.5mm]C) (M){ \stepcounter{exo} \bf\rqm{\theexo}}; \node[anchor=east,text=red!40!black] at (M.west)(N){\ondor{blue!60!black}}; \node[anchor=east,text=red!40!black] at (N.west)(N){\RL{\bf\sffamily #1}}; }] }{\end{tcolorbox}} \def\rosol{% \tikzpicture[transform shape,scale=0.5] \node [circle,scale=1.2,draw,fill=gray!25](1){}; \foreach \i in {0,2}{ \draw [line width=.4mm]([shift={(-0.\i,-.08)}]1.north east)arc(-40:-338:1.3mm and 5.3mm);} \endtikzpicture} \newtcolorbox{box1}[1][عنوان]{ enhanced,breakable, before skip=2mm,after skip=1cm,bottom=4mm, colback=white,colframe=black,boxrule=0.5mm, attach boxed title to top center={yshift*=1mm-\tcboxedtitleheight}, varwidth boxed title*=-3cm, boxed title style={frame code={ \path[fill=blue!30!black] ([yshift=-1mm,xshift=-1mm]frame.north west) arc[start angle=0,end angle=180,radius=1mm] ([yshift=-1mm,xshift=1mm]frame.north east) arc[start angle=180,end angle=0,radius=1mm]; \path[left color=blue!60!black,right color=blue!60!black, middle color=blue!40!white] ([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east) [rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east) -- (frame.south east)--(frame.south)[sharp corners]--([xshift=-1mm,yshift=-2mm]frame.south)[rounded corners=1mm]--([xshift=-2mm]frame.south)[rounded corners=1mm]--(frame.south west) --([xshift=-1mm,yshift=-1mm]frame.north west) [sharp corners]-- cycle; },interior engine=empty, },overlay unbroken and first={ \foreach \i in {0.1,0.2,...,0.9}{ \node at ($([yshift=-2.4mm,xshift=2mm]title.north east)!\i!([yshift=-1.4mm]frame.north east)$){\rosol}; } \foreach \i in {0.1,0.2,...,0.9}{ \node at ($([yshift=-2.4mm,xshift=-2mm]title.north west)!\i!([yshift=-1.4mm]frame.north west)$){\rosol}; } }, fonttitle=\bfseries, title={#1}} \newtcolorbox{BoxRafa}[2][red] {enhanced, before skip=2mm,after skip=2mm, colback=yellow!10!white,colframe=black!50,boxrule=0.2mm, attach boxed title to top right = {xshift=-0.6cm,yshift*=1mm-\tcboxedtitleheight}, varwidth boxed title*=-3cm, boxed title style={frame code={ \path[fill=tcbcolback!30!black] ([yshift=-1mm,xshift=-1mm]frame.north west) arc[start angle=0,end angle=180,radius=1mm] ([yshift=-1mm,xshift=1mm]frame.north east) arc[start angle=180,end angle=0,radius=1mm]; \path[left color=tcbcolback!60!black,right color = tcbcolback!60!black, middle color = tcbcolback!80!black] ([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east) [rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east) -- (frame.south east) -- (frame.south west) -- ([xshift=-1mm,yshift=-1mm]frame.north west) [sharp corners]-- cycle; },interior engine=empty, }, fonttitle=\bfseries, title={#2},colbacktitle = {#1}} \newcommand{\Time}[2][0]{% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{0.2} \pgfmathsetmacro{\timeShift}{\baseDist - 0.55 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north west |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { \begin{minipage}{1cm}\centering {\large\yagding[ifsymclock]{148}}\\ \normalsize {{د \EN{#2} }} \end{minipage} }; \end{tikzpicture}% } \newcommand{\rems}[2][0]{% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{-1.5} \pgfmathsetmacro{\timeShift}{\baseDist - 0.55 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north west |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { \RL{\begin{minipage}{2cm}\small\centering #2 \end{minipage}} }; \end{tikzpicture}% } \newcommand{\mrhala}[2][0]{% \tikz[overlay,remember picture,baseline=0pt]{% \def\baseDist{-5.45} \pgfmathsetmacro{\newX}{\baseDist - (\value{tcblayer}-1)*0.3} \coordinate (A) at (0,0); \ifnum\value{tcblayer}>0 \coordinate (Edge) at (current page.north east |- A); \node[inner sep=0] at ([xshift=\newX cm, yshift=#1 mm]Edge) {\rotatebox{90}{\RL{#2}}}; \fi }% } \newtcolorbox[auto counter]{box2}[1][]{enhanced,arc=1.5mm, before skip=2mm,after skip=2mm,right=1mm, colback=white,frame style={left color=white, right color=red!80!black,fill=none},boxrule=0.4mm, attach boxed title to top right= {xshift=-0.01cm,yshift*=-0.12mm-\tcboxedtitleheight}, boxed title style={frame code={ \path[draw=red!80!black, left color=tcbcolback!60!black,right color=tcbcolback!60!black, middle color=tcbcolback!80!black] ([xshift=-5mm]frame.north west) [rounded corners=1.5mm] -- (frame.north east) -- ([ yshift=-1mm]frame.south east) -- (frame.south east) -- ([xshift=-2mm]frame.south west) -- ([xshift=-4mm,yshift=-1mm]frame.north west)[sharp corners] -- cycle;},interior engine=empty,},colbacktitle=red, fonttitle=\bfseries,title={~~مثال~\thetcbcounter}, ,overlay unbroken and first={\node[anchor=west,color=green!55!black] at ([xshift=-4.5cm]title.west) {{\bfseries\small\RL{ #1}}};},} \newtcolorbox{proof 1}[1][]{ freelance,before skip=0mm,after skip=0pt, colback=white,title={\hspace*{-0.6cm}\bccrayon\ \bfseries \textcolor{red!90!black}{إثبـــات}}, bottomrule=0pt,top=-0cm,left=0mm,right=3mm,bottom=-1mm, boxrule=0pt,colframe=white, overlay unbroken and first={ \draw[red!40,line width=2.1pt,] ([xshift=-1.3mm,yshift=-8mm]frame.north east) -- ([xshift=-1.3mm,yshift=-8mm]frame.north east) -- ([xshift=-1.3mm,yshift=-0mm]frame.south east); \hfill \textcolor{red!70!black}{$\blacksquare$};}} \newtcolorbox[auto counter]{box3}[1][عنوان] {enhanced,arc=1.5mm, boxrule=2pt, breakable,colback=cyan!3,frame style={ left color=yellow!80, middle color=green!80, right color= cyan!80!blue, }, title=#1, attach boxed title to top right={xshift=-0.51cm,yshift*=-0.42cm}, coltitle=red, boxed title style={top=.5mm,bottom=+.5mm}, , underlay unbroken and first={ \fill[green!30,draw=cyan]([xshift=2pt,yshift=+2pt]title.north east) -- ([xshift=-8pt,yshift=+2pt]title.north west)--([xshift=-9pt]$(title.west)+(-0.3cm,0)$)-- ([xshift=-8pt,yshift=-2pt]title.south west) -- ([xshift=2pt,yshift=-2pt]title.south east)--cycle; % \draw[white,thick]([xshift=-1pt,yshift=+1pt]title.north west) -- ([xshift=+7pt,yshift=+1pt]title.north east)--([xshift=+8pt]$(title.east)+(0.3cm,0)$)-- ([xshift=+7pt,yshift=-1pt]title.south east) -- ([xshift=-1pt,yshift=-1pt]title.south west)--cycle; % \fill[cyan](title.north east) -- (title.north west)--($(title.west)+(-0.3cm,0)$)-- (title.south west) -- (title.south east)--cycle; \node[font=\bf] at(title.center){\textcolor{white}{#1}} ;} % } \begin{document} \begin{BoxDars} \section{عنوان} \mrhala{مرحلة الإنطلاق} \begin{box1}[نشاط مقترح] $f$ و $g$ دالتان معرفتان على $D_f$ و $D_g$ على الترتيب. مركب الدالة $f$ متبوعة بالدالة $g$ هي الدالة التي نرمز إليها بالرمز \{$g \circ f $ \} والمعرفة على $D_{ g \circ f} =\big\{ x ; f(x) \in D_g \wedge x\in D_f\big\}$ بــ \{{$(g \circ f )(x) = g \big( f(x)\big) $} \} \end{box1} \Time{20} \begin{box2}\mrhala{مرحلة} \textcolor{blue!85!black}{$z+z'=x+x'+i(y+y')$} جداء العددين $z$ و $z'$ هو العدد المركّب \textcolor{blue!85!black}{$z.z'=xx'-yy'+i(xy'+x'y)$} \end{box2} \begin{BoxRafa}[blue]{تعريف} لإثبات أن $f$ لا فردية ولا زوجيـة يكفي تقديم مثــال مضاد \end{BoxRafa} \begin{BoxRafa}{مــلاحظة} \mrhala{مرحلة} لإثبات أن $f$ لا فردية ولا زوجيـة يكفي تقديم مثــال مضاد \end{BoxRafa} \rems{ كتابة الملاحظة يكون هنا في هذه التعليمة } \begin{proof 1} \begin{enumerate} \item أي \item { $\dfrac{aZ_A+bZ_B}{a+b}$}. \end{enumerate} \end{proof 1} \begin{box3}[مبرهنــة] سسسسسسس \end{box3} \begin{exe} لتكن الدالة التالية يييسس \end{exe} \end{BoxDars} \end{document}

  • Error when making a list of abbreviations in linguistics
    by Holden on January 7, 2026 at 5:14 am

    I'm using the leipzig package and the gb4e package for making an example with glosses. I want to make a list of abbreviations that I used in the document. The code below does produce a list of abbreviations, but it comes with an error message, Package glossaries Error: Glossary style `inline' undefined attached to \printglosses. I replaced \usepackage{glossaries} with \usepackage{glossaries-extra}, but it came with more error messages including the one above. It is not a problem as long as it creates the list of abbreviations, but the error bothers me. The following is the code. \documentclass[12pt]{article} \usepackage{graphicx} \usepackage[margin=3cm]{geometry} \usepackage{setspace} \usepackage{mathptmx} \usepackage{amssymb} \usepackage{pifont} \usepackage{gk-biblatex} \usepackage[normalem]{ulem} \usepackage{movement-arrows} \usepackage[linguistics]{forest} \usepackage{multicol} \usepackage{comment} \usepackage{glossaries} \usepackage{leipzig} \usepackage{gb4e} \addbibresource{ref.bib} \usetikzlibrary{decorations.pathmorphing} \doublespacing \makeglossaries \newleipzig{sfp}{sfp}{sentence-final particle} \title{Right Dislocation} \author{He} \date{} \begin{document} \maketitle \pagenumbering{roman} \tableofcontents \newpage \printglosses \section{Introduction} \begin{exe} \ex \gll John-ga LGB-o yonda-yo.\\ John-\Nom{} LGB-\Acc{} read.\Pst{}-\Sfp{}\\ \trans `John read LGB.' \end{exe} \end{document}

  • How to use datatooltk with DTLforeach after reading dbtex file using DTLread?
    by Krantz on January 7, 2026 at 1:55 am

    The following code works if I use \DTLread to read csv under name data, then save it as dbtex-3 using \DTLwrite, and finally read the .dbtex file under the name datafromdbtex. Then I can use it for the operations that follow, in this case with \action. However, if I produce the .dbtex under the same name datafromdbtex using datatooltk.jar, it does not work. No error is produced but also no PDF is produced. Any help would be much appreciated. I get the warning (and no PDF is produced): Package datatool Warning: Database name `datafromdbtex' requested but name hard coded in file as `datafromdbtex' on input line 13. Here is the reproducible example: \begin{filecontents*}{testdata.csv} one,two,three first_value_of_one,first_value_of_two,first_value_of_three second_value_of_one,second_value_of_two,second_value_of_three \end{filecontents*} \documentclass{article} \usepackage{datatool} % \DTLread[name=data,format=csv,keys={one,two,three}]{testdata}% works % \DTLwrite[name=data,format=dbtex-3,keys={one,two,three},overwrite=allow]{testdata}% works \immediate\write18{datatooltk.jar --csv testdata.csv --output testdata.dbtex --name datafromdbtex}% does not produce pdf and does not produce error: just a wraning saying: Package datatool Warning: Database name `datafromdbtex' requested but name hard coded in file as `datafromdbtex' on input line 27. \DTLread[format=dbtex,name=datafromdbtex,keys={one,two,three}]{testdata}% \newcommand{\action}[3]{\csname#1#2#3\endcsname} {% \def\_{_}% \DTLforeach{datafromdbtex}{\one=one,\two=two,\three=three}% {% \global\cslet{datafromdbtex\one\two}{\three}% }% }% \begin{document} \action{datafromdbtex}{second_value_of_one}{second_value_of_two} % should print second_value_of_three \end{document}

  • How can I re-define the Tex math commands for Greek letters?
    by dedded on January 7, 2026 at 12:18 am

    I want to occasionally include a little math with a font that does not have a math font. My plan is to use Stix2 as the math font, but then substitute all the letters and numbers with those from the main font. A problem is that some of the Greek characters are missing, like \phi. The font does have \varphi, so I would like to substitute that. I can make substitutions work for unicode characters, but I have been unable to re-define the Tex commands for the Greek letters. How can I re-define \phi to be \varphi? Here's a MWE: \documentclass{article} \usepackage{unicode-math} \usepackage{newunicodechar} \setmainfont{SourceSerifPro} \setmathfont{STIXTwoMath} % Want SourceSerifPro characters in math mode \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{SourceSerifPro-Regular} \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]{SourceSerifPro-It} \setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{SourceSerifPro-Bold} \setmathfont[range=\mathbfit/{num,latin,Latin,greek,Greek}]{SourceSerifPro-BoldIt} % But there is no \phi (ϕ) in SourceSerifPro, substitute \varphi (φ) \newunicodechar{ϕ}{φ} % This works in text or math mode \newunicodechar{𝜙}{𝜑} % This works in math mode only % How to re-define the Tex command? None of these work: %\AtBeginDocument{% %\let\phi\varphi% %\renewcommand\phi{φ}% %\renewcommand\phi{\varphi}% %\RenewCommandCopy\phi=\varphi% %\mathchardef\phi=\varphi% %} \begin{document} $ϕ𝜙φ𝜑$ \\ % These work (get italic \varphi for all) $\varphi$ \\ % This works, no substitution necessary $\phi$ \\ % Does not work \end{document}

  • How to force strict flush-left alignment in align* environments inside a minipage when text notes are added?
    by Oregon Math Tutor on January 6, 2026 at 11:53 pm

    I am working on a math worksheet involving quadratic formula. My goal is to have every problem on the sheet strictly follow the alignment and layout of Problem #1 (top left in image below). Currently, Problem #1 renders correctly: The equation, variable list ($a=, b=, c=$), solution steps, and the final boxed answer are all flush-left. The vertical spacing is consistent. However, as seen in Problems #2, #3, and #4, the layout breaks when I introduce additional steps or explanatory text (e.g., "Set equal to 0"). These elements seem to force center alignment or inconsistent indentation, disrupting the visual flow. My Goal: code fix that forces Problems 2–4 to mimic the strict left-alignment and vertical spacing of Problem 1, regardless of whether there are extra text annotations or extra solution steps involved. This LaTeX project uses both .sty and .tex files (see below). Thanks very much for your assistance! I've tried long and hard to fix the problem without success. High probability that my .sty is not canonical LaTeX code. The document does compile in overleaf. mwe: .sty \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{quadratic-solutions}[2026/01/06 v1.4 Step-Hint Standardization] % -------------------------------------------------- % Core packages % -------------------------------------------------- \RequirePackage[margin=0.75in]{geometry} \RequirePackage{xcolor} \RequirePackage{amsmath} \RequirePackage{amssymb} \RequirePackage{bm} \RequirePackage{calc} % -------------------------------------------------- % Color definitions % -------------------------------------------------- \definecolor{colorA}{RGB}{220, 53, 69} \definecolor{colorB}{RGB}{0, 123, 255} \definecolor{colorC}{RGB}{40, 167, 69} \definecolor{instructioncolor}{RGB}{80, 80, 80} \newcommand{\cola}[1]{{\color{colorA}#1}} \newcommand{\colb}[1]{{\color{colorB}#1}} \newcommand{\colc}[1]{{\color{colorC}#1}} % -------------------------------------------------- % Assignment header % -------------------------------------------------- \newcommand{\assignmentheader}[2]{% \noindent\textbf{ASSIGNMENT #1 --- #2}\hfill\textbf{#1}\par \vspace{0.1in}\hrule\vspace{0.15in} } % -------------------------------------------------- % Problem box (layout only — no instruction logic) % -------------------------------------------------- \newenvironment{problembox}[2]{% \begin{minipage}[t]{0.48\textwidth} \textbf{#1.} #2 }{% \end{minipage}% } % -------------------------------------------------- % Step hint (for aligned math rows) % -------------------------------------------------- \newcommand{\stephint}[1]{% \quad \text{\itshape\color{instructioncolor}(#1)}% } % -------------------------------------------------- % Quadratic Formula display % -------------------------------------------------- \newcommand{\displayquadformula}{% \par\medskip \begin{center} \setlength{\fboxsep}{10pt} \framebox{% {\fontsize{14}{17}\selectfont $x = \dfrac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$}% } \end{center} \medskip } % -------------------------------------------------- % Solutions environment % -------------------------------------------------- \newenvironment{solutions}{% \par\vspace{0.5em} \noindent \setlength{\jot}{12pt} $\displaystyle \begin{aligned}[t] }{% \end{aligned} $ \par\vspace{1em} } % -------------------------------------------------- % Final answer box % -------------------------------------------------- \newcommand{\solutionbox}[2]{% \par\vspace{0.5em} \noindent \setlength{\fboxsep}{8pt} \framebox{$\displaystyle x = #1 \approx #2$} \par\vspace{0.5em} } \endinput .tex \documentclass[11pt]{article} \usepackage{quadratic-solutions} \begin{document} \assignmentheader{9-A}{QUADRATIC FORMULA PRACTICE} \noindent \textbf{PRACTICE:} Use the Quadratic Formula to solve each equation. Write answers as (a) exact values and (b) decimals rounded to the nearest hundredth. Show work. \displayquadformula \vspace{0.5cm} % ======================================================= % ROW 1 % ======================================================= \noindent \begin{problembox}{1}{$-x^{2} + 7x - 3 = 0$} \begin{solutions} \cola{a} & = \cola{-1},\quad \colb{b} = \colb{7},\quad \colc{c} = \colc{-3} \\ x & = \dfrac{-\colb{7} \pm \sqrt{\colb{7}^2 - 4(\cola{-1})(\colc{-3})}}{2(\cola{-1})} \end{solutions} \solutionbox{\dfrac{-7 \pm \sqrt{37}}{-2}}{0.09 \text{ or } 3.54} \end{problembox} \hfill \begin{problembox}{2}{$x^{2} + 6x = 10$} \begin{solutions} x^{2} + 6x & = 10 \stephint{Set equal to $0$} \\ x^{2} + 6x - 10 & = 0 \\ \cola{a} & = \cola{1},\quad \colb{b} = \colb{6},\quad \colc{c} = \colc{-10} \\ x & = \dfrac{-\colb{6} \pm \sqrt{\colb{6}^2 - 4(\cola{1})(\colc{-10})}}{2(\cola{1})} \end{solutions} \solutionbox{-3 \pm \sqrt{19}}{-3 \pm 4.36} \end{problembox} \vspace{1.5cm} % ======================================================= % ROW 2 % ======================================================= \noindent \begin{problembox}{3}{$2x^{2} = 4x + 3$} \begin{solutions} 2x^{2} & = 4x + 3 \stephint{Move all terms left} \\ 2x^{2} - 4x - 3 & = 0 \\ \cola{a} & = \cola{2},\quad \colb{b} = \colb{-4},\quad \colc{c} = \colc{-3} \\ x & = \dfrac{4 \pm \sqrt{16 + 24}}{4} \end{solutions} \solutionbox{\dfrac{4 \pm \sqrt{40}}{4}}{2.16 \text{ or } -0.66} \end{problembox} \hfill \begin{problembox}{4}{$4x^{2} + 81 = 36x$} \begin{solutions} 4x^{2} + 81 & = 36x \stephint{Set equation $= 0$} \\ 4x^{2} - 36x + 81 & = 0 \\ \cola{a} & = \cola{4},\quad \colb{b} = \colb{-36},\quad \colc{c} = \colc{81} \\ x & = \dfrac{36 \pm 0}{8} \end{solutions} \solutionbox{\dfrac{36}{8}}{4.5} \end{problembox} \vspace{0.8cm} \end{document}

  • Define commands inside foreach loop
    by kaba on January 6, 2026 at 8:29 pm

    I'm trying to define commands inside a pgffor \foreach loop, where the command-names depend both on the a macroparameter and the loop parameters. However, I get "First argument of '\NewDocumentCommand' must be a command.". What is wrong, and how can it be fixed? \documentclass[a4paper,12pt]{article} \usepackage{pgffor} \NewDocumentCommand{\CreateMyCommands}{m}{ \foreach \x/\a in {x/a,y/b} { \global\NewDocumentCommand{\csname #1\x\endcsname}{}{#1\a} } } \CreateMyCommands{f} \begin{document} \fx \fy \end{document} A smaller example which seems to demonstrate the problem is: \documentclass[a4paper,12pt]{article} \usepackage{pgffor} \foreach \x in {x} { \global\NewDocumentCommand{\csname f\endcsname}{}{a} } \begin{document} \f \end{document}

  • Drawing behind gridlines in Rotated pgfplot - "set layers" seems to have side-effects
    by user1476176 on January 6, 2026 at 7:36 pm

    I'm trying to create a figure with a filled area behind the gridlines for use on a rotated page. I don't want to use axis on top because I have nodes which need to be drawn on top of the gridlines. I've tried following the instructions at PGFPlots: Understanding how to draw plots on different layers and arrange them, which uses set layers, but I've found that it messes up the spacing when combined with rotate=90,transform shape. MWE: \documentclass{standalone} \usepackage{pgfplots} \begin{document} % Rotate entire page \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90} % Correct label placement but incorrect layering \begin{tikzpicture}[rotate=90,transform shape] \begin{axis}[grid=both,title={Correct Spacing but Incorrect Layering}] \addplot {\x}; \addplot[fill=green,draw=none,on layer=background] coordinates { (-5,-5) (-5,-3) (-3,-3) (-3,-5) (-5,-5) }; \node[fill=white,align=center] at (axis cs:-3,2) {Node above\\gridlines}; \end{axis} \end{tikzpicture} % Fix from Stack Exchange \pgfplotsset{% layers/my layer set/.define layer set={background,main,foreground}{},% set layers=my layer set,% }% % Correct layering but incorrect label placement \begin{tikzpicture}[rotate=90,transform shape] \begin{axis}[grid=both,,title={Correct Layering but Incorrect Spacing}] \addplot {\x}; \addplot[fill=green,draw=none,on layer=background] coordinates { (-5,-5) (-5,-3) (-3,-3) (-3,-5) (-5,-5) }; \node[fill=white,align=center] at (axis cs:-3,2) {Node above\\gridlines}; \end{axis} \end{tikzpicture} \end{document} Output: I also tried setting the layers as follows: \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} but it seems to also give correct spacing but incorrect layering.

  • Tikz: how to fit a series of nodes determined at run-time
    by Guidone on January 6, 2026 at 7:15 pm

    My goal is to draw a brace under N nodes, like it is shown in the picture (nodes "G" and "H"): Looking at the second answer to this question I came out with this MWE: \begin{filecontents}[overwrite]{argumentmapp.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{argumap}[2026/01/03 v.0.0 Argument Mapping] \LoadClass[11pt]{extarticle} \RequirePackage{fontspec} \defaultfontfeatures{Ligatures=TeX} \setmainfont{Brill} \RequirePackage{euler-math} \newfontfamily{\supscriptfont}{Euler Math}%[Scale=0.55] \RequirePackage{polyglossia} \setdefaultlanguage{italian} \setotherlanguage[hyphenation=liturgical, usej=true, prosodicshorthands=true]{latin} \RequirePackage{suffix} %=================% % Document layout % %=================% % Page \RequirePackage{geometry} \geometry{a4paper,margin=20mm} \pagestyle{plain} \setlength{\parindent}{0pt} % Line spacing: 1.3 \RequirePackage{setspace} \setstretch{1.2} % Two-column engine \RequirePackage{paracol} %=================% % Utilities % %=================% \RequirePackage{etoolbox} \RequirePackage{etextools} \RequirePackage{lipsum} %------------------ % Control Flow %------------------ \RequirePackage{xifthen} \RequirePackage{xstring}% used to operate on a string %------------------ % Graphics %------------------ \RequirePackage{graphicx} \RequirePackage{tikz} \usetikzlibrary{% calc,arrows.meta,% positioning,% decorations.pathreplacing,% fit,% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Main 2-column environment %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentEnvironment{argan}{ O{0.55} O{0.45} }{% \setcounter{ctrstmt}{0}% \columnratio{#1,#2}% \begin{paracol}{2}% \switchcolumn[0]% }{% \end{paracol}% } \newcommand{\TextCol}{\switchcolumn[0]} \newcommand{\AnalysisCol}{\switchcolumn[1]} \newcommand{\TextColStar}{\switchcolumn*[0]} \newcommand{\AnalysisColStar}{\switchcolumn*[1]} \newcommand{\TextColumn}{\switchcolumn[0]} \WithSuffix\newcommand\TextColumn*{\switchcolumn*[0]} \newcommand\AnalysisColumn{\switchcolumn[1]} \WithSuffix\newcommand\AnalysisColumn*{\switchcolumn*[0]} \newcounter{ctrstmt} \setcounter{ctrstmt}{0} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Right column macros %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%==============================%% %% Statement Graphic %% %%==============================%% % Styles \tikzset{ argStmnt/.style={ circle, draw, inner sep=0pt, minimum size=2.2em, font=\normalsize, }, arganDep/.style={ -{Latex[length=2.2mm,width=1.6mm]}, line width=0.4pt }, } \newrobustcmd{\emptyKey}{} \newrobustcmd{\elemPos}{} \pgfkeys{% /gstmnt/.is family, /gstmnt/.cd, name/.store in=\elemName, name/.default=, depend from/.store in=\dependFrom, % depend from/.initial={}, depend from/.default=, from/.store in=\dirFrom, from/.default=south, to/.store in=\dirTo, to/.default=north, element@pos/.style={}, south of/.code={\pgfqkeys{/gstmnt}{element@pos/.style={below=of #1}}}, north of/.code={\pgfqkeys{/gstmnt}{element@pos/.style={above=of #1}}}, west of/.code={\pgfqkeys{/gstmnt}{element@pos/.style={left=of #1}}}, east of/.code={\pgfqkeys{/gstmnt}{element@pos/.style={right=of #1}}},% name,depend from,from,to } \NewDocumentCommand{\graphStmnt}{O{} m}{% \pgfkeys{/gstmnt/.cd,% name,depend from,from,to,%, #1}% \node[argStmnt, /gstmnt/element@pos] (\elemName) {\supscriptfont#2};% \ifx\dependFrom\empty% \else \draw[arganDep] (\dependFrom.\dirFrom) -- (\elemName.\dirTo); \fi } %%==============================%% %% Coordinated Statement %% %%==============================%% \newif\ifispivot \newcounter{ctrelem} \setcounter{ctrelem}{0} \pgfkeys{% /coostmnt/.is family,% /coostmnt/.cd,% name/.store in=\elemName,% name/.default=,% pivot/.is if=ispivot,% element@pos/.style={}, pivot on/.store in=\pivotOn,% pivot on/.default=,% pivot below/.code={\pgfqkeys{/coostmnt}{element@pos/.style={below=of \pivotOn}}}, pivot below/.initial=, pivot above/.code={\pgfqkeys{/coostmnt}{element@pos/.style={above=of \pivotOn}}}, child of/.store in=\elemParent,% child of/.default=,% after/.code={\pgfqkeys{/coostmnt}{element@pos/.style={right=of \elemParent}}}, before/.code={\pgfqkeys{/coostmnt}{element@pos/.style={left=of \elemParent}}}, from/.store in=\dirFrom, from/.default=, to/.store in=\dirTo, to/.default=, name,pivot on, child of, from, to,% } \tikzset{ coordBrace/.style={ line width=0.4mm,% decorate,% decoration={amplitude=0.1cm,brace, mirror},% % blue } } \newcommand{\elemid}{} \newcommand{\elelist}{} \newcommand{\elements}{} \NewDocumentCommand{\coordielem}{O{} m}{ \refstepcounter{ctrelem} \pgfkeys{/coostmnt/.cd,% name,pivot=false, pivot on, child of,% #1 } \listadd{\elelist}{\elemName} \node[argStmnt, /coostmnt/element@pos] (\elemName) {\supscriptfont$#2\|$\thectrelem}; \ifx\pivotOn\empty \draw[arganDep] (\elemParent.\dirFrom) -- (\elemName.\dirTo); \else \draw[arganDep] (\pivotOn.\dirFrom) -- (\elemName.\dirTo); \fi } \newcounter{cntrbox} \setcounter{cntrbox}{0} \newcommand*{\boxname}{} \NewDocumentEnvironment{coordination}{+b}{% \stepcounter{cntrbox} \renewcommand*{\boxname}{coordbox\thecntrbox} \begin{scope}[local bounding box=\boxname] #1% \end{scope} \draw[color=red, coordBrace] (\boxname.south west) -- (\boxname.south east); } {\setcounter{ctrelem}{1}} % \NewDocumentEnvironment{argugraph}{O{12mm} +b}{ \par\centering% \begin{tikzpicture}[node distance=#1]% #2 }{% \end{tikzpicture}\par} \end{filecontents} \documentclass{argumentmapp} \begin{document} \begin{argan}[0.55][0.35] \AnalysisColumn \begin{argugraph} \graphStmnt[name=A]{A} \graphStmnt[name=B, south of=A, depend from=A, from=south, to=north]{1} \graphStmnt[name=C, north of=A, depend from=A, from=north, to=south]{C} \graphStmnt[name=D, west of=A, depend from=A, from=west, to=east]{D} \graphStmnt[name=E, east of=A, depend from=A, from=east, to=west]{E} \graphStmnt[name=F, south of=D, depend from=D, from=south, to=north]{F} \begin{coordination} \coordielem[name=G, pivot on=E, pivot above, from=north, to=south]{G} \coordielem[name=H, child of=G, after, from=east, to=west]{H} \end{coordination} \graphStmnt[name=L, south of=H, depend from=H, from=south, to=north]{L} \end{argugraph} \end{argan} \end{document} It compiles, but it is not what I am looking for. As a matter of fact, this is what I get: Which makes sense, since the scope also includes the connectors from "E" and "L". So, I decided to go along with the first answer to the same question, and modified the coordination environment to read like this: \newcounter{cntrbox} \setcounter{cntrbox}{0} \newcommand*{\boxname}{} \newcommand{\Loopx}{} \NewDocumentEnvironment{coordination}{+b}{% #1 % Converting the list obtained by each '\coordielem' \listtocsv[\elements]\elelist %suggested by https://tex.stackexchange.com/questions/173579/tikz-fit-variable-number-of-nodes \xdef\Loop{} \foreach \el in \elements {\xdef\Loop{\Loop(\el)} } \node[draw=red,fit=\Loop] {}; } {\setcounter{ctrelem}{1}}% Compiling it, I get the following message: ! Package pgf Error: No shape named `' is known. See the pgf package documentation for explanation. Type H <return> for immediate help. ... l.238 \end {argugraph} With this output: I think something is wrong with my use of the lists. My idea would be to build a list containing the names of \coordielem with etoolbox, convert it to a csvlist with etextools, then iterate over it with TikZ's \foreach method. But, clearly, I am missing something. Any idea?

  • Setting the "trapped" flag in XMP
    by schade96 on January 6, 2026 at 6:42 pm

    I am trying to set the "Trapped" flag for my PDF using pdfmanagement: \DocumentMetadata{ pdfstandard = {X-4}, lang = en-US, pdfversion = 1.7, colorprofiles = { X = FOGRA39L_coated.icc% } } \documentclass[a4paper]{article} \ExplSyntaxOn % Note that these must be equal, as per PDF/X-4. \pdfmeta_xmp_add:n{<pdfx:Trapped>True</pdfx:Trapped>} \pdfmanagement_add:nnn{Info}{Trapped}{/True} \ExplSyntaxOff \begin{document} test \end{document} I can for example see $ exiftool test.pdf | grep "Trapped" Trapped : True or, when opening the PDF in a text editor: <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:xmpRights="http://ns.adobe.com/xap/1.0/rights/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" xmlns:pdfuaid="http://www.aiim.org/pdfua/ns/id/" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/" xmlns:prism="http://prismstandard.org/namespaces/basic/3.0/" xmlns:stFnt="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaType="http://www.aiim.org/pdfa/ns/type#" xmlns:pdfaField="http://www.aiim.org/pdfa/ns/field#" xmlns:pdfxid="http://www.npes.org/pdfx/ns/id/"> <pdfaExtension:schemas> [...] </pdfaExtension:schemas> <pdf:Producer>luahbtex-1.22.0</pdf:Producer> <pdf:PDFVersion>1.7</pdf:PDFVersion> <pdfxid:GTS_PDFXVersion>PDF/X-4</pdfxid:GTS_PDFXVersion> [...] <pdfx:Trapped>True</pdfx:Trapped> </rdf:Description> </rdf:RDF> </x:xmpmeta> This looks fine to me. But then why is Preflight in Adobe Acrobat reporting this: Trapped key not present in XMP metadata There is no trapped key present in the XMP metadata. The trapped key indicates whether the PDF has been trapped or not. PDF/X-4 requires that the Trapped entry is present in the document's XMP Metadata in the user defined 'pdfx" name space. user defined 'pdfx" name space.

  • Errors using Multicol after package update [closed]
    by Robert Pearson on January 6, 2026 at 6:33 pm

    Preface: while this may not have to do with anything, today I updated packages in MikTex for the first time in perhaps a few years. After failing to build documents I have used for many years (syllabi), I've isolated the issue to the Multicol package. The latex-tools package is installed. This is the MWE that's not working. \documentclass{article} \usepackage{multicol} \begin{document} \begin{multicols}{2} ab cd \end{multicols} \end{document} Below are the first log errors I'm getting. ! Undefined control sequence. \mc@prepare@mark@regions ...ark_clear_structure:n {column} l.7 a b cd The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! You can't use `\prevdepth' in horizontal mode. \nointerlineskip ->\prevdepth -\@m \p@ l.7 a b cd Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! Missing $ inserted. <inserted text> $ l.7 a b cd I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. LaTeX Font Info: External font `cmex10' loaded for size (Font) <7> on input line 7. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 7. ! Missing number, treated as zero. <to be read again> { l.7 a b cd A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) ! Illegal unit of measure (pt inserted). <to be read again> { l.7 a b cd Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one! I'll assume that you meant to say pt, for printer's points. To recover gracefully from this error, it's best to delete the erroneous units; e.g., type `2' to delete two letters. (See Chapter 27 of The TeXbook.) ! Missing $ inserted. <inserted text> $ l.7 a b cd I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. Missing character: There is no � in font cmex10!

  • Starred nocite not functioning
    by user2568648 on January 6, 2026 at 4:48 pm

    I am trying to cite all references in a .bib file (generated via Zotero). I use the \nocite{*} command yet nothing appears. My method of composing is XeLaTex + MakeIndex + BibTex. MWE: \documentclass[a4paper, 11pt]{report} \usepackage[utf8]{inputenc} \usepackage[style=apa]{biblatex} \addbibresource{testbib.bib} \begin{document} my doc with hopefully a full bibliography! \nocite{*} \printbibliography \end{document} The following warnings appear : No file test.bbl. LaTeX Warning: Empty bibliography on input line 16. LaTeX Warning: There were undefined references. Package biblatex Warning: Please (re)run Biber on the file: (biblatex) test (biblatex) and rerun LaTeX afterwards.

  • How can I create a simple sankey diagram?
    by Martin Thoma on January 6, 2026 at 1:20 pm

    I've used the following data to generate this sankey diagram of my energy usage in December 2025: PV Dach [216] House PV Garten [9] House Grid [1283] House House [1223] Heat House [20.98] Dishwasher House [15.25] Refrigerator House [8] TV House [1.98] Washing Machine House [0.45] Microwave Heat [1110] Heating (HP) Heat [63] Hot Water (HP) Heat [49.8] AC Heat [22] Heater (Bathroom) :PV Dach #f5f542 :PV Garten #f5f542 :Grid #000 :House #cdcdcd :Heat #ff0000 :AC #cc0000 :Heating (HP) #cc0000 :Hot Water (HP) #cc0000 :Heater (Bathroom) #cc0000 :Refrigerator #0000ff with https://sankeymatic.com/ I've seen https://ctan.mirror.garr.it/mirrors/ctan/graphics/pgf/contrib/sankey/sankey.pdf, and sankey but the graphs there seem to be rather complex. Is there any way that lets me produce something like the image above without writing a lot of TeX?

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

    This question is nearly the same as this: \documentclass[twocolumn]{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{cuted} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \begin{strip} \lipsum[2] \bigskip \hrule \bigskip \end{strip} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]}} 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{document} which gives: Noted that I want to typeset something like a university transcript. Thus, unbalanced layout is not elegant, is that possible to hack with some tricks? Edited: longtblr solution conflicted with multicol: \documentclass{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{multicol} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \lipsum[2] \bigskip \hrule \bigskip \begin{multicols}{2} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]},rowhead=1} Header 1 & Header 2 & Header 3 \\ 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{multicols} \end{document} It failed resulted:

  • Hide all content before a certain point [duplicate]
    by Sebastiano on January 6, 2026 at 11:48 am

    Suppose I have a document containing text and mathematical formulas. From a certain point onward, I would like everything written before that point not to be displayed in the compiled document, without manually deleting the previous content. In other words, I am looking for a command or macro or environment that allows me to say: "from here on, show the content, but ignore everything that comes before". I am looking for possible solutions because I need this behavior for a correspondence with another user who has not updated their TeX distribution for a long time. For this reason, solutions that work with older or widely available LaTeX setups would be especially useful. I have never needed to do something like this before, so I am not sure whether such a command exists or if a specific package is required. Here a MWE with a comment: \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[8] %%%%%%%%%%%%%%%%%%% I not want visualize \lipsum[8] %%%%% %%%%%%%%%%%%%%%%%%% but only \lipsum[10] %%%%%%%%%% \lipsum[10] \end{document}

  • Can I customise the footer in ltx-talk?
    by Elena on January 5, 2026 at 1:52 pm

    Yay, now there are accessible Latex slides! I just started porting my slides to ltx-talk from beamer. The first thing that I cannot easily replicate from my beamer template is the footer, which is as follows: \setbeamercolor{foot1}{fg=black, bg=skyblue!20} \setbeamercolor{foot2}{fg=black, bg=skyblue!60} \setbeamercolor{foot3}{fg=black, bg=skyblue} \setbeamertemplate{footline}{% \leavevmode% \hbox{% \begin{beamercolorbox}[wd=.3\paperwidth,ht=2.75ex,dp=1ex,left]{foot1}% \hspace*{2ex} \insertshorttitle \end{beamercolorbox}% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.75ex,dp=1ex,center]{foot2}% \insertsubtitle % \end{beamercolorbox}% \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.75ex,dp=1ex,right]{foot3}% \insertframenumber{}/\inserttotalframenumber \hspace*{2ex} \end{beamercolorbox}}% \vskip0pt% } I have two main issues. First, I cannot change the height of the footer. See the original beamer slide and its version in ltx-talk. While I can ignore the other differences, this height does bother me. Second, I really like to show the number of the current slide out of the total number of slides. Is there a way to do something similar like 3/10? By the way, this is my current ltx-talk settings: \EditInstance{footer}{std}{ background-color = skyblue!20, color = black, element-order = {title, subtitle, framenumber}, right-hspace = 3mm, left-hspace = 3mm, } I did try using totalframes comma separated inside element-order, but it gave me this error <argument> \??? ! LaTeX Error: Erroneous variable \@shorttotalframes used! But even if it did work, I still don't like the two numbers to be separated. Here is my minimal working example: \DocumentMetadata{tagging = on} \documentclass[10pt]{ltx-talk} \title{Fundamentals of Web Development} \subtitle{Week 1: Basics of HTML} \usepackage[T1]{fontenc} \renewcommand*\familydefault{\sfdefault} \usepackage[sfdefault,condensed]{roboto} \definecolor{kentblue}{HTML}{003882} \definecolor{skyblue}{HTML}{2ABED9} \EditInstance{footer}{std}{ background-color = skyblue!20, color = black, element-order = {title, subtitle, framenumber}, right-hspace = 3mm, left-hspace = 3mm, } \begin{document} \begin{frame} \begin{center} \Huge \textcolor{kentblue}{\textbf{Lecture 1} ltx-talk} \end{center} \begin{itemize} \item Introduction to HTML and CSS \item Basic syntax of HTML \item Some simple formatting \item Images and links \end{itemize} \end{frame} \end{document}

  • microtype + newcomputermodern produce unknown slot number warnings, even without text
    by PHL on January 5, 2026 at 12:29 pm

    microtype used together with fontspec is producing many unknown slot number warnings. This is apparently related to protrusion, see microtype producing dozens of Unknown slot number warnings for Lete Sans Math . These warnings happens even with an empty document (so without any pdf output) and are not stopped by disabling protrusion at the beginning of document as demonstrated by the following MWE. % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontsetup} \usepackage{microtype} \AtBeginDocument{\microtypesetup{protrusion=false}} \begin{document} \end{document} (fontsetup without option load the new computer modern font). Using protrusion=false as an option of the package does however solve the problem. [concrete]{fontsetup} does also solve the problem, so this is really font dependent.

  • Is there an equivalent to the decimal package (provides raised decimal point in math mode automatically) which works in lualatex? [closed]
    by Phillip Helbig on January 5, 2026 at 11:24 am

    I've mentioned the following subject in an earlier question, but it’s probably best to raise it in a question of its own. (The earlier question involves pdfLaTeX, in which the decimal package works fine for simple font setups.) Unfortunately, I’m having trouble getting Times Roman-like oldstyle numerals both in math and text modes, monospaced in math mode and proportional in text, with otherwise identical fonts. My goal is to have oldstyle numerals both in math (tables, matrices) and text (preferably proportional oldstyle, but monospaced oldstyle would be OK) with a raised decimal point. At least at first glance, it looks like LuaLaTeX can handle the font-related routines. However, for obvious reasons, the decimal package doesn’t work there. I have hundreds of numbers so something like \num from siunitx is not an option for me. Normal input should be possible.

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

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

  • circuitikz: potentiometer without pin on the right side
    by Explorer on January 5, 2026 at 7:45 am

    What I want to achieved is as below: I have the following code: \documentclass[border=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \draw(0,0) to [rmeter,t=A] (0,2) to [R,l_=$R$](3,2) to [pR,l_=$R'$,n=pr] (4.1,2); \draw(0,0) to [normal open switch,l_=$S$] (6,0) |-(pr.wiper); \end{circuitikz} \end{document} it gives the similar result: However, the righthand of sliding rheostat's length is control in manual, but guess the coordinate (4.1,2), which is not elegant. I have consulted the manual, but found no similar components. Is that better method to achieve the desird result?

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

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

  • How to make \refcmpd output ranges instead of individual numbers in chemnum?
    by taiwan12 on January 4, 2026 at 7:33 pm

    I am using the chemnum package to reference compounds defined in scheme environments. By default, \refcmpd{...} outputs a comma-separated list like 1, 2 and 4, but I would like it to automatically collapse consecutive numbers into ranges, e.g. (1–2, 4) or (1–4). Is there a way (using chemnum options or by redefining \refcmpd) to automatically detect consecutive compound numbers and print them as ranges instead of individual references? Code: \documentclass{article} \usepackage{graphicx} \usepackage[version=4]{mhchem} \usepackage{chemstyle} \usepackage{chemnum} % \refcmpd inside parentheses \let\oldrefcmpd\refcmpd \renewcommand{\refcmpd}[1]{\textbf{(}\oldrefcmpd{#1}\textbf{)}} \begin{document} \begin{scheme} \replacecmpd{PhMe} \replacecmpd{PhCOOH} %\includegraphics[scale=0.8]{PhCOOH.eps} \caption{...} \label{synPhMe} \end{scheme} \begin{scheme} \replacecmpd{pXylene} \replacecmpd{pMePhCOOH} %\includegraphics[scale=0.8]{pMePhCOOH.eps} \caption{...} \label{synpMePhCOOH} \end{scheme} \refcmpd{PhMe, PhCOOH, pMePhCOOH} % desired output: (1-2, 4) \refcmpd{PhMe, PhCOOH, pXylene, pMePhCOOH} % desired output: (1-4) \end{document} .eps https://drive.google.com/file/d/1gWCa8DGZRXbCfQMEiVjEAmb4XUY4cM8v/view?usp=sharing https://drive.google.com/file/d/1d2LQlyugB2D6Gnl5r5ScjLmTZMGqH386/view?usp=sharing IMG

  • ConTeXt: Inset Bible Chapter Numbers Mid-Paragraph
    by Jeff Dodson on January 4, 2026 at 3:22 pm

    I'm new to ConTeXt, and am wondering how I might typeset Bible chapter numbers for cases where a chapter break occurs in the middle of a paragraph (i.e., verse 1 of the chapter doesn't begin a new paragraph). Here's an example of what I'd like to achieve in ConTeXt: As you can see here, in Mark, Chapter 9 begins mid-paragraph. As a result, there's no paragraph break at Mark 9:1, and I do need to explicitly show the verse number for Mark 9:1 in the text. The chapter number "9" does appear against the left margin, but the text of the paragraph flows nicely around it, until there's eventually a paragraph break starting at Mark 9:2. The above was achieved in XeLaTeX using a code snippet that David Carlisle (I believe it was) was kind enough to provide a couple of years ago. Perhaps the answer to my question is to use the same snippet with ConTeXt. However, I guess what I'm wondering is if there's a different way I should be doing it in ConTeXt, as opposed to (XeLaTeX). Incidentally, this is the snippet in LaTeX that produced the above desired results: \newlength{\parskipval} \makeatletter \def\newparshape{\parshape\@npshape0{}} \def\@npshape#1#2#3{\ifx\\#3\expandafter\@@@npshape\else\expandafter\@@npshape\fi {#1}{#2}{#3}} \def\@@npshape#1#2#3#4#5{% \ifnum#3>\z@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {\expandafter\@@npshape\expandafter{\the\numexpr#1+1\relax}{#2 #4 #5}{\numexpr#3-1\relax}{#4}{#5}}% {\@npshape{#1}{#2}}} \def\@@@npshape#1#2#3{#1 #2} \makeatother \newcommand{\parnopar}[1][]{\parfillskip=0pt\par% #1% \parskip=0pt\noindent\parfillskip=0pt plus1fil} \newfontfamily\dropnum[Scale=3.2]{Times New Roman} \newsavebox{\dropcapbox} \newcommand{\nbchapbeg}[1]{% \setlength{\parskipval}{\parskip}% \parnopar% \savebox{\dropcapbox}{\dropnum{#1}}% \newparshape {2}{\dimexpr\wd\dropcapbox+1ex}{\dimexpr\linewidth-\wd\dropcapbox-1ex} {1}{0pt}{\linewidth}\\% \noindent \llap{\raisebox{\dimexpr-\height+.44\baselineskip}[0pt][0pt]{% \usebox{\dropcapbox}% \hspace{1ex}% }}% \ignorespaces% \setlength{\parskip}{\parskipval}% } With the \nbchapbeg macro above (which I believe stands for "non-breaking chapter beginning), I place a call to the macro anywhere within the verse prior to the first verse of the chapter that doesn't begin a new paragraph (Mark 9 here), and it causes the chapter number to be inset into the text in the proper place. So I guess my real question is: Is there a "ConTeXty" way to do this, or should I use the same technique? Here's the ConTeXt code snippet I'm working with, where I'd like to make the chapter number have the paragraph flow around it. The text below is in English rather than Greek, but the solution applies regardless of the language used. \starttext 35 For whosoever will save his life shall lose it; but whosoever shall lose his life for my sake and the gospel's, the same shall save it. 36 For what shall it profit a man, if he shall gain the whole world, and lose his own soul? 37 Or what shall a man give in exchange for his soul? 38 Whosoever therefore shall be ashamed of me and of my words in this adulterous and sinful generation; of him also shall the Son of man be ashamed, when he cometh in the glory of his Father with the holy angels. (Chapter 9 drop num goes here) 1 And he said unto them, Verily I say unto you, That there be some of them that stand here, which shall not taste of death, till they have seen the kingdom of God come with power. 2 And after six days Jesus taketh with him Peter, and James, and John, and leadeth them up into an high mountain apart by themselves: and he was transfigured before them. \stoptext UPDATE: I realized today that I left the \def for \newparshape out of my original post, so I added that above. At this point, I'd be happy to just have a conversion of the original code into pure TeX in such a way that I could use it in ConTeXt. I've tried that conversion myself, but have not been able to get it right. The following is what I did so far, but again, it doesn't work. The sticking point, I think, is the \newparshape part. \newskip\parskipval \newbox\dropcapbox \def\dropnumfont{\definedfont[Serif*default at 38.4pt]} \def\newparshape{\parshape\npshape0{}} \def\npshape#1#2#3{% \ifx\\#3% \expandafter\npshapeend \else \expandafter\npshapeloop \fi {#1}{#2}{#3}% } \def\npshapeloop#1#2#3#4#5{% \ifnum#3>0 \expandafter\npshapeloop \expandafter{\the\numexpr#1+1\relax}% {#2 #4 #5}% {\numexpr#3-1\relax}% {#4}{#5}% \else \npshape{#1}{#2}% \fi } \def\npshapeend#1#2#3{#1 #2} \def\nbchapbeg#1{% \parskipval=\parskip \parfillskip=0pt\par\parskip=0pt\noindent\parfillskip=0pt plus 1fil \setbox\dropcapbox=\hbox{\dropnumfont #1}% \dimen0=\wd\dropcapbox \advance\dimen0 by 1ex \dimen1=\wd\dropcapbox \advance\dimen1 by -1ex \dimen2=\linewidth \advance\dimen2 by -\dimen1 \newparshape 2 \dimen0 \dimen2 1 0pt \linewidth \\% \noindent \rlap{% \smash{% \raise -0.56\baselineskip \hbox{% \unhbox\dropcapbox \hskip 1ex }% }% }% \ignorespaces \parskip=\parskipval }