• pgfplotstable commands do not work in a foreach loop
    by CarLaTeX on February 24, 2026 at 8:33 am

    I'm trying to put together n files into one with pgfplotstable. This example works: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \pgfplotstableread[header=false]{data2.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \pgfplotstableread[header=false]{data3.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} It gives what I want: But if I put the \pgfplotstableread and \pgfplotstablevertcat in a \foreach loop, they don't work: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \foreach \ind in {2,3} {the loop is executed: \ind\newline \pgfplotstableread[header=false]{data\ind.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} } \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} Even if the loop is executed, I got no errors, and in the log I have: PGFPlots: reading {data1.csv} PGFPlots: reading {data2.csv} PGFPlots: reading {data3.csv}

  • Formatting a sequence of items with comma and ending with 'and' or 'respectively'
    by mf67 on February 23, 2026 at 10:02 pm

    Can someone help me create a macro like \MyList{A;B;C;D;E;F} which returns “A, B, C, D, E[,] respectively F" independently on how many ”arguments” (2+) that are specified and also support math, e.g. \MyList{\(A\);\(B\);\(C\);\(D\);\(E\);\(F\)} ? (I used the [,] notation since I’m not sure if the Oxford comma is used today.) If the number of arguments is two; \MyList{A;B} I would like it to return “A respectively B”. Edit: I tried using sinuitx but it might not be suitable for this task as it mainly(?) handles numbers. Here is a test \documentclass{article} \usepackage{siunitx} \begin{document} \numlist[parse-numbers=false]{A;2;3} \numlist[parse-numbers=false]{\text{A};2;3} \numlist[parse-numbers=false]{\(A+B\);2;3} \end{document} but it gives an error on the last line and I would like to have ”roman letters” if no ”math mode” is used, and avoid using \text{}.

  • tabular: add lines until the end of the text body is reached
    by cis on February 23, 2026 at 12:56 pm

    Can I configure this loop, or a similar loop, to add rows until the end of the text body is reached? A small gap at the end will probably be unavoidable. Could this be achieved with \pdfpos? \documentclass[a5paper]{article} \usepackage[margin=14mm, showframe=true, paperheight=126mm, ]{geometry} \newcounter{mycount} \setcounter{mycount}{0} \def\mylines{}% \loop\ifnum\themycount<7% \addtocounter{mycount}{1} \expandafter\def\expandafter\mylines\expandafter{% \mylines & & \themycount \\ }% \repeat% \begin{document} \section{Table} \begin{tabular}{| c c | c|} \hline \multicolumn{3}{|c|}{Something} \\ \hline A & B & (My Head) \\ \hline a & b & n\\ a & b & n\\ a & b & n\\ \mylines \hline A & B & (My Foot)\\ \hline \end{tabular} \end{document}

  • Controlling Subsection Visibility in LaTeX Table of Contents
    by Aimar on February 23, 2026 at 10:43 am

    I am using the amsart document class in LaTeX. I would like the table of contents to display all sections while including only a single, specific subsection. All other subsections should remain numbered and visible in the document, but should not appear in the table of contents. \documentclass{amsart} \usepackage{hyperref} \begin{document} \title{title} \author{Author Name} \maketitle \tableofcontents \section{First Section} \subsection*{This subsection should NOT appear in the TOC} \subsection{This subsection SHOULD appear in the TOC} \section{Second Section} \subsection*{Another subsection NOT in the TOC} \end{document}

  • How to draw arc segments of circular quiver diagram elegant with tikz?
    by Explorer on February 23, 2026 at 9:23 am

    Claim This post is more likely asking for better approach, focused on the arc's plot. And that is similar to, but I don't find the same one: Drawing cyclic quiver Drawing a circular graph using xypic https://tex.stackexchange.com/a/759710/322482 Descrption I found that just with: \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; The arc is not exactly centered at (0,0)(the violet part), thus I learnt from here and calculate the \deltaangg with cosline rule manually. Code \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \def\NN{5} \def\RR{5} \def\rr{0.5} \def\deltaang{\fpeval{360/\NN}} \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}} % cosine rule \begin{tikzpicture}[ thick,>=Stealth,shortstyle/.style={shorten >=\rr cm,shorten <=\rr cm}] \foreach \i in {1,...,\NN}{ \def\ang{\fpeval{\deltaang*(\i-1)}} \path[draw,fill=gray!75] (\ang:\RR cm) circle[radius=\rr cm]; \def\startang{\fpeval{\ang+\deltaangg}} \def\endang{\fpeval{\ang+\deltaang-\deltaangg}} %%%%%%%%%%%%%% \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; %%%%%%%%%%%%%% % https://tex.stackexchange.com/a/66265/322482 \draw[<->,magenta] ([{shift=(\startang:\RR cm)}]0,0) arc[radius=\RR cm,start angle=\startang,end angle=\endang]; \foreach[parse=true] \j in {2,...,{\NN-2}}{ \def\nextang{\fpeval{\ang+\deltaang*\j}} \draw[shortstyle,<->] (\ang:\RR cm) -- (\nextang:\RR cm); } } \end{tikzpicture} \end{document} Question The magenta arcs is what I want, but I found it too hard to calculate \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}}. Any suggestions on the code?

  • Setting pages of an index entry with an specific font
    by Knudsen on February 23, 2026 at 6:24 am

    I have always used \documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman} \newfontfamily\semibold[Ligatures={TeX, Common}]{Times LT Std Semibold} \usepackage{imakeidx} \makeindex[program=texindy, options=-L english -C utf8, title=Index] \begin{document} Some text\index{Important Topic|textbf}. Some text\index{Not Important Topic}. \printindex \end{document} to be processed with xelatex -shell-escape main.tex, which sets the page of the entry in boldface using the standard font used by \textbf{}. How can I set the page in a particular (semibold) font? Or, for that matter, any other font?

  • Text above horizontal arrow in longtblr / tblr with minimal vertical spacing
    by GJW on February 23, 2026 at 12:40 am

    I would like text to be above a horizontal arrow in longtblr, with the following constraints longtblr package Define start and stop points of arrow relative to column borders - i.e. enable the table is dynamic if width of columns change Minimal space between arrow bar and the text Text in column A centred between rows 2 and 3 A screen grab of the desired outcome is attached. Here is a minimal example illustrating what I currently have: \documentclass{article} \usepackage{tabularray} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{longtblr}{ colspec={|c|c|c|}, vlines, hlines, row{3} = {ht=0pt}, % arrow row height } % --- First row --- A & B & C \\ % --- SECOND row: merge columns 2 and 3 --- 1 & \SetCell{c=2} 2 & \\ % --- Arrow row (thin) --- & \SetCell{cmd=\tikz[remember picture]\node (Bstart) {};} & \SetCell{cmd=\tikz[remember picture]\node (Cend) {};} \\ \end{longtblr} % --- Draw the arrow --- \begin{tikzpicture}[overlay, remember picture] \draw[red, thick, <->] ($(Bstart.west)+(-\pgflinewidth/2,0)$) -- ($(Cend.east)+(\pgflinewidth/2,0)$); \end{tikzpicture} \end{document}

  • Wrong links in \hyperref
    by Alex Degtyarev on February 22, 2026 at 9:01 pm

    Sorry everyone. I just did an update, which was probably a mistake, and encountered another problem with hyperref. For years I've been using a workaround which I borrowed from a journal, and it worked. Well, I understand that this is an undocumented feature, but there seems (seemed?) to be no other way to have everything numbered consecutively. Here's a minimal example: \documentclass{amsart} \usepackage{hyperref} \newtheorem{theorem}{Theorem}[section] \makeatletter \let\c@equation\c@theorem \let\theequation\thetheorem \makeatother \begin{document} \section{1} \begin{equation} a=b\label{1} \end{equation} \newpage \section{2} \begin{equation} c=d\label{2} \end{equation} \newpage \eqref1 \eqref2 \end{document} Both links lead to eqn. 1.1, and the log reports multiple anchors with the same name. What would the new hack be? Or is there a documented way now to have all theorems, lemmas, ... and equations numbered consecutively within sections and, at the same time, have \autoref work correctly?

  • Multiple images stacked with a single caption, no extra vertical space
    by palloc on February 22, 2026 at 7:53 pm

    I'm trying to create a LaTeX document where I have several images stacked vertically, with no extra vertical space between them, and only one caption for all images (appearing under the last image). The problem is that each \IMG creates a separate figure, so each image gets its own caption and there’s extra vertical space between images. What I want: Multiple images stacked vertically with no extra vertical space. Only one caption for all images (appearing under the last one). Allow overlays on the images (x, y, text). This is how it should look like: The code what I got from taiwan12 with little modification (link: https://tex.stackexchange.com/a/760076/287423) : \documentclass{report} \usepackage{graphicx} \usepackage{float} \usepackage{xcolor} \usepackage{xparse} \ExplSyntaxOn % variables \tl_new:N \l_taiwanxii_image_tl \tl_new:N \l_taiwanxii_caption_tl \tl_new:N \l_taiwanxii_shortcaption_tl \tl_new:N \l_taiwanxii_label_tl \tl_new:N \l_taiwanxii_pos_tl \fp_new:N \l_taiwanxii_scale_fp \fp_new:N \l_taiwanxii_overlayscale_fp \clist_new:N \l_taiwanxii_x_clist \clist_new:N \l_taiwanxii_y_clist \clist_new:N \l_taiwanxii_text_clist % keys \keys_define:nn { taiwanxii } { image .tl_set:N = \l_taiwanxii_image_tl, caption .tl_set:N = \l_taiwanxii_caption_tl, shortcaption .tl_set:N = \l_taiwanxii_shortcaption_tl, label .tl_set:N = \l_taiwanxii_label_tl, pos .tl_set:N = \l_taiwanxii_pos_tl, scale .fp_set:N = \l_taiwanxii_scale_fp, overlayscale .fp_set:N = \l_taiwanxii_overlayscale_fp, x .clist_set:N = \l_taiwanxii_x_clist, y .clist_set:N = \l_taiwanxii_y_clist, text .clist_set:N = \l_taiwanxii_text_clist, } \NewDocumentCommand{\IMG}{m} { % reset \tl_clear:N \l_taiwanxii_image_tl \tl_clear:N \l_taiwanxii_caption_tl \tl_clear:N \l_taiwanxii_shortcaption_tl \tl_clear:N \l_taiwanxii_label_tl \tl_clear:N \l_taiwanxii_pos_tl \tl_clear:N \l_taiwanxii_pos_tl \clist_clear:N \l_taiwanxii_x_clist \clist_clear:N \l_taiwanxii_y_clist \clist_clear:N \l_taiwanxii_text_clist \tl_set:Nn \l_taiwanxii_pos_tl {H} \fp_set:Nn \l_taiwanxii_scale_fp {1} \fp_set:Nn \l_taiwanxii_overlayscale_fp {1} \keys_set:nn { taiwanxii } { #1 } % shortcaption \tl_if_empty:NT \l_taiwanxii_shortcaption_tl { \tl_set_eq:NN \l_taiwanxii_shortcaption_tl \l_taiwanxii_caption_tl } \use:e { \exp_not:N \begin{figure}[\l_taiwanxii_pos_tl] } \centering \sbox0{\includegraphics[scale=\fp_use:N \l_taiwanxii_scale_fp]{\l_taiwanxii_image_tl}} \usebox0 \int_zero:N \l_tmpa_int \clist_map_inline:Nn \l_taiwanxii_x_clist { \int_incr:N \l_tmpa_int \tl_set:Nn \l_tmpa_tl {##1} \tl_set:Nx \l_tmpb_tl { \clist_item:Nn \l_taiwanxii_y_clist { \int_use:N \l_tmpa_int } } \tl_set:Nx \l_tmpc_tl { \clist_item:Nn \l_taiwanxii_text_clist { \int_use:N \l_tmpa_int } } \rlap{ \hspace{\dimexpr \l_tmpa_tl\wd0-\wd0\relax} \raisebox{\dimexpr \ht0-\l_tmpb_tl\ht0\relax}{ \makebox[0pt][l]{ \raisebox{-\height}{ \scalebox{\fp_use:N \l_taiwanxii_overlayscale_fp}{ \fcolorbox{black}{white}{ \shortstack[c]{\l_tmpc_tl} } } } } } } } \caption[\l_taiwanxii_shortcaption_tl]{\l_taiwanxii_caption_tl} \label{fig:\l_taiwanxii_label_tl} \end{figure} } \ExplSyntaxOff \begin{document} \listoffigures \IMG{ image = example-image, caption = Caption I, shortcaption = Caption, label = figA, pos = H, scale = 0.6, x = {0.0,0.5,0.2,0.7,0.8}, y = {0.0,0.2,0.3,0.65,0.9}, text = {AA\\BB,AABB,A,B,C}, overlayscale = 0.75, } \IMG{ image = example-image, caption = Caption II, shortcaption = Caption, label = figB, pos = H, scale = 0.6, x = {0.2,0.5}, y = {0.2,0.3}, text = {AABB,A}, overlayscale = 1, } \end{document}

  • What is the best way to draw a potato (like found in vector analysis/continuum mechanics courses)
    by Dimitrios ANAGNOSTOU on February 21, 2026 at 11:34 pm

    I apologized if this is a duplicate. What is the best way to draw such figures with tikz (or other packages)? For the time being just the potato like figure. I do not care for the vectors and the infinitesimal mass element. I do not want someone to do the work for me. Just some advice or suggestions.

  • Top right math kern value not being used with \directlua code (bug?)
    by Apoorv Potnis on February 21, 2026 at 7:30 pm

    I want to add a topright math kern (aka cut-in or staircase kerning) to DOUBLE-STRUCK CAPITAL R (Hex value: 0x211D, Code point: U+211D). I tried the method as shown in this answer of mickep, but it does not seem to work here. \documentclass{article} \usepackage{fontsetup} \directlua{ local kerns = { ["NewCMMath-Book"] = { [0x211D] = { topright = { { kern = -500 } } }, } } local function addkerns(tfmdata) if tfmdata.mathparameters then local kerns = kerns[tfmdata.properties.fontname] if kerns then local characters = tfmdata.characters for unicode, specification in pairs(kerns) do local character = characters[unicode] if character and not character.mathkerns then character.mathkerns = specification end end end end end fonts.handlers.otf.features.register { name = "mathkerns", description = "additional math kerns", default = true, initializers = { position = 1, base = addkerns, node = addkerns, } } } \usepackage{lua-visual-debug} % The absence of a red rectangle between the doublestruck R and the superscript n seems to indicate that math kerning is not being used, if I understand correctly. \begin{document} \(\symbb{R}^n\) \end{document} While I am using LuaLaTeX with unicode-math, answers for other engines such as ConTeXt and OpTeX are also welcome, if the resulting code is different. Edit: I have tried loading the fonts manually, but that also does not seem to work. \documentclass{article} \directlua{ local kerns = { ["NewCMMath-Book"] = { [0x211D] = { topright = { { kern = -100 } } } } } local function addkerns(tfmdata) if tfmdata.mathparameters then local kerns = kerns[tfmdata.properties.fontname] if kerns then local characters = tfmdata.characters for unicode, specification in pairs(kerns) do local character = characters[unicode] if character and not character.mathkerns then character.mathkerns = specification end end end end end fonts.handlers.otf.features.register { name = "mathkerns", description = "additional math kerns", initializers = { position = 1, base = addkerns, node = addkerns, } } } \usepackage{unicode-math} \setmainfont{NewCM10-Book.otf} \setmathfont[ StylisticSet={3}, BoldFont = NewCMMath-Bold.otf, RawFeature=+mathkerns ]{NewCMMath-Book.otf} \usepackage{lua-visual-debug} \lvdset{glyph={show=true}} \begin{document} \(\symbb{R}^n\) \end{document}

  • Latex: Tikz - rectangle to inherit the width of another rectangle
    by GJW on February 21, 2026 at 1:44 pm

    I would like node B to have exactly the same width as node A, without explicitly specifying a fixed dimension, with the following constraints: The two nodes are not adjacent in the source code. I do not want to hard-code a width (e.g., minimum width=3cm). Node A will always be at least as wide as node B. I would prefer a solution that does not rely on manually computing dimensions via \path let unless necessary. Here is a minimal example illustrating what I currently have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node [draw] (A) {Some text}; \path let \p1 = (A.south west), \p2 = (A.north east) in node [draw, minimum width=\x2-\x1-\pgflinewidth, minimum height=\y2-\y1-\pgflinewidth, below right] at ([yshift={\pgflinewidth}]A.south west) {more}; \end{tikzpicture} \end{document}

  • Directlua can not add options to tikz node
    by Norodix on February 21, 2026 at 12:37 pm

    I'm trying to set up some parameters of nodes from lua code. I don't understand why the first version works but not the second. \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [ color=\directlua{ tex.print("red") } ] {A}; \node [ \directlua{ tex.print("color=red") } ] {B}; \end{tikzpicture} \end{document} To me it looks like that these two directlua sections should produce the exact same output, but B fails with the following error message: ! Package pgfkeys Error: I do not know the key '/tikz/color=red' and I am going to ignore it. Perhaps you misspelled it.

  • QED symbol at end of align blocks final equation number
    by Niles on February 21, 2026 at 9:56 am

    I'm trying to use \qedhere with the ams classes to set a proof endmark at the end of an align environment. But doing so removes the number from that equation! This problem doesn't happen with a single numbered equation. Here are some examples. In the last one, I have a sort of hack from this question that adds a paragraph break and then a negative \vspace. But, the spacing isn't quite right and I wouldn't want to manually adjust it for each different environment. I've also seen a similar suggestion for a multi-line display. Is there not a better way? \documentclass{amsart} \begin{document} \begin{proof} Numbered equation, qedhere at right. \begin{equation} x+y\qedhere \end{equation} \end{proof} \begin{proof} Align environment; qed on newline \begin{align} x & = 2\\ y & = 3 \end{align} \end{proof} \begin{proof} Align environment; using qedhere blocks the final equation number \begin{align} x & = 2\\ y & = 3\qedhere % <---- want a number here too \end{align} \end{proof} \begin{proof} Align environment; paragraph break and negative vspace \begin{align} x & = 2\\ y & = 3 \end{align} \par\nopagebreak\vspace{-\baselineskip}\mbox{} \end{proof} \end{document} Note: Several related questions, like this one for the cases environment, have comments suggesting that it's just bad style to end a proof with a displayed equation. Leaving that aside, I'm really interested in different endmarks for different environments. The proof environment is just the simplest way to display the issue with \qedhere and align. Note 2: I also see suggestions that ntheorem handles endmarks better. I've used ntheorem for many years, but it hasn't been updated since 2011. I'm looking for a better solution using the new begin/end environment hooks. I had hoped \qedhere in the appropriate hook could do the job.

  • Strange intersection glitch of knots package?
    by Explorer on February 21, 2026 at 9:20 am

    This question based on the previous question: % Source - https://tex.stackexchange.com/a/759998 % Posted by Andrew Stacey % Retrieved 2026-02-21, License - CC BY-SA 4.0 \documentclass[tikz, border=1cm]{standalone} \usetikzlibrary{decorations.pathreplacing,knots} %\url{https://tex.stackexchange.com/q/759978/86} \begin{document} \begin{tikzpicture}[ basic strand/.style={ black, double=gray!10, double distance=1pt, line cap=round, thick, }, crossing strand/.style={ line width=2pt, only when rendering/.style={% draw=gray!10,% line width=1pt, double=none, } }, rounded corners=1pt, ] \begin{knot}[ consider self intersections=true, ignore endpoint intersections=false, background colour=black, every intersection/.style={ crossing strand }, only when rendering/.style={ basic strand }, clip width=1, flip crossing=1, ] \strand (7.5,7.5)--(6.5,5.5)--(7.5,3.5)--(6.5,1.5)--(4.5,0.5)--(2.5,1.5)--(0.5,0.5)--(1.5,2.5)--(0.5,4.5)--(1.5,6.5)--(3.5,7.5)--(5.5,6.5)--(7.5,5.5)--(6.5,3.5)--(7.5,1.5)--(5.5,0.5)--(3.5,1.5)--(1.5,0.5)--(0.5,2.5)--(1.5,4.5)--(0.5,6.5)--(2.5,7.5)--(4.5,6.5)--(6.5,7.5)--(5.5,5.5)--(7.5,4.5)--(6.5,2.5)--(7.5,0.5)--(5.5,1.5) --(3.5,0.5)--(1.5,1.5)--(0.5,3.5)--(1.5,5.5) --(0.5,7.5)--(2.5,6.5)--(4.5,7.5)--(6.5,6.5) --(4.5,5.5)--(5.5,3.5) % --(7.5,2.5) ; \end{knot} \end{tikzpicture} \end{document} With --(7.5,2.5) commented, it behaves good: However, if I uncommented that line, thing changed: Is that a bug or feature? Any possibility to improve this?

  • Using tikz's backgrounds library to draw something behind text
    by Werner on February 21, 2026 at 7:20 am

    Consider the following minimal example where I want to draw a rectangle behind a sequence of numbers (to highlight them): \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds,calc} \NewDocumentCommand{\tikzmark}{ m }{\tikz[overlay, remember picture] \node (#1) {};} \newcounter{seq} \NewDocumentCommand{\seqstart}{}{% \stepcounter{seq}% Start a new sequence \tikzmark{seq-start-\theseq}}% Set start marker \NewDocumentCommand{\seqend}{}{% \tikzmark{seq-end-\theseq}% Set end marker \tikz[remember picture, overlay] \scoped [on background layer] \fill [fill=blue!10!white] ($(seq-start-\theseq.south west) + (-0.5pt,1pt)$) rectangle ($(seq-end-\theseq.south east) + (0.5pt,1.1\normalbaselineskip)$);% } \begin{document} \[ 12, 15, 8, 11, 4, 7, 0, 3, 16, 19, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \[ \seqstart{}12, 15, 8, 11, 4, 7, 0, 3, 16, 19\seqend{}, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \end{document} The idea is that \seqstart would set a (counter-driven) \tikzmark representing the start of the sequence to be marked. Then \seqend would set a \tikzmark at the end and highlight it using the background layer. The counter allows for multiple such sequence marking within a larger document. However, the output shows that the rectangle highlighting a part of the sequence is not being drawn on background layer as requested. Why is that? How can I ensure the rectangle is drawn on the background layer behind document/text elements? The backgrounds library documentation (in the tikz documentation, section 45) mentions that on background layer can only be used inside a {scope} or \scoped, which is done above.

  • When I use \hl inside of a longtable, the file says it's building forever but never builds
    by Tyler on February 21, 2026 at 12:02 am

    First off, here is my setup because I am certain that must be part of the problem. I'm using: texlive 2025 VS Code with these extensions: LaTeX by Mathematic Inc LaTeX Workshop by James Yu I have a LaTeX document that used to build just fine. I recently tried switching over to using the tcolorbox package instead of the soul package for highlighting in that document. As part of that process, I was getting some errors, and from reading various posts online for similiar issues I suspected I had an outdated texlive distribution so ended up trying to update everything with this on my command line: tlmgr update --all This appeared to fix the errors with tcolorbox, but I then realized that tcolorbox does not break across lines nicely so switched back to using soul. But now my document will not build. It is stuck in an infinite loop or something, the status at the bottom of VS code has the spinning circular arrows next to "Build" and it just spins forever. I have narrowed the problem down to when I use \hl inside of a longtable. Minimum working code is below. If I uncomment the commented line, I get the building-forever behavior. \documentclass{article} \usepackage{longtable} \usepackage{soul} \usepackage{xcolor} \begin{document} \sethlcolor{yellow}\hl{Test text} \begin{longtable}{ll} Column 1 & Column 2\\ % \hl{Test text} & Entry 2 \\ \end{longtable} \end{document} I have completely removed and re-installed my texlive installation and am still getting the same result. When I click "Kill LaTeX compiler process" twice to stop the infinite build, I get a popup saying "Recipe terminated with error". I click on "Open Compiler log" and get this: Initial Win CP for (console input, console output, system): (CP437, CP437, CP1252) I changed them all to CP1252 Rc files read: NONE Latexmk: This is Latexmk, John Collins, 15 June 2025. Version 4.87. No existing .aux file, so I'll make a simple one, and require run of *latex. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Category 'other': Rerun of 'pdflatex' forced or previously required: Reason or flag: 'Initial setup' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:/Users/REDACTED/test/test.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (c:/Users/REDACTED/test/test.tex LaTeX2e <2025-11-01> L3 programming layer <2026-01-19> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size10.clo)) (c:/texlive/2025/texmf-dist/tex/latex/tools/longtable.sty) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul.sty (c:/texlive/2025/texmf-dist/tex/generic/soul/soul-ori.sty) (c:/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (c:/texlive/2025/texmf-dist/tex/generic/etexcmds/etexcmds.sty (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty))) (c:/texlive/2025/texmf-dist/tex/latex/xcolor/xcolor.sty (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/color.cfg) (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def) (c:/texlive/2025/texmf-dist/tex/latex/graphics/mathcolor.ltx)) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./test.aux) (c:/texlive/2025/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) Here is my test.log file: This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex 2026.2.20) 20 FEB 2026 17:50 entering extended mode restricted \write18 enabled. file:line:error style messages enabled. %&-line parsing enabled. **c:/Users/REDACTED/test/test.tex (c:/Users/REDACTED/test/test.tex LaTeX2e <2025-11-01> L3 programming layer <2026-01-19> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count275 \c@section=\count276 \c@subsection=\count277 \c@subsubsection=\count278 \c@paragraph=\count279 \c@subparagraph=\count280 \c@figure=\count281 \c@table=\count282 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen148 ) (c:/texlive/2025/texmf-dist/tex/latex/tools/longtable.sty Package: longtable 2025-10-13 v4.24 Multi-page Table package (DPC) \LTleft=\skip51 \LTright=\skip52 \LTpre=\skip53 \LTpost=\skip54 \LTchunksize=\count283 \LTcapwidth=\dimen149 \LT@head=\box53 \LT@firsthead=\box54 \LT@foot=\box55 \LT@lastfoot=\box56 \LT@gbox=\box57 \LT@cols=\count284 \LT@rows=\count285 \c@LT@tables=\count286 \c@LT@chunks=\count287 \LT@p@ftn=\toks17 ) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul.sty Package: soul 2023-06-14 v3.1 Permit use of UTF-8 characters in soul (HO) (c:/texlive/2025/texmf-dist/tex/generic/soul/soul-ori.sty Package: soul-ori 2023-06-14 v3.1 letterspacing/underlining (mf) \SOUL@word=\toks18 \SOUL@lasttoken=\toks19 \SOUL@syllable=\toks20 \SOUL@cmds=\toks21 \SOUL@buffer=\toks22 \SOUL@token=\toks23 \SOUL@syllgoal=\dimen150 \SOUL@syllwidth=\dimen151 \SOUL@charkern=\dimen152 \SOUL@hyphkern=\dimen153 \SOUL@dimen=\dimen154 \SOUL@dimeni=\dimen155 \SOUL@minus=\count288 \SOUL@comma=\count289 \SOUL@apo=\count290 \SOUL@grave=\count291 \SOUL@spaceskip=\skip55 \SOUL@ttwidth=\dimen156 \SOUL@uldp=\dimen157 \SOUL@ulht=\dimen158 ) (c:/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (c:/texlive/2025/texmf-dist/tex/generic/etexcmds/etexcmds.sty Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO) (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2024/12/12 v1.0g TeX engine tests ))) (c:/texlive/2025/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2024/09/29 v3.02 LaTeX color extensions (UK) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: pdftex.def on input line 274. (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2025/09/29 v1.2d Graphics/color driver for pdftex ) (c:/texlive/2025/texmf-dist/tex/latex/graphics/mathcolor.ltx) Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1349. Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1353. Package xcolor Info: Model `RGB' extended on input line 1365. Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1367. Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1368. Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1369. Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1370. Package xcolor Info: Model `Gray' substituted by `gray' on input line 1371. Package xcolor Info: Model `wave' substituted by `hsb' on input line 1372. ) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count292 ) (./test.aux) \openout1 = `test.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checki Yes, it just cuts off in the middle of a line there. I can't decipher anything from these outputs, and I'm not sure what else to check. Please let me know whatever file you need to see to help figure this out. Thanks!

  • Advantage of \csname over \makeatletter (inside \pgfkeys/\tikzset)?
    by Sammy on February 20, 2026 at 3:29 pm

    In this answer https://tex.stackexchange.com/a/133357 to a question regarding TikZ I found the following comment inside a \tikzset: % Use csname so catcode of @ doesn't have do be changed. This leaves me wondering if using \csname has any advantage over changing the catcode of @ by wrapping \tikzset with \makeatletter - which inside a package wouldn't even be neccesary since inside a package @ is of catcode letter by default. Is the use of \makeatletter potentially problematic (in general or inside pgfkeys)? If so: In which cases is it advisable to use \csname instead of \makeatletter? As far as I can imgine it (practically?) should be just a matter of taste, otherwise using such code inside a package where @ is of catcode letter would be problematic?!

  • Thinspace with babel french?
    by nowox on February 20, 2026 at 12:47 pm

    I love LaTeX, but I also love french typography and I noticed that babel does not really add a thin space before the colon/semicolon: \documentclass{article} \usepackage[french]{babel} \addto\extrasfrench{% \renewcommand{\FBcolonspace}{\nobreak\thinspace}% } \begin{document} \large Le canard: un animal avec deux pattes. \end{document} Built with: latexmk -lualatex test.tex If I manually do it, the result is visually much better. \begin{document} \large Le canard\nobreak\thinspace: un animal avec deux pattes. \end{document} Is there a way to tweak babel to do it right?

  • Make a distorted circle a circle again, after rescaling in the `axis` environment
    by Máté Wierdl on February 20, 2026 at 3:53 am

    In the graph below the red "dots" get distorted due to unequal scaling. How can I make them circles again? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} % Parameter: epsilon \newcommand{\eps}{0.25} % Compute intersection x-values: \pgfmathsetmacro{\xint}{acos(1 - \eps)/360} \begin{axis}[xscale=2/3, yscale=0.4, width=10cm, % chose these to keep axis height=20cm, % from automatically rescaling to a square trig format=rad, domain = -1/2:1/2, axis y line=left, axis x line=bottom, axis line style = {-}, % makes arrow heads disappear; has to come % after "axis y line" and "axis x line" xtick = {-1/2, -\xint, 0, \xint, 1/2}, xticklabels = {$-1/2$, $-\delta$, $0$, $\delta$, $1/2$}, ytick = {-1, 1-\eps, 1}, yticklabels = {$-1$, $1-\epsilon$, $1$}, ] \addplot[smooth] { cos(2*pi*x) }; \draw[dashed] (-0.5, 1 - \eps) -- (0.5, 1 - \eps); \draw[dashed] (-\xint, -1) -- (-\xint, 1 - \eps); \draw[dashed] (\xint, -1) -- (\xint, 1 - \eps); \filldraw[red] (axis cs: -\xint,1 - \eps) circle (0.5cm); \filldraw[red] (axis cs: \xint,1 - \eps) circle (0.5cm); \end{axis} \end{tikzpicture} \end{document}

  • Is it possible to log the contents of a box without changing pdfTeX's return value?
    by cfr on February 19, 2026 at 4:17 pm

    Consider \documentclass{article} \begin{document} \ExplSyntaxOn \tl_set:Nn \l_tmpa_tl {abc} \tl_log:N \l_tmpa_tl \hbox_set:Nn \l_tmpa_box {abc} \box_log:N \l_tmpa_box \ExplSyntaxOff \end{document} This does exactly what I want, except that \box_log:N \l_tmpa_box changes pdfTeX's return value from 0 to 1, whereas compiling \documentclass{article} \begin{document} \ExplSyntaxOn \tl_set:Nn \l_tmpa_tl {abc} \tl_log:N \l_tmpa_tl \hbox_set:Nn \l_tmpa_box {abc} % \box_log:N \l_tmpa_box \ExplSyntaxOff \end{document} returns 0. Is it possible to log the contents of \l_tmpa_box without altering pdfTeX's exit code?

  • Create a directed graph
    by Dimitrios ANAGNOSTOU on February 19, 2026 at 4:15 pm

    I want to create the following figure. Using the following code, I managed to get something close. But I cannot figure out how to get properly the diagonal vectors without too much trial and error. Any ideas? Thanks a lot! \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{tikz} \usetikzlibrary{positioning,arrows.meta} \begin{document} \begin{figure}[!htpb] \centering \begin{tikzpicture}[ node distance=3cm, box/.style={draw, rectangle, minimum size=1.2cm, font=\large}, arr/.style={->, >=Stealth, thick} ] % Nodes \node[box] (1) {1}; \node[box, below=of 1] (2) {2}; \node[box, right=of 1] (3) {3}; \node[box, below=of 3] (4) {4}; % Labels n_i \node[above=3mm of 1] {$n_1=3$}; \node[above=3mm of 3] {$n_3=1$}; \node[below=3mm of 2] {$n_2=2$}; \node[below=3mm of 4] {$n_4=2$}; % Horizontal 1 <-> 3 (two parallel arrows) \draw[arr] ([yshift=4pt]1.east) -- ([yshift=4pt]3.west); \draw[arr] ([yshift=-4pt]3.west) -- ([yshift=-4pt]1.east); % Vertical left \draw[arr] (1) -- (2); % Vertical right \draw[arr] (4) -- (3); % Bottom horizontal \draw[arr] (2) -- (4); % Diagonals \draw[arr] (2) -- (3); \draw[arr] ([xshift=-4pt]4.north) -- ([xshift=4pt]1.south); \draw[arr] ([xshift=-4pt]1.south) -- ([xshift=4pt]4.north); \end{tikzpicture} \end{figure} \end{document}

  • how to put a character between dollars
    by Jordi Pinyol on February 19, 2026 at 12:18 pm

    In texmaker how can you put a character (or more) between dollars automatically, just like you can do with emphasis. For example: x=y -> select and execute a command -> $x=y$

  • forcing kerning for italics correction in command
    by Stefan Müller on February 19, 2026 at 8:30 am

    I wrote a command that puts a string in italics either in math mode or in text mode. I use it for typing "types". They have to be in italics in my theory and so it is not just \textit but the command says something about the content. Now, for some situations my macro has strange effects. While \emphputs a following comma close to the italicized "f", my command does not. Is there a way to achieve this? Edit: The italics should come out as normalfont italics even if the environment is small caps: \textsc{\type{inf}}. \documentclass{scrartcl} \newcommand{\type}[1]{\ifmmode\mathit{#1}\else\textnormal{\textit{#1}}\fi} \begin{document} \noindent \emph{inf},\\ \type{inf}, \end{document}

  • Is it possible to implement loop in TikZ like xypic?
    by YCH817 on February 18, 2026 at 8:54 pm

    I have tried plotting loop arrows with different sizes using xypic and tikz : \documentclass{article} \usepackage[a4paper, landscape=true]{geometry} \usepackage{graphicx} % Required for inserting images \usepackage[curve,pdf,all]{xy} \usepackage[svgnames,dvipsnames]{xcolor} \usepackage{tikz} \begin{document} $\begin{xy} (0,0)*+<5pt,3pt>[F-:<3pt>:red][F*:<3pt>:pink]{\vphantom{fg}x}="x", \ar@`{"x"+(-10,+10),"x"+(+10,+10)}^{1} \ar@`{"x"+(-20,+20),"x"+(+20,+20)}^{2} \ar@`{"x"+(-30,+30),"x"+(+30,+30)}^{3} \ar@`{"x"+(-40,+40),"x"+(+40,+40)}^{4} \ar@`{"x"+(-50,+50),"x"+(+50,+50)}^{5} \ar@`{"x"+(-60,+60),"x"+(+60,+60)}^{6} \ar@`{"x"+(+10,-10),"x"+(-10,-10)}^{1} \ar@`{"x"+(+20,-20),"x"+(-20,-20)}^{2} \ar@`{"x"+(+30,-30),"x"+(-30,-30)}^{3} \ar@`{"x"+(+40,-40),"x"+(-40,-40)}^{4} \ar@`{"x"+(+50,-50),"x"+(-50,-50)}^{5} \ar@`{"x"+(+60,-60),"x"+(-60,-60)}^{6} \end{xy}$ % --- \tikz{ \node [ draw, line width=.4pt, rounded corners=5pt, inner sep=3pt ] (x) at (0,0) {$x\vphantom{fg}$}; \foreach \i in {1,2,3,...,6} { \draw[->] (x) .. controls +(-\i,+\i) and +(+\i,+\i) .. (x) ; \draw[->] (x) .. controls +(+\i,-\i) and +(-\i,-\i) .. (x) ; }} \end{document} and here is the output : xypic : tikz : I noticed that the loop curve produced by tikz is a little bit squashed (especially the smallest curve, I think it is quite ugly -_-||), compared to the one produced by xypic. Since I am starting to use LuaLaTeX as compiling engine and I cannot use xypic with pdf option in LuaLaTex, I wonder if there is a good way to make tikz produce loop curves like the one produced by xypic. Also luamplib code is welcome.

  • uneven commutative diagram
    by mappingmoe on February 18, 2026 at 11:33 am

    I want to draw the following commutative diagram in LaTeX: I have tried tikzcd, but I think I won't work, since the rows have different size. Is there a clean way to do it? EDIT: my first approach was the following: \documentclass[a4paper]{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} P \arrow{l}{pr} \arrow{d}{\pi} & TP \arrow{d}{T \pi}\\ I \arrow{ur}{\tilde{\gamma}} \arrow{r}{\dot{\gamma}} & M \arrow{l}{pr} & TM \end{tikzcd} \end{document}

  • Issue attempting "fullwidth" image on document
    by Atiroocky on February 18, 2026 at 10:22 am

    I'm writting report in "Tufte-style" with scrreprt koma-script class. I'm quite happy with the result, but I cannot figure out how to put a figure in full width of the page. I want to keep using koma-script (instead of tufte-style class) because my document contains numerous formating options. To make the report looking like Tufte-style and avoid some conflicts in the margin section, I use : sidenotesplus (provides fullwidth environment with \begin{figure*}…\end{figure*}) marginfix (to avoid conflicts like overlapping, or shifting out of page in margin) Here is the MWE (I only keep 1/3 of all packages, but the misbehavior keep happening). First remark : Claude suggests me calling the addmarginenvironnement. It works, but that does not solve the root issue. Second remark: I thought of a conflict between koma-scriptand geometrypackages. I tried to disable geometryand setup the typearea and margin dimensions with koma options -> same result with the figure shifting on right. Thanks for your help 😉 \documentclass[% parskip=half, oneside, ]{scrreprt} \usepackage[% a4paper, top=10mm, right=15mm, left=90mm, bottom=10mm, headheight=15mm, includeheadfoot, marginparwidth=7cm, marginparsep=9mm, showframe, ]{geometry} \usepackage[T1]{fontenc} \usepackage{scrlayer-scrpage} \usepackage{marginfix} \usepackage[french]{babel} \usepackage{lipsum} \usepackage{xcolor} \usepackage{graphicx} \usepackage{sidecap} \usepackage{subcaption} \usepackage[% mark=arabic, size=footnote, font=sf, shape= up, per=section, ]{sidenotesplus} \pagestyle{scrheadings} \reversemarginpar \title{Report MWE} \author{Name} \date{February 2026} \begin{document} \newgeometry{ a4paper, top=10mm, right=30mm, left=30mm, bottom=10mm, headheight=15mm, includeheadfoot, } \maketitle \tableofcontents \restoregeometry %------------------------------------------------------------- \pagebreak \chapter{First chapter} \section{Introduction - figure in typearea} \lipsum[1] \begin{figure}[h!] \centering \includegraphics[width=\linewidth]{example-image-a} \caption{Figure in text} \end{figure} \newpage \section{First section - figure in margin} First paragragh with a sidenote.\sidenote{First sidenote of report}\\ \lipsum[1-2] \begin{marginfigure} \centering \includegraphics[width=\linewidth]{example-image-b} \caption{Figure in margin} \end{marginfigure} \begin{marginfigure} \centering \includegraphics[width=\linewidth]{example-image-b} \caption{Figure in margin} \end{marginfigure} \begin{marginfigure} \centering \includegraphics[width=\linewidth]{example-image-b} \caption{Figure in margin} \end{marginfigure} Last paragraph of section.\sidenote{second sidenote of report} \newpage \section{Second section - attempt full width} \lipsum[1] \begin{figure*} \centering \includegraphics[width=\linewidth]{example-image-c} \caption{Figure full width ?} \end{figure*} \newpage \section{Third section - work around with addmargin} \begin{figure}[h!] \centering \begin{addmargin*}[-\dimexpr\marginparwidth+\marginparsep\relax]{0pt} \centering \includegraphics[width=\linewidth]{example-image-c} \caption{Figure full width with workaround addmargin} \end{addmargin*} \end{figure} \end{document}

  • Libertine font features missing when compiling with xelatex or lualatex
    by Alf on February 18, 2026 at 8:21 am

    I want to use the libertine package in my fonts, as I prefer them over the standard font. Here is a MWE % list every file used to standard output \listfiles \documentclass[ 12pt, a4paper, twoside, chapterprefix=true, % write "Chapter X" in separate line followed by chapter title fleqn, % equations are left-aligned (instead of centered) bibliography=totocnumbered % give bibliography a chapter number and add to ToC ]{scrbook} % for hyphenation for languages with accented characters (should be before inputenc) \usepackage[T1]{fontenc} % load Libertine (Serif), Biolinum (Sans), and Libertine Mono % must be loaded AFTER fontenc \usepackage{libertine} % <---- CHECK THE COMPILATION WARNING!!!!!!!!!!!!!!!!!!!!!!! % allows you to write Umlaute directly \usepackage[utf8]{inputenc} % load the babel package for the english language \usepackage[english]{babel} \begin{document} bla bla bla \end{document} When I compile with pdflatex I get no error/warning. I prefer to use latexmk though, and when I compile with xelatex or lualatex, I get the following warnings: Package fontspec Warning: OpenType feature 'Numbers=Uppercase' (lnum) not available for font 'LinBiolinum_RB' with script 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Numbers=Uppercase' (lnum) not available for font 'LinBiolinum_RB' with script 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Numbers= Monospaced, Lining' (tnum) not available for font 'LinLibertine_RZI' with script 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Numbers= Monospaced, Lining' (tnum) not available for font 'LinLibertine_RZI' with script 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Numbers=Uppercase' (lnum) not available for font 'LinBiolinum_RB' with script 'CustomDefault' and language 'Default'. Package fontspec Warning: OpenType feature 'Numbers=Uppercase' (lnum) not available for font 'LinBiolinum_RB' with script 'CustomDefault' and language 'Default'. This is the output of *File List*: scrbook.cls 2023/07/07 v3.41 KOMA-Script document class (book) scrkbase.sty 2023/07/07 v3.41 KOMA-Script package (KOMA-Script-dependent basics and keyval usage) scrbase.sty 2023/07/07 v3.41 KOMA-Script package (KOMA-Script-independent b asics and keyval usage) scrlfile.sty 2023/07/07 v3.41 KOMA-Script package (file load hooks) scrlfile-hook.sty 2023/07/07 v3.41 KOMA-Script package (using LaTeX hooks) scrlogo.sty 2023/07/07 v3.41 KOMA-Script package (logo) keyval.sty 2022/05/29 v1.15 key=value parser (DPC) tocbasic.sty 2023/07/07 v3.41 KOMA-Script package (handling toc-files) fleqn.clo 2016/12/29 v1.2b Standard LaTeX option (flush left equations) scrsize12pt.clo 2023/07/07 v3.41 KOMA-Script font size class option (12pt) typearea.sty 2023/07/07 v3.41 KOMA-Script package (type area) fontenc.sty 2021/04/29 v2.0v Standard LaTeX package t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern libertine.sty 2023/11/26 (Bob Tennent) Supports Libertine and Biolinum fonts for all LaTeX engines. ifxetex.sty 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead. iftex.sty 2022/02/03 v1.0f TeX engine tests ifluatex.sty 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead. xkeyval.sty 2022/06/16 v2.9 package option processing (HA) xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) textcomp.sty 2020/02/02 v2.0n Standard LaTeX package fontspec.sty 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX xparse.sty 2023-10-10 L3 Experimental document command parser expl3.sty 2024-01-22 L3 programming layer (loader) l3backend-luatex.def 2024-01-04 L3 backend support: PDF output (LuaTeX) fontspec-luatex.sty 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX fontenc.sty 2021/04/29 v2.0v Standard LaTeX package fontspec.cfg LinLibertine_R.tex LinBiolinum_R.tex LinBiolinum_K.tex LinLibertine_I.tex LKey.tex inputenc.sty 2021/02/14 v1.3d Input encoding file babel.sty 2024/01/07 v24.1 The Babel package english.ldf 2017/06/06 v3.3r English support from the babel system babel-english.tex ts1cmr.fd 2023/04/13 v2.5m Standard LaTeX font definitions Any ideas how to get rid of that warnings, i.e. getting these missing features? Update: as requested, the output at the very end of the compilation, when using lualatex: </usr/share/texlive/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf> I installed the fonts by copying them into ~/.local/share/fonts/ and run fc-cache -f -v afterwards, which I thought should be sufficient - or did I miss a step?

  • Generate random, unique, nonzero integers
    by pwesterbaan on February 17, 2026 at 8:14 pm

    I've been writing some commands that I use to randomize writing exam questions. I currently have the following code for generating "variables" containing (possibly non-zero) random integers: \newcommand{\randIntLower}{1} %Lower bound on rand ints \newcommand{\randIntUpper}{5} %Upper bound on rand ints \newcommand{\randIntTemp}{} %Used for defining values in randInts \newcommand{\randInts}[2][]{% % #1 = option (default: []; Use nz for nonzero) % #2 = list of variables % Uses \randIntLower and \randIntUpper as bounds (change with renewcommand if needed) \foreach \var in {#2}{% \ifstrequal{#1}{nz}{% % nonzero method: produces +/- nonzero random integers \pgfmathparse{int(ifthenelse(rand > 0, 1, -1)*random(\randIntLower,\randIntUpper))}% \expandafter\xdef\var{\pgfmathresult}% }{% \pgfmathrandominteger{\randIntTemp}{\randIntLower}{\randIntUpper}% \expandafter\xdef\var{\randIntTemp}% }% }% } This gives me something like this: \randInts[nz]{\randOne,\randTwo,\randThree} %\randOne -> 4 %\randTwo -> -2 %\randThree -> 4 This code works well enough, with the exception that I might get repeat random numbers. I've also been running into some of the limitations of pgfmath, so I'm now trying to rewrite the above using LaTeX3 syntax (hopefully fewer issues with calculations, and optional arguments aren't as positional). My hope is to have something that behaves as such: \randInts[nz]<1>(5){randOne, randTwo, randThree} %\randOne -> 4 %\randTwo -> -2 %\randThree -> 4 \randInts*[nz]<1>(5){randOne, randTwo, randThree} %\randOne -> 4 %\randTwo -> -2 %\randThree -> 6 It grieves me to say this, but I've been trying to write this with the help of Github's CoPilot. I have been reading whatever Latex3 documentation I could find (e.g. xparse, expl3, l3kernel), but for now, this is what I've got: \ExplSyntaxOn% % Flag: whether to generate ±nonzero \bool_new:N \l__randints_nonzero_bool % Parsed bounds \int_new:N \l__randints_min_int \int_new:N \l__randints_max_int \bool_new:N \l__randints_unique_bool \clist_new:N \l__randints_used_clist \int_new:N \l__randints_range_len_int \int_new:N \l__randints_slots_int % \randInts[nz?]<min>(max){name1,name2,...} % - [nz] or [nonzero]: produce ±(magnitude), where magnitude in [min,max] % - <min> and (max) are *separate* optional delimited args; defaults are 1 and 5 % - names are bare (no leading \); defines \name globally to the drawn integer \cs_new_protected:Npn \__randints_pick_unique:nn #1 #2 { \int_set:Nn \l_tmpa_int { \int_rand:nn { #1 } { #2 } } \prg_do_while:nn { \clist_if_in:NnTF \l__randints_used_clist { \int_to_arabic:n { \l_tmpa_int } } { \prg_return_true: }{ \prg_return_false: } } { \int_set:Nn \l_tmpa_int { \int_rand:nn { #1 } { #2 } } } } \cs_new_protected:Npn \__randints_pick_unique_signed:nn #1 #2 { % Loop until we find a nonzero signed value not yet used \int_zero:N \l_tmpa_int \prg_do_while:nn { % pick magnitude \int_set:Nn \l_tmpb_int { \int_rand:nn { #1 } { #2 } } % reject zero magnitude \int_compare:nNnTF { \l_tmpb_int } = { 0 } { \prg_return_true: } { % pick sign and form signed value \int_set:Nn \l_tmpc_int { \int_rand:nn { 0 } { 1 } } \int_set:Nn \l_tmpc_int { \int_eval:n { ( \l_tmpc_int * 2 - 1 ) * \l_tmpb_int } } \clist_if_in:NnTF \l__randints_used_clist { \int_to_arabic:n { \l_tmpc_int } } { \prg_return_true: } { \int_set:Nn \l_tmpa_int { \l_tmpc_int } \prg_return_false: } } } { } } \NewDocumentCommand \randInts { s o D<>{\randIntLower} D(){\randIntUpper} m } { % Determine nonzero mode from [ #2 ] \bool_set_false:N \l__randints_nonzero_bool \IfNoValueF{#2}{ \tl_if_eq:nnT {#2} {nz} { \bool_set_true:N \l__randints_nonzero_bool } } % starred variant -> unique values (no repeats): #1 is boolean from `s` \IfBooleanTF{#1} { \bool_set_true:N \l__randints_unique_bool } { \bool_set_false:N \l__randints_unique_bool } % Normalize order (so <7>(3) becomes [3,7]) \int_set:Nn \l_tmpa_int { \int_min:nn { \l__randints_min_int } { \l__randints_max_int } } \int_set:Nn \l_tmpb_int { \int_max:nn { \l__randints_min_int } { \l__randints_max_int } } \int_set_eq:NN \l__randints_min_int \l_tmpa_int \int_set_eq:NN \l__randints_max_int \l_tmpb_int % If unique requested, check availability and clear used list \int_set:Nn \l__randints_range_len_int { \int_eval:n { \l__randints_max_int - \l__randints_min_int + 1 } } % compute available slots for uniqueness \int_set:Nn \l__randints_slots_int { \l__randints_range_len_int } \bool_if:NTF \l__randints_unique_bool { \bool_if:NTF \l__randints_nonzero_bool { \int_set:Nn \l__randints_slots_int { \int_eval:n { 2 * \l__randints_range_len_int } } \int_compare:nNnT { \l__randints_min_int } <= { 0 } { \int_compare:nNnT { \l__randints_max_int } >= { 0 } { \int_set:Nn \l__randints_slots_int { \int_eval:n { \l__randints_slots_int - 2 } } } } } { \int_set:Nn \l__randints_slots_int { \l__randints_range_len_int } } \int_compare:nNnTF { \clist_count:n {#5} } > { \l__randints_slots_int } { \PackageError{exam}{Not~enough~unique~integers}{Requested~more~unique~integers~than~available~in~range.} } { \clist_clear:N \l__randints_used_clist } } { \clist_clear:N \l__randints_used_clist } % Generate for each bare name and define \name globally \clist_map_inline:nn { #5 } { \bool_if:NTF \l__randints_nonzero_bool { % \pm nonzero: sign * magnitude (support unique/starred) \bool_if:NTF \l__randints_unique_bool { \__randints_pick_unique_signed:nn { \l__randints_min_int } { \l__randints_max_int } \cs_gset:cpn { ##1 } { \int_to_arabic:n { \l_tmpa_int } } \tl_set:Nx \l_tmpa_tl { \int_to_arabic:n { \l_tmpa_int } } \clist_put_right:Nn \l__randints_used_clist { \l_tmpa_tl } } { \cs_gset:cpn { ##1 } { \int_eval:n { ( \int_rand:nn {0}{1} * 2 - 1 ) * \int_rand:nn { \l__randints_min_int } { \l__randints_max_int } } } } } { % Plain integer in [min,max] or unique selection if starred \bool_if:NTF \l__randints_unique_bool { % pick a unique random value via recursion \__randints_pick_unique:nn { \l__randints_min_int } { \l__randints_max_int } \cs_gset:cpn { ##1 } { \int_to_arabic:n { \l_tmpa_int } } \tl_set:Nx \l_tmpa_tl { \int_to_arabic:n { \l_tmpa_int } } \clist_put_right:Nn \l__randints_used_clist { \l_tmpa_tl } } { \cs_gset:cpn { ##1 } { \int_rand:nn { \l__randints_min_int } { \l__randints_max_int } } } } } } \ExplSyntaxOff% The issues I'm running into are that prg_do_while does not actually exist. The other recommendation that Co-Pilot had was to do a recursive call, but this seems like a worse idea. So, my questions are: What is the syntax for the while loop? How should I write this code? Am I over-complicating this whole problem? EDIT Based on @David Carlisle's and @egreg's suggestions, I came up with the following code: \ExplSyntaxOn \NewDocumentCommand \newrandInts { s o D<>{\randIntLower} D(){\randIntUpper} m O{1} }{ % \randInts[nz?]<min>(max){name1,name2,...}[t] % - [nz]: produce pm(magnitude), where magnitude in [min,max] % - <min> and (max) are *separate* optional delimited args; defaults are 1 and 5 % - clist of names; defines \name globally to the drawn integer % - optional randInt multiplier t (defaults to 1) \tl_clear_new:N \l__my_number_tl \seq_clear_new:N \l_numbers_seq \tl_if_eq:nnT {#2} {nz}{ \int_step_inline:nnn {-#4}{-#3} { \seq_put_right:Nn \l_numbers_seq { \fp_eval:n{ ##1 * #6 } } } } \int_step_inline:nnn {#3}{#4} { \seq_put_right:Nn \l_numbers_seq { \fp_eval:n{ ##1 * #6 } } } \seq_shuffle:N \l_numbers_seq \clist_map_inline:nn { #5 } { \IfBooleanTF{#1}{ \seq_pop_left:NN \l_numbers_seq \l__my_number_tl \cs_gset:cpx { ##1 } { \tl_use:N \l__my_number_tl } }{ \cs_gset:cpx { ## 1 } { \seq_rand_item:N \l_numbers_seq } } } } \ExplSyntaxOff I use the code like this: \newrandInts*[nz]{a,b,c,d}[3] \a, \b, \c, \d % prints nonzero random integers between -5 and 5 % multiplied by 3 without repeats: % -3, -9, 3, -6 \newrandInts{a,b,c,d}[0.1] \a, \b, \c, \d % prints random integers between 1 and 5 % multiplied by 0.1 with repeats possible: % 0.3, 0.5, 0.4, 0.1 The multiplication by a scalar was a bit of an afterthought because my current workflow is define random integers, then scale them up.

  • Listingsutf8 (plus a JSON preset) Accents moved at start of words (avéré => ééavr)
    by pikachuyann on February 17, 2026 at 4:15 pm

    I am trying to represent a JSON in my document which for documentation purpose has french descriptions inside of strings (which I would like to keep here as the "placeholders" they are). But I don't exactly understand how the string coloring works in listings(utf8) and it seems to move all the accents to the beginning of their words, which isn't ideal. Here's a "minimal" "working" example \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{xcolor} \usepackage{listingsutf8} \lstset{ inputencoding=utf8, extendedchars=\true, showstringspaces=false, } % The code for JSON is copied from https://gist.github.com/ed-cooper/1927af4ccac39b083440d436d018d253 % obviously I don't understand it fully, and the documentation of listings says absolutely nothing about how coloration of strings work (which is the problem here) \definecolor{jsondelim}{RGB}{20,105,176} \definecolor{jsonnumb}{RGB}{106, 109, 32} \definecolor{jsonstring}{rgb}{0.64,0.08,0.08} \lstdefinelanguage{json}{ numbers=left, numberstyle=\small, frame=single, rulecolor=\color{black}, showspaces=false, showtabs=false, breaklines=true, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{gray}\hookrightarrow\space}}, breakatwhitespace=true, basicstyle=\ttfamily\small, upquote=true, morestring=[b]", stringstyle=\color{jsonstring}, literate= *{0}{{{\color{jsonnumb}0}}}{1} {1}{{{\color{jsonnumb}1}}}{1} {2}{{{\color{jsonnumb}2}}}{1} {3}{{{\color{jsonnumb}3}}}{1} {4}{{{\color{jsonnumb}4}}}{1} {5}{{{\color{jsonnumb}5}}}{1} {6}{{{\color{jsonnumb}6}}}{1} {7}{{{\color{jsonnumb}7}}}{1} {8}{{{\color{jsonnumb}8}}}{1} {9}{{{\color{jsonnumb}9}}}{1} {\{}{{{\color{jsondelim}{\{}}}}{1} {\}}{{{\color{jsondelim}{\}}}}}{1} {[}{{{\color{jsondelim}{[}}}}{1} {]}{{{\color{jsondelim}{]}}}}{1} } % --- end of copied json \begin{document} \begin{lstlisting}[language=JSON] "A string with accents - Du texte accentué - Note that accents move to the beginning of a word - Le déplacement des accents est avéré" \end{lstlisting} \end{document} It displays the string somewhat properly (in "red"), except the accents are (a) in front of their respective words (b) in black : Do any one have experienced this and has got ideas ?