• Why is the current page.center of a beamer page not making my image flush with the edges?
    by Jasper on May 12, 2026 at 2:29 am

    Why is the current page.center of a beamer page not making my image flush with the edges? Compile with lualatex: Learning from samcarter's solution, the code below is okay to put the image: \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame}[plain] \begin{tikzpicture}[remember picture,overlay] \node[at=(current page.center)] { \includegraphics[width=\paperwidth, height=\paperheight]{example-image} }; \end{tikzpicture} \end{frame} \end{document} However, if put inside animateinline, as below: \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} { \setbeamertemplate{navigation symbols}{} \begin{frame}[plain] \begin{animateinline}[autoplay,loop]{10}% % Credit to @Explorer's comment: \begin{tikzpicture}[remember picture,overlay] \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline} \end{frame} } \end{document} The code complained that: ! Package animate Error: Content of first frame must not have zero width. See the animate package documentation for explanation. Type H <return> for immediate help. ... l.20 \end{frame} ? In regard to the comment about https://tex.stackexchange.com/a/656219/319072, the following MWE still is not flush. \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} \AtBeginShipoutNext{% \AtBeginShipoutUpperLeft{% \unitlength=\paperheight% \put(0,-1){% \begin{animateinline}[autoplay,loop]{10}% \begin{tikzpicture} \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline}% }% }% }% { \setbeamertemplate{navigation symbols}{} \begin{frame} \end{frame} } \end{document}

  • Multilingual document: switch main language in order to switch layout within a document
    by ncdipde on May 11, 2026 at 8:27 pm

    I am writing a document whose main language is French. A whole section is in English \section{Abstract} And then other sections are in French \section{Résumé} \section{Méthodes} etc. I would like the English section to respect English typographic rules (note only punctuation or quotes) and other sections in French to respect French typographic rules. Writing \selectlanguage{english} or using otherlanguage environment only change the locale language which changes how quotes render for example, but it does not change first paragraph indentation nor the \labelitemi Is it possible to switch the main language for a whole section ? Thereafter a minimal example: \documentclass[paperletter, 12pt, english, french]{article} \usepackage{babel} \usepackage[inline]{enumitem} \usepackage{lipsum} \title{Plain Latex} \begin{document} \section{Français} Une liste en français \begin{itemize} \item La langue \og principale\fg{} est : \mainlocalename ! \item La langue \og courante\fg{} est : \localename ; \end{itemize} \lipsum[1][1-3]\par \lipsum[1][4-6] \selectlanguage{english} \section{English} A list in English \begin{itemize} \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \lipsum[2][1-3]\par \lipsum[2][4-6]\par \subsection{poor patches} \noindent \lipsum[3][1-3]\par \lipsum[3][4-6]\par \begin{itemize}[label={\textbullet}] \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \end{document}

  • Creating a \hookrightnotleftarrows operator
    by Alma Arjuna on May 11, 2026 at 3:21 pm

    I wish to create a math operator, which I'm calling \hall, similar to \rightleftarrows, but the arrows should be hooked, as in \hookrightarrow and \hookleftarrow; the left arrow (which is below) should be crossed. I've tried to create the symbol with the following code, but it turned out quite ugly because of spacing. \documentclass{standalone} \usepackage{amssymb, amsmath} \usepackage{centernot} \newcommand{\hall}{{\hookrightarrow}\atop{\centernot\hookleftarrow}} \begin{document} $\rightleftarrows$ $\hall$ \end{document} It would also be nice if the hook in the left arrow would be pointed downwards instead of upwards. I tried fixing this with a \rotatebox, but this messed up with the arrow size.

  • Minted–add a box around each token
    by Jean Dubois on May 11, 2026 at 3:00 pm

    I have some minted code blocks in a beamer, such as: \documentclass[compress]{beamer} \usepackage{minted} \setminted[ocaml]{ frame=leftline, framesep=6pt, rulecolor=gray, linenos=true, numbersep=4pt, xleftmargin=20pt, breaklines=true, tabsize=2, } \begin{document} \begin{frame} \inputminted{ocaml}{some_file.ml} %% HERE \end{frame} \end{document} where some_file.ml is, say: let rec sum l = match l with | [] -> 0 | x::q -> x + sum q As expected, this is the output I get: I would like to box every token in the file, either automatically or manually (every snippet is as small as this example), approximately like this: I have absolutely no idea how to do this. I searched in the minted documentation for “token” but found nothing relevant. Is it possible to do this and if so, how can I achieve it? Thank you in advance 🙂

  • Context: how can I deal with line spreading due to inline math?
    by Georgian Ilie on May 11, 2026 at 1:39 pm

    Good afternoon, I would like to know if I can do grid typesetting without the need of enlarging too much the line spacing to accomodate the subscripts of math formulas. Indeed, without adjsuments the latter leave annoying white spaces afterwards. In the following, I provide an example code and its output to make it clear: \setuphead[section] [style=\ss\bf, grid=line, method=m, % 'm' stands for 'max'—it forces the line height to the grid max before={\blank[force, 2*line]}, after={\blank[line]}] \setuphead[chapter] [page=right, style=\ss\tfc\bf, header=high, before=, after={\blank[line]\placecontent[criterium=local]\blank[line]}, grid=tolerant] \definecolumnset [example] [n=2] %\definecolumnsetspan[wide][n=2] \setuplayout[grid=yes] % \showgrid \starttext \startcolumnset[example] %\startcolumnsetspan[wide] %\startchapter[title=Introduction,grid=tolerant] %\stopcolumnsetspan \startsection[title=Happy] The quick, brown fox jumps \m{\varepsilon_p^*} over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just \stopsection \stopcolumnset \stoptext Thank you in advance for your help.

  • How to draw two squares beside each other?
    by Intuition on May 11, 2026 at 11:23 am

    Here is the picture I want to draw: I know how to draw just one colored square, for example here is a code to it: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[a4paper, margin=1.5in]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{tikz-cd} \usepackage{amsmath,amsfonts,amssymb} \usepackage{amsthm} \usepackage{graphicx} \usepackage[all,cmtip]{xy} \usepackage[english]{babel} \usepackage{xurl} \usetikzlibrary{positioning, shapes.geometric} \begin{document} \begin{tikzpicture}[ every path/.style={thick}, every node/.style={circle,fill=black,draw,inner sep = 0pt, minimum size= 2pt} ] \draw[red] (0,0)--(2,0); \draw[cyan] (2,0)--(2,2); \draw[yellow] (2,2)--(0,2); \draw[red] (0,2)--(0,0); \draw[green] (0,0)--(2,2); %\draw[green] (0,2)--(2,0); \foreach \corner in {(0,0), (2,0), (2,2), (0,2)} \node at \corner {}; \end{tikzpicture} \end{document} Also, how to remove the common edge if I aligned the two squares beside each other? Any help will be greatly appreciated.

  • Sans serif font
    by m4r35n357 on May 11, 2026 at 11:04 am

    How do I set a sans-serif document font in Latex? This simple question does not seem to have an answer here at all - everyone already seems to know it and nobody asks. MWE: \documentclass{book} \usepackage[T1]{fontenc} \author{me} \title{Blah} \date{never} \begin{document} % start document \frontmatter % the front of the book has roman numerals \maketitle\tableofcontents % generates a titlepage and Contents \mainmatter % the main part of the book will have standard pages Hello \end{document} I have been asked to explain why my question is different to this one. Two reasons: I am looking for a global solution, not tweaking as I go. The answers there are not what I want. The ones here are what I want.

  • Has processing of blank source lines in array environments changed?
    by Klaus on May 11, 2026 at 10:00 am

    I have a LaTeX source text which I could run through pdflatex on April 15 but which fails today May 11. I can make the source text work again by deleting blank lines in array environments (400 places in my case). Here is a minimal failing example of a source text which does not compile: \documentclass{article} \begin{document} \[\begin{array}{l} foo \end{array}\] \end{document} In contrast, this compiles: \documentclass{article} \begin{document} \[\begin{array}{l} foo \end{array}\] \end{document} Also, this compiles: \documentclass{article} \begin{document} \[\begin{array}{l} foo \\ \end{array}\] \end{document} So my question is: what makes the minimal failing example above fail today? Or, equivalently, what made it work on April 15? Between April 15 and today I have upgraded my Fedora Linux installation so, in particular, I have upgraded TeX related packages. My guess is that some TeX related package has changed. My LaTeX source text which worked on April 15 used the following packages: centernot latexsym amssymb graphicx amsmath url enumitem stackengine accents printlen cancel tocloft makeidx tikz. So it could be that one of those packages made the minimal failing example work previously but not anymore.

  • TeX4ht fails to find image if make4ht -B option is used
    by oleksii.markovets on May 11, 2026 at 8:18 am

    I'm compiling my document in 3 different formats (pdf, odt, html), in order to avoid conflicts I'm using separate build directories for each format. But compilation to odt/html fails if document contains images and -B/--build-dir is used. Here is my sources test.tex: \documentclass{article} \usepackage{graphicx} \begin{document} test \begin{figure} \centering \includegraphics{img/test.eps} \caption{Test} \label{fig:test} \end{figure} \end{document} test.mk: Make:latexmk {} And here is compilation output: $ make4ht -e test.mk4 -B odt-build -d odt-out -f odt --lua test [STATUS] make4ht: Conversion started [STATUS] make4ht: Input file: test --- error --- Can't find/open file `img/test.png.4og' [FATAL] make4ht-lib: Fatal error. Command tex4ht returned exit code 1 But if I don't use -B option, it compiles just fine: $ make4ht -e test.mk4 -d odt-out -f odt --lua test [STATUS] make4ht: Conversion started [STATUS] make4ht: Input file: test [STATUS] make4ht: Conversion finished

  • How to use/define longtblr (from tabularray) with two independent caption counters
    by Vitor Coimbra on May 11, 2026 at 12:58 am

    For a document I'm working on, there's a distinction between "frames" and "tables". Long story short, tables are for purely numerical data, while frames can contain text. Because they're separate entities, I need to make sure they're also indexed separately. I managed to somehow figure out how to do that for normal tblrs by creating my own floating environments, which can easily keep track of their own counters. Main issue is that I'm working with some massive tables of numbers and text, meaning I need to use longtblrs for both of these entities pretty much everywhere. longtblrs, however, seem to embed caption stuff into their own innards and so far all my attempts to get independent counters to work have not worked. Here's the latest attempt I've made: \documentclass{article} \usepackage{tabularray} \DeclareTblrTemplate{caption-sep}{default}{ -- } \UseTblrLibrary{counter} \newcounter{framecounter} \NewTblrTheme{frame}{ \DeclareTblrTemplate{caption-tag}{default}{ \stepcounter{framecounter} Frame\ \theframecounter } } \begin{document} \begin{tblr}[ long, caption = {This should be Frame 1}, label = {frm:testframe1}, theme=frame ]{ colspec = {X[c]X[c]}, hlines, vlines } This is & a table test \\ to see & if counters work \\ \end{tblr} \begin{tblr}[ long, caption = {This should be Table 1}, label = {tab:testtable1}, ]{ colspec = {X[c]|X[c]}, hlines } This is & a table test \\ to see & if counters work \\ \end{tblr} \begin{tblr}[ long, caption = {This should be Frame 2}, label = {frm:testframe2}, theme=frame ]{ colspec = {X[c]X[c]}, hlines, vlines } This is & a table test \\ to see & if counters work \\ \end{tblr} References (and what they should be, in brackets): Frame \ref{frm:testframe1} (1), Table \ref{tab:testtable1} (1), Frame \ref{frm:testframe2} (2) \end{document} And what it looks like:

  • Tikz node text width and alignment messed up spaces and indentation
    by aky-her on May 10, 2026 at 5:52 pm

    I have a mono-spaced font (TeX Gyre Cursor), but when I use it in a Tikz node with text width = XYcm the spaces change size. Is there a way to either preserve the space size with the width command, or achieve automatic line breaks in tikz node in some other way that does not break the spaces? Additionally, when using alignemnt, it inserts an indent at the start of the text, which I was not able to remove with \setlength{parindent}{0pt}. What causes this indent and how can I remove it? Here is my full node code: \node at (3, 1.75) [ align = left, text width = 4.6cm, ] {\setlength{\parindent}{0pt}\textbf{\setfontsz{\sztext} Text line 1, Longer text line 2, Even way way way way longer text line 3, Text line 4}}; EDIT: here is the full code: \documentclass{article} \usepackage[paperheight=8cm, paperwidth=6cm, left=0pt, top=0pt, right=0pt, bottom=0pt]{geometry} \usepackage{tikz} \usepackage{fontspec} \usepackage{array} \setmainfont{TeX Gyre Cursor} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} %% horizontal centering \newcommand{\setfontsz}[1]{ \fontsize{#1}{1.2#1} \selectfont } \pagestyle{empty} %\renewcommand{\arraystretch}{2.2} \newcommand{\sztext}{8pt} \begin{document} %\vspace*{-\baselineskip} \begin{tikzpicture}[remember picture, overlay, shift = {(current page.south west)}] \node at (current page.center) [] {\includegraphics[height=\paperheight]{example-image-a.png}}; \node at (3, 1.75) [ align = left, text width = 4.6cm, ] {\setlength{\parindent}{0pt}\textbf{\setfontsz{\sztext} Text line 1, Longer text line 2, Even way way way way longer text line 3, Text line 4}}; \end{tikzpicture} \end{document}

  • Arrows pointing into dots
    by Tala Cruz on May 10, 2026 at 11:51 am

    I am trying to draw a diagram that shows an equivalence chain between statements. I am trying to use tikz-cd to achieve this, here is my code. \[ \begin{tikzcd} \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R} \;\; f(\alpha_1,\cdots,\alpha_n) < 0 \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1,X_2) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \ar[d, Leftrightarrow] \\ \vdots \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1,\cdots,X_n) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \end{tikzcd} \] However, there is an undesired space above the \vdots, as shown: I have tried using \raisebox but it only seems to make the lower gap larger. Is there a way to make the dots’ spacing the same as the other lines? (I am also fine with a solution that does not need tikz-cd).

  • Overriding the column number for enumext inline list items
    by Teepeemm on May 9, 2026 at 2:34 pm

    The enumext package allows inline lists with a set number of columns that can be overridden, like this: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2] \item Short \item Short \item Short \item Short \item(2) A longer item that takes both columns to show \item Short \item Short \item Short \item Short \end{enumext*} \end{document} This works well if most items need the short column, and there's an occasional longer item. I have the opposite setup: most of my items are longer, but there's an occasional pair of short items. I could do this with: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2] \item(2) A longer item that takes both columns to show \item(2) A longer item that takes both columns to show \item Short \item Short \item(2) A longer item that takes both columns to show \item(2) A longer item that takes both columns to show \end{enumext*} \end{document} But writing (2) every time is annoying. Is there a way to say that (2) is the default, and then specify (1) for the short items? Something like: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2,item-columns=2] % Package enumext Error: The key 'item-columns=2' is unknown by environment 'enumext*' and is being ignored. \item A longer item that takes both columns to show \item A longer item that takes both columns to show \item(1) Short \item(1) Short \item A longer item that takes both columns to show \item A longer item that takes both columns to show \end{enumext*} \end{document} I've tried \NewCommandCopy\olditem\item \RenewDocumentCommand\item{D(2)}{\olditem(#1)} Within the {enumext*} environment this causes an error ("! Missing number, treated as zero." and then a fatal error). Outside the environment this causes the next item to display as "()2).[]", but with less spacing. (Note that this document needs to be tagged, so using the enumitem or enumerate packages is not an option.)

  • How to make the `\hrule` in custom math symbol rounded?
    by Explorer on May 9, 2026 at 1:05 pm

    Learning from the classical egreg's solution for example here and here, I try to construct the custom symbols: with the following code: \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\myge}{\mathrel{\mathpalette\myrel@{\@firstoftwo}}} \newcommand{\myle}{\mathrel{\mathpalette\myrel@{\@secondoftwo}}} \newcommand{\myrel@}[2]{% \begingroup \setbox\z@=\hbox{$\m@th#1=$}% \vcenter to \dimexpr.75\ht\z@\relax{% #2{% \hrule width \dimexpr2\wd\z@\relax \vfill \hrule width \wd\z@ }{% \hrule width \wd\z@ \vfill \hrule width \dimexpr2\wd\z@\relax }% }% \endgroup } \makeatother \begin{document} \[ a \myge b \quad a \myle b \] \[ \displaystyle a \myge b \quad \textstyle a \myge b \quad {}_{\scriptstyle a \myge b} \quad {}_{\scriptscriptstyle a \myge b} \] \[ \displaystyle a \myle b \quad \textstyle a \myle b \quad {}_{\scriptstyle a \myle b} \quad {}_{\scriptscriptstyle a \myle b} \] \end{document} but which gives: I want to know that, based on my code, any suggestions to change the rule from butt to rounded? I don't think with tikz is a good choice... here...

  • Lua based solution for tracking equivalent to fontspec LetterSpace Opentype feature
    by David Purton on May 9, 2026 at 10:41 am

    I've been using the OpenType LetterSpace font feature to adjust tracking. It does what I want, but has the side effect of creating a new font instance, which is annoying when babel is in use as the newly created instance is not known to babel. I'd like a drop in alternative implemented in Lua that behaves the same. But it's beyond my skill and understanding. Requirements: No change in the word spacing (like fontspec). Like for like behaviour when same number is supplied as I was using with LetterSpace (I already spent time tuning things to this number). Group safe. Switch-like behaviour (like \bfseries). Optional compatibility with the microtype package if loaded. I probably don't care specifically what happens if you try and use both tracking methods at the same time – one or the other in use is sufficient. But other microtype features need to still work (like protrusion, etc.). Here's a MWE that shows the current behaviour I have with the LetterSpace option. If possible, I'd like the numbers and output to match. %! TeX Program = lualatex \documentclass{article} \pagestyle{empty} \usepackage{fontspec} \setmainfont{Noto Serif} \newlength{\testlen} \newcommand{\settracking}[1]{% \addfontfeatures{LetterSpace=#1}} \begin{document} \begin{tabbing} \settowidth{\global\testlen}{Test Test} Test Test \= width: \the\testlen \\ \settracking{-5}\settowidth{\global\testlen}{Test Test} Test Test \> width: \the\testlen \\ \settowidth{\global\testlen}{Test Test} Test Test \> width: \the\testlen \\ \end{tabbing} \end{document}

  • negating math symbols
    by Antonis on May 9, 2026 at 10:36 am

    I have been asked to introduced negated mathrel symbols in NewCM that do not exist in Unicode standard. Before I get into adding extra symbols in NewCMMath I would like to make sure that a macro does not suffice. I tested with the \not command or relative packages like centernot without good results. Then there is \ooalign. For example, \documentclass{article} \usepackage[olddefault]{fontsetup} \makeatletter \newcommand{\ndisin}{\mathrel{\mathpalette\overlay@slash\disin}} \newcommand{\overlay@slash}[2]{% \ooalign{$\m@th#1#2$\cr\hss$\m@th#1/$\hss}% } \makeatother \begin{document} $y\ndisin A_{y\ndisin A_{y\ndisin A}}$ \end{document} Produces This shows that exactly centering the two symbols is not always good. The slash should be better placed a bit to the right (centered with respect to \in). So the question is if it is possible to make such adjustments on the above or other code to get the desired result, or one has to go to the font level and design new characters.

  • tablenotes, spacing of superscript before right bracket
    by N. Hunt on May 9, 2026 at 4:36 am

    I am having problems with superscripts in tablenotes, specifically, when the superscript comes before a right parenthesis, they are correct, but before a right bracket, extra space is being inserted. I initially was just using the plain tnote, but that behaviour was even worse; I discovered a workaround with 'xspace' and this works apart from what I have just described. This lualatex, by the way. \documentclass[a4paper,14pt]{extarticle} \usepackage[a4paper,left=0.75in,top=0.25in,bottom=0.25in,landscape]{geometry} \usepackage{fontspec} \usepackage[main=greek]{babel} \babelprovide[onchar=ids]{american} \setmainfont[Ligatures=TeX]{Gentium} \usepackage{booktabs} \usepackage{array} \usepackage[flushleft]{threeparttable} \usepackage{xspace} \setlength{\tabcolsep}{10pt} \setlength{\parindent}{0pt} \begin{document} \thispagestyle{empty} \renewcommand{\arraystretch}{1.25} \newcommand{\tss}[1]{\textsuperscript{#1}\xspace} \begin{threeparttable} \begin{tabular}{l !{\kern20pt} l} \multicolumn{2}{c}{\textsc{First Declension}}\\ \multicolumn{1}{c}{\textsc{Masc.}} & \multicolumn{1}{c}{\textsc{Fem.}} \\ xxx, xxxx & xxx, xxx, x \\ xxx, [xxx\tss{9}] & xxx, xxxx \\ x, x & x, x \\ xxx, xxxx\phantom{, xxx} & xxx, (xxx\tss{10}), xxxx \\ xxx, xxx\tss{11}, x & [xxx\tss{12}], xxx, x \\ \multicolumn{2}{c}{x} \\ \multicolumn{2}{c}{xxx} \\ \multicolumn{2}{c}{xxx} \\ \multicolumn{2}{c}{xxx, [xxxx\tss{13}]} \\ \multicolumn{2}{c}{xxx, [xxx, xxxx, xxxx, xxx, xxxx]} \\ \multicolumn{2}{c}{xxxx} \\ \end{tabular} \begin{tablenotes} \small \item [9] Some proper names in Lesser Quux. \item [10] Some proper names in Plat., Xen., Thuc., etc. \item [11] Aristophanes and Plutarch. \item [12] Often in the poets and inscrr.; sometimes in Plato. \item [13] Foobar. \end{tablenotes} \end{threeparttable} \end{document}

  • How to use idiosyncratic fonts in current TeX
    by F. Bartlett on May 8, 2026 at 5:17 pm

    I have been using TeX since 1986 and Type 1 fonts since the early 90s, courtesy of Berthold Horn. Moreover, I created my own fontnames and mappings for T1 fonts and, therefore, tfm files. I should also mention that I have a long-standing allergy to LaTeX and its derivatives, and so work only in plain TeX. But now I have somehow modernized my TeX installation due to a disastrous update to Fedora 44, so none of my non-CM Type 1 fonts work at all. When I attempt to use, say, AGaramond-Regular, I get mktexnam errors (yes, all my font files have Adobe PostScript names): kpathsea: Running mktextfm AGaramond-Regular /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation A for AGaramond-Regular. /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update /usr/share/texlive/texmf-dist/fonts/map/fontname/special.map? mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input AGaramond-Regular This is METAFONT, Version 2.71828182 (TeX Live 2023) (preloaded base=mf) Of course, METAFONT fails in short order. Any suggestions? My preference would be to ignore all the font-handling changes made in the last few years, but I suspect that that’s a lost cause. Thanks! Fred

  • How can I list or visualize all available anchors of a CircuitTikZ component?
    by internet on May 8, 2026 at 9:31 am

    I am using CircuitTikZ and often need to connect wires or labels to component anchors. However, it is not always easy to know which anchors are available for a specific component. For example, different components may provide anchors such as north, south, in, out, gate, collector, emitter, etc., and the available anchors vary depending on the component type. When building more complicated schematics, I frequently need to stop and search through the documentation to check anchor names. I was wondering whether there is a way to programmatically: List all available anchors of a given CircuitTikZ/TikZ shape/components, and/or Visualize those anchors directly on the rendered component. For example, something conceptually like: \showanchors{a component/shape} that would either print all anchor names and draw markers/labels on the component itself. So my question is: Is there a practical way to list all anchors associated with a TikZ/CircuitTikZ shape? My motivation is mainly usability and workflow efficiency. A tool like this would make it much easier to explore unfamiliar components and reduce the need to constantly check the manual, especially for beginners or occasional CircuitTikZ users. This is an example of visualizing the anchors to help wiring from CircuiTikz documentation. A possible MWE (clearly, the pin thing must be adjusted somehow to have a better distribution, and to take into account that labels can have spaces and strange characters, but well...). The task it to substitute the \allanchors definition with something automatic, see the comment above it. \documentclass[border=10pt]{standalone} \usepackage[T1]{fontenc} \usepackage[siunitx, RPvoltages]{circuitikz} \begin{document} \begin{tikzpicture}[every pin/.append style={text=red, inner sep=1pt, font=\tiny\ttfamily}] \node [npn](myshape) at (0,0) {}; % Example: this should be autofilled % Basically, for every shape named, say, "gizmo", the anchor "spot" % is a macro named pgf@anchor@gizmo@spot % --- so to do what you want, you should be able to find all % the macros with that pattern that exist % (and I do not know if this is possible in TeX in general, % maybe in LuaTeX...). \newcommand{\allanchors}{center,E,B,south} \foreach \anc in \allanchors { \node[circ, pin=45:\anc] at (myshape.\anc) {}; } \end{tikzpicture} \end{document}

  • Class memoir Warning: \addtodef is marked deprecated and will be removed in 2026, but \addtodef is not being used anywhere
    by marshmelou on May 7, 2026 at 10:20 am

    I am using the memoir class to write my thesis, and I found that this warning regarding \addtodef being deprecated is triggered whenever I load the natbib package. Below is a MWE: \documentclass{memoir} \usepackage{natbib} \begin{document} Hello \end{document} If I comment out \usepackage{natbib}, the warning goes away. Does anyone know the reason for that? Is this safe to ignore? I'm just worried that I'll carry on using this and then at some point in 2026 \addtodef will be removed and for some reason that will mess up my document. Just to clarify, I am using natbib over biblatex because I am already used to it and I found biblatex to be a nightmare to format it the way I would like it to be. For completion, the full warning message is: Class memoir Warning: \addtodef is marked deprecated and will be removed in 2026, use instead \patchcmd, \pretocmd or \apptocmd from the etoolbox package (which is autoloaded by the class) on input line 5.

  • Why is there no spacing around the plus sign?
    by John Sullivan on May 7, 2026 at 10:02 am

    Why is there nice spacing around the + inside the parentheses, but not around the one just after the parentheses? \documentclass{article} \begin{document} $$-\tau N = B'=-\theta'\bigl(\cos\theta\, U + \sin\theta\, V\bigl) + 0 T = -\theta' N$$ \end{document}

  • How can I automatically adapt LaTeX content to different minipage widths, including automatic line breaks in long display equations?
    by ljguo on May 7, 2026 at 7:04 am

    I am trying to typeset exercise/question content inside containers of different widths. For example, the same content may be placed inside a minipage of width 21cm, or inside a narrower minipage of width 10cm. The content may include normal text, images, tables, and display equations. My goal is that the layout should adapt automatically to the available width. In particular, long display equations should be broken automatically when the width becomes smaller. Here is a simplified example: \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{array} \usepackage{booktabs} \usepackage{mwe} \begin{document} \noindent \begin{minipage}{21cm} \textbf{Question 1.} A particle moves along a straight line. Its position at time \(t\) is given by the function \[ s(t)=3t^4-8t^3+6t^2-12t+5. \] The following diagram illustrates the motion of the particle: \[ \includegraphics[width=0.6\linewidth]{example-image} \] The table below gives some measured values: \[ \begin{array}{c|c|c|c|c} t & 0 & 1 & 2 & 3 \\ \hline s(t) & 5 & -6 & 9 & 86 \end{array} \] Find the velocity and acceleration of the particle at \(t=2\). Also simplify the following expression: \[ \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \] \end{minipage} \vspace{1cm} \noindent \begin{minipage}{10cm} \textbf{Question 1.} A particle moves along a straight line. Its position at time \(t\) is given by the function \[ s(t)=3t^4-8t^3+6t^2-12t+5. \] The following diagram illustrates the motion of the particle: \[ \includegraphics[width=0.6\linewidth]{example-image} \] The table below gives some measured values: \[ \begin{array}{c|c|c|c|c} t & 0 & 1 & 2 & 3 \\ \hline s(t) & 5 & -6 & 9 & 86 \end{array} \] Find the velocity and acceleration of the particle at \(t=2\). Also simplify the following expression: \[ \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \] \end{minipage} \end{document} In the wider minipage, the content looks acceptable. However, in the narrower minipage, the long display equation overflows the available width. What I would like is something like an “automatic responsive layout”: Text should wrap according to the current minipage width. Images should scale relative to the current width, for example using \linewidth. Tables should ideally fit or adapt to the available width. Long display equations should automatically break into multiple lines when necessary. I know that I can manually rewrite the long equation using environments such as align, aligned, multline, or split, for example: \begin{multline} \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \end{multline} But in my real use case, the LaTeX content is generated automatically, and the container width may vary. Therefore, I would prefer not to manually decide where every long formula should be broken. In my actual project, the LaTeX source is not written manually. It is generated from structured exercise data. The same exercise may be rendered in different layouts, such as a full-page layout, a two-column layout, or a card-like layout. Therefore, I am looking for a robust strategy rather than a one-off manual fix for a single equation. My questions are: Is there a recommended way in LaTeX to make mathematical content adapt automatically to different container widths? Can display equations be automatically line-broken depending on the current \linewidth? If full automatic line breaking is not possible, what is the usual robust approach for generating such content automatically? Are packages such as breqn, tabularx, adjustbox, or resizebox appropriate for this kind of problem? What is the best practice for this situation?

  • spacing in array environment
    by Stefan Müller on May 6, 2026 at 5:04 pm

    I have a macro for typesetting Attribute Value Matrices (AVMs). Sometimes I want to add a little bit of vertical space. My understanding is that I type \\[2mm] and then 2mm space is inserted. But this is not what happens. Sometimes I have to add 8mm or 10 or 12. It somehow seems to depend on what happened before. But why? And how does it work and is there anything I can do to get the desired behavior? \documentclass{scrartcl} \usepackage{etex} \usepackage{array} \newcommand{\nliste}[1]{% \mbox{$\langle$\upshape\normalfont#1$\rangle$}% } \newcommand{\eliste}{% \mbox{% $\left\langle\right\rangle$}% } \newcommand{\ms}[2][]{% \ifdim\lastskip=-1pt % flag value \mbox{}\\*[-.8\baselineskip]% \else \ifnum\lastpenalty=-10000 % other flag value \mbox{}\\*[-.8\baselineskip]% \fi \fi \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt\tabcolsep=0pt% $\hspace{-2pt}\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else \multicolumn{2}{>{\normalfont\itshape}l}{#1}% \\% \fi% #2% \end{tabular}% \right]\hspace{-2pt}$% }% % \par\vspace{1mm}% \vspace{1mm}% } \newcommand{\ibox}[1]{{% \setlength{\fboxsep}{1.25pt}% \fbox{$\scriptstyle #1$}% }} \newcommand{\liste}[1]{% \mbox{% $% \left\langle\mbox{\upshape\normalfont#1}\right\rangle% $% }%\\[2pt]% } \newcommand{\ind}[1]{\mbox{$_{\ibox{#1}}$}} \begin{document} \ms{ \ldots & \ms{ cat & \ms{% head & verb \\ arg-st & \ibox{1} $\oplus$ \ibox{2} $\oplus$ \nliste{ V[\textit{inf}, \textsc{lex}+, \textsc{subj}~\ibox{1}, \textsc{comps}~\ibox{2}, \textsc{ltop} \ibox{3} ] } }\\ cont & \ms{ ltop & \ibox{4}\\ ind & \ibox{5} event } }\\ rels & \liste{ \ms[scheinen]{ lbl & \ibox{4}\\ arg0 & \ibox{5}\\ arg1 & \ibox{6}\\ } }\\[10mm] hcons & \liste{ \ms[qeq]{ harg & \ibox{6}\\ larg & \ibox{3}} } } \end{document}

  • Consistent scaling of Greek letters and operators when using mathptmx/Error messages with newtx
    by Dimitrios ANAGNOSTOU on May 6, 2026 at 4:14 pm

    EDIT I am using the mathptmx package to achieve a Times New Roman aesthetic. However, it seems to me that the Greek letters ($\lambda, \mu, \omega$) seem to lose their relative weight or scale inconsistently compared to the Latin constants. Is this an inherent limitation of the virtual fonts in mathptmx, and how can I force a more robust scaling for these mathematical elements? Working example: \documentclass{article} %\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathptmx} % Times New Roman style \usepackage{amsmath,amssymb,amsthm} %------------------------------------------------------------- % Custom macros %------------------------------------------------------------- \newcommand{\cL}{c_{\mathrm{L}}} % longitudinal wave speed \newcommand{\cT}{c_{\mathrm{T}}} % shear wave speed \begin{document} (...) The material is assumed to be homogeneous, isotropic, linearly elastic, and lossless (non-dissipative), characterised by the real-valued Lam\'e constants $\lambda$ and $\mu$ (with $\mu > 0$ and $3\lambda + 2\mu > 0$) and mass density $\rho > 0$. The corresponding longitudinal and shear wave speeds are % \begin{equation} \cL = \sqrt{\frac{\lambda + 2\mu}{\rho}}, \qquad \cT = \sqrt{\frac{\mu}{\rho}}, \label{eq:wavespeeds} \end{equation} % with $\cL > \cT > 0$. The material obeys the generalised Hooke's law % \begin{equation} \sigma_{ij} = \lambda\,\delta_{ij}\,\varepsilon_{kk} + 2\mu\,\varepsilon_{ij}, \qquad \varepsilon_{ij} = \tfrac{1}{2}(U_{i,j} + U_{j,i}), \label{eq:hooke} \end{equation} % where $\delta_{ij}$ is the Kronecker delta and the usual summation convention over repeated indices is employed. Substituting \eqref{eq:hooke} into the equations of motion $\sigma_{ij,j} + \rho\,\partial_{tt} U_i = 0$ and using the time-harmonic ansatz, so that $\partial_{tt} \to -\omega^2$ and hence $\ddot{U}_i = -\omega^2 U_i$, yields the time-harmonic Navier equations: % \begin{equation} \mu\,\nabla^2 \mathbf{U} + (\lambda+\mu)\,\nabla(\nabla\cdot\mathbf{U}) + \rho\omega^2\,\mathbf{U} = \mathbf{0} \quad \text{in } \Omega, \label{eq:navier} \end{equation} % where $\nabla^2 = \partial^2/\partial x^2 + \partial^2/\partial y^2$ is the two-dimensional Laplacian. Equation~\eqref{eq:navier} is a system of two coupled second-order partial differential equations for $U_x$ and $U_y$. \end{document} When using the more recent \usepackage{newtx} I get error messages. LaTeX Error: Command \openbox already defined. amsthm.sty:426 Or name \end... illegal, see p.192 of the manual.name \@backslashchar \@qend ... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help\@err@ l.426 \vrule\hfil}} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. LaTeX Error: Command `\Bbbk' already defined. amssymb.sty:261 See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ->\errmessage LaTeX Error: Command `\string \Bbbk ' already defined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help\@err@ l.261 \DeclareMathSymbol{\Bbbk} {\mathord}{AMSb}{"7C} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. Afficher moins

  • Drawing a half-space figure (à la elasticity/elastodynamics books)
    by Dimitrios ANAGNOSTOU on May 6, 2026 at 11:46 am

    Extension of my question for half plane. I want to be able to draw figures like the following one (i.e. figures for the classic Boussinesq/Lamb problems). After some trial and error, inspired by the following answer in a recent question of mine I got something not bad. \documentclass{standalone} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{decorations.pathmorphing, shadings, arrows.meta, calc} \tikzset{ potato/.style={ rounded corners=2pt, decorate, decoration={random steps, segment length=5mm, amplitude=3pt}, } } \begin{document} \begin{tikzpicture} \pgfmathsetseed{2345} \begin{scope} \clip (-4, -6) rectangle (4, 0); \draw[potato, top color=gray!15, bottom color=gray!50] (0,0) ellipse[x radius=3.2cm, y radius=3.2cm]; \end{scope} \fill[gray!10] (0,0) ellipse[x radius=3.2cm, y radius=0.9cm]; \draw[thick] (0,0) ellipse[x radius=3.2cm, y radius=0.9cm]; \draw[-{latex}, thick] (0,0) -- (0, -2.4) node[below] {$z$}; \draw[-{latex}, thick] (0,0) -- (3.8, 0) node[right] {$x$}; \draw[-{latex}, thick] (0,0) -- (-2.55, -0.93) node[below left] {$y$}; \filldraw[black] (0,0) circle (2pt) node[below left] {$O$}; \draw[-{Stealth}, very thick] (0, 2.0) -- (0, 0.05) node[right, yshift=1.5cm] {$P$}; \end{tikzpicture} \end{document} There are a couple of issues as shown in the figure. First why the white space below the figure and second it appears to me that the 'wiggy' curve does not fit correctly to the ellipse. Thanks for any improvements.

  • Shade (gray fill) a 'wiggy' half-plane
    by Dimitrios ANAGNOSTOU on May 5, 2026 at 5:42 pm

    Follow-up to my previous question. How to fill/shade the plotted area? % Source - https://tex.stackexchange.com/a/762539 % Posted by kabenyuk % Retrieved 2026-05-04, License - CC BY-SA 4.0 \documentclass[tikz,border=10pt]{standalone} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[>=latex] % Draw the wavy boundary % We use a parabola-like base: 0.2*x^2 - 2 % We add a small sine component for the "roughness" \begin{scope} \clip (-3.5,-2.5) rectangle (3.5,0); \draw[thick] plot [domain=-3.3:3.3, samples=100, smooth] (\x, {0.2*\x*\x - 2 + 0.08*sin(200*\x)}); \end{scope} % Draw Horizontal Axis (x) \draw[->] (-3.5,0) -- (3.5,0) node[below right] {$x$}; % Draw Vertical Axis (y) \draw[->] (0,0.25) -- (0,-1.5) node[right] {$y$}; % Origin label \node[below left] at (0,0) {$0$}; %--- Material label --- \node at (-1.5,-1) {$\lambda,\,\mu,\,\rho$}; \end{tikzpicture} \end{document}

  • How to obtain two same sized block with pictures inside in a tikzposter?
    by JackRed on May 5, 2026 at 5:17 pm

    Using tikzposter, if I create 2 blocks in a column environment, and put inside of each the same picture, I obtain block of different size. I would like both blocks to have the same size, given they should have the same content. Minimal example: \documentclass[25pt,a1paper]{tikzposter} \begin{document} \begin{columns} \column{0.45} \block[]{AAA}{ \begin{tikzfigure}[] \includegraphics[width=0.8\colwidth]{Figure/2026-05-05_17-53.png} \end{tikzfigure} } \column{0.45} \block[]{AAA}{ \begin{tikzfigure}[] \includegraphics[width=0.8\colwidth]{Figure/2026-05-05_17-53.png} \end{tikzfigure} } \end{columns} \end{document} With the results below: I have tried to create more than two columns, and the behaviour was strange (this was done with 4 columns of size 0.22, and 2 pictures per block). The first block has a different size than the next four, and the the final three have again a different size.

  • Multiple bibliographies in OpTeX
    by Robert Alessi on May 5, 2026 at 12:43 pm

    In LateX, there are many ways to have the bibliography distributed into different sections depending on the nature of the references cited, eg. “Primary Sources” for ancient authors and “Secondary Sources” for modern authors. Examples follow. LaTeX Sample \begin{filecontents}{\jobname.bib} @Article{Dols1987, author = {Dols, Michael W.}, date = 1987, journaltitle = {Bulletin of the History of Medicine}, entrysubtype = {secondary}, langid = {english}, pages = {367--390}, title = {The Origins of the Islamic Hospital: Myth and Reality}, volume = 61, } @Inbook{endress1992, author = {Endress, Gerhard}, editor = {Fisher, Wolfdietrich}, location = {Wiesbaden}, entrysubtype = {secondary}, publisher = {Reichert}, booktitle = {Grundriß der arabischen Philologie}, date = 1992, langid = {german}, note = {Supplement}, pages = {3--152}, title = {Die Wissenschaftliche Literatur}, volume = 3, } @Mvbook{al-nadim, author = {{Ibn an-Nadīm}}, editor = {Flügel, Gustav}, location = {Leipzig}, entrysubtype = {primary}, date = {1871/1872}, entrysubtype = {primary}, shorthand = {{Ibn an-Nadīm}, \mkbibemph{{Fihrist}}}, title = {{Fihrist}}, volumes = 2, } @Book{al-qifti, author = {{Ibn al-Qifṭī}}, editor = {Lippert, Julius}, location = {Leipzig}, entrysubtype = {primary}, date = 1903, entrysubtype = {primary}, shorthand = {{al-Qifṭī}, \mkbibemph{{Taʾrīḫ}}}, title = {{Taʾrīḫ al-ḥukamāʾ}}, } \end{filecontents} \documentclass[a4paper,12pt]{article} \usepackage[style=oxnotes]{biblatex} \addbibresource{\jobname.bib} \begin{document} This file illustrates how such a field as \verb|entrysubtype| can be used to have the bibliography distributed into two different sections, namely ``primary sources'' for ancient authors and ``secondary sources'' for modern literature (commentaries, books, articles, chapters and the like). For example the two references that follow are taken from modern authors: one\footcite{Dols1987} and two.\footcite{endress1992} Whereas these other two are taken from ancient authors: one\footcite{al-nadim} and two.\footcite{al-qifti} \printbibliography[title={Primary Sources}, subtype=primary] \printbibliography[title={Secondary Sources}, subtype=secondary] \end{document} My question: how can the same be achieved with OpTeX? A way would be to use a dedicated BibTeX field as entrysubtype. Right now, OpTeX can do the sorting based on sortedby, but without inserting, of course, the headings. It would be great to have an option that would allow for multiple lists in OpTeX! OpTeX Sample @Article{Dols1987, author = {Dols, Michael W.}, year = 1987, journal = {Bulletin of the History of Medicine}, entrysubtype = {secondary}, sortedby = {02-secondary}, langid = {english}, pages = {367--390}, title = {The Origins of the Islamic Hospital: Myth and Reality}, volume = 61, } @Inbook{endress1992, author = {Endress, Gerhard}, editor = {Fisher, Wolfdietrich}, address = {Wiesbaden}, entrysubtype = {secondary}, sortedby = {02-secondary}, publisher = {Reichert}, booktitle = {Grundriß der arabischen Philologie}, year = 1992, langid = {german}, note = {Supplement}, pages = {3--152}, title = {Die Wissenschaftliche Literatur}, volume = 3, } @book{al-nadim, author = {{Ibn an-Nadīm}}, editor = {Flügel, Gustav}, address = {Leipzig}, entrysubtype = {primary}, sortedby = {01-primary}, year = {1871/1872}, entrysubtype = {primary}, title = {{Fihrist}}, volumes = 2, } @Book{al-qifti, author = {{Ibn al-Qifṭī}}, editor = {Lippert, Julius}, address = {Leipzig}, entrysubtype = {primary}, sortedby = {01-primary}, year = 1903, entrysubtype = {primary}, title = {{Taʾrīḫ al-ḥukamāʾ}}, } \nonumcitations \fontfam[NewCM] \verbchar| \nonum\sec \OpTeX/ sample With \LaTeX/, such a field as |entrysubtype| can be used to have the bibliography distributed into two different sections, namely ``primary sources'' for ancient authors and ``secondary sources'' for modern literature (commentaries, books, articles, chapters and the like). How would the same be achieved with \OpTeX/? For example the two references that follow are taken from modern authors: one\fnote{\rcite[Dols1987].} and two.\fnote{\rcite[endress1992].} Both must be printed {\em below} references taken from ancient authors. Whereas these other two are taken from ancient authors: one\fnote{\rcite[al-nadim].} and two.\fnote{\rcite[al-qifti].} Both must be printed {\em above} references taken from modern authors. In the list that follows, I managed to have the ancient authors printed first by using the |sortedby| field. This works, but there is no way to insert headings like {\bf Primary Sources} and {\bf Secondary Sources } as above in the \LaTeX/ example in the list of references. Besides, this is not the way |sortedby| is meant to be used. \nonum\sec References \usebib/s (simple) test-entrysubtype \bye

  • Lost references when including files with delayed exercise answers
    by DaftWullie on May 5, 2026 at 9:58 am

    I'm trying to use the exercise package to collect solutions and then print them later. This is mostly working, but if I have answers typeset in a separate file and included into a main file, any labels introduced within the answers of that separate file cannot be referenced. In case it's relevant, if I input the file instead of include it, the reference is correctly resolved. Here's a MWE. In the main file, we have \documentclass{article} \usepackage[lastexercise,answerdelayed]{exercise} \begin{document} \include{extra} \begin{Exercise} \Question This is a second question. \end{Exercise} \begin{Answer} \Question \begin{equation}\label{eq:test2} x^2 \end{equation} Have a look at (\ref{eq:test2}). \end{Answer} Answers go here \shipoutAnswer \end{document} A second file, extra.tex contains the following: \begin{Exercise} \Question This is a question. \end{Exercise} \begin{Answer} \Question \begin{equation}\label{eq:test} x^2 \end{equation} Have a look at (\ref{eq:test}) \end{Answer} So, we have 2 questions + answers that are essentially the same. The answers are both typeset after the "Answers go here" text. The reference to eq:test2 works, the reference to eq:test does not work. How can I fix this?

  • Why does -- cycle not work in this CircuiTikz example?
    by internet on May 5, 2026 at 8:43 am

    I am trying to draw a simple closed loop using circuitikz. I noticed that using -- cycle does not work here (as shown in the figure on the right). Here is a minimal example: \documentclass[border=10pt]{standalone} \usepackage[american]{circuitikzgit} \begin{document} \begin{circuitikz}[line width=2pt] \draw (0,0) to[isource] (0,3) -- (2,3) to[R] (2,0) -- (0,0); \end{circuitikz} \begin{circuitikz}[line width=2pt] \draw (0,0) to[isource] (0,3) -- (2,3) to[R] (2,0) -- cycle; \end{circuitikz} \end{document} Note that I used a thick line width only to make the issue more visible with manually closing the loop. Why does -- cycle not work properly here, and what is the correct way to fix this?