• How to refer the total chapter number and current chapter number in `shipout/background`?
    by Explorer on March 26, 2026 at 9:13 am

    I want something decorative layout like this, where the magenta node indicated the current chapter(just for example): I have the following code now: \documentclass[12pt,oneside,openany]{book} \usepackage{libertine} \usepackage{lipsum} \usepackage{tikz,tikzpagenodes} \usetikzlibrary{matrix} \pagestyle{empty} \usepackage[showframe]{geometry} \usepackage{totcount} \regtotcounter{chapter} \ExplSyntaxOn \tl_new:N \l_matrix_content_tl \int_step_inline:nn {10} { \ifnum #1=4\relax%<-just for example \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} \fi \tl_put_right:Nn \l_matrix_content_tl {#1\\} } % I want something like this.. but not work % \int_step_inline:nn {\total{chapter}} { % \ifnum #1=\thechapter\relax % \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} % \fi % \tl_put_right:Nn \l_matrix_content_tl {#1\\} % } \AddToHook{shipout/background}{ \put (0pt,-\paperheight) {% \begin{tikzpicture}[% overlay,remember~picture, ]% % \node[draw,anchor=west,font=\sffamily\bfseries\Huge] at (current page marginpar area.west) {\thechapter/\total{chapter}}; \matrix[ anchor=east, matrix~of~nodes, nodes={draw, align=center,fill=cyan, minimum~size=1.2cm,font=\sffamily\bfseries\Huge}, row~sep=.75cm, column~sep=0mm, inner~sep=0pt, outer~sep=0pt, ] (m) at (current~page.east){% \l_matrix_content_tl }; \end{tikzpicture}% }% } \ExplSyntaxOff \begin{document} \chapter{First Chapter} \lipsum[1-10] \chapter{Second Chapter} \lipsum[1-10] \chapter{Third Chapter} \lipsum[1-10] \end{document} I want to construct the \l_matrix_content_tl with: \int_step_inline:nn {\total{chapter}} { \ifnum #1=\thechapter\relax \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} \fi \tl_put_right:Nn \l_matrix_content_tl {#1\\} } which complain that: ! Missing number, treated as zero. <to be read again> \def l.24 } ? I guess that \total{chapter} could be empty within the first run, but I have no idea of when and where(or how to delay) to construct the token list?

  • How to complete a full TeX Live installation in the sharelatex container of Overleaf Community Edition?
    by RDiezDiaz on March 26, 2026 at 8:05 am

    Once I access the sharelatex container using bin/shell from the overleaf-toolkit folder, I start a new full installation of the latest TeX Live version in the usual way without using tlmgr install scheme-full, because it does not work. After it finishes, I'm not sure what exactly needs to be done so that the web app can compile my documents. I've tried running tlmgr path add, but it doesn't change the version shown by tlmgr --version. If I export the PATH variable directly inside the container, the version does change, but my documents still won't compile after committing the changes with docker and updating config/version. Does anyone know what actually needs to be done? Thank you.

  • Incompatibilities bewteen xfrac and lua-unicode-math
    by PHL on March 26, 2026 at 7:25 am

    The following MWE gives 3 warnings Font shape in size <3.486> not available with lua-unicode-math, but none with unicode-math % !TEX TS-program = lualatex \documentclass{article} \usepackage{xfrac}% \sfrac for a/b fractions \usepackage{lua-unicode-math} %\usepackage{unicode-math} \begin{document} \(\sfrac{4}{5}\) \end{document} It is unclear to me if the fix should be on the xfrac side or on the lua-unicode-side. The three warnings are for OT1/cmr/m/n, OML/cmm/m/it and OMS/cmsy/m/n. Changing the separator (as in \sfrac{4}[L]{5}) does not remove the warnings.

  • How to make good use of `tikz-ext.paths.ortho` library to make four-segmented arrow?
    by Explorer on March 26, 2026 at 6:06 am

    The code used the powerful tikz-ext package from Qrrbrbirlbel: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{ext.paths.ortho} \begin{document} \begin{tikzpicture} \node[draw,fill=cyan] (Root) {Root}; \node[draw,fill=magenta] at (-1,-1) (nodeA) {NodeA}; \node[draw,fill=magenta] at (1,-1) (nodeB) {NodeB}; \node[draw,fill=teal] at (3,-1) (nodeC) {NodeC}; \draw[-latex] (Root) |-| (nodeA); \draw[-latex] (Root) |-| (nodeB); \coordinate (aux) at (2,-.75);% I don't want the aux here, `-0.75' is not always easy to determine \draw[-latex,magenta,thick] (Root) |-| (aux) |- (nodeC); \end{tikzpicture} \end{document} which gives: The actual desired result is something like: My code's problem is that, in the actual case, that is not always easy to know exactly the coordinate of aux, says (2,-.75). I wonder whether some extension or patch to plot the FOUR segmented arrow what I want elegantly?

  • Defining list of commands using \foreach
    by Lorenzo Riva on March 25, 2026 at 11:02 pm

    I want to use a \foreach loop to define a series of commands of the form \bf\l where \l runs through the uppercase letters of the alphabet and \bf\l evaluates to \mathbf{\l}. This is so that I don't have to manually define \bfA, \bfB, etcetera at the start of all my documents. I've tried the following setup (patched together from Defining a newcommand, with variable name, inside another newcommand): \documentclass{article} \usepackage{amsmath,pgffor} \foreach \l in {A,B,C,D} { \expandafter\newcommand\csname bf\l\endcsname{ \mathbf{\l}% } } \begin{document} $\bfA$ $\bfB$ $\bfC$ $\bfD$ \end{document} It resulted in four errors, namely that the four commands are undefined. Where am I going wrong, and why does this not work?

  • How to Vertically Stretch Arched Words
    by Jethro on March 25, 2026 at 10:52 pm

    MWE: \documentclass[12pt]{book} \usepackage{tikz,xcolor,scalefnt,scalerel} \usetikzlibrary{decorations.text} \begin{document} \thispagestyle{empty} {\Huge{\scalefont{1.25}{ \begin{tikzpicture} \path[-latex,white!30!black,postaction={decorate},decoration={text along path,text={HOW TO ADD A VERTICAL STRETCH?},text color={black},text align=center}] (7,0) arc [start angle=180,end angle=0,radius=7]; \end{tikzpicture}}}} \end{document} which produces: How may I add a vertical stretch to the letters? I have called in the scalerel package and tried placing \vstretch{}{} at various places in the code, but to no avail. It is necessary that I compile the code with xelatex.

  • Custom glyph mappings for unicode-math
    by Gargantuar on March 25, 2026 at 10:35 pm

    Latin Modern Math doesn't provide a symbol for \lParen (a double left parenthesis) from unicode-math. Instead of choosing another font, I'd rather want to define a custom symbol, namely (\!( for \lParen (or \big(\!\!\big( for \big\lParen and so on). How do I do this so that \lParen is scalable with \big, ..., \left, and will unicode-math correctly map it to unicode? (I know how to emulate this with \DeclarePairedDelimiterX and the like, but these are not exactly glyphs that can be mapped to a unicode character.) On the other hand, I want to define something like \longtwoheadrightarrow, which is not defined by unicode-math: \newcommand{\longtwoheadrightarrow}{\relbar\joinrel\twoheadrightarrow} Of course, this symbol isn't defined in unicode, but will this be mapped to the closest corresponding symbol, namely the normal "Rightwards Two Headed Arrow" ↠ (U+21A0)? Even more difficult, how can I map \newcommand{\longhookrightarrow}{\lhook\joinrel\longrightarrow} to the unicode character "Rightwards Arrow with Hook" ↪ (U+21AA)? There are a lot of similar long versions of arrows I'd like to define. Edit: some sort of exposition: \documentclass{article} \usepackage{mathtools} \usepackage{unicode-math} \DeclarePairedDelimiter{\dParen}{\lparen}{\rparen} \reDeclarePairedDelimiterInnerWrapper{\dParen}{nostarnonscaled} {\mathopen{#1\!#1} #2 \mathclose{#3\!#3}} \reDeclarePairedDelimiterInnerWrapper{\dParen}{nostarscaled} {\mathopen{#1\!#1} #2 \mathclose{#3\!#3}} \reDeclarePairedDelimiterInnerWrapper{\dParen}{star} {\mathopen{} \mathclose{#1 \!\! {#1 #2\aftergroup} #3\aftergroup} \!\! #3} \newcommand{\lParen}{(\!(} \newcommand{\rParen}{)\!)} \newcommand{\longtwoheadrightarrow}{\relbar\joinrel\twoheadrightarrow} \newcommand{\longhookrightarrow}{\lhook\joinrel\longrightarrow} \begin{document} \[\sin\dParen*{\sin\dParen[\Bigg]{\sin\dParen[\bigg]{\sin\dParen[\Big]{\sin\dParen[\big]{\sin\dParen{a}}}}}}\] \[A \longtwoheadrightarrow B\] % copies as 𝐴 −↠ 𝐵 \[A \longhookrightarrow B\] % copies as 𝐴 ,⟶ 𝐵 \end{document}

  • Nesting decorations in TikZ disconnects subpath
    by Sandy G on March 25, 2026 at 9:49 pm

    The decorations in the decorations.fractals library can be used to create fractal lines by applying the decoration repeatedly to an originally straight path. (This can be done with decorations from other libraries as well.) For example, the code \begin{tikzpicture}[decoration=Koch snowflake] \draw decorate{decorate{decorate{(0,0)--(3,0)}}}; \end{tikzpicture} produces the expected result. When a decoration is applied to a subpath however, nesting the decoration produces a result I did not expect. Namely, the decorated subpath appears to be disconnected from the path as a whole. Consider the following image: which is produced by the code below. A single iteration of the decoration produces a closed path (orange) as expected. But when the decoration is nested (blue) the --cycle does not close the whole path, only the portion beginning with the decoration. If you look closely, you can see that the first segment of the path is not connected to the decorated portion. What is the reason for this behavior? Note the partial fix in purple does not solve the problem (unless one only wanted to fill the path without drawing it) but it does show that the --cycle is not the problem—the issue is the missing connection between the initial segment and the decorated segment. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \begin{document} \begin{tikzpicture}[decoration=Koch snowflake] \draw[help lines] (0,0) grid (5,3); \draw[orange, very thick] (1,0)--(0,0) decorate{--(0,3)}--cycle; \draw[blue, very thick] (3,0)--(2,0) decorate{decorate{--(2,3)}}--cycle; \draw[purple, very thick] (5,0)coordinate(A)--(4,0) decorate{decorate{--(4,3)}}--(A); \end{tikzpicture} \end{document}

  • List of all Latin Modern Math symbols
    by Gargantuar on March 25, 2026 at 9:01 pm

    I'm trying my documents more accessible by using unicode-math. Conveniently, the default font Latin Modern Math provides many symbols, and I think much more than amssymb, but stuff like \lParen or \rParen are missing. Is there a list of all Latin Modern Math symbols, similar to PDFs like for stix2, amssymb, yhmath, etc.?

  • Gray vector appears with fading in TikZ
    by Sebastiano on March 25, 2026 at 8:33 pm

    In TikZ, for my previous answer here: Circular Motion when I use the fading library to create a vector with a fading effect, a smaller gray vector appears inside the main vector. Why does this happen, and is there a way to prevent the inner gray vector from being visible? \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usetikzlibrary{arrows.meta, decorations.markings} \usetikzlibrary{fadings} \usepackage{newtxmath} \definecolor{myblue}{RGB}{0, 119, 200} \definecolor{mygreen}{RGB}{27, 175, 78} \definecolor{myorange}{RGB}{245, 130, 32} \begin{document} \begin{center} \begin{tikzpicture}[ vvec/.style={mygreen, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, avec/.style={myorange, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, dot/.style={circle, fill=black, inner sep=0pt, minimum size=7pt} ] \def\R{2.5} \def\V{2.8} \def\A{1.2} \draw[myblue, line width=1.2pt, decoration={markings, mark=at position 0.0833 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.4167 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.75 with {\arrow{Latex[length=3mm, width=2.5mm]}} }, postaction={decorate}] (0,0) circle (\R); \draw[gray!20, line width=4mm, -{Latex[length=7mm, width=8mm]}, path fading=north] (155:\R+0.8) arc (155:205:\R+0.8); \node at (180:\R+1.5) {\Large $\boldsymbol{\omega}$}; \node[dot] (P1) at (90:\R) {}; \draw[vvec] (P1) -- ++(180:\V) node[midway, above=2pt] {\Large $\vec{v}$}; \draw[avec] (P1) -- ++(270:\A) node[midway, right=2pt] {\Large $\vec{a}$}; \node[dot] (P2) at (210:\R) {}; \draw[vvec] (P2) -- ++(300:\V) node[midway, below left=2pt] {\Large $\vec{v}$}; \draw[avec] (P2) -- ++(30:\A) node[midway, below right=2pt] {\Large $\vec{a}$}; \node[dot] (P3) at (330:\R) {}; \draw[vvec] (P3) -- ++(60:\V) node[midway, below right=2pt] {\Large $\vec{v}$}; \draw[avec] (P3) -- ++(150:\A) node[midway, below=2pt] {\Large $\vec{a}$}; \end{tikzpicture} \end{center} \end{document}

  • Online tool to write LaTeX formulas on a non-editable PDF
    by Sebastiano on March 25, 2026 at 8:26 pm

    Suppose I have a PDF containing Math or Physics exercises, but it is not editable. I would like to know if there is an online tool or web service that allows me to: Upload the PDF. Preview the pages. Write LaTeX formulas directly on top of the PDF (for example, as annotations or overlays). Basically, I am looking for a way to add formulas written in LaTeX to the original PDF without having to recreate the entire document from scratch. Are there any tools like this available? Addendum: After my question I have found PDF Annotator but it is not free.

  • longtable cell is not expanded when using multirow
    by Snowrabbit on March 25, 2026 at 5:52 pm

    I like to use longtable because table will be long and span several pages. But I have a problem using multirow in the longtable, the cell is not expanded vertically. How to use multirow correctly in a longtable? Can someone explain in simple terms why the cell doesn't expand? If you have any suggestions for improvements to the code, I would be grateful 🙂 \documentclass{article} \usepackage{longtable} \usepackage{multirow} \usepackage{multicol} \usepackage{lipsum} \usepackage[table]{xcolor} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \begin{document} \begin{longtable}[c]{|L{1cm}|L{3cm}|L{1cm}|L{7cm}|} \caption{Long table with multirow} \label{tab:long table with multirow}\\ \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endfirsthead \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endhead 1 & Name 1 & 42 & \multirow[t]{3}{=}{\lipsum[1]} \\ 2 & Name 2 & & \\ 3 & Name 3 & & \\ \hline \end{longtable} \end{document} This is what I get: This is the desired result: I apologize if the question has already been answered elsewhere and please provide a reference.

  • sourcesanspro and siunitx conflict
    by Paul on March 25, 2026 at 2:20 pm

    I'm using sourcesanspro as my default text font to write my thesis (with fourier for the math mode), along with siunitx to deal with number and units printing. Everything was working just fine until I decided to update all of my packages with miktex and especially the sourcesans package. The error I got is : ! Use of ??? doesn't match its definition. ??? ! LaTeX Error: Erroneous variable \l__siunitx_print_version... l.27 ...mathrm{l} \left[\unit{\ohm\per\kilo\meter} \right] \cdot x \left[\un... If you say, e.g., \def\a1{...}', then you must always put 1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. This error happen for every siunitx command (\qty, \unit, \num) used in math mode. Outside of math mode (in text mode), it seems to be ok. Here is a MWE : \documentclass[12pt]{article} \usepackage[utf8]{inputenc}\usepackage[T1]{fontenc} \usepackage[default]{sourcesans} % Police Source Sans \usepackage{amsmath,mathtools,amssymb,amsthm,amsfonts,bm,siunitx,commath,xfrac} % Math Presets \sisetup{detect-family=true, detect-mode=true, detect-weight=true, detect-shape=true} %police pour siunitx \begin{document} $\unit{\ohm\per\kilo\meter}$ \unit{\ohm\per\kilo\meter} \qty{90}{\kilo\volt} \end{document} I reported this bug to the sourcesans package git hub (https://github.com/silkeh/latex-sourcesanspro/issues/10#issue-4128078876) and still waiting for a response. What should I do ? Should I try to manually roll back the update ? How should i do that ? Thanks for your help

  • ltx-talk: \visible command not working as I expected
    by Svend Tveskæg on March 25, 2026 at 12:50 pm

    Consider the following (almost?) MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{ltx-talk} \usepackage{fontspec} \usepackage{pstricks} \begin{document} \begin{frame}{\visible<1->{Exercise}} \begin{enumerate} \item \visible<2->{A} \visible<3->{B} \visible<4->{% \begin{center} \begin{pspicture}(8,2) \psframe(8,2) \end{pspicture} \end{center}}% \end{enumerate} \end{frame} \end{document} Do to the order of the visible<n->{} commands, I expected the PSTricks drawing to not show up before the 4th slide but it is drawn right from the beginning. Question How do I fix the above-mentioned "issue"? Thanks in advance.

  • The order of \pgfkeys always mattered in tikz's option?
    by Explorer on March 25, 2026 at 12:11 pm

    I have the following code example: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \draw[->,>=latex] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \draw[>=latex,->] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,below=of tmp,node distance=.5cm] {below}; \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,node distance=.5cm,below=of tmp] {below}; \end{tikzpicture} \end{document} Which gives the following: What I get confused is that: ->,>=latex and >=latex,-> behaves the same below=of tmp,node distance=.5cm honer the default value node distance=1cm, and node distance=.5cm,below=of tmp honer the previous node distance=.5cm Why caused the difference between >= and node distance? How to know whether an option's order is important with \pgfkeys? Edited: As jps commented: Keys are generally ordered as key code is executed in the order given. Whether the order of keys then matters strongly depends on the key code. The way to know whether an option's order matters is to either know the implementation by heart, or trial and error and Jasper Habicht supplemented that: Some keys only store a value in a macro that is later retrieved (which is true for the arrow settings, for example). The values stored in the macros are only retrieved when the arrows is drawn, that is at the end of the path. But other keys actually use values that are stored in macros and if these values are set my other keys, the order is relevant. But as was said above: You really need to know how the implementation is exactly to know whether the first or the second holds in a specific case. Here below is my follow-up doubt: In my understanding, "TikZ keys are applied in the order they are given", so is the following always safer (avoid the unexpected behavior of below=of tmp,node distance=.5cm)? >=latex,->: define the arrow style at first, then set the arrow node distance=.5cm,below=of tmp: set the distance at first, then apply the position

  • NVDA screen reader with MathML not working properly
    by Tricia Bevans on March 25, 2026 at 6:58 am

    I'm taking first steps to make accessible math pdf documents. I have used a simple template for a very basic document that compiles properly with luaLatex using the tool here:https://latex3.github.io/tagging-project/documentation/wtpdf/small-example but I want to listen to how it's read by a screen reader. I've downloaded NVDA and the MathCat add-on but nothing seems to read properly like it does in these demo videos: https://latex3.github.io/tagging-project/documentation/wtpdf/fulldoc I've tried to use the actual document from the videos as well to know I was using a document that was tagged properly but it still doesn't read things clearly as it's supposed to. I've tried in Adobe and Foxit. What am I missing? I'll be so grateful for any support I can get. I'm not very sophisticated in any aspect of this process so the simpler the explanations the better.

  • Mix and match lowercase letters from different mathematical fonts
    by Yi Wang on March 25, 2026 at 4:17 am

    I'm currently using the unicode-math package and I want to mix lowercase characters from different mathematical fonts. For example, lowercase Latin letters $x$ from XITSMath-Regular.otf and $u,v,w$ from NewCMM-Book.otf. I know that using setmathfont to replace all lowercase Latin letters works, but it doesn't work when I want to replace a single Latin letter. I used Gemini's solution, employing the range parameter of the \setmathfont command to replace individual letters, but this did not work; the lowercase letters I attempted to replace still displayed the NewCMMath font. \documentclass{article} \usepackage{unicode-math} % --- Font Configuration Start --- % 1. Set the main math font (New Computer Modern Book) \setmathfont{NewCMMath-Book.otf} % 2. Map all lowercase Latin letters to XITS Math % This covers a-z in italic (math) mode as the baseline for your request \setmathfont{XITSMath-Regular.otf}[ range=it/{latin-lowercase}, Scale=MatchUppercase ] % 3. Bring back u, v, w from NewCMMath-Book % (Hex: u="75, v="76, w="77) \setmathfont{NewCMMath-Book.otf}[ range={it/"75, it/"76, it/"77}, Scale=MatchUppercase ] % 4. Set f from Erewhon-Math % (Hex: f="66) \setmathfont{Erewhon-Math.otf}[ range=it/"66, Scale=MatchUppercase ] % 5. Set x from XITS Math % (Included in step 2, but isolated here for clarity and specific scaling) \setmathfont{XITSMath-Regular.otf}[ range=it/"78, Scale=MatchUppercase ] % --- Font Configuration End --- \begin{document} \section*{Math Font Mixing Test} The glyphs in the formula below are pulled from different fonts as requested: \begin{itemize} \item $f$: Erewhon-Math (distinctive hook/curve) \item $x$: XITS Math (Times-style) \item $u, v, w$: NewCMMath-Book (Computer Modern style) \item $a, b, c, y, z$: XITS Math \end{itemize} \[ f(x, u, v, w) = a + b + c + y + z \] \[ \int_{u}^{v} f(t) \, dt = \sqrt{x^2 + w^2} \] \end{document}

  • Writing environment contents verbatim to a file and also keeping them inline
    by seanmk on March 25, 2026 at 12:31 am

    I would like to create an environment where the contents are both parsed as LaTeX and also written verbatim to a file. The reason is that I want to create a Jupyter-notebook-style environment where some code can be included in a listings-type environment and then the result of compiling and running that code is included after the code itself. I can write the contents verbatim to a file using VerbatimOut from fancyvrb: \newenvironment{mylisting}{% \VerbatimOut{myfile.c}% }{% \endVerbatimOut } I also can include the contents of that file using \lstinputlisting{myfile.c} after, but this does not end up being parsed the same way as including it inline. Specifically, escaping \labels for later \refs does not work when I use \lstinputlisting{myfile.c}. It seems like there should be a way to copy the contents of the environment into some kind of buffer to use twice, but I haven't been able to figure it out. Any help is appreciated!

  • Help cant compile chemformula, compiler is hanging
    by Felipe9 on March 24, 2026 at 9:37 pm

    When i try to compile with the line \ch{2 Fe2O3} uncommented, the compiler just hangs, never finishing, i dont get any errors MWE: \documentclass{article} \usepackage{chemmacros} \chemsetup[phases]{pos=sub} \begin{document} \ch{Fe2O3\sld{} + CO\gas{} <> Fe\sld{} + CO2\gas{}} % \ch{2 Fe2O3} \end{document}

  • \end{twocolumn} doesn't work
    by Alex Degtyarev on March 24, 2026 at 8:58 pm

    How do I go from two columns back to a single one? Here is a simple example that no one seems to address in the documentation. \documentclass{amsart} \begin{document} \columnsep1cm \begin{twocolumn} Two column text two column text two column text two column text \newpage Two column text two column text two column text two column text \newpage \end{twocolumn} Now, by the whole idea of ``environment'', this is supposed to continue in a single column, isn't it? \newpage Nevertheless, it sucks! Enhancements like \verb+\usepackage{multicol}+ do not make an iota of difference. \end{document}

  • Refactor nested ifx statement
    by Thomas on March 24, 2026 at 4:53 pm

    I'm in a situation where I have nested ifx statements that check if a value equal to another in a list of values. It results in this nested code : \documentclass{article} \begin{document} \def\name{Charlie} \def\nameA{Alice} \def\nameB{Bob} \def\nameC{Charlie} \def\nameD{Denise} \ifx\name\nameA Hello Alice ! \else \ifx\name\nameB Bonjour Bob ! \else \ifx\name\nameC Holà Charlie ! \else \ifx\name\nameD Gutten Tag Denise \else I'm sorry, you are ? \fi \fi \fi \fi \end{document} Is there a way to write this code shortly ? In Python, I would used elif, and in C++ a switch statement.

  • Adjusting 'curviness' of edges in tkz-graph
    by Tarran M on March 24, 2026 at 3:05 pm

    I am trying to make this edge not overlap with node number 5, and I didn't find anywhere in the documentation that would let me increase the length of the edge itself so that it curves more steeply. Any help would be appreciated! This is what I have so far: \begin{tikzpicture} \Vertex{1} \WE(1){7} \NOWE(7){5} \SOWE(7){2} \NOWE(2){6} \NOEA(1){3} \SOEA(1){4} \Edge(1)(7) \Edge(2)(5) \Edge[style=bend left](5)(1) \Edge[style=bend left](5)(7) \Edge[style=bend right](5)(6) \Edge[style=bend right](6)(2) \Edge[style=bend left](7)(2) \Edge[style=bend left](1)(2) \Edge[style=bend left](1)(3) \Edge[style=bend left](3)(4) \Edge[style=bend left](4)(1) \tikzset{EdgeStyle/.style={in=90,out=90}} \Edge[style=bend right](6)(1) \end{tikzpicture} with the output

  • Chemfig: inconsistent `\chemmove` behavior
    by Clydinite on March 24, 2026 at 2:59 pm

    I am using chemfig to draw a reaction mechanism and \chemmove for electron flow. I've noticed a very strange behavior: when I draw arrows from/to other atoms, it works perfectly. However, when I use \draw (o1) .. controls +(180:0.5cm) .. (c1);, the arrow tip is significantly offset, no where near the intended carbon atom. I've already verified that the issue doesn't come from failure to compile twice. Here's the minimal reproducible example. \documentclass[border=10pt]{standalone} \usepackage{chemfig} \usepackage{tikz} \setchemfig{atom sep=7mm, bond offset=1.5pt, atom style={font=\small}} \newcommand{\chemneg}[2][45]{% \charge{#1:1pt=$\scriptscriptstyle-$}{#2}% } \begin{document} \schemestart \chemfig{*6(-(-NO_2)=-(-@{c1}C(=[2]O)-[:-30]O-CH_3)=-=)} \+ \chemfig{@{o1}\chemneg[90]{O}H} \arrow{->} \chemfig{*6(-(-NO_2)=-(-C(-[@{sb1}2]@{o2}\chemneg{O})(-[6]OH)-[@{sb2}:-30]@{o3}O-CH_3)=-=)} \arrow{->} \chemfig{*6(-(-NO_2)=-(-C(=[2]O)-[:-30]\chemneg{O})=-=)} \+ \chemfig{CH_3OH} \schemestop \chemmove[red, -stealth, shorten <= 2pt]{ \draw (o1) .. controls +(180:0.5cm) .. (c1); \draw (o2) .. controls +(180:0.5cm) .. (sb1); \draw (sb2) .. controls +(90:0.5cm) .. (o3); } \end{document}

  • Proper language / babel / document settings for Swiss Standard German
    by kalle on March 24, 2026 at 2:03 pm

    I would like to create a document following the Swiss Standard German variety, but I am getting incorrect quotation marks (I actually get question marks instead of quotation marks). What settings are recommended to fully support Swiss Standard German? MWE: \DocumentMetadata{ lang=de-CH, } \documentclass[nswissgerman]{report} \usepackage[nswissgerman,provide=*]{babel} \usepackage[german=swiss]{csquotes} \begin{document} \chapter{Einführung} \enquote{Dies ist ein Zitat, das besagt \enquote{sind Zitate nicht toll?}}, und doch wundere ich mich, ob es mit einer Gehaltserhöhung des Generalstabsvorstandsvorsitzenden klappen würde. \end{document}

  • Setting fixed text labels for enumerate-based environment according to the item counter
    by Stephen on March 24, 2026 at 12:47 pm

    \documentclass{article} \usepackage{enumitem} \newlist{syntax}{enumerate}{1} \renewcommand{\labelsyntaxi}{\bfseries\ifcase\value{syntaxi}\or Usage\or Argument\or Return\fi} \begin{document} \begin{syntax} \item aaa \item bbb \item ccc \end{syntax} \end{document} I've defined an enumerate-based environment (called syntax) and I want the first three labels are Usage, Argument and Return, respectively. However, the above code gives error. How to fix and what's the reason behind the error? Similar question: enumerate with custom alphabet for items

  • Vertical distance between description and enumerate env [duplicate]
    by Gudrun on March 24, 2026 at 11:48 am

    How to minimize the space between Workflow and the first item, please? Probably an easy question, but I was unable to figure it out myself. Many thanks for your help. \documentclass[a4paper]{article} \usepackage{enumitem} \begin{document} \begin{description}[style=nextline] \item[Tool:] Get a kitchen. \item[Workflow:]\leavevmode \begin{enumerate} \item Visit a location \item Pass the food into a processor \item Remove the solid pieces \item Enjoy \end{enumerate} \end{description} \end{document}

  • Index of topics at beginning of document
    by Martin on March 24, 2026 at 10:20 am

    I have a document, where I describe topics (one page per topic). I want to have a list of all topics together with some additional information at the beginning of the document. So far my solution is this: First I make a file whrere the list is at the end of the file. MWE (file called Themen.tex): \documentclass[a4paper,12pt]{scrartcl} \usepackage{longtable} \newcounter{nummer} \def\Uebersicht{% Nr. & Topic & A & Page \\\hline \endfirsthead Nr. & Topic & A & Page \\\hline \endhead } \usepackage{hyperref} \newcommand{\Thema}[3]{% \refstepcounter{nummer}\label{#3}% \begin{center} \LARGE #1 \end{center} \begin{table}[h!] \centering \begin{tabular}{p{4.3cm}p{1cm}p{11cm}} A: && #2 \end{tabular} \end{table} \hrule \appto\Uebersicht{\getrefnumber{#3} & #1 & #2 & \pageref{#3} \\} } \begin{document} \clearpage \Thema{A}{A}{A} \clearpage \Thema{B}{B}{B} \clearpage \Thema{C}{C}{C} \clearpage \Thema{D}{D}{D} \clearpage \clearpage \begin{longtable}[h!]{r|p{0.48\linewidth}|p{0.34\linewidth}|r} \centering \Uebersicht \end{longtable} \end{document} Afterwards, I rearrange the pages. MWE: \documentclass{scrartcl} \usepackage{pdfpages} \pdfximage{Themen.pdf}% Read entire PDF \edef\totalpages{\the\pdflastximagepages}% Store number of pages \edef\lastbutonepage{\number\numexpr\totalpages-1}% Store last page - 1 \begin{document} \includepdf[pages=last]{Themen} \includepdf[pages=1-\lastbutonepage]{Themen} \end{document} The problem is, that in the end, the cross-references to pages inside the document, as well as external links that I put in the description of the topics do not work. How can I achieve what I want with working links (either with my 2-file-solution or directly)?

  • Custom date format for copyright years in a BibLaTeX style: c-prefixed date without breaking sorting
    by Marlon de Col on March 23, 2026 at 9:55 pm

    I am writing a paper whose formatting rules for both citations and the bibliography require that the date of a reference, when it refers to the copyright year, be preceded by a lowercase "c" with no intervening space. Therefore, I would like to be able to assign the date field with the corresponding year preceded by the letter c by implementing a new date format, similar to formats such as <date>~, <date>?, etc., but restricted to accepting only the year. With this, the copyright year would be specified in the bib file as follows: date = {c<year>} Using the authoryear style from BibLaTeX as an example, the following MWE would apply: \documentclass{article} \usepackage[style=authoryear]{biblatex} \setlength{\parindent}{0pt} \begin{filecontents}{\jobname.bib} @article{aksin, author = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent and {\c{C}}etinkaya, Bekir and Ni, Chaoying and B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan}, title = {Effect of immobilization on catalytic characteristics of saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck} reactions}, journaltitle = {J.~Organomet. Chem.}, date = {c2006}, volume = 691, number = 13, pages = {3027-3036}, indextitle = {Effect of immobilization on catalytic characteristics}, } @article{glashow, author = {Glashow, Sheldon}, title = {Partial Symmetries of Weak Interactions}, journaltitle = {Nucl.~Phys.}, date = {c1961}, volume = 22, pages = {579-588}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \section{\citeauthor{aksin}} \verb|\cite{aksin}|: \cite{aksin}. \verb|\textcite{aksin}|: \textcite{aksin}. \section{\citeauthor{glashow}} \verb|\cite{glashow}|: \cite{glashow}. \verb|\textcite{glashow}|: \textcite{glashow}. \printbibliography \end{document} With this MWE, the desired output would be as follows: For reference, the document shown in this screenshot was compiled using the year field instead of date in the bib file; otherwise, the c<year> value is considered invalid and consequently ignored. However, in that case, sorting by year does not work. Given these requirements, is there a way to implement this? I have created a custom BibLaTeX style package with a few modifications that I use exclusively for this paper, so this would be implemented in the package files rather than in the document preamble.

  • evenly-padded horizontal line separator in a table with rows with graphics
    by Mampac on March 22, 2026 at 10:35 am

    when defining a figure that holds a table of images, how do i ensure even and symmetric padding when using \hline in it? by default, there's no padding before the row that was \hlined. i have the following MRE: \documentclass{article} \usepackage{array} \usepackage{graphicx} \newcolumntype{I}{>{\centering\arraybackslash}m{0.18\linewidth}} % simulate images \newcommand{\fakeimg}{\rule{\linewidth}{2.5cm}} \begin{document} \begin{tabular}{c I I I} & A & B & C \\ row1 & \fakeimg & \fakeimg & \fakeimg \\ \hline row2 & \fakeimg & \fakeimg & \fakeimg \\ \end{tabular} \end{document} this produces the following image, where the rule is stuck tightly to the images on the second row: how do i define the padding in a controlled (tunable) manner so that the optional rule perfectly divides it in half (i want to add the divider only between specific pairs of rows)? i've tried interjecting a bunch of artifical spaces and padding in the rows before/after, but they all break apart when i wish for a small-scale padding of, say, 0.3ex: my attemps yield assymetrical padding where the padding before second row is smaller than padding after the first row.

  • tikz, scaling widths of lines
    by Zarko on March 17, 2026 at 2:39 pm

    It seems (or is apparently) that thickness of lines is hard coded. Consequently when drawing a line, the use for example of scale=2 only makes the line longer and its thickness is not changed, see MWE below: \documentclass[margin=3mm, varwidth]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{LA/.style = {-Straight Barb, line width=1mm}} \begin{document} \begin{tikzpicture} \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \begin{tikzpicture}[scale=2] \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \end{document} Is there some trick by which the thickness of the line will also be scaled? The best way would be as option of the line style, which will have effect just on this particular line. My quick search on this site so far didn't give me any suggestion ...