Week
- Is there a "hook" to expand a macro after the end of a path in TikZ?by Rmano on January 18, 2026 at 7:33 pm
I am adding a new feature to circuitikz to simplify the usage of "user-defined" voltages (and currents and "flow"s). The question is not specific to circuitikz, although the MWE is — sorry for the complication. If I manage a smaller MWE I'll post here. The basic question is: when a TikZ \path command is processed (and a \draw, etc., which are basically the same), is it possible to add a hook to be expanded at the end of it? I mean, after the final ; is found. In the following MWE, I would like to add some code to the addcall key so that I do not need to add the final \DoAdvVoltage. Ideally, the macro should be called after each path is finished, but calling it before of the end of the environment wold be acceptable. The solution should be engine-independent (well, it should work in the engines supported by TikZ). \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[RPvoltages]{circuitikz} % just an example \ctikzset{voltage=raised, !v sym/.style={no v symbols}} \newcommand{\placesigns}[2]{% place the +- signs at a fixed distance \path (#1voltage.center) ++(-\ctikzgetdirection{#1}:0.5cm) node[]{$+$}; \path (#1voltage.center) ++(180-\ctikzgetdirection{#1}:0.5cm) node[]{$-$}; } % add a command queue to circuitikz \makeatletter \gdef\local@voltages{} \def\addcommand#1#2{%add to \commands the macro \#1{nodename}{#2} \begingroup \edef\@@name{\ctikzvalof{bipole/name}} \edef\@@temp{% \noexpand\pgfutil@g@addto@macro\noexpand\local@voltages{% \expandafter\noexpand\csname #1\endcsname {\@@name}{#2}% }% }% \@@temp \endgroup } \def\DoAdvVoltages{\local@voltages\relax\gdef\local@voltages{}} \makeatother % This works, but just for LaTeX (or not?) % Moreover, I'd like to add this from the addcall keys, so that % I don't call it for *every* tikzpicture! % \AddToHook{env/tikzpicture/end}{\DoAdvVoltages} \ctikzset{addmyv/.style = {v={#1}, !v sym, addcall={#1}}} \ctikzset{addcall/.code ={\addcommand{placesigns}{#1}}} \begin{document} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \DoAdvVoltages \end{tikzpicture} \end{document}
- "Not in outer par mode" errors on intermediate compilations that resolve on later passesby RLH on January 18, 2026 at 7:07 pm
I have a long document (600+ pages) that has been using \clearpage and \afterpage to force some page breaks and figure placement, and breakable tcolorboxes as example environments. This document occasionally gets into states where a fresh compile of the document completes without errors, the second compilation fails with ! LaTeX Error: Not in outer par mode. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.128 \clearpage and the third and subsequent compilations succeed. Based on comments on my closed question \clearpage causes "not in outer par mode error" on second pass, I've found ways to reduce the use of \afterpage and to use non-float objects that otherwise behave like figures when I do need \afterpage, and have also tracked down my specific problem to an interaction between Floats in afterpage. Special footnote handling that uses shipout to move the footnote outside of the box. The presence of a long table of contents. (see demonstration code below) -- While I now understand more about what source-code patterns can produce these errors, I would stil like to better understand how the processing of the document leads to the specific error behavior. The error message (and other documentation of when the error is expected to appear) seems to indicate that the compiler is reading a \clearpage command at a point in the document which some internal state variable registers as being inside of a float. Combined with this error appearing on the second pass (when the TOC moves pages around) and its absence if the \tableofcontents call is removed, a parsimonious interpretation would be that either the location of the page breaks forced by \clearpage or the page numbers on which the floats appear are being retained from the previous pass, and so are triggering the error, even though \clearpage command does not appear inside float environment in the source code. Once the page locations have stabilized, the error goes away. Comments on my previous question suggested that this is not the correct model for how the error plays out at compilation time. What is a better way to understand the behavior of these kinds of errors that show up on intermediate compilations, but go away if I compile enough times? -- Code for generating the kind of errors that I'm encountering. This document should compile successfully on the first pass, error three times on the second and third passes, and then compile correctly on subsequent passes. \documentclass[11pt]{book} \usepackage{afterpage} \usepackage[many]{tcolorbox} \tcbuselibrary{magazine} % Not directly relevant here, but gets me a foreach function for the examples %%%%%%%% %%%%%%%% % Code for typesetting footnotes from tcolorboxes outside of the box, and in the main footnote sequence \newif\iffootaux \newcounter{footaux}% for \csname \newcounter{auxpage}% to handle frontmatter etc. \setcounter{auxpage}{1} \makeatletter \def\footnoteaux{\@ifnextchar[\@xfootnoteaux{\stepcounter{footnote}% \footnotemark[\thefootnote]\@footaux[\thefootnote]}} \def\@xfootnoteaux[#1]{\footnotemark[#1]\@footaux[#1]} \def\footaux{\@ifnextchar[\@footaux{\@footaux[\thefootnote]}} \def\@footaux[#1]#2{\protected@write{\@auxout}{\let\theauxpage\relax}{\string\newfootnote{\theauxpage}{#1}{#2}}} \newcommand{\newfootnote}[3]{% #1 = \theauxpage, #2 = \thefoontnote, #3 = text \ifnum#1=1\relax \footnotetext[#2]{#3}% \else \stepcounter{footaux}% \expandafter\xdef\csname footauxpage\thefootaux\endcsname{#1}% \expandafter\xdef\csname footauxnumber\thefootaux\endcsname{#2}% \expandafter\protected@xdef\csname footauxtext\thefootaux\endcsname{#3}% \fi} % to run at the end of every page (debug version) \newcommand{\addfootaux}{\loop \@ifundefined{footauxpage\thefootaux}{\footauxfalse}{% \count1=\csname footauxpage\thefootaux\endcsname\relax \advance\count1 by -1 \ifnum\count1=\value{auxpage}% \expandafter\let\expandafter\footauxnumber\csname footauxnumber\thefootaux\endcsname \expandafter\let\expandafter\footauxtext\csname footauxtext\thefootaux\endcsname \footnotetext[\footauxnumber]{\footauxtext}% \footauxtrue \else \footauxfalse \fi} \iffootaux \global\expandafter\let\csname footauxpage\thefootaux\endcsname\relax \global\expandafter\let\csname footauxnumber\thefootaux\endcsname\relax \global\expandafter\let\csname footauxtext\thefootaux\endcsname\relax \stepcounter{footaux}% \repeat \stepcounter{auxpage}} \makeatother \AtBeginDocument{\setcounter{footaux}{1}}% reset counter after \newfootnote \AddToHook{shipout/after}{\addfootaux} %%%%%%%% %%%%%%%% \newtcbtheorem[number within=section, number freestyle={\noexpand\thesection.\noexpand\arabic{\tcbcounter}}]{example}{Example}{ detach title, before upper={\tcbtitle.\quad \let\footnotetext=\footaux \let\footnote=\footnoteaux }, enhanced jigsaw, sharp corners, frame hidden, lines before break=4, borderline west={.5pt}{3pt}{black}, right=0pt, toprule=0pt, rightrule=0pt, bottomrule=0pt, leftrule=.5pt, colback=white, colframe=black, breakable=true, opacityback=0, colbacktitle=white, opacitybacktitle=0, coltitle=black, titlerule=0pt, fonttitle=\bfseries, parbox=false, label type=example, }{exp} % Demonstration text \usepackage{lipsum} % Credit to musarithmia for Sator square % https://tex.stackexchange.com/a/208857 % Retrieved 2026-01-17, License - CC BY-SA 3.0 \newcommand{\satorsquare}{ {\huge\bfseries%\hfil% \begin{tabular}{|c|c|c|c|c|} \hline S & A & T & O & R\\ \hline A & R & E & P & O\\ \hline T & E & N & E & T\\ \hline O & P & E & R & A\\ \hline R & O & T & A & S\\ \hline \end{tabular}}} \begin{document} \title{Afterpage hammering to cause crash} \maketitle \tableofcontents % Generate enough text that the table of contents moves things across pages \foreach \n in {1,...,35} { \section{C} \lipsum[\n]%\footnote{This is a footnote from outside an example} } % Generate progressively longer examples with afterpaged figures \foreach \n in {1,...,3} { \typeout{On Example \n} % Put a float into an afterpage \afterpage{ \begin{figure} {\centering \satorsquare{} \caption{figure}{This is a Sator square} \label{fig:onesatorsquare\n} } \end{figure} } % Force a clearpage \clearpage % Typeset text in a breakable tcolorbox \begin{example}{Example}{exp\n} \lipsum[1-3] \lipsum[\n-\n+\n] \end{example} } % Generate progressively longer examples with afterpaged figures and footnotes handled with shipout \foreach \n in {1,...,3} { \typeout{On Example 3+\n} % Put a float into an afterpage \afterpage{ \begin{figure} {\centering \satorsquare{} \caption{figure}{This is a Sator square} \label{fig:onesatorsquare\n} } \end{figure}} % Force a clearpage \clearpage % Typeset text in a breakable tcolorbox with a footnote that is placed outside the box \begin{example}{Example}{exp\n} \lipsum[1-3]\footnote{This is a footnote from inside an example} \lipsum[\n-\n+\n] \end{example} } \end{document}
- Inconsistent line thickness of \frac and \overline in PDF [closed]by The Little Blue Man on January 18, 2026 at 5:11 pm
My problem Some of the lines in the PDF of my LaTeX document are different thicknesses. This applies to lines generated using the commands frac, \overline and underline (I'm not sure about the latter). Sometimes the thickness is correct, and sometimes it is much too thick. The thickness varies throughout the document and depending on the zoom level. My main issue is that it persists after printing the document. This problem don't affect lines generated by \rule or \hline. Here is an example: Some details I use LuaLaTeX. I use TexLive on Linux. Here are the packages I use: % Mandatory: \usepackage[french]{babel} \usepackage{graphicx} % — Maths — \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{stmaryrd} % - Addition of the mathscr font \usepackage[scr]{rsfso} \usepackage{fontspec} \usepackage{unicode-math} % Misc \usepackage{comment} \usepackage{geometry} \usepackage{titlesec} \usepackage[shortlabels]{enumitem} \usepackage{calc} \usepackage{lipsum} I use Latin Modern Math as my math font. What I have tried I tried several things that did not solve the issue: redefining \frac with \genfrac{}{}{0.4pt}{} I also tried adding the line '\fontdimen3\textfont3=0.4pt' (on the order of ChatGPT). I tried changing the maths font. Code that generate the problem \documentclass[12pt]{article} \title{Test} % --- Mandatory --- \usepackage[french]{babel} % --- Maths --- \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{stmaryrd} \usepackage[scr]{rsfso} \usepackage{fontspec} \usepackage{unicode-math} % ---- Fonts --- \setmathfont{Latin Modern Math} \setmathfont{STIX Two Math}[ % Utilisation de STIX Two uniquement pour mathbb range=bb, Scale=MatchUppercase ] \setmathfont{STIX Two Math}[ % Utilisation de STIX Two uniquement pour \varnothing range={\varnothing}, Scale=MatchUppercase ] \setmathfont{rsfso10}[ % Utilisation de rsfso10 uniquement pour mathscr range=scr, Scale=MatchUppercase ] \begin{document} \begin{align*} \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \frac{a}{b} & & \overline{A} \\ \end{align*} \end{document}
- Reproducing figures with shaded half-planes in a gray square boxby Sebastiano on January 18, 2026 at 4:43 pm
I am trying to reproduce some images from old lecture notes, in particular notes by Prof. Gorni dating back to the 1993/94 academic year (pag. 4), or in other notes, like this picture At that time I had no knowledge of LaTeX at all. I do not know whether those figures were produced using PSTricks or with XFig/WinFig via psfrag, but my goal is to reproduce them in TikZ, correctly coloring the relevant half-planes. I am not completely sure whether it is possible (or appropriate) to modify the domain by introducing a square with a gray background or a path, but I have nevertheless quickly put together a minimal working example. \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{arrows.meta,decorations.markings,backgrounds} \usepackage{geometry} \geometry{margin=2.5cm} \begin{document} \begin{center} \begin{tikzpicture}[scale=1.5] \draw[->] (-0.2,0) -- (2,0) node[right] {$x$}; \draw[->] (0,-0.2) -- (0,2) node[above] {$y$}; \def\a{1.75} \begin{scope}[on background layer] \fill[gray!25] (-\a,\a) -- (\a,\a) -- (\a,-\a) -- (-\a,\a) -- cycle; \end{scope} \draw[thick,white] (-\a,-\a) rectangle (\a,\a); \draw[thick] (-1.5,1.5) -- (1.5,-1.5); \node at (-1.25,0.55) {$y=-x$}; \draw[thick] ({sqrt(2)},0) arc (0:90:{sqrt(2)}); \fill (0,{sqrt(2)}) circle (0.6pt); \fill ({sqrt(2)},0) circle (0.6pt); \node[left] at (0,{sqrt(2)}) {$\left(0,\sqrt{2}\right)$}; \node[below] at ({sqrt(2)},0) {$\left(\sqrt{2},0\right)$}; \end{tikzpicture} \end{center} \end{document} The problems I am facing (also because I have never attempted anything like this before) are the red rectangles (I wonder if there is a simple option to place the arc vector in a central position):
- How to return array from a command?by karu on January 18, 2026 at 10:07 am
How to return an array from a command? or rather How to expand a command to some generated array? The code below generates the correct array into \OutArray inside \Transmogrifier, but I don't know how to return it to calling \ResultArray. I know one option to access the values is to define an empty array, give the array as an argument to the command, have the command generate the elements to that array and access them when the command is finished. This is not what I am looking for. My question is more to expand my understanding and increase the tools I have in my disposal. \documentclass[tikz]{standalone} \begin{document} \newcommand*{\SomeOperation}[2]{% \fpeval{#1*#2}% }% \newcommand*{\Transmogrifier}[2]{% \pgfmathparse{dim(#1)}% or \pgfmathdim{#1}% \edef\ArrayLength{\pgfmathresult}% \xdef\OutArray{{}}% \foreach \i in {0,...,\fpeval{\ArrayLength-1}}% {% \pgfmathparse{array({#1},\i)}% or \pgfmatharray{{#1}}{\i}% \ifnum \i=0% \xdef\OutArray{\SomeOperation{\pgfmathresult}{#2}}% \else% \xdef\OutArray{\OutArray,\SomeOperation{\pgfmathresult}{#2}}% \fi% }% \xdef\OutArray{{\OutArray}}% How to "return" \OutArray? %\typeout{OutArray: \OutArray}% }% \begin{tikzpicture} \def\TestArray{{1,2,3}}% \typeout{TestArray: \TestArray}% \newcommand*{\ResultArray}{% \Transmogrifier{\TestArray}{2}% }% %\ResultArray% Temp for testing \typeout{ResultArray: \ResultArray}% \end{tikzpicture} \end{document} Desired outcome in the log file: TestArray: {1,2,3} ResultArray: {2,4,6}
- Indifference and budget curveby henry on January 18, 2026 at 8:26 am
I have a trouble to draw this diagram, could you guys help me please. This is my code: \begin{frame}{5.2.Child-care subsidy} \vspace{0.1cm} \centering \resizebox{0.95\textwidth}{!}{% \begin{tikzpicture}[scale=0.95, >=Stealth, font=\sffamily] % --- 1. HỆ TRỤC --- \draw[thick] (0,0) -- (0,6.5) node[above] {Income}; \draw[thick] (0,0) -- (6.5,0); \node[below left] at (0,0) {0}; \node[below] at (5.5,0) {$\longleftarrow$ Hours of Paid Work}; \coordinate (a) at (6.0, 0); \coordinate (c) at (6.0, 1.5); \coordinate (b) at (6.0, 3.0); \draw[thin, gray!30] (6.0, 0) -- (6.0, 3.2); \filldraw[black] (a) circle (1.5pt) node[right, font=\scriptsize] {$a$}; \filldraw[black] (c) circle (1.5pt) node[right, font=\scriptsize] {$c$}; \filldraw[black] (b) circle (1.5pt) node[right, font=\scriptsize] {$b$}; % Đường thấp d-c \coordinate (d) at (0, 4.0); \draw[thick, cyan!50] (d) node[left, black, font=\scriptsize] {$d$} -- (c); \coordinate (e) at (0, 5.5); \draw[thick, curveBlue] (e) node[left, black, font=\scriptsize] {$e$} -- (b); \coordinate (X) at (2.4, 3.0); \filldraw[black] (X) circle (2pt) node[below left] {$X$}; \coordinate (Y) at (3.6, 4.0); \filldraw[black] (Y) circle (2pt) node[above right] {$Y$}; \draw[thick, black] (0.6, 5.2) .. controls (1.2, 3.8) and (1.8, 2.9) .. (X) .. controls (3.2, 3.1) and (5.0, 2.5) .. (6.2, 4.0) node[right] {$U_1$}; \draw[thick, black] (1.5, 6.5) .. controls (2.2, 5.0) and (2.8, 3.9) .. (Y) .. controls (4.5, 4.1) and (5.5, 4.2) .. (6.2, 5.8) node[right] {$U_3$}; \draw[thick, black!70] (1.0, 6.0) .. controls (1.8, 4.5) and (2.5, 3.5) .. (3.1, 3.6) .. controls (4.0, 3.7) and (5.2, 3.5) .. (6.2, 5.0) node[right] {$U_2$}; \end{tikzpicture} } This is what i get:
- Any possible method to handle for-loop more smartly in tikz?by Explorer on January 18, 2026 at 7:31 am
I have the following codes to typeset following: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{decorations.pathreplacing} \ExplSyntaxOn \cs_new:Nn \__my_Aterm_tl:n { \tl_set:Nn \l_tmpa_tl { a \sb 1 } \int_step_inline:nnn {2} {#1} { \tl_put_right:Nn \l_tmpa_tl { + a \sb {##1} } } \tl_use:N \l_tmpa_tl } \NewDocumentCommand{\Aterm}{ m }{\__my_Aterm_tl:n{#1}} \ExplSyntaxOff \begin{document} \def\NN{5} \begin{tikzpicture} \foreach \i[evaluate=\i as \nexti using int(\i+1)] in {1,...,\NN}{ \draw (0,{-(\i-1)}) rectangle (\i,-\i); \ifnum\i<\NN\relax \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}-b_{\nexti}$} (\i,-\i); \else \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}$} (\i,-\i); \fi \draw[decorate,decoration={brace,mirror,amplitude=5pt}] (0,{-(\i-1)}) -- node[midway,below=3pt] { % $a_{\i}$ $\Aterm{\i}$ } (\i,{-(\i-1)}); } \end{tikzpicture} \end{document} It works! But the code looks not elegant, for the abrupt \ifnum and expl3-syntex(I have heard from that may cause unexpected result to mix tikz and expl3), is that possible to make good use of evaluate=<variable> as <macro> using <formula> or /remember=<variable> as <macro> (initially <value>)?
- Set xmp description for other languages tooby HerpDerpington on January 18, 2026 at 1:50 am
The xmp description can be set for example using hyperref: \DocumentMetadata{ lang=en-US } \documentclass{article} \usepackage{hyperref} \hypersetup{ pdfsubject={This will end up as the english subject.} } \begin{document} test \end{document} exiftool then reveals: Description : This will end up as the english subject. Description (en-US) : This will end up as the english subject. Language : en-US coming from the XMP block [...] <dc:description> <rdf:Alt> <rdf:li xml:lang="x-default">This will end up as the english subject.</rdf:li> <rdf:li xml:lang="en-US">This will end up as the english subject.</rdf:li> </rdf:Alt> </dc:description> [...] which seems to suggest that the Description may also be set for other languages. How can I for example set the description for something like de-DE?
- LaTeX macro to generate a centered grid of subfigures from a comma list (no gaps, equal widths, auto sublabels 1,2,3…)by taiwan12 on January 17, 2026 at 7:57 pm
I’m trying to define a LaTeX command that creates a figure containing multiple subfigures from a comma-separated list of image names. I’d like a macro with this interface: \multipleIMG{<images per row>}{<comma-separated list of image files>}{<main label>}{<main caption>} Requirements: Use the full available width (\linewidth). No horizontal and vertical gaps between images. Each row should be centered as a whole (even the last row if it’s not full). All images must have the same width (based on <images per row>). Create sublabels automatically as <main label>_1, <main label>_2, … (1, 2, 3, …). I’m using subcaption. I don’t want visible subcaptions, only labels for referencing (\phantomcaption is fine). Example input: \multipleIMG{3}{location-1,location-2,location-3,location-4,location-5}{fig:first}{Five Figure} This should produce 3 images in the first row, then 2 centered images in the second row, all with equal widths, and labels: fig:first_1, fig:first_2, fig:first_3, fig:first_4, fig:first_5 So that I can reference both the main figure and a subfigure like: \ref{fig:first}, \ref{fig:first_1} Here is an MWE showing the layout I want (hard-coded manually for 5 images). I want to replace this manual code with \multipleIMG. \documentclass{report} \usepackage[demo]{graphicx} \usepackage{subcaption} \usepackage[colorlinks=true]{hyperref} \begin{document} \begin{figure}[htbp] \centering \newlength{\imgw} \setlength{\imgw}{\dimexpr\linewidth/3\relax} \makebox[\linewidth][c]{% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_1} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_2} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_3} \end{subfigure}% } \vspace{-\baselineskip} \makebox[\linewidth][c]{% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_4} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_5} \end{subfigure}% } \caption{Five Figure} \label{fig:first} \end{figure} \ref{fig:first}, \ref{fig:first_1} \end{document}
- Insert in middle blank page with 2 columnsby miguel747 on January 17, 2026 at 5:26 pm
I'm having trouble inserting an image (Tikz) in the middle of a document that has two columns, and the second column is blank. Any tips? I replaced the \columnbreak (which only works with multicolumns and causes the error) with \newpage in \twocolumn mode, and added another \newpage after the block to start the next section on a new page. % ============================== % Codificação e fonte % ============================== \documentclass[a4paper,9pt]{article} \usepackage{lmodern} % Usa Latin Modern como base (compatível com fontes vetoriais) \usepackage{helvet} % Usa Helvetica \renewcommand{\familydefault}{\sfdefault} % Define sans-serif como padrão % ============================== % Formatação geral da página % ============================== \usepackage{geometry} % Define margens da página \geometry{top=2cm, bottom=2.7cm, left=1cm, right=1cm, headheight=62pt} \setlength{\footskip}{50pt} % Distância do rodapé até o fim da página \setlength{\parskip}{0pt} % Espaço entre parágrafos \setlength{\parindent}{1em} % Recuo no início dos parágrafos % ============================== % Cores (xcolor deve ser carregado antes do separador) % ============================== \usepackage[table]{xcolor} \definecolor{azulpetroleo}{HTML}{084D6E} \definecolor{verdeolivaclaro}{HTML}{E8F5E9} \definecolor{brancogelo}{HTML}{F8F9FA} \definecolor{BlueGreen}{HTML}{14BCBC} \definecolor{SkyBlue}{HTML}{4285F4} \definecolor{linhaFina}{HTML}{999999} % Cinza claro para linhas finas \definecolor{linhaGrossa}{HTML}{666666} % Cinza escuro para linha grossa % Layout de colunas com separador estilizado (três linhas em tons de cinza) \setlength{\columnsep}{28pt} % Espaçamento entre colunas % Customização do separador de colunas com três linhas verticais \makeatletter \renewcommand{\@outputdblcol}{% \if@firstcolumn \global\@firstcolumnfalse \global\setbox\@leftcolumn\copy\@outputbox \splitmaxdepth\maxdimen \vbadness\maxdimen \else \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% \hb@xt@\columnwidth{\box\@leftcolumn\hss}% \hfil % Separador de colunas: linha fina | linha grossa | linha fina {\color{linhaFina}\vrule width 0.4pt}% \hspace{1.5pt}% {\color{linhaGrossa}\vrule width 1.2pt}% \hspace{1.5pt}% {\color{linhaFina}\vrule width 0.4pt}% \hfil \hb@xt@\columnwidth{\box\@outputbox\hss}% }% }% \@combinedblfloats \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn \@whilesw\if@fcolmade\fi{\@outputpage\@startdblcolumn}% \endgroup \fi } \makeatother % ============================== % Pacotes para matemática % ============================== \usepackage{amsmath} \usepackage{amssymb} % Fornece \checkmark e outros símbolos matemáticos \usepackage{mathtools} \everymath{\rm} % Força fonte reta em expressões matemáticas % ============================== % Tabelas % ============================== \usepackage{array} \usepackage{multirow} \usepackage{tabularx} % xcolor já foi carregado anteriormente com cores definidas % ============================== % Listas % ============================== \usepackage[inline]{enumitem} % Permite listas inline e personalização de listas % ============================== % Bibliografia % ============================== \usepackage[backend=biber, style=authoryear]{biblatex} % Geração da bibliografia \addbibresource{bibliografia.bib} % Caminho do arquivo .bib % ============================== % Cabeçalho e Rodapé % ============================== \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Limpa cabeçalho e rodapé % Cabeçalho com imagem %\fancyhead[c]{ % \hspace*{-1.7em}\raisebox{0pt}{\includegraphics[height=1.11cm]{Imagens/Cabeçalho.jpeg}} %} \renewcommand{\headrulewidth}{0pt} % Remove linha de separação do cabeçalho % Defines a robust length for the footer indent %\newlength{\footerindent} %\setlength{\footerindent}{0.7\oddsidemargin} % Rodapé personalizado %\fancyfoot[l]{% % \noindent % \hspace*{\footerindent}% <-- Corrige o início da caixa com comprimento pré-calculado % \colorbox{azulpetroleo}{ % fundo azul % \parbox{\paperwidth}{ % caixa que ocupa toda a largura do papel % \vspace{7pt} % \hspace{3em}\textcolor{white}{\textbf{\large SIMULADO 01 -- CAIXA}}\\[-3em] % % \hspace{3em}\textcolor{white}{Engenharia Elétrica} % \hfill % \includegraphics[height=1.4cm]{Imagens/Projeto_100_Aprovação.png} % \vspace{9pt} % } % } %} \fancyfoot[C]{% \raisebox{8pt}{ \tikz[baseline=(char.base), yshift=15pt]\node[ draw=white, fill=azulpetroleo, text=white, line width=1pt, inner sep=6pt, minimum width=1.5em, minimum height=1.5em ](char){\thepage}; } } % ============================== % Outros pacotes úteis % ============================== \usepackage{setspace} % Permite configurar espaçamento entre linhas \usepackage{tikz} % Criação de gráficos vetoriais \usepackage{circuitikz} % Diagramas eletricos/eletroeletronicos \usepackage[most]{tcolorbox} % Caixas coloridas avançadas \usepackage{eso-pic} % Adição de elementos na página (como molduras) \usepackage{lastpage} % Conta número total de páginas \usepackage[switch*]{lineno} % Numeração de linhas na margem externa (não reduz largura do texto) % ============================== % Configuração de numeração de linhas nos textos % ============================== \renewcommand\linenumberfont{\normalfont\fontsize{7}{9}\selectfont\itshape\bfseries} % Números em itálico e negrito, tamanho 7 \setlength\linenumbersep{-20pt} % Espaço entre número e margem do texto \setlength{\linenumberwidth}{2em} % Largura reservada para os números % Redefinição para alinhar números à esquerda e exibir apenas múltiplos de 5 (exceto 0) \makeatletter \renewcommand\makeLineNumber{% % Verifica se o número da linha é múltiplo de 5 e diferente de 0 \@tempcnta=\value{linenumber}% \divide\@tempcnta by 5\relax \multiply\@tempcnta by 5\relax \ifnum\@tempcnta=\value{linenumber}% \ifnum\value{linenumber}>0% \hss\makebox[\linenumberwidth][l]{\linenumberfont\thelinenumber}\hskip\linenumbersep \fi \fi } \makeatother % Ambiente para textos com numeração de linhas (reinicia contagem automaticamente) % Exibe apenas múltiplos de 5 (5, 10, 15, 20...), omitindo o número 0 \newenvironment{textonumerado}{% \par \setcounter{linenumber}{0}% \begin{linenumbers}% }{% \end{linenumbers}% \par } % Redefinição do flushright para desativar numeração de linhas (usado nas referências) \let\oldflushright\flushright \let\oldendflushright\endflushright \renewenvironment{flushright}{% \nolinenumbers \oldflushright }{% \oldendflushright } \usepackage{float} % mater a imagem onde foi colocada \usepackage{pdfpages} % Inserir PDFs externos \usepackage{pifont} % Símbolos especiais como \ding{} % ============================== % Comandos para questões % ============================== % Comando para inserir questão com alternativas maiusculas (A) \newcommand{\questaoV}[2]{ \item #1 \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #2 \end{enumerate} } \newcommand{\questaoVtexto}[4]{ \item #1 \vspace{1em} #2 \vspace{1em} #3 \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #4 \end{enumerate} } %Questoes com alternativas na Horizontal \newcommand{\questaoH}[2]{ \item #1 \begin{enumerate*}[label=(\Alph*),itemsep=0.3em] #2 \end{enumerate*} } %Novo comando para questões com afirmativas e alternativas \newcommand{\questaoComAfirmativas}[4]{ \item #1 \begin{enumerate}[label=\Roman*.,itemsep=0.3em] #2 \end{enumerate} #3 %comando to da questão \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #4 \end{enumerate} } % ============================== % Ambiente Gabarito Box % ============================== \newtcolorbox{gabaritobox}{ enhanced, breakable, colback=brancogelo, colframe=brancogelo, arc=2mm, boxrule=0pt, left=6pt, right=6pt, top=6pt, bottom=6pt, fontupper=\itshape, colupper=SkyBlue, before upper={\noindent\raisebox{-0.3\height}{\includegraphics[width=16pt]{Imagens/gabarito.png}}\hspace{0.3em}\textbf{\normalfont COMENTÁRIOS:}\hspace{0.5em}}, overlay unbroken and first={} } % ============================== % Hyperref (deve ser carregado por último) % ============================== \usepackage[bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,colorlinks=true,linkcolor=black,urlcolor=blue,citecolor=black]{hyperref} % Necessário para \phantomsection e links \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%% NOÇÕES DE PROBABILIDADE E ESTATÍSTICA %%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage \begin{center} \subsection*{NOÇÕES DE PROBABILIDADE E ESTATÍSTICA} \end{center} \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] % =============================================== % QUESTÃO 26 - Telemetria e Esperança Condicional % =============================================== \questaoV{Em um sistema de telemetria de uma subestação, dois sensores binários são monitorados a cada instante: \begin{itemize} \item $X$: indica se houve detecção de evento (0 = não, 1 = sim); \item $Y$: indica se um alarme foi acionado (0 = não, 1 = sim). \end{itemize} As probabilidades conjuntas observadas são: \begin{align*} P(X=0 \text{ e } Y=0) &= \frac{1}{4} \\ P(X=1 \text{ e } Y=0) &= \frac{1}{8} \\ P(X=0 \text{ e } Y=1) &= \frac{1}{2} \\ P(X=1 \text{ e } Y=1) &= \frac{1}{8} \end{align*} Com base nessas informações, dado que $X=1$, o valor esperado de $Y$ é:}{ \item $\dfrac{1}{4}$ \item $\dfrac{1}{2}$ \item $\dfrac{1}{8}$ \item $\dfrac{1}{3}$ \item $\dfrac{3}{4}$ } % =============================================== % QUEST�O 27 - Media Geometrica % =============================================== \questaoV{Quando tres numeros reais, positivos e nao nulos formam uma progressao geometrica, dizemos que o termo do meio corresponde a media geometrica dos outros dois. Desse modo, qual e a media geometrica entre 28 e 252?}{ \item 84 \item 168 \item 882 \item 1.764 \item 3.528 } % =============================================== % QUESTÃO 28 - Análise de Dados do ENADE % =============================================== \end{enumerate} % Temporariamente muda para uma coluna para acomodar a tabela larga da Q28 \onecolumn \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] \questaoV{As questões do questionário socioeconômico foram tabuladas segundo as respostas dos ingressantes e dos concluintes e também segundo os dois grupos extremos (inferior e superior) de desempenho dos alunos da área no ENADE 2006. Esses grupos foram definidos pelos percentis de ordem 25 (P25) e 75 (P75). Os resultados relativos ao número de horas de estudo encontram-se na tabela a seguir. \textbf{Pergunta:} \textit{Quantas horas por semana, aproximadamente, você dedica/dedicou aos estudos, excetuando as horas de aula?} \begin{center} \begin{tabular}{|l|c|c|c|c|c|c|} \hline \textbf{Horas de estudo} & \multicolumn{3}{c|}{\textbf{Ingressantes}} & \multicolumn{3}{c|}{\textbf{Concluintes}} \\ \textbf{por semana} & P25 & P75 & Total & P25 & P75 & Total \\ \hline Nenhuma & 9,7\% & 4,6\% & 7,0\% & 12,7\% & 6,1\% & 9,3\% \\ \hline Uma a duas & 47,2\% & 29,7\% & 40,1\% & 46,8\% & 32,6\% & 40,4\% \\ \hline Três a cinco & 27,9\% & 35,1\% & 31,5\% & 25,7\% & 32,0\% & 29,8\% \\ \hline Seis a oito & 8,2\% & 15,6\% & 11,6\% & 7,9\% & 13,9\% & 10,7\% \\ \hline Mais de oito & 6,4\% & 14,7\% & 9,4\% & 6,3\% & 15,1\% & 9,5\% \\ \hline Sem informação & 0,6\% & 0,3\% & 0,4\% & 0,6\% & 0,3\% & 0,3\% \\ \hline \textbf{Amostra} & \multicolumn{3}{c|}{\textbf{38461}} & \multicolumn{3}{c|}{\textbf{27608}} \\ \hline \end{tabular} \end{center} Analisando-se as informações, conclui-se que: \textbf{I} -- a proporção de alunos que não estudam ou estudam no máximo duas horas por semana é maior no grupo de concluintes com desempenho inferior na prova; \textbf{II} -- pelo menos 12.000 alunos da área estudam mais de oito horas por semana; \textbf{III} -- a maioria dos alunos com desempenho superior, nos dois grupos, estuda de três a oito horas por semana; \textbf{IV} -- mais de 60,0\% dos alunos concluintes com desempenho superior na prova estudam, no mínimo, três horas por semana. Está(ão) correta(s) APENAS a(s) informação(ões):}{ \item I \item III \item I e IV \item I, II e IV \item II, III e IV } \end{enumerate} % Área de rascunho \vspace{0.5cm} \begin{center} \begin{tikzpicture} \node[opacity=0.3, rotate=45, scale=4, text=gray] {RASCUNHO}; \end{tikzpicture} \end{center} % Retorna ao layout de duas colunas \twocolumn \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] % =============================================== % QUESTÃO 29 - Probabilidade sem Reposição % =============================================== \questaoV{Em um treinamento operacional de uma agência bancária, a coordenação prepara um conjunto com 52 cartões, todos bem embaralhados, cada um contendo o nome de uma operação. Dentre esses cartões, 12 são de operações consideradas ``prioritárias'', distribuídas igualmente entre: \begin{itemize} \item Transferência (TED) \item Pix \item Cartão de Crédito \end{itemize} (isto é, 4 cartões de cada uma dessas operações, totalizando 12 cartões prioritários). Retiram-se 4 cartões ao acaso, sem reposição. Qual é a probabilidade de que todos os 4 cartões retirados sejam cartões prioritários (TED, Pix ou Cartão de Crédito)?}{ \item $\dfrac{141}{54145}$ \item $\dfrac{325}{62522}$ \item $\dfrac{82}{43131}$ \item $\dfrac{99}{54145}$ \item $\dfrac{11}{54145}$ } % =============================================== % QUESTÃO 30 - Medidas Estatísticas % =============================================== \questaoV{A tabela a seguir apresenta a distribuição dos clientes de uma determinada agência bancária classificados segundo o perfil do investidor em: conservadores, moderados e arrojados. \begin{center} \begin{tabular}{|l|r|} \hline \textbf{Classificação dos clientes} & \textbf{Frequência absoluta} \\ \hline \textbf{Total} & \textbf{11.000} \\ \hline Conservadores & 3.300 \\ \hline Moderados & 5.400 \\ \hline Arrojados & 2.300 \\ \hline \end{tabular} \end{center} Considere as medidas estatísticas: média, moda, mediana, variância e desvio padrão. Para análise da classificação dos clientes, é possível determinar a:}{ \item moda, apenas. \item média e a mediana, apenas. \item média, a moda e a mediana, apenas. \item média, a variância e o desvio padrão, apenas. \item média, a moda, a mediana, a variância e o desvio padrão. } \end{enumerate} \newpage % Preenche o restante da segunda coluna com marca d'água \vfill \newpage \begin{center} \begin{tikzpicture} \node[opacity=0.3, rotate=45, scale=4, text=gray] {RASCUNHO}; \end{tikzpicture} \end{center} \vfill \end{document}
- Exam Class (Hirschhorn) has different Itemize Spacings for the solution and the solutionbox Environmentsby Simon on January 17, 2026 at 10:32 am
I am working with the "exam" class by Philip Hirschhorn (version 2.704) and I am experiencing some trouble with the spacing of lists, itemize in my case, in solution environments. I see strong differences between the spacing in the "solutionbox" and the other solution environment but I am not proficient enough in lower level Latex or Tex to figure out the reason and potential solutions myself. I could make the lists behave the same by using "enumitem" with \setlist[itemize, 1]{nosep}. As far as I understand, this means that the list settings are actually changing between the different environments. I am interested in an explanation of the underlying mechanisms. Here is a minimum working example for you \documentclass[11pt, answers]{exam} \renewcommand{\solutiontitle}{% \textbf{Solution:}% \par% \noindent% } \begin{document} \textbf{Start of Document} \begin{questions} \question This is a solutionbox environment \begin{solutionbox}{5cm} The solution is either \begin{itemize} \item A \textbf{or} \item B \end{itemize} But it could also be C in a new paragraph. Or D in another new paragraph. \end{solutionbox} \question This is a solution environment \begin{solution} The solution is either \begin{itemize} \item Z \textbf{or} \item Y \end{itemize} But it could also be X in a new paragraph. Or W in another new paragraph. \end{solution} \end{questions} \textbf{End of Document} \end{document} You can see the difference in this screenshot montage it looks like the line spacing is identical but some lengths in the list environment are modified, such as \itemsep or \parsep The behavior of the solution environment is identical with the other solution environments (solutionorbox, etc.) as far as I see. The documentation says that the solutionbox environment is implemented differently from the other environments. I guess that this is part of the reason. Thanks in advance, Simon
- Hungarian clickable references with manual suffixesby taiwan12 on January 16, 2026 at 9:03 pm
I’m typesetting a document in Hungarian. Hungarian uses case suffixes / postpositions attached to the noun (e.g. ábra, ábrán, ábrára, táblázat, táblázaton), so I need to manually provide the inflected noun in running text. Additionally, I use the chemstyle package and I want scheme environments to behave like figures: same counter as figures (one shared sequence) same caption name (schemes should say “Ábra” in the caption, not “Scheme”) schemes should appear in the List of Figures This scheme/figure integration is already working; I include that code only because it’s part of the real setup. What I’m stuck on is a small helper macro for clickable references that lets me manually supply the Hungarian noun/suffix without duplicating it. \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} Desired output (whole text clickable) ábra ábrán táblázat táblázaton Current output (wrong: noun duplicated) ábra 1. ábra ábra 1. ábrán táblázat 1. táblázat táblázat 1. táblázaton Important: If I remove chemstyle (and the scheme-related unification code), then my referencing setup behaves as expected. The duplication issue appears only when chemstyle is loaded / schemes are involved. MWE \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage{chemstyle} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none, tablewithin=none]{caption} \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} \makeatletter % scheme and figure counter \let\c@scheme\c@figure \renewcommand{\thescheme}{\thefigure} % schemename caption figurename \renewcommand{\schemename}{\figurename} % scheme into lof \def\ext@scheme{lof} \let\l@scheme\l@figure \makeatother \begin{document} \tableofcontents \chapter{A} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figA} \end{figure} \begin{scheme} \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{schA} \end{scheme} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figB} \end{figure} \begin{table}[H] \centering \begin{tabular}{c|c} & \\ & \end{tabular} \caption{Caption} \label{tabA} \end{table} \myref[ábra]{figA}, \myref[ábra]{schA}, \myref[ábra]{figB}, \myref[táblázat]{tabA} \myref[ábrán]{figA}, \myref[táblázaton]{tabA} \clearpage \phantomsection \addcontentsline{toc}{chapter}{Ábrák jegyzéke} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{Táblázatok jegyzéke} \listoftables \end{document} MWE without chemstyle \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none, tablewithin=none]{caption} \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} \begin{document} \tableofcontents \chapter{A} \begin{figure}[h] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figA} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figB} \end{figure} \begin{table}[h] \centering \begin{tabular}{c|c} & \\ & \end{tabular} \caption{Caption} \label{tabA} \end{table} \myref[ábra]{figA}, \myref[ábra]{figB}, \myref[táblázat]{tabA} \myref[ábrán]{figA}, \myref[táblázaton]{tabA} \clearpage \phantomsection \addcontentsline{toc}{chapter}{Ábrák jegyzéke} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{Táblázatok jegyzéke} \listoftables \end{document}
- Is that possible to just fill=white for text in only one node?by Explorer on January 16, 2026 at 8:07 pm
I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \ExplSyntaxOn \keys_define:nn {mykey} { foo .tl_set:N = \l_tmpa_tl } \keys_set:nn {mykey} { foo = {O\quad K},%<- } \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \ExplSyntaxOff \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner sep=0pt] at (.7,0) {O}; \node[fill=white,inner sep=0pt] at (1.3,0) {K}; \end{tikzpicture} \end{document} For the sake of the template settings, the text O\quad K should be put as a token list, as a whole, but I need the third picture's result. Is that possible to just fill=white to just shade the "text area"? Edited: Since cfr commented for the original template case, I would provide more information. Claims: The original package is exam-zh package It depends on xeCJK, so xelatex is must I was not sure that whether it's CJK fonts settings works on every OS. See here. What I want, is to achieve something sealline style as below: It appeared in the leftmargin of exam paper: Now I have the following code: \documentclass{exam-zh} \usepackage{zhlipsum} % \ExplSyntaxOn % % Line 1487 in exam-zh.cls % % https://github.com/xkwxdyy/exam-zh/blob/main/exam-zh.cls#L1487-L1496 % \cs_set:Npn \__examzh_sealline_odd_text_around_line: % { % \node [ anchor = east ] % at ([xshift = -\g__examzh_sealline_odd_text_xshift_dim, yshift = \g__examzh_sealline_odd_text_yshift_dim]current~page~text~area.west) % { % \g__examzh_sealline_odd_text_format_tl % \__examzh_sealline_odd_spread_box:nn { \g__examzh_sealline_odd_text_width_dim } % { \g__examzh_sealline_odd_text_tl } % }; % } % \ExplSyntaxOff \examsetup{ sealline={ show=true, circle-show=false, line-type={loosely-dotted}, text={密封线},%<- the text here is put as `\g__examzh_sealline_odd_text_tl' text-format={\huge\bfseries}, line-thickness={2.5pt}, text-xshift={.375cm} } } \begin{document} \zhlipsum[name=zhufu] \end{document} That is the original case. Noted that 密封线, the l3keys sealline/text is put into \g__examzh_sealline_odd_text_tl ands \g__examzh_sealline_even_text_tl here(why I say as a whole). Which need to be processed by \__examzh_sealline_odd_spread_box:nn here. I want to change the present settings of exam-zh's setting code to the minimal extent.(Of course, I can type text={}, leave it empty, and follow \__examzh_sealline_odd_circle: here to draw multiple \node[fill=white] {密}s) But that change too much the package's setting. So, I simplified it to my origianl post😊.
- Best way to break up long equation to fit the IEEE format (double column)by TastyTurtle 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}
- Help me draw a labor supply diagramby henry on January 15, 2026 at 6:26 am
I'm trying to draw these two diagram in a slide but I cannot do it. Anyone can help me please. This is my previous code: \begin{frame}{Backward-bending Supply Curve} \vspace{0.1cm} \begin{columns}[T] \column{0.55\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=125, ymin=0, ymax=3200, xtick={70, 80, 90, 110}, ytick=\empty, xlabel={leisure ($L$)}, ylabel={consumption(\textdollar)}, ylabel style={rotate=90, at={(axis description cs:0.03,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, clip=false] \coordinate (E) at (axis cs: 110, 0); \filldraw[black] (E) circle (2.5pt) node[right, font=\footnotesize] {$E$}; \node[below, font=\scriptsize] at (axis cs: 110, -50) {}; \coordinate (P1) at (axis cs: 90, 260); \coordinate (P2) at (axis cs: 70, 800); \coordinate (P3) at (axis cs: 80, 750); \draw[lineBlue, thick] (axis cs: 0, 1430) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=13$}; \draw[lineBlue, thick] (axis cs: 0, 2200) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=20$}; \draw[lineBlue, thick] (axis cs: 0, 2750) -- (E) node[pos=0.15, right, font=\tiny, black] {$w=25$}; \draw[curveBlack, thick] (axis cs: 60, 800) to[out=-75, in=160] (P1) to[out=-20, in=170] (axis cs: 115, 120) node[right, font=\tiny] {$U_1$}; \draw[curveBlack, thick] (axis cs: 45, 1600) to[out=-80, in=145] (P2) to[out=-35, in=165] (axis cs: 105, 300) node[right, font=\tiny] {$U_2$}; \draw[curveBlack, thick] (axis cs: 60, 1600) to[out=-85, in=135] (P3) to[out=-45, in=170] (axis cs: 105, 200) node[right, font=\tiny] {$U_3$}; \draw[dashed, thin, gray] (P1) -- (axis cs: 90, 0); \draw[dashed, thin, gray] (P2) -- (axis cs: 70, 0); \draw[dashed, thin, gray] (P3) -- (axis cs: 80, 0); \filldraw[dotRed] (P1) circle (2pt); \filldraw[dotRed] (P2) circle (2pt); \filldraw[dotRed] (P3) circle (2pt); \draw[dotted, thick, black] (E) .. controls (100,100) .. (P1) .. controls (80, 500) .. (P3) -- (P2) node[above left, font=\tiny] {Expansion Path}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(a) Optimal bundles} \column{0.45\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=55, ymin=0, ymax=32, xtick={0, 20, 30, 40}, ytick={10, 13, 20, 25}, xlabel={Giờ làm việc ($H$)}, ylabel={Mức lương ($w$)}, ylabel style={rotate=90, at={(axis description cs:0.05,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, grid=major, grid style={dotted, gray!50}, clip=false ] \coordinate (S1) at (axis cs: 20, 13); \coordinate (S2) at (axis cs: 40, 20); \coordinate (S3) at (axis cs: 30, 25); \coordinate (S0) at (axis cs: 0, 10); \draw[lineBlue, very thick] (S0) to[out=10, in=-120] (S1) to[out=60, in=-90] (S2) % Đoạn dốc lên to[out=90, in=-20] (S3) % Đoạn vòng ngược to[out=160, in=-60] (axis cs: 25, 30); \filldraw[dotRed] (S1) circle (2.5pt); \filldraw[dotRed] (S2) circle (2.5pt); \filldraw[dotRed] (S3) circle (2.5pt); \filldraw[black] (S0) circle (2pt); \node[right, font=\scriptsize, color=lineBlue] at (axis cs: 30, 28) {Labor Supply}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(b) Labor supply} \end{columns} \end{frame}
- 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 DavidIsAqwerty 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)