Week
- Best way to break up long equation to fit the IEEE format (double column)by Joar Bertholdsson on January 16, 2026 at 12:41 pm
I have a very long equation where the fraction line spans the whole equation, which makes it fit poorly in the IEEEtran format! Below is an image of the equation(s) in question, along with the current code I am using. Feel free to think creatively for a solution, I am open to almost anything. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsthm} \usepackage{geometry} \usepackage{empheq} \geometry{margin=1in} \begin{document} \begin{empheq}[left=\empheqlbrace]{alignat=2} \label{eq:EOM} &\ddot x_w &= \frac{ \dfrac{k_t}{R_m}V_m - \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) - r_w m_b l_b\!\left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) }{ \dfrac{I_w}{r_w}+r_w m_w + r_w m_b }, \\ &\ddot\theta_b &= \frac{ - \dfrac{k_t}{R_m}V_m + \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b }{ I_b + m_b l_b^{2} }. \end{empheq} \end{document} Any help would be awesome Edit: Its my first time working with the IEEEtran format but for this questions, it is just a double-column format. More information can be see here: https://www.overleaf.com/latex/templates/ieee-conference-template/grfzhhncsfqn Furthermore, I have updated the code above so that it's compilabl,e and below is a link to my set of equations in a IEEEtran document: https://www.overleaf.com/read/sqrtfcwfjygr#70ecc2 Edit 2: Three different "solutions" can be see in the image below, its probably best to drop the curly bracket and use ´\multline´: Here is the code to recreate the image above: \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage{mathtools} \usepackage{empheq} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \begin{verbatim} \splitfrac \end{verbatim} \begin{empheq}[left=\empheqlbrace]{align} \ddot{x}_w &= \frac{ \splitdfrac{ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) } }{ \frac{I_w}{r_w} + r_w (m_w + m_b) } \label{eq:EOM_xw} \\[1em] \ddot\theta_b &= \frac{ \splitdfrac{ -\frac{k_t}{R_m}V_m + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ + m_b l_b g \sin\theta_b - m_b l_b \ddot{x}_w \cos\theta_b } }{ I_b + m_b l_b^{2} } \label{eq:EOM_thetab} \end{empheq} Fraction and multline\\ \begin{empheq}[left=\empheqlbrace]{align} \begin{split} \ddot x_w &= \frac{1}{\frac{I_w}{r_w} + r_w (m_w + m_b)} \Bigg[ \frac{k_t}{R_m}V_m \\ &\quad - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{split} \label{eq:EOM_xw} \\[15pt] \begin{split} \ddot\theta_b &= \frac{1}{I_b + m_b l_b^{2}} \Bigg[ -\frac{k_t}{R_m}V_m \\ &\quad + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b \Bigg] \end{split} \label{eq:EOM_thetab} \end{empheq} Negative exponent and multline\\ \begin{multline}\label{eq:EOM_xw} \ddot x_w = \left( \frac{I_w}{r_w} + r_w (m_w + m_b) \right)^{-1} \\ \times \Bigg[ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{multline} \end{document}
- Drawing a porous sandwich beamby Tldi You on January 16, 2026 at 9:03 am
Can we reproduce this image in LaTeX Tikz? I try this \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{patterns,arrows.meta,decorations.pathmorphing} \begin{document} \begin{tikzpicture}[scale=1] %------------------------------------------------- % Common styles %------------------------------------------------- \tikzset{ block/.style={draw, thick, fill=orange!20}, caps/.style={draw, thick, fill=blue!40}, axis/.style={->, thick}, profile/.style={thick}, } %================================================= % (b) SD %================================================= \begin{scope}[xshift=0cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block with layered patterns \draw[block] (0,0.5) rectangle (4,4); % Internal layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.7) rectangle (4,4); \draw[pattern=crosshatch, pattern color=orange!70] (0,1.6) rectangle (4,2.7); \draw[pattern=grid, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,2.25) -- (0,5) node[above] {$z$}; % Right profile \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({6-cos(180*\z/((4-0.5)))},{\z}); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\max},\,\rho_{\max}$}; \node at (2,-0.6) {(b) SD}; \end{scope} %================================================= % (c) ASD %================================================= \begin{scope}[xshift=8cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block \draw[block] (0,0.5) rectangle (4,4); % Gradient-like pattern layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.5) rectangle (4,4); \draw[pattern=crosshatch dots, pattern color=orange!70] (0,0.5) rectangle (4,2.5); \draw[pattern=checkerboard, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,0.5) -- (0,5) node[above] {$z$}; % Right profile (asymmetric) % \draw[profile] % (4,4) .. controls (4.8,3.5) and (4.8,1.5) .. (4,0.5); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\min},\,\rho_{\min}$}; \node at (2,-0.6) {(c) ASD}; \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({1*(5-cos(45+(180*\z)/(2*(4-0.5)))))},{\z}); \end{scope} \end{tikzpicture} \end{document} Current result:
- In a standalone subpreamble, \newcommand not considered as already defined but acro's \DeclareAcronym considered as already definedby Denis Bitouzé on January 15, 2026 at 2:24 pm
Consider the following MCE (say test.tex): \begin{filecontents*}[overwrite]{subfile} \documentclass{article} \newcommand{\foo}{foo} \begin{document} \foo{} \end{document} \end{filecontents*} \documentclass{article} \usepackage[subpreambles]{standalone} \usepackage{acro} \begin{document} \input{subfile} \end{document} The generated test.sta file: contains \newcommand {\foo }{foo}), is loaded two times (see test.log), but no complaint regarding a command \foo already defined. By contrast, the following MCE (again, say test.tex): \begin{filecontents*}[overwrite]{subfile} \documentclass{article} \DeclareAcronym{cd}{short = CD , long = compact disc} \begin{document} \ac{cd}. \end{document} \end{filecontents*} \documentclass{article} \usepackage[subpreambles]{standalone} \usepackage{acro} \begin{document} \input{subfile} \end{document} fails to compile at the 3rd run because of: (./test.sta ! LaTeX Error: Control sequence \g__acro_cd_pages_seq already defined. Do you understand why?
- Creating a label-reference system for asterisk/obelus symbols in LaTeX equationsby Samuel on January 15, 2026 at 12:16 pm
In LaTeX, I wish to use a sequence of asterisk/obelus symbols ($\dagger$, $\ddagger$, $\ast_1$, $\ast_2$, $\ast_3$, ... ) within my equations and then reference them later in the text. See the following example: \documentclass{article} \usepackage{amsmath} \begin{document} \noindent Here is a minimal example of an equation: \begin{equation} \label{eq:parallelogram_law_like_inequality} \begin{alignedat}{3} \langle a, a-b \rangle &= &\;& \|a\|^2 - \langle a, b \rangle \\ &\leq_{\dagger} & & \|a\|^2 - \langle a, b \rangle + \frac{1}{2}\|b\|^2 \\ &= & & \frac{1}{2}\|a\|^2 + \frac{1}{2}\Big(\|a\|^2 - 2 \langle a, b \rangle + \|b\|^2 \Big)\\ &=_{\ddagger} & & \frac{1}{2} \|a\|^2 + \frac{1}{2}\|a-b\|^2 \end{alignedat} \end{equation} where $\dagger$ follows from blar and $\ddagger$ is an application of the blah blah. \end{document} However rather than manually matching up the different *1, *2, *3, ..., I would like to use some syntax along the lines of \note\label{note:blar} and later \ref{note:blar}. This should automatically enumerate the notes in the order they appear and create a hyperref target and link similarly to how equation/figure/table references work. What is the neatest way to achieve this? Thanks!
- Primes in Latexby legogubben on January 15, 2026 at 10:18 am
I want to create a command \isthisprime{<number>} where it decides whether <number> is or is not prime, and if it is, it also returns the order of the prime (eg, 2 is the first, 3 is the second, and so on). Here is my attempt at a code (excuse my choice of naming the counters): \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \usepackage{lipsum,blindtext} \newcount\div \newcount\divs \newcount\somnum \newcount\yes \newcount\yess \newcount\numberofprimes \newcommand{\isthisprime}[1]{% %Decide if #1 is prime \div=2 \yes=0 \ifnum#1<2 \yes=1 \fi \loop \ifnum\div<#1 \ifnum#1=\numexpr(#1/\div)*\div\relax \yes=1 \fi \advance\div by 1 \repeat \numberofprimes=0 \somnum=2 \yess=0 \divs=2 %Checking every number less than or equal to #1 \ifnum\yes=0 \loop \ifnum\somnum<\numexpr#1+1\relax \loop%checking if somnum is prime \ifnum\divs<\somnum \ifnum\somnum=\numexpr(\somnum/\divs)*\divs\relax \yess=1 \fi \advance\divs by 1 \repeat \ifnum\yess=0 \advance\numberofprimes by 1 \fi \yess=0\divs=2\advance\somnum by 1 \repeat \fi \ifnum\yes=0 #1 is a prime with index~\the\numberofprimes. \else #1 is not a prime. \fi } \begin{document} \isthisprime{101}\newline \isthisprime{102} \end{document} The idea: the first part of the code decides whether or not <number> is a prime; if it is we set the counter \yes=1, otherwise it remains equal to 0. So if \yes=1 we check every number less than or equal to <number> to see if it is prime or not. At every occurrence of prime, we increase the counter \numberof primes. Hence \numberofprimes will determine the order of <number>, if it prime that is. The part where it decides whether or not the input is prime or not is fine. However, it cannot find its order. It just says that the order is 1 if the input is prime. It cannot see what is wrong with my code, so I would appreciate any advice! Thank you in advance.
- Is there a tool that translates LaTeX written with user-defined commands into standard LaTeX?by Steven Thomas Hatton on January 15, 2026 at 7:23 am
I have a (far from ideal) collection of macros that I \include in the preambles of my documents. It's very useful in giving my documents uniform semantic representation. For example, contravariant vector component functions all have a common appearance which I control globally. The down-side to this is that when I want to post an except to math.stackexchange.com, for example, I have to manually convert all of my LaTeX code into standard LaTeX which is independent of my preamble. Obviously the Tex-engine (e.g., lualatex) converts my macros into a form that TeX understands which is equivalent to standard LaTeX. Is there a tool that will take my customized LaTeX documents and convert them into standard LaTeX? Here's an example. (Please don't question the sanity of my notation. I have professionals for that.) \documentclass[a4paper,10pt]{article} \usepackage{amsmath} \newcommand{\CONST}[1]{\mathrm{#1}} \newcommand{\dd}{\CONST{d}} % differential d \newcommand{\DD}[2]{\frac{\dd#1}{\dd\CONST{#2}}} % derivative \newcommand{\PD}[2]{\frac{\partial #1}{\partial\CONST{#2}}} % partial derivative \begin{document} Written using my macros: \begin{align*} \dd f & = \PD{f}{x}\dd x + \PD{f}{y}\dd y.\\ \DD{f}{t} & = \PD{f}{x}\DD{x}{t}+\PD{f}{y}\DD{y}{t} \end{align*} What I want the tool to output: \begin{align*} \mathrm{d} f & = \frac{\partial f}{\partial \mathrm{x}} \mathrm{d} x + \frac{\partial f}{\partial \mathrm{y}} \mathrm{d} y.\\ \frac{\mathrm{d} f}{\mathrm{d}\mathrm{t}} & = \frac{\partial f}{\partial \mathrm{x}}\frac{\mathrm{d}x}{\mathrm{d}\mathrm{t}} +\frac{\partial f}{\partial \mathrm{y}}\frac{\mathrm{d}y}{\mathrm{d}\mathrm{t}} \end{align*} \end{document}
- No headings in index for words starting with umlauts (pdflatex)by Hakan on January 14, 2026 at 7:44 pm
When I turn on headings for entries in index, I get the following error: ! LaTeX Error: Invalid UTF-8 byte sequence (�\check@icr). This is a minimal tex file: \documentclass{scrbook} \usepackage{splitidx} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \makeindex \newindex[Index of Fruits]{fru} \begin{document} \sindex[fru]{Äpfel} \sindex[fru]{üzüm} \printindex[fru][Index of Fruits] \end{document} This is a minimal style file: headings_flag 1 heading_prefix "{\\textbf{" heading_suffix "}}\\nopagebreak\n" If I set headings_flag to 0 in the style file, I get no error messages. But the entries in index don't get headings in this case. In order to reproduce the same error, follow these steps: pdflatex file.tex splitindex file.idx -- -s style.ist pdflatex file.tex There is a similar question, which has no accepted answer. Index category for umlauts
- How to underline a tagged parbox?by Teepeemm on January 14, 2026 at 7:20 pm
I have answer blanks on an exam, and then I like to fill them in with the answers. Because the answer may need to be a displayed equation, I put it all in a parbox that gets underlined. This all works fine, until I try to enable tagging, at which point the displayed equation causes "Package tagpdf Error: The number of automatic begin and end text para hooks differ!" Is there a tagging friendly way to underline a parbox? \DocumentMetadata{lang=en-US,tagging=on} \documentclass{article} \begin{document} 1. \underline{\parbox{1in}{~}}\par 2. \underline{\parbox{1in}{\makebox[1in]{}}}\par 3. \underline{\parbox{1in}{okay}}\par 4. \underline{\parbox{1in}{$okay$}}\par 5. \underline{\parbox{1in}{\[not~okay\]}} \end{document}
- Strange behavior of a counter using siunitx, mathtools and array (2025)by Watson on January 14, 2026 at 7:17 pm
Consider the following piece of code (MWE): \documentclass{article} \usepackage{siunitx} \usepackage{mathtools} \newcounter{A} \setcounter{A}{1} \begin{document} $\begin{array}{c} \text{\arabic{A}:} \text{\arabic{A}\stepcounter{A}:} \text{\arabic{A}\stepcounter{A}:} \text{\arabic{A}\stepcounter{A}:} \text{\arabic{A}\stepcounter{A}:} \end{array}$ \end{document} Compiling with the 2025 TeX distribution, it produces the following output: 1:2:6:10:14 which is very unexpected, since I just increment the counter A once by line. On the other hand: Compiling with the 2024 or 2023 TeX distribution yields the expected output 1:2:3:4:5 The expected output is also obtained if we swap the two line \usepackage{siunitx} and \usepackage{mathtools}. Can anyone explain this strange behavior to me?
- Making geometric frieze (pattern) with tikzby Erwan on January 14, 2026 at 9:11 am
i'm trying to do some geometric frieze with tikz. The last goal is to do a command to draw one of the 7 possible frieze (see wikipedia). But, first, i just do 1 frieze. Results: My code: \documentclass[tikz]{standalone} \begin{document} \newcommand{\footstep}[4]{ \begin{scope}[ xshift=#3cm, %for translation yshift=#4cm, %for translation xscale=#1, %for reflexion yscale=#2 %for reflexion ] \draw (1, 3) -- (1, 0); \draw (1, 0) -- (7, 0); \draw (6, 3) -- (7, 0); \draw (6, 3) -- (5, 0); \draw (5, 0) -- (4, 2); \draw (4, 2) -- (2, 0); \draw (2, 0) -- (1, 3); \end{scope} } \begin{tikzpicture}[rounded corners=1pt, very thick, scale=.75] \draw[help lines] (0,-1) grid (22,5); \footstep{1}{1}{0}{0} \footstep{1}{-1}{7}{3} \end{tikzpicture} \end{document} but i have to find the parameters by myself. I'd like something automatic. Something like : xshift = "scope width" yshift = "scope height" Thanks
- Unable to enumerate in tagged lualatexby Miloop on January 14, 2026 at 7:12 am
I am trying to make an inline list using enumerate*, but it isn't working when trying to make a tagged document. I want the output to look like this: , but I am getting lonely item errors. Here is my minimal code that generates the error: \DocumentMetadata{lang=en-UK, tagging=on, pdfstandard=UA-2} \documentclass[a4paper,12pt,oneside]{book} \usepackage[inline]{enumitem} \begin{document} Therefore such ideas are expressed as: \begin{enumerate*}[label=(\roman*)] \item Suggestions \item Compulsions \item Delusions \item Pertrusions \item Overwhelming sense of righteousness \item Own by themselves where every entity is largely linked to another for its own survival. \end{enumerate*} \end{document} and here is the first bit of the the error in the .log: ! LaTeX Error: Lonely \item--perhaps a missing list environment. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.11 \item S uggestions Try typing <return> to proceed. If that doesn't work, type X <return> to quit.
- Acro package: Use long form for pdfcommentby miile7 on January 13, 2026 at 10:05 am
I am using the (awesome) acro package to manage my acronyms. Therefore, I want acronyms to be displayed in the pdf when hovering over them. acro supports this out of the box by using the pdfcomment package and the pdfcomments/use=true option. I always want to display the long form of the acronym, which is (in my case) always just text. So currently I'm using the following (for MWE see below): \DeclareAcronym{AI}{ short=AI, long=artificial intelligence, pdfcomment=artificial intelligence, } While this creates exactly the output I'm looking for (and I'll continue to use it, if not otherwise possible), it feels weird to insert the same text twice. As acro has served with perfect solutions to all my problems until now, I'm wondering whether there is a more elegant way to just use the long form for the pdf comments. Thank you in advance. Minimal Working Example (MWE): \documentclass{article} \usepackage{acro} \usepackage{pdfcomment} \acsetup{ pdfcomments/use=true, } \DeclareAcronym{AI}{ short=AI, long=artificial intelligence, pdfcomment=artificial intelligence, } \begin{document} Currently, the big thing is \ac{AI}. \end{document} Results in the following intended behavior:
- Put a text in the middle of a path move operation in Tikzby Harald on January 12, 2026 at 4:24 pm
I know how to use \draw (0,0) -- node[below]{X} (10,0); to put the text X in the middle below the line between the coordinates. What I would like to have is the very same, but without drawing the line, yet the following does not work (somewhat to my surprise :-/) \draw (0,0) node[below]{X} (10,0); I figured out a way involving node at ($ ...!.5!... $) yet \draw would sometimes be a bit more natural and I would in particular like to understand why it does not work, as I seem to miss some fundamental knowledge here.
- In ltx-talk make text body not vertically centeredby Jim Hefferon on January 12, 2026 at 3:44 pm
In ltx-talk the default is for body text to be vertically centered. How to instead make it display always starting from the page top? Vertical centering makes the text jump around when I use the \only<..>{} command. That is, how to achieve what in Beamer I get with \beamer@centeredfalse? Here is an MWE. Between slides 1 and 2 the first paragraph jumps up. \DocumentMetadata{tagging = on} \documentclass{ltx-talk} \usepackage{blindtext} \begin{document} \begin{frame} \frametitle{Frame title} \blindtext \only<2>\blindtext \end{frame} \end{document}
- Can no longer change BoldFont with New Computer Modernby mbert on January 12, 2026 at 3:13 pm
Until a recent update, the following example used New Computer Modern book weight in the first paragraph and Latin Modern demibold in the second paragraph (confirmed with an older texlive in Overleaf). After the update, the BoldFont setting no longer seems to work and New Computer Modern bold is used. \documentclass{article} \usepackage{fontspec} \usepackage{kantlipsum} \setmainfont{NewCM10-Book.otf}[ BoldFont=lmromandemi10-regular.otf, ] \begin{document} \kant[1][1-2] \bfseries \kant[1][1-2] \end{document} I know there was some recent discussion around NewCM defaulting to Harf mode and not being able to override this due to the provided .fontspec files. Did something change so that setting BoldFont is no longer possible? Note that if NewCM10-Book.otf is changed to another font, say TeX Gyre Pagella, then the example works as expected.
- breakage regarding thmtools and mdframedby DavidIsDumb on January 12, 2026 at 2:12 pm
So basically this time I was using overleaf again and came across this error: When I do \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{thmtools} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmblackbox,name=Blah,numbered=no]{bla} \declaretheorem[style=thmgreenbox,name=Blahblah,numbered=no]{blah} \begin{document} \begin{bla} \begin{blah} Blah blah blah blah blah \end{blah} \begin{proof} blah blah blah blah blah \end{proof} \begin{itemize} \item Blah blah blah blah blah \item Blah blah blah blah blah \end{itemize} \end{bla} \end{document} It breaks and gives me which is just weird. The “Blah.” should be at the very front of the black box while the “Proof” should be right below the green. Also there is no bullet point for the first item in itemize. Surprisingly, If I remove the Blahblah section (the green box) everything comes out normally! (The blahs are edited from some content in my actual file)
- Cyrillic script letter el with tailby moorooduc on January 11, 2026 at 11:19 pm
I am trying to typeset a text in the Khanty language, whose orthography uses the Cyrillic script. I know how to make Cyrillic script work in the book project, but Khanty has the letter Ӆ ӆ (that's a Cyrillic lower case "L" with a tail: https://en.wikipedia.org/wiki/El_with_tail). I don't find a way to typeset this correctly. Does anyone have advice?
- Why is my pgffor loop not iterating as expected? \foreach \i[parse=true] in {0,pi/18,...,2*pi-pi/18} {works \i\\}by Jasper on January 11, 2026 at 10:47 pm
Why is my pgffor loop not iterating as expected? \documentclass{article} \usepackage{pgffor} \begin{document} \foreach \i[parse=true] in {0,pi/18,...,2*pi-pi/18} {works \i\\} \end{document} It only prints the first two elements of the sequence, but not the rest. It does however work when I evaluate the numbers first: \documentclass{article} \usepackage{pgffor} \usepackage{pgfmath} \begin{document} \pgfmathsetmacro{\a}{pi/18} \pgfmathsetmacro{\b}{2*pi-\a} \foreach \i[parse=true] in {0,\a,...,\b} {works \i\\} \end{document} I would expect parse = true to do this for me. Am I mistaken?
- tikz: using the pos key to place nodes along a plotby Jasper on January 11, 2026 at 7:39 pm
In this tikz MWE, why is the node placement not even close to pos=0.7 on a plotted curve? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain = 0:2, samples = 100, variable = \y ] plot (\y*\y,\y) node[pos = 0.7, above left] {\(x=y^2\)} ; \end{tikzpicture} \end{document}
- Problem with \ifxby user209882 on January 11, 2026 at 6:32 pm
\def\drawDSID#1#2{ \def\trP{#2}\def\rpT{R}\def\trV{\ifx{\trP}{\rpT}3\else2\fi} \trV} The result is always 2, irrespective of #2, eg \drawDSID{(0,-7)}{R};
- label referencing problem in tcolorboxby mmjt on January 11, 2026 at 5:38 am
I am trying to use tcolorboxes to highlight exercises in a math tutorial (book document class) for a course I teach. I use a \label in the box hoping to reference the exercise by number in the solutions manual. However, the label does not "attach" to the colorbox; instead it returns the section number. Thus, Exercise "17" is referenced as "2.2.3" because that is the chapter section it is in. This behavior is different to that of a normal LaTeX environment and I am going in circles trying to resolve the issue. The tcolorbox manual is very detailed, but I cannot sort out this (seemingly) simple issue. What I want to accomplish is this: (1) create a box and put a \label{mylabel} in it. (2) \ref{mylabel} returns the box (exercise) number. (3) I want to reset the box numbering at the start of each chapter, with no "cross-talk" between the similarly numbered boxes in each chapter. I hope somebody can help restore my sanity and reveal the secret to doing this! Here is a MWE: \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{most} \begin{document} \section{Introduction} This document contains labeled tcolorboxes in Section \ref{sec:example}. The first box is numbered as \ref{box:label1}. \section{An Example Section} \label{sec:example} \newcounter{myboxcounter} \newtcolorbox[auto counter]{mybox}[1][]{ enhanced, colback=blue!5!white, colframe=blue!75!black, fonttitle=\bfseries, before title={\refstepcounter{myboxcounter}}, title={Exercise~\arabic{myboxcounter}\ifx#1\empty\else\ (#1)\fi}, fonttitle=\bfseries, breakable } \begin{mybox}[] \label{box:label1} This is box \ref{box:label1}. \end{mybox} \begin{mybox}[] \label{box:label2} This is box \ref{box:label2}. \end{mybox} \subsection{An Example Section} \begin{mybox}[] \label{box:label3} This is box \ref{box:label3}. The first two are boxes \ref{box:label1} and \ref{box:label2}. \end{mybox} \end{document}
- How get ISO math style with lua-unicode-math package?by murray on January 11, 2026 at 12:26 am
The commented-out line in the source below, if used instead of the line preceding it, produces ISO-style for upper-case Greek math letters, namely, Italic insead of upright. How does one get the same result with lua-unicode-math instead of just unicode-math? % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage{fontspec,lua-unicode-math} %\usepackage[math-style=ISO]{unicode-math} % Italic upper-case Greek math \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] \begin{document} $a, z, B, X, \quad \alpha, \beta, \Gamma, \Xi $ \end{document}
- How to move an equations system letter to midline height?by graograman on January 10, 2026 at 6:36 pm
I'd like to move the letter H below so it's at a midline height in between the two equations, please. Here's a MWE. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \left.\begin{matrix} \frac{x-h}{a}=\sec\theta\Rightarrow x-h=a\sec\theta\Rightarrow x=a\sec\theta+h \\ \frac{y-k}{b}=\tan\theta\Rightarrow y-k=b\tan\theta\Rightarrow y=b\tan\theta+k \end{matrix}\right\}\Rightarrow \mbox{\Huge$\mathcal{H}$:} \begin{matrix} x=a\sec\theta+h \\ y=b\tan\theta+k \end{matrix} \end{equation*} \end{document} This code produces the equations system thus:
- Redefine `$...$` to `\(...\)`by weisj on January 10, 2026 at 2:44 pm
The mathtools package can automatically insert italics correction when using \(...\) for inline math mode. See this answer. However, I much prefer $...$ for inline math as I find it more readable and comfortable to type on my keyboard layout. I am currently using the following hack to keep using the $...$ syntax while preserving the italics correction. \catcode`\$=13% \def$#1${\(#1\)}% I haven't had issues with it in my current document, but I was wondering whether there are reasons this might be a bad idea. I would image that if this was harmless the mathtools package would use it to also patch the $...$ syntax for the mathic feature. So my question is: Is this safe and are there any caveats I might be overseeing?
- Degree character breaks compilation with latex+dvipdfmx and fourier packageby user691586 on January 10, 2026 at 10:56 am
I have encountered a build breakage which I could reduce to the following document: \documentclass[dvipdfmx]{article} \usepackage{fourier} \begin{document} \thispagestyle{empty} \showoutput n°1 \end{document} After executing latex, the dvipdfmx step crashes $ dvipdfmx test test.dvi -> test.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx test I had a similar issue at some point with xelatex (not using dvipdfmx class option) while I was reducing from the real-life document but I could not reproduce it later on once reaching the above mwe, so it may have been a process error on my part. Examining fourier.sty I have reduced it to this even more minimal reproducer: \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} \thispagestyle{empty} \showoutput n°1 \end{document} $ latex testminimal.tex This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./testminimal.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-29> (/usr/local/texlive/202x/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/202x/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/fontenc.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/textcomp.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/t1futs.fd) (/usr/local/texlive/202x/texmf-dist/tex/latex/l3backend/l3backend-dvipdfmx.def) (./testminimal.aux) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/ts1futs.fd) Completed box being shipped out [1] \vbox(633.0+0.0)x407.0 .\glue 16.0 .\vbox(617.0+0.0)x345.0, shifted 62.0 ..\vbox(12.0+0.0)x345.0, glue set 12.0fil ...\glue 0.0 plus 1.0fil ...\hbox(0.0+0.0)x345.0 ....\hbox(0.0+0.0)x345.0 ..\glue 25.0 ..\glue(\lineskip) 0.0 ..\vbox(550.0+0.0)x345.0, glue set 539.94232fil ...\write-{} ...\glue(\topskip) 3.65001 ...\hbox(6.34999+0.0)x345.0, glue set 316.21002fil ....\hbox(0.0+0.0)x15.0 ....\T1/futs/m/n/10 n ....\TS1/futs/m/n/10 ? ....\T1/futs/m/n/10 1 ....\penalty 10000 ....\glue(\parfillskip) 0.0 plus 1.0fil ....\glue(\rightskip) 0.0 ...\glue 0.0 plus 1.0fil ...\glue 0.0 ...\glue 0.0 plus 0.0001fil ..\glue(\baselineskip) 30.0 ..\hbox(0.0+0.0)x345.0 ...\hbox(0.0+0.0)x345.0 (./testminimal.aux) ) Output written on testminimal.dvi (1 page, 256 bytes). Transcript written on testminimal.log. $ dvipdfmx testminimal.dvi testminimal.dvi -> testminimal.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx testminimal.dvi I am using TL2025, fully updated as of today. The problem goes away if one removes the ° character. The problem is not only one of that character it is also triggered by the \thanks macro. \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \title{A} \author{B\thanks{C}} \date{} \begin{document} \maketitle \end{document} $ dvipdfmx test2 test2.dvi -> test2.pdf [1Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. Abort trap: 6 dvipdfmx test2 Actually the culprit here is \textasteriskcentered. Same problem with \textdagger. \documentclass[dvipdfmx]{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} % A\textasteriskcentered % \ifcase#1\or \TextOrMath\textasteriskcentered *\or % \TextOrMath \textdagger \dagger\or % \TextOrMath \textdaggerdbl \ddagger \or % \TextOrMath \textsection \mathsection\or % \TextOrMath \textparagraph \mathparagraph\or % \TextOrMath \textbardbl \|\or % \TextOrMath {\textasteriskcentered\textasteriskcentered}{**}\or % \TextOrMath {\textdagger\textdagger}{\dagger\dagger}\or % \TextOrMath {\textdaggerdbl\textdaggerdbl}{\ddagger\ddagger}\else \textdagger \end{document} Same with xelatex. Use \documentclass{article} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand\rmdefault{futs} \begin{document} \textdagger \end{document} Then $ xelatex testxelatex This is XeTeX, Version 3.141592653-2.6-0.999997 (TeX Live 2025) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode (./testxelatex.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-29> (/usr/local/texlive/202x/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/202x/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/fontenc.sty (/usr/local/texlive/202x/texmf-dist/tex/latex/lm/t1lmr.fd)) (/usr/local/texlive/202x/texmf-dist/tex/latex/base/textcomp.sty) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/t1futs.fd) (/usr/local/texlive/202x/texmf-dist/tex/latex/l3backend/l3backend-xetex.def) (./testxelatex.aux) (/usr/local/texlive/202x/texmf-dist/tex/latex/fourier/ts1futs.fd) [1] (./testxelatex.aux)Assertion failed: (obj), function pst_string_release, file pst_obj.c, line 770. ) Error 6 (driver return code) generating output; file testxelatex.pdf may not be valid. Transcript written on testxelatex.log. (not so surprising as xelatex uses xdvipdfmx; and xelatex --no-pdf testxelatex compiles without error.)
- How to split the value of a macro into elements using LaTeX3?by lukascbossert on January 10, 2026 at 10:24 am
I would like to have separate values for the content of the macro. In the example below they should be considered as two elements (splitted at the ,). \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \seq_new:N \l_inst_seq \newcommand{\institutions}{ins1,ins2} \begin{document} \ExplSyntaxOn % Split the macro contents at commas \seq_set_split:Nnn \l_inst_seq { , } { \institutions } % Use the sequence Count:~\seq_count:N \l_inst_seq\par Items:~\seq_use:Nn \l_inst_seq {~|~} \ExplSyntaxOff \end{document}
- LaTeX enumeration: two-digit numbering with prefix (FR-01)by Markus M on January 10, 2026 at 10:21 am
I currently fail to create an referenceable enumeration in LaTeX where each item is labeled and numbered with a fixed string prefix, and a two-digit number with leading zeros Example: FR-01, FR-02, FR-03, … References using \ref / \cref should reproduce the item prefix+number (e.g. FR-01). What already works This minimal example works for one-digit numbers: \documentclass[12pt,a4paper,twoside,openright]{scrbook} \usepackage{enumitem} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \begin{enumerate}[ label=\textbf{FR-\arabic*}, ref=FR-\arabic*, leftmargin=*, ] \item\label{fr:upload-data} The system shall allow a user to upload data. \end{enumerate} This task addresses \cref{fr:upload-data}. \end{document} This produces FR-1 This task addresses FR-1. What I want FR-01 This task addresses FR-01. My attempts to use commands such as \twodigits fail. Does anyone have a good solution and can help?
- How to tweak the distance of resistor's "+"/"-" label's vertical distance when `raised` is set?by Explorer on January 10, 2026 at 10:09 am
I have the following code: \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \ctikzset{voltage=raised}%<- \draw (0,0) -- ++(1,0) to[R=R,label distance=3pt, v=$\mathrm{u_R}$] ++(0,+3) -- ++(-1,0); \end{circuitikz} \end{document} However, I want the "+" and "-" to get closer with "u_R"(that is: shift "+" up and shift "-" down), I have tried shift and label distance and voltage/distance from node, but all failed, because they justs tweak the distance between the wire. It's hard for me to dig it out from the manual, is that exists elegant method?
- What is the symbol/macro for `$(\!\!)$` (symbol that looks like opening and closing paretheses that overlap each other)?by Dima Pasechnik on January 10, 2026 at 1:05 am
In 100+ years old algebraic geometry texts one sees notation like $(a(\!\!)A,B,C)^2=0$. How does one properly typeset $(\!\!)$ in (La)TeX? for some reason I can't seem to be able to post proper TeX here. Edited The symbol's usage and example screenshot is shown in x-post at here and in the comment:
- How to improve graphs of functions of two variables with jagged edges in pgfplots?by orion2112 on January 9, 2026 at 10:19 pm
In the spirit of creating "beautiful plots" of functions of two variables, I am reaching out to this community to try and find possible improvements in the way I have been using pgfplots and \addplot3. Here are 3 attempts at graphing the paraboloid $f(x,y)=x^2+y^2$. Attempt 1: plotting {x^2+y^2} in cartesian coordinates with no restriction on the z domain yields a plot that "hides part of itself" and doesn't readily show the "bowl" shape we all love: \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Smooth and ugly} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, domain=-3:3, y domain=-3:3, opacity=0.5 ] {x^2+y^2}; \end{axis} \end{tikzpicture} \end{document} Attempt 2: adding the "restrict z to domain=-3:3" option, but this produces a very jagged top edge to the paraboloid, and not a nice smooth circle. Adding samples reduces the jaggedness slightly but there is a limit to how many samples I can put before I get an error, and that isn't enough to get a smooth circle. \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Jagged edges at top} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, domain=-3:3, y domain=-3:3, restrict z to domain={-3:3}, opacity=0.5 ] {x^2+y^2}; \end{axis} \end{tikzpicture} \end{document} Attempt 3: using data cs=polar and a domain of 0:360 instead of -3:3 gets me to an acceptable graph that doesn't hide itself and that has a smooth border: \documentclass[tikz,12pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{colorbrewer} %For the colormap \begin{document} \begin{tikzpicture} \begin{axis}[ axis line style={very thick}, axis on top=false, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, zlabel style={rotate=90}, xtick={-3,-2,-1,0,1,2,3}, ytick={-3,-2,-1,0,1,2,3}, ztick={-3,-2,-1,0,1,2,3}, tick label style={font=\scriptsize}, no marks, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-3, zmax=3, view={130}{30}, title={Not jagged, but polar coords} ] \addplot3[ surf, samples=40, colormap/PuBu-9, shader=flat, data cs=polar, domain=0:360, y domain=-3:3, restrict z to domain={-3:3}, opacity=0.5 ] ({x},{y},{y^2}); \end{axis} \end{tikzpicture} \end{document} Problem solved? Not really. What if now I want to plot f(x,y)=x/(y-x)? If done in cartesian coordinates without restricting the z domain, the graph "hides itself". If done in cartesian coordinates and restricting the z domain, some of the edges are jagged. For instance: (I seem to notice that if the mesh line is parallel to one of the "walls" of the plot box, there is no jagged edge, but if a "square" of the mesh is outside the z domain, the whole square is erased, and not just the part that is outside the z domain). And here I don't see how polar coordinates would be usable to bypass that problem. "But, this is not a nice function, of course the graph will be ugly". Fair enough, but seeing that Desmos does it instantly and even allows you to rotate the plot smoothly, I was hoping that maybe it's possible to do better here: So, is there anything that can be done about this? Am I using this wrong? Or is it just a limitation of plotting surfaces in LaTeX? Thanks in advance for all the insight. Note: I am aware of the topic here and that it seems there are only rectangular (and not triangular) surface elements, but I am not sure the issue is the same nor how \clip and \begin{scope} were used to fix the issue. If this is the way to go, can someone explain what those commands do exactly?