Week
- 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}
- Latex syntax, LR mode,by James Durfee on October 1, 2026 at 12:31 am
I have very limited experience with latex and coding in general. I am trying to use latex to create a pdf of a proof I have already written out by hand, but I am getting several errors that I do not understand. Any feedback on the code or suggestion on where to start learning would be very appreciated, I have been researching the errors But I can't seem to find a good source for this. thank you for your time. \documentclass[12pt]{article} \usepackage{graphicx} % Required for inserting images \newtheorem{proposition}{proposition} \newtheorem{case}{case} \usepackage{dsfont} \usepackage[OT1]{fontenc} \usepackage{amsthm} \usepackage{amsmath} \title{Equivalence Proof} \author{James Durfee} \date{September 2026} \usepackage{amsthm} \begin{document} \maketitle \begin{proposition} \item Suppose n is an integer. Then the following are equivalent. \begin{enumerate} \item 1. n is odd \item 2. $3n+2$ is odd \item 3. $n^2$ is odd. \end{enumerate} \end{proposition} \begin{proof} Assume n is an odd integer. \begin{case} assume n is odd. By definition $n=2k+1$ where $k \in \mathds{Z}$. \newline thus, \begin{align} n &= 2k + 1 3n + 2 &= 6k + 3 + 2 &= 2(3k+2) + 1 \end{align} where $3k+2$ is a integer by closure. Thus by definition $3n+2$ is odd. \end{case} \begin{case} We will prove the contrapositive. Assume n is even. then by definition $n+2k$ where $k \in \mathds{Z}$. \newline Then, \newline \begin{align} n &= 2k 3n &= 6k 3n+2 &= 6k+2 &= 2(3k+1) \end{align} where by closure $3k+1$ is an integer. So $3n+2$ is even. Thus if $3n+2$ is odd, then $n$ is odd. \end{case} \begin{case} Assume n is odd. Then by definition $n=2k+1$, where $k \in \mathds{Z}$. \newline Then, \begin{align} n &= 2k+1 n^2 &= 4k^2+4k+1 &= 2(2k^2+2k)+1 \end{align} where $2k^2+2k$ is an integer under closure. Then by definition $n^2$ is odd. \end{case} \begin{case} We will prove the contrapositive. Assume n is even. So by definition $n+2k$ where $k \in \mathds{Z}$.\newline then, \begin{align} n &= 2k n^2 &= 4k^2 &= 2(2k^2). \end{align} By closure $2k^2$ is a integer. then by definition $n^2$ is even. Thus if $n^2$ is odd then $n$ is odd. \end{case} Therefore, if n is a integer, then the following are equivalen. 1. $n$ is odd, 2. $3n+2$ is odd, 3. $n^2$ is odd. \end{proof} \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
Introduction This is very much a "please do (some of) it for me" question. I'm very sorry for that but I don't know where to start with the table. Code The following code is nothing more than a possible very early starting point for a document. (Again, I'm sorry for that.) \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} Question 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.
- Critical Apparatus pushing over page footerby muk.li on September 28, 2026 at 1:55 pm
[Revised question:] Under certain circumstances, such as when you adjust the line spacing, or perhaps with certain fonts, reledmac fails to calculate correctly the space needed for paragraphed footnotes, which leads to the critical apparatus taking too much space, pushing into the page footer. How to fix that? \documentclass{memoir} \usepackage{lipsum} \usepackage{reledmac} \usepackage{showframe} \Xarrangement[]{paragraph} \begin{document} \begin{Spacing}{1.20} \beginnumbering \pstart \lipsum[1-3] \edtext{test}{\Afootnote{A somewhat lengthy footnote. We need it to be a bit longer, so that we have at least two lines. And a bit longer even, such that it will go into a third line. Some more filler text.}} \edtext{test}{\Afootnote{A somewhat lengthy footnote. We need it to be a bit longer, so that we have at least two lines. And a bit longer even, such that it will go into a third line. Some more filler text.}} \edtext{test}{\Afootnote{A somewhat lengthy footnote. We need it to be a bit longer, so that we have at least two lines. And a bit longer even, such that it will go into a third line. Some more filler text.}} \lipsum[4] \pend \endnumbering \end{Spacing} \end{document} The last two lines, 33 and 34, should have been printed on the next page in order to make room for the critical apparatus below. [Supplement to the revised question:] It took a while figuring out what was going on. Thus below some earlier parts of the question, to which some of the comments to it relate, with a much more complex example: Up until recently, I was not able to use reledmac's paragraphed footnotes with Devanāgarī text due to a bug. With a workaround, I can start using them now, but in several places the critical apparatus now extends over the page footer, as here: EDIT September 30: Here my changed, still not very Minimal WE. I will try to isolate the problem more. But for now, I have for the purpose of the example only changed the font from Pedantic Devanagari, which I had employed due to its feature of applying formatting such as bolding on the sub-syllabic (sub-akṣara) level which however I am currently not using, for which reason we also have the many bolding commands which presently are set to not do anything, to the more common Shobika font. As the pages render differently, I had to add some extra text both to the running text as well as as to the critical apparatus to reproduce the problem. Furthermore, I'm now loading the showframe package to show where the textbox should actually be ending. In my understanding, LaTeX should start a new page after line 5 of the commentary on verse 38 (३८), but that would lead to the last two lines of the paragraph being displayed on page two. Would that already be considered a widow? In any case, the apparatus pushing even below the footer is far worse than a widow. \documentclass[11pt,article,a4paper,oneside]{memoir} \setstocksize{230mm}{150mm} \settrimmedsize{230mm}{150mm}{*} \setulmarginsandblock{34mm}{20mm}{} \setlrmarginsandblock{20mm}{20mm}{} \checkandfixthelayout \usepackage{showframe} \usepackage[english]{babel} \babelprovide[% typography/prehyphenchar = `-, transforms=transliteration.iast, ]{sanskrit} \babelfont{rm}[Renderer=HarfBuzz]{Libertinus Serif} \babelfont[*devanagari]{rm}{Shobhika}%{PedanticDevanagariLight.otf}[Script=Devanagari,BoldFont={PedanticDevanagariBold.otf}] \babelprovide[import=sa, hyphenrules=sanskrit, typography/prehyphenchar = `-, % onchar=ids ]{sanskrit-latin} \babelfont[sanskrit-latin]{rm}{Libertinus Serif}[Renderer=HarfBuzz] \NewDocumentCommand{\textsanskrit}{m}{\foreignlanguage{sanskrit-latin}{#1}} \NewDocumentCommand{\sktd}{m}{\foreignlanguage{sanskrit}{#1}} \newcommand{\skti}[1]{\emph{\textsanskrit{#1}}} \newcommand{\sktr}[1]{\textsanskrit{#1}} \newcommand{\sktt}[1]{\emph{\textsanskrit{#1}}\index{\emph{\textsanskrit{#1}}{}}} \newcommand{\sktw}[1]{\emph{\textsanskrit{#1}}\index{\emph{\textsanskrit{#1}}{}}} \newcommand{\sktn}[1]{\textsanskrit{#1}\index{\textsanskrit{#1}{}}} \makeatletter \NewDocumentCommand\SwitchToCommentary{}{ \endnumbering \bigskip \beginnumbering \renewcommand\linenumrep[1]{\foreignlanguage{english}{\@arabic{##1}}} \setcounter{firstlinenum}{3} \setcounter{linenumincrement}{3} \pstart \patchcmd{\endquote}{\vskip\topsep}{\relax}{}{} \noindent } \NewDocumentCommand\SwitchToVerse{}{ \pend \endnumbering \bigskip \beginnumbering \setcounter{firstlinenum}{1000} \linenumberstyle{alph} } \newcommand\sa[1]{\foreignlanguage{sanskrit}{#1}} \newcommand\en[1]{\foreignlanguage{english}{#1}} \NewDocumentCommand{\devjoin}{o m m}{#2#3} \newcommand\danda{.} \newcommand\ddanda{..} \newcommand\emend{\mbox{\en{em.}}} \newcommand\ENdot{} \newcommand{\abbr}{-} \newcommand\Lpc{\en{L$^{pc}$}} \newcommand\Lac{\en{L$^{ac}$}} \newcommand\mh{\en{MH07}} \newcommand\bti{\en{BTI}} \newcommand\conj{\mbox{\en{conj.}}} \newcommand\Ldot{\en{L}} \newcommand\msln[1]{% \@bsphack \@esphack } \newcommand\KAbold[1]{#1} \newcommand\commpratikaseparator{..} \newcommand\KAquestion{\danda} \newcommand{\zwnj}{\char"200C} \newcommand\KAcomma{\zwnj} \newcommand{\devjoinPB}{} \begingroup \catcode`\&=\active \gdef\devjoinPB#1#2{- & #1#2} \endgroup \newcommand\KAcommaAnusvaara{% ṃ% \@bsphack \@esphack } \newcommand\stringhole{% \@bsphack \@esphack } \makeatother \usepackage{circledsteps} \usepackage{reledmac} \setlength{\stanzaindentbase}{\leftmargin} \setstanzaindents{4,1,2,1,2,3,3,1,2,1} \setstanzapenalties{1,10000,5000,10000,0} \numberstanzatrue \renewcommand{\stanzanumwrapper}[1]{} \newcounter{stanzanum} \Xstanza \Xnotenumfont{\selectlanguage{english}} \Xstanzaseparator[A]{.} \Xstanzaseparator[B]{} \Xstanzaseparator[C]{.} \Xstanzaseparator[D]{.} \Xarrangement[]{paragraph} % Keep the footers in English even if we're in a Sanskrit environment \newcommand{\fixedtoday}{\english{}} \edef\fixedtoday{\today} \makepagestyle{mydraft} \makeevenfoot{mydraft}{}{\en{\normalfont\ttfamily\fontsize{8bp}{10bp}\selectfont\jobname\ \ \fixedtoday\ \ \printtime\ \ Page \thepage}}{} \makeoddfoot{mydraft}{}{\en{\normalfont\ttfamily\fontsize{8bp}{10bp}\selectfont\jobname\ \ \fixedtoday\ \ \printtime\ \ Page \thepage}}{} %\pagestyle{mydraft} \newtoggle{draft-mode} \toggletrue{draft-mode} %\togglefalse{draft-mode} \iftoggle{draft-mode}{\pagestyle{mydraft}}{} \usepackage{multicol} \usepackage{docmute} \usepackage[hidelinks]{hyperref} % Workaround for bug which otherwise makes paragraphed footnotes % impossible with Devanāgarī, see % https://github.com/latex3/luaotfload/issues/317#issuecomment-5764124744 \directlua{ local direct = node.direct local disc_t, whatsit_t = node.id("disc"), node.id("whatsit") local function strip_disc_whatsits(head) for n in direct.traverse_id(disc_t, head) do local replace = direct.getfield(n, "replace") if replace then for w in direct.traverse_id(whatsit_t, replace) do replace = direct.remove(replace, w) end direct.setfield(n, "replace", replace) end end return head end luatexbase.add_to_callback("pre_linebreak_filter", function(head) return direct.tonode(strip_disc_whatsits(direct.todirect(head))) end, "remove whatsits from discs") } \begin{document} \begin{otherlanguage}{sanskrit} \setSingleSpace{1.20} \SingleSpacing \beginnumbering \setcounter{firstlinenum}{1000} \linenumberstyle{alph} \setlength{\stanzaindentbase}{0pt} \Large \setcounter{stanza}{36} \stanza ratiṃ dadhat tilakapade kṛtāspadaḥ & kapolayoś ciram atha cumbitastanaḥ \danda{} & dhṛtāyatir vapur abhito 'bhiṣasvaje & natabhruvāṃ salilabharo nidāghajaḥ \ddanda{} 37 \ddanda{} \& \SwitchToCommentary {}\msln{78b5}% \KAbold{rati}\commpratikaseparator{} \KAbold{nidāghajo} \edtext{gharmajaḥ \KAbold{salilabharo}}{% \lemma{gharmajaḥ salilabharo}\Cfootnote{\emend{}; gharmajasya lilabharo \Ldot{}}} \KAbold{natabhruvāṃ} \msln{6} strīṇāṃ satkaṃ \KAbold{vapur abhiṣasvaje} samāliliṅga. katham\KAquestion{} abhitaḥ \edtext{samantāt}{\Cfootnote{\emend{}; samāntāt \Ldot{}}}. kīdṛśo 'sau\KAquestion{} \KAbold{tilakapade} lalāṭe \KAbold{ratiṃ} dhṛtiṃ \KAbold{dadha}\devjoin[BR]{d}{bi}bhrāṇaḥ. tathā \KAbold{kapolayoḥ kṛtāspadaḥ} \msln{7} \edtext{tasthivān}{ \lemma{tasthivān} \Cfootnote{\conj{}; tatasthirān san \Ldot{}} }.% kiñca\KAcomma{} \KAbold{athā}nantaraṃ \KAbold{cumbitau} śliṣṭau \KAbold{stanau} yena\KAcomma{} sa tathā. tathā\KAcomma{} \KAbold{dhṛtāyati}\devjoin[BR]{r}{vi}stāro yena\KAcomma{} sa evam. anyo 'pi kāntāyā evaṃ kurva%n \edtext{\devjoin{nn}{ā}liṅganaṃ}{ \lemma{āliṅganaṃ} \Cfootnote{\emend; āliṅgana \Ldot}} kuruta \edtext{i\msln{79a1}ti}{\Cfootnote{iti \emend{}; i\msln{79a1} \Ldot{}}} śleṣacchāyā~\ddanda{}37\ddanda \SwitchToVerse \setlength{\stanzaindentbase}{0pt} \Large \stanza mṛgīdṛśāṃ rucitakacācitair api & smitodayād ativikacatvam āgataiḥ \danda{} & sugandhibhiḥ \edtext{sadalikatā\devjoin{m}{a}}{ \lemma{sadalikatām} \Bfootnote{\bti; sadalitatām \mh{}\ENdot} }pi śritai\devjoinPB{r}% & {da}dhe mukhair asadalikatvam agrataḥ \ddanda{} 38 \ddanda{} \& \SwitchToCommentary {}\msln{79a1}% \KAbold{mṛgī}\commpratikaseparator{} hariṇākṣīṇāṃ \KAbold{mukhaiḥ} \edtext{\KAbold{sugandhibhiḥ}}{% \lemma{sugandhibhiḥ} \Cfootnote{\Lpc{}; sugandhiḥ \Lac{}\ENdot} } sadbhir agrato rasanto \KAbold{'layo} yeṣā\KAcommaAnusvaara{} tāny eva\KAcommaAnusvaara{} tadbhāvaḥ % ta\devjoin[RB]{t}{tvaṃ} \edtext{\KAbold{dadhe}}{\lemma{dadhe}\Cfootnote{\conj{}; babhre \Ldot{}}} dhṛtam. kīdṛśaiḥ\KAquestion{} \KAbold{santi} śobhanā% \devjoin[RB]{ny}{a}% \KAbold{likāni} lalaṭāni yeṣu\KAcomma{} tadbhāvas ta\devjoin[RB]{t}{tā}\KAcomma{} tā\devjoin[RB]{m}{a}\KAbold{pi} \KAbold{śritaiḥ}. \edtext{apiḥ}{\Cfootnote{\emend; api \Ldot}} śrutiviruddhatām āha. \edtext{asadalikatvaṃ}{\Cfootnote{\conj; sadalikatātvaṃ \Ldot}} kathaṃ dhriyate\KAquestion{} kiñca\KAcomma{} \KAbold{rucirāḥ} \KAbold{kacāḥ} \edtext{keśāḥ}{\Cfootnote{\emend{}; keśā \Ldot{}}}\KAcomma{} tai\devjoin[RB]{r}{ā}\KAbold{citāni} yā\msln{3}ni\KAcomma{} tair evam. \edtext{smitodayā\devjoin[BR]{d}{dhe}}{% \lemma{smitodayād} \Cfootnote{\emend; smṛtodayād \Ldot} }% to\devjoin[RB]{r}{a}\KAbold{tivikacatvaṃ} vikāsitva\stringhole{}%m \edtext{\devjoin[RB]{m}{ā}\KAbold{gataiḥ}}{% \lemma{āgataiḥ} \Cfootnote{\Lpc{}; āgataiḥ \Lac{}\ENdot} }. ihāpy api \edtext{\devjoin{s}{ta}ttvato}{ \lemma{tattvato} \Cfootnote{\emend; tattvata \Ldot}} yāni \edtext{kacācitāni}{\Cfootnote{\emend; kacāni \Ldot}}\KAcomma{} \edtext{tāni}{\Cfootnote{\emend; tāna \Ldot{} kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | kiṃcit kiṃcit kiṃcit | }} kathaṃ vigatakacatvaṃ yāntīti~% \ddanda{}~38~\ddanda kiṃcit kiṃcit kiṃcit kiṃcit kiṃcit kiṃcit kiṃcit kiṃcit \SwitchToVerse \setlength{\stanzaindentbase}{0pt} \Large \stanza nitambinīmukhakamaleṣu sālasāṃ & dṛśoḥ sthitiṃ param upadiśya vallabhaiḥ \danda{} & athādadhe pulakapayobhir anvaya\devjoinPB{s}% & {ta}dīkṣaṇavyasaniṣu nāyakeṣv api \ddanda{} 39 \ddanda{} \& \SwitchToCommentary {}\msln{79a4}% \KAbold{nita}\commpratikaseparator{} \KAbold{pulakapayobhir nitambinīmukha}\edtext{\KAbold{kamaleṣu}}{% \lemma{\abbr{}kamaleṣu}\Cfootnote{\emend{}; \abbr{}kamale \Ldot{}}} \edtext{\KAbold{dṛśo}\devjoin[BR]{r}{a}}{% \lemma{dṛśor} \Cfootnote{\Lpc{}; dṛśoru \Lac\ENdot} }% a kṣṇo\stringhole{}ḥ \KAbold{sālasāṃ} \KAbold{sthitiṃ} \KAbold{paraṃ} su\devjoin[RB]{ṣṭh}{ū}\KAbold{padiśya} saṃkrama%yya \edtext{\devjoin[RB]{yy}{ā}\KAbold{tha}}{ \lemma{atha} \Cfootnote{\emend{}; adhva \Ldot{}}} \edtext{\KAbold{nāyake}\devjoin[BR]{ṣv}{a}}{% \lemma{nāyakeṣv} \Cfootnote{\emend{}; nāya\danda{}keṣv \Ldot{}} }% nvayaḥ paricaya \msln{5} \KAbold{ādadhe} kṛtaḥ. te 'pi tadvanto jātā iti bhāvaḥ. kīdṛśais taiḥ\KAquestion{} \edtext{\KAbold{vallabhai}\devjoin[BR]{r}{a}}{% \lemma{vallabhair} \Cfootnote{\Lpc{}; vallabhaiḥ \Lac{}\ENdot} }%a bhipretaiḥ. kīdṛśeṣu nāyakeṣu\KAquestion{} \KAbold{tāsām īkṣaṇe} vilokane \KAbold{vyasaniṣu} \msln{6} rāgiṣu \ddanda{}~39~\ddanda \pend \endnumbering \end{otherlanguage} \end{document} I don't quite understand what exactly causes this issue. If I change the language-switching environment containing the edition to sanskrit-latin, the problem does not seem to occur. If I comment out the page-layout-specific commands, it does not occur either, and also not if I do not increase the line spacing at the beginning of the Sanskrit environment.
- Proof environment already defined with \DocumentMetadata{pdfstandard=UA-2}by Gaussler on September 28, 2026 at 12:04 pm
I just updated to TeX Live 2026. Now when I compile the following, I get ! LaTeX Error: Command \proof already defined. The problem disappears if I remove the \DocumentMetadata line: \DocumentMetadata{pdfstandard=UA-2} \documentclass{article} \usepackage{amsmath} \usepackage{ntheorem} \theoremstyle{nonumberplain} \newtheorem{proof}{Proof} \begin{document} You want proof? \end{document}
- Macro which prints input only if all internal invocations of a second macro are non-blank?by modallyFragile on September 28, 2026 at 9:11 am
I want to define two macros, let's call them \coalesce and \coalescegroup. \coalescegroup is only ever used within \coalesce (names are inspired by the Postgres command). \coalesce prints its input if and only if every instance of \coalescegroup within that input prints something non-blank (where blankness is tested by \tl_if_blank:nTF or a variant). Otherwise it discards its input. \coalescegroup divides its input at every instance of some delimiter -- say \coalesceor, and then prints the first division which is not blank (by the same test). If all are blank, it prints nothing. The motivation is templating in class files. I maintain class files for things like handouts and syllabi, where I often want to do things like print 'my email is ', but only if my email is defined. Usually that would be something like \ifblank{\email}{}{My email is: \email} but with coalesce it can be \coalesce{My email is: \coalescegroup{\email}}, which to me makes much more sense. I also like the idea of setting up active characters for these things within coalesce, so that the last example could be written \coalesce{My email is: <\email>}, but that's a separate issue. How can I do this? Below is a MWE of what I've tried so far. I feel like it's close, but not quite there. My idea was to define \coalesceor to evaluate to itself, then define \coalescegroup to exhaustively expand its input, split it on \coalesceor (which will survive the expansion, because it expands to itself), then map over the result and print the first non-blank element, or the token \__coalesce_stop if they're all blank. Then \coalesce uses the same trick: define \__coalesce_stop to expand to itself, \coalesce then just expands its input, checks to see if the resulting token list includes \__coalesce_stop, and prints it all just if it doesn't. I think the basic idea is probably OK, but I can't get the expl3 details right. \documentclass{article} \ExplSyntaxOn % First attempt at coalescegroup % Define a boolean for 'already done' \bool_new:N \__coalesce_coalescegroup_bool % Processor for arguments \cs_new:Npn \__coalesce_coalescegroup_step #1 { \bool_if:NF \__coalesce_coalescegroup_bool \tl_if_blank:nF #1 % If the group isn't blank, then ... % ... we will (eventually) print this arg. {\tl_set:Nn \tl_tmpa_tl {#1} % ... and set the boolean. \bool_set_true:N \__coalesce_coalescegroup_bool } } % Disjunction token \cs_new:Npn \coalesceor { \exp_not:N \coalesceor } \NewDocumentCommand{\coalescegroup}{ m }{ \bool_set_false:N \__coalesce_coalescegroup_bool % Set the scratch list a to be empty. \tl_set:Nn \tl_tmpa_tl {\__coalesce_stop} \tl_set:Nn \tl_tmpb_tl {\exp_args:Ne {\SplitList{\coalesceor}} { #1 }} \ProcessList \tl_tmpb_tl { \__coalesce_coalescegroup_step } % Print the output \tl_tmpa_tl } % Second attempt \NewDocumentCommand{\newcoalescegroup}{ >{\SplitList{\coalesceor}} m }{ \tl_new:N \coalescegroup_output_tl \tl_set:Nn \coalescegroup_output_tl \__coalesce_stop \tl_set:Nn \tl_tmpa_tl {\exp_args:ne { #1 }} \tl_map_inline:Nn \tl_tmpa_tl { % If the token is non-empty ... \tl_if_blank:nF #1 { % ... then write it to output var \coalescegroup_output_tl \tl_set:Nn \tl_tmpa_tell #1 % ... and break. \tl_map_break: } } % Leave result in the input stream \coalescegroup_output_tl } % Blocker token \cs_new:Npn \__coalesce_stop { \exp_not:N \__coalesce_stop } \NewDocumentCommand{\coalesce}{ m }{ % Print nothing if the blocker cs is found. \exp_args:Ne \tl_if_in:nnTF { #1 } \__coalesce_stop {} { #1 } } \ExplSyntaxOff % Testing values \def\blank{} \def\something{something} \begin{document} \section{First attempt} % Should print nothing, prints `foo bar' \coalesce{foo \coalescegroup{\blank} bar} % Should print nothing (because the second coalesce group fails), % prints `foo something bar baz' \coalesce{foo \coalescegroup{\something} bar \coalescegroup{\blank} baz} % Should print `foo something bar', and does! \coalesce{foo \coalescegroup{\blank \coalesceor \something} bar} % Should print `foo literal bar', and does! \coalesce{foo \coalescegroup{\blank \coalesceor literal} bar}\ \section{Second attempt} % Should print nothing, prints `foo bar' \coalesce{foo \newcoalescegroup{\blank} bar} % These all produce Error: Control sequence \coalescegroup_output_tl % already defined: % % \coalesce{foo \newcoalescegroup{\something} bar \newcoalescegroup{\blank} baz} % \coalesce{foo \newcoalescegroup{\blank \coalesceor \something} bar} % \coalesce{foo \newcoalescegroup{\blank \coalesceor literal} bar} \end{document} TIA.
- MLTeX and encTeX interactionby lodwicz on September 27, 2026 at 7:34 pm
I know that modern 8bit TeX implementations (TeXLive) may enable both MLTeX and encTeX extensions. My question is thus both technical and historical. I am enabling all three extensions (with eTeX) for some custom Plain pdfTeX macros, but I'd like to understand the processing order, and thus the interaction, amongst these extensions in terms of reencoding and hyphenation. So, assume I have an hyphenation pattern including with 1n defined in the format, that I have a pdfTeX with all three extensions enabled, and I reencode and substitute ñ, as follows, to enable UTF-8 input: \mubyte ^^D1 ^^C3 ^^91 \endmubyte % Ñ \mubyte ^^F1 ^^C3 ^^B1 \endmubyte % ñ \charsubdef ^^D1 = '176 ^^4E % Ñ \charsubdef ^^F1 = '176 ^^6E % ñ My actual question is this: in this case, it is clear to me that the hyacc-cm macros, to enable hyphenation in the remaining part of a composite word (say: "pi-ña-ta"), are unnecessary to enforce hyphenation even in Computer Modern fonts, if I define the \chars for Latin1 and compatible encodings as follows: \catcode^^D1=\active \catcode^^F1=\active \def^^D1={\~N} \def^^F1={\~n} I ran some experiments to check whether this was true, rather successfully, but I cannot understand exactly why. I haven't seen (maybe haven't searched enough for) any explanation of the interaction between MLTeX and encTeX that explains this behavior. update However, I found that without the UTF8 definitions from llist-latin.tex, in the Knuth local/lib directory, the character does not show up. MNWE as follows: \input pdftex.ini \font\ttfont= cmtt8 \font\syttfont= cmtex10 at 8pt \mubyte ^^D1 ^^C3 ^^91 \endmubyte % Ñ \mubyte ^^F1 ^^C3 ^^B1 \endmubyte % ñ \charsubdef "D1 = '176 "4E % Ñ \charsubdef "F1 = '176 "6E % ñ \catcode"D1=\active \catcode"F1=\active \def^^D1={\~N} \def^^F1={\~n} piñata \newcount\n \catcode`\^^c3=\active \def\missing{{\syttfont\char15}} \def^^c3#1{\n=`#1\advance\n by-128 {%\ttfont \ifcase\n \`A\or\'A\or\^A\or\~A\or\"A\or\AA\or\AE\or\c C\or \`E\or\'E\or\^E\or\"E\or\`I\or\'I\or\^I\or\"I\or \missing\or\~N\or\`O\or\'O\or\^O\or\~O\or\"O\or{\syttfont\char2}\or \O\or\`U\or\'U\or\^U\or\"U\or\'Y\or\missing\or\ss\or \`a\or\'a\or\^a\or\~a\or\"a\or\aa\or\ae\or\c c\or \`e\or\'e\or\^e\or\"e\or\`\i\or\'\i\or\^\i\or\"\i\or \missing\or\~n\or\`o\or\'o\or\^o\or\~o\or\"o\or{\syttfont\char4}\or \o\or\`u\or\'u\or\^u\or\"u\or\'y\or\missing\or\"y\fi}} piñata \bye Somehow the diacritic letter does not show up. Run with pdftex -ini -8bit -ml -enc -etex test as usual. My best guess is that the \mubyte/\endmubyte, \charsubdef code might work for other purposes, and the macro definitions are still required. Some references to some documentation are surely welcome.
- Align the equal sign of two groups `aligned` with two tagsby myhsia on September 27, 2026 at 5:45 pm
Two aligned environments inside two equation environments (obviously, two tags), now I want to align the 4 = signs. I know I can place the middle text inside the \shortintertext or \intertext provided by the mathtools package, but how to keep only 2 numbered tags keep in the middle of each aligned group vertically? \documentclass{article} \usepackage{mathtools} \begin{document} some text \begin{equation}\label{eq:eta_quantum} \begin{aligned} abc & = defghij\\ & = \int f(x) dx, \end{aligned} \end{equation} some text \begin{equation}\label{eq:eta_classical} \begin{aligned} defghi & = defghij\\ & = \int f(x) dx, \end{aligned} \end{equation} \end{document}
- Why does combining TikZ `patterns` and `fadings` cause rendering problems in some PDF viewers?by kabenyuk on September 27, 2026 at 3:47 pm
I have come across an interesting difference in how a PDF produced by TikZ is rendered by different PDF viewers. The following MWE isolates the issue: \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns,fadings} \begin{document} \begin{tikzpicture} % Pattern only \fill[draw,pattern=north west lines] (0,0) rectangle (3,.4); % Fading only \fill[draw,path fading=east] (0,-1) rectangle (3,-.6); % Pattern + fading \fill[draw,pattern=north west lines,path fading=east] (0,-2) rectangle (3,-1.6); \end{tikzpicture} \end{document} Left: Adobe Acrobat. Right: WinEdtPDF. The same PDF file is shown in both viewers. In WinEdtPDF the first two rectangles are rendered correctly. The problem appears only in the third one, where pattern=north west lines and path fading=east are used together: the hatching is not rendered correctly. Thus, pattern=north west lines works by itself, and path fading=east works by itself. The rendering difference appears only when the two TikZ mechanisms are combined. The same PDF is rendered correctly in Adobe Acrobat, Microsoft Edge, and Firefox. The same defect as in WinEdtPDF is also visible in Google Drive's PDF preview. I initially reported this to the WinEdt developer. Alex Simonic explained that WinEdtPDF uses PDFium for rendering and that the behavior observed there is a limitation of PDFium rather than of WinEdtPDF itself: https://github.com/WinEdt-Team/WinEdt-Support/discussions/131#discussioncomment-18627725 So my question is about the TikZ/PDF side of this behavior: what does TikZ write into the PDF when a pattern and path fading are combined, and what is special about this construction that makes different PDF rendering engines handle it differently?
- How to draw reaction mechanism arrows in chemfig?by alayne on September 27, 2026 at 3:20 am
I want to draw a simple arrow with its tail towards the C-H bond and its arrowhead pointing to the plus charge. Here is what I have so far: \documentclass[12pt]{article} \special{papersize=3in,5in} \usepackage{chemfig} \begin{document} \schemestart \chemfig{(-[:90]H)(-[:150])(-[:210])(-[:330]{\charge{330:3pt=$\scriptstyle \oplus$}{}}) } \arrow{->} \chemfig{{\charge{180:3pt=$\scriptstyle \oplus$}{}}(-[:0])(-[:120])(-[:240])} \schemestop \end{document} Also, for some reason, I can't add images
- How to adjust the width and height of underbracket and overbracket with LuaLaTeX?by Mika Ike on September 26, 2026 at 10:17 pm
Mathtools package admits width and height adjusts with PDFLaTeX, but with LuaLaTeX width and height is not adjustable. How to adjust or use native mathtools? \documentclass{article} \usepackage[spanish,es-notilde]{babel} \usepackage{amsmath,amssymb,mathtools} % amssymb, en LuaLaTeX, debe cargarse antes que unicode-math \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} \setmathfont{TeX Gyre Pagella Math} \usepackage{xcolor} \begin{document} \[ B(x)\underbracket[0.5pt]{A(z)}_{\text{Esto es una prueba}}C(w) B(x)\underbracket{A(z)}_{\text{Esto es una prueba}}C(w) \] \[ B(x)\overbracket[0.5pt]{A(z)}^{\text{\footnotesize Esto es una prueba}}C(w) B(x)\overbracket{A(z)}^{\text{\footnotesize Esto es una prueba}}C(w) \] \end{document}
- How to adjust the placement of the chemical reaction arrows in chemmacros so that it is horizontally aligned with the center of the chemfig figures?by alayne on September 26, 2026 at 4:25 pm
I need to show the structure of the products and reactants in a chemical equation. However, the arrow is not horizontally aligned to the center of the chemical figures. Here is the commands: \documentclass[12pt]{article} \special{papersize=3in,5in} \usepackage{chemmacros} \usepackage{chemfig} \usepackage[version=4] {mhchem} \begin{document} \begin{reaction*} \chemfig{(-[:210])(-[:330]OH)} ->[O] \chemfig{(-[:210])(=[:330]O)} \end{reaction*} \end{document}
- Adding -\infty and +\infty using nl-intervalby Sebastiano on September 26, 2026 at 12:40 pm
Is there a remote possibility to have, -\infty and +\infty, below the real line using only the package nl-interval? \documentclass{article} \usepackage{nl-interval} \begin{document} \begin{tikzpicture} \nlAxisX{-2}{5} \nlnuminf[pattern=north west lines]{1.5}[+3]{c}[.2] \end{tikzpicture} \begin{tikzpicture} \nlAxisX{-2}{5} \nlinfnum[pattern=north west lines]{1}[-5]{o}[.2] \end{tikzpicture} \begin{tikzpicture} \nlAxisX{-2}{5} \nlnumnum{-1}{o}{3}{c}[.2] \end{tikzpicture} \end{document}
- why is TeX capacity exceeded with \DocumentMetadata{tagging=off}?by murray on September 26, 2026 at 1:34 am
This source compiles just fine with the line \DocumentMetadata{tagging=off} commented out, as shown. Why, if I uncomment that line, do I get a "TeX capacity exceeded" at line 15, and how can this be fixed? \NeedsTeXFormat{LaTeX2e}[2026-06-01] % !TEX program = lualatex %\DocumentMetadata{tagging=off} \documentclass{book} \usepackage{fontspec} \usepackage{lua-unicode-math} \usepackage[thmtools-compat]{keytheorems} \newkeytheoremstyle{thmstyle}{} \AtBeginDocument{\newkeytheorem{theorem}[name=Theorem,style=thmstyle,numberwithin=chapter]} \usepackage{hyperref} \begin{document} \chapter{A chapter} \section{The section} \begin{theorem}[A key theorem] Some theorem text \end{theorem} \end{document}
- Enumitem: problem with formatting *itemize* inside *description* listby Zarko on September 25, 2026 at 4:12 pm
Consider the following example: \documentclass{article} \usepackage{lipsum} \usepackage{enumitem} \begin{document} \begin{description}[style=nextline] \item[First item] \lipsum[11] \item[Second item] \begin{itemize} \item first subitem \item second subitem \end{itemize} \end{description} \end{document} Why itemize list in above example doesn't start in new line as other normal text do? Is this a bug? Well, I can manage this behaviour by adding \mbox{} after description label.
- How do we create a `\subsubsubsection` (using `\paragraph`) and `\subsubsubsubsection` (using `\subparagraph`) in amsart?by Arbuja on September 25, 2026 at 3:13 pm
Using Latex Overleaf, I want to create a \subsubsubsection with \paragraph and \subsubsubsubsection with \subparagraph in \documentclass{amsart}. However, there are two problems: The \subsubsubsection returns an error sign If I add an * to the \subsubsubsection and \subsubsubsubsection (e.g., \subsubsubsection*), it won't disappear from the table of contents. \documentclass[11pt]{amsart} \newcommand{\subsubsubsection}{\paragraph} \newcommand{\subsubsubsubsection}{\subparagraph} \setcounter{secnumdepth}{5} \setcounter{tocdepth}{5} \title[Title]{Title} \author[Arbuja]{Arbuja Krishnan} \address{None, Unaffiliated, United States} \begin{document} \maketitle \tableofcontents \section{adhfk} \subsection{aksad} \subsubsection{fsajk} \subsubsubsection{agrg} \subsubsubsubsection{sjaf} \subsubsection{aehkfg} \subsubsubsubsection*{asfkdh} %We want this invisible from the table of contents%) \subsubsubsubsection*{asdgj} %We want this invisible from the table of contents%) \end{document} Question: How do I fix the problems above the code?