• 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.

  • Rotated and not rotated cells in the first table row
    by 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}

  • 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?

  • Making code less scattered when crossing a pagebreak in lstlisting
    by 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}

  • 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 ?

  • Baseline, sub- and superscripts and vertical centering in math-mode
    by 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 circuit
    by 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

  • Help with abrupt interuption of `tlmgr` with `First directive needs to be 'name'`?
    by Explorer on February 16, 2026 at 7:59 am

    I found no similar answer on the site. Here below is my story. As cfr post the newest package forest-ext on CTAN last month, I need to run tlmgr update --all, and I was waiting for that to update. However, the power supply of personal computer was unexpectedly cut off! Then the tlmgr was broken! When I turn on again, and run with tlmgr update --all again, it complained that: tlmgr update --all First directive needs to be 'name', not at C:/texlive/2025/tlpkg/TeXLive/TLPOBJ.pm line 106, <TMP> line 1. I have no idea with my unlucky case... Any suggestions to relieve my tlmgr? Possible related: tlgmr error: First directive needs to be 'name'… Edited: The explorer.exe's infomration with C:/texlive/2025/tlpkg/TeXLive/TLPOBJ.pm: Information with C:\texlive\2025\tlpkg: Edited Again: Since kind Max Chernoff mentioned at here and here: The error located at my broken texlive.tlpdb. When I replace my texlive.tlpdb with Max's version at here, the error message gone, but maybe some resource's difference, tlmgr doesn't think I have any package to update.... $tlmgr update --all tlmgr.pl: package repositories main = https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet (not verified: gpg unavailable) tlcontrib = https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlcontrib (not verified: gpg unavailable) tlcritical = https://tug.org/texlive/tlcritical/ (not verified: gpg unavailable) For more about verification, see https://texlive.info/verification.html. tlmgr.pl: saving backups to C:/texlive/2025/tlpkg/backups tlmgr.pl: no updates available As Ulrike Fischer and cabohah's advice, I would give 2026-preset a try😋, which looks more efficient. Edited Finally: With Max's version, and --reinstall, it works: tlmgr install --reinstall forest-ext tlmgr.pl: package repositories main = https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet (not verified: gpg unavailable) tlcontrib = https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlcontrib (not verified: gpg unavailable) tlcritical = https://tug.org/texlive/tlcritical/ (not verified: gpg unavailable) For more about verification, see https://texlive.info/verification.html. [1/1, ??:??/??:??] reinstall: forest-ext @main [1267k] running mktexlsr ... done running mktexlsr. tlmgr.pl: package log updated: C:/texlive/2025/texmf-var/web2c/tlmgr.log tlmgr.pl: command log updated: C:/texlive/2025/texmf-var/web2c/tlmgr-commands.log However, since ctug.org didn't provide a windows-specific texlive.tlpdb, maybe that is not purely compatible, and maybe not a quite extensive solution to this case.

  • \mathunderbar automatically gobbles the subscript following it
    by Jinwen on February 16, 2026 at 3:27 am

    Consider the following example: \documentclass{article} \usepackage{unicode-math} \begin{document} \( \mathunderbar{s}_f \) \( \mathunderbar{s}{}_f \) \end{document} It seems \mathunderbar automatically interprets the subscript following it as part of its argument. Is this behavior by design? Should I thus always write an empty group after it to get the correct output, as in the example above?

  • Latex Math bracket right that covers two rows of aligned's
    by Christopher Ettling on February 15, 2026 at 6:56 pm

    Is it possible to make such a nice bracket like in the picture? \documentclass{article} \usepackage{amsmath,amssymb} \newcommand{\Z}{\mathbb{Z}} \begin{document} \begin{align*} a\!\in\!\Z\mid b\!\in\!\Z &\left\{ \begin{aligned} &\Leftrightarrow\left\{ \begin{aligned} \pm a &\mid \mp b\\ ac &\mid bc:\forall c\in\Z \end{aligned}\right.\\ &\Rightarrow\left\{ \begin{aligned} a\mid bc:\forall c\in\Z\\ |a|\le |b|\lor b=0 \end{aligned}\right.\\ &\land\left\{ \begin{matrix} a=0 &\Rightarrow& b=0\\ b\mid a &\Rightarrow& a=\pm b\\ b\mid c &\Rightarrow& a\mid c \end{matrix}\right. \end{aligned}\right. \end{align*} \end{document}

  • TeX expansion with \number has mysterious error when followed by space, why?
    by Dan Levin on February 15, 2026 at 3:07 pm

    This code produces the table I'm expecting with fully expandable copying: % same as \ltx@\ReturnAfterFi \long\def\ReturnAfterFi#1\fi{\fi#1} % expandable copies % #1=number, #2=text \def\xcopies#1#2{% \ifnum#1>0 #2% \ReturnAfterFi{\expandafter\xcopies\expandafter{\the\numexpr#1-1}{#2}}% \fi} \def\hundredtable{% \vtop{\offinterlineskip \global\count255=1 \everycr{\noalign{\hrule}}\tabskip0pt \halign{\strut \vrule ##&& \global\advance\count255 by 1 \hbox to 2.5em{\hss##\hss}\vrule\cr \xcopies{10}{\xcopies{10}{& \number\count255}\cr}\crcr}}} \hundredtable But an error occurs if I put a space after the \number command in the code block above, as shown here: ... \xcopies{10}{\xcopies{10}{& \number\count255 }\cr}\crcr}}} I thought the space would be optional. I've tried \relax and it, too, produces an error, with TeX saying the \ifnum doesn't complete. I suspect the \number command with the register is checking if it should multiply what follows and is therefore expanding the \ReturnAfterFi. But the space would seem to solve this, not cause it. Can someone explain the expansion error here?

  • LaTeX zref-clever: automatically generate dash-separated figure ranges including non-consecutive labels
    by taiwan12 on February 15, 2026 at 1:21 pm

    I'm trying to use the zref-clever package in LaTeX to reference multiple figures in a compact, readable way. I want the output to: Merge consecutive figure numbers with a dash (-) Separate non-consecutive numbers with commas Never use "and" Work for any order of figure labels MWE \documentclass{article} \usepackage{graphicx} \usepackage{float} \usepackage[colorlinks]{hyperref} \usepackage{zref-clever} \begin{document} % Example of referencing figures \zcref{fig:figA, fig:figB, fig:figC, fig:figE, fig:figF} % figures 1-3, 5-6 \zcref{fig:figB, fig:figA} % figures 1-2 \zcref{fig:figD, fig:figA} % figures 1, 4 \zcref{fig:figA, fig:figB, fig:figC, fig:figE, fig:figG} % figures 1-3, 5, 7 \begin{figure}[H] \caption{Caption} \label{fig:figA} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figB} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figC} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figD} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figE} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figF} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figG} \end{figure} \end{document}

  • cleveref \cref fails when there is a space after comma in multiple labels [duplicate]
    by taiwan12 on February 15, 2026 at 12:23 pm

    I am using LaTeX with the cleveref package and I want to reference multiple figures like this: \cref{fig:figA, fig:figB}. However, it only works if there is no space after the comma: \cref{fig:figA,fig:figB}. Is there a clean way to make \cref handle spaces after commas in multiple labels automatically? I only came up with one idea: \crefspace which removes the every space. \documentclass{article} \usepackage{graphicx} \usepackage{float} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \begin{document} \begin{figure}[H] \caption{Caption} \label{fig:figA} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figB} \end{figure} \begin{figure}[H] \caption{Caption} \label{fig:figC} \end{figure} \cref{fig:figA,fig:figB} % works \cref{fig:figA, fig:figB} % does NOT work \end{document}

  • LaTeX macro for typesetting AVMs and distance between AVM and text + typing
    by Stefan Müller on February 15, 2026 at 11:37 am

    Decades ago a colleague wrote a macro for type setting Attribute Value Matrices (AVMs) for me. It is simple and can be used for AVMs with a type (italics at the left top bracket) and AVMs without type. The problem is that sometimes the AVMs are very close to preceding text and I do not see why. The distance between "Perfekt" and AVM is perfect, but the distance between "Passive" and the AVM is not. Of course this could be fixed by inserting a newline with 2pts extra space, but I would like to understand the problem and have a solution for it. Apart from this the whole AVM should be some points further to the left, so that it aligns with the text. I guess this is due to the array package, which probably adds some space for nesting brackets. This is of course welcome but should not happen at teh outermost bracket. This is my code: \documentclass{scrartcl} \usepackage{langsci-gb4e} \usepackage{array} \newcommand{\nliste}[1]{% \mbox{$\langle$\upshape\normalfont#1$\rangle$}% } \newcommand{\eliste}{% \mbox{% $\left\langle\right\rangle$}% } \newcommand{\ms}[2][]{% \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt\tabcolsep=0pt% $\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else \multicolumn{2}{>{\normalfont\itshape}l}{#1}% \\% \fi% #2% \end{tabular}% \right]$% }% \vspace{1mm}% } \newcommand{\onems}[2][]{% \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt \tabcolsep=0pt $\left[% \begin{tabular}{>{\upshape\scshape}l} \if\relax\detokenize{#1}\relax\else {\normalfont\itshape #1}% \\ \fi #2% \end{tabular}% \right]$% }% \vspace{1mm}% } \newcommand{\menge}[1]{% \mbox{% $% \left\{% \begin{tabular}{@{}l@{}}\ignorespaces#1\end{tabular}% \right\}% $% }% } \newcommand{\str}{{\normalfont\textit{str}}}% xspace does not work with NP[\str] \begin{document} The second AVM is too close to the `P'. There seems to be too much space before the AVM. \eal \ex Perfekt:\\ \ms{ spr & \nliste{ NP[\str]$_i$ }\\ comps & \nliste{ NP[\str]$_j$ }\\ arg-st & \nliste{ NP[\str]$_i$, NP[\str]$_j$ } } \ex Passiv:\\ \ms{ spr & \nliste{ NP[\str]$_j$ }\\ comps & \eliste\\ arg-st & \nliste{ NP[\str]$_j$ } } \zl \eal \label{linking-konstruktionen} \ex\label{transitiv-Konstruktion} die \emph{Transitive Construction}:\\ \ms{ syn & \ms{ cat & v\\ voice & active\\ }\\ val & \menge{ \onems{ role \ms{ gf & obj \\ %$\theta$ & \textsc{da}$-$\\ \textsc{da} & $-$\\ }\\ }}\\ } \ex die \emph{Subject Construction}:\\ \ms{ syn & \ms{ cat & v\\ }\\ val & \menge{ \onems{ role \onems{ gf \textit{subj} } }}\\ } \ex die \emph{Passive Construction}:\\ \ms{ syn & \ms{ cat & v\\ form & PastPart\\ }\\ val & \menge{ \ms{ role & \ms{ gf & obl\\ da & $+$\\ }\\ syn & \textrm{P[von]/}zero\\ }}\\ } \zl \ms[test]{ feature1 & value\\ feature2 & value} \ms[word]{ feature1 & value\\ feature2 & value} \ms[passive]{ feature1 & value\\ feature2 & value} \end{document} Another problem is the type in the last three AVMs. It seems to take all the space that would be needed if there were letters like `t' that stick out towards the top. But this is not the case for words like "passive". Could such types be raised by some points (according to font properties)? Sorry, for asking two questions in one. I can split them up, but since it is the same code, I thought it might be better this way.

  • How to change the name "Publications " to "references" and how to make them colored?
    by Intuition on February 15, 2026 at 3:50 am

    Here is a template of overleaf that I am using to write my research statement: \documentclass[11pt,a4paper,sans]{moderncv} \moderncvstyle{casual} \moderncvcolor{red} \usepackage{lipsum} \usepackage[scale=0.75]{geometry} \firstname{} % Your first name \familyname{} % Your last name %\addbibresource{mybibliography.bib} %\bibliography{references} \title{ Research Statement} \address{W. Ethan Eagle}{} \mobile{(302) 584 3464} \email{ethan.eagle@gmail.com} %\addbibresource{mybibliography.bib} %\bibliography{references} \begin{document} \makecvtitle % Print the CV title %---------------------------------------------------------------------------------------- % EDUCATION SECTION %---------------------------------------------------------------------------------------- %\newpage %\addbibresource{references.bib} %\bibliography{references} \section{Previous Research Experience} 'Turbulence/Chemistry Interaction' and 'Thermo-fluids research.' ~\cite{MR1122302} {\hskip 2em}Details of my previous research work are available in my CV, but I would like to highlight my interests in diagnostic development for infrared imaging detection. The measurement capabilities of this diagnostic are just beginning to be understood, and I will continue to eagerly pursue and develop this measurement technique. I am also interested in continuing to make advanced measurements in combustion that can assess the impact of scalar dissipation on the ignition and inflammation of a mixture.\\ %---------------------------------------------------------------------------------------- \section{Research Goals} {\hskip 2em}I aim to develop a reputation as world-class expert in turbulence/chemistry interaction as applied to the areas of energy, health, and the environment. {\hskip 2em}To be successful as a starting faculty, I plan to start from simple 'unit' problems where I can explore the influence of boundary conditions in simple flow problems while developing diagnostic capability (e.g. infrared measurements of hydrocarbon distribution in atmospheric jet flames). {\hskip 2em}I have contacts to funding sponsors at the DOE, with NSF program managers in the turbulence and combustion sub-areas, and at DOD including AFRL and NRL, and will seek the support of these agencies through responses to FOAs regularly put out by these venues. \section{Teaching} My teaching interests span experiments in fluids, theoretical fluid dynamics, thermodynamics, and combustion. $\bullet{}$ Undergraduate: Thermodynamics, In/compressible Flows, Instrumentation (Lab), Combustion\\ $\bullet{}$ Graduate: Turbulent-Compressible-Viscous Flows, Combustion, Optical and Laser Diagnostics {\hskip 2em}I believe that a comprehensive set of courses on fundamental viscous and turbulent flows would be a worthwhile addition to a core competency at the undergraduate level. {\hskip 2em}I cultivate the following attitudes in students who complete course work or research with me: $\bullet{}$ demonstrate understanding of rigorous mathematical tools for design/analysis, (Teach others) $\bullet{}$ exhibit audience driven communication strategies, (Justify and explain the importance of research) $\bullet{}$ establish sound environmental/ethical/social reasoning. (Think long term, not just short term) %\section{References} %~\cite{MR1122302} %\addbibresource{references.bib} %\printbibliography [title={REFERENCES }, heading=bibintoc] \bibliographystyle{alpha} \bibliography{references} % Gunakan judul LITERATURE \end{document} I was wondering how to change the name "Publications " to "references" and how to make them colored? Notice that I created a file named references.bib that contains my citations from mathscinet Any help will be appreciated.

  • breve and macron over several letters
    by rensemil on February 14, 2026 at 2:57 pm

    I am using the metre package for metrical notation of Latin text. Here is my MWE: \documentclass[12pt]{article} \usepackage{metre} \begin{document} \begin{metrica} \=a \={ae} \-a \-{ae} \end{metrica} \end{document} This produces: The ā and ă are fine, but as you can see, with both of the "ae"s, the diacritics don't stretch to fill the whole width of the letters. Is it possible to change this so that the symbol matches the width of however many letters are under it? I would like it to work for not just 2 letters, but ideally as many as possible, e.g. I want to be able to draw a macron or even a breve over "huius" when I mark it as being one single syllable and the diacritic should then stretch to be as wide as it has to be to cover the whole word. This is what it should look like (note the macron in the first line on "praebeo" and the brevia on "aut" and "improbae". Thanks in advance!

  • Display a range of values with the associated unit
    by Nicolas on February 14, 2026 at 9:24 am

    I would like to be able to display in my text a range of values with the associated unit, for example 50-200 μm: I found well how to write"50 to 200 µm" (\qtyrange[range-units = single]{50}{200}{\micro\m}) or "50-200" (\numrange[range-phrase = --]{5}{200}) but nothing to make a mix of 2. Does anyone have any idea? \documentclass{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{siunitx} \begin{document} \qtyrange[range-units = single]{50}{200}{\micro\m} \numrange[range-phrase = --]{5}{200} \end{document}

  • 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)

  • tabularx: more horizontal distance between {|X| |X|}
    by cis on February 14, 2026 at 7:05 am

    How do I get more horizontal distance ? \documentclass[paper=a5]{scrarticle} \usepackage[margin=14mm, showframe=true]{geometry} \usepackage{tabularx,hhline,booktabs} \begin{document} \setlength{\arrayrulewidth}{3pt}% to see the rules clearly %\setlength{\tabcolsep}{5mm}% ungood \noindent% \begin{tabularx}{\textwidth}{|X| |X|} \hhline{|-||-|} Content Column 1 & Content Column 2 \\ \hhline{|-||-|} \end{tabularx} \end{document}

  • diagbox pops error : "Package xcolor Error: Undefined color `diagbox'."
    by philippe on February 13, 2026 at 11:14 pm

    Here is the MWE of the code I am attempting to use: \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{diagbox} \definecolor{MyLightGray}{gray}{0.9} \begin{document} \begin{table}[h] \centering \begin{tblr}{ colspec={|m{3cm}|X|X|X|}, hlines, vlines, cells={c,m}, } \SetCell{bg=MyLightGray,diagbox={Expertise}{Connaissance}} & \SetCell{bg=MyLightGray} Colonne 1 & \SetCell{bg=MyLightGray} Colonne 2 & \SetCell{bg=MyLightGray} Colonne 3 \\ Aucun / Standard & 0 & 2 & 6 \\ Spécial / COTS & 0 & 2 & 6 \\ \end{tblr} \end{table} \end{document} Here is the error I am getting while compiling : Package xcolor Error: Undefined color `diagbox'. I have no clue where xcolor comes from while it comes to diagbox, I may have a typo or something somewhere, this is driving me crazy! Please feel free to ask for more information, I don't know what more I could provide.

  • Multiple independent compound numbering series in `chemnum` (generalizing two-series solution)
    by monty01 on February 13, 2026 at 9:48 pm

    I am using the chemnum package together with chemstyle to label compounds in reaction schemes. By default, chemnum only provides a single global counter (cmpdmain), so compounds are numbered like: 1, 2, 3a, 3b, 4 … However, I need multiple independent numbering series, for example: literature compounds -> 1, 2, 3… target compounds -> T1, T2… intermediates -> INT1, INT2… supplementary information -> S1, S2… So effectively I want arbitrary named numbering series: \seriesBegin{EG} \replacecmpd{a} \seriesEnd \seriesBegin{INT} \replacecmpd{b} \seriesEnd and each series should continue later in the document without resetting. What I already found This answer provides a clever workaround for two parallel numbering series by saving and restoring cmpdmain: https://tex.stackexchange.com/a/759086/433835 code \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} % Provides the 'scheme' float environment (and general chem document styling) \usepackage{chemnum} % Provides compound numbering + psfrag-like replacement via \replacecmpd / \cmpd % --- Two "parallel" compound series trick ------------------------------------ % chemnum internally uses ONE main counter: cmpdmain. % To emulate two independent series (literature vs EG), we: % 1) save the current main counter value % 2) swap in the saved EG counter state % 3) turn on the "EG" prefix % 4) after the EG block, save the updated EG state and restore the main counter \newcounter{cmpdMainSaved} % temp storage: saves the current literature/main cmpd counter \newcounter{cmpdEGstate} % persistent storage: remembers where the EG series left off \newcommand{\EGseriesBegin}{% % Save the current "main" (literature) compound counter: \setcounter{cmpdMainSaved}{\value{cmpdmain}}% % Switch cmpdmain to the last saved EG state (so EG numbering continues): \setcounter{cmpdmain}{\value{cmpdEGstate}}% % Turn on a bold "EG" prefix for printing compound labels (EG1, EG2, ...): \setchemnum{pre-label-code=\textbf{EG}}% } \newcommand{\EGseriesEnd}{% % Save the updated EG state (so the next EG block continues where we stopped): \setcounter{cmpdEGstate}{\value{cmpdmain}}% % Turn off the EG prefix (back to plain numbers): \setchemnum{pre-label-code=}% % Restore the literature/main counter exactly where it was before EG mode: \setcounter{cmpdmain}{\value{cmpdMainSaved}}% } \begin{document} % --- Literature compounds: should print as 1,2 -------------------------------- \begin{scheme}[H] \replacecmpd{lit:a.1} % Register/replace the placeholder in the graphic with compound "1a" \replacecmpd{lit:b} % Register/replace the placeholder in the graphic with compound "2" \includegraphics[width=.5\linewidth]{PhH-and-PhMe} \caption{Normal numbering} \end{scheme} % --- Your target compounds: should print as EG1, EG2 --------------------------- \EGseriesBegin % Switch into EG-series mode (prefix + separate counter state) \begin{scheme}[H] \replacecmpd{eg:a.1} % Register/replace placeholder with "EG1a" \replacecmpd{eg:b} % Register/replace placeholder with "EG2" \includegraphics[width=.5\linewidth]{PhH-and-PhMe} \caption{EG numbering} \end{scheme} \EGseriesEnd % Leave EG mode and restore literature numbering \cmpd{eg:a.1}, \cmpd{eg:b} \cmpd{lit:a.1}, \cmpd{lit:b} % --- Continue EG series: should now print as EG3, EG4 -------------------------- \EGseriesBegin \begin{scheme}[H] \replacecmpd{eg:d} % Expected: EG3 \replacecmpd{eg:e} % Expected: EG4 \includegraphics[width=.5\linewidth]{PhH-and-PhMe} \end{scheme} \EGseriesEnd \cmpd{eg:e} % --- Back to literature series: continues as 3,4 ------------------------------- \begin{scheme}[H] \replacecmpd{lit:c} % Expected: 3 \replacecmpd{lit:d} % Expected: 4 \includegraphics[width=.5\linewidth]{PhH-and-PhMe} \caption{Normal numbering} \end{scheme} \cmpd{lit:c} % --- Later EG block: continues again (no reset) -------------------------------- % NOTE: If you ever want to restart the EG series at EG1, you can reset the state: % \setcounter{cmpdEGstate}{0} \EGseriesBegin \begin{scheme}[H] \replacecmpd{eg:f} \replacecmpd{eg:g} \includegraphics[width=.5\linewidth]{PhH-and-PhMe} \end{scheme} \EGseriesEnd \end{document}

  • Any better suggestions with the pos of arrow on arc with tikz?
    by Explorer on February 13, 2026 at 12:25 pm

    This question is similar to this link, but not exactly the same focues. What I want, is something like: But I want a better looking and better syntax of the arrow: The figure above is produced by: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{bending,decorations.markings,arrows.meta,calc,spath3} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[ >={Kite[inset=0pt,length=.32cm,bend]}, baz/.style={spath/save=curve}, foo/.style={ draw,tips=true,->, spath/remove empty components={curve}, spath/split at keep start={curve}{#1}, spath/use=curve }, foo/.default=0.5, ] \filldraw[thick,fill=gray!40] (4,0) node[below]{$R$} arc (0:180:4) node[below]{$-R$} -- (-3,0) arc(180:0:1) -- (1,0) arc(180:0:1) -- cycle; \path[baz] (4,0) arc (0:90:4);\path[foo=.4]; \path[baz] (0,4) arc (90:180:4);\path[foo]; \path[baz] (-3,0) arc (180:0:1);\path[foo=.55]; \path[baz] (1,0) arc (180:0:1);\path[foo=.55]; \draw[-Stealth] (-5,0) -- (5,0) node[below]{$\Re$}; \draw[-Stealth] (0,0) -- (0,5) node[right]{$\Im$}; \path node[below] {$O$} (60:4) node[above=3pt] {$C_{R}$}; \end{tikzpicture} \end{document} which learning from Andrew Stacey's elegant solution. However, the code above is manually seperated, my \foreach version didn't get expected result: \documentclass[tikz,border=5pt]{standalone} % https://tex.stackexchange.com/a/656167/322482 \usetikzlibrary{bending,decorations.markings,arrows.meta,calc,spath3} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[>={Kite[inset=0pt,length=.32cm,bend]}] \filldraw[ thick,fill=gray!40, spath/save=curve, ] (4,0) node[below]{$R$} arc (0:180:4) node[below]{$-R$} -- (-3,0) arc(180:0:1) -- (1,0) arc(180:0:1) -- cycle; \foreach \pos in {.1,.4,.675,.9}{% \path[ draw=blue,tips=true,->, spath/clone={tmp}{curve}, spath/remove empty components={tmp}, spath/split at keep start={tmp}{\pos}, spath/use=tmp, ]; } \draw[-Stealth] (-5,0) -- (5,0) node[below]{$\Re$}; \draw[-Stealth] (0,0) -- (0,5) node[right]{$\Im$}; \path node[below] {$O$} (60:4) node[above=3pt] {$C_{R}$}; \end{tikzpicture} \end{document} Edited: (I seemed to find some out-of-my-intuition features with spath3 and also reported at here, but actually turn out to be my fault of understanding the pos parameter of curve).