Week
- 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}
- author of book and author of mvbook differby 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 vesselsby 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.
- Defining a point on a plane using Asymptoteby 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 \Longrightarrowby 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 widthby 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.
- tex4ebook + offline math SVGs that resize with text sizeby ana on October 2, 2026 at 5:46 pm
I want to generate epub3 files from .tex files where the mathematics is rendered as offline SVGs, no javascript, and the SVGs automatically resize with the font-size on the ereader. Possible? How? Ereaders now render MathML. Yay. But badly. Boo. SVGs are still visually better. The answers here do not work. They are also a decade old. After many iterations, I figure the SVG must be rendered such that it is scalable and the CSS must make the SVGs scale. So test.tex: \documentclass{article} \begin{document} This is inline: \(\alpha\). This is display: \begin{equation} f(x) = 1 + x \alpha \end{equation} \end{document} math.cfg: \Preamble{xhtml} \Css{img[src$=".svg"] { display: inline-block; max-width: 100%; width: auto; height: auto; }} \begin{document} \EndPreamble build.lua: Make:image("svg$", "dvisvgm --bbox=min --exact-bbox --no-fonts -p ${page} -o ${output} ${source}" ) and command: tex4ebook \ -f epub3 \ -c math.cfg \ -e build.lua \ test.tex \ "svg,pic-m,pic-equation" While this generates the math as SVG, it does not scale with the text. So I'm stumped.
- List and "complicated" table side-by-sideby 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.
- Content of table cell placed unexpectedby Svend Tveskæg on October 2, 2026 at 10:14 am
Introduction This is a follow-up question to Table of amino acids. Code and output % lualatex test.tex \documentclass[ a4paper, 12pt ]{article} \usepackage[ hmargin = 2.4cm, vmargin = 3cm ]{geometry} \usepackage{tabularray} \UseTblrLibrary{tikz} \usepackage{chemfig} \begin{document} \begin{table} \def\penta{1.5}% \def\heksa{1.2}% \centering \scriptsize \def\acidlabels{ { Gly % Glycin , Ala % Alanin , Val % Valin , Leu % Leucin , Ile % Isoleucin }, { Met % Methionin , Phe % Phenylalanin , Pro % Prolin , Asp % Aspartat , Glu % Glutamat }, { Ser % Serin , Thr % Threonin , Cys % Cystein , Tyr % Tyrosin , Asn % Asparagin }, { Gln % Glutamin , Trp % Tryptofan , Lys % Lysin , Arg % Arginin , His % Histidin }% <-- VIGTIG } \begin{tblrtikzabove} \foreach \cols[count = \i] in \acidlabels { \foreach \content[count = \j] in \cols { \node[below right, font = \sffamily\bfseries] at (\i-\j.north west) {\content}; } } \end{tblrtikzabove}% \setchemfig{ fixed length = true, atom sep = 1.3em } \begin{tblr}{ width = \linewidth, colspec = *{5}{X[c]}, hlines, vlines } \chemfig{H_2N-CH(-[6]{\color{red}H})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H}(-[0,,,,red]{\color{red}\smash[b]{CH_3}})-[6,,,,red]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H}(-[0,,,,red]{\color{red}\smash[b]{CH_3}})-[6,,,,red]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H}(-[0,,,,red]{\color{red}\smash[b]{CH_3}})-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} \\ \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}S}-[6,,,,red]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]*6([6,\heksa,,,red]=[6,,,,red]-=-=-))-C(=[2]O)-OH} & \chemfig{O=[6]C(-[6]*5([6,\penta,,,red]-[,,,,black]HN-[red]---))-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}(=[0,,,,red]{\color{red}O})-[6,,,,red]{\color{red}O}|{\color{red}H})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}(=[0,,,,red]{\color{red}O})-[6,,,,red]{\color{red}O}|{\color{red}H})-C(=[2]O)-OH} \\ \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}O}|{\color{red}H})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H}(-[0,,,,red]{\color{red}OH})-[6,,,,red]{\color{red}C}|{\color{red}H_3})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}S}|{\color{red}H})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]*6([6,\heksa,,,red]=-=(-[:270,,,,red]{\color{red}O}|{\color{red}H})-=-))-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}(=[0,,,,red]{\color{red}O})-[6,,,,red]{\color{red}N}|{\color{red}H_2})-C(=[2]O)-OH} \\ \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}(=[0,,,,red]{\color{red}O})-[6,,,,red]{\color{red}N}|{\color{red}H_2})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]*5([6,\penta,,,red]=-{\color{red}N}(-[:180,0.001,,,draw = none]{\color{red}H})-*6(-=-=-=)--))-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}N}|{\color{red}H_2})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}C}|{\color{red}H_2}-[6,,,,red]{\color{red}N}|{\color{red}H}-[6,,,,red]{\color{red}C}(=[0,,,,red]{\color{red}NH})-[6,,,,red]{\color{red}N}|{\color{red}H_2})-C(=[2]O)-OH} & \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]*5([6,\penta,,,red]-{\color{red}N}=-{\color{red}N}(-[:0,0.001,,,draw = none]{\color{red}H})-=))-C(=[2]O)-OH} \end{tblr} \end{table} \end{document} Question As can be seen in the screenshot above, the contents of the cell in the second row, third column in not at the top of the cell. How do I fix this?
- Need to fix equal space for all row using tabularrayby 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}
- chemfig: distorted ringby Svend Tveskæg on October 1, 2026 at 8:30 pm
Introduction As can most likely be seen from the following code, I'm not an experienced chemfig user. Code and output \documentclass{article} \usepackage{chemfig} \begin{document} \setchemfig{atom sep = 2em} \def\penta{1.5} \chemfig{H_2N-CH(-[6]{\color{red}C}|{\color{red}H_2}-[6,,,,red]*5([6,\penta,,,red]=[6,\penta,,,red]-[6,\penta,,,red]{\color{red}H}|{\color{red}N}-[6,\penta,,,red]*6(-=-=-=)-[6,\penta,,,red]-))-C(=[2]O)-OH} \end{document} Question The ring with HN is distorted (which is do to the addition of the NH, I found out); how do I fix this? Post Scriptum You are more than welcome to simplify the code.
- lua-unicode-math makes \parbox generate font warningsby 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}
- How do we find an alternative to align, similar to \begin{aligned}[t], that allows \allowdisplaybreaks in amsart?by Arbuja on September 30, 2026 at 11:00 pm
I am using Latex Overleaf. Suppose we have the following code: \documentclass[11pt]{amsart} \usepackage{amsmath} \usepackage{enumitem} \usepackage{lipsum} \begin{document} \allowdisplaybreaks \begin{enumerate} \item \lipsum[1-2] \item \lipsum[3-4] \item {\large$\begin{aligned}[t] % Random Equations % & x+y+xyz=10\\ & x+2y+yz=13\\ & 2x+xyz+z=15\\ & 3x+y+yz=7\\ & xy+y^2+zx=100\\ & 7x+yz+xz=1 \end{aligned}$} \end{enumerate} \end{document} Despite the end of the last paragraph (in the code above) being close to the end of page 1, the list of equations in the code does not split into two pages, where the first equation is right next to the item number without spacing. (The other equations are aligned with the first equation.) Question: How do we find an alternative to align (similar to aligned) such that x+y+xyz=10 is right next to its item number with no space in between, the remaining equations are aligned with the first equation right next to the item number, the list of equations are split into two pages? There was an answer to a similar question, but it has spacing between the equations and item number and when applying this to the code above: \documentclass[11pt]{amsart} \usepackage{amsmath} \usepackage{environ, enumitem} \makeatletter \let\olditem\item% Store regular \item macro \newlength{\LHS} \def\processitem#1\relax{% \olditem\hspace*{\LHS}% \llap{$\displaystyle #1{}$}% $\displaystyle{}#2$% } \NewEnviron{mathlist}[1][3em]{% \setlength{\LHS}{#1}% Set Left-Hand Side length \g@addto@macro{\BODY}{\item\relax\item}% Used to delimit the items; last item identified by \item\relax\item \def\item##1\item{% Redefine \item to capture contents \def\optarg{##1}% \expandafter\ifx\optarg\relax\else% Last item not reached \expandafter\processitem##1\relax% Process item \expandafter\item% Recursively continue processing items \fi } \begin{itemize}[label={},labelsep=0pt] \BODY% Process environment (save items) \end{itemize} } \makeatother \usepackage{lipsum} \begin{document} \allowdisplaybreaks \begin{enumerate} \item \lipsum[1-2] \item \lipsum[3-4] \item {\large\begin{mathlist}[1em] % Random Equations % & x+y+xyz=10\\ & x+2y+yz=13\\ & 2x+xyz+z=15\\ & 3x+y+yz=7\\ & xy+y^2+zx=100\\ & 7x+yz+xz=1 \end{mathlist}} \end{enumerate} \end{document} I get errors on latex overleaf. I think this is due to the documentclass being amsart.
- Change only one word's color in beamer to beamer colorsby Jim on September 30, 2026 at 6:45 pm
I want to change the color of only one word within a larger text in beamer. The color I need is one of the default beamer colors, say I want to make this word have the same color as the title of the presentation. Unfortunately, the beamercolorbox environment ends the paragraph and is itself a "paragraph environment" breaking the text. Also, I don't know (and I shouldn't have to) what the exact color of the title is within the particular beamer theme, which means I cannot use \textcolor or \color to manually type in the color. How can one do this? Can I "retrieve" the color somehow or is there a way to stop beamercolorbox from breaking the paragraph?
- How to use conditional if-then statements in luacas (LuaLaTeX) to filter algebraic solutions based on a sign condition?by minthao_2011 on September 30, 2026 at 3:51 pm
I am using the luacas package in LuaLaTeX to dynamically generate and solve radical equations. In my example, I want to solve the equation: $\sqrt{4x+3} = -x+5$. By squaring both sides, the package successfully finds two roots, $r_{1}$ and $r_{2}$. However, I need to check the extraneous root condition, which is checking if the right-hand side $-x+5 \geq 0$ at those specific root values. Currently, I have to manually hardcode the text conclusions (e.g., deciding which root is valid and writing the final conclusion line by hand). I want to automate this process inside the \begin{CAS} environment using an if-then block or a similar logic feature, so that it automatically filters the valid root and prints the correct concluding text depending on the sign of the evaluated expression. Here is my current working LaTeX code (with manual conclusions): \documentclass{article} \usepackage{luacas} \begin{document} \begin{CAS} vars("x") sq = -x+5 f = topoly((-x + 5)^2) g = topoly(4*x +3) eq = f-g r = ZTable( roots(eq) ) y1 = substitute({[x]=r[1]}, f):simplify() y2 = substitute({[x]=r[2]}, f):simplify() sol1 = substitute({[x]=r[1]}, sq):simplify() sol2 = substitute({[x]=r[2]}, sq):simplify() \end{CAS} Solve the equation: \[\sqrt{\print{g}} = \print{sq}.\] Squaring both sides of the equation, we get: \[\print{f} = \print{g}.\] Simplifying the equation above yields: \[ \print{eq} = 0. \] This equation has two roots: \[r_1 = \print{r[1]}, \quad r_2 = \print{r[2]}.\] We have: \[-r_1 + 5 = \print{sol1} < 0,\] hence $r_1$ is an extraneous root (not a solution). \[-r_2 + 5 = \print{sol2} > 0,\] hence $r_2$ is a valid solution. Therefore, the final solution to the equation is $x = \print{r[2]}.$ \end{document} How can I rewrite this using conditional statements (if ... then ... else) or loop routines inside the \begin{CAS} environment to: Dynamically evaluate if sol1 and sol2 are $\geq 0$ or $<0$ (handling luacas algebraic objects properly when comparing).
- Table of amino acidsby 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.
- Keep consistent vertical spacing with beamer when using overlaysby profj on September 30, 2026 at 3:32 am
I am using a combination of only and onslide overlays in beamer, and the vertical spacing is inconsistent between different slides of a frame. Here is a minimum working example: \documentclass{beamer} \begin{document} \begin{frame}{Vertical spacing is inconsistent} \begin{itemize} \item here is an example \begin{itemize} \item<2-> Here is an equation: \only<3> {$$P = 2\times Q1$$} \only<4> {$$P = 2\times Q$$} \onslide<5-> {$$P = 2\times 4$$} \item<6-> some more stuff \item<7-> some more stuff \item<8-> some more stuff \end{itemize} \item<9-> Next block of text \begin{itemize} \item<9-> Here's another equation: \only<10> {$$Q = 0.5 \times P1$$} \only<11> {$$Q = 0.5 \times P$$} \onslide<12-> {$$Q = 0.5\times 8$$} \item<13-> some more stuff \item<14-> some more stuff \item<15-> some more stuff \end{itemize} \end{itemize} \end{frame} \end{document} Is there a way to keep the vertical spacing consistent. The only way I've figured out is to use phantom to hold space until the only lines can take up vertical space. But I wonder if there is a more elegant way: \documentclass{beamer} \begin{document} \begin{frame}{Vertical spacing is inconsistent} \begin{itemize} \item here is an example \begin{itemize} \item<2-> Here is an equation: \only<-2> {$$\phantom{P}$$} \only<3> {$$P = 2\times Q1$$} \only<4> {$$P = 2\times Q$$} \onslide<5-> {$$P = 2\times 4$$} \item<6-> some more stuff \item<7-> some more stuff \item<8-> some more stuff \end{itemize} \item<9-> Next block of text \begin{itemize} \item<9-> Here's another equation: \only<-9> {$$\phantom{Q}$$} \only<10> {$$Q = 0.5 \times P1$$} \only<11> {$$Q = 0.5 \times P$$} \onslide<12-> {$$Q = 0.5\times 8$$} \item<13-> some more stuff \item<14-> some more stuff \item<15-> some more stuff \end{itemize} \end{itemize} \end{frame} \end{document}
- Text width on paper is different from \textwidthby Ievgen on September 29, 2026 at 12:27 pm
Somehow the text width of my printed document (pdf created from LaTEX) is different from the \textwidth parameter. The main font size also appears visually somewhat smaller on paper than it should be. What may be the reason? The problem doesn't seem to be caused by zooming the pdf by the software I printed from. Here's the preamble: \documentclass[11pt, makeidx, a4paper]{book} \textheight=172mm \textwidth=112mm \usepackage{makeidx} \makeindex %\nofiles \usepackage[english,russian, ukrainian]{babel} \usepackage[cp1251]{inputenc} \usepackage[T2A]{fontenc} \usepackage{amsmath,amssymb,calc} % \usepackage{indentfirst} \usepackage{amsmath,multicol} \usepackage{amssymb} \usepackage{amsthm} \usepackage{amscd} \usepackage[pdftex]{graphicx} %%% \usepackage[mathscr]{eucal} \usepackage[dvips]{color} %%% \usepackage{layout} \usepackage{floatflt} \usepackage{calc} \usepackage{here} \usepackage{nccsect} % \newtheoremstyle{nashstteorem}% name {1pt}% Space above {1pt}% Space below {\it}% Body font {}% Indent amount (empty = no indent, \parindent = para indent) {\mdseries}% Thm head font {. }% Punctuation after thm head {}% Space after thm head: " " = normal interword space; % \newline = linebreak {}% Thm head spec (can be left empty, meaning `normal') \theoremstyle{nashstteorem} \newtheorem{thm}{\hspace*{\parindent}Т\,е\,о\,р\,е\,м\,а}[section] \newtheorem{lmm}{\hspace*{\parindent}Л\,е\,м\,а}[section] \newtheorem{ex}{\hspace*{\parindent}П\,р\,и\,к\,л\,а\,д}[section] \newtheoremstyle{problemstyle}% name {0pt}% Space above {0pt}% Space below {\rm}% Body font {}% Indent amount (empty = no indent, \parindent = para indent) %{\mdseries}% Thm head font %%%%% {\bfseries} % Thm head font {. }% Punctuation after thm head {}% Space after thm head: " " = normal interword space; % \newline = linebreak {}% Thm head spec (can be left empty, meaning `normal') \theoremstyle{problemstyle} \newtheorem{probl}{\hspace*{\parindent}Задача}[chapter] % THEOREMS ------------------------------------------------------- % ---------------------------------------------------------------- \includeonly{ pr_ua, ch1_ua, ch2_ua, ch3_ua } \def\emline#1#2#3#4#5#6{% \put(#1,#2){\special{em:moveto}}% \put(#4,#5){\special{em:lineto}}}% % \renewcommand{\theequation}{\thesection.\arabic{equation}} \renewcommand{\thefigure}{\thesection.\arabic{figure}} \renewcommand{\thetable}{\thesection.\arabic{table}} \newcommand{\sign}{\mathop{\rm sign}\nolimits} \newcommand{\mgtF}{\mathfrak{F}} % \newcommand{\PO}{\mathsf{P}} % \newcommand{\Pbb}{\mathbb{P}} \newcommand{\Qbb}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\Dov}{Д\,о\,в\,е\,д\,е\,н\,н\,я. } \newcommand{\Opr}{О\,з\,н\,а\,ч\,е\,н\,н\,я. } \newcommand{\Otv}{В\,і\,д\,п\,о\,в\,і\,д\,ь: } \newcommand{\Rozv}{Р\,о\,з\,в'\,я\,з\,а\,н\,н\,я. } \newcommand{\Sleds}{Н\,а\,с\,л\,і\,д\,о\,к } \newcommand{\Sledsdot}{Н\,а\,с\,л\,і\,д\,о\,к.} \newcommand{\Theornonum}{Т\,е\,о\,р\,е\,м\,а.\ } \newcommand{\Zau}{З\,а\,у\,в\,а\,ж\,е\,н\,н\,я. } \newcommand{\sts}{\,\,} \newcommand{\suml}{\sum\limits} \newcounter{formula} \pagestyle{myheadings} % \renewcommand{\baselinestretch}{0.8} Thanks in advance.
- Continuous/running footnotes with Paracolby Home Typesetter on September 29, 2026 at 11:07 am
I'm trying to make footnotes while using paracol. I'd like to have them in one continuous text like shown in the image here. However, it seems to be tricky to do, especially with paracol. My current preamble looks like this: % --- Voetnoten --- \footnotelayout{p} \makeatletter \renewcommand{\thefootnote}{\Roman{footnote}} \renewcommand{\@makefnmark}{% \textcolor{rood}{\schuinfont\textsuperscript{\@thefnmark}}% % Ankersymbooltjes rood en schuin } \renewcommand{\@makefntext}[1]{% \noindent \makebox[3.5em][l]{% \textcolor{rood}{\@thefnmark.}%\hspace{1em}% }% {\footnotesize #1}% } \renewcommand{\footnoterule}{% \kern -3pt \textcolor{rood}{\hrule width 0.4\textwidth height 0.4pt} \kern 2.6pt } \let\pcol@footnoterule\footnoterule \makeatother Mostly AI-generated and edited myself with trail and error (still learning). I am getting better at this however more complex stuff like this seems tricky for a novice like me. Any general tips on proper coding in here are also most welcome. Thanks in advance. My minimal working document: \documentclass[11pt,twoside]{book} \usepackage{paracol} \usepackage{lipsum} \begin{document} \footnotelayout{p} \begin{paracol}{2} \begin{leftcolumn} \lipsum[1] \footnote{This is a footnote} \end{leftcolumn} \begin{rightcolumn} \lipsum[1] \footnote{yet another footnote} \end{rightcolumn} \end{paracol} \end{document} Gives this: While I am trying to get something like this:
- use newline in f:writeby flawr on September 28, 2026 at 10:08 pm
I'd like to create a data file using lua in LuaTeX that I can reuse e.g. using pgfplots. But currently I'm stuck printing multiple lines as it seems the "\n" will always get interpreted as a TeX command and not as a newline. How would we correctly do that in this document? \documentclass{article} \usepackage{pgfplots} \usepackage{luacode} \begin{document} \begin{luacode} local f = io.open("data.txt", "w") for x = 0, 10, 0.5 do local y = math.sin(x) f:write(x .. " " .. y .. "\n") end f:close() \end{luacode} \begin{tikzpicture} \begin{axis} \addplot table {data.txt}; \end{axis} \end{tikzpicture} \end{document}
- 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}
- Inconsistent \fint symbol with olddefault option in fontsetup [closed]by Alexander Voigt on September 28, 2026 at 5:10 pm
When I compile the following MWE with LuaLaTeX 1.18.0, \documentclass{article} \usepackage[olddefault]{fontsetup} % default works \begin{document} \[\int\fint\] \end{document} I obtain two integral signs: Note, that the second one (\fint) does not appear slanted. In general, \fint looks inconsistent with all other integral signs in the olddefault font. (This issue does not appear with default font.) How can I get \fint to be as slanted as \int when using olddefault? Edit: The same issue exists with \intbar.