Week
- An enumeration with apostrophesby Leandro Caniglia on September 17, 2025 at 11:31 pm
I'm trying to set up an enumeration that would produce two items P_3' and P_3''. My attempt \usepackage[shortlabels]{enumitem} \newcommand{\apostrophes}[1]{% \ifcase\numexpr#1\relax \or ' \or '' \or ''' \or '''' \or '''''% \else '''''\fi} \begin{enumerate}[label={p$_3$\apostrophes{\arabic*}},font=\scshape] \item \label{P3'} \item \label{P3''} \end{enumerate} so that I can then refer to the items with \newcommand{\Ptprime}{{\upshape\textsc{\ref{P3'}}}} \newcommand{\Ptdprime}{{\upshape\textsc{\ref{P3''}}}} However, I get a "missing number, treated as zero" error message. I've also tried \arabic{\value{enumi}}' and \arabic{\theenumi}' without luck (same error). How should I change my code, please? Compilable version \documentclass{article} \usepackage[shortlabels]{enumitem} \newcommand{\apostrophes}[1]{% \ifcase\numexpr#1\relax \or ' \or '' \or ''' \or '''' \or '''''% \else '''''\fi} \newcommand{\Ptprime}{{\upshape\textsc{\ref{P3'}}}} \newcommand{\Ptdprime}{{\upshape\textsc{\ref{P3''}}}} \begin{document} \begin{enumerate}[label={p$_3$\apostrophes{\arabic*}},font=\scshape] \item \label{P3'} There are four points in general position. \item \label{P3''} The incidence relation is not empty. \end{enumerate} The first item is number \Ptprime. The second item is number \Ptdprime. \end{document}
- Define counters using a loopby Subhajit Paul on September 17, 2025 at 5:32 pm
I am preparing a template for a question paper in which the syllabus units are indicated alongside each question. Subsequently, I would like to generate a table showing the number of questions and the total marks corresponding to each unit. Since the number of units may vary depending on the course, I have defined \numunits as a variable. However, I am having difficulty creating the counters dynamically. Below is a MWE of my attempt. Any guidance would be greatly appreciated. \documentclass{exam} \newcommand\numunits[1]{\newcommand\zzunit{#1}} \numunits{3} \usepackage{tikz} \foreach \n in {1,...,\zzunit}{ \newcounter\csname unitmarks\expandafter{\romannumeral\n}\endcsname \newcounter\csname unitqn\expandafter{\romannumeral\n}\endcsname } \newcommand{\Unit}[2]{% \addtocounter{unitmarks\uppercase\expandafter{\romannumeral #1}}{#2} \refstepcounter{unitqn\uppercase\expandafter{\romannumeral #1}} } \begin{document} \begin{questions} \question \Unit{1}{2} First qn. \question \Unit{2}{3} Second qn. \question \Unit{3}{4} Third qn. \question \Unit{1}{5} Fourth qn. \end{questions} \begin{tabular}{| c | c | c |} \hline \foreach \n in {1,...,\zzunit}{ Unit \n & \theunitqn\expandafter{\romannumeral \n} & \theunitmarks\expandafter{\romannumeral \n}\\ \hline } \end{tabular} \end{document}
- TikZ bounding box not calculated properly in standalone classby TheFox on September 17, 2025 at 10:37 am
I'm using tikz to create a figure with a ring and n nodes on it equally separated by an angle of 360° / n. Since I want the number of nodes to be arbitrary I defined a command which creates the tikzpicture: \newcommand{\drawfigure}[2]{% \def\n{#1} \begin{tikzpicture} \draw[dashed] (0,0) circle (\rring); \foreach \i in {0,...,\numexpr\n-1\relax}{ \pgfmathsetmacro{\angle}{360*\i/\n} \begin{scope}[shift={(\angle:\rring)}, rotate=\angle] \draw[fill=black!20] #2; \end{scope} } \end{tikzpicture} } where \rring is defined globally, the first argument is the number of nodes to create and the second the node to draw. For example if one wants circular/rectangular nodes he can pass as second argument the macro \nodecirc/\noderect: \def\nodecirc{% (0,0) circle (\rnode); } \def\noderect{% (-\rnode,-\rnode) rectangle (\rnode,\rnode); } The problem I stumbled across is related to the bounding box of tikzpictures for specific values of n, and only with the circular node. For example for n = 3 I obtain a white space above the upper node, but not below the lower one as in this picture (sorry for the white backgrounds, if I added a background color the bounding box would get bigger, just open the image in a new tab): a similar problem arises for n = 5: but not for n = 4: while as I said with the rectangular node everything works fine. The issue persists if I set the bounding box as \usetikzlibrary{bbox} \tikzset{% bezier bounding box } the only difference being now some nodes are cut off, for instance the lower one in the case n = 3: Here is a MWE: \documentclass[tikz]{standalone} %\usetikzlibrary{bbox} \tikzset{% %bezier bounding box } \def\rring{1} \def\rnode{0.4} \def\nodecirc{% (0,0) circle (\rnode); } \def\noderect{% (-\rnode,-\rnode) rectangle (\rnode,\rnode); } \newcommand{\drawfigure}[2]{% \def\n{#1} \begin{tikzpicture} \draw[dashed] (0,0) circle (\rring); \foreach \i in {1,...,\n}{ \pgfmathsetmacro{\angle}{360*\i/\n} \begin{scope}[shift={(\angle:\rring)}, rotate=\angle] \draw[fill=black!20] #2; \end{scope} } \end{tikzpicture} } \begin{document} \drawfigure{3}{\nodecirc} \drawfigure{4}{\nodecirc} \drawfigure{5}{\nodecirc} \drawfigure{3}{\noderect} \drawfigure{4}{\noderect} \drawfigure{5}{\noderect} \end{document} How can I solve the problem, possibly without setting manually the bounding box? Why does tikz behave like this, it shouldn't since every node is placed symmetrically with respect to the origin? EDIT: as suggested by @gernot the problem seems to be related to how the bounding box of each node is calculated. See these examples: for n = 3, and for n = 5, while in the case n = 4 every bounding box is computed correctly. The bounding boxes were drawn replacing the scope environment with: \begin{scope}[shift={(\angle:\rring)}, rotate=\angle, local bounding box=bbox] \draw[fill=black!20] #2; \end{scope} \draw[red] (bbox.south west) rectangle (bbox.north east); Still I don't understand where's the problem, and why symmetric nodes don't have symmetric bounding boxes...
- why the "e" and "m" in the last terms look different from those in the first termsby brownser on September 17, 2025 at 7:28 am
I have this equation, \begin{equation} e m = - e^2 \bf{E} \mathcal{N}- e s \bf{v_d} \mathcal{N} + e m \end{equation} here the letter "e" looks different in terms 1,2 and 3,4. What is casuing this? How can I fix this? How can I make the "e" in terms 3 and 4 to look like that in 1 and 2. Thanks.
- genealogytree: How to make `traditional database` tree grow horizontally?by J...S on September 17, 2025 at 7:28 am
I am making a family tree using the geneologytree package like this: \documentclass{standalone} \usepackage[all]{genealogytree} \begin{document} \begin{genealogypicture}[ template=database traditional, ] parent[id=parents]{ p[id=father]{ male, name = {Jack Doe}, } p[id=mother]{ female, name = {Jane Doe}, } c[id=c1]{ female, name = {Jane Doe}, } c[id=c2]{ male, name = {Jack Doe}, } c[id=c3]{ male, name = {Jack Doe}, } g[id=c4]{ female, name = {Jane Doe}, } c[id=c5]{ female, name = {Jane Doe}, } c[id=c6]{ male, name = {Jack Doe}, } c[id=c7]{ male, name = {Jack Doe}, } } \end{genealogypicture} \end{document} This is the output: I am using the traditional database template for a 'minimal' look. But is there a way to make this tree grow horizontally from the left to the right? Instead of growing from top to bottom? I tried using the timeflow=right option, but it seems that has no effect on the traditional database template. I tried genealogytree because that seemed to be most suited for drawing family trees. Perhaps I should be using something else?
- Has \subnode broken or am I doing something daft?by cfr on September 16, 2025 at 10:56 pm
The following code compiles without error but gives unexpected (to me) results. In particular, the labels never 'settle'. As far as I can tell, LaTeX perpetually reports that the labels may have changed. The positions of the nodes jump from place-to-place (sometimes on different pages) accordingly. Now I know \subnode[]{}{} works - or did work. So either I am doing something very silly or something has broken (probably very recently) or both. \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,fit} \begin{document} \begin{tikzpicture} \node {a \subnode{a}{sub} node}; \node [fit=(a),draw,inner sep=0pt,] {}; \end{tikzpicture} \end{document} This is essentially copy-pasted from tikzmark's manual, but I cannot get it to work. Certainly tikzmark does not seem to have been updated recently. However, pgf/tikz is from 2025-08-29 v3.1.11a (3.1.11a), so perhaps something has changed there. Another suspect may be LaTeX if anything to do with \mathchoice might have changed recently, since \subnode uses this internally.
- Drawing vertical and horizontal vectors along a Bézier curve (without local rotation)by lukewarn on September 16, 2025 at 10:26 pm
I’m trying to annotate a quadratic Bézier* curve in TikZ with vectors. Right now I can draw normal vectors (red arrows) at multiple points along the curve using the decorations.markings library. Here is a minimal working example: \documentclass[tikz,border=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings,calc,arrows.meta} % <-- arrows.meta added \begin{document} \begin{tikzpicture} % Quadratic Bézier control points \coordinate (QB1) at (0,0); \coordinate (QB2) at (0,3); \coordinate (QB3) at (8,3); % Convert quadratic to cubic control points \path let \p1 = (QB1), \p2 = (QB2), \p3 = (QB3), \p4 = ({(1/3)*\x1 + (2/3)*\x2},{(1/3)*\y1 + (2/3)*\y2}), \p5 = ({(2/3)*\x2 + (1/3)*\x3},{(2/3)*\y2 + (1/3)*\y3}) in coordinate (QB_aux1) at (\p4) coordinate (QB_aux2) at (\p5); % The curve \draw[thick,black] (QB1) .. controls (QB_aux1) and (QB_aux2) .. (QB3); % Normal vectors using arrows.meta syntax \draw[ postaction={ decorate, decoration={ markings, mark=between positions 0. and 1. step 0.1 with { \draw[color=red, -{Latex[length=1mm]}] (0,0) -- (0,0.5); } } } ] (QB1) .. controls (QB_aux1) and (QB_aux2) .. (QB3); \end{tikzpicture} \end{document} Now, in addition to the red arrows (normals), I would like to draw vertical and horizontal arrows at the same positions. However, it seems that TikZ rotates every arrow into the local coordinate system of the decoration. As a result, I cannot find a way to get all arrows to stay vertical/horizontal in the global picture. Also, I don’t want the red vectors to become the vectorial sum of the horizontal and vertical components — they are all independent drawings. Question: How can I place these vertical and horizontal arrows at each marked position along the Bézier curve, aligned with the global axes, rather than with the curve’s local frame? * For some reason, if I use \draw[thick,black] (QB1) .. controls (QB2) .. (QB3); instead of \draw[thick,black] (QB1) .. controls (QB_aux1) and (QB_aux2) .. (QB3); the curve doesn't look like a quadratic Bèzier.
- Why can't I use \StrLeft for this macro?by haifisch123 on September 16, 2025 at 7:47 pm
I'd like to have a macro which returns the first two letters of a weekday given a certain date (DD.MM.YYYY). For example "16.09.2025" would be "Tu". \documentclass{article} \usepackage{datetime} \usepackage{xstring} % input has the form "DD.MM.YYYY" % outputs first two letters of the weekday of a given date \newcommand{\strToWeekday}[1]{ \StrBefore{#1}{.}[\myDay]% \StrBehind{#1}{.}[\myYearAndMonth]% \StrBefore{\myYearAndMonth}{.}[\myMonth]% \StrBehind{\myYearAndMonth}{.}[\myYear]% \dayofweekname{\myDay}{\myMonth}{\myYear}[\myWeekday]% \StrLeft{\myWeekday}{2} } \begin{document} \strToWeekday{11.05.2023} % should return Th \strToWeekday{13.05.2023} % should return Sa \strToWeekday{16.09.2025} % should return Tu \end{document} Splitting the string, and getting (the long form of) the weekday works fine. But I couldn't manage to get only the first 2 letters of this longform. Thanks in advance for any help.
- Modified \bigcup and \bigcapby Jairo Bochi on September 16, 2025 at 6:40 pm
I'd like to define some modified \bigcap and \bigcup commands so that I could easily write code such as the following one, without having to adjust things by hand: \documentclass[12pt]{article} \begin{document} The intersection of a nested decreasing sequence of sets $A_1 \supseteq A_2 \supseteq \dots$ is denoted \[ \downarrow \hspace{-15pt} \bigcap_{n=1}^\infty A_n \, . \] Similarly, the union of a nested increasing sequence of sets $B_1 \subseteq B_2 \subseteq \dots$ is denoted $\uparrow \hspace{-10pt} \bigcup_{n=1}^\infty B_n$. \end{document}
- Defining a verbatim environment as a pair of commands (e.g., using c argspec), with optional argumentby Karl Berry on September 16, 2025 at 4:55 pm
I'm wondering if it's possible to use the new c arg spec (or any other method) in LaTeX to define a verbatim environment as a pair of commands. I also want the starting command to take an optional argument. My attempt, following the example in ltnews41, fails: \documentclass{article} \NewDocumentEnvironment{tubtyping}{!O{} c} {\begin{verbatim}#2 \end{verbatim} } {} \def\starttyping{\begin{tubtyping}} \def\stoptyping{\end{tubtyping}} \begin{document} \starttyping[foo] foo \stoptyping \starttyping bar \stoptyping \end{document} Not surprisingly, it gets the error Runaway argument? bar\obeyedline \stoptyping\obeyedline \end{document}\obeyedline \obeyedline \ET C. ! File ended while scanning use of \@xverbatim. I presume the verbatim environment can't recognize the \end{verbatim} since it's already been tokenized in the definition. I get similar errors with commands defined using traditional optional arguments (\newcommand\starttyping[1][]), etc., since (it seems) looking ahead for the [ freezes the tokens. I'm not worried about end of line behavior, having text on the \start or \stop lines, etc. It would just be helpful to have the basic idea work. This is with current (as of 2025-09-16) pdflatex-dev, LaTeX2e <2025-06-01> patch level 1 and L3 programming layer <2025-08-13>. I saw the previous question Defining a new environment extending a verbatim environment but it's not about L3. If anything in fancyvrb, listings, or any other verbatim package offers this functionality, I'd be happy to hear about it. I don't need to define it myself, I just couldn't find anything that provides it. P.S. I should mention, an alternative approach would be a way to change the end-verbatim string from \end{verbatim} to \stoptyping. Then \starttyping could take the optional arg and start the verbatim env, and the env could end normally. As far as I know the end-verbatim string cannot be changed, though.
- How to draw the Ketamine molecular structure using ChemFig?by Marco Fanelli on September 16, 2025 at 11:27 am
How to draw the Ketamine molecular structure using ChemFig? Question I'm trying to draw the molecular structure of Ketamine (C₁₃H₁₆ClNO) using the chemfig package in LaTeX. I'm having trouble properly positioning the substituents on the benzene ring and connecting the cyclohexanone ring. What I've tried Here's my current attempt: \documentclass{article} \usepackage{chemfig} \begin{document} \chemfig{*6(=-(-[:30](=[:90]O)-[:330]HN-[:30])=-(-Cl)=)} \end{document} Expected result
- Vertical dashed lines in tikz. Figure from Proofs Without Wordsby Richard on September 16, 2025 at 9:08 am
I’m trying to recreate a figure from Roger B. Nelsen’s Proofs Without Words: Exercises in Visual Thinking—specifically “Sums of Squares V” (Integer Sums, p. 81). My code gets everything right except the vertical dashed lines inside each unit square. Can these be drawn when using rectangle ++(1,1), or should I use a different approach? \documentclass[]{article} \usepackage [utf 8]{inputenc} \usepackage{soul} \usepackage {ulem} \usepackage{amsmath , bm} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{quotes,angles} \usetikzlibrary {arrows.meta} \usetikzlibrary{math} \usetikzlibrary {babel} \usetikzlibrary{calc} %for coordinate calc \usepackage{tikz,ifthen} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm,yscale=-1] % neutralize \i and \j only within this block \begingroup \let\i\relax \let\j\relax %First rectangle \foreach \i in {-1} \foreach \j in {0} \draw (\i,\j) rectangle ++(1,1); %Second rectangle \foreach \i in {0,1}{ \foreach \j in {0,1}{ \ifnum\j=0\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=2\relax \else \draw (\i,\j) rectangle ++(1,1); \fi\fi } } %Third rectangle \foreach \i in {2,3,4}{ \foreach \j in {0,1,2}{ \ifnum\j=0\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=2\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else \draw (\i,\j) rectangle ++(1,1); \fi\fi } } %Fourth rectangle \foreach \i in {2,3,4}{ \foreach \j in {0,1,2}{ \ifnum\j=0\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=2\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else \draw (\i,\j) rectangle ++(1,1); \fi\fi } } %Fifth rectangle \foreach \i in {5,6,7,8}{ \foreach \j in {0,1,2,3}{ \ifnum\j=0\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=2\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else \draw (\i,\j) rectangle ++(1,1); \fi\fi } } %Sixth rectangle \foreach \i in {9,10,11,12,13}{ \foreach \j in {0,1,2,3,4}{ \ifnum\j=0\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=2\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else\ifnum\j=4\relax \filldraw[fill=gray!30,draw=black] (\i,\j) rectangle ++(1,1); \else \draw (\i,\j) rectangle ++(1,1); \fi\fi\fi } } \endgroup \end{tikzpicture} \end{document}
- How to save and reuse a calculated distanceby Lucy on September 16, 2025 at 5:50 am
I want to draw two arcs in TikZ. Right now I’m using \path let to calculate the radius, but I’d like to store this value and reuse it later, so I don’t have to write the starting points every time. In particular, I want to calculate the distance 𝐴𝑆1 once, save it, and then use it as the radius when defining other points on the arc. I guess I should use \pgfmathsetmacro for this, but I’m not sure how. What is the best way to save a value (for example, the distance between two points) and reuse it in multiple \draw commands? I would like use for example \coordinate (K1) at (140:\n3). \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amsfonts,amssymb,mathrsfs} \usepackage[cmyk]{xcolor} \usepackage{pgfplots} %grafy s použitím \begin{axis} ... \end{axis} \pgfplotsset{compat=newest} % 1.15 pro geogebru, potřeba pro vykrelsení grafů \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usetikzlibrary{babel,arrows,intersections,patterns,calc,angles,through} \pagestyle{empty} % % % \begin{document} % %%%DEFINE COLOR \definecolor{modra}{cmyk}{1,0,0,0} \definecolor{cerna}{cmyk}{0,0,0,1} \definecolor{bila}{cmyk}{0,0,0,0} % \begin{tikzpicture}[scale=1] \def\delka{2.1} \def\uhel{72} \coordinate (A) at (0,0); \coordinate (B) at (\delka,0); \coordinate (S) at ($(A)!1/2!(B)$); % \draw[-] (A) -- (B); \path[name path=rr] (A) -- (\uhel-90:\delka); \draw[dash pattern=on 6pt off 2pt on 1pt off 2pt,name path=osa,cerna!80] ($(S)!1.25cm!270:(A)$) -- ($(S)!1.25cm!90:(A)$) coordinate[very near end] (o); \path[name intersections={of=rr and osa,by=S1}]; \draw (S1) node {$+$}; % %%%arcs \draw[thick,shift={(S1)}] let \p1 = (A), \p2 = (S1), \n3 = {veclen(\x1-\x2,\y1-\y2)} in (180-15:\n3) arc (180-15:360+15:\n3); \draw[thick,shift={(S1)}] (140:\n3) arc (140:400:\n3); % %%%I use \path let \p2 = (S1) in coordinate (S2) at (\x2, {- \y2}); \draw (S2) node {$+$}; \draw[thick,shift={(S2)}] let \p4 = (A), \p5 = (S2), \n6 = {veclen(\x4-\x5,\y4-\y5)} in (180+15:\n6) arc (180+15:-15:\n6); \draw[fill=blue!25] (A) circle (2pt); \draw[fill=blue!25] (B) circle (2pt); % % \end{tikzpicture} % \end{document}
- Changing the line style / line pattern in clozeby user1 on September 15, 2025 at 7:29 pm
Is there a way to change the line style of a cloze, i.e., to be dotted, loosely dash dot dot or any other style (like tikz's dash pattern)? \documentclass{article} \usepackage{cloze} \begin{document} Here \cloze{is my} text. \end{document}
- Get coordinates of a voltage label (circuitikz)by Workoft on September 15, 2025 at 1:54 pm
I'm trying to draw a circle around a voltage label and then an arrow from that circle pointing somewhere else. I can't figure out how to get the coordinates of the label. I know I can just place the circle by trial-and-error or draw the voltage label as a separate node altogether, but those are just workarounds. I feel there should be a simpler, more robust way of doing this. As a MWE, consider the code below. How do I draw a circle around the label v without manually figuring out the exact position? \documentclass{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz} \draw (0,0) to[open, v=$v$, voltage=straight] (2,0); \end{circuitikz} \end{document}
- How to double chapter numbers and let hyperref do its work correctlyby Christophe on September 15, 2025 at 9:40 am
I have the following MWE with the goal to double some chapter numbers (don't ask me why, please). The problem is obviously that the links in the toc do not work anymore (hyperref). How to make these links work correctly? Or how should I do to double some chapter numbers? Thank you! \documentclass{memoir} \usepackage{hyperref} \begin{document} \tableofcontents \newpage \chapter{One} \section{First} Blabla. \section{Second} Blabla. \setcounter{chapter}{0} \chapter{One again} \section{Third} Blabla. \section{Fourth} Blabla. \end{document}
- Why does the space for hyphenation patterns differ in TEX vs INITEX?by Igor Liferenko on September 15, 2025 at 9:22 am
In section 11 of tex.web it says that the space for hyphenation patterns should be larger for INITEX than it is in production versions of TEX. Why should the space be different? And why does tex.web use one value for both virtex and initex?
- Issue identifying reason for slow codeby mbert on September 15, 2025 at 12:29 am
I've been trying to identify the causes of a significant slowdown in my package keytheorems as the functionality has grown (I intended to avoid feature bloat, alas...), especially in comparison to the package it is supposed to replace the functionality of, thmtools. For large documents the difference is negligible, but with short documents the difference is noticeable. With l3benchmark, I've been able to determine the biggest slowdowns occur during package loading and in the begindocument(/before|end) hooks. Some of this is inevitable with the overhead of expl3 code. Here you can see loading the package takes about 0.4 seconds on my machine, compared with about 0.1 seconds for loading amsthm and thmtools: \documentclass{article} \ExplSyntaxOn \benchmark_tic: \usepackage{keytheorems} % compare with \usepackage{amsthm,thmtools} \benchmark_toc: \ExplSyntaxOff \begin{document} \end{document} So I just started placing \benchmark_tic:...\benchmark_toc: around various code chunks in keytheorems.sty to identify the cause. I discovered that adding translation definitions to the hook begindocument/before was taking about 0.25 seconds, a huge portion of the total time for ~150 lines out of ~3350. Here is a GitHub gist of keytheorems.sty with that code chunk benchmarked: https://gist.github.com/mbertucci47/7772d19ff41fdf6752d503232f145c6c If I don't add the code to the begindocument/before hook and just execute it during package loading, the time drops to 0.004 seconds. This makes sense, because the code being benchmarked is just adding the translations to the hook, not executing it. However, I can't recreate the slowdown in a minimal document. Here is that exact code chunk by itself (with an irrelevant boolean check commented): \documentclass{article} \usepackage{translations} \ExplSyntaxOn \benchmark_tic: \hook_gput_code:nnn { begindocument/before } { . } { % use 'provide' in case user defines their own translation in preamble \ProvideTranslationFallback { keythms_listof_title } { List~of~Theorems } \ProvideTranslationFallback { keythms_continues } { continuing~from~p.\, } \ProvideTranslationFallback { keythms_axiom } { Axiom } \ProvideTranslationFallback { keythms_conjecture } { Conjecture } \ProvideTranslationFallback { keythms_corollary } { Corollary } \ProvideTranslationFallback { keythms_definition } { Definition } \ProvideTranslationFallback { keythms_example } { Example } \ProvideTranslationFallback { keythms_lemma } { Lemma } \ProvideTranslationFallback { keythms_proposition } { Proposition } \ProvideTranslationFallback { keythms_remark } { Remark } \ProvideTranslationFallback { keythms_theorem } { Theorem } % \bool_if:NT \g__keythms_autotranslate_bool % { \ProvideTranslation { English } { keythms_listof_title } { List~of~Theorems } \ProvideTranslation { English } { keythms_continues } { continuing~from~p.\, } \ProvideTranslation { English } { keythms_axiom } { Axiom } \ProvideTranslation { English } { keythms_conjecture } { Conjecture } \ProvideTranslation { English } { keythms_corollary } { Corollary } \ProvideTranslation { English } { keythms_definition } { Definition } \ProvideTranslation { English } { keythms_example } { Example } \ProvideTranslation { English } { keythms_lemma } { Lemma } \ProvideTranslation { English } { keythms_proposition } { Proposition } \ProvideTranslation { English } { keythms_remark } { Remark } \ProvideTranslation { English } { keythms_theorem } { Theorem } % from DeepL; I don't know these languages! \ProvideTranslation { Albanian } { keythms_listof_title } { Lista~e~teoremave } \ProvideTranslation { Bulgarian } { keythms_listof_title } { Списък~на~теоремите } \ProvideTranslation { Czech } { keythms_listof_title } { Seznam~teorémů } \ProvideTranslation { Czech } { keythms_continues } { pokračování~ze~strany~ } \ProvideTranslation { Croatian } { keythms_listof_title } { Popis~teorema } \ProvideTranslation { Croatian } { keythms_continues } { nastavak~od~stranice~ } \ProvideTranslation { Danish } { keythms_listof_title } { Liste~over~sætninger } \ProvideTranslation { Danish } { keythms_continues } { fortsætter~fra~side~ } \ProvideTranslation { Danish } { keythms_axiom } { Aksiom } \ProvideTranslation { Danish } { keythms_conjecture } { Formodning } \ProvideTranslation { Danish } { keythms_corollary } { Følgeslutning } \ProvideTranslation { Danish } { keythms_definition } { Definition } \ProvideTranslation { Danish } { keythms_example } { Eksempel } \ProvideTranslation { Danish } { keythms_lemma } { Lemma } \ProvideTranslation { Danish } { keythms_proposition } { Udsagn } \ProvideTranslation { Danish } { keythms_remark } { Bemærkning } \ProvideTranslation { Danish } { keythms_theorem } { Teorem } \ProvideTranslation { Dutch } { keythms_listof_title } { Liste~over~sætninger } \ProvideTranslation { Dutch } { keythms_continues } { fortsætter~fra~side~ } \ProvideTranslation { Dutch } { keythms_axiom } { Axioma } \ProvideTranslation { Dutch } { keythms_conjecture } { Conjectuur } \ProvideTranslation { Dutch } { keythms_corollary } { Gevolg } \ProvideTranslation { Dutch } { keythms_definition } { Definitie } \ProvideTranslation { Dutch } { keythms_example } { Voorbeeld } \ProvideTranslation { Dutch } { keythms_lemma } { Lemma } \ProvideTranslation { Dutch } { keythms_proposition } { Propositie } \ProvideTranslation { Dutch } { keythms_remark } { Opmerking } \ProvideTranslation { Dutch } { keythms_theorem } { Stelling } \ProvideTranslation { Estonian } { keythms_listof_title } { Teoreemide~loetelu } \ProvideTranslation { Estonian } { keythms_continues } { jätkub~leheküljelt~ } \ProvideTranslation { Finnish } { keythms_listof_title } { Luettelo~teoreemoista } \ProvideTranslation { Finnish } { keythms_continues } { jatkuu~sivulta~ } \ProvideTranslation { French } { keythms_listof_title } { Liste~des~théorèmes } \ProvideTranslation { French } { keythms_continues } { suite~de~la~p.\, } \ProvideTranslation { French } { keythms_axiom } { Axiome } \ProvideTranslation { French } { keythms_conjecture } { Conjecture } \ProvideTranslation { French } { keythms_corollary } { Corollaire } \ProvideTranslation { French } { keythms_definition } { Définition } \ProvideTranslation { French } { keythms_example } { Exemple } \ProvideTranslation { French } { keythms_lemma } { Lemme } \ProvideTranslation { French } { keythms_proposition } { Proposition } \ProvideTranslation { French } { keythms_remark } { Remarque } \ProvideTranslation { French } { keythms_theorem } { Théorème } \ProvideTranslation { German } { keythms_listof_title } { Liste~der~Theoreme } \ProvideTranslation { German } { keythms_continues } { weiter~von~Seite~ } \ProvideTranslation { German } { keythms_axiom } { Axiom } \ProvideTranslation { German } { keythms_conjecture } { Vermutung } \ProvideTranslation { German } { keythms_corollary } { Korollar } \ProvideTranslation { German } { keythms_definition } { Definition } \ProvideTranslation { German } { keythms_example } { Beispiel } \ProvideTranslation { German } { keythms_lemma } { Lemma } \ProvideTranslation { German } { keythms_proposition } { Satz } \ProvideTranslation { German } { keythms_remark } { Bemerkung } \ProvideTranslation { German } { keythms_theorem } { Theorem } \ProvideTranslation { Greek } { keythms_listof_title } { Κατάλογος~θεωρημάτων } \ProvideTranslation { Hungarian } { keythms_listof_title } { A~tételek~listája } \ProvideTranslation { Icelandic } { keythms_listof_title } { Listi~yfir~setningar } \ProvideTranslation { Indonesian } { keythms_listof_title } { Daftar~Teorema } \ProvideTranslation { Italian } { keythms_listof_title } { Elenco~dei~teoremi } \ProvideTranslation { Italian } { keythms_continues } { continua~da~p.\, } \ProvideTranslation { Italian } { keythms_axiom } { Assioma } \ProvideTranslation { Italian } { keythms_conjecture } { Congettura } \ProvideTranslation { Italian } { keythms_corollary } { Corollario } \ProvideTranslation { Italian } { keythms_definition } { Definizione } \ProvideTranslation { Italian } { keythms_example } { Esempio } \ProvideTranslation { Italian } { keythms_lemma } { Lemma } \ProvideTranslation { Italian } { keythms_proposition } { Proposizione } \ProvideTranslation { Italian } { keythms_remark } { Osservazione } \ProvideTranslation { Italian } { keythms_theorem } { Teorema } \ProvideTranslation { Latvian } { keythms_listof_title } { Teorēmu~saraksts } \ProvideTranslation { Lithuanian } { keythms_listof_title } { Teoremų~sąrašas } \ProvideTranslation { Macedonian } { keythms_listof_title } { Список~на~теореми } \ProvideTranslation { Norwegian } { keythms_listof_title } { Liste~over~teoremer } \ProvideTranslation { Norwegian } { keythms_continues } { fortsetter~fra~side~ } \ProvideTranslation { Norwegian } { keythms_axiom } { Aksiom } \ProvideTranslation { Norwegian } { keythms_conjecture } { Formodning } \ProvideTranslation { Norwegian } { keythms_corollary } { Korollar } \ProvideTranslation { Norwegian } { keythms_definition } { Definisjon } \ProvideTranslation { Norwegian } { keythms_example } { Eksempel } \ProvideTranslation { Norwegian } { keythms_lemma } { Lemma } \ProvideTranslation { Norwegian } { keythms_proposition } { Påstand } \ProvideTranslation { Norwegian } { keythms_remark } { Bemerkning } \ProvideTranslation { Norwegian } { keythms_theorem } { Teorem } \ProvideTranslation { Polish } { keythms_listof_title } { Lista~twierdzeń } \ProvideTranslation { Polish } { keythms_continues } { ciąg~dalszy~ze~strony~ } \ProvideTranslation { Portuguese } { keythms_listof_title } { Lista~de~teoremas } \ProvideTranslation { Portuguese } { keythms_continues } { continua~da~p.\, } \ProvideTranslation { Portuguese } { keythms_axiom } { Axioma } \ProvideTranslation { Portuguese } { keythms_conjecture } { Conjetura } \ProvideTranslation { Portuguese } { keythms_corollary } { Corolário } \ProvideTranslation { Portuguese } { keythms_definition } { Definição } \ProvideTranslation { Portuguese } { keythms_example } { Exemplo } \ProvideTranslation { Portuguese } { keythms_lemma } { Lema } \ProvideTranslation { Portuguese } { keythms_proposition } { Proposição } \ProvideTranslation { Portuguese } { keythms_remark } { Observação } \ProvideTranslation { Portuguese } { keythms_theorem } { Teorema } \ProvideTranslation { Romanian } { keythms_listof_title } { Lista~teoremelor } \ProvideTranslation { Romanian } { keythms_continues } { continuare~de~la~p.\, } \ProvideTranslation { Russian } { keythms_listof_title } { Список~теорем } \ProvideTranslation { Slovak } { keythms_listof_title } { Zoznam~teorém } \ProvideTranslation { Slovak } { keythms_continues } { pokračovanie~zo~strany~ } \ProvideTranslation { Slovenian } { keythms_listof_title } { Seznam~trditev } \ProvideTranslation { Slovenian } { keythms_continues } { nadaljevanje~s~strani~ } \ProvideTranslation { Spanish } { keythms_listof_title } { Lista~de~teoremas } \ProvideTranslation { Spanish } { keythms_continues } { continúa~de~la~p.\, } \ProvideTranslation { Spanish } { keythms_axiom } { Axioma } \ProvideTranslation { Spanish } { keythms_conjecture } { Conjetura } \ProvideTranslation { Spanish } { keythms_corollary } { Corolario } \ProvideTranslation { Spanish } { keythms_definition } { Definición } \ProvideTranslation { Spanish } { keythms_example } { Ejemplo } \ProvideTranslation { Spanish } { keythms_lemma } { Lema } \ProvideTranslation { Spanish } { keythms_proposition } { Proposición } \ProvideTranslation { Spanish } { keythms_remark } { Observación } \ProvideTranslation { Spanish } { keythms_theorem } { Teorema } \ProvideTranslation { Swedish } { keythms_listof_title } { Lista~över~teorem } \ProvideTranslation { Swedish } { keythms_continues } { fortsättning~från~sidan~ } \ProvideTranslation { Swedish } { keythms_axiom } { Axiom } \ProvideTranslation { Swedish } { keythms_conjecture } { Förmodan } \ProvideTranslation { Swedish } { keythms_corollary } { Följdsats } \ProvideTranslation { Swedish } { keythms_definition } { Definition } \ProvideTranslation { Swedish } { keythms_example } { Exempel } \ProvideTranslation { Swedish } { keythms_lemma } { Hjälpsats } \ProvideTranslation { Swedish } { keythms_proposition } { Påstående } \ProvideTranslation { Swedish } { keythms_remark } { Anmärkning } \ProvideTranslation { Swedish } { keythms_theorem } { Sats } \ProvideTranslation { Turkish } { keythms_listof_title } { Teoremler~Listesi } \ProvideTranslation { Ukrainian } { keythms_listof_title } { Список~теорем } \ProvideTranslation { Welsh } { keythms_listof_title } { Rhestr~o~Theoremau } \ProvideTranslation { Welsh } { keythms_continues } { yn~parhau~o~dudalen~ } % } } \benchmark_toc: \ExplSyntaxOff \begin{document} \end{document} l3benchmark says 0 seconds. So I thought maybe it has something to do with adding to this hook regardless of what code is being added. However, just adding the lines \benchmark_tic: \hook_gput_code:nnn { begindocument/before } { . } { \def\abc{} } \benchmark_toc: to keytheorems.sty is timed at 0 seconds. So the length or content of the code chunk being added to the hook seems to matter, as does the fact that it's being added inside the package file. What is happening in the package loading such that adding to that hook is taking so long? Edit I discovered the problem: the label for the hook! Inside keytheorems.sty, \hook_gput_code:nnn { begindocument/before } { . } { <code>} is the same as \hook_gput_code:nnn { begindocument/before } { keytheorems } {<code>}, whereas in the top-level tex document it is treated specially and executed last. Indeed, if you change the . in the example document above to keytheorems (or anything else), the time goes from 0 seconds to ~0.25 seconds. Such a huge slowdown seems less than desirable; I understand there are different code paths in lthooks for hooks with labels, but it seems bad that every package's \AddToHook{begindocument}{...} should take so long. I don't know if this question makes sense any more, but I will leave it here in case anyone has anything more intelligent to say and provide a self-answer if no one does.
- tikz plot missing half of the graphby underflow on September 14, 2025 at 11:21 pm
I want to plot y = x sin(1/x) for x between +/-1. I split the graph into two halves to avoid the singularity at the origin, and I was able to plot the right half but not the left half. Minimal (non)working example: \documentclass{amsart} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[->] (-3.5,0) -- (3.5,0) node[right] {$x$}; \draw[->] (0,-1) -- (0,1.1) node[left] {$y$}; \draw[domain=0.01:1, samples=100, variable=\x] plot ({\x}, { \x * sin ( 1 / \x r)}); \draw[domain=-1:-0.01, samples=100, variable=\x] plot ({\x}, { \x * sin ( 1 / \x r)}); \draw[domain=-1:-0.01, samples=100, variable=\x] plot ({\x}, { \x * sin ( 1/ \x r) } ); \end{tikzpicture} \end{document} Why happened to the left half? Thanks for your help!
- New Computer Modern Sans: Strange irregular letter heightby HerpDerpington on September 14, 2025 at 12:35 am
I encountered an oddly specific issue in my document. Here is a mininmal example to reproduce it: \documentclass[11pt]{scrbook} \usepackage{fontspec} \setmainfont{NewCM10-Regular} \setsansfont{NewCMSans10-Regular} % \setmainfont{lmroman10-regular} % \setsansfont{lmsans10-regular} \begin{document} \tableofcontents \chapter{This is a Sample Chapter HEADING} \end{document} The issue can be seen here: The letter heights are clearly inconsistent, which is especially visible with the "a". This seems to happen at least in Adobe Acrobat at certain zoom levels (66.7%) and maybe other PDC viewers. The commented-out font pair does not have this issue. Removing \setsansfont{NewCMSans10-Regular} also solves this. Where does this come from and can this be fixed? I am also not exactly certain whether this issue comes from the font size. Version information: $ lualatex -credits This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) [...] Compiled with libharfbuzz 10.2.0; using 10.2.0 Compiled with libpng 1.6.46; using 1.6.46 Compiled with lua version 5.3.6 Compiled with mplib version 2.11 Compiled with zlib 1.3.1; using 1.3.1 Development id: 7673 $ tlmgr --version tlmgr revision 75204 (2025-05-13 23:48:24 +0200) tlmgr using installation: /usr/local/texlive/2025 TeX Live (https://tug.org/texlive) version 2025
- Optimization of a function that recursively splits a sequence of tokensby Vincent on September 14, 2025 at 12:33 am
I currently have the following code to recursively split and access a sequence according to a list of separators: %% -------------------------------- PREAMBLE -------------------------------- %% \documentclass[10pt]{article} \ExplSyntaxOn \cs_generate_variant:Nn \seq_set_split:Nnn{cnn,cne,cen,cee} \cs_generate_variant:Nn \seq_map_indexed_inline:Nn{cn} %% ---------------------------------- SPLIT --------------------------------- %% \NewDocumentCommand{\recursivesplit}{m m m}{ \recursive_split:nnn{#1}{#2}{#3} } \cs_new_protected:Nn \recursive_split:nnn{ \__recursive_split:nnn{#1}{#2}{#3} } \cs_new_protected:Npn \__recursive_split:nnn #1#2#3{ \tl_new:c{#1tl} \tl_set:cn{#1tl}{#2} \tl_if_empty:nF{#3}{ \seq_new:c{#1} \seq_set_split:cen{#1}{\tl_head:n{#3}}{#2} \seq_map_indexed_inline:cn{#1}{ \__recursive_split:nne{#1_##1}{##2}{\tl_tail:n{#3}} } } } \cs_generate_variant:Nn \__recursive_split:nnn{nne} %% -------------------------------- ACCESSOR -------------------------------- %% \NewDocumentCommand{\recursiveget}{m m}{ \tl_use:c{#1_\clist_use:nn{#2}{_}tl} } And its use: %% -------------------------------- DOCUMENT -------------------------------- %% \begin{document} a.b,c.d.e,f.g.h::i,j,k::l.m.n.o::p.q.r,s.t.u.v::x::y::z\\ \recursivesplit{mylist}{a.b,c.d.e,f.g.h::i,j,k::l.m.n.o::p.q.r,s.t.u.v::x::y::z}{{::},.} \recursiveget{mylist}{1} % -> display [a.b,c.d.e,f.g.h] \recursiveget{mylist}{1,2} % -> display [c.d.e] \recursiveget{mylist}{3} % -> display [l.m.n.o] \recursiveget{mylist}{3,1,2} % -> display [m] \end{document} %% -------------------------------------------------------------------------- %% It works but the current version creates a lot of temporary variables. QUESTION: How to clean and optimize the function so that it's a robust and fast latex3-compatible command?
- When will be the next version of ConTeXt if any? Why?by John on September 13, 2025 at 6:42 pm
[followup of https://tex.stackexchange.com/questions/747360/was-there-ever-a-context-mark-iii-or-context-mark-v] The latest ConTeXt version is MkXL or LMTX. We know there is never going to be a LaTeX3 -- instead LaTeX2e will be gently refactored. As shown at the speculation part of https://tex.stackexchange.com/a/747376/388111 the next available version number shall be MkXC (to faciliate MkCX being named parametered version). QUESTION: What features can we expect out of the next version of ConTeXt, if any? Will there even be the next version? How is new features incorporated into ConTeXt MkXL if there'll never be a new version like LaTeX2e? For all the above, why?
- Essential ConTeXtby jarnowy on September 13, 2025 at 3:01 am
How reliable is the tutorial Getting Started with CONTEXT, by Otten and Hagen, as a truly short ("Essential", as with the LaTeX series) introduction to ConTeXt? It looks like an old doc (1997?), so I don't know if the basics still apply for MKLX.
- Subscript - superscript shiftingby mert on September 12, 2025 at 5:24 pm
I want to make some default adjustments to the positions of certain letters in subscripts and superscripts within math mode (kerning). For example, I wrote the following code for the letter j. But this code did not produce any shift in the subscript or superscript. Where is the mistake? \documentclass{article} \def\mathdef#1{% \expandafter\mathchardef\csname old#1\endcsname\mathcode`#1 % \mathcode`#1="8000 % \begingroup \lccode`\~=`#1 % \lowercase{\endgroup\NewDocumentCommand~}} \mathdef{j}{o o}{% \oldj \IfValueT{#1}{\mkern-2mu_{#1}} \IfValueT{#2}{\mkern1mu^{#2}} } \begin{document} $ j_1^2 $ \end{document}
- Fatal error when compiling xymatrixby Semen Podkorytov on September 12, 2025 at 5:00 pm
I get a fatal error when trying to compile the following tex file with a xymatrix. \documentclass [10pt] {article} \usepackage {xypic} \begin {document} \[ \xymatrix { **{!/r1pt/}{a} \ar[r] & b } \] \end {document} Namely, I get the message ! TeX capacity exceeded, sorry [input stack size=10000]. Am I wrong at the line **{!/r1pt/}{a}? The whole log follows (I am using overleaf; at my home computer, I get the same error). This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025) (preloaded format=pdflatex 2025.8.27) 12 SEP 2025 16:33 entering extended mode \write18 enabled. %&-line parsing enabled. **main.tex (./main.tex LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2025-05-26> (/usr/local/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/2025/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count275 \c@section=\count276 \c@subsection=\count277 \c@subsubsection=\count278 \c@paragraph=\count279 \c@subparagraph=\count280 \c@figure=\count281 \c@table=\count282 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen148 ) (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xypic.sty (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xy.sty (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes, docmode, (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xyrecat.tex) (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xyidioms.tex) Xy-pic version 3.8.9 <2013/10/06> Copyright (c) 1991-2013 by Kristoffer H. Rose <krisrose@tug.org> and others Xy-pic is free software: see the User's Guide for details. Loading kernel: messages; fonts; allocations: state, \X@c=\dimen149 \Y@c=\dimen150 \U@c=\dimen151 \D@c=\dimen152 \L@c=\dimen153 \R@c=\dimen154 \Edge@c=\toks17 \X@p=\dimen155 \Y@p=\dimen156 \U@p=\dimen157 \D@p=\dimen158 \L@p=\dimen159 \R@p=\dimen160 \Edge@p=\toks18 \X@origin=\dimen161 \Y@origin=\dimen162 \X@xbase=\dimen163 \Y@xbase=\dimen164 \X@ybase=\dimen165 \Y@ybase=\dimen166 \X@min=\dimen167 \Y@min=\dimen168 \X@max=\dimen169 \Y@max=\dimen170 \lastobjectbox@=\box53 \zerodotbox@=\box54 \almostz@=\dimen171 direction, \d@X=\dimen172 \d@Y=\dimen173 \K@=\count283 \KK@=\count284 \Direction=\count285 \K@dXdY=\dimen174 \K@dYdX=\dimen175 \xyread@=\read2 \xywrite@=\write3 \csp@=\count286 \quotPTK@=\dimen176 utility macros; pictures: \xy, positions, \swaptoks@@=\toks19 \connectobjectbox@@=\box55 objects, \styletoks@=\toks20 decorations; kernel objects: directionals, circles, text; options; algorithms: directions, edges, connections; Xy-pic loaded) (/usr/local/texlive/2025/texmf-dist/tex/generic/iftex/ifpdf.sty Package: ifpdf 2019/10/25 v3.4 ifpdf legacy package. Use iftex instead. (/usr/local/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2024/12/12 v1.0g TeX engine tests )) LaTeX Warning: You have requested package `xypic', but the package provides `xy'. Package: xy 2013/10/06 Xy-pic version 3.8.9 (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xypdf.tex Xy-pic option: PDF driver v.1.7 loaded)) (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xyv2.tex Xy-pic option: Version 2 Compatibility v.3.8 Xy-pic Warning: `\stop' redefined. (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xyframe.tex Xy-pic option: Frame and Bracket extension v.3.14 loaded) Xy-pic pdf driver: `frame' extension support (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xypdf-fr.tex (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xycurve.tex Xy-pic option: Curve and Spline extension v.3.12 curve, \crv@cnt@=\count287 \crvpts@=\toks21 \splinebox@=\box56 \splineval@=\dimen177 \splinedepth@=\dimen178 \splinetol@=\dimen179 \splinelength@=\dimen180 circles, \L@=\dimen181 loaded) Xy-pic pdf driver: `curve' extension support (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xypdf-cu.tex loaded) loaded) (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xymatrix.tex Xy-pic option: Matrix feature v.3.14 \Row=\count288 \Col=\count289 \queue@=\toks22 \queue@@=\toks23 \qcount@=\count290 \qcount@@=\count291 \matrixsize@=\count292 loaded) (/usr/local/texlive/2025/texmf-dist/tex/generic/xypic/xyarrow.tex Xy-pic option: Arrow and Path feature v.3.9 path, \ar, loaded) loaded)) (/usr/local/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2025-04-14 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count293 ) (./output.aux) \openout1 = `output.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: External font `cmex10' loaded for size (Font) <7> on input line 6. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 6. Package xypdf Info: Line width: 0.39998pt on input line 6. <xymatrix 2x1 ! TeX capacity exceeded, sorry [input stack size=10000]. \dir ->\hbox \bgroup \xyFN@ \dir@i l.13 } If you really absolutely need more capacity, you can ask a wizard to enlarge me. Here is how much of TeX's memory you used: 3113 strings out of 467886 39087 string characters out of 5434057 566187 words of memory out of 5000000 31703 multiletter control sequences out of 15000+600000 627698 words of font info for 45 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 10000i,13n,68p,1425b,312s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!
- Tables: aligning text and equationby Marta B. on September 12, 2025 at 3:00 pm
I'm trying to allign a normal cell with text together with another one in which I have an equation. For instance, I want OB2B and SSMF to be aligned with their corresponding equations. Here is my code: \documentclass{article} \usepackage{amsmath} \usepackage{array} \begin{document} \begin{table}[h!] \caption{Current amplitude response at low frequencies in the mmW band (small signal regime)} \centering \small \renewcommand{\arraystretch}{2} % adjust row spacing \begin{tabular}{p{1.5cm}p{8cm}} \hline\hline & \centering\arraybackslash $i(2\omega_{RF}\pm\omega_{IF})$ \\ \hline OB2B & \begin{minipage}[t]{8cm}\vspace{0pt} \begin{equation} \Re P_0 m_{AM}m_{RF}^2 \sin^2 \varphi_{DC} \label{gain_OB2B} \end{equation} \end{minipage} \\ SSMF & \begin{minipage}[t]{8cm}\vspace{0pt} \begin{equation} \Re P_0 m_{AM}m_{RF}^2 \sin^2 \varphi_{DC} \left(1 \pm j \alpha \kappa P_0 \beta L \omega_{RF}\right) \label{gain_SSMF} \end{equation} \end{minipage} \\ \hline\hline \end{tabular} \label{gainTable1} \end{table} \end{document}
- pgfpolar-plot is shifted rightby Matthias on September 12, 2025 at 9:02 am
The plot is shifted to the right -- it should be centered. Any ideas why? I assume it comes from my coordinate transformation, since I plot nothing, the coordinate system is centered. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{pgfplots.polar} \begin{document} \begin{filecontents*}{test_world.dat} 13.4050 52.5200 151.2093 -33.8688 -74.0060 40.7128 \end{filecontents*} % Berlin \def\latO{52.5200} \def\lonO{13.4050} \pgfmathdeclarefunction{aeqdr}{4}{% \pgfmathsetmacro\dlon{#1-#3} \pgfmathsetmacro\argtmp{sin(#4)*sin(#2)+cos(#4)*cos(#2)*cos(\dlon)} \pgfmathsetmacro\arg{min(1,max(-1,\argtmp))} \pgfmathsetmacro\cdeg{acos(\arg)} \pgfmathparse{\cdeg/180} } \pgfmathdeclarefunction{aeqdtheta}{4}{% \pgfmathsetmacro\dlon{#1-#3} \pgfmathparse{mod(atan2(sin(\dlon)*cos(#2),cos(#4)*sin(#2)-sin(#4)*cos(#2)*cos(\dlon)),360)} } \centering \begin{tikzpicture} \begin{polaraxis}[ width=8cm, height=8cm, y axis line style={draw=none}, separate axis lines, ymin=0, ymax=1, xtick distance=10, xticklabel={% \pgfmathparse{% int(mod(450-\tick,360))% }% \pgfmathprintnumber{% \pgfmathresult }\textdegree% }, yticklabels={}, ] \addplot+[only marks, mark=*, mark size=1.6pt] table[ x expr = {mod(450 - aeqdtheta(\thisrowno{0},\thisrowno{1},\lonO,\latO), 360)}, y expr = {aeqdr(\thisrowno{0},\thisrowno{1},\lonO,\latO)}, col sep=space, ] {test_world.dat}; \end{polaraxis} \end{tikzpicture} \end{document}
- How to handle hyphened entries with a counting glossary?by Rubem Pacelli on September 11, 2025 at 7:23 pm
\documentclass{article} \usepackage{hyperref} \usepackage{glossaries} \makeglossaries \glsenableentrycount % Add a 'hyphenated' field to entries \glsaddkey {hyphenated} {\relax} {\cglsentryhyph} {\cGlsentryhyph} {\cglshyph} {\cGlshyph} {\cGLShyph} % Hyphenated printers: \renewcommand*{\cglshyph}[1]{% \ifglsused{#1}% {\glsdisp{#1}{\glsentryshort{#1}}}% {\glsdisp{#1}{\cglsentryhyph{#1} (\glsentryshort{#1})}}% } \renewcommand*{\cGlshyph}[1]{\cglshyph{#1}} \renewcommand*{\cGLShyph}[1]{\cglshyph{#1}} % Glossary entry \newglossaryentry{sota}{ type=\acronymtype, name={SOTA}, description={state of the art}, first={state of the art (SOTA)}, hyphenated={state-of-the-art}, long={state of the art}, short={SOTA}, sort={SOTA}, } \begin{document} \cglshyph{sota}... %\cgls{sota}... %\cglshyph{sota}. \printglossaries \end{document} I want: If I use SOTA only once: appears state of the art (if \cgls is used) or state-of-the-art (\cglshyph is used) If I use SOTA twice or more 2.1. Appears state of the art (SOTA) (if \cgls is used) or state-of-the-art (SOTA) (\cglshyph is used) in the first occurrence 2.2. Appears SOTA in the other occurences. I was managing to do so when I was not using this hyphen variant. Now, I am struggling to get this considering hyphened entries...
- For loop using the multido packageby Svend Tveskæg on September 11, 2025 at 7:00 pm
Consider the following (not that) MWE: \DocumentMetadata{} \documentclass[ a4paper, 12pt ]{article} \usepackage[ hmargin = 1cm, vmargin = 2cm ]{geometry} \usepackage{float} \usepackage{xcolor} \usepackage{multido} \usepackage{pstricks} \psset{dimen = m} \usepackage{hyperref} \makeatletter \providecommand*\floatlocation[2]{\@namedef{fps@#1}{#2}} \makeatother \floatlocation{figure}{H} \def\mlr{1} \def\bredde{\fpeval{(19-2*\mlr)/3}} \def\brik(#1,#2)#3#4{% \psframe[ fillstyle = solid, fillcolor = #3 ](\fpeval{\bredde*(#1-1)+\mlr*(#1-1)},\fpeval{\bredde*(#2-1)+\mlr*(#2-1)}) (\fpeval{\bredde* #1 +\mlr*(#1-1)},\fpeval{\bredde* #2 +\mlr*(#2-1)}) \rput(\fpeval{\bredde*(#1-0.5)+\mlr*(#1-1)},\fpeval{\bredde*(#2-0.5)+\mlr*(#2-1)}) {\fontsize{40}{48}\selectfont #4}} \begin{document} \multido {\i = 1+1} {10} {\phantomsection \addcontentsline {toc} {section} {\protect\numberline{\i}\i-tabellen} \label{\i-tabellen} \begin{figure} \centering \begin{pspicture}(19,\fpeval{(76+\mlr)/3}) \brik(1,4){red}{$\i \cdot 0$} \brik(1,3){blue!60!white}{$\fpeval{\i*0}$} \brik(2,4){green}{$\i \cdot 1$} \brik(2,3){yellow}{$\fpeval{\i*1}$} \brik(3,4){orange}{$\i \cdot 2$} \brik(3,3){green!40!white}{{$\fpeval{\i*2}$}} \brik(1,2){red!65!white}{$\i \cdot 3$} \brik(1,1){white}{{$\fpeval{\i*3}$}} \brik(2,2){cyan!50!white}{$\i \cdot 4$} \brik(2,1){gray!50!white}{{$\fpeval{\i*4}$}} \brik(3,2){pink}{$\i \cdot 5$} \brik(3,1){olive}{{$\fpeval{\i*5}$}} \end{pspicture} \end{figure} \newpage \begin{figure} \centering \begin{pspicture}(19,\fpeval{(76+\mlr)/3}) \brik(1,4){red}{$\i \cdot 6$} \brik(1,3){blue!60!white}{$\fpeval{\i*6}$} \brik(2,4){green}{$\i \cdot 7$} \brik(2,3){yellow}{$\fpeval{\i*7}$} \brik(3,4){orange}{$\i \cdot 8$} \brik(3,3){green!40!white}{$\fpeval{\i*8}$} \brik(1,2){red!65!white}{$\i \cdot 9$} \brik(1,1){white}{$\fpeval{\i*9}$} \brik(2,2){cyan!50!white}{$\i \cdot 10$} \brik(2,1){gray!50!white}{$\fpeval{\i*10}$} \end{pspicture} \end{figure} \cleardoublepage} \end{document} When I compile, I get the following error: Runaway argument? {\phantomsection \addcontentsline {toc} {section} {\protect \numberline \ETC. ! Paragraph ended before \multido@@ was complete. <to be read again> \par l.85 \cleardoublepage} I would like to loop over the first ten integers to produce 10x2 pages with cards containing multiplication of all the first ten integers and the corresponding answers. Can the code somehow be adjusted to achieve this?
- Is that possible to get symbol-family like `\ell` for "k" and "h"?by Explorer on September 11, 2025 at 1:29 pm
As the title mentioned, we know that \ell is provided by LaTeX kernal: latexdef \ell \ell: \mathchar"160 \the\ell: 352 In my senior high school, my mathematica teacher, use another two handwritten \ell-like symbols for k and h: Sorry for that I have no idea to draw them with tikz, and I didn't find some , so I can't provide my code. Is that possible to define another two similar symbols? Any thoughts are welcome and appreciated. Edited In texdoc unimath-symbols, there exists some letters with similar style, but not so "plain" as \ell, they are a bit too fancy. Edited Again: What I was actually after is the \ell-version of h and k which have the computer-modern-math style. What I said "computer-roman-math" style? In my opinion, that is harmonious with default computer-modern-math font. See the following figure(The h and k in purple are from "XITS Math" font): In my opinion, \ell is more matched with neighbored "og" in the example "log". But the k and h is not so matched with default "computer-modern-math" style. Thanks for @Sebastiano has provided methods to use cal fonts from mtpro2 and calligra. What I actually want to know is: Which font provide the similar \mathcal style of k and h, as l was converted to \ell by \mathcal with the same effect with "computer-modern-math"? I want to extend it to k and h with the similar style(without dramatic math-font style change when k and h was put together as normal computer-modern-math letters).