• 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 \bigcap
    by 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 argument
    by 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 Words
    by 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 distance
    by 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 cloze
    by 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 correctly
    by 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 code
    by 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 graph
    by 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!

  • Highlight a range of y-values in a pgfplot dateplot
    by J...S on September 14, 2025 at 7:14 am

    I have a set of values that I am plotting with the dateplot library of pgfplots. But I also need to indicate the desired range within which those values ideally should lie in. How can we highlight such a range in a plot? This is the plot that I have got (a modified form of the example in this post): \begin{filecontents}{mwe.csv} Time,a,b 2020-1-1 10:30,6,4 2020-1-1 11:30,5,5 2020-1-1 12:30,3,7 2020-1-1 13:30,2,8 \end{filecontents} \documentclass{article} \usepackage{filecontents} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, xtick=data, xticklabel={\hour.\minute}, x tick label style={align=center,rotate=45}, ymajorgrids, legend pos=north west ] \addplot [ycomb,color=blue] table [col sep=comma,y=a] {mwe.csv}; \addlegendentry{a} \addplot [ycomb,color=red] table [col sep=comma,y=b] {mwe.csv}; \addlegendentry{b} \end{axis} \end{tikzpicture} \end{document} It gives the following plot: I need to give a visual indication of the desired range of values in this plot. I am thinking of highlighting a part of the plot by adding a rectangle that stretches throughout the plot horizontally, but spanning only the desired range of y-values. For instance, I wish to draw a rectangle bounded by y=3 and y=5 in the above plot. How can this be done? I thought of doing this: % \usepgfplotslibrary{fillbetween} \path [name path=A] (\pgfkeysvalueof{/pgfplots/xmin},3) -- (\pgfkeysvalueof{/pgfplots/xmax},3); \path [name path=B] (\pgfkeysvalueof{/pgfplots/xmin},5) -- (\pgfkeysvalueof{/pgfplots/xmax},5); \addplot [green] fill between [ of=A and B ]; But that doesn't work. It gives errors like: ./inp.tex: Argument of \pgfcalendar@datetojulian has an extra }. I wanted something like this: (I am not sure why the legend doesn't show up properly.)

  • New Computer Modern Sans: Strange irregular letter height
    by 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 tokens
    by 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 ConTeXt
    by 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.

  • Special LaTeX characters and TikZ Math Mode
    by berkus on September 12, 2025 at 6:50 pm

    Is there a simple fix (other than not using \i in the math mode) to get the correct character in the following MWE? \documentclass[]{standalone} \usepackage{tikz} \usetikzlibrary{math} \begin{document} \tikzmath{ int \i; \i=7; } \begin{tikzpicture} \node at (0, 0) {ABC ı}; \end{tikzpicture} \end{document} The output of the MWE is

  • Subscript - superscript shifting
    by 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 xymatrix
    by 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 equation
    by Marta Botella Campos 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}

  • "changes" package "comment" command doesn't work with multicol
    by td211 on September 12, 2025 at 2:40 pm

    I'm trying to add comments to a two column document, however they are completely invisible. Is there a way to make comments work? Here is a MWE: \documentclass[]{article} \usepackage{changes} \usepackage{multicol} %opening \title{} \author{} \begin{document} \begin{multicols}{2} some text then a comment here \comment{I should be visible} \end{multicols} Outside of multicols the comment works \comment{Right?} \end{document}

  • pgfpolar-plot is shifted right
    by 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}

  • For loop using the multido package
    by 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?

  • Use \csdef on command line to pass in paramaters
    by Peter Grill on September 11, 2025 at 4:07 pm

    Is it possible to use a \csdef{}{} on the command line to pass in parameters to pdflatex? Background: If the MWE below is saved as "TeX-SE.tex", I can use the following command line to define the value of \MyCommandViaDef pdflatex "\def\MyCommandViaDef{123} \input{TeX-SE.tex}" and things work as desired: When I need to define a more complicated command that contains file names with dashes, using \def is no longer an option. I realize I can use pdflatex "\def\MyCommandViaDef{123} \expandafter\def\csname MyCommand Via Csdef\endcsname{xyz} \input{TeX-SE.tex}" to obtain the desired results but using a \csdef{}{} such as would be preferrable. pdflatex "\def\MyCommandViaDef{123} \csdef{MyCommand Via Csdef}{xyz} \input{TeX-SE.tex}" Code: \documentclass{article} \usepackage{etoolbox} \begin{document} Value via def: \MyCommandViaDef \ifcsdef{MyCommand Via Csdef}{% Value via csdef: \csuse{MyCommand Via Csdef} }{% Value via csdef: Not Available }% \end{document}

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

  • Beamer: What else is possible besides blocks?
    by Gudrun on September 10, 2025 at 10:00 pm

    for a beamer presentation I have 4 blocks with itemize env next to each other. I was wondering if there is a more interesting design for the blocks. I thought about 4 puzzle pieces connected. But I don't know how to connect the puzzle pieces automatically nor how to place an itemize env in one piece. Or how to have a better design? The pieces will stretch probably with more items/text, but that is fine for me. Some irregular puzzle. I prepared a MWE \documentclass{beamer} \usetheme{Madrid} \useoutertheme{shadow} \useoutertheme{infolines} \useoutertheme[subsection=false]{miniframes} \usepackage{jigsaw} \begin{document} \section{Section1} \begin{frame} \frametitle{Title1} \framesubtitle{Subtitle1} %Idea is to have 4 puzzle pieces connected to each other. %Each has a short title, maybe with a line break % All of them are connected %Suggested packages: https://github.com/samcarter/jigsaw %https://github.com/cpierquet/latex-packages/tree/main/thematicpuzzle \begin{columns}[T,onlytextwidth] \begin{column}{\textwidth} \begin{columns}[T,totalwidth=\textwidth] % Block 1 \begin{column}{0.23\textwidth} \begin{block}{Block 1 Block 1 extended} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \hfill % Block 2 \begin{column}{0.23\textwidth} \begin{block}{Block 2} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \item item4 \end{itemize} \end{block} \end{column} \hfill % Block 3 \begin{column}{0.23\textwidth} \begin{block}{Block 3} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \hfill % Block 4 \begin{column}{0.23\textwidth} \begin{block}{Block 4} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \end{columns} \end{column} \end{columns} \begin{center} The take home message \end{center} \includegraphics[height=0.3\textheight]{example-image-duck} \end{frame} \begin{frame} \frametitle{Title2} Multiple items will stretch the jigsaw piece in vertical direction, but that is fine. \begin{tikzpicture} \path (2,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 1 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={1}{1}{0}{0}}; \path (5.5,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 2 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{-1}}; %How to autoconnect the pieces? \path (9,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 3 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{1}}; \path (12,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 3 Could one also have a tiny image inside? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{1}}; \end{tikzpicture} \end{frame} \end{document}

  • Can I print \ShowCommand's output to the document?
    by schtandard on September 10, 2025 at 3:18 pm

    In classic TeX, there are two commands for inspecting the definition of a macro \show prints the macro name and definition to the .log file (and the interactive console). \meaning outputs the macro definition (but not the name, sadly) directly to the document. Now, for macros that do any preprocessing of their arguments, like detecting optional arguments, (or that do other fancy stuff) the actually interesting code is often obscured by several layers of helper macros. This is true for any command created using \NewDocumentCommand. LaTeX provides \ShowCommand for this reason, which bypasses all the noise and prints the command name and definition to the log file, i.e. it does \show on the relevant macro (along with info on the argument types). As far as I can tell, there is no similar equivalent to \meaning. While \show as advantages in some cases, \meaning often works better in my workflow for quick checks, as I have the .pdf output open in my editor while I do not usually have the .log file at hand. Can I (conveniently) typeset the output of \ShowCommand somehow? Not sure an MWE is helpful, but here is one. \documentclass{article} \usepackage[T1]{fontenc} \NewDocumentCommand\test{mm}{Testing #1 and #2 as a test.} \begin{document} \show\test \meaning\test \ShowCommand\test \end{document}

  • Avoid hyperref to affect line spacing
    by ariel on September 10, 2025 at 1:39 pm

    I have this document structure: \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[margin=1in]{geometry} \usepackage{tabularx} \usepackage{booktabs} \usepackage{etoc} %\usepackage{hyperref} \etocsettocstyle{}{} % Section entries: no number, normal font, dotted leaders \etocsetstyle{section}{}{}{\noindent\normalfont\etocname\dotfill\etocpage\par}{} \setcounter{tocdepth}{1} \begin{document} % no title, no space before/after ToC \begin{tabularx}{\textwidth}{X|X} \toprule Author & Luke Skywalker \\ \midrule Company & Star Wars Inc. \\ \midrule Role & Jedi Knight \\ \midrule Contents & \tableofcontents \\ \bottomrule \end{tabularx} \section{Section Title 1} Section 1 content goes here. \section{Section Title 2} Section 2 content goes here. \section{Section Title 3} Section 3 content goes here. \end{document} That produce this look that i like: However, if i want the table of content to be clickable, i can uncomment \usepackage{hyperref}. Unfortunately, doing so will disalign the toc with the other column: How can i avoid hyperref to interact with the line spacing (At least in the context of the toc)?

  • How can I draw a simple three dimensional coil?
    by Desiree on September 10, 2025 at 10:46 am

    I would like to draw something like this using tikz: So far, I only managed this: using the following code: \documentclass[tikz]{standalone} %\usetikzlibrary{decorations} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture} \draw[thick,decoration={aspect=0.3, segment length=3mm,amplitude=1cm,coil},decorate] (0,3) -- (0,0.15); \draw[thick] plot[smooth , tension=2] coordinates {(0,3) (-2.5,1.5) (0,0.15)}; \end{tikzpicture} \end{document} Is there a simple way to add the white gaps so that the coil looks three dimensional? Thanks in advance for your help!