• Different math font in inline vs displayed styles doesn't work with \setmainfont and \mathrm: is the mathrm=sym unicode-math option safe?
    by Denis Bitouzé on October 6, 2026 at 9:01 am

    (This is a follow up of this Mico's answer to the quite old question Use different math font in inline-style and display-style formulas) For a LaTeX class I'm currently working on, based on a graphic designer work, I'm asked (but don't agree!) to use different fonts for the maths depending whether they are inline or displayed: Garamond Math for the inline ones, Concrete Math font for the displayed ones. The following MCE: \documentclass{article} \usepackage{unicode-math} \setmainfont{EBGaramond} % EBGaramond or anything else \setmathfont[version=Concrete]{Concrete-Math} \setmathfont[version=Garamond]{Garamond-Math} \mathversion{Garamond} \everymath{\mathversion{Garamond}} \everydisplay{\mathversion{Concrete}} \begin{document} \begin{enumerate} \item $2=\sqrt[4]{16}$ and \begin{equation} 2=\sqrt[4]{16} \end{equation} \item $1 \times 2$ and \begin{equation} 1 \times 2 \end{equation} \item $E=mc^2$, where $E$ stands for energy, and \begin{equation} E=mc^2 \end{equation} % \item $5=17 \pmod{12}$ and % \begin{equation*} % 5=17 \pmod{12} % \end{equation*} \end{enumerate} \end{document} (lualatex) compiles, not nicely (numerous warnings “LaTeX Font Warning: Command \mathversion invalid in math mode on input line…”), but compiles. But, as soon as its commented lines are uncommented, it doesn't compile any more, because of: ! LaTeX Error: Math alphabet identifier \mathrm is undefined in math version ` Garamond'. Note that it compiles again if \setmainfont{…} is commented. As a workaround, one can just load unicode-math with at least the mathrm=sym option. But is it safe?

  • How to display solutions of trigonometric equations in degrees in luacas?
    by minthao_2011 on October 6, 2026 at 8:36 am

    I am trying to solve the equation $\sin(5x)=\frac{1}{2}$, where $x$ is measured in degrees, using the luacas package. I tried: \documentclass{article} \usepackage{fourier-otf} \usepackage{luacas} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{ex}{Example} \begin{document} \begin{ex} $x$ in degree \begin{CAS} vars("x", "k") u = 5*x v = 30 eq1 = Equation(u, v + 360*k):autosimplify() r1 = eq1:solvefor(x) eq2 = Equation(u, 180 - v + 360*k):autosimplify() r2 = eq2:solvefor(x) \end{CAS} \[ \sin(5x) = \frac{1}{2} \Leftrightarrow \sin\left(\print{u}\right)=\sin\left(\print{v}^\circ\right) \Leftrightarrow \left[ \begin{aligned} \print{u} &= \print{v} + 360 k\\ \print{u} &= 180-\print{v}+ 360 k \end{aligned} \right. \Leftrightarrow \left[ \begin{aligned} &\print{r1}\\ &\print{r2} \end{aligned} \right. \] How can I make the solutions produced by luacas be written in the following form? \[ \sin(5x) = \frac{1}{2} \Leftrightarrow \sin\left(\print{u}\right)=\sin\left(\print{v}^\circ\right) \Leftrightarrow \left[ \begin{aligned} \print{u} &= \print{v}^\circ + 360^\circ k\\ \print{u} &= 180^\circ-\print{v}^\circ+ 360^\circ k \end{aligned} \right. \Leftrightarrow \left[ \begin{aligned} &x = 6^\circ + 72^\circ k\\ & x = 30^\circ + 72^\circ k \end{aligned} \right. \] \end{ex} \end{document}

  • CommonMark php parsing [closed]
    by user449527 on October 6, 2026 at 1:28 am

    This code isn't working for some reason. I am using Debian linux. I get a 500 error. <?php $doc = \CommonMark\Parse("# Hello World\nThis is **Markdown**."); $html = \CommonMark\Render\HTML($doc); echo $html; ?>

  • List of Tables/Figures Page and List Enumeration
    by Ryan Murphy on October 5, 2026 at 10:32 pm

    I'm having trouble with the following output I'm using the following code that is oh so close, \addcontentsline{lot}{figure}{\protect\numberline{3}Data from CalRecycle \dotfill 15-20} from AI search it looks like. The \dotfill is what I thought would fix my problem. Well actually there are two problems. I'm trying to get the pages to read 15-20, not 1, and I'm also trying to get table 3 in row 3. The \addcontentsline appears to throw it to the top of the list. I understand I may not be able to adjust the page range, nor the row position, but I figured I'd see if somebody has a solution. Note there are two other table 3's at the bottom that I've been trying to figure this out with.

  • LaTeX twoside starts with margins on the wrong side
    by duruburak on October 5, 2026 at 5:44 pm

    I am writing my thesis in Overleaf using LaTeX. The front matter should use asymmetric margins, with a wider left margin than right margin. Starting from the Introduction, however, the thesis should use a twoside layout: odd-numbered pages should have the wider inner margin on the left, while even-numbered pages should have the wider inner margin on the right. The problem is that the twoside layout does not start on the expected side. Everything before the Introduction works as intended: pages i–xii have a wider left margin than right margin. However, when the Introduction begins, page 1 is formatted as an even page would be—the wider margin is on the right instead of the left. I expected page 1 to be a right-hand (odd) page, with the wider inner margin on the left. I have tried \cleardoublepage and manually enabling twoside with @twosidetrue, but neither solved the problem. I suspect that I am misunderstanding how twoside, geometry, and page numbering interact. Does anyone know what is causing page 1 to start with the wrong margin configuration, and what would be the correct way to make the Introduction start on an odd/right-hand page? All in one main.tex MWE file [Compiler must be XeLaTeX!]: \documentclass[a4paper, 11pt]{article} % MACROS \newcommand{\ikiSatir}{\\ [2em]} % CONDITIONAL \usepackage{etoolbox} \usepackage{ifthen} % FONT \usepackage[T1]{fontenc} \usepackage[turkish]{babel} \usepackage{fontspec} \setmainfont{Times New Roman} \usepackage{lipsum} %\usepackage{mathptmx} % LAYOUT \usepackage{geometry} \geometry{top=3cm, bottom=3cm, left=4cm, right=2cm} % LINE SPACING \usepackage{setspace} \spacing{1.5} \renewcommand{\arraystretch}{1.5} % PARAGRAPH INDENTATION \setlength{\parindent}{0pt} % SECTION TITLES \usepackage{titlesec} \newbool{centeredsections} \setbool{centeredsections}{true} \newcommand{\setsectionalignment}[1]{ \ifstrequal{#1}{center}{\setbool{centeredsections}{true}}{} \ifstrequal{#1}{left}{\setbool{centeredsections}{false}}{} } \titleformat{\section}{\normalfont\Large\bfseries\ifbool{centeredsections}{\centering}{}}{\thesection.}{1em}{} \titlespacing*{\section}{0pt}{0pt}{2em} \titlespacing*{\subsection}{0pt}{0pt}{2em} \titlespacing{\subsubsection}{0pt}{0pt}{2em} % UNDERLINE \usepackage[normalem]{ulem} \usepackage{ragged2e} % \usepackage{fancyhdr} % \usepackage{array} % SECTIONS \usepackage{tocloft} \makeatletter \renewcommand{\cftsecaftersnum}{. \hskip 1em} \renewcommand{\cftsubsecaftersnum}{ \hskip 1em} \renewcommand{\cftsubsubsecaftersnum}{ \hskip 1em} %\renewcommand{\numberline}[1]{#1.\hskip 1em} \makeatother \renewcommand{\cftdot}{.} \renewcommand{\cftdotsep}{1.5} \renewcommand{\cftsecfont}{\bfseries} \renewcommand{\cftsubsecfont}{\bfseries} \renewcommand{\cftsubsubsecfont}{\bfseries} \renewcommand{\cftsecpagefont}{\bfseries} \renewcommand{\cftsubsecpagefont}{\bfseries} \renewcommand{\cftsubsubsecpagefont}{\bfseries} \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} \setlength{\cftbeforesecskip}{0em} %içindekiler linehegiht \setlength{\cftbeforesubsecskip}{0em} \setlength{\cftsubsecindent}{0pt} \setlength{\cftsubsubsecindent}{0pt} % IMAGES AND DESCRIPTIONS \usepackage{graphicx} \usepackage{caption} \captionsetup[figure]{labelsep=space} \captionsetup[table]{labelsep=space} \captionsetup{justification=raggedright, singlelinecheck=true} \usepackage{chngcntr} \counterwithin{figure}{section} \counterwithin{table}{section} \usepackage{float} \begin{document} \pagenumbering{gobble} \label{cover} \spacing{1} \begin{center} \Large\textbf{XXXXXXXXXXXXX XXXXX (thesis name) } \\ \vspace*{\fill} \Large\textbf{A THESIS SUBMITTED TO} \\ \Large\textbf{THE GRADUATE SCHOOL OF xxx} \Large\textbf{OF} \\ \Large\textbf{ANKARA UNIVERSITY} \vspace{\fill} \Large\textbf{by} \\[5em] \Large\textbf{Xxxx Xxxx XXXXX (name surname) } \\[5em] \Large\textbf{IN PARTIAL FULFILMENT OF THE REQUIREMENTS} \\ \Large\textbf{FOR THE DEGREE OF} \\ \Large\textbf{MASTER OF SCIENCE IN} \\ \large\textbf{Xxxxx Xxxxx (department) }\\[5em] \textbf{\uline{ANKARA}} \\ \textbf{2024} \end{center} \begin{center} \textbf{All rights reserved} \end{center} \newpage \pagenumbering{roman} \spacing{1} \section*{SYMBOLS AND ABBREVIATIONS} \addcontentsline{toc}{section}{SYMBOLS AND ABBREVIATIONS} \begin{flushleft} \begin{tabular}{@{}ll@{}} AHP & Analytical Hierarchy Process \\ \textdegree C & Degree Celsius \\ \% & Percentage \\ $\Sigma$ & The summation symbol \\ \end{tabular} \end{flushleft} \newpage \section*{LIST OF FIGURES} \renewcommand{\figurename}{Figure} \renewcommand{\listfigurename}{} \addcontentsline{toc}{section}{LIST OF FIGURES} \listoffigures \newpage \section*{LIST OF TABLES} \renewcommand{\tablename}{Table} \renewcommand{\listtablename}{} \addcontentsline{toc}{section}{LIST OF TABLES} \listoftables \newpage \newgeometry{twoside, inner=4cm, outer=2cm, top=3cm, bottom=3cm} \spacing{1.5} \pagenumbering{arabic} \setsectionalignment{left} \section{INTRODUCTION} \lipsum[2-3] \begin{figure}[!h] \centering \includegraphics[]{} \caption{Aaaaaaaaaaaaaaa bbbbbbbbbbbbbb} \label{fig:bbb} \end{figure} \begin{table}[!h] \centering \caption{Bbbbbbbbbbbbbbb aaaaaaaaaaaaaa} \begin{tabular}{ll} A & B \\ C & D \\ \end{tabular} \label{ciz:3.1} \end{table} \lipsum[1-2]. \ikiSatir \lipsum[3-5] \ikiSatir \lipsum[6-9] \ikiSatir \end{document} The main question is: How should I correctly switch from the front-matter layout to a twoside layout so that the Introduction starts on page 1 as an odd/right-hand page with the correct inner/outer margins? I changed the values between inner and outer margins, it still doesn't work. The Introduction page (Page 1) still begins left-hand page. I change \pagenumbering mid-document right at the Introduction section, maybe it has something to do with it?

  • Minor issues with brace and alignment in table
    by Svend Tveskæg on October 5, 2026 at 4:32 pm

    The is a follow-up question to Fit side-by-side tables to page width. Explorer came up with a very nice solution to my problem of having two tables side-by-side. However, as can be seen below, when I compile the following code, I have a few minor issues: The smallest braces inside the table are a bit too large and the biggest braces are a bit too small. The Met is a bit too low compared to AUG. I can manually fix this by using \raisebox{0.3ex}{Met}. Code and output % lualatex test.tex \documentclass[ a4paper, 12pt ]{article} \usepackage{fontspec} \setmainfont[ NFSSFamily = tgp, Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, Ligatures = { TeX, CommonOff } ]{texgyrepagella} \usepackage[ math-style = TeX ]{unicode-math} \setmathfont{texgyrepagella-math.otf} \usepackage[ hmargin = 2.4cm, vmargin = 3cm ]{geometry} \usepackage{nicematrix} \usepackage{tabularray} \UseTblrLibrary{tikz} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{hyperref} \newcommand{\skrstr}[1]{\fontsize{#1pt}{\fpeval{1.2*#1}pt}\selectfont} \newcommand{\navn}[1]{\textbf{#1}} \newcommand{\essentiel}[1]{\textcolor{red}{#1}} \newcommand{\PanelWidth}{65pt} \newcommand{\CellGap}{6pt} \newcommand{\CellPadding}{3pt} \newcommand{\ContentPadding}{2pt} \newlength{\CodonLineHeight} \setlength{\CodonLineHeight}{14pt} \newcommand{\GroupLabel}[2]{% \hspace{1pt}% \parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{26pt}{% \raggedright\small\navn{#2}% }% } \newcommand{\ChartCell}[3][\dimexpr4\CodonLineHeight+16pt\relax]{% \parbox[c][\dimexpr#1+\CellGap\relax][c]{\dimexpr#2+\CellGap+\CellPadding*2+\ContentPadding*2\relax}{% \centering \parbox[c][#1][c]{\dimexpr#2+\ContentPadding*2\relax}{\centering#3}% }% } \newcommand{\CodonLines}[1]{% \begingroup \setlength{\tabcolsep}{0pt}% \begin{tabular}{@{}>{\rule[-0.3\CodonLineHeight]{0pt}{\CodonLineHeight}}c@{}}% #1 \end{tabular}% \endgroup } \newcommand{\BraceGroup}[2]{% \hbox{\parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{10pt}{% \centering \raisebox{-2pt}[0pt][0pt]{% \(\nulldelimiterspace = 0pt \smash{\left.\vcenter{\hbox{% \rule{0pt}{\dimexpr#1\CodonLineHeight-3pt\relax}% }}\right\}}% \)% }% }\GroupLabel{#1}{#2}}% } \newcommand{\BraceBlank}[2]{% \hbox{% \parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{10pt}{\mbox{}}% \GroupLabel{#1}{#2}% }% } \newcommand{\CodonPanel}[2]{% \ChartCell{\PanelWidth}{% \CodonLines{#1}\hspace{2pt}% \parbox[c][\dimexpr4\CodonLineHeight\relax][c]{37pt}{% \offinterlineskip#2% }% }% } \newcommand{\RowIndex}[1]{{% \renewcommand{\CellPadding}{0pt}% \ChartCell{18pt}{#1}% }} \newcommand{\ColumnIndex}[1]{\ChartCell[18pt]{\PanelWidth}{#1}} \newcommand{\ThirdIndex}[1]{\RowIndex{\CodonLines{#1}}} \begin{document} \begin{table} \small \centering \begin{tabular}{c@{\qquad}|@{\quad}c}% \scalebox{0.72}{\Large\bfseries 2.~base} & \scalebox{0.72}{\Large\bfseries Forkortelser}\\ \hspace*{10pt}%<-- add left bounding box \begingroup \setlength{\tabcolsep}{0pt} \setlength{\extrarowheight}{0pt} \scalebox{0.72}{\begin{NiceTabular}{@{}cccccc@{}}[corners, cell-space-limits = 0pt] \CodeBefore \TikzEveryCell{offset = \dimexpr\CellGap/2\relax, fill = teal!60} \begin{tikzpicture} \foreach \r/\rn in {2/3,3/4,4/5,5/6} \foreach \c/\cn in {2/3,3/4,4/5,5/6} \fill[yellow!35] ([xshift = \dimexpr\CellGap/2\relax, yshift = -\dimexpr\CellGap/2\relax]\r-|\c) rectangle ([xshift = -\dimexpr\CellGap/2\relax, yshift = \dimexpr\CellGap/2\relax]\rn-|\cn); \end{tikzpicture} \Body & \ColumnIndex{U} & \ColumnIndex{C} & \ColumnIndex{A} & \ColumnIndex{G} \\ \RowIndex{U} & \CodonPanel{UUU\\UUC\\UUA\\UUG}{\BraceGroup{2}{Phe}\BraceGroup{2}{Leu}} & \CodonPanel{UCU\\UCC\\UCA\\UCG}{\BraceGroup{4}{Ser}} & \CodonPanel{UAU\\UAC\\UAA\\UAG}{\BraceGroup{2}{Tyr}\BraceBlank{1}{\skrstr{9.3}\textcolor{red!70!black}{STOP}}\BraceBlank{1}{\skrstr{9.3}\textcolor{red!70!black}{STOP}}} & \CodonPanel{UGU\\UGC\\UGA\\UGG}{\BraceGroup{2}{Cys}\BraceBlank{1}{\skrstr{9.3}\textcolor{red!70!black}{STOP}}\BraceBlank{1}{Trp}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{C} & \CodonPanel{CUU\\CUC\\CUA\\CUG}{\BraceGroup{4}{Leu}} & \CodonPanel{CCU\\CCC\\CCA\\CCG}{\BraceGroup{4}{Pro}} & \CodonPanel{CAU\\CAC\\CAA\\CAG}{\BraceGroup{2}{His}\BraceGroup{2}{Gln}} & \CodonPanel{CGU\\CGC\\CGA\\CGG}{\BraceGroup{4}{Arg}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{A} & \CodonPanel{AUU\\AUC\\AUA\\AUG}{\BraceGroup{3}{Ile}\BraceBlank{1}{Met}} & \CodonPanel{ACU\\ACC\\ACA\\ACG}{\BraceGroup{4}{Thr}} & \CodonPanel{AAU\\AAC\\AAA\\AAG}{\BraceGroup{2}{Asn}\BraceGroup{2}{Lys}} & \CodonPanel{AGU\\AGC\\AGA\\AGG}{\BraceGroup{2}{Ser}\BraceGroup{2}{Arg}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{G} & \CodonPanel{GUU\\GUC\\GUA\\GUG}{\BraceGroup{4}{Val}} & \CodonPanel{GCU\\GCC\\GCA\\GCG}{\BraceGroup{4}{Ala}} & \CodonPanel{GAU\\GAC\\GAA\\GAG}{\BraceGroup{2}{Asp}\BraceGroup{2}{Glu}} & \CodonPanel{GGU\\GGC\\GGA\\GGG}{\BraceGroup{4}{Gly}} & \ThirdIndex{U\\C\\A\\G} \\ \CodeAfter \TikzEveryCell{offset = \dimexpr\CellGap/2\relax, draw} \begin{tikzpicture} % \node[font = \Large\bfseries, anchor = south] % at ([yshift = +8pt]$(1-|2)!0.5!(1-|6)$) {2.~base}; \node[font = \Large\bfseries, rotate = 90, anchor = south] at ([xshift = -2pt]$(2-|1)!0.5!(6-|1)$) {1.~base}; \node[font = \Large\bfseries, rotate = -90, anchor = south] at ([xshift=+2pt]$(2-|7)!0.5!(6-|7)$) {3.~base}; \end{tikzpicture} \end{NiceTabular}} \endgroup% \hspace*{10pt}%<-- add right bounding box &% {\def\mlr{2} \scriptsize \begin{tabular}{ l @{\;=\;} l } \multicolumn{2}{c}{} \\ \navn{Ala} & Alanin~(\navn{A}) \\[\mlr pt] \navn{Arg} & Arginin~(\navn{R}) \\[\mlr pt] \navn{Asn} & Asparagin~(\navn{N}) \\[\mlr pt] \navn{Asp} & Aspartat~(\navn{D}) \\[\mlr pt] \navn{Cys} & Cystein~(\navn{C}) \\[\mlr pt] \navn{Gln} & Glutamin~(\navn{Q}) \\[\mlr pt] \navn{Glu} & Glutamat~(\navn{E}) \\[\mlr pt] \navn{Gly} & Glycin~(\navn{G}) \\[\mlr pt] \navn{His} & \essentiel{Histidin}~(\navn{H}) \\[\mlr pt] \navn{Ile} & \essentiel{Isoleucin}~(\navn{I}) \\[\mlr pt] \navn{Leu} & \essentiel{Leucin}~(\navn{L}) \\[\mlr pt] \navn{Lys} & \essentiel{Lysin}~(\navn{K}) \\[\mlr pt] \navn{Met} & \essentiel{Methionin}~(\navn{M}) \\[\mlr pt] \navn{Phe} & \essentiel{Phenylalanin}~(\navn{F})\\[\mlr pt] \navn{Pro} & Prolin~(\navn{P}) \\[\mlr pt] \navn{Ser} & Serin~(\navn{S}) \\[\mlr pt] \navn{Thr} & \essentiel{Threonin}~(\navn{T}) \\[\mlr pt] \navn{Trp} & \essentiel{Tryptofan}~(\navn{W}) \\[\mlr pt] \navn{Tyr} & Tyrosin~(\navn{Y}) \\[\mlr pt] \navn{Val} & \essentiel{Valin}~(\navn{V}) \\ \end{tabular}} \end{tabular} \end{table} \end{document} Questions How can the braces be adjusted automatically? (I don't see this issue in Explorer's answer which confuses me a bit.) How can the alignment be done automatically? (I do see this issue in Explorer's answer.)

  • Using \multicolumn inside align
    by schtandard on October 5, 2026 at 3:43 pm

    I have a block of equations that I want to align (and number) with a final equation that should just be centered. Since align is essentially a table, my first attempt to realize this was to just use \multicolumn, but this shifts the equation number into the margin. \documentclass{article} \usepackage{array} \usepackage{amsmath} \begin{document} \begin{align} a_1 &= b_1 & a_2 &= b_2 \\ c_1 &= -d_1 & c_2 &= -d_2 \\ \multicolumn{4}{c}{$e = f$} \end{align} \end{document} How can I achieve the same alignment effect without shifting the equation number?

  • Compilation error if listing contains either | or $
    by Marek Stepanek on October 5, 2026 at 9:18 am

    How to print out a Makefile into \usepackage{listings} Here a mwe which I cut were the compiling stops. (l. 43) Choosing CMake as language does not help. \documentclass{scrreprt} \usepackage{listings} \lstset{escapeinside=||} % this is trying to read in the code from an external file \newcommand{\snip}[2][]{% \IfFileExists{snips/snips/#2} {\lstinputlisting[style=texcode, #1]{snips/snips/#2}} {\lstinputlisting[style=texcode, #1]{snips/#2}}% } \begin{document} \begin{lstlisting}[language=make, title=Makefile Original, mathescape] # NOTE: every recipe line below must start with a real TAB, not spaces. # --- what to build (values only; comments go above, never on the same line) -- MAIN ?= foo_headers SRCDIR ?= foo_dialogs BUILDDIR ?= _build # Sanitised copies of everything above. The recipes use only these, so a stray # space from the environment -- or a command line like `make BUILDDIR='_build '` # -- can never reach a filename. MAINBASE := $(strip $(MAIN)) CHAPDIR := $(strip $(SRCDIR)) OUTDIR := $(strip $(BUILDDIR)) # Tools. VIEWER is overridable and its call is prefixed with '-' in the # recipe, so a machine without Preview (Linux, CI) still gets a clean build: # `make VIEWER=true` or `make VIEWER=:`. LATEXMK ?= latexmk LATEXMKFLG ?= -lualatex -bibtex VIEWER ?= open -a Preview # Which chapter gets compiled? # default : whatever the master pulls in at the moment (auto-detected from # the first \input{...} or \include{...} naming the chapter dir) # override: make compile CH=chapters/networking_new02_day60-64.tex # Both mechanisms only *name* the job; the master decides the content -- see # the note at the bottom of this file. CH ?= $(shell sed -nE 's@.*\\(input|include)[{]([^}]*$(CHAPDIR)/[^}]*)[}].*@\2@p' $(MAINBASE).tex 2>/dev/null | head -n 1) \end{listings}

  • Building a dependency graph based on proofs of results referencing other lemmas and theorems
    by One_Cable5781 on October 5, 2026 at 6:40 am

    Consider \begin{lemma}\label{lma:firstlemma} All men are mortal. \end{lemma} %say above gets typeset as Lemma 1 \begin{thm}\label{th:firsttheorem} Socrates is mortal. \end{thm} %say above gets typeset as Theorem 1. \begin{proof} We know from Lemma \ref{lma:firstlemma} that all men are mortal.... \end{proof} Like the above, I have a large number of theorems in my study notes which reference previous results, etc. Is there a way to build a visually perceivable dependency graph wherein there is a node labelled L1 which stands for Lemma 1 and another node labelled T1 which stands for Theorem 1 and there is a directed arc leading from L1 to T1? Giving this task by uploading the typeset pdf to ChatGPT is one way but it is static. Is there an inbuilt way, which can dynamically change the graph node labelling if a new theorem is added in the middle thereby changing the numbering of subsequent theorems? The way should accept .tex files and not the compiled .pdf output. ----xposted to /r/latex as well---- Edited to add: I was made aware of a package by a user over at /r/learnmath which approximately does what I asked for in this OP. https://github.com/PierreSenellart/proofgraph [I have no connection with that author] So, please consider this thread as answered.

  • author of book and author of mvbook differ
    by Alexander Wittmann on October 4, 2026 at 11:06 pm

    bibstyle: biblatex-philosophy In the Collected Works of JW von Goethe there is one volume not written by the god himself (mainauthor), but by one of his servants ([book]author), i.e. JP Eckermann. It's nevertheless vol. X of Werke, by [not edby] Goethe, JW von, 99 vols., Frankfurt 1985--2013. How do I get something like Eckermann, JP, Gespräche mit Goethe, Vol. X, in Werke, von JW von Goethe, 99 vols., Location: Publisher, 1985-2013. ??? The closest I can get (--> 2nd entry) is by replacing author of Werke by editor, which is misleading as the author of the multivolume book is still Goethe, and there is a whole bunch of first and second class editors for each of the volumes. \documentclass[german]{article} \usepackage[unicode]{hyperref} \usepackage[main=german]{babel} \usepackage{bookmark} \usepackage[style=german]{csquotes} \usepackage{isodate} \usepackage[style=philosophy-modern,sortlocale=de_DE,sorting=nyvt,% language=german, bibencoding=utf8, backend=biber, hyperref=true% ]{biblatex} \addbibresource{author-mainauthor.bib} \begin{document} blabla \cite{Eckermann:Gespraeche}, \cite{Eckermann:Gespraeche1} \nocite{*} \printbibliography{} \begin{filecontents}[force]{author-mainauthor.bib} @Book{Eckermann:Gespraeche, author = {Johann Peter Eckermann}, gender = {sm}, options = {useeditor=false,useauthor=true}, title = {Gespräche mit Goethen in den letzten Jahren seines Lebens \mkbibbrackets{1823\bibrangedash 1832}}, shorttitle = {Gespräche}, langid = {german}, date = 1999, editor = {Christoph Michel}, editora = {Hans Grüters}, editoratype = {collaborator}, commentator = {Christoph Michel}, series = {Bibliothek Deutscher Klassiker}, number = 167, publisher = {Deutscher Klassiker Verlag}, location = {Frankfurt am Main}, related = {Goethe:Werke}, relatedstring = {in}, volume = {X} } @SuppCollection{Eckermann:Gespraeche1, author = {Johann Peter Eckermann}, gender = {sm}, booktitle = {Gespräche mit Goethen in den letzten Jahren seines Lebens \mkbibbrackets{1823\bibrangedash 1832}}, langid = {german}, date = 1999, editor = {Christoph Michel}, editora = {Hans Grüters}, editoratype = {collaborator}, commentator = {Christoph Michel}, series = {Bibliothek Deutscher Klassiker}, number = 167, publisher = {Deutscher Klassiker Verlag}, location = {Frankfurt am Main} } @MVCollection{Goethe:Werke, editor = {Johann Wolfgang Goethe}, gender = {sm}, options = {useeditor=false,useauthor=true,skipbib}, title = {Sämtliche Werke, Briefe, Tagebücher und Gespräche}, date = {1985/2013}, language = {german}, publisher = {Deutscher Klassiker Verlag}, series = {Bibliothek Deutscher Klassiker}, location = {Frankfurt am Main}, volumes = 99 } \end{filecontents} \end{document}

  • The water level and the principle of communicating vessels
    by Sebastiano on October 4, 2026 at 7:49 pm

    I would like to create a water level, i.e. a transparent flexible tube filled with water, so that the principle of communicating vessels is clearly illustrated. How can I represent the flexible tube, keeping it along the horizontal surface and making it run up the two vertical sides, so that the configuration is similar to the one shown in the image? Here my 1st MWE: \documentclass{article} \usepackage{tikz} \usepackage{tikzphysics} \begin{document} \begin{tikzpicture}[ line cap=round, line join=round ] \node[ ground, ground width=8.6cm, ground depth=3mm ] (G) at (0,0) {}; \node[ ground, ground width=3.2cm, ground depth=3mm, rotate=90 ] (GL) at (-3.5,1.6) {}; \node[ ground, ground width=3.2cm, ground depth=3mm, rotate=90 ] (GR) at (3.5,1.6) {}; \draw[dashed, thick] (-3.9,2.8) -- (4.2,2.8); \draw[thin] (-3.9,0) -- (-3.7,0); \node[left] at (-3.7,3.1) {\small 100.0}; \draw[thin] (-3.2,0) -- (-3.2,3.1); \draw[thin] (3.8,0) -- (3.8,3.1); \draw[thin] (3.7,0) -- (3.9,0); \node[right] at (3.9,3.1) {\small 100.0}; \draw[thin] (-4.3,0) -- (-3.8,0); \node[left] at (-4.3,0.08) {\small 0.00}; \end{tikzpicture} \end{document} Now with Mathcha I have created the flexible tube, \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usepackage{tikzphysics} \definecolor{water}{RGB}{73,194,221} \pagestyle{empty} \begin{document} \centering \begin{tikzpicture}[x=1cm,y=1cm] \node[ ground, ground width=8.6cm, ground depth=3mm ] (G) at (0,0) {}; \node[ ground, ground width=3.2cm, ground depth=3mm, rotate=90 ] (GL) at (-3.5,1.6) {}; \node[ ground, ground width=3.2cm, ground depth=3mm, rotate=90 ] (GR) at (3.5,1.6) {}; \draw[dashed, thick] (-3.9,2.5) -- (4.2,2.5); \draw[thin] (-3.9,0) -- (-3.7,0); \node[left] at (-3.7,3.1) {\small 100.0}; \draw[thin] (-3.2,0) -- (-3.2,3.1); \draw[thin] (3.8,0) -- (3.8,3.1); \draw[thin] (3.7,0) -- (3.9,0); \node[right] at (3.9,3.1) {\small 100.0}; \draw[thin] (-4.3,0) -- (-3.8,0); \node[left] at (-4.3,0.08) {\small 0.00}; \begin{scope}[shift={(-6cm,-.9cm)}] \draw[gray!70,line width=7pt] (3.48,4.32) .. controls (3.48,3.98) and (3.71,3.58) .. (3.72,3.21) .. controls (3.73,2.85) and (3.50,2.35) .. (3.84,1.74) .. controls (4.10,1.23) and (4.46,1.03) .. (4.97,1.03) .. controls (6.20,1.03) and (7.68,0.99) .. (8.36,1.59) .. controls (8.96,2.09) and (8.90,3.16) .. (8.90,4.23); \draw[gray!20,line width=4.5pt] (3.48,4.32) .. controls (3.48,3.98) and (3.71,3.58) .. (3.72,3.21) .. controls (3.73,2.85) and (3.50,2.35) .. (3.84,1.74) .. controls (4.10,1.23) and (4.46,1.03) .. (4.97,1.03) .. controls (6.20,1.03) and (7.68,0.99) .. (8.36,1.59) .. controls (8.96,2.09) and (8.90,3.16) .. (8.90,4.23); \draw[water,line width=4.5pt] (3.69,3.42) .. controls (3.81,3.02) and (3.49,2.39) .. (3.84,1.74) .. controls (4.10,1.23) and (4.46,1.03) .. (4.97,1.03) .. controls (6.20,1.03) and (7.68,0.99) .. (8.36,1.59) .. controls (8.82,1.98) and (8.92,2.72) .. (8.90,3.42); \end{scope} \end{tikzpicture} \end{document} but the tube is not filled correctly.

  • How to name a string variable inside a \foreach loop using the loop variable
    by Plum Rapson on October 4, 2026 at 3:42 pm

    I am trying to simplify my document typing for schoolwork. For ODEs, we are asked to show multiple possible solutions for a given differential equation. I have been using TikZ, pgfplots, and a dash of audacity to place multiple functions on the same graph, changing either the value of y_0 or C or both to show different function outcomes. However, this takes up a lot of space and time, so I am hoping that I could define a new command to repeatedly \addplot with slightly different functions. Here's what I have so far, including the page setup and relevant preamble for a sanity check: \documentclass[12pt]{article} \usepackage{geometry} %I have my page set to weird sizes and small margins \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{shapes.geometric,arrows.meta,calc,pgfplots.external} \pgfplotsset{compat=1.18} \usepackage{xstring} \newcommand{\addmultiplot}[3][2]{ %{sample}{variable}{equation} where sample is a number %determined by my own organization, variable is %the character variable to be changed, equation is %formatted exactly as it would in \addplot \IfEqCase{#1}{ {0.1}{ \def\a{-0.9} \def\b{-0.1} \def\c{0.1} \def\d{0.4} \def\e{0.75} \foreach \x in {\a, \b, \c, \d}{ \StrSubstitute{#3}{#2}{\x}[\NAME] \def\nums{\a, \b, \c, \d, \e} %%%% Haven't been able to test, want this to give me \nums = {-0.9, -0.1, 0.1, 0.4, 0.75} } } {2}{ \def\a{-10} \def\b{-5} \def\c{2} \def\d{5} \def\e{10} \foreach ... } } . . . [] }; \foreach \v in {\nums} {\addplot{\NAME}};} \begin{document} \begin{tikzpicture} \begin{axis}[xticks =\empty, yticks= \empty] \addmultiplot{2}{C}{3*(C)/((C) + exp(3*x^2)*(3 - (C)))}; \end{axis} \end{tikzpicture} \end{document} What I am struggling with is [\NAME], Where I would want something like eq\x so that the last line of the command sees nums as {-0.9, -0.1, 0.1, 0.4, 0.75} and outputs \addplot{eq-0.9}; \addplot{-0.1}; etc. Maybe trying to have the negative sign be a part of it would be a problem, but I haven't even gotten there yet. At first I had [eq\x], but it gave me a \def issue "please don't put \def cs {...} use \def\cs{...}" on the line where I called \addmultiplot, and after trimming things down and making sure all the numbers were going into clearly defined variables, I'm left with assuming it involves the names of my equations, but surely [\eq\x] would not result in the first string later being referred to by "eq-0.9" so that when the final \foreach looks at \nums and pulls -0.9, \addplot can receive the equation that has C replaced with -0.9.

  • Defining a point on a plane using Asymptote
    by Fabrice on October 4, 2026 at 12:19 pm

    The idea is to reproduce the figure using the Asymptote software for the first time. The code could likely be improved, given that I determined the points on the plane using the Cartesian equation 25x + 14y - 35 = 0. Is there a better way to define the points on the plane ? import three; import math; size(8cm); defaultpen(fontsize(9pt)); currentprojection=orthographic ( camera=(8,5,4), up=(0,0,1), target=(2,2,2), zoom=1 ); pen style1 = linetype("4 4"); real h = 1; triple A = (1.4*h,0,0), B = (1.4*h,2.5*h,0), C = (0,2.5*h,0), D = (0,0,0), Ep = (1.4*h,0,1.3*h), F = (1.4*h,2.5*h,1.3*h), G = (0,2.5*h,1.3*h), H = (0,0,1.3*h); path3 p = A--C--G--Ep--cycle; draw(surface(p),lightgray+opacity(0.5)); draw(A--B--F--Ep--cycle^^B--F--G--C--cycle^^G--H--Ep); draw(A--D--C^^D--H,dashed); triple I = (0.728,1.2,0.55); triple J = (1.232,0.3,0.3); triple K = (1.036,0.65,0.75); triple S = interp(J,I,1.3); triple Np = interp(J,K,1.3); triple M = shift(Np-J)*S; dot(I);dot(J);dot(K);dot(S);dot(Np);dot(M); draw(interp(J,I,-0.1)--interp(J,I,1.6),style1); draw(interp(J,K,-0.2)--interp(J,K,1.6),style1); draw(S--M,style1); draw(Np--M,style1); draw(J--M,style1); draw(A--C,style1); draw(Ep--G); label("$A$",J, align=NW); label("$B$",I, align=SE); label("$C$",K, align=NW); label("$S$",S, align=SE); label("$N$",Np, align=NW); label("$M$",M, align=SE);

  • Linguistic examples in gb4e: formatting the preamble (NOT the gloss lines)
    by Robert on October 4, 2026 at 9:50 am

    I'm writing a book with a lot of linguistic examples and had to switch from expex to gb4e due to publisher requirements. Most of my examples have three lines, an orthographic representation that is not aligned with the others and two more for interlinear glosses (morphemes and labels). For example: \ea Huŋkhi cektake pho. \\ \gll hun -khiʔ cekt -a -k -e pho \\ MED -MOD say -PST -IPFV -IND.PST[.3sg.S] REP \\ \glt ‘I heard he was saying that.’ \z I know how to format the two interlinear lines using \leteachwordone and \leteachwordtwo. However, my question is about the first line (in the example, Huŋkhi cektake pho.). In expex this would have been called the preamble and I could have modified it using everyglpreamble=\itshape (italicizing this line is my ultimate goal). What is this line called in gb4e and how can I modify it centrally? There is no \leteachwordzero, so I'm at a loss. Edit: My question has been answered, I'm just adding a minimal working example below as requested, maybe others can use it this way, too. I also get the problem with the italicized subexamples when I use the original gb4e but I'm using the modified package langsci-gb4e and there it doesn't occur. I'm combining Marijn's suggestion (\AddToHook) with the etoolbox package to overrun some class defaults for formatting examples. Also note I'm using XeLaTeX. \documentclass{langscibook} \usepackage{etoolbox} % modify commands such that additional code is run each time they are called \usepackage{langsci-gb4e} \AddToHook{cmd/ex/after}{\itshape} % line 1 (= orthographic representation) in italics \AddToHook{cmd/gll/before}{\normalfont} % back to normal font after that (otherwise all following lines are in italics) \pretocmd{\gll}{\def\eachwordone{\normalfont}}{}{} % line 2 (= segments) in normal font \pretocmd{\gll}{\def\eachwordtwo{\small}}{}{} % line 3 (= glosses) in smaller font \pretocmd{\glll}{\def\eachwordtwo{\small}\def\eachwordthree{\small}}{}{} % same in occasional examples with additional gloss line 4 \begin{document} \begin{exe} \ex Sattekha gone, o baba! Lu, abo tupla basaiʔko ubheĩbe. \\ \gll satte =kha gonei o baba la abo tupla ba -sa -iʔ =go u- bheĩ -beʔ \\ truth =NMLZ₂ ATTN oh lord okay now {banana\textunderscore leaf} PROX -OBL -LOC₁ =NMLZ₁ 3SG.POSS- {place\textunderscore below} -LOC₂ \\ \glt ‘It is the truth indeed, oh Father! Okay, now [put] the banana leaf below this thing here.’ \end{exe} \begin{exe} \ex \begin{xlist} \ex Huŋgo haniwahum koptubidaʔ. \\ \gll hun =go hani- wahum kopt -u -pid -a \\ MED NMLZ₁ 2PL.POSS- calabash {pick\textunderscore up\textunderscore for} -3[sg].P -BEN -IMP[.2SG.A] \\ \glt ‘Pick up that calabash of yours for him.’ \ex Achetta pati garikana, soloĩwa khukmari garikana... \\ \gll acheta pati gar -ikana soloĩwa khukmari gar -ikana \\ {consecrated\ rice} leaf do -CVB calabash trident do -CVB \\ \glt ‘Having [here before me] consecrated rice, having calabashes and a trident...’ \end{xlist} \end{exe} \end{document}

  • Custom font sizes like Word Office [duplicate]
    by Sebastiano on October 4, 2026 at 8:42 am

    I am using the extarticle document class because I need larger font sizes than those provided by the standard article class. My document currently starts with: \documentclass[leqno,14pt]{extarticle} As far as I understand, extarticle provides the following font sizes: 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, and 20pt. However, I would like to use intermediate font sizes such as 11.5pt or 11.758653pt, 12.54525pt, 13pt, or 15pt, similar to what is possible in Microsoft Word. Is there a proper way to define or use arbitrary base font sizes to have the same size like Microsoft Word (example: 12.58217582pt)? I am preparing a multiple-choice test with 10 questions and want to typeset it on an A3 page, so being able to fine-tune the font size would be very useful. Related: How to put centered figures in \question{} using TikZ and \includegraphics without mistakes

  • Apparent conflict between \xelatex and \Longrightarrow
    by Leo on October 4, 2026 at 8:34 am

    The command \Longrightarrow gives a broken arrow if I compile using xelatex and a regular (long) arrow if I compile using pdflatex. Here is MWE: \documentclass[11pt,b5paper]{book} \usepackage{amsmath, mathrsfs} %\usepackage[T1]{fontenc} % %\usepackage{fontspec} % %\setmainfont{Tinos} % \usepackage{polyglossia} % \setdefaultlanguage{french} % \setotherlanguages{hebrew, greek} % \newfontfamily\hebrewfont[Script=Hebrew]{Tinos} % \newfontfamily\greekfont[Script=Greek]{Linux Libertine O} % \newfontfamily\greekfontsf[Script=Greek]{Linux Libertine O} \begin{document} $$ A \Longrightarrow B$$ \end{document} This works correctly as it is (with pdflatex). If one includes the commented out (%) code (and compiles with xelatex), the arrow is broken. Is it a known conflict of packages?

  • How to add \tags to multi-line equations in Lyx?
    by Penelope on October 3, 2026 at 11:46 pm

    I am trying to add text using \tag in a multi-line equation in Lyx. Here is how I do it in mathjax for the web. \begin{align} a \alpha \beta + b \beta^2 N^2 & = \beta \\ \\ b (\beta^2 N^2 - \alpha^2) & = \beta  \tag{using (ii)} \\ \\ \beta ( \alpha^2 - \beta^2 N^2) & = \beta \tag{using (iv)}\\ \\ \alpha^2 - \beta^2 N^2 & = 1 \end{align} And the result seems to work: But I can't find any way to do this in the Lyx gui. Perhaps I shouldn't be trying to add tag, and there is a more canonical way to do it? Ultimately I want to express short explainers with each line of a multi-line equation.

  • \autoref does not work for my exercise environment. What should I use?
    by Sourav on October 3, 2026 at 9:51 pm

    I want to link my exercise later in the document such that the text "Exercise #" is (colored and) hyperlinked. For doing the same with the theorem environment, \autoref can be used, but it doesn't work with my exercise environment. How can I make it work ? Here is what I tried : \documentclass{article} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{hyperref} \hypersetup{ colorlinks=true, filecolor=red, urlcolor=red, linkcolor=red } \newtheorem{theorem}{Theorem} \theoremstyle{definition} \newtheorem{exercise}{Exercise} \begin{document} \begin{theorem} \label{th} A theorem. \end{theorem} \begin{exercise} \label{ex} Some exercise. \end{exercise} See \ref{th} and \ref{ex}. \\ See \autoref{th} and \autoref{ex} \end{document} Output : In particular, I want the second 1 in the second line to be written as Exercise 1, instead of just the number 1.

  • Want an environment titled "Solution of Exercise #"
    by Sourav on October 3, 2026 at 10:26 am

    I am in need of an environment of the following name : Solution of Exercise #, where # is the required exercise number. I know that I can do this in case of a proof : \documentclass{article} \usepackage{amsmath,amsfonts,amssymb,amsthm} \usepackage{hyperref} \hypersetup{ colorlinks=true, filecolor=red, urlcolor=red, linkcolor=red } \newtheorem{theorem}{Theorem} \theoremstyle{definition} \newtheorem{exercise}{Exercise} \theoremstyle{remark} \newtheorem*{solution}{Solution} \begin{document} \begin{theorem} \label{th} Theorem. \end{theorem} Some content in between. \begin{proof}[Proof of \ref{th}] Proof. \end{proof} \end{document} The above gives the following output : How can I do the same for a solution ?

  • Fit side-by-side tables to page width
    by Svend Tveskæg on October 2, 2026 at 6:55 pm

    Introduction This is a follow-up question to List and "complicated" table side-by-side. In Explorer's answer everything looks good, but I forgot to mention the dimensions of the pages in my document, and when I copy-paste the answer into my document, it doesn't fit at all. (That's my own stupid fault for not mentioning this in the first place.) Code \documentclass[ a4paper, 12pt ]{article} \usepackage[ hmargin = 2.4cm, vmargin = 3cm ]{geometry} \usepackage{nicematrix} \usepackage{tabularray} \UseTblrLibrary{tikz} \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\PanelWidth}{65pt} \newcommand{\CellGap}{6pt} \newcommand{\CellPadding}{3pt} \newlength{\CodonLineHeight} \setlength{\CodonLineHeight}{14pt} \newcommand{\GroupLabel}[2]{% \hspace{1pt}% \parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{26pt}{% \raggedright\small\bfseries#2% }% } \newcommand{\ChartCell}[3][\dimexpr4\CodonLineHeight+16pt\relax]{% \parbox[c][\dimexpr#1+\CellGap\relax][c]{\dimexpr#2+\CellGap+\CellPadding*2\relax}{% \centering \parbox[c][#1][c]{#2}{\centering#3}% }% } \newcommand{\CodonLines}[1]{% \begingroup \setlength{\tabcolsep}{0pt}% \begin{tabular}{@{}>{\rule[-.3\CodonLineHeight]{0pt}{\CodonLineHeight}}c@{}}% #1 \end{tabular}% \endgroup } \newcommand{\BraceGroup}[2]{% \hbox{\parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{10pt}{% \centering \raisebox{-2pt}[0pt][0pt]{% \(\nulldelimiterspace=0pt \smash{\left.\vcenter{\hbox{% \rule{0pt}{\dimexpr#1\CodonLineHeight-8pt\relax}% }}\right\}}% \)% }% }\GroupLabel{#1}{#2}}% } \newcommand{\BraceBlank}[2]{% \hbox{% \parbox[c][\dimexpr#1\CodonLineHeight\relax][c]{10pt}{\mbox{}}% \GroupLabel{#1}{#2}% }% } \newcommand{\CodonPanel}[2]{% \ChartCell{\PanelWidth}{% \CodonLines{#1}\hspace{2pt}% \parbox[c][\dimexpr4\CodonLineHeight\relax][c]{37pt}{% \offinterlineskip#2% }% }% } \newcommand{\RowIndex}[1]{{% \renewcommand{\CellPadding}{0pt}% \ChartCell{18pt}{#1}% }} \newcommand{\ColumnIndex}[1]{\ChartCell[18pt]{\PanelWidth}{#1}} \newcommand{\ThirdIndex}[1]{\RowIndex{\CodonLines{#1}}} \begin{document} \noindent X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X {\sffamily \begin{tabular}{c@{\qquad\qquad\qquad}|@{\qquad\qquad}c}% {\sffamily\bfseries Anden base} & {\sffamily\bfseries Betegnelser}\\[-6.5ex] \begingroup \setlength{\tabcolsep}{0pt} \setlength{\extrarowheight}{0pt}\hspace*{30pt}% <-- add left bounding box ... \begin{NiceTabular}{@{}cccccc@{}}[corners, cell-space-limits = 0pt] \CodeBefore \TikzEveryCell{offset = \dimexpr\CellGap/2\relax, fill = teal!60} \begin{tikzpicture} \foreach \r/\rn in {2/3,3/4,4/5,5/6} \foreach \c/\cn in {2/3,3/4,4/5,5/6} \fill[yellow!35] ([xshift = \dimexpr\CellGap/2\relax, yshift = -\dimexpr\CellGap/2\relax]\r-|\c) rectangle ([xshift = -\dimexpr\CellGap/2\relax, yshift = \dimexpr\CellGap/2\relax]\rn-|\cn); \end{tikzpicture} \Body & \ColumnIndex{U} & \ColumnIndex{C} & \ColumnIndex{A} & \ColumnIndex{G} \\ \RowIndex{U} & \CodonPanel{UUU\\UUC\\UUA\\UUG}{\BraceGroup{2}{Phe}\BraceGroup{2}{Leu}} & \CodonPanel{UCU\\UCC\\UCA\\UCG}{\BraceGroup{4}{Ser}} & \CodonPanel{UAU\\UAC\\UAA\\UAG}{\BraceGroup{2}{Tyr}\BraceBlank{1}{\textcolor{red!70!black}{STOP}}\BraceBlank{1}{\textcolor{red!70!black}{STOP}}} & \CodonPanel{UGU\\UGC\\UGA\\UGG}{\BraceGroup{2}{Cys}\BraceBlank{1}{\textcolor{red!70!black}{STOP}}\BraceBlank{1}{Trp}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{C} & \CodonPanel{CUU\\CUC\\CUA\\CUG}{\BraceGroup{4}{Leu}} & \CodonPanel{CCU\\CCC\\CCA\\CCG}{\BraceGroup{4}{Pro}} & \CodonPanel{CAU\\CAC\\CAA\\CAG}{\BraceGroup{2}{His}\BraceGroup{2}{Gln}} & \CodonPanel{CGU\\CGC\\CGA\\CGG}{\BraceGroup{4}{Arg}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{A} & \CodonPanel{AUU\\AUC\\AUA\\AUG}{\BraceGroup{3}{Ile}\BraceBlank{1}{\textcolor{blue!75!black}{Met}}} & \CodonPanel{ACU\\ACC\\ACA\\ACG}{\BraceGroup{4}{Thr}} & \CodonPanel{AAU\\AAC\\AAA\\AAG}{\BraceGroup{2}{Asn}\BraceGroup{2}{Lys}} & \CodonPanel{AGU\\AGC\\AGA\\AGG}{\BraceGroup{2}{Ser}\BraceGroup{2}{Arg}} & \ThirdIndex{U\\C\\A\\G} \\ \RowIndex{G} & \CodonPanel{GUU\\GUC\\GUA\\GUG}{\BraceGroup{4}{Val}} & \CodonPanel{GCU\\GCC\\GCA\\GCG}{\BraceGroup{4}{Ala}} & \CodonPanel{GAU\\GAC\\GAA\\GAG}{\BraceGroup{2}{Asp}\BraceGroup{2}{Glu}} & \CodonPanel{GGU\\GGC\\GGA\\GGG}{\BraceGroup{4}{Gly}} & \ThirdIndex{U\\C\\A\\G} \\ \CodeAfter \TikzEveryCell{offset = \dimexpr\CellGap/2\relax, draw} \begin{tikzpicture} % \node[font = \sffamily\bfseries, anchor = south] % at ([yshift = +2pt]$(1-|2)!0.5!(1-|6)$) {Second Letter}; \node[font = \sffamily\bfseries, rotate = 90, anchor = south] at ([xshift = -2pt]$(2-|1)!0.5!(6-|1)$) {Første base}; \node[font = \sffamily\bfseries, rotate = -90, anchor = south] at ([xshift = +2pt]$(2-|7)!0.5!(6-|7)$) {Tredje base}; \end{tikzpicture} \end{NiceTabular} \endgroup% &% \begin{tabular}{l @{\;=\;} l} \multicolumn{2}{c}{} \\[0.25cm] \textbf{Ala} & Alanine\;(\textbf{A})\\[4pt] \textbf{Arg} & Arginine\;(\textbf{R})\\[4pt] \textbf{Asn} & Asparagine\;(\textbf{N})\\[4pt] \textbf{Asp} & Aspartate\;(\textbf{D})\\[4pt] \textbf{Cys} & Cysteine\;(\textbf{C})\\[4pt] \textbf{GIn} & Glutamine\;(\textbf{Q})\\[4pt] \textbf{Glu} & Glutamate\;(\textbf{E})\\[4pt] \textbf{Gly} & Glycine\;(\textbf{G})\\[4pt] \textbf{His} & Histidine\;(\textbf{H})\\[4pt] \textbf{Ile} & Isoleucine\;(\textbf{I})\\[4pt] \textbf{Leu} & Leucine\;(\textbf{L})\\[4pt] \textbf{Lys} & Lysine\;(\textbf{K})\\[4pt] \textbf{Met} & Methionine\;(\textbf{M})\\[4pt] \textbf{Phe} & Phenylalanine\;(\textbf{F})\\[4pt] \textbf{Pro} & Proline\;(\textbf{P})\\[4pt] \textbf{Ser} & Serine\;(\textbf{S})\\[4pt] \textbf{Thr} & Threonine\;(\textbf{T})\\[4pt] \textbf{Trp} & Tryptophan\;(\textbf{W})\\[4pt] \textbf{Tyr} & Tyrosine\;(\textbf{Y})\\[4pt] \textbf{Val} & Valine\;(\textbf{V})\\[0.8cm] \end{tabular}\\ \end{tabular}} \end{document} Question How do I modify the code in order to make the two side-by-side tables fit on the page?

  • How to test that my package option is not set?
    by gildux on October 2, 2026 at 5:56 pm

    I'm writing a package (that will be called mytest in the MWE) but I'm having a little trouble with the use of one option (the only case presented in the MWE). Well, I have this mytest.sty file: \NeedsTeXFormat{LaTeX2e}[2022/06/02] \ProvidesPackage{mytest}[2026/09/09 v0.0.0 my test] \DeclareKeys[mytest]{% foo.store = \@mytest@foo, foo.usage = load, } \ProcessKeyOptions[mytest] \NewDocumentCommand\myexample{o m }{% foo?, baz \IfNoValueTF{#1}{% use default, set by \IfBlankTF{\@mytest@foo}{nope% package. }{\@mytest@foo% user. } }{#1% use provided… }\space% \emph{#2}% } \endinput Then I use this mytest.tex file: \documentclass{article} \usepackage{mytest} \begin{document} \myexample{yeah}. \end{document} I'd expect the result to be of nope \emph{yeah}. but that's not the case. What am I doing wrong? Note that replacing the \IfBlankTF with \IfNoValueTF gives the same result, so after keys processing \@mytest@foo is neither blank nor null/unset. I'm lost.

  • List and "complicated" table side-by-side
    by Svend Tveskæg on October 2, 2026 at 3:17 pm

    Introduction I'v been pondering about how to get started with the following table and list side-by-side. Unfortunately, I haven't come up with any useful ideas, so once again I present a "please do (some of) it for me" question. Sorry! 🙁 Question I would like to reproduce the following table and list side-by-side: A few 'corrections': Table: I don't want the light color in the middle of each cell; plain yellow is preferred. List: I would like to left-align both the abbreviations, the equal signs, and the names. Important I hope that I can do the rest of it myself, as long as someone helps me getting started by setting up the "First letter", "Second letter", and "Third letter" labels around the table, the turquoise boxes on the edges of the table, the contents of the top-left yellow cell in the table, the first two rows aligned in the list. Again, I'm sorry for this type of question but I don't know where to start.

  • How to set active characters locally within a command using expl3?
    by modallyFragile on October 2, 2026 at 10:48 am

    How to set active characters locally within a command using expl3? I want to use some characters in special ways inside the argument to a command, which I define with expl3. Let's say I want < to expand to \textlangle. I can set up the active characters successfully outside the command: \documentclass{article} \ExplSyntaxOn \cs_new_protected:Npn \__textlangle: { \textlangle } \char_set_active_eq:nN { `< } \__textlangle: \char_set_catcode_active:N < \ExplSyntaxOff \begin{document} % Desired behaviour, prints 〈foo <foo \end{document} But if I try to do the same thing inside a command, using local asignments, it doesn't work; what's going on? \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\specialsyntax}{ +m }{ \group_begin: \cs_new_protected:Npn \__textlangle: { \textlangle } \char_set_active_eq:nN { `< } \__textlangle: \char_set_catcode_active:N < #1 \group_end: } \ExplSyntaxOff \begin{document} % Wrong behaviour, prints <foo \specialsyntax{<foo} \end{document} TIA.

  • Need to fix equal space for all row using tabularray
    by MadyYuvi on October 2, 2026 at 8:12 am

    I tried with: \documentclass[twocolumn]{article} \usepackage{amsmath} \usepackage{array} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{booktabs,siunitx} \definecolor{tablightcolor}{cmyk}{0.08,0.04,0.01,0}% \definecolor{tabdarkcolor}{cmyk}{0.16,0.07,0.02,0}% \definecolor{tabcolheadcolor}{cmyk}{0.81,0.34,0.07,0}% \SetTblrInner{% rowsep=2pt,% row{1}={l,b},% hborder{1}={belowspace=3.25pt},% hborder{2}={abovespace=2pt,belowspace=6pt},% hborder{Z}={abovespace=6pt},% width=\linewidth,% %%%% row{odd} = {tabdarkcolor},% row{even} = {tablightcolor},% hlines = {1pt,white},% row{1} = {bg=tabcolheadcolor, fg=white,},% }% \NewColumnType{T}{>{\raggedright\hangindent=1em\arraybackslash}X}% \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}Q[wd=#1]}% \begin{document} \heavyrulewidth=0pt% \lightrulewidth=0pt% \cmidrulewidth=0pt% \let\toprule\relax \let\midrule\relax \begin{table} \caption{Short learning programme.} \begin{tblr}{TW{15pc}} \toprule Sessions & Activity \\ \midrule 1. & The short learning programme was briefly discussed with the participants to help them understand what to expect. They were instructed to write their narratives on teaching approaches they are using with a prompt provided to avoid writing unnecessary information. These narratives were then shared with everyone. \\ 2. & The researchers visited the classrooms of the participants to observe their mathematics lessons following a lesson observation guide. The study mainly focused on teaching approaches, student engagement, and the use of real -- life examples as outlined in the observation guide \\ 3. & This session started with feedback from the participants and researchers. They then learned about HP by reading Gutstein [70] and discussing examples from the book. They were allowed to formulate their own examples to share with each other in preparation for using Hp with their students. \\ 4. & During this session, participants were required to apply the knowledge they gained from the previous session before introducing HP to their students. Researchers revisited the classrooms to observe lessons using the same lesson observation guide. \\ 5. & This time, participants were instructed to give feedback in a form of a narrative focusing on how they perceive HP after making use of it. The researchers make use of these narratives and the noted from the lessons observed as their data. The workshop ended. \\ \bottomrule \end{tblr} \end{table} \end{document}

  • How to get path info from arg of \usepackage
    by lyl on October 1, 2026 at 12:52 pm

    I build a marco package named 0-path.sty which is loacated in the ‌subdirectory‌ of lib under the root path of my project. In this package, I create a macro named \setpath to designate all directoried for file search. Meanwhile, optional args are given to this package for addtional search pathes. I want to set search pathes when this package is introduced like: \usepackage[pic/, tex/]{../lib/0-path}: With this, the root path, which is used as the start point of file search, would be ../(father directory of lib), and program will find files in these pathes: .././, ../lib/, ../material/, ../pic/, ../tex. \usepackage{lib/0-path}: The default root path is ./ The file test-path.tex in ./test/ introduces this package. But error is given when compiling it: ERROR: Paragraph ended before \path@split was complete. --- TeX said --- <to be read again> \par l.56 What's wrong with my codes? ./lib/0-path.sty: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{0-path}[2026/09/24 v1.0 ...] \edef\path@currname{\CurrentFilePath/\CurrentFile}%like ../lib/0-path.sty %\show\path@currname \RequirePackage{graphicx} \ExplSyntaxOn \tl_new:N \l_setsearchpath_paths_tl \NewDocumentCommand{\setpath}{s O{} m}{ \clist_set:Nn \l_tmpa_clist {#2} \IfBooleanF{#1} { \clist_put_left:Nn \l_tmpa_clist {./, lib/, material/} } \tl_clear:N \l_setsearchpath_paths_tl \clist_map_inline:Nn \l_tmpa_clist { \tl_put_right:Nx \l_setsearchpath_paths_tl { {#3\tl_trim_spaces:n {##1}} } } \exp_args:NV \graphicspath \l_setsearchpath_paths_tl \cs_set:cpx { input@path } { \exp_not:V \l_setsearchpath_paths_tl } }%\setpath \ExplSyntaxOff %========================================================= % Get opt args of this package \newcommand{\path@options}{} \DeclareOption*{% \ifx\path@options\@empty \xdef\path@options{\CurrentOption}% \else \xdef\path@options{\path@options,\CurrentOption}% \fi } \ProcessOptions\relax %==================================================== % Get root path \def\path@split#1lib/0-path#2\@nil{% \def\path@root{#1}% \ifx\path@root\@empty \def\path@root{./}% \fi } \expandafter\path@split\path@currname\@nil % ========================================================= \setpath[\path@options]{\path@root} %========================================================= \endinput ./test/test-path: \documentclass{article} \usepackage{../lib/0-path} \usepackage{4.1-element}%in the directory of "./lib" \begin{document} \makeatletter \path@currname %print "../lib/0-path.sty" \makeatother \end{document} Apparently, the problem comes from \path@split. How to correct it? PS: I also tried with xstring like this: \RequirePackage{xstring} \IfSubStr{\path@currname}{lib}{ \StrBefore{\path@currname}{lib}[\path@root] \ifx\path@root\@empty \def\path@root{./} \fi }{\def\path@root{./////}}%to see which branch is passed And I get .///// which is apperently a wrong result. Why?

  • lua-unicode-math makes \parbox generate font warnings
    by David Purton on October 1, 2026 at 12:29 pm

    If I select a non-standard font size and then use a \parbox, I get font substitution warnings relating to maths fonts when lua-unicode-math is loaded. This happens even though I do not have any maths in my document. No warnings are produced for normal text (unless I actually include maths, of course). And unicode-math does not do this. Is this expected? Am I doing something wrong? Can I get rid of the warnings? I can use something other than a \parbox, but I have trouble with tagging with boxes… MWE % TeX Program = lualatex \documentclass{article} \usepackage{lua-unicode-math} \usepackage{fontspec} \setmainfont{Noto Serif} \begin{document} \fontsize{16pt}{24pt}\selectfont \parbox{3cm}{Some text} \end{document}

  • Is there any method to invert the even odd rule?
    by D G on October 1, 2026 at 8:37 am

    I want to get rather than Appending (0,0) circle (3.5) is fine but I am wondering whether there are any nicer approaches. odd even rule does not exist too. \documentclass[tikz,border=1cm,12pt]{standalone} \begin{document} \begin{tikzpicture}[ultra thick] \filldraw[fill=red,even odd rule] \foreach \i in {0,0.5,...,3.5}{(0,0) circle (\i)} (0,0) circle (3.5) % just a hack to invert the even odd rule ; \end{tikzpicture} \end{document}

  • Table of amino acids
    by Svend Tveskæg on September 30, 2026 at 9:12 am

    The following code is nothing more than a possible very early starting point for a document for amino acids. \DocumentMetadata{tagging = off} \documentclass{article} \usepackage{graphicx} \usepackage{chemfig} \usepackage{tabularray} % maybe use this package for the table \begin{document} \setchemfig{atom sep = 2em} \chemfig{H_2N-CH(-[6,,,,red]{\color{red}H})-C(=[2]O)-OH} \end{document} How do I produce the following table? I would like to also have a table boundary. I hope that I can create all of the 20 drawings myself so I would appreciate some help with the construction of the table and the placement of the name of the amino acid in the top left corner of the first cell.

  • How to get pre-numbered theorems in a post-ntheorem world?
    by Gaussler on September 28, 2026 at 5:56 pm

    As mentioned by @UlrikeFischer in this question, ntheorem is currently not compatible with \DocumentMetadata, as the latter now provides theorem environments out of the box which emulate the amsthm interface. Combined with the fact that ntheorem is seemingly unmaintained, it seems I must prepare myself for a post-ntheorem world. But that is quite unfortunate since I prefer pre-numbering my theorem environments. I also like to make the custom argument (if it is provided) completely replace the theorem label. How can I get something similar to this with the new interface? %\DocumentMetadata{pdfstandard=UA-2} % incompatible with ntheorem \documentclass{article} \usepackage{ntheorem} \makeatletter \newtheoremstyle{prenumber}% {\item[\hskip\labelsep \theorem@headerfont ##2\theorem@separator\ ##1\theorem@separator]}% {\item[\hskip\labelsep \theorem@headerfont ##2\theorem@separator\ ##3\theorem@separator]} \newtheoremstyle{prenumberbreak}% {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont ##2\theorem@separator\ ##1\theorem@separator}\hbox{\strut}}}]}% {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont ##2\theorem@separator\ ##3\theorem@separator}\hbox{\strut}}}]} \newtheoremstyle{nonumberplainflex}% for proof environments, see below {\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}% {\item[\theorem@headerfont\hskip \labelsep ##3\theorem@separator]} \newtheoremstyle{nonumberbreakflex}% {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont ##1\theorem@separator}\hbox{\strut}}}]}% {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont ##3\theorem@separator}\hbox{\strut}}}]} \makeatother \theoremseparator{.} \theorembodyfont{\itshape} \theoremstyle{prenumber} \newtheorem{theorem}{Theorem} \theoremstyle{prenumberbreak} \newtheorem{theorembreak}[theorem]{Theorem} \theoremheaderfont{\itshape} \theorembodyfont{\normalfont} \theoremstyle{nonumberplainflex} \newtheorem{proof}{Proof} \theoremstyle{nonumberbreakflex} \newtheorem{proofbreak}{Proof} \begin{document} \begin{theorem} First theorem. \end{theorem} \begin{proof} Proof \end{proof} \begin{theorem}[Pythagorean Theorem] We have~\( c^2 = a^2 + b^2 \). \end{theorem} \begin{proof}[Proof of the Pythagorean Theorem] Draw it! \end{proof} \begin{theorembreak} Theorem environment for use e.g. when the body is a list. \end{theorembreak} \begin{theorembreak}[Fermat's Last Theorem] No non-trivial integral solutions to~\( c^{n} = a^{n} + b^{n} \) for~\( n > 2 \). \end{theorembreak} \begin{proofbreak}[Proof of Fermat's Last Theorem] Too long for this MWE. \end{proofbreak} \end{document}

  • Modern Scientific illustrations: what can we "show off" now that wasn't possible 12 years ago?
    by DJP on September 23, 2026 at 1:05 am

    There is a highly popular post from 2014 showcasing Nice scientific pictures show off but a lot has changed with LaTeX over the last 12 years. What is your best science picture to show off now that wasn't possible 12 years ago? Constraints for each answer: The Picture & Code: Show off a beautiful scientific illustration that utilizes features, packages, or engine capabilities (e.g., LuaLaTeX memory handling, modern pgfplots limits, Luametafun) that remove barriers which routinely stopped typical users from doing this 12 years ago (such as hard memory crashes, lack of default ecosystem support, or prohibitive manual workarounds). The Evolution: You must explicitly explain what technological progress or package developmentover the last decade made this picture possible today. AI usage is allowed, but must be acknowledged per community guidelines.