Hot
- 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 graphby 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}
- I am trying to \protected@edef a bmatrix, and then I token.get_macro that token from Lua, so I can print it to the .tex at a later timeby Jasper on February 19, 2026 at 3:25 pm
I am trying to \protected@edef a bmatrix, and then I token.get_macro that token from Lua, so I can print it to the .tex at a later time. The error: WARNING: mathml missing for hash E6607B372B3A7F4DE18DB36E2B449CBD ! You can't use `\spacefactor' in math mode. \@->\spacefactor \@m {} \DocumentMetadata{ lang = en ,pdfversion = 2.0 ,pdfstandard = {UA-2} ,tagging = on } \tagpdfsetup {math/mathml/luamml/load=true} \documentclass{article} \usepackage{luacode,unicode-math,tikz} \begin{document} \makeatletter \protected@edef\COUNTDOOKU{\( \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \)} \makeatother \begin{tikzpicture} \begin{luacode*} tex.sprint( ("\\node at (0,0) {%s};") :format( token.get_macro("COUNTDOOKU") ) ) \end{luacode*} \end{tikzpicture} \end{document}
- Adjust tabularx with X columns to text widthby cis on February 19, 2026 at 2:22 pm
In the following table, I'm trying to simulate a larger table using the original settings. The p-columns (p1, p2, ..., p7) should be evenly distributed across the remaining text width. So, I've chosen \newcolumntype{Y}{>{\centering\arraybackslash}X} for them. The rest are c-columns. To me, it looks like the table fits within the text width, but I'm still getting Overfull \hbox (1.16014pt too wide). How can I fix this? \documentclass[paper=a5]{scrartcl} \usepackage[margin=14mm, showframe]{geometry} \usepackage{xcolor} \usepackage{diagbox} \usepackage{colortbl} \usepackage{tabularx} \newcolumntype{Y}{>{\centering\arraybackslash}X} \newcolumntype{K}{>{\cellcolor{pink}}c} \newcolumntype{S}{>{\cellcolor{lightgray}}c} \begin{document} \section{Tabularx with overfull hbox} \begingroup \setlength\arrayrulewidth{1pt}% test: correctness of the rules \footnotesize\sffamily % used \noindent% \begin{tabularx}{\textwidth}{c | K | *{7}{Y} | S | l } \hline $n$ & \diagbox{$k$}{$p$} & p1 & p2 & p3 & p4 & p5 & p6 & p7 & \diagbox{$p$}{$k$} \\ \hline 100 & 22 % 3 and 2 digits & 0.1111 % with leading zero & .2222 & .3333 & .4444 & .5555 & .6666 & .7777% without ~ & 22 % 2 digits \end{tabularx} \endgroup \end{document}
- how to put a character between dollarsby 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$ a texmaker com es pot posar un caracter (o mes) entre dolars automaticament, igual que es pot fer amb emphasis. Per exemple: x=y -> seleccionem i executem un comandament -> $x=y$
- forcing kerning for italics correction in commandby 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.
- Adjusting the Indentation for Paragraph Style Index Entriesby DDS on February 18, 2026 at 8:44 pm
Consider the code: \documentclass[12pt]{book} \usepackage{imakeidx} \usepackage[itemlayout= singlepar]{idxlayout} \makeindex \begin{document} \Large Some words.\index{Heading@\textbf{Heading}! 1. This is the first index entry.} \newpage Some more words.\index{Heading@\textbf{Heading}! 2. This is the second index entry.} \newpage Some more words.\index{Heading@\textbf{Heading}! 3. This is the third index entry.}\index{Heading@\textbf{Heading}! 4. This is the fourth index entry.} \newpage Some more words.\index{Heading@\textbf{Heading}! 5. This is the fifth index entry.} \idxlayout{columns=1} \printindex \end{document} which produces the Index: QUESTION: How may I make an adjustment (either increase or decrease) to the width of the indent under "Heading"? Thank you.
- Looking for a developer for Newspaper project [closed]by Rich Resnick on February 18, 2026 at 5:11 pm
I’m building a newspaper and am having trouble with Continue plugin and use of multiple flows on a single page template. If there are any experts on this forum that are interested in a consulting engagement, please reach out to me! Thank you!!
- Rotated and not rotated cells in the first table rowby forrest on February 18, 2026 at 4:57 pm
How to make a table with rotated labels in the first row and centered first-row first-column cell content that is not rotated? I found nicematrix package to be the most powerful tool for making tables, therefore I am trying to apply it. There is almost identical case, nevertheless still I can't solve my problem by the rearrangement of the code given in the answer. Code: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{siunitx} \usepackage{makecell} \usepackage{multirow} \usepackage{nicematrix} \usepackage{booktabs} \renewcommand{\arraystretch}{1.3} \begin{document} \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{N}{S[table-format=3.0]} \begin{NiceTabular}{L{35mm}NNNNNNN} \toprule \multirow{2}{\linewidth}{\begin{minipage}[c]{\linewidth}\centering Long list of items to be listed in the table\end{minipage}}&&&&&&&\\ & \multicolumn{1}{c}{\rotate{First}} & \multicolumn{1}{c}{\rotate{Second}} & \multicolumn{1}{c}{\rotate{Third}} & \multicolumn{1}{c}{\rotate{\makecell{Fourth is much\\longer}}} & \multicolumn{1}{c}{\rotate{Fifth}} & \multicolumn{1}{c}{\rotate{Sixth}} & \multicolumn{1}{c}{\rotate{\makecell{Seventh is\\the longest item}}}\\ \midrule Description of numbers & 188 & 128 & 229 & 32 & 55 & 22 & 222\\ Very long description of numbers in the table & 765 & 654 & 534 & 34 & 45 & 56 & 67\\ One more row & 1 & 2 & 3 & 4 & 5 & 6 & 7\\ \bottomrule \end{NiceTabular} \end{document}
- Switch option 'headinclude' in KOMA-Script by pagestyleby Igor Yukhimenko on February 18, 2026 at 1:28 pm
In a KOMA document I toggle the headings \KOMAoptions{headinclude=on} \KOMAoptions{DIV=last} It works. But I need to create a custom style where this heading is not taken into account. I can create a style like this, but I don't see a way to specify this in the style parameter \documentclass[11pt, open=right, paper=200mm:136mm,% BCOR=7mm, DIV=14, headinclude=off, footinclude=off]{scrbook} \usepackage{showframe} \AfterCalculatingTypearea{% \setlength{\headsep}{1.2em} } \KOMAoptions{DIV=last} \usepackage{polyglossia} % пакет для української мови \setmainlanguage{ukrainian} \hyphenrules{ukrainian} % ВИПРАВЛЕННЯ ГІФЕНАЦІЇ ДЛЯ УКРАЇНСЬКОЇ \usepackage[final]{microtype} \usepackage{eso-pic} \usepackage[normalem]{ulem} \usepackage{scrlayer-scrpage} \usepackage{tinos} \usepackage[default]{raleway} \author{Ігор Юхименко} \title{Подарунок осені} \makeatletter \let\booktitle\@title \let\bookauthor\@author \makeatother \setsansfont{Raleway} \DeclareNewLayer[% textarea,% contents={% \rule{\textwidth}{1.2pt}% }]{page.chapter.line} \newpagestyle{scrheadchap}{}{} \AddLayersToPageStyle{scrheadchap}{page.chapter.line} \rehead{\bookauthor} \lohead{\booktitle} \RedeclareSectionCommand[ beforeskip = 8em plus 1em minus 0.5em, afterskip = 0.6em minus 0.1em, font = \Large, pagestyle = scrheadchap ]{chapter} %================================================================== % | % BEGIN OF DOCUMENT | % | %================================================================== \begin{document} Осінь. Чудова пора. Вже не відчувається літня спека. Повітря стає чи- стішим та прохолоднішим. в цей час найкраще підбивати підсумки того, що було зроблено за літо. Адже осінь проявляє все, що було зроблено та бу- ло упущено, коли для цього траплялася найкраща нагода — теплі сонячні та ясні літні дні. Як би там не було, але за осінню завжди прийде зима, яка вкриє все снігом. Тепер всі помилки видні як найкраще. Проте, навіть, якщо ти й зробив якусь помилку влітку, це — не страшно. Адже в сучасному суспіль- стві (принаймні мені б хотілося в це вірити) пропасти з голоду практично неможливо. Завжди знайдуться люди які тебе підтримають й допоможуть. І якось більш-менш вдасться дотягнути до весни. А там — вже й до літа не- далеко. І вже однозначно, з’явиться ще одна нагода виправити помилки допущені минулого року. \clearpage \KOMAoptions{headinclude=on} \KOMAoptions{DIV=last} Осінь. Чудова пора. Вже не відчувається літня спека. Повітря стає чи- стішим та прохолоднішим. в цей час найкраще підбивати підсумки того, що було зроблено за літо. Адже осінь проявляє все, що було зроблено та бу- ло упущено, коли для цього траплялася найкраща нагода — теплі сонячні та ясні літні дні. Як би там не було, але за осінню завжди прийде зима, яка вкриє все снігом. Тепер всі помилки видні як найкраще. Проте, навіть, якщо ти й зробив якусь помилку влітку, це — не страшно. Адже в сучасному суспіль- стві (принаймні мені б хотілося в це вірити) пропасти з голоду практично неможливо. Завжди знайдуться люди які тебе підтримають й допоможуть. І якось більш-менш вдасться дотягнути до весни. А там — вже й до літа не- далеко. І вже однозначно, з’явиться ще одна нагода виправити помилки допущені минулого року. \chapter{This page must have "Headinclude=off", as first} Осінь. Чудова пора. Вже не відчувається літня спека. Повітря стає чи- стішим та прохолоднішим. в цей час найкраще підбивати підсумки того, що було зроблено за літо. Адже осінь проявляє все, що було зроблено та бу- ло упущено, коли для цього траплялася найкраща нагода — теплі сонячні та ясні літні дні. Як би там не було, але за осінню завжди прийде зима, яка вкриє все снігом. Тепер всі помилки видні як найкраще. Проте, навіть, якщо ти й зробив якусь помилку влітку, це — не страшно. Адже в сучасному суспіль- стві (принаймні мені б хотілося в це вірити) пропасти з голоду практично неможливо. Завжди знайдуться люди які тебе підтримають й допоможуть. І якось більш-менш вдасться дотягнути до весни. А там — вже й до літа не- далеко. І вже однозначно, з’явиться ще одна нагода виправити помилки допущені минулого року. \clearpage Осінь. Чудова пора. Вже не відчувається літня спека. Повітря стає чи- стішим та прохолоднішим. в цей час найкраще підбивати підсумки того, що було зроблено за літо. Адже осінь проявляє все, що було зроблено та бу- ло упущено, коли для цього траплялася найкраща нагода — теплі сонячні та ясні літні дні. Як би там не було, але за осінню завжди прийде зима, яка вкриє все снігом. Тепер всі помилки видні як найкраще. Проте, навіть, якщо ти й зробив якусь помилку влітку, це — не страшно. Адже в сучасному суспіль- стві (принаймні мені б хотілося в це вірити) пропасти з голоду практично неможливо. Завжди знайдуться люди які тебе підтримають й допоможуть. І якось більш-менш вдасться дотягнути до весни. А там — вже й до літа не- далеко. І вже однозначно, з’явиться ще одна нагода виправити помилки допущені минулого року. \end{document} \newpagestyle{scrheadchap}{\KOMAOption{headinctude=off}}{} takes no effects
- uneven commutative diagramby 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}
- How to modify `\lastskip` without inserting `\vskip`?by forrest on February 18, 2026 at 10:52 am
Or is it possible to assign \mylength to \lastskip, e.g. by \setlength{\lastskip}{\mylength}? This is the fourth time I ask this question (the previous one is here How to make a sign separating two fragments of text?), but this time I decided to focus on the first its part only. The goal is to create a macro that puts the asterisk-separator between two consecutive paragraphs. If this separator falls in the neighbourhood of some list (the second page of the attached graphics) then it should establish its surrounding vertical distances (denoted by u and v) the same as in the case of a neighbouring plain paragraph (the first page of the attached graphics). In the code below are 2 macros: \myfancybreak \myfancybreakbeforeenv But the task should be done by one macro \myfancybreak that manages with both above cases. Here (https://tex.stackexchange.com/a/668171) is the answer utilized by creation of this question. Code: \documentclass[11pt,twoside]{memoir} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathabx} \usepackage{lipsum} \usepackage{graphicx} % output data in log-file \showoutput \showboxdepth=3 \newtoks\realoutput \realoutput\output \output{% \batchmode \showboxbreadth\maxdimen \showboxdepth\maxdimen \showbox255 \the\realoutput } % page setup \setstocksize{115mm}{120mm} \settrimmedsize{115mm}{120mm}{*} \settypeblocksize{95mm}{100mm}{*} \setlrmargins{10mm}{*}{*} \setulmargins{10mm}{*}{*} \setheadfoot{0pt}{0pt} \settypeoutlayoutunit{mm} \checkandfixthelayout \raggedbottom \makeatletter \newenvironment{myquotation}{% \list{}{% {\setlength\leftmargin{\the\leftmargin}% \setlength\rightmargin{0mm}}% \listparindent=\parindent% \parsep=0cm% }% \item\relax\slshape% }{% \endlist%\par\nointerlineskip% } \makeatother \makeatletter \def\@xaddvskipreversed{% based on the standard definition of \@xaddvskip \ifdim\lastskip<\@tempskipb \vskip-\lastskip \vskip\@tempskipb \else \ifdim\@tempskipb<\z@ \ifdim\lastskip<\z@ \else % \advance\@tempskipb\lastskip \vskip-\lastskip \vskip\@tempskipb \fi \else \vskip-\lastskip % added \vskip\@tempskipb % added \fi \fi } \def\addvspacereversed#1{% based on the standard definition of \addvspace, just changed \@xaddvskip -> \@xaddvskipreversed \ifvmode \if@minipage\else \ifdim \lastskip =\z@ \begingroup\setlength\skip@{#1}\vskip\skip@\endgroup% \else \setlength\@tempskipb{#1}% \@xaddvskipreversed \fi \fi \else \@noitemerr \fi } \makeatother \newlength{\myfancybreakbeforelength} \newlength{\myfancybreakafterlength} \setlength{\myfancybreakbeforelength}{1.25\baselineskip} \setlength{\myfancybreakafterlength}{.5\baselineskip} \newcommand{\myfancybreaktext}[1]{{\par\nointerlineskip\addvspacereversed{\myfancybreakbeforelength}\centering #1\par}} \newcommand{\myfancybreak}[1]{% \myfancybreaktext{#1}% distance above the asterisk-separator and the separator itself \addvspace{\myfancybreakafterlength}% distance below the separator \par\nointerlineskip% } \newcommand{\myfancybreakbeforeenv}[1]{% \myfancybreaktext{#1}% distance above the asterisk-separator and the separator itself \addvspace{\glueexpr-\topsep-\parskip-\partopsep+\myfancybreakafterlength\relax}% distance below the separator \vskip 0pt\par\nointerlineskip% } \begin{document} \pagestyle{empty} \section{Distance between fancy anonymous breaks and plain text paragraphs} \lipsum[1][1-3] \myfancybreak{$\ast$Aa}% \lipsum[1][1-3] \newpage \section{Distance between fancy anonymous breaks and quotations/lists} \begin{myquotation}% Some own-defined or standard quotation.% \end{myquotation}% \myfancybreakbeforeenv{$\ast$Aa}% \begin{myquotation}% Some own-defined or standard quotation.% \end{myquotation}% \begin{myquotation}% Some own-defined or standard quotation.% \end{myquotation}\newpage% \end{document}
- Issue attempting "fullwidth" image on documentby 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}
- What packages are useful for drawing topological surfaces? [closed]by Sean Wakasa on February 18, 2026 at 8:37 am
I'm writing a mathematical paper that studies the fundamental groups of surface bundles, hence I need to create images of surfaces of genus greater than 1 with loops drawn on surface. What packages can I use to make such images? See page 8 of this paper for an example of such a surface.
- Libertine font features missing when compiling with xelatex or lualatexby 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?
- Making code less scattered when crossing a pagebreak in lstlistingby Danya Zh on February 18, 2026 at 4:11 am
I have a large section of code I want to embed in my pdf via lstlisting and it will not fit on a single page. I want to avoid readers having to jump from page to page when trying to understand a section of code. I believe it would be natural to either Force sections of code to be inseparable like with the samepage environment. I don't know how to implement this solution within lstlisting, and that solution seems awkward anyway (each section of code will have to be individually wrapped within a samepage). Duplicate lines of code that are being broken up. If, for example, the code pagebreaks on line 50, instead of going to line 51 on the next page, the code goes to line 45 again. This way the reader has the small section of code from the last page to hang on to. I believe I have seen this solution be implemented in some college course, but I am not sure if this is conventional or even acceptable. Feedback and implementation suggestions appreciated. Minimal example of a code being broken up by a pagebreak is provided below: \documentclass{article} \usepackage{listings} \usepackage{xcolor} \definecolor{codegreen}{rgb}{0,0.6,0} \definecolor{codegray}{rgb}{0.5,0.5,0.5} \definecolor{codepurple}{rgb}{0.58,0,0.82} \definecolor{backcolour}{rgb}{0.95,0.95,0.92} \lstdefinestyle{mystyle}{ backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen}, keywordstyle=\color{magenta}, numberstyle=\tiny\color{codegray}, stringstyle=\color{codepurple}, basicstyle=\ttfamily\footnotesize, breakatwhitespace=false, breaklines=true, captionpos=t, keepspaces=true, numbers=left, numbersep=5pt, showspaces=false, showstringspaces=false, showtabs=false, tabsize=2 } \lstset{style=mystyle} \begin{document} \begin{lstlisting} [ language=C++, caption= {Code for the second part of BB84 problem. Eve eavesdrops on Alice and Bob.}, label=lst:bb84-pt2] #include <cstdlib> #include <cstdio> #include <ctime> #include <vector> using namespace std; const int SIGNAL_LENGTH = 100; int main(void) { srand(time(NULL)); // Initialize bits, bases, and keys bool alice_bits[SIGNAL_LENGTH]; bool alice_bases[SIGNAL_LENGTH]; bool bob_bits[SIGNAL_LENGTH]; bool bob_bases[SIGNAL_LENGTH]; bool eve_bits[SIGNAL_LENGTH]; bool eve_bases[SIGNAL_LENGTH]; vector<bool> alice_key; vector<bool> bob_key; int key_mismatch_count = 0; // Sending and Recieving Bits for (int i = 0; i < SIGNAL_LENGTH; i++) { alice_bases[i] = rand() % 2; bob_bases[i] = rand() % 2; eve_bases[i] = rand() % 2; alice_bits[i] = rand() % 2; eve_bits[i] = (alice_bases[i] == eve_bases[i]) ? alice_bits[i] : (rand() % 2); bob_bits[i] = (eve_bases[i] == bob_bases[i]) ? eve_bits[i] : (rand() % 2); } // Establishing keys for (int i = 0; i < SIGNAL_LENGTH; i++) { if (alice_bases[i] == bob_bases[i]) { alice_key.push_back(alice_bits[i]); bob_key.push_back(bob_bits[i]); key_mismatch_count += (bob_bits[i] != alice_bits[i]); } } // Comparing keys printf("Key length: %d\n", int(alice_key.size())); printf("\nBob's key: "); for (int i = 0; i < int(bob_key.size()); i++) { printf("%d", int(bob_key[i])); } printf("\nAlice's key: "); for (int i = 0; i < int(alice_key.size()); i++) { printf("%d", int(alice_key[i])); } if (key_mismatch_count == 0) { printf("\nThe keys are the same\n"); } else { float mismatch_percent = 100.0 * key_mismatch_count / int(alice_key.size()); printf("\nThe keys are different,\n"); printf("\nThere are %d mismatches, %.2f%% of the key,\n", key_mismatch_count, mismatch_percent); } return 0; }; \end{lstlisting} \end{document}
- Is there a template resource to validate current practices for PDF tagging complianceby Jeffrey J Weimer on February 18, 2026 at 2:24 am
Summary (TL;DR) Does a reference site exist with an up-to-date template-like file that demonstrates viable and as-yet-invalid practices to assure PDF tagging using DocumentMetaData when also wanting to use common formatting packages? Background I am just starting to assemble resources to prepare a textbook. I hope to generate an electronic PDF version that is, as best possible, fully tagged. In this period of transition with the DocumentMetaData command prefix, I struggle to find resources giving examples of best practices that work within the current developments while offering clear options to upgrade when new compatibilities are added. By reference, I was caught by surprise with the break of the caption package after returning from a holiday break and had to search a while to figure out what had happened. What I believe would help me, and perhaps others as well, is to have a template. The template would illustrate the best practice to set tagged segments in a document while also using external packages to format the "hard copy" display of content from those same segments. My list is not extensive. What are the best practices to assure the highest current standard in tagging compatibility in an electronic PDF generated through LaTeX (LauLaTeX) when formats in the "hard copy" print are also being designed as below. content headers (titlesec) toc objects (titletoc) captions (caption) placing figures (float with [H]) page headers and footers (fancyhdr) bibliographies (natbib) creating \NewDocumentEnvironment content (see below) \usepackage{float} ... \NewDocumentEnvironment{TaggedFigure}{O{1}mmm+b} { \tagstructbegin{tag=Sect} \begin{figure}[H] \centering \includegraphics[width=#1\textwidth,alt={#3}]{#2} \caption{#5} \label{fig:#4} \end{figure} } { \tagstructend } \begin{TaggedFigure} {fig-hypothesistesting} {A flow diagram of the hypothesis testing method} {hypothesistesting} In the hypothesis testing method, we discover ... \end{TaggedFigure} Closing Notes I greatly appreciate the ongoing efforts to incorporate tagging into PDFs generated by LaTeX. With due respect, the technical details mostly go over my head. I'd like to be able to find a reference site that presents the approach as below. Download this template file. It is compliant with tagged PDF to our current best practices. It includes a set of commonly used formatting packages for various components in the document. Run the template file on your LuaLaTeX installation. Check the log output. -> If the log shows that a package is not compliant, your TeX installation is likely at fault (outdated). Test the resulting PDF file for full tag compliance using the approach provided here ... -> If the resulting PDF file is not fully compliant, your LuaLaTeX compilation process is likely at fault. If the template does not include a package that you need, test the package by itself separately. Do these steps ... (e.g. add \usepackage(yourpackage), include one case that must use your required package, compile, review the log output as above, and if the package is reported as compliant re-rerun the PDF tag testing as above). I hope this request is within the guidelines of the forum.
- Tree-like structureby yrodro on February 17, 2026 at 9:04 pm
In the package forest I created this macro to draw simple trees: \newcommand{\Tree}[1]{ \begin{forest} for tree={% grow'=north,circle,fill,minimum size=3pt,inner sep=0, outer sep=0pt, s=8pt, l=0} #1 \end{forest} } Now I need a modified version that adds a horizontal line for each node, joining its children. The idea is to get triangles that symbolize the fan of edges from the vertex. Thus, with input [ [[][]] [[]] ] instead of a tree V | \ / the picture would look something like _ V | ___ \ / My best bet so far is the command roof as exmplified in the snippet % roof terminal phrases \useforestlibrary{linguistics} % ... \begin{forest} delay={where n children=0{tier=word, if={instr("P",content("!u"))}{roof}{} }{}}, [VP[DP[Mary]][V’[V[loves]][DP[her cat]]]] \end{forest} that I found in page 74 of the package manual, but I can't make heads of it.
- Generate random, unique, nonzero integersby 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?
- Spacing in Tikz Heatmapby itc on February 17, 2026 at 6:09 pm
I am struggling with the vertical space of my tikz heatmap. Specifically, my column labels are getting into the title of my diagram. The same is happening with the legend. I have put the MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{matrix, positioning, backgrounds} \begin{document} \begin{tikzpicture}[ font=\sffamily, cell/.style={ rectangle, minimum width=2.5cm, minimum height=1cm, draw=white, line width=0.5mm, align=center }, label/.style={ anchor=east, font=\bfseries\small }, header/.style={ anchor=south, rotate=45, font=\bfseries\small, anchor=south west } ] % Define Colors representing the score (Low, Medium, High) \definecolor{scoreLow}{HTML}{F2F2F2} % Weak/Low \definecolor{scoreMed}{HTML}{84B7D6} % Medium/Partial \definecolor{scoreHigh}{HTML}{004C6D} % Strong/High % Legend formatting \matrix [draw=none, anchor=north west] at (-4, 2) { \node [fill=scoreHigh, text=white, minimum width=1cm] {High/Strong}; & \node [anchor=west] {Jddhdhshdhshss}; \\ \node [fill=scoreMed, text=black, minimum width=1cm] {Zprororo}; & \node [anchor=west] {Trump}; \\ \node [fill=scoreLow, text=black, minimum width=1cm] {Hhdueueu}; & \node [anchor=west] {Ghsshshshs}; \\ }; % --- THE DATA MATRIX --- % Row 1: H % High Behavioural Realism [cite: 29], Low Auditability [cite: 81], Low Probability [cite: 78], High Actionability [cite: 40] \node[cell, fill=scoreHigh, text=white] (c11) at (0,0) {High}; \node[cell, fill=scoreLow, text=black] (c12) at (2.5,0) {Low}; \node[cell, fill=scoreLow, text=black] (c13) at (5,0) {Low}; \node[cell, fill=scoreLow, text=black] (c14) at (7.5,0) {Risk}; \node[cell, fill=scoreHigh, text=white] (c15) at (10,0) {High}; % Row 2: A % Low Realism, High Auditability [cite: 82], Med Probability (Rankings) [cite: 109] \node[cell, fill=scoreLow, text=black] (c21) at (0,-1) {Low}; \node[cell, fill=scoreHigh, text=white] (c22) at (2.5,-1) {High}; \node[cell, fill=scoreMed, text=black] (c23) at (5,-1) {Med}; \node[cell, fill=scoreMed, text=black] (c24) at (7.5,-1) {Med}; \node[cell, fill=scoreMed, text=black] (c25) at (10,-1) {Med}; % Row 3: B % Input oriented [cite: 112], Low actionability alone [cite: 113] \node[cell, fill=scoreLow, text=black] (c31) at (0,-2) {Low}; \node[cell, fill=scoreMed, text=black] (c32) at (2.5,-2) {Med}; \node[cell, fill=scoreLow, text=black] (c33) at (5,-2) {Low}; \node[cell, fill=scoreHigh, text=white] (c34) at (7.5,-2) {High}; \node[cell, fill=scoreLow, text=black] (c35) at (10,-2) {Low}; % Row 4: C % Easier to document [cite: 94], Explore plausibility not prob [cite: 93] \node[cell, fill=scoreMed, text=black] (c41) at (0,-3) {Med}; \node[cell, fill=scoreHigh, text=white] (c42) at (2.5,-3) {High}; \node[cell, fill=scoreLow, text=black] (c43) at (5,-3) {Low}; \node[cell, fill=scoreMed, text=black] (c44) at (7.5,-3) {Med}; \node[cell, fill=scoreMed, text=black] (c45) at (10,-3) {Med}; % Row 5: D % Traceability/Coherence [cite: 96], Probabilistic [cite: 95] \node[cell, fill=scoreLow, text=black] (c51) at (0,-4) {Low}; \node[cell, fill=scoreHigh, text=white] (c52) at (2.5,-4) {High}; \node[cell, fill=scoreHigh, text=white] (c53) at (5,-4) {High}; \node[cell, fill=scoreLow, text=black] (c54) at (7.5,-4) {Low}; \node[cell, fill=scoreMed, text=black] (c55) at (10,-4) {Med}; % Row 6: E % Normative/Pathways[cite: 101], High Actionability \node[cell, fill=scoreLow, text=black] (c61) at (0,-5) {Low}; \node[cell, fill=scoreMed, text=black] (c62) at (2.5,-5) {Med}; \node[cell, fill=scoreLow, text=black] (c63) at (5,-5) {Low}; \node[cell, fill=scoreHigh, text=white] (c64) at (7.5,-5) {High}; \node[cell, fill=scoreHigh, text=white] (c65) at (10,-5) {High}; % Row 7: F % Calibration/Monitoring[cite: 133], High Probability, Low Realism \node[cell, fill=scoreLow, text=black] (c71) at (0,-6) {Low}; \node[cell, fill=scoreHigh, text=white] (c72) at (2.5,-6) {High}; \node[cell, fill=scoreHigh, text=white] (c73) at (5,-6) {High}; \node[cell, fill=scoreLow, text=black] (c74) at (7.5,-6) {Low}; \node[cell, fill=scoreMed, text=black] (c75) at (10,-6) {Med}; % Row 8: G % Adversarial[cite: 122], Low Auditability (often anecdotal) \node[cell, fill=scoreHigh, text=white] (c81) at (0,-7) {High}; \node[cell, fill=scoreLow, text=black] (c82) at (2.5,-7) {Low}; \node[cell, fill=scoreLow, text=black] (c83) at (5,-7) {Low}; \node[cell, fill=scoreLow, text=black] (c84) at (7.5,-7) {Low}; \node[cell, fill=scoreMed, text=black] (c85) at (10,-7) {Med}; % --- LABELS --- % Y-Axis Labels (Methods) \node[label] at (-1.5, 0) {H}; \node[label] at (-1.5, -1) {A}; \node[label] at (-1.5, -2) {B}; \node[label] at (-1.5, -3) {C}; \node[label] at (-1.5, -4) {D}; \node[label] at (-1.5, -5) {E}; \node[label] at (-1.5, -6) {F}; \node[label] at (-1.5, -7) {G}; % X-Axis Labels (Attributes) \node[header] at (0, 0.6) {Fuuueueueu djejejejjejejejejej}; \node[header] at (2.5, 0.6) {Ldhdhdhdd hdhdjddjdjdjdjeieeieiidjd}; \node[header] at (5, 0.6) {LLwhwuquahsajqjqjqjqjqqjssjsj}; \node[header] at (7.5, 0.6) {Kahhwuwuwuddeeicdjsjwjw}; \node[header] at (10, 0.6) {KKsiwiwiwiwyduweueeuee}; % Title \node[anchor=center, font=\bfseries\Large] at (3.5, 3.5) {Xfhfhhe jeeieiei nddjewoo djwiwoxdk msaaakkkwifjfjf}; \node[anchor=center, font=\small, text width=12cm, align=center] at (3.5, 2.8) {Xomtive fhfru dieieo difiwwi dkdfjdkwo ksksskskw.\\ \textit{Fsw7w8 ddijej doofoe cdirirfv iiroflvw dkoeowoxk dfeke.}}; \end{tikzpicture} \end{document} I have attached the screenshot as well:
- 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 ?
- Head-aligning nested tblr tables in merged cells with middle-alignmentby Christopher Gerking on February 17, 2026 at 3:22 pm
I am using tabularray with nested tblr tables. My problem is a nested table being placed inside a "merged" cell of the outer table (spanning two rows using cell{1}{2} = {r=2}{}). In this case, it seems impossible to align the nested table itself to the head of the outer table and, at the same time, align the contents of the nested table to the middle of each cell: \documentclass{article} \usepackage{tabularray} \begin{document} \begin{tblr}{ colspec = {Q Q[h]}, hlines, vlines, cell{1}{2} = {r=2}{m} } {A \\ B \\ C \\ D} & {Head? \\ \begin{tblr}{ colspec={Q[m]}, hlines, vlines, rows = {1cm} } Middle \\ Middle \\ \end{tblr}} \\ {E \\ F \\ G \\ H} & ... \end{tblr} \end{document} Changing the nested table itself to Q[h] will in fact align it to the head, but then any of my attempts to align its cells to the middle failed. These are the two different results: I tried different baseline settings as well, but none of them seems to do the trick. Am I missing something? Thank you in advance.
- How to have expex example indented in list environment?by lkw on February 17, 2026 at 3:06 pm
Sometimes I use an expex numbered example within an itemize environment (e.g. for handouts). I want the example to be indented relative to the list environment, rather than the full page width. I used to gb4e, which did this automatically. Is there a way to have expex also do this globally (without just wrapping every example in say a minipage)? \documentclass{article} \usepackage{expex} \usepackage{enumitem} \begin{document} Hello. \begin{itemize} \item Here is a list item. \pex \a\begingl \gla This is a sentence// \glb this is a sentence// \glft `This is the translation.'// \endgl \a\begingl \gla This is a sentence// \glb this is a sentence// \glft `This is the translation.'// \endgl \xe \end{itemize} \end{document}
- Baseline, sub- and superscripts and vertical centering in math-modeby Tapedeck Ghost on February 17, 2026 at 2:13 pm
See my edits below Subscripts are meant to be typeset below the baseline. However in math-mode LaTeX simply ignores this by default and supposes that a symbol like X_i should be centered vertically as a whole. Here is an example of what I mean: Evidently only the X should be centered and the subscript should be ignored when aligning. Why this isn't the default behaviour is beyond me (indeed, in text-mode writing $X_i$ does not raise the letter X above the baseline, because that would be equally nonsensical). Is there any way to make this a default behaviour without declaring new operators or using \raisebox every single time? Edit: As per request, here is the code: \documentclass{article} \begin{document} \[ \prod_{i\in I} X_i \quad \sum_{i\in I} X_i \] \end{document} Second Edit: In light of the fact that I was simply wrong to assume the behaviour I describe above, I've accepted @David Carlisle's answer. I add an example of what I wish to achieve: produced by the following code: \documentclass{article} \begin{document} \[ \textrm{this:}\quad \raisebox{-.07em}{$X=$}\prod_{i\in I} \raisebox{-.07em}{$X_i$} \quad \textrm{and not:} \quad X=\prod_{i\in I} X_i \] \end{document} The difference is subtle, but noticeable. Notice that the space above and below the X_i is roughly equal in the desired example. To the disbelief of @David Carlisle that any typographer of a published text would proceed in such a way , I add two examples, from Munkres, Topology, p. 38 and from Bourbaki, General Topology I p. 88, 🙂 It is not my intention to put the bottom of \sum and \prod on the baseline, but just to refute the claim that it is never done, here is an example from the french version of Bourbaki's Topologie Generale, Chapter I, page 73 🙂
- Introducing a vertical line in a quantikz circuitby Rob on February 17, 2026 at 10:44 am
I have the following circuit generated using quantikz: \documentclass{article} \usepackage{quantikz} \begin{document} \begin{center} \begin{quantikz}[row sep=.2cm, column sep=.5cm] \lstick{$|0\rangle$} & \gate{A} & \gate[2]{B} & \ghost{C} & \gate{D} & \\ \lstick{$|1\rangle$} & & & \gate[2]{C} & \gate{E} & \\ \lstick{$|1\rangle$} & & & & \gate{F} & \end{quantikz} \end{center} \end{document} How can I introduce some vertical lines as shown in the attached screenshot below
- Sphinx and LuaTeXby Signor Pizza on February 17, 2026 at 9:03 am
I tried to build PDF of (latest) documentation of QEMU: (I previously activated a Python virtual environment with Sphinx) git clone https://gitlab.com/qemu-project/qemu.git cd docs/ mkdir build sphinx-build -M latex . build/ cd build/latex make all causes Runaway argument? \PYG {o}{|} \PYG {o}{\PYGZhy {}}\PYG {o}{\PYGZhy {}}\PYG {o}{\PYGZhy \ETC. ! TeX capacity exceeded, sorry [main memory size=5000000]. l.13263 ...Zhy{}}\PYG{o}{\PYGZhy{}}\PYG{o}{\PYGZhy {}}\PYG{o}{\PYGZhy{}}\PYG{... ! ==> Fatal error occurred, no output PDF file produced! QEMU.log : https://pastebin.com/yxp6ivkg instead cd /home/yalihupokn/qemu/docs/build/latex lualatex QEMU.tex doesn't run out of memory, but still gets stuck in an infinite loop. Any ideas?
- Fine tuning of ellipsis spacing based on neighboring charactersby tsj on February 17, 2026 at 2:39 am
There's some mechanism that moves a period slightly closer to characters that have some kind of "horizontal overhang" like r or f. For example, compare: Foobar.\\ Foobar\hbox{}.\\ % supress with empty box in output: This is with the LibertinusSerif font, it doesn't happen with standard Computer Modern, so my guess is that this is an opentype feature. I've noticed that with an ellipsis that follows a character like r, the spacing looks slightly unbalanced, i.e. there's no shifting of the ellipsis in the same way that the single period is shifted when it immediately follows the r. (It tends to look better / worse depending on font choice.) For example, compare the below: \documentclass{article} \usepackage[no-math]{fontspec} \setmainfont{LibertinusSerif} \usepackage[xspace]{ellipsis} \begin{document} \noindent% Foobar \dots\ l\\ % default spacing Foobar \kern-0.5pt\dots\ l\\ % attempt to replicate kerning of period next to r (I want this) Foobal \dots\ l\\ % for reference, already looks balanced \end{document} Is there any way (with fontspec, microtype, something else) that I could apply a negative kern (left shift) of the ellipsis depending on the character on either side (preferably the same kerning that gets applied to the singleton period immediately following an ordinary letter like r.)? i.e. to achieve the second case in the image above but without manual kerning. (I know this is a very small detail... I think it looks worse with a non-free font that I'm actually using. Maybe someone will try to convince me I should NOT do this from a standpoint of typographic style, or to just forget about it... I'd like to know if it's technically achievable anyway.) If it matters, I'm using XeLaTeX and not dead-set on using the ellipsis package. EDIT: I'm using LuaLaTeX, NOT XeLaTeX.
- Nested acronym in acronym packageby Fellow InstituteOfMathophile on February 16, 2026 at 8:28 am
I have two related acronyms: HMM (Hidden Markov Model) and iHMM (infinite Hidden Markov Model). I define them as \acro{HMM}[HMM]{Hidden Markov Model} \acro{iHMM}[iHMM]{infinite \ac{HMM}} Ideally, within a chapter, if HMM has already been introduced, \ac{iHMM} should expand to infinite HMM (iHMM); if HMM has not been introduced, it should expand to infinite Hidden Markov Model (iHMM). However, with the current definition, \ac{iHMM} expands to infinite Hidden Markov Model (HMM) (iHMM), which contains an unwanted extra (HMM). How do I get rid of this behavior?
- Strange geometric calculation error of ellipse with `arc` in tikz?by Explorer on February 14, 2026 at 7:33 am
I want to plot something as below in an elegant appraoch, with a handy control of the angle and eccentricity: (the pattern is not important here) Here below, I make some calculations: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[line join=round] \def\R{5} \def\ell{0.9} \def\startAngle{40} \def\endAngle{90-\startAngle} \def\rhoo{\fpeval{\R*sind(45-\startAngle)/cosd(\startAngle)}} \def\Rx{\fpeval{\rhoo*(sqrt(1-(\ell^2*cosd(\startAngle)^2)))/(sqrt(1-\ell^2))}} \def\Ry{\fpeval{\Rx*(sqrt(1-\ell^2))}} \def\ellstartAngle{\fpeval{atand(\Rx/\Ry*tand(\startAngle))}} \filldraw[ fill=cyan!30, draw=cyan, very thick ] (\R,0) arc[start angle=0, end angle=\startAngle, radius=\R] { [rotate=-\startAngle] arc[start angle=-\ellstartAngle,end angle=180+\ellstartAngle,x radius=\Rx,y radius=\Ry] } arc[start angle=\endAngle, end angle=90, radius=\R] -- (0,\R) -- (\R,\R) -- cycle; \end{tikzpicture} \end{document} But it gives some drawbacks of the ellipse's ending tip: With the following sketch: My calculation thoughts is as below: noted that \StartAngle is \theta, and \ell is the ellipse's eccentricity with \def\rhoo{\fpeval{\R*sind(45-\startAngle)/cosd(\startAngle)}}, I want to derive the radius from origin of the ellipse, that is the \rho's distance in the sketch with the formula of the radius length from origin of the ellipse, that is: I want to derive the x-radius of ellipse, that is a(\Rx) via \def\Rx{\fpeval{\rhoo*(sqrt(1-(\ell^2*cosd(\startAngle)^2)))/(sqrt(1-\ell^2))}} Then I calaulated the y-radius with \Rx and \ell via \def\Ry{\fpeval{\Rx*(sqrt(1-\ell^2))}} Finally, I calculate the geometric angle of sub-path rotation learning from this answer via \def\ellstartAngle{\fpeval{atand(\Rx/\Ry*tand(\startAngle))}} I really have no idea of any mathematical calculation issues or just my tikz's parameter misunderstandings. Could somebosy give me a hand? (Any approach with neat syntax are all welcome! My calculation above is just to draw this in one \path)