• Good packages for maintaining multiple document versions, with simple interface like `tagging` and `optional`?
    by Peter LeFanu Lumsdaine on April 2, 2026 at 12:31 pm

    This is a package-recommendation question: What good, modern packages exist for maintaining a document with multiple versions? This is something I find myself needing constantly, for many purposes (e.g. versions in different page geometries for printing/screenreading; versions with different styles for preprint/journal versions of an article…) One option is to define conditionals like “\newif\ifsmallscreen” at the start, and manage the conditional logic by hand. A cleaner approach is provided by the rather similar packages optional and tagging: you load them at the start of the preamble with your named options/tags e.g. \usepackage[smallscreen]{optional}, and they allow conditing on thses with an interface like \opt{smallscreen}{\geometry{a5paper}}. However, both these packages have some pretty basic limitations (e.g. optional only lets you conditionally include code based on options, not exclude it; and tagging’s conditionals don’t work inside command definitions), and are also unmaintained. So for more complex versioning I end up rolling my own solution — but I miss the very clean interface provided by these packages. Are there any modern, slightly wider-featured alternatives to these packages — offering a quick (ideally one-liner) interface for specifying tags/version options at the start of a document, and then offering a robust and flexible interface for conditionals depending on these? I’ve looked through CTAN’s conditional-compilation category, but haven’t found anything suitable — multiaudience and renditions have similar aims, but offer no improvement on optional and tagging, as far as I can see.

  • Strange key-value option trailing symbol behaviour in ConTEXt?
    by Explorer on April 2, 2026 at 9:17 am

    I have the following code: \startTEXpage[offset=20pt,width=15cm] \setuptyping[ before={\startframedtext[width=broad,framecolor=magenta]}, after={\stopframedtext}] \starttyping Framed example environment \starttyping ... \stoptyping \stoptyping \setuptyping[ before={\startframedtext[width=broad,framecolor=cyan]}, after={\stopframedtext} ] \starttyping Framed example environment \starttyping ... \stoptyping \stoptyping \setuptyping[ before={\startframedtext[width=broad,framecolor=orange]}, after={\stopframedtext}, ] \starttyping Framed example environment \starttyping ... \stoptyping \stoptyping \stopTEXpage The difference here is the trailing symbol after after={\stopframedtext}: caseA(work!) \setuptyping[ before={\startframedtext[width=broad,framecolor=magenta]}, after={\stopframedtext}] caseB(Not work!) \setuptyping[ before={\startframedtext[width=broad,framecolor=cyan]}, after={\stopframedtext} ] caseC(work!) \setuptyping[ before={\startframedtext[width=broad,framecolor=cyan]}, after={\stopframedtext}, ] The complete code gives only A and C framedbox: I was new to ConTEXt, and is that the option's key-value settings has such restrict requirement on \setuptyping? I was preferrable with the syntax as below: \mycmd[ keyA=ValA, keyB=ValB, keyC=ValC ] It looks dangerous in the ConTeXt case above? I wonder is that we should always avoid such syntax(as case B) in ConTeXt to keep the code safer? Edited Not all the commands are NOT worked with dangerous caseB syntax, and in the following case, the dangerous caseB work... \starttext \definecolor[colorA][ r=.8, g=.2, b=.2] \framed{\colorA This is colorA text} \definecolor[colorB][ r=.5, g=.1, b=.5 ] \framed{\colorB This is colorB text} \definecolor[colorC][ r=.1, g=.1, b=.9, ] \framed{\colorC This is colorC text} \stoptext

  • exam class: How to create a solution space that automatically spans multiple pages?
    by Dimitrios ANAGNOSTOU on April 2, 2026 at 9:04 am

    I am using the exam class to create tests and would like to provide students with a solution area that can span multiple pages if needed. The built-in environments such as solutionbox, \fillwithlines, or \makeemptybox work well for fixed-height spaces, but they do not naturally extend across page breaks (or I failed to do so...). What I would like is: a solution environment or command, that provides a large writable area, and automatically continues onto the next page(s) if necessary (e.g., like a long answer space). Here is a minimal example: \documentclass{exam} \usepackage{hyperref, graphicx} \begin{document} \begin{questions} \question[3] In no more than one paragraph, explain why the earth is round. \begin{solutionbox}{1in} The solution \end{solutionbox} \question[10] Long question requiring more space. % Desired: a solution space that can span multiple pages \begin{solution} % large writable area for students \end{solution} \end{questions} \end{document} I tried using solution, but I am not sure how to turn it into a multi-page writable area for students (not just for typeset solutions). What is the best way (within the exam class or with additional packages) to create a solution space for students that can automatically split across multiple pages?

  • wrap NewDocumentCommand macro definition
    by Franz on April 2, 2026 at 7:07 am

    in my research we have lots of unstable notation, i.e., we change the meaning of symbols a lot. Therefore I created a small notation package that provides macros by semantic identifiers (see here: https://gitlab.com/FranzAtGitLab/abs-smooth-notation). I then had the idea that a symbol could link to its definition if a corresponding label is found in the document. Therefore I have \newif\ifasn@links \asn@linkstrue \DeclareOption{nolinks}{\asn@linksfalse} \DeclareOption{links}{\asn@linkstrue} \ProcessOptions\relax \newcommand{\labelprefix}{asn} \makeatletter \newcommand{\maybelink}[2]{% \ifasn@links \@ifundefined{r@#2}% {#1}% {\hypersetup{hidelinks}\hyperref[#2]{#1}}% \else #1% \fi } \makeatother A simple macro is then like this \newcommand{\switchfctdx}{\maybelink{Z}{\labelprefix-switchfctdx}. You can imagine that this comes up a lot in the package. Therefore as a next step I created this: \newcommand{\definesymbol}[2]{% \expandafter\newcommand\csname #1\endcsname{% \maybelink{\ensuremath{#2}}{\labelprefix-#1}% }% } Which reduces the above definition to \definesymbol{switchfctdx}{Z}. However this does only work for the case of simple \newcommands. I also have definitions like this \NewDocumentCommand{\switchfctd}{ m }{{\maybelink{\fixed{\switchfct}}{\labelprefix-switchfctd}}_{#1}}. Of course in these cases it is not clear what part of the macro should be the link (actually every thing that is not an argument makes sense). But what annoys me the most is that I have to repeat the macro name for the label name. I would like to extend the functionality of \definesymbol in one of these ways: Have a \marker that tells \definesymbol what part is used for the link but still use the command name as the label reference automatically. Better: If no marker was set, assume everything is marked. Or even better: Use everything that is not an argument of the \NewDocumentCommand. No marker is needed. I will probably not use the full feature set of \NewDocumentCommand so a solution that can handle any number of mandatory arguments would work for me. EDIT: An example usage of the package would be \documentclass{article} \usepackage{abs-smooth-notation} \begin{document} Define \begin{equation}\label{asn-switchfctd} \switchfctd{x} := \{ \dots \}. \end{equation} The funny thing is, you can click on or hover over the symbol \(\switchfctd{x}\) to jump to its definition. This works for all symbols in the \texttt{abs-smooth-notation} package! To enable linking for a symbol defined by \texttt{\textbackslash{}symbol}, simply create a label \texttt{asn-symbol}. Here is the same for \(\texttt{\textbackslash{}Signature}\) producing \(\Signature\) \begin{equation}\label{asn-Signature} \Signature := \operatorname{diag}(\signature). \end{equation} \end{document} The minimal package code for this example would be \ProvidesPackage{abs-smooth-notation} \newif\ifasn@links \asn@linkstrue % default: links enabled \DeclareOption{nolinks}{\asn@linksfalse} \DeclareOption{links}{\asn@linkstrue} % optional explicit enable \ProcessOptions\relax \newcommand{\labelprefix}{asn} \makeatletter \newcommand{\maybelink}[2]{% \ifasn@links \@ifundefined{r@#2}% {#1}% {\hypersetup{hidelinks}\hyperref[#2]{#1}}% \else #1% \fi } \makeatother \newcommand{\definesymbol}[2]{% \expandafter\newcommand\csname #1\endcsname{% \maybelink{\ensuremath{#2}}{\labelprefix-#1}% }% } \RequirePackage{amsmath} \RequirePackage{hyperref} \providecommand{\fixed}[1]{\mathring{#1}} \definesymbol{switchfct}{F} \NewDocumentCommand{\switchfctd}{ m }{{\maybelink{\fixed{\switchfct}}{\labelprefix-switchfctd}}_{#1}} \definesymbol{signature}{\sigma} \definesymbol{Signature}{\Sigma}

  • How do I get rid of the extra \endgroup at \begin{document}?
    by Keegan Cove on April 2, 2026 at 5:49 am

    I have to use this template for my dissertation, but I have a persistent issue at the \begin{document} step. As I add text to the chapters, eventually the PDF refuses to render at all, presumably because of this endgroup issue. Where is the invisible bracket? What can I do? Edit: The template can be found here. Apologies for the image, I just don't understand the issue enough to reproduce it.

  • How do I specify what my symbol should copy-paste as?
    by Draconis on April 2, 2026 at 2:07 am

    When I'm reading a PDF, it's always nice if characters are encoded as themselves—that is, if searching for "≈" finds the \approx symbols, searching for "á" finds the \'{a}s, and so on. Not only does this make searching easier, but it means I can copy-paste symbols from the document into other programs. For the most part, XeLaTeX does a fantastic job of this; every standard symbol I've tried to insert has copied properly. But sometimes I'm defining my own symbols—in particular, I've drawn several of them in Inkscape, and inserted them into my document with \includegraphics. These obviously aren't searchable or copiable, since they're graphics rather than text. The same is true for TikZ pictures and anything I've synthesized by smashing standard symbols together. Is it possible to specify a Unicode codepoint that these symbols should copy and search as? I've considered drawing the character invisibly behind my graphics and \smashing it so it doesn't interfere with the spacing, but given how fantastic the support is for all the standard symbols, I suspect XeLaTeX has its own way to make this happen. MWE: \documentclass{article} \usepackage{graphicx} % I would like \myweirdsymbol to copy as U+229A, ⊚ \newcommand{\myweirdsymbol}{\includegraphics[height=10pt]{example-image-a}} \begin{document} This is a weird symbol: \myweirdsymbol{}. This is some more text. \end{document} (Of course, example-image-a looks nothing like ⊚. But that's just a random placeholder. Hopefully anything that works for them, works for any image and codepoint I choose.)

  • Why do links to exercises and solutions not always land at the same place?
    by LaTeXereXeTaL on April 2, 2026 at 12:01 am

    I'm using Mac TeX 2026 with all updates on macOS 26.4 with all updates. In my book project, I discovered links to exercises and solutions do not always land in the same place. In my MWE, links to exercises from List of Exercises and links to solutions from List of Solutions land such that the entire exercise or solution box is visible. However, from each individual exercise the link to its solution lands below the box's title. This behavior is present in the links in the Debug Section pages (which do not appear in the TOC because they are only for temporary debugging). My question is: how can I get link from exercises to their corresponding solutions, and links to solutions from the Debug Section pages, to land with the entire solution box visible? I have searched the site and could not find any directly applicable question. I found one answer involving modifying something about the "height" of a link but that did not work, and I cannot find that particular post at the moment. MWE: % !TEX program = lualatexmk % !TEX encoding = UTF-8 Unicode \documentclass[12pt]{book} \usepackage[nottoc]{tocbibind} \usepackage{tcolorbox} \usepackage{hyperref} \hypersetup{colorlinks,citecolor=blue,naturalnames=true} \tcbuselibrary{most} \begin{filecontents*}{chapterone.tex} \chapter{Chapter One} \section{A Section} \begin{exercise}{oneone} This is an exercise. \tcblower This is the solution. \end{exercise} \section{Another Section} \begin{exercise}{onetwo} This is an exercise. \tcblower This is the solution. \end{exercise} \newpage \section*{Debug Section} This page is for debugging. \DebugExercise{oneone} \DebugExercise{onetwo} \end{filecontents*} \begin{filecontents*}{chaptertwo.tex} \chapter{Chapter Two} \section{A Section} \begin{exercise}{twoone} This is an exercise. \tcblower This is the solution. \end{exercise} \section{Another Section} \begin{exercise}{twotwo} This is an exercise. \tcblower This is the solution. \end{exercise} \newpage \section*{Debug Section} This page is for debugging. \DebugExercise{twoone} \DebugExercise{twotwo} \end{filecontents*} % Exercise/Solution engine taken directly from the tcolorbox documentation % and modified by me. The ingenious mechanism for referencing exercise % solutions, which I could not get to work myself, is from TSE user cfr. % Only one new counter is needed; the other one is custom created. % Source - https://tex.stackexchange.com/a/761090 % Posted by cfr, modified by community. See post 'Timeline' for change history % Retrieved 2026-03-23, License - CC BY-SA 4.0 \newcounter{exercisecounter} \newcommand{\exercisecounterautorefname}{Exercise} \newcommand{\solutioncounterautorefname}{Solution} \makeatletter \newcommand*\ref@strimmer{} \def\ref@strimmer#1.#2\@nil{#2} \newif\if@solnref \newcommand*\de@ref{} \def\de@ref#1#2#3#4#5#6\@nil{ \def\tempa{#4}% \def\tempb{0}% \ifx\tempa\tempb \@solnreffalse \else \def\temp@ri{#1}% \def\temp@rii{#2}% \def\temp@riii{#3}% \@solnreftrue \edef\temp@riv{\expandafter\ref@strimmer #4\@nil}% \def\temp@rv{#5}% \fi } \NewTColorBox[use counter=exercisecounter,number within=chapter,list inside=exrcs] { exercise }{ m +!O{} } {% breakable,% enhanced,% colframe=green!20!black,% colback=yellow!10!white,% coltitle=green!40!black,% fonttitle=\bfseries,% underlay unbroken and first={\begin{tcbclipinterior} \shade[inner color = green!80!yellow,outer color=yellow!10!white] (interior.north west) circle (2cm); \draw[yellow!80!black,shift = {(interior.north west)}]; \end{tcbclipinterior} },% title={Exercise~\thetcbcounter:},% label={exer:#1},% attach title to upper=\quad,% after upper={\IfRefUndefinedExpandable{soln:#1}{}{% \par\hfill\textcolor{green!40!black} {\itshape Solution on page~\pageref{soln:#1}}} },% lowerbox=ignored,% savelowerto=exercise-\thetcbcounter.tex,% record={\string\solution{#1}{exercise-\thetcbcounter.tex}},% #2 }% \NewTotalTColorBox[list inside=sltns]{ \solution }{ m m } {% breakable,% enhanced,% colframe=red!20!black,% colback=yellow!10!white,% coltitle=red!40!black,% fonttitle=\bfseries,% underlay unbroken and first={\begin{tcbclipinterior} \shade[inner color=red!50!yellow,outer color=yellow!10!white] (interior.north west) circle (2cm); \draw[yellow!80!black,shift={(interior.north west)}]; \end{tcbclipinterior} },% title={Solution of Exercise~\ref{exer:#1} on page~\pageref{exer:#1}:},% phantomlabel={solution:#1},% attach title to upper=\par,% }{% \expandafter\de@ref\expanded{\csname r@exer:#1\endcsname}00000\@nil \if@solnref \MakeLinkTarget*{solutioncounter.\temp@riv}% \expandafter\write\expandafter\@auxout\expandafter{\expanded{% \string\newlabel{soln:#1}{% {\temp@ri}{\noexpand\thepage}{\temp@riii}% {solutioncounter.\temp@riv}{\temp@rv}% }% }% }% \fi \input{#2}% }% \makeatother \tcbset{no solution/.style={no recording,after upper=}} \NewDocumentCommand{ \DebugExercise }{ m } {% % \IfRefUndefinedExpandable is from refcount and is loaded by hyperref. \noindent I can cite \autoref{exer:#1} on page~\pageref{exer:#1} and \IfRefUndefinedExpandable{soln:#1}{it has no solution}{\autoref{soln:#1} on page~\pageref{soln:#1}}.\par }% \raggedbottom % reduces warnings with book class \title{The Title} \author{The Author} \begin{document} \frontmatter \maketitle \tableofcontents \tcblistof[\chapter]{exrcs}{List of Exercises} \tcblistof[\chapter]{sltns}{List of Solutions} %\tcblistof[\chapter]{deriv}{List of Derivations} \mainmatter \tcbstartrecording\relax \include{chapterone} \include{chaptertwo} \tcbstoprecording \appendix \chapter{Solutions to Exercises}\label{sec:apndxsolns} \tcbinputrecords \backmatter \end{document} Link to Solution of Exercise 1.1 on page 1 from List of Solutions showing entire solution box, the desired behavior: Link to Solution of Exercise 1.1 on page 1 from Exercise 1 showing only part of the solution box, the undesired, and current, behavior:

  • Localizing only specific fields per entry language in BibLaTeX
    by marlondecol on April 1, 2026 at 11:33 pm

    Suppose a simple document that uses only the Babel and BibLaTeX packages, and that loads a .bib file in which all bibliography entries have the langid field defined. When printing the bibliography, how can the edition field and only the month part of the date field be localized according to the language of each bibliography entry — which could be any language — while all other fields remain localized in the document's main language? To provide further context, consider a first scenario in which the document has the following preamble: \usepackage[brazilian]{babel} \usepackage{biblatex} In this case, BibLaTeX localizes all references in Brazilian Portuguese. Now, a second scenario in which the autolang=other option is passed to BibLaTeX: \usepackage[brazilian]{babel} \usepackage[autolang=other]{biblatex} This time, BibLaTeX localizes each reference according to its own entry language. However, unlike what I need, all fields end up being localized. The solution I am looking for is essentially a blend of these two scenarios: the effect of autolang=other would apply only to the fields mentioned above, while the remaining fields would still be localized in Brazilian Portuguese. To help clarify, the following MWE illustrates the first scenario using the abnt style: \documentclass{article} \usepackage[brazilian]{babel} \usepackage[style=abnt]{biblatex} % This is the style I use. % Change the formatting of ordinal numbers in Brazilian Portuguese. \DefineBibliographyExtras{brazilian}{% \protected\def\mkbibordedition#1{\stripzeros{#1}\adddot}} % Redefine the formatting of the edition field so that it varies according to % the language. \DeclareFieldFormat{edition}{% \ifinteger{#1}{\mkbibordedition{#1}~\bibstring{edition}}{#1\isdot}} \begin{filecontents}{\jobname.bib} @book{Booch-Rumbaugh-Jacobson-2005a, author = {Booch, Grady and Rumbaugh, James and Jacobson, Ivar}, title = {The unified modeling language user guide}, edition = {2}, location = {Upper Saddle River}, publisher = {Addison-Wesley}, date = {2005-05}, pagetotal = {xviii, 475}, langid = {american} } @book{Rover-Mello-2024a, author = {Rover, Ardinete and Mello, Regina Oneda}, title = {Normas da ABNT}, subtitle = {orientações para a produção científica}, edition = {2}, location = {Joaçaba}, publisher = {Unoesc}, date = {2024-04-10}, pagetotal = {244}, langid = {brazil} } \end{filecontents} \addbibresource{\jobname.bib} \nocite{*} \begin{document} \printbibliography \end{document} This MWE produces the following output: For this example, the proposed solution should print the first reference as follows: 2nd ed. instead of 2. ed.; May 2005 instead of maio 2005. The second reference should remain unchanged, since the entry language defined in the langid field matches the document's main language. I have searched for discussions and solutions related to this issue, but nothing addressed my problem precisely. I also came across the BibLaTeX multiscript project, though I have not studied it thoroughly enough to determine whether it could be of use here. Since I am using the same style as the MWE, I assumed it would not be a viable path. I hope I have not made any incorrect assumptions due to a misunderstanding on my part.

  • How to correctly parse tokens and preserve command-argument structure in expl3?
    by Alexander Rodríguez on April 1, 2026 at 6:49 pm

    I am parsing input in expl3 token by token. I want to wrap characters like a or + as [a], [+], while preserving commands such as \textbf{...} and \textit{...}. The problem is that my current approach separates the command from its argument, so something like \textbf{text} is no longer preserved as a single structure. How can I correctly parse the input so that commands keep their arguments, while still processing the content recursively? \documentclass[8pt]{article} \usepackage[ paperwidth=28cm, paperheight=4cm, margin=0.5cm ]{geometry} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\Brackets}{m} { \brackets_process:n {#1} } \cs_new_protected:Npn \brackets_process:n #1 { \tl_map_inline:nn {#1} { \brackets_case:n {##1} } } \cs_new_protected:Npn \brackets_case:n #1 { \tl_if_single:nTF {#1} { \tl_if_head_is_group:nTF {#1} { % Es un grupo \BracketsGroup:n {#1} } { % Es una lista \token_if_cs:NTF #1 { \BracketsCommand:n {#1} } % Es un comando { \token_if_space:NTF #1 { [\c_space_tl] } { \BracketsToken:n {#1} } } % Es un caracter } } { { \BracketsGroup:n {#1} } } } \cs_new_protected:Npn \BracketsGroup:n #1 { \brackets_process:n {#1} } \cs_new_protected:Npn \BracketsCommand:n #1 { #1 } \cs_new_protected:Npn \BracketsToken:n #1 { \str_case:nnF {#1}{{$}{$}{^}{^}{_}{_}}{ [#1] } } \ExplSyntaxOff \begin{document} \Brackets{Text \textbf{textbf \textit{textit} text } text {text {group}} text $ x^{1+1}+2x+4$ $\frac{1}{2} \sqrt[3]{x}$ text. {{Text}} } \vspace{5mm} Expected:\\ [T][e][x][t] \textbf{[t][e][x][t][b][f][ ]\textit{[t][e][x][t][i][t]}[ ][t][e][x][t]}[ ][t][e][x][t][ ]{[t][e][x][t][ ]{[g][r][o][u][p]}}[ ][t][e][x][t][ ]$ [x]^{[1][+][1]}[+][2][x][+][4]$[ ]$\frac{[1]}{[2]} \sqrt[{[3]}]{[x]}$[ ][t][e][x][t][.][ ]{{[T][e][x][t]}} \end{document} Expected behavior:

  • Is there a straightforward way to break and align an equation on more than one 'level'?
    by Simon on April 1, 2026 at 4:46 pm

    There is an equation that I would like to break and align as follows: ( in the second line and - in the third line should be aligned the same way that [ in the first line and + in the second line are, which requires aligning on more than one 'level' if level is the correct term. Intuitively, it would work as shown in the MWE, just with && not commented out: & for the first 'level' and && for the second one. (The concept could be extended by &&& for the third one and so on.) \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} E_\mathrm{kinetic}=\frac{1}{2}&\left[m_\mathrm{1}\left(v_\mathrm{1}-v_\mathrm{2}\right)^2\right.\notag\\ &\left.+m_\mathrm{2} % && \left(v_\mathrm{3}+...+...+...+...+a\omega_\mathrm{1}\right.\right.\notag\\ % && -\left.\left.b\omega_\mathrm{2}-...-...-...-...-v_\mathrm{4}\right)\right] \end{align} \end{document}

  • Auto placement of Tables in single and twocolumn format
    by MadyYuvi on April 1, 2026 at 1:46 pm

    I'm trying to automate the table placement either in single or two column based on its width, for this, I've tried: \documentclass[twocolumn]{article} \usepackage{tabularx} \usepackage{showframe} \usepackage{lipsum} \begin{document} \makeatletter \newlength{\tabboxwidth}% \newdimen\tempdime \newbox\temptbox \newenvironment{splprocesstable}[3]{\setbox\temptbox=\hbox{\sffamily{#2}}% \tempdime\wd\temptbox\@splprocesstable{#1}{#2}{#3}{\tempdime}} {\relax} \newlength{\tablebotadjustskip}% \setlength{\tablebotadjustskip}{\z@}% \newenvironment{@splprocesstable}[4]{% \setbox4=\hbox to \textwidth{\vbox{\begin{center}\begin{minipage}[t]{#4}% \sffamily% \caption{#1}{#2}% \vskip4pt\noindent% \parbox{#4}{\sffamily\fontsize{8bp}{10bp}\selectfont% #3\par}% \vspace*{\tablebotadjustskip}% \end{minipage}\end{center}}}% \box4} {\relax} \newbox\tabwdbox% \newdimen\tabwddimen% \newcommand{\processtable}[4][tb!]{\bgroup% \setbox\tabwdbox=\hbox{#3}% \tabwddimen=\wd\tabwdbox% \ifdim\tabwddimen = 245\p@%actual size 241 and fix buffer upto 4pts \setlength{\tabboxwidth}{245\p@}% \begin{table}[#1]% \splprocesstable{#2}{#3}{#4}% \end{table}% \else% \ifdim\tabwddimen < 245\p@% \setlength{\tabboxwidth}{245\p@}% \begin{table}[#1]% \splprocesstable{#2}{#3}{#4}% \end{table}% \else%%End of Single column Table \ifdim\tabwddimen = 502\p@%actual size 241 and fix buffer upto 4pts \setlength{\tabboxwidth}{502\p@}% \begin{table*}[#1]% \splprocesstable{#2}{#3}{#4}% \end{table*}% \else% \ifdim\tabwddimen < 502\p@%actual size 241 and fix buffer upto 4pts \setlength{\tabboxwidth}{502\p@}% \begin{table*}[#1]% \splprocesstable{#2}{#3}{#4}% \end{table*}% \fi\fi\fi\fi% \egroup}% \makeatother \lipsum[1-4] \processtable{For Single column Testing.\label{sara}} {\begin{tabularx}{\tabboxwidth}{@{\extracolsep\fill}XXXXX@{\extracolsep\fill}} \hline 1 &2 &3 &4 &5 \\ 1 &2 &3 &4 &5 \\ 1 &2 &3 &4 &5 \\ \hline 1 &2 &3 &4 &5 \\ \end{tabularx}}{} \processtable{For Two column Testing.\label{sara}} {\begin{tabularx}{\tabboxwidth}{@{\extracolsep\fill}XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX@{\extracolsep\fill}} \hline 1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &18 &19 &20 &21 &22 &23 &24 &25 &26 &27 &28 &29 &30\\ 1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &18 &19 &20 &21 &22 &23 &24 &25 &26 &27 &28 &29 &30\\ 1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &18 &19 &20 &21 &22 &23 &24 &25 &26 &27 &28 &29 &30\\ 1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 &17 &18 &19 &20 &21 &22 &23 &24 &25 &26 &27 &28 &29 &30\\ \hline \end{tabularx}}{} \end{document} But both the tables are comes in single column only, how can I fix this? Please advise.

  • How to colorized any line drawed with draw (nor with plot expression)?
    by Mika Ike on April 1, 2026 at 1:44 pm

    How to colorized any line drawed with draw (nor with plot expression)? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = middle, %title={Cor baseada no valor de $y$}, title={Color depending on $y$ coordinate}, colormap/hot % Podes usar 'hot', 'cool', 'jet', etc. ] \addplot[ mesh, % Divide o trazo en segmentos para aplicar cores thick, domain=-3:3, samples=100, point meta=y % Indica que a cor depende do valor de y ] {x^2}; % A función matemática \draw[thick, xshift=0.5,rounded corners] (-2,0.5) .. controls (0,-1) and (0,7) .. (1,7.8) .. controls (2,1) and (2,4) .. (3,3) node[anchor=east,pos=0.95] {How to colorize black line with colormap?} node[anchor=north east,pos=0.95] {depending on $y$ coordinate}; \end{axis} \end{tikzpicture} \end{document}

  • mdframed error with math mode: missing \item
    by David61 on April 1, 2026 at 12:16 pm

    When I type \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{thmtools} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,rightline=false,leftline=true,topline=false,bottomline=false,nobreak=true} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmblackbox,name=Test1,numbered=no]{t1} \declaretheorem[style=thmgreenbox,name=Test2,numbered=no]{t2} \begin{document} \title{Hello} \author{hello} \maketitle \begin{t1} \[hello\]hello. \begin{t2} hello \end{t2} \end{t1} \end{document} into Overleaf, line 21 (the line saying "hello") gives the error: LaTeX Error: Something's wrong--perhaps a missing \item. The result of render also looks like the "hello." after \[hello\] is unusually squashed into the green box. However, when I delete the \[hello\], or if I add another "hello" preceeding it, everything is normal! What is going on and what does \item have to do with anything?

  • Retrieve coordinates of self-intersections of a curve
    by Ventrikle on April 1, 2026 at 11:06 am

    I am trying to extract the intersection points of a closed curve using the spath3 package. Currently, I have managed to find these points by splitting the path at self-intersections and then using the spath cs (coordinate system) on the resulting components. However, I noticed that the spath3 documentation doesn't seem to provide a direct command for "finding intersections" and returning them as coordinates. My current workaround involves a somewhat manual process: splitting the path, identifying components, and then grabbing the coordinates at the end of specific segments. Here is my MWE. \documentclass[tikz, border=10pt]{standalone} \usetikzlibrary{spath3, knots, hobby, intersections} \begin{document} \begin{tikzpicture}[ use Hobby shortcut, ] \path[spath/save=trefoil] ([closed]90:2) foreach \k in {1,...,3} {.. (-30+\k*240:.5) .. (90+\k*240:2) } (90:2); \tikzset{ spath/.cd, split at self intersections=trefoil, remove empty components=trefoil, get components of={trefoil}\pathcomponents, } % Label each component at its midpoint for reference \foreach[count=\k] \cpt in \pathcomponents { \node[] at (spath cs:{\cpt} 0.5) {\tiny \k}; } % Extracting coordinates before inserting gaps \foreach[count=\k] \i in {1, 3, 5} { \coordinate (A\k) at (spath cs:\getComponentOf{\pathcomponents}{\i} 1); } \tikzset{ % Gaps are inserted after coordinate retrieval. % If inserted earlier, spath cs would only capture positions within the fragmented arcs. spath/insert gaps after components={trefoil}{10pt}{1,3,5}, } \draw[spath/use=trefoil]; % Mark the original intersection points \foreach \k in {1,2,3} { \fill[red, opacity=0.5] (A\k) circle[radius=2pt] node[above, black, opacity=1] {\color{red}\(\k\)}; } \end{tikzpicture} \end{document} While this code works, it feels like a "workaround." Is there a more concise or idiomatic way to retrieve these intersection coordinates directly using spath3 or its integration with the intersections library?

  • circuitikz, how to prettify connection between transformer and connecting lines?
    by Zarko on March 31, 2026 at 10:52 pm

    I would like to reproduce the following image using the circuitikz package: So far I was able to write the following MWE: \documentclass[border=1mm, 11pt]{standalone} \usepackage{circuitikz} \usetikzlibrary{positioning} %---------------------------------------------------------------% \begin{document} \begin{circuitikz}[ node distance = 3mm and 7mm, N/.style = {draw, minimum height=13mm, text width=#1, font=\small\linespread{0,84}\selectfont, align=center}, ] \ctikzset{inductors/coils=6, quadpoles/transformer core/inner = 1.0, quadpoles/transformer core/width = 0.5, quadpoles/transformer core/height= 0.68} \node (n1) [N=13mm] {SPE\\ PHY}; \node (n2) [transformer core, rotate=90, transform shape, right=of n1, anchor=base] {}; \node (n3) [transformer core, right=of n2.south] {}; \node (n4) [N=23mm, right=of n3] {common mode\\ termination}; %--- \draw[semithick] (n2.north east) -- (n2.north east -| n1.east) (n2.north west) -- (n2.north west -| n1.east) % (n2.south east) |- (n3.north west) (n2.south west) |- (n3.south west) % (n3.north east) -- (n3.north east -| n4.west) (n3-L2.midtap) -- (n4.west) (n3.south east) -- (n3.south west -| n4.west); %-------------------- \end{circuitikz} \end{document} which produce: As you can see, connections between transformers and connecting lines are not as on image, which I want to reproduce. Is there a (if possible simple) way to improve these connections?

  • Exam class: change color of \firstpagefootrule, \firstpageheadrule and \runningheadrule \runningfootrule
    by MrI2C on March 31, 2026 at 7:53 pm

    is there a way to change the color end pts thickness from default black to anything else in the exam class? \runningheadrule % lijn onder de running header (pagina 2+) \runningfootrule % lijn boven de running footer (pagina 2+) \firstpageheadrule % lijn onder de header op pagina 1 \firstpagefootrule % lijn boven de footer op pagina 1 for example here: \documentclass[12pt, a4paper, addpoints]{exam} % ── Pakketten ────────────────────────────────────────────────────────────────── \usepackage[a4paper, top=3cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} %\usepackage{helvet} %\usepackage{palatino} % of met betere math-ondersteuning: %\usepackage{newpxtext} %\usepackage{newpxmath} \usepackage{xcolor} \usepackage{lipsum} \renewcommand{\familydefault}{\sfdefault} % ── Kleuren ──────────────────────────────────────────────────────────────────── \definecolor{darkblue}{RGB}{26,37,47} \definecolor{midgray}{RGB}{85,85,85} % ── exam class: activeer de vier regels ─────────────────────────────────────── \runningheadrule % lijn onder de running header (pagina 2+) \runningfootrule % lijn boven de running footer (pagina 2+) \firstpageheadrule % lijn onder de header op pagina 1 \firstpagefootrule % lijn boven de footer op pagina 1 % ── Running header/footer (pagina 2+) ───────────────────────────────────────── \runningheader {\textbf{Examen: Inleiding tot de Magie}} {} {\textcolor{midgray}{Academiejaar 2025--2026}} \runningfooter {\textcolor{midgray}{Faculteit Toveren \& Hocus Pocus \quad|\quad Vertrouwelijk}} {} {Pagina \thepage\ van \numpages} % ── First page header/footer (pagina 1) ─────────────────────────────────────── \firstpageheader {} {% \textbf{\large\textcolor{darkblue}{UNIVERSITEIT HOGWARDS}}\\[3pt] \textcolor{midgray}{Faculteit Magie \& Toveren}% } {} \firstpagefooter {Datum: 15 juni 2026 \quad|\quad Duur: 3 uur Gesloten boek} {} {Nummer: \underline{\hspace{4cm}}} % ══════════════════════════════════════════════════════════════════════════════ \begin{document} % ── Titel ───────────────────────────────────────────────────────────────────── \begin{center} {\LARGE\bfseries\textcolor{darkblue}{EXAMEN: INLEIDING TOT DE MAGIE}}\\[6pt] {\large\textcolor{midgray}{Bachelor Magicus -- 1ste jaar \quad|\quad 15 juni 2026}} \end{center} \vspace{1em} \textbf{Instructies} \lipsum[1] \lipsum[2] \lipsum[3] % ── Vragen ──────────────────────────────────────────────────────────────────── \begin{questions} \question[20] \lipsum[1] \end{questions} % ── Pagina 2: antwoordruimte ────────────────────────────────────────────────── \newpage \textbf{Antwoordruimte -- Vraag 1} \lipsum[4] \lipsum[5] \lipsum[1] \lipsum[2] \end{document}

  • I started using TeXstudio and my margins are crazy [closed]
    by Анна on March 31, 2026 at 5:54 pm

    I used to use overleaf for work, and my documents always looked fine, but when I moved the same code to the TeXstudio editor, no matter how I tried to change the preamble or adjust the program, my document's margins weren't respected. Here's my preamble: \documentclass[12pt,a4paper,titlepage]{article} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} \usepackage[russian, english]{babel} %\usepackage{multicol} \usepackage{float} \usepackage{pgfplots} \usepackage{booktabs} \usepackage{amsmath,amsthm,amssymb} \usepackage{mathtext} \usepackage{graphicx} \usepackage{hyperref} \usepackage{gensymb} \usepackage{array} \usepackage{mathrsfs} \usepackage[parfill]{parskip} \usepackage{showframe} \usepackage{hyperref} \usepackage[left=15mm, top=20mm, right=15mm, bottom=20mm, nohead, nofoot]{geometry} %\makecell[l]{$$ \\ $$ } для колонок Пример отображения: Буду рада любым предложениям по решениям этой проблемы.

  • Phantom overline over visible expression
    by Michael on March 31, 2026 at 4:22 pm

    The following code: \documentclass{article} \begin{document} \[ f(x',\overline{x'}) \] \end{document} produces the following output for me: I'm a bit bothered that the heights of the primes are mismatched. My first thought for how to fix this issue was to add a phantom overline over the first argument so that the prime in the first argument would get pushed down to the same height. However, despite some experimentation with syntax (\phantom{\overline}{x'} for instance), I couldn't find something which compiles. Apologies if this has been asked before. The inverted version of this question overline over no text does not seem relevant here.

  • Replace placeholder in chemical formula
    by cis on March 31, 2026 at 3:11 pm

    I have a large table with many cells of the type <appropriated value>c<Mendeleev's correction>; e.g., BeCl3cBeCl2, VCl2cVCl5,... I would like to display this in a special notation: Is the following an efficient implementation, or is there a better way? \newcommand{\mycorrectio}{\ensuremath{\,{\color{red}\scriptscriptstyle\complement}\,}} % \NewDocumentCommand{\AddCorrectio}{m}{% \saveexpandmode\expandarg \StrSubstitute{#1}{c}{{{\mycorrectio}}}[\temp]% \temp% \restoreexpandmode% } Does mhchem perhaps have its own method for making such substitutions? PS: I just noticed that mhchem no longer seems to work in the table. Oh dear... \documentclass{article} \usepackage[version=4]{mhchem} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \usepackage{xstring} \usepackage{amsmath, amssymb} \usepackage{xcolor} \newcommand{\mycorrectio}{\ensuremath{\,{\color{red}\scriptscriptstyle\complement}\,}} % \NewDocumentCommand{\AddCorrectio}{m}{% \saveexpandmode\expandarg \StrSubstitute{#1}{c}{{{\mycorrectio}}}[\temp]% \temp% \restoreexpandmode% } \pgfplotstableset{ % Standard chemistry without substitution StandardMHchem/.style={% string type, column type={l}, postproc cell content/.code={ \pgfkeyssetvalue{/pgfplots/table/@cell content}{\ce{##1}} } },% % Chemistry with correction symbol MendeleevCorrectio/.style={ string type, column type={l}, postproc cell content/.code={ \edef\final{\noexpand\ce{\AddCorrectio{##1}}}% \pgfkeyslet{/pgfplots/table/@cell content}{\final}% } } } \pgfplotstableread[header=false]{ Cl BeCl3cBeCl2 VCl2cVCl5 - InCl2cInCl3 }\mydata \begin{document} \section{Mendeleev's Correctios} \subsection{Text} \AddCorrectio{BeCl3cBeCl2} \subsection{Table} \pgfplotstabletypeset[ display columns/0/.style={% StandardMHchem, column name={Standard \ce{mhchem}} },% % Create a virtual copy of column 0 for the correction view create on use/corr/.style={create col/copy=0}, columns={0, corr}, columns/corr/.style={MendeleevCorrectio, column name={With AddCorrectio}}, every head row/.style={after row=\hline}, ]{\mydata} \end{document}

  • Graph of f and f' with luacas package
    by Sebastiano on March 31, 2026 at 1:29 pm

    Recently I have discovered the interesting package named luacas (compilable with LuaLaTeX). To pag. 14 of the manual https://ctan.mirror.garr.it/mirrors/ctan/macros/luatex/latex/luacas/doc/luacas.pdf I have not understood the necessary packages to put in the preamble to compile the MWE to plot f and f'. Someone please, can help me? Here the fragment of the code: \directlua{ tex.print(h:tolatex()) } For Bob’s purposes, \fetch{h} is exactly what he needs: \begin{tikzpicture}[scale=0.9] \begin{axis}[legend pos = north west] \addplot [domain=-3.5:1.5,samples=100] {\fetch{h}}; \addlegendentry{$f$}; \addplot[densely dashed] [domain=-3.25:1.25,samples=100] {\fetch{dh}}; \addlegendentry{$df/dx$}; \addplot[gray,dashed,thick] [domain=-3.5:1.5] {0}; \end{axis} \end{tikzpicture} Alternatively, Bob could use \store. The \store command will fetch the contents of its mandatory argument and store it in a macro of the same name. \store{h} \store{dh}

  • Is there a lowercase Greek letter font with a fixed width in math format?
    by 2023 Siri on March 31, 2026 at 1:20 pm

    I've noticed that monospaced fonts have uppercase Greek letters but no lowercase Greek letters. Is there a mathematical format to resolve this issue with monospaced fonts? \documentclass{article} \begin{document} $\mathtt{\Gamma \Delta \Theta \Lambda \Xi \alpha \beta \gamma \delta}$ \end{document}

  • Hyperlink does not scale in pgfplots
    by Thomas on March 31, 2026 at 10:32 am

    I have a figure drawn with pgfplots where I cite a reference in the legend. the issue I have is when I try to scale the whole figure, I noticed that the green hyper link for the reference is not scaled and inserted at the original place. Here is an ECM with on the one hand the figure in whole size, and on the other hand the figure scaled. \documentclass{article} \usepackage{biblatex} \usepackage{hyperref} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \addbibresource{biblatex-examples.bib} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[red, domain=-3e-3:3e-3, samples=51]{exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))}; \addlegendentry{Text \cite{aksin}} \end{axis} \end{tikzpicture} % \begin{tikzpicture}[scale=0.9] \begin{axis} \addplot[red, domain=-3e-3:3e-3, samples=51]{exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))}; \addlegendentry{Text \cite{aksin}} \end{axis} \end{tikzpicture} \printbibliography \end{document} On the linked export, we see that the second green boxed is not over the reference [1], but over the place it would have been if the figure were not scaled. Is it possible to set the correct location for this box ?

  • Luadraw as a background image
    by PHL on March 31, 2026 at 7:43 am

    I would like to use a luadraw picture as a background image on a page. I tried overlay, but this is not working as the picture is shifted above right. Luadraw is not (yet?) on CTAN, but available on github: luadraw %!TEX TS-program = lualatex \documentclass[a4paper]{article} %\usepackage[ignoreall, margin=-0cm, marginparsep=0cm]{geometry} \usepackage{luadraw} \begin{document} \begin{luadraw}{} local g = graph:new{ margins={0,0,0,0} , size={31,31} , pictureoptions="overlay" } for j= 1, 5 do for k=1,10*j do g:Dcircle(Zp(j,k*math.pi/(5*j)),1) end end g:Show(true) \end{luadraw} % without overlay, the center of the picture (on a new page) is approximately at (20,10) (if (0,0) is the bottom left corner % with overlay, the center of the picture is out the page (at (30,50) ? maybe) \end{document} (The original picture is more complex than this one, so using a standard tikzpicture is not really an option)

  • How do I break a link within \url{} only after / or //?
    by Simon on March 30, 2026 at 10:15 pm

    I am required to break the links within \url{} to my references only after / or //, not after any other symbol that also might occur in a link. How do I implement this properly for all the links to my references at once? Have I just missed an option of the hyperref package or the \url{} command, or could an input to Forcing linebreaks in \url solve the problem? I have prepared a MWE to illustrate the problem: \documentclass{article} \usepackage[hidelinks]{hyperref} \begin{document} {\raggedright \begin{thebibliography}{} \bibitem[Reference 1]{reference1} Available at \url{https://tex.stackexchange.com/one/two-three/four_five_six} \bibitem[Reference 2]{reference2} Available at \url{https://tex.stackexchange.com/seven-eight-nine/ten_eleven/twelve} \end{thebibliography} } \end{document}

  • Problem with \textwidth wide subfigure array in JaCOW template (twocolumn environment)
    by WolfiG on March 30, 2026 at 1:28 pm

    The following LaTeX code: % % !BIB TS-program = biber % !BIB program = biber % !TeX spellcheck = en_US % !TeX program = lualatex % % support document for version: v 3.00 Feb 2026 Volker RW Schaa % % \documentclass[luatex]{jacow} \usepackage[english]{babel} \usepackage{subcaption} \usepackage{lipsum} \listfiles \begin{document} \title{My title} \author[1]{author 1} \author[1]{author 2} \affil[1]{affiliation 1} \maketitle \begin{abstract} The abstract should summarize the context, content and conclusions of the paper in less than 200 words. It should be written in the present tense and refer to the work described in the paper. The abstract should be self-contained, without abbreviations, footnotes, or references. It should be formatted as a single paragraph. \end{abstract} \section{Section I} \begin{figure}[htb] \centering \begin{minipage}{0.99\textwidth} \begin{subfigure}{0.49\textwidth}{\centering\includegraphics[width=\textwidth]{example-image-a}}\end{subfigure} \begin{subfigure}{0.49\textwidth}{\centering\includegraphics[width=\textwidth]{example-image-b}}\end{subfigure} \vfill \begin{subfigure}{0.49\textwidth}{\centering\includegraphics[width=\textwidth]{example-image-c}}\end{subfigure} \begin{subfigure}{0.49\textwidth}{\centering\includegraphics[width=\textwidth]{example-image-a}}\end{subfigure} \caption{Another caption.} \label{fig:HITRAP} \end{minipage} \end{figure} \lipsum[1-3] \end{document} Produces this output: Obviously, the text behind/in front of the figure is wrong. How can I make the text correctly surround the figure with the four subfigures and caption? If a solution does not use a minipage environment, this is fine with me.

  • Automate uncovering of an align in beamer with line numbers adapting
    by scottkosty on March 30, 2026 at 12:35 pm

    I'm currently using Automate *alert*-uncovering of lines of an align in beamer to uncover (and alert) lines of an align environment one line at a time. I'm also using An alt fill-in-the-blank with question in the middle to reveal some text on a subsequent overlay. When combining these two approaches, I want the line number to be shown on the first overlay that contains that line. Currently, it is revealed on the last overlay of that line. Here is my example code: \documentclass{beamer} \usepackage{mathtools} \usepackage{amstext} \usepackage{amsthm} \beamerdefaultoverlayspecification{<alert@+|+->} % https://tex.stackexchange.com/questions/661230/automate-alert-uncovering-of-lines-of-an-align-in-beamer % https://tex.stackexchange.com/questions/611375/automate-uncovering-of-lines-of-an-align-in-beamer \ExplSyntaxOn % mode should be \makeatother by default. % \makeatother \cs_new_eq:NN \_overlayalign_orig_align: \align \cs_new_eq:NN \end_overlayalign_orig_align: \endalign \exp_after:wN \cs_new_eq:NN \exp_after:wN \_overlayalign_orig_starred_align: \cs:w align* \cs_end: \cs_new_eq:NN \end_overlayalign_orig_starred_align: \endalign \seq_new:N \l__overlayalign_linesin_seq \seq_new:N \l__overlayalign_linesout_seq \seq_new:N \l__overlayalign_onelinein_seq \seq_new:N \l__overlayalign_onelineout_seq \cs_new:Npn \overlayalign_add_alert_to_cells:n #1 { \seq_set_split:Nnn \l__overlayalign_linesin_seq { \\ } { #1 } \seq_map_inline:Nn \l__overlayalign_linesin_seq { \seq_clear:N \l__overlayalign_onelineout_seq \seq_set_split:Nnn \l__overlayalign_onelinein_seq { & } { ##1 } \seq_map_indexed_inline:Nn \l__overlayalign_onelinein_seq { \int_compare:nNnTF { ####1 } = { 1 } { \seq_put_right:Nn \l__overlayalign_onelineout_seq { \action<+-|alert@+> { ####2 } } } { \seq_put_right:Nn \l__overlayalign_onelineout_seq { \action<.-|alert@.> { ####2 } } } } \seq_put_right:Nx \l__overlayalign_linesout_seq { \seq_use:Nnnn \l__overlayalign_onelineout_seq { & } { & } { & } } } } \newenvironment{overlayalign}{ \RenewDocumentEnvironment{align}{+b} { \exp_after:wN \cs_set_nopar:Npn \cs:w tagform@ \cs_end: ####1 { \cs:w maketag@@@ \cs_end: { \action<.-|alert@.> { ( \ignorespaces ####1 \unskip \cs:w @@italiccorr \cs_end: ) } } } \overlayalign_add_alert_to_cells:n { ##1 } \begin{_overlayalign_orig_align:} \seq_use:Nnnn \l__overlayalign_linesout_seq { \\ } { \\ } { \\ } \end{_overlayalign_orig_align:} } { } \RenewDocumentEnvironment{align*}{+b} { \overlayalign_add_alert_to_cells:n { ##1 } \begin{_overlayalign_orig_starred_align:} \seq_use:Nnnn \l__overlayalign_linesout_seq { \\ } { \\ } { \\ } \end{_overlayalign_orig_starred_align:} } { } }{ } \ExplSyntaxOff % Source - https://tex.stackexchange.com/a/682151 % Posted by samcarter_is_at_topanswers.xyz, modified by community. See post 'Timeline' for change history % Retrieved 2026-03-30, License - CC BY-SA 4.0 \newlength{\gapwidth} \makeatletter \newcommand{\doblankQ}[1]{% \ifmmode \if@display \settowidth{\gapwidth}{$\displaystyle #1$}% \else \settowidth{\gapwidth}{$#1$}% \fi \else \settowidth{\gapwidth}{#1}% \fi \alert<.(1)>{% \alt<+->{% #1% }{% \vphantom{#1}\smash{\underline{\makebox[\gapwidth]{?}}}% }% }% } \makeatother \begin{document} \begin{frame} \begin{overlayalign} \begin{align} 4(2 + 8) & = 4(2) + 4(\doblankQ{8})\\ x(a + b) & = x(a) + x(b)\\ 4(2 + 8) & = 4(2) + 4(\doblankQ{8}). \end{align} \end{overlayalign} \end{frame} \end{document} It produces the following output. For both lines 1 and 3, I would like the line numbers to be shown one overlay earlier (i.e., when the question mark on that line is shown).

  • Fullpage vs geometry
    by Sebastiano on March 30, 2026 at 12:33 pm

    I am trying to understand the differences between the fullpage package (e.g. \usepackage[cm]{fullpage}) and the geometry package for setting page margins. From what I see, both seem to adjust margins, but I am not sure: In which situations is it appropriate to use fullpage? When should I prefer geometry instead? Are there any limitations or drawbacks of fullpage compared to geometry? Is one of them considered best practice today? For example, is there any reason to write: \usepackage[cm]{fullpage} instead of: \usepackage[a4paper, margin=2cm]{geometry} I would appreciate a clear explanation of the differences and recommendations for typical use cases.

  • Issue with kashida inside underline
    by Salim Bou on March 30, 2026 at 11:21 am

    This example of arabic text (babel with lualatex engine) does not give the desired result, text inside \underline with kashida activated displays an incorrect result. Used font Noto Naskh Arabic. \documentclass{article} \usepackage[bidi=basic]{babel} \babelprovide[import=ar, main, justification = kashida, transforms = kashida.base] {arabic} \babelfont{rm}{Noto Naskh Arabic} \begin{document} \large\bfseries \makebox[4cm][s]{سلام} \underline{\makebox[4cm][s]{سلام}} \end{document}

  • Fonts missing Italics in Arabic
    by Knudsen on March 29, 2026 at 7:32 pm

    If one produces a bibliography containing entries in Arabic, you are bound to have to use slanted text, no matter how rare this is in Arabic. Producing it in "Amiri", by Khaled Hosny, yields a text that has titles in slanted text just fine: But producing it either in Arial or Noto leaves the slanted text out and Arial is even missing a character: as one can see in this short MWE: \documentclass{article} \begin{filecontents}[overwrite]{arabic.bib} @book{Guillemin-Pollack:Persian, author = {Guillemin, Victor and Pollack, Alan}, title = {\foreignlanguage{arabic}{ﺕﻮﭘﻮﻟﻭﮋﯾ ﺪﯿﻓﺭﺎﻨﺴﯿﻟ ﻢﻗﺪﻣﺎﺘﯾ}}, publisher = {\foreignlanguage{arabic}{ﺱﺎﺤﻟ ﺎﻧﺪﯿﺸﻫ ﺖﻫﺭﺎﻧ }}, note = {\foreignlanguage{arabic}{ﺕﺮﺠﻤﻫ: ﻢﻫﺪﻳ ﻦﺠﻔﻳ ﺥﻭﺎﻫ}}, year = {2006}, pages = {108}, } @book { promenade:ar, AUTHOR = {Ghys, Étienne}, title = {\foreignlanguage{arabic}{ﻥﺯ ﻩﺓ ﺓﺭﺎﻴﻀﻳﺎﺘﻳ}}, note = {\foreignlanguage{arabic}{ﺕﺮﺠﻣﺓ: ﺢﻣﺯﺓ ﺦﻠﻴﻓ}}, PUBLISHER = {ENS Éditions}, address = {Lyon}, YEAR = {2023}, PAGES = {318}, } @book{polya-ar, author = {Pólya, George}, title = {\foreignlanguage{arabic}{ﻚﻴﻓ ﺖﺤﻟ ﻢﺳﺎٔﻟﺓ ﺮﻳﺎﻀﻳﺓ : ﻢﻨﺣﻯ ﺝﺪﻳﺩ ﻒﻳ ﺎﻠﻃﺮﻴﻗﺓ ﺎﻟﺮﻳﺎﻀﻳﺓ }}, publisher = {\foreignlanguage{arabic}{ﺎﻠﻤﻨﻈﻣﺓ ﺎﻠﻋﺮﺒﻳﺓ ﻞﻠﺗﺮﺠﻣﺓ،}}, address = {\foreignlanguage{arabic}{ ﺐﻳﺭﻮﺗ، ﻞﺒﻧﺎﻧ}}, date = {2016}, } \end{filecontents} \usepackage{fontspec} \usepackage{csquotes} \usepackage[english, bidi=basic-r]{babel} \babelprovide[import=ar, mapdigits, language=Default]{arabic} \babelfont{rm}{Times New Roman} % Default font for LTR \babelfont[arabic]{rm}{Arial} % No italic, missing a character %\babelfont[arabic]{rm}{Noto Naskh Arabic} % No italic %\babelfont[arabic]{rm}{Amiri} % Has upright and slanted \usepackage[backend=biber, style=authoryear, autolang=other, url=false, isbn=false, language=auto]{biblatex} \addbibresource{arabic.bib} \begin{document} \nocite{*} \printbibliography \end{document} Is italics missing in two widely distributed fonts, by design, or something wrong with this LaTeX set-up? Same for the missing character in Arial? Obs: Traditional italics are rare in Arabic, and "slanted" Arabic is almost entirely a modern, Western-influenced invention. Arial and Arial Italic are distributed with Windows and MacOS. For Unix one can install it using sudo apt install ttf-mscorefonts-installer. NoTO is OpenSource and distributed by Google.

  • What is a better approach to plot the double path style as a subpath?
    by Explorer on March 29, 2026 at 3:03 am

    I want to replicate something as below: Now is my code, but good with the conjunction (the double path's start and end, and the glitch of double), even with line join=round: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[line join=round] \coordinate (start) at (0,1.5); \coordinate (end) at (0,0); \draw[magenta] (start) -- ++(3,0) coordinate (doublestart) ++(-.5,-1.5) coordinate (doubleend) -- (end); \draw[cyan,double,double distance=2.5pt] (doublestart) .. controls ++(.25,-.75) and ++(-.3,1) .. (doubleend) ; \end{tikzpicture} \end{document}