Week
- How to use new/other `S` column specifier in merged cells of an `tabularray` table?by Stefan Pinnow on September 22, 2026 at 4:11 am
The title says it all. Here an MWE, where the first (regular) tabular is the one I try to replicate using tabularray. (The last table is just to confirm that the S colspec in the second table is used in the merged cells as well.) \documentclass[border=5pt,varwidth]{standalone} \usepackage[table]{xcolor} \usepackage{booktabs} \usepackage{tabularray} \UseTblrLibrary{ booktabs, siunitx, } \SetTblrInner{rowsep=0pt} \usepackage{siunitx} \begin{document} \bgroup \newcommand*{\mc}[1]{\multicolumn{2}{c}{\cellcolor{black!10}\tablenum[table-format=3.2]{#1}}} \begin{tabular}{*{2}{S[table-format=5]}} \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule \mc{0.12} \\ \mc{12.3} \\ \mc{123} \\ \mc{5} \\ \mc{0.8} \\ \bottomrule \end{tabular} \egroup \quad \bgroup \begin{booktabs}{ colspec={*{2}{S[table-format=5]}}, row{1}={guard}, cell{4-Z}{1}={c=2}{ % the `S` column specifier or `colspec` seem to be ignored ... S[table-format=3.2\unit{\percent}], % colspec={S[table-format=3.2\unit{\percent}]}, % ... when a color is given. Otherwise an error is raised % that the `S` or `colspec` are interpreted as a color black!10, % % using "usual" colspec values work as expected ... % (the `S` column specifier of the non-merged column/cells seems % to be still used/applied here) l, % c, % r, }, } \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule 0.12 & 0.12 \\ 12.3 & 12.3 \\ 123 & 123 \\ 5 & 5 \\ 0.8 & 0.8 \\ \bottomrule \end{booktabs} \egroup \quad \bgroup \begin{booktabs}{ colspec={ll}, row{1}={guard}, cell{4-Z}{1}={c=2}{ % the `S` column specifier or `colspec` seem to be ignored ... % S[table-format=3.2\unit{\percent}], colspec={S[table-format=3.2\unit{\percent}]}, % ... when a color is given. Otherwise an error is raised % that the `S` or `colspec` are interpreted as a color black!10, % % using "usual" colspec values work as expected ... % l, c, % r, }, } \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule 0.12 & 0.12 \\ 12.3 & 12.3 \\ 123 & 123 \\ 5 & 5 \\ 0.8 & 0.8 \\ \bottomrule \end{booktabs} \egroup \end{document}
- repeating verbatim text within forloop or equivalentby blandish on September 21, 2026 at 6:57 pm
I would like to use forloop (or multido or another alternative if suggested) so that I can generate a series of short coding quizzes where each quiz uses verbatim (or fancyvrb or listings or another alternative). But when I try to do this: \documentclass{article} \usepackage{forloop} \newcounter{x} \begin{document} \forloop{x}{1}{\value{x} < 7}{% \begin{verbatim} def f(x): return x + 1 \end{verbatim} } \end{document} I get an error: File ended while scanning use of \@xverbatim The same basic problem has occurred when I have tried using multido rather than forloop; likewise fancyvrb or listings instead of verbatim. Is there anyway around this limitation?
- Displaying a Tabularx Entry on Two Linesby DDS on September 21, 2026 at 3:34 pm
Consider the code: \documentclass[12pt]{book} \usepackage{tabularx,lipsum} \begin{document} \thispagestyle{empty} \begin{tabularx}{\linewidth}{c>{\arraybackslash}X} \emph{Heading:} \emph{(to go on second line)} \hskip 15pt & \lipsum[13] \end{tabularx} \end{document} which produces QUESTION: How may I place Heading: (on the second line) over two lines: Heading and (on the second line)? (\vspace{5pt} or \vspace*{5pt} neither seem to work; and, \\[5pt] gives me an overflow message.) Thank you.
- Citations not showing up correctly despite correct key and reference file entryby RBG on September 21, 2026 at 3:30 pm
I'm having issues with a specific bibliographic entry. While all other citation call-outs in the document work fine, one shows up as sacco˙neurite˙2020 instead of as "(Sacco et al., 2020)" when I use \cite{sacco_neurite_2020}. Here, sacco_neurite_2020 is the correct key that is in Zotero and also in references.bib. The full entry in references.bib is the following: @article{sacco_neurite_2020, chapter = {Adult Brain}, title = {Neurite {Orientation} {Dispersion} and {Density} {Imaging} for {Assessing} {Acute} {Inflammation} and {Lesion} {Evolution} in {MS}}, volume = {41}, copyright = {© 2020 by American Journal of Neuroradiology. Indicates open access to non-subscribers at www.ajnr.org}, issn = {0195-6108, 1936-959X}, url = {https://www.ajnr.org/content/41/12/2219}, doi = {10.3174/ajnr.A6862}, abstract = {...}, language = {en}, number = {12}, urldate = {2026-07-04}, journal = {American Journal of Neuroradiology}, publisher = {American Journal of Neuroradiology}, author = {Sacco, S. and Caverzasi, E. and Papinutto, N. and Cordano, C. and Bischof, A. and Gundel, T. and Cheng, S. and Asteggiano, C. and Kirkish, G. and Mallott, J. and Stern, W. A. and Bastianello, S. and Bove, R. M. and Gelfand, J. M. and Goodin, D. S. and Green, A. J. and Waubant, E. and Wilson, M. R. and Zamvil, S. S. and Cree, B. A. and Hauser, S. L. and R. G. Henry and and University of California, San Francisco MS-EPIC Team}, month = dec, year = {2020}, pages = {2219--2226}, } In the preamble, I have: \usepackage[ backend=biber, style=apa, natbib=true, url=false, doi=false, eprint=false ]{biblatex} Does anyone have an idea what could be wrong? Thank you.
- listings does not load language Luaby Marek Stepanek on September 21, 2026 at 10:28 am
I am new to listings package. I am on macOS using the complete TeXLive install 2026 and nvim. In the file /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty are three versions of Lua defined with nr like 5.0 - do I have to add this to my tex request for language Lua? A path error is excluded: kpsewhich lstlang2.sty # Output: /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty Permission error is excluded: ls -l /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty -rw-r--r-- 1 root wheel 106030 Nov 20 2025 /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty Here a minimal (non) working example: \documentclass{article} \usepackage{listings} % \input{listings-lua.prf} % Define Lua manually (bypassing the broken auto-loader) % \lstdefinelanguage{Lua}{ % keywords={and,break,do,else,elseif,end,false,for,function,if,in,local, % nil,not,or,return,true,then,until,while}, % sensitive=true, % morecomment=[l]{--}, % morestring=[b]\", % morestring=[b]' % } \begin{document} \begin{lstlisting}[language=Lua] print("Hello, Lua!") \end{lstlisting} \end{document} Compiling with lualatex in zsh. Other languages are loaded: bash, TeX etc ... Supplemental question (Do I have to make an own thread for it?): How to include TeX code with \end{lstlisting} and/or \end{document} in it? \begin{lstlisting}[language=TeX, title=TITLE, escapeinside=||] \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[language=Lua, title=TITLE] print("Hello, Lua!") |\end{lstlisting}| |\end{document}| \end{lstlisting}
- Automatic way to hide every solution environment in handout modeby Stephen on September 21, 2026 at 8:46 am
In beamer, I want all the solution environments' contents to appear in normal beamer mode but disappear in handout mode. Typically this can be achieved by something like \documentclass[handout]{beamer} \begin{document} \begin{frame} \begin{example} example text \end{example} \begin{solution}<2-|handout:0> solution text \end{solution} \end{frame} \end{document} However, adding handout:0 for every solution environment is tedious. Is there any automatic may?
- math mode: make parentheses smaller?by Thibault de Villèle on September 21, 2026 at 8:11 am
I already know \left<opening operator> <content> \right<closing operator> automatically scales up the operators to adapt to the <content> size. I have the opposite problem: I want to scale a set of parentheses down, specifically in a superscript. Take the symbol below in (1) which I use to refer to a specific curve in my paper. I sometimes want to take the first derivative of it, which needs a \prime in superscript, leading to (2). % (1) The regular curve symbol. \NewDocumentCommand{\curve}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}}% \IfBlankF{#1}{(#1)} }% % (2) Its derivative \NewDocumentCommand{\curvederivative}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}\prime}% \IfBlankF{#1}{(#1)} }% However, these can easily be confused. I want to add parentheses around the \prime in order to make the difference stand out. The problem is the parentheses have a lot of height, but no depth (quite the change compared to the "gen" text, only having depth). This version also adds some height to the surrounding line in text mode... % (3) My attempt with parentheses... \NewDocumentCommand{\curvederivativeparen}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}(\prime)}% \IfBlankF{#1}{(#1)} }% Is there an automatic way to scale the parentheses down to the size of the content (in that case, only the \prime symbol)? I know I can play around with \scalebox and \raisebox, but I don't want to fiddle with the lengths if the content changes... MWE, with EBGaramond: \documentclass{article} \usepackage{fontspec} \usepackage[amsthm,frenchmath,uprightscript]{newtxmath} \usepackage[lining,tabular]{ebgaramond} \usepackage{mathtools} \NewDocumentCommand{\curve}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}}% \IfBlankF{#1}{(#1)}% }% \NewDocumentCommand{\curvederivative}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}\prime}% \IfBlankF{#1}{(#1)}% }% \NewDocumentCommand{\curvederivativeparen}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}(\prime)}% \IfBlankF{#1}{(#1)} }% \begin{document} First attempt: \( \curve{} \).\par Second attempt: \( \curvederivative{} \).\par Third attempt: \( \curvederivativeparen{} \).\par \end{document}
- Index not created automatically by the package imakeidxby lyl on September 21, 2026 at 7:53 am
I try to use Emacs + AUCTeX + Miktex to compile the following code which fails to output the index I expect. The options of the engine is: (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex -shell-escape -aux-directory=./tmp -recorder %(mode)%' %t" TeX-run-TeX nil t)) Then I remove the option -aux-directory=./tmp and the index is created. But temporary files created during compilation are now all located in root path which is very annoying. How to get my index automatically created with imakeidx and meanwhile put all the temporay files in a given path? \documentclass{article} \usepackage[nonewpage]{imakeidx} \makeindex[columns=3,intoc,title=My Index] \begin{document} The first index needed\index{index}\\\clearpage The second index needed\index{second} \printindex \end{document}
- How to make this matrix fit inside the width of a column, in a document with a two-column page layoutby Ricky W. on September 20, 2026 at 7:02 pm
I am trying to put a 12 times 12 matrix into one column of the IEEE conference format. But it turns out like this. How do I make this looks better and fit the 12*12 matrix into the left column? Here is the package I am using \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts % The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out. \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{algorithm} \usepackage{mathtools} \usepackage{matlab-prettifier} \usepackage{diagbox} \usepackage{amsmath} \usepackage{booktabs} \usepackage{amsthm} \setcounter{MaxMatrixCols}{12} \newcommand{\INPUT}{\item[\algorithmicinput]} \newcommand{\algorithmicinput}{\textbf{Input:}} \newcommand{\OUTPUT}{\item[\algorithmicoutput]} \newcommand{\algorithmicoutput}{\textbf{Output:}} \newcommand{\INITIALIZE}{\item[\algorithmicinitialize]} \newcommand{\algorithmicinitialize}{\textbf{Initialize:}} \newcommand{\wvar}[1]{\mathit{#1}} Here is my code: \begin{equation} A = \begin{bmatrix} 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & g\sin{\psi} & g\cos{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -g\cos{\psi} & g\sin{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & r & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -r & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & q & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_y-Jz}{J_x}r & \frac{J_y-J_z}{J_x}q \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_z-J_x}{J_y}r & 0 & \frac{J_z-J_x}{J_y}p \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_x-J_y}{J_z}q & \frac{J_x-J_y}{J_z}p & 0 \\ \end{bmatrix}\label{eq.3} \end{equation}
- "restore" booktabs rules above/below spacing in tabularray with `rowsep=0pt`by Stefan Pinnow on September 20, 2026 at 6:31 pm
The title says it all. What needs to be done, thus that \toprule, \midrule, and bottomrule (and maybe other rules from booktabs) in a tblr environment have the additional spacing again, as they have in a regular tabular environment? Here a direct comparison in the MWE \documentclass[border=5pt,varwidth]{standalone} \usepackage{booktabs} \usepackage{tabularray} \UseTblrLibrary{booktabs} \SetTblrInner{rowsep=0pt} \begin{document} \begin{tabular}{@{}llr@{}} \toprule \multicolumn{2}{c}{Item} \\ \cmidrule(r){1-2} Animal & Description & Price (\$) \\ \midrule Gnat & per gram & 13.65 \\ & each & 0.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.33 \\ Armadillo & frozen & 8.99 \\ \bottomrule \end{tabular} \vspace{1ex} \begin{tblr}{@{}llr@{}} \toprule \SetCell[c=2]{c} Item \\ \cmidrule[r]{1-2} Animal & Description & Price (\$) \\ \midrule Gnat & per gram & 13.65 \\ & each & 0.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.33 \\ Armadillo & frozen & 8.99 \\ \bottomrule \end{tblr} \end{document} which results in
- roman numerals as enumeration in italics font styleby Rup_LA on September 20, 2026 at 2:59 pm
I'm writing a lemma with italics font style where I need enumeration in lowercase Roman numerals. I tried different ways and the best I could do is to use the package enumerate like this: \usepackage{enumerate} \begin{document} \begin{lemma} For any graph G, \begin{enumerate}[(i)] \item L(G) is symmetric. \item L(G) is positive semidefinite. \item etc. \end{enumerate} \end{lemma} \end{document} But the problem I'm facing is the tilts of parentheses are more than that I like. Actually I want like this: Any help would be appreciated.
- TikZ 3D: different planes within one pathby Wrzlprmft on September 20, 2026 at 10:29 am
Suppose, I want to draw a 3D cylinder using TikZ’ 3D library. If I just want to draw the outline, it’s straightforward, as I can draw each line in a separate command: \documentclass[tikz]{standalone} \usetikzlibrary{3d} \begin{document} \begin{tikzpicture}[z={(0.5cm,0.2cm)}] \newcommand{\atan}{26.565} % the visually rightmost angle \newcommand{\radius}{2} \newcommand{\height}{3} % top \draw[canvas is xz plane at y=0] (\atan:\radius) arc(\atan:\atan-180:\radius) coordinate(top left); % left \draw (top left) -- ++(0,-\height); % bottom \draw[canvas is xz plane at y=-\height] (\atan-180:\radius) arc(\atan-180:\atan:\radius) coordinate(bottom right); % right \draw (bottom right) -- ++(0,\height); % back of top face \draw[canvas is xz plane at y=0,red] (\atan:\radius) arc(\atan:\atan+180:\radius); \end{tikzpicture} This gives me: Now, if I want to fill the faces of the cylinder, I cannot simply adapt the above as the planes are changing all the time. Changing coordinate systems mid-command as described here doesn’t work (or I am using it wrong). How can I do this? I prefer answers that are generalisable and where it is clear what the current coordinate system is at any point (like the above solution). For reference, the desired output is something like this:
- allow caption over two pages in float environmentby Matteo on September 20, 2026 at 6:17 am
I have the current situation where I handled a panel/composite figure with subfigure; I have adjusted sizes so that both images can be visible and occupy the entire page space. The problem is that when I add the caption it covers the page number... I wish for it to break at some point and continue to the next page. I have attempted to use \ContinuedFloat but this has the undesired effect of positionning each subfigure in an independent page. Is there a way to keep images in one page, possibly part of the caption, and having the rest naturally finishing on the following page? Thanks. MWE \documentclass{article} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{lmodern} \usepackage{float} \usepackage{graphicx} \usepackage{csquotes} \usepackage{subcaption} \usepackage[labelfont=bf,font=small]{caption} \usepackage[noabbrev]{cleveref} \Crefname{figure}{Fig.}{Figs.} \makeatletter \renewcommand{\fnum@figure}{Fig. \thefigure} \makeatother \renewcommand{\_}{{\fontfamily{ptm}\selectfont\textunderscore}} \begin{document} \begin{figure}[htbp] \centering \begin{subfigure}{\textwidth} \centering \includegraphics[width=6.15in]{example-image-a} \caption{sub1} \label{figure:1a} \end{subfigure} \medskip \begin{subfigure}{\textwidth} \centering \includegraphics[width=6.15in]{example-image-b} \caption{sub2} \label{figure:1b} \end{subfigure} \caption{\textbf{(a)} top part showcases sequencing data in input for assembling the \textsc{rpe}\oldstylenums{1} genome; both \enquote{isogenomic mapping} and genome graph methodologies, tested for ascertaining the most suitable to accurately detect variants genome-wide, are indicated as schematics on the right — heterozygous sites private to each haplotype are in darker shades of red. The bottom part shows different \textsc{rpe}\oldstylenums{1} batches sequenced with long-read \textsc{h}i\textsc{f}i and aligned to the two data structures; \textit{c0\_prt} are the reads used for assembly and afterward for benchmark (besides short-read Illumina\textsuperscript{\textregistered}). In \textbf{(b)} a grouped bar plot for the three metrics recall, precision, and \textsc{f}\oldstylenums{1} comparing graph and linear approaches with different sequencing technologies.} \label{figure:fig_1} \end{figure} \end{document} Also, a visual output of my real case without and with caption
- biber doesn't compileby Epimanes on September 19, 2026 at 8:15 pm
Today I tried to use biber (within TeXShop) and I got this error in the console: usage: lipo <input_file> <command> [<options> ...] command is one of: -create[_album] -info -detailed_info -thin <arch> -extract <arch> [-extract <arch> ...] -remove <arch> [-remove <arch> ...] -replace <arch> <file_name> [-replace <arch> <file_name> ...] -verify_arch <arch> ... -archs options are one or more of: -arch <arch> <input_file> -o <output_file> -segalign <arch> <alignment> /Library/TeX/texbin/biber: extracting arm64 binary with lipo failed (wstatus=256) All of the error makes no sense to me. But when I google that last line, it says that it "does not contain the arm64 architecture slice." I'm wondering if this is an error having to do with the upcoming updates in the OS (???). If anyone has a solution or even a description of what is going on, I'd appreciate the help.
- Macro for drawing intervalsby Fabrice on September 19, 2026 at 6:04 pm
How to modify this macro to ensure the same spacing between the first mark and the opening delimiter, and between the last mark and the closing delimiter ? \documentclass[border=5mm]{standalone} \usepackage{luatex85} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); vardef interval(expr a, b, c, d) = interim ahangle := 30; numeric u; u = 0.5cm; path l; l = (0,0) -- (8*u,0); drawarrow l; for x = (a + 0.2) step 0.2 until (b - 0.2): draw (3 down -- 3 up rotated -45) shifted (x * u, 0); endfor label(c, (2*u,0)); label(d, (6*u,0)); label.bot("$a$", (a*u,-5)); label.bot("$b$", (b*u,-5)); label.bot("$-\infty$", (0,-5)); label.bot("$+\infty$", (8*u,-5)); enddef; interval(2, 6, "[", "]"); endfig; \end{mplibcode} \end{document}
- Importing text file while following newlinesby ticster on September 19, 2026 at 4:52 pm
I'm putting together a collection of poems I've written. The poems are already written separately in txt files, and I would like to import them directly into my LaTeX file. The reason I don't want to simply copy and paste them is that I want the ability to access and modify them directly, independently of the broader collection I'm writing, and for any modifications to then be reflected directly in the final LaTeX file. The issue I'm having is that if I just \input the files, the line breaks aren't respected. Is there any way to import the file in such a way that LaTeX understands that every new line in the txt file should represent a line break in the final PDF ?
- How to delete entire section using track changes package?by IgotiT on September 19, 2026 at 8:17 am
I am submitting a minor revision of my manuscript. One of the reviewers has asked me to remove a section from the manuscript because it is somewhat misaligned with the main focus of the work. I am using the changes package, and the commands \added{...}, \replaced{...}{...}, and \deleted{...} work perfectly well when applied to a single word or even an entire paragraph. However, when I use \deleted{...} to delete an entire section (including the section heading and all of its contents), it does not work as expected. I am aware that there are other solutions, such as latexdiff, but I am not very familiar with it and would prefer to continue using the changes package. Is there a way to use \deleted{...} to mark an entire section as deleted while using only the changes package? If not, is there a recommended way to achieve this with changes without manually applying \deleted{...} to every paragraph?
- Replace Source Sans Pro with Source Sans 3by Paul Gaborit on September 19, 2026 at 6:05 am
A document compiled with lualatex used the "Source Sans Pro" font: \setsansfont{Source Sans Pro} However, the new version of the font distributed via TeXLive 2026 is "Source Sans 3". The document must therefore use: \setsansfont{Source Sans 3} However, this document is shared among several users. Some use TeXLive 2026, while others use TeXLive 2025 or even 2024. How to use the "Source Sans 3" font when available, and fall back to the "Source Sans Pro" font otherwise ?
- Counter not updated in foreach loop [duplicate]by Thomas on September 17, 2026 at 3:57 pm
I trying to make some algorithmic in LaTeX (how crazy am I !), but I'm stuck on something. I make a for loop to count some elements of an array (actually 2D array, but the issue is not from that). Do do that, I use a counter that I increment on each steps of the foreach loop: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \newcount\mycounter \mycounter=0 \foreach\i in {0,1,...,5}{% \advance\mycounter by1 It. \i : Counter is \the\mycounter } In the end : \the\mycounter \end{document} But in the end, the counter seems to be updated only locally and its value is 0 : It. 0: Counter is 1 It. 1: Counter is 1 It. 2: Counter is 1 It. 3: Counter is 1 It. 4: Counter is 1 It. 5: Counter is 1 In the end : 0 I did not managed to find an explanation to this, and how to fix this :/ I also tried to look another way to make for loop in (La)TeX, but except this discussion that I did not manage to adapt to my case, I did not found it...
- SyncTeX preview jumps one page backward after compilation with macOS Golden Gateby david Balavoine on September 17, 2026 at 12:52 pm
I’m writing to report a reproducible issue with TeXShop’s built-in PDF preview after upgrading to macOS Golden Gate. Description: After each compilation, the PDF preview window systematically shows the page one page before the expected SyncTeX position. This happens even with a minimal document. Minimal example: \documentclass{article} \usepackage{lipsum} \begin{document} \section{First section} \lipsum[1-10] \section{Second section} \lipsum[11-20] \section{Third section} \lipsum[21-30] \end{document} Steps to reproduce: Open this file in TeXShop. Ensure SyncTeX is enabled (Preferences → Typeset → Sync Method: SyncTeX). Place the cursor in the “Third section”. Compile with Cmd-T. The PDF preview shows the previous page instead of the page corresponding to the current source line. Environment: macOS: Golden Gate TeXShop: 5.57 TeX Live: 2026 tlmgr revision 79639 (2026-07-10 18:45:34 +0200) installation: /usr/local/texlive/2026 Engine: pdflatex (SyncTeX enabled via -synctex=1) The issue started immediately after upgrading to macOS Golden Gate and did not occur on the previous macOS version. Could this be a regression in TeXShop’s PDF preview / SyncTeX handling under macOS Golden Gate? I’m happy to provide additional information (logs, screen recording, etc.) if needed.
- Scalebox and tikzby Carl on September 17, 2026 at 10:46 am
I want to reduce the dimension of the formula in the image, keeping the arrow pointing to the green square containing ’2’. It works fine without \scalebox. However, using this command a displacement of the arrow's endpoint emerges... how can I solve this? With thanks. Below, find my code (compiled via LuaLatex): \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{tikzmark,calc,positioning,fit,arrows,shapes,backgrounds,shapes.geometric,arrows.meta,patterns.meta,decorations.pathreplacing} \begin{document} \begin{frame} \begin{equation*} \text{\scalebox{0.95}{$f(t) = \left\{ \begin{array}{l} x \; \; \text{if $t < 0$ or $t = 1.05\tikzmarknode[fill=green,inner sep = 2pt,outer sep=1pt]{a}{2}3$} \\[10pt] y, \; \; \text{otherwise} \end{array} \right.$}} \end{equation*} \begin{tikzpicture}[remember picture,overlay] \node[inner sep=2pt] (b) [above right=3.0cm and 4.0cm of current page.center]{$z$}; \path[<-] (a) edge [out=90,in=180] (b); \end{tikzpicture} \end{frame} \end{document}
- In what situations should I use \noexpand after \romannumeral?by Elayson Abreu on September 16, 2026 at 6:20 pm
In what situations should I use \noexpand after \romannumeral? For example, the trimspaces package contains the following code: \catcode`\Q=3 \newcommand\trim@spaces[1]{% \romannumeral-`\q\trim@trim@\noexpand#1Q Q% } \long\def\trim@trim@#1 Q{\trim@trim@@#1Q} \long\def\trim@trim@@#1Q#2{#1} \catcode`\Q=11 Why is the \noexpand in \trim@spaces necessary? Edit: I managed to create an example where \noexpand does not seem to be important. % !TeX TS-program = lualatex \documentclass{article} \begin{document} \def\y{1} \expandafter\def\expandafter\x\expandafter{\romannumeral-`\. \y} \show\x % >\y . \end{document} Note how the \y macro survived expansion.
- `ball color` with `fill opacity` for transparency would make the color darken with 3D object, any other schemes?by Explorer on September 16, 2026 at 5:28 pm
Lead-in Claim: this part might be quite personal, but to show why, I decide to post it. The content was borrowed from here. Let's consider the following two series of images, just focus on the style: Group 1: Bright and Brilliant Group 2: Depressing and Gloomy Noted that was my personal perspective, I perferred the bright group. I like the real 3D style provided by ball color, It looks both professional and sophisticated. But not so good for me with opacity, it make the image looks seems a little bit depressing. So I was looking for any schemes with opacity that would not make the image too dark... Consider the pfradin's comment here and here, the difference: The real difference between the two groups is transparency. It is not luadraw that handles the ball color and fill opacity options, but TikZ, since it is responsible for the rendering. I therefore suggest you look into TikZ. Code Here below is my follow-up TikZ question: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \node {case1:hidden}; \fill[magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case1':hidden}; \fill[magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case2:hidden}; \fill[ball color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case2':hidden}; \fill[ball color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case3:hidden}; \fill[left color=magenta!25, right color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case3':hidden}; \fill[left color=magenta!25, right color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case4:hidden}; \fill[inner color=magenta!25, outer color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case4':hidden}; \fill[inner color=magenta!25, outer color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \end{document} Here below is the version with tikz-3dplot: \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{70}{110} \begin{tikzpicture}[tdplot_main_coords] \begin{scope}[x={(1cm,0)}, y={(0,1cm)}] \node {hidden}; \shade[inner color=magenta!25, outer color=magenta] (0,0) circle (3cm); \end{scope} \end{tikzpicture} \begin{tikzpicture}[tdplot_main_coords] \begin{scope}[x={(1cm,0)}, y={(0,1cm)}] \node {hidden}; \shade[inner color=magenta!25, outer color=magenta,opacity=0.5] (0,0) circle (3cm); \end{scope} \end{tikzpicture} \end{document} It didn't get the things gloomy: My purpose Since my comment here, I think the ball color was excellent with opaque 3D-object. But if thing changed transparent, that was not looks quite good(claim again, just personal option-based perspective), I want the transparent magenta sphere(actually circle)'s color scheme looks like: the bright one. Or in the following sketch, I want the dark orange was changed to light orange: Questions (sorry, option-based questuon, but not the key point here, no need to answer, but I wonder any preferences?) Would you prefer the Group A(bright-opaque 3D) instead of the Group B(dark-opacity 3D)? Is that possible for ball color and fill opacity not to make things darken and gloomy? How many shading stretagies could be used(provided with TikZ/pgf) to simulate the light and shadow of 3d-object? Is that exists one that would darken the color(It looks like tikz-3dplot used one)? Is that possible to support another shading color scheme similar to tikz-3dplot to mimic 3D with luadraw instead of the ball color now?
- How to enlarge the bounding box of `tblr` with `tikz` if the `overlay` get out of the `tblr` itself?by Explorer on September 16, 2026 at 3:47 pm
Just for fun, I try to mimic this question with tikz-extension with tabularray: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{tikz} \begin{document} \begin{tblr}{ colspec={*{3}{Q[c,m,12mm]}}, hlines,vlines, } multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \\ \end{tblr} \bigskip \begin{tblr}{ colspec={*{3}{Q[c,m,12mm]}}, % hlines,vlines, rows={rowsep=+5pt}, columns={colsep=+5pt}, } multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \foreach \i in {1,...,\arabic{rowcount}}{ \foreach \j in {1,...,\arabic{colcount}}{ \coordinate (A) at ([xshift=+2pt,yshift=-2pt]h\i-|v\j); \coordinate (B) at ([xshift=-2pt,yshift=+2pt]h\inteval{\i+1}-|v\inteval{\j+1}); \draw[cyan] (A) rectangle (B); } } \draw[magenta] ([xshift=-1.5pt,yshift=+1.5pt]h1-|v1) rectangle ([xshift=+1.5pt,yshift=-1.5pt]h\inteval{\arabic{rowcount}+1}-|v\inteval{\arabic{colcount}+1}); \end{tblrtikzabove}% \end{tblr} \end{document} However, the bounding box was not enlarged with the overlay. It looks not a good idea to do so with tabularray...? Now I turn to focus, if we need to draw something outside the tblr, how to enlarge the corresponding bounding box? Edit Now let's only focues the bounding box, similar to this post(?), following example: \documentclass{article} \usepackage{showframe} \setlength{\parindent}{0pt} \usepackage{tabularray} \UseTblrLibrary{tikz} \usetikzlibrary{bending} \begin{document} \begin{tblr}{colspec={*{3}{Q[c,m,12mm]}},hlines,vlines} multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \draw[ultra thick,cyan,-latex] (1-1.north west) to[bend right] (3-1.south west); \end{tblrtikzabove}% \end{tblr} \bigskip some text% \begin{tblr}{colspec={*{3}{Q[c,m,12mm]}},hlines,vlines} multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \draw[ultra thick,cyan,-latex] (1-1.north west) to[bend right] (3-1.south west); \end{tblrtikzabove}% \end{tblr} \end{document} The "some text" was overlapped with the arrow outside the tblr, my focus here, was how to enlarge the bounding box of tblr in similar case?
- The triple link no longer appearsby Nicolas on September 16, 2026 at 3:26 pm
I want to show a sequence of reaction, keeping the environment reaction: for the first alcyne, the triple bond is clearly visible; on the other hand, for the next two, it no longer appears \documentclass[a4paper,12pt]{article} \usepackage[T1]{fontenc} \usepackage{chemfig} \usepackage{chemmacros} \begin{document} \begin{reaction} \chemfig{R_1-C~C-H}->[ base~forte] "\chemfig{R_1-C~C\mch{}}" %+\ch{BH} ->[ "\chemfig{R_2-X}" ] "\chemfig{R_1-C~C-R_2}" \label{rxn:bilansnalcyne}% \end{reaction} \end{document}
- Text in Devanāgarī, line numbering in Arabicby muk.li on September 16, 2026 at 1:24 pm
In the following example, to be compiled with LuaLaTeX, I have a Sanskrit text which, while in the source file it is written in IAST transliteration, in the PDF output it is rendered in Devanāgarī, which is done by babel's transform mechanism. \documentclass{memoir} \usepackage{fontspec} \defaultfontfeatures{Ligatures=TeX} \setmainfont{Noto Serif} \usepackage[english]{babel} \babelprovide[% typography/prehyphenchar = `-, transforms=transliteration.iast, ]{sanskrit} \babelfont{rm}{Noto Serif} \babelfont[*devanagari]{rm}[Renderer=Harfbuzz]{Noto Serif Devanagari} \usepackage{reledmac} \linenumberstyle{arabic} \setcounter{firstlinenum}{1} \setcounter{linenumincrement}{1} \begin{document} \begin{otherlanguage}{sanskrit} \beginnumbering \pstart athety ayam adhikārārthaḥ. yogānuśāsanaṃ śāstram adhikṛtaṃ veditavyam. yogaḥ samādhiḥ. sa ca sārvabhaumaś cittasya dharmaḥ. kṣiptaṃ mūḍhaṃ vikṣiptam ekāgraṃ niruddham iti cittabhūmayaḥ. tatra vikṣipte cetasi vikṣepopasarjanībhūtaḥ samādhir na yogapakṣe vartate. yas tv ekāgre cetasi sadbhūtam arthaṃ pradyotayati kṣiṇoti ca kleśān karmabandhanāni ślathayati nirodham abhimukhaṃ karoti sa saṃprajñāto yoga ity ākhyāyate. sa ca vitarkānugato vicārānugata ānandānugato 'smitānugata ity upariṣṭān nivedayiṣyāmaḥ. sarvavṛttinirodhe tv asaṃprajñātaḥ samādhiḥ. 1.1 \pend \endnumbering \end{otherlanguage} \end{document} I would prefer the line numbering to be exempt from that transformation, so that the numbers in the left margin appear in the usual Arabic form. One possibility to do that could be to open the Sanskrit environment only after \pstart and close it before \pend, but that would then lead to the lemmas not being displayed properly, and possibly other complications. Is there a way to wrap the line numbers in an English language environment?
- Tablecaption IEEEconf misalignedby binex6 on September 16, 2026 at 1:01 pm
In my Latex IEEEconf paper (template ieeeconf.cls from here) I have a table, placed on top of the page. The table caption has to be placed above the table. Somehow, the caption is misaligned, same as in this question. It is placed to far towards the pages top. Instead of the letters written uppercase, the letters written in lowercase are perfectly aligned to the top margin. So exactly the difference between the lowercase and uppercase letters shifts the caption text to far towards the pages top. Nothing so far helped, I tried \vspace, \vspace*, \caption{\rule{0pt}{0.7\baselineskip}Caption Text}, minipages, etc... The same error occurs to all figures on top of pages but for figures it was easy to fix with \vspace*{0.2cm}, since the caption is placed below normal figures and therefore they are shifted with the figures content. For tables, it is not working because the caption is placed above the table itself. A minimal example is below. \documentclass[10pt, conference]{ieeeconf} % \IEEEoverridecommandlockouts \usepackage[utf8]{inputenc} \usepackage{graphicx} % Add graphics capabilities \usepackage{amsmath} % Better maths support \usepackage{amssymb} % Additional math symbols \usepackage[TS1,T1]{fontenc} \usepackage{multirow} \usepackage[labelfont=bf, ]{caption} \usepackage[bookmarksopen, colorlinks, linkcolor=black, urlcolor=black, citecolor=black, breaklinks, linktocpage=true]{hyperref} \usepackage{floatrow} \floatsetup[table]{capposition=top} \usepackage{orcidlink} \usepackage{microtype} \usepackage{makecell} % for multi-cell tables \usepackage{tikz} \usetikzlibrary{calc, backgrounds, positioning} \usepackage{pgfplots} \pgfplotsset{compat=1.18} % This draws border around page margins, which shows the table caption fail \usepackage{eso-pic} % For background placement in all modes \AtBeginDocument{% \AddToShipoutPictureBG{% \begin{tikzpicture}[remember picture, overlay] \path (current page.south west) ++(54pt,54pt) coordinate (original south west) (current page.north east) ++(-54pt,-54pt) coordinate (original north east); \draw[thin, lightgray](original south west) rectangle (original north east); \end{tikzpicture}%% }% } \usepackage{lipsum} \title{Title} \author{Authors% <-this stops a space \thanks{Partially supported by BLABLABLA}% } \begin{document} \maketitle \lipsum[1-15] \begin{table}[t] \centering \caption{Some Caption.} \begin{tabular}{l c c} & Col1 & Col2 \\ \hline Row1 & Num1 & Num2 \\ Row2 & Num3 & Num4 \\ \hline \end{tabular} \label{tab:label1} \end{table} \end{document}
- LaTeX3: check if a macro is relaxed, and how \cs_if_exist:cTF worksby Thibault de Villèle on September 16, 2026 at 12:49 pm
I have the following in some parts of my code, which need to interact with LaTeX2ε code: \NewDocumentCommand{\foo}{m}{ %... \expandafter\gdef\csname cname@\@currentcounter\endcsname{\IfBlankTF{#1}{\relax}{#1}} %... } I expected the following to work in expl3 (because I use zref for some stuff): %... \bool_if:nTF { \cs_if_exist_p:c { cname@ \@currentcounter } } { do something with the value of \cname@.... } { do something else } %... But it seems like this is always evaluating to true, even when cname@\@currentcounter is set to \relax. The LaTeX3 manual states: \cs_if_exist_p:c Tests whether the <control sequence> is currently defined (whether as a function or another control sequence type), and its meaning is not the primitive \relax token. Is this expected behaviour? Are \gdef macros set to \relax somehow not set to "the primitive \relax token" ? MWE: \documentclass[varwidth, margin=1cm]{standalone} \NewDocumentCommand{\makecmdG}{m m}{\expandafter\gdef\csname mycommand#1\endcsname{\IfBlankTF{#2}{\relax}{#2}}}% \NewDocumentCommand{\makecmdX}{m m}{\expandafter\xdef\csname mycommand#1\endcsname{\IfBlankTF{#2}{\relax}{#2}}}% \ExplSyntaxOn \NewDocumentCommand{\checkcmd}{m}{ \bool_if:nTF { \cs_if_exist_p:c { mycommand#1 } } { defined~ } { undefined~ } and~ \cs_if_exist:cTF { mycommand#1 } { not-relaxed } { relaxed } \cs_log:c { mycommand#1 }} \ExplSyntaxOff \makecmdG{foo}{} \makecmdG{bar}{content} \makecmdX{FOO}{} \makecmdX{BAR}{CONTENT} \begin{document} \texttt{\string\mycommandfoo} is \checkcmd{foo}.\par% Expected: defined and relaxed. \texttt{\string\mycommandbar} is \checkcmd{bar}.\par% Expected: defined and not-relaxed. \texttt{\string\mycommandFOO} is \checkcmd{FOO}.\par% Expected: defined and relaxed. \texttt{\string\mycommandBAR} is \checkcmd{BAR}.\par% Expected: defined and not-relaxed. % Instead, all lines are equal to "... defined and not-relaxed." \end{document}
- Where was \selectlanguage defined in the LaTeX kernel?by Elayson Abreu on September 15, 2026 at 8:40 pm
My code: % !TeX TS-program = lualatex \documentclass{article} \begin{document} \meaning\selectlanguage \end{document} Result: Where was \selectlanguage defined? When I try to find the definition in source2e.pdf, I can't find it. What caused my doubt is that I recently needed to define \selectlanguage using \providecommand because my macros use \selectlanguage internally. Instead, it seems more correct to use \@ifpackageloaded{babel}, but I would expect, in cases like this, that a \providecommand would be enough. Thank you in advance. Obs.: LaTeX2e <2026-06-01> L3 programming layer <2026-06-18>
- Adding an arrowhead at the bottom of \rceil and \lceilby J.-E. Pin on September 15, 2026 at 10:54 am
As indicated in the title, I am trying to create new delimiters (variable-sized if possible!) derived from the pair (\rceil, \lceil) by adding an arrowhead at the bottom of these symbols. After looking at these questions How do I superimpose two math symbols? Exact positioning of superimposed symbols How do you superimpose two symbols over each other? I tried to superimpose \downarrow and \rceil (respectively \lceil), using the following code \documentclass[]{article} \newcommand{\da}{\downarrow} \makeatletter \newcommand{\dar}{\mathrel{\mathpalette\eqdr@t\relax}} \newcommand{\eqdr@t}[2]{% \ooalign{% $\m@th#1\rceil$\cr \hidewidth$\m@th#1\da$\hidewidth\cr }% } \newcommand{\dal}{\mathrel{\mathpalette\eqdl@t\relax}} \newcommand{\eqdl@t}[2]{% \ooalign{% $\m@th#1\lceil$\cr \hidewidth$\m@th#1\da$\hidewidth\cr }% } \makeatother \begin{document} $u\dal I \dar$ \qquad $u\dal I \cup J \dar$ \end{document} but, as you can see on the picture, the downarrow is slightly too high and does not superimpose perfectly. I'm not particularly keen on using \downarrow if there are better ways to obtain the arrowheads.