• How to shrink with a certain amount of offset?
    by D G on May 14, 2026 at 1:09 pm

    I want a one cm offset between the blue path and the black one. \documentclass[tikz,margin=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[gray!50] (-8,0) grid (8,-8); \fill (0,0) node[above=12pt]{origin} circle (5pt); \draw[ultra thick] (-6,0) arc[x radius=12,y radius=8,start angle=90,end angle=0] -- (-6,-8) -- cycle; \draw[blue,ultra thick] (-5,-1) arc[x radius=10,y radius=6,start angle=90,end angle=0] -- (-5,-7) -- cycle; \end{tikzpicture} \end{document} Note: Both must be similar. Right now both are not similar.

  • How do I make the gate branch in the JFET transistor symbol centralised rather than to the bottom or top of the gate?
    by Vector on May 14, 2026 at 10:58 am

    I am trying to reproduce a specific transistor circuit image for an assignment. Using the stock circuitikz JFET symbol, I was able to reproduce the circuit fairly well. I am also quite satisfied with it. I am curious, however, if it is possible to make the gate closer to the center as it is in the image. I have looked through the documentation and the only plausible solution I can find is to create a new symbol however I am a bit stuck on how to go about that. The damper example in the documentation was not very clear. Here is the code, if it is needed. (I removed the voltmeter to keep the code copied compact.) \documentclass[border = 10pt]{standalone} \usepackage{amsmath} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[american, scale = 0.65] \ctikzset{ transistors/scale=1, capacitors/scale=0.7, resistors/scale=0.8 } % Transistor \draw (0,0) node[njfet, tr circle, anchor=S](Q){}; \draw(Q.G) to[short] ++(-2,0) to[short] ++(0, -2) node[ground] (G1) {}; \draw(Q.S) to[short] (Q.S |- G1) node[ground] {}; \coordinate (V_s) at ($(Q.D) + (1.5,0)$); \draw[-{Triangle[scale = 1.5]}](V_s) to[short] ++(-1.5,0) coordinate (Q.D); \draw (V_s)to [short](Q.S -| V_s); \draw[-{Triangle[scale = 1.5]}] (Q.S -| V_s) to[short] (Q.S); \draw(Q.D) to [short] ++ (0, 1.5) to[ammeter, v^<={\phantom{m}}] ++ (3.5,0) to[R, l_={$4.7\ \mathrm{k}\Omega$}, a^= {$R_D$}] ++(3.7,0) coordinate(C) to [battery, name = BDD, v_={\phantom{m}}, l^= {$V_\mathrm{DD}$}] (C |- G1) node[ground] {}; \ctikztunablearrow{1}{1}{135}{BDD} \end{circuitikz} \end{document} Here are the images;

  • Tikz: perpendicular line to intersect the x-axis
    by Tldi You on May 14, 2026 at 10:11 am

    I would like to draw a line starting from the point (200, 105.6), perpendicular to the failure envelope, and extending down to intersect the x-axis. I have implemented the following LaTeX/TikZ \documentclass[border=2pt]{standalone} \usepackage{pgfplots,siunitx} \pgfplotsset{compat=1.18} \usetikzlibrary{calc} \begin{document} \centering \begin{tikzpicture} \begin{axis}[ width=15cm, height=9.375cm, xmin=0, xmax=640, ymin=0, ymax=400, xtick={0,80,...,640}, ytick={0,80,...,400}, minor tick num=1, grid=both, grid style={black, thin}, minor grid style={black, thin}, xlabel={Contrainte normale ($\sigma_{nr}$), $kN/m^2$}, ylabel={Contrainte de cisaillement ($\tau_r$), $kN/m^2$}, axis line style={thick}, tick label style={font=\small}, label style={font=\small}, clip=false ] % Regression line: tau = 34 + sigma * tan(20) \addplot [domain=0:590, samples=2, thin, black] {34 + x*tan(20)}; % Data points on the line (open circles) \addplot [only marks, mark=o, mark size=3.5pt, fill=white, thin, black] coordinates { (100, 72.2) (200, 105.6) (300, 144.4) (400,177.7) }; % Solid dot and its label \node [circle, fill, inner sep=1.5pt] (dot) at (axis cs:320, 138) {}; \node [anchor=west, xshift=2pt] at (axis cs:320, 138) {\small (320, 138)}; % Perpendicular line from the 3rd circle (x=300) \coordinate (P) at (axis cs:200, {36 + 200*tan(20)}); \draw [very thick, black] (P) -- (axis cs:252.1, 0); % Right angle symbol \draw [very thick, black] ($(P) + ({-18*cos(20)}, {-18*sin(20)})$) -- ($(P) + ({-18*cos(20) + 18*sin(20)}, {-18*sin(20) - 18*cos(20)})$) -- ($(P) + ({18*sin(20)}, {-18*cos(20)})$); % Angle phi indicator \coordinate (phi_pt) at (axis cs:520, {34 + 520*tan(20)}); \draw [thin, black] (phi_pt) -- +(0.8cm, 0); \draw [thin, black] (phi_pt) +(0.5cm, 0) arc (0:20:0.5cm); % Box in top right \node [draw, thick, fill=white, align=center, inner sep=10pt] at (axis cs:520, 340) { $c = 34 \, kN/m^2$ \\ $\varphi = \ang{20}$ }; % Phi angle \coordinate (V) at (axis cs:520,223); \draw[thin] (V) -- ++(25pt,0); \draw[thin] ($(V)+(15pt,0)$) arc[start angle=0,end angle=20,radius=15pt]; \node[right] at ($(V)+(22pt,2pt)$) {$\varphi$}; \end{axis} \end{tikzpicture} \end{document} Do you have any suggestions or improvements? CURRENT RESULT:

  • Break point inadequate in nested boxes
    by Erwann on May 14, 2026 at 4:18 am

    In the code below, there are two \TitleBox environments inside a single \DocumentBox. I expected that when I add sufficient \lipsum text in the second \TitleBox, the page break would occur within that box at the overflow point. Instead, the entire second \TitleBox is moved to the next page, leaving extra whitespace on the first page. Is there a remedy for this behavior? \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[english]{babel} %\usepackage{csquotes} % disabled; use ``'' \usepackage[most]{tcolorbox} \usepackage[letterpaper]{geometry} \usepackage{lipsum} % ---------------------------------------------------------------- % Amendment commands % ---------------------------------------------------------------- \newcommand{\Delete}[1]{% {\sout{#1}}% } \newcommand{\Amend}[1]{% {\uline{#1}}% } % ---------------------------------------------------------------- % Global container % ---------------------------------------------------------------- \newtcolorbox{DocumentBox}{ enhanced, breakable, colback=white, boxrule=0.8pt, arc=1mm, left=4mm, right=4mm, top=4mm, bottom=4mm, } % ---------------------------------------------------------------- % Title box (FIXED: NOT breakable) % ---------------------------------------------------------------- \newtcolorbox{TitleBox}[1]{ enhanced, boxrule=0.6pt, arc=1mm, title={#1}, fonttitle=\sffamily, before skip=4mm, after skip=4mm, left=3mm, right=3mm, top=2mm, bottom=2mm, before upper=\parindent0pt, } % ---------------------------------------------------------------- \begin{document} \begin{DocumentBox} \begin{TitleBox}{\lipsum[1][1]} \lipsum[1][2] \end{TitleBox} \begin{TitleBox}{\lipsum[1][3]} \lipsum[2] \lipsum[3] \lipsum[4] \lipsum[5] \lipsum[6] \lipsum[7] \end{TitleBox} \end{DocumentBox} \end{document}

  • renewcommand Gamma into itGamma in unicode-math
    by Ryan Kong on May 14, 2026 at 2:26 am

    I want to have a command \Gamma that does what \itGamma does, under unicode math. My Preambles: %! TEX program = xelatex \documentclass[]{article} \usepackage{amsmath} \usepackage[]{unicode-math} \setmathfont[]{TeX Gyre Termes Math} I only want \Gamma to be italic, so I will not consider using \usepackage[math-style=ISO]{unicode-math}. Here's what I tried and their respective error messages (or problem): \renewcommand{\Gamma}{\itGamma} \renewcommand{\Gamma}{\mitGamma} \AtBeginDocument{\renewcommand{\Gamma}{\mitGamma}} % They all compiles, but the result shows a upright \Gamma \AtBeginDocument{\renewcommand{\Gamma}{\itGamma}} % TeX capacity exceeded, sorry [input stack size=10000]. \tl_if_exist:NTF #1->\if_meaning:w #1 \unimathsetup{Gamma=italic} % The key 'unicode-math/Gamma' is unknown and is being ignored. I have no idea what I can do now, help would be much appreciated.

  • expl3 syntax in pgfdeclaredataformat command
    by tkl on May 13, 2026 at 5:06 pm

    Is it possible to use expl3 syntax, specifically floating point operations, within a pgfdeclaredataformat command? Below is a minimal example, indeed with a workaround solution. Comment out the doesnotwork lines to get an error. Actual computations are different and involve a small Newton solver. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{datavisualization} \begin{document} \ExplSyntaxOn \def\tologarithmic#1#2{ % 0.43429 = 1/ln(10) \pgfkeys{/data~point/x=\fp_to_decimal:n{0.43429*ln(#1)}} \fp_log:n {0.43429*ln(#1)}% to see in the log file, that the calculation actually works! \pgfkeyssetvalue{/data~point/y}{\fp_to_decimal:n{0.43429*ln(#2)}} \pgfdatapoint } \ExplSyntaxOff \pgfdeclaredataformat{compute}{}{} {#1 #2}% line format {\tologarithmic{#1}{#2}}% code {}{} %\def\doesnotwork{% \begin{tikzpicture} \datavisualization[scientific axes, visualize as scatter, x axis=logarithmic, y axis=logarithmic ] data[format=compute,set=scatter] { 2.868E+03 2.804E-02 5.636E+04 2.061E-02 1.791E+06 1.079E-02 3.554E+07 7.080E-03 }; \end{tikzpicture} %}% end doesnotwork % the workaround solution \begin{tikzpicture} \datavisualization[scientific axes, visualize as scatter ] data[format=TeX code,set=scatter] { \tologarithmic{2.868E+03}{2.804E-02} \tologarithmic{5.636E+04}{2.061E-02} \tologarithmic{1.791E+06}{1.079E-02} \tologarithmic{3.554E+07}{7.080E-03} }; \end{tikzpicture} % that is how the graph should look like \begin{tikzpicture} \datavisualization[scientific axes, visualize as scatter, x axis=logarithmic, y axis=logarithmic ] data[set=scatter,separator=\space] { x y 2.868E+03 2.804E-02 5.636E+04 2.061E-02 1.791E+06 1.079E-02 3.554E+07 7.080E-03 }; \end{tikzpicture} \end{document}

  • Remember coordinate in nested tikzpicture with listings
    by Jason Cho on May 13, 2026 at 2:10 pm

    \documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} \usepackage{listings} \begin{document} \begin{tikzpicture}[remember picture] \node[draw] {\begin{lstlisting}[language=c++, linewidth=140pt, basicstyle=\ttfamily\scriptsize] class Counter : public QObject { public: Counter() { value = 0; }!\tikz[remember picture]\node (l1){};! int getValue() { return value; }!\tikz[remember picture]\node (l2){};! }; \end{lstlisting}}; \draw[red, ->] (l1) -- (l2); \end{tikzpicture} \end{document} In this code snippet, I use listings to syntax highlight a piece of C++ code, where I mark two lines with name l1 and l2. Then I want to use the coordinates of l1 and l2. However, the output is off. How do I fix the location of the named coordinates? Requirements: I name these two points because there are a dozen of commands relying on these coordinates. Therefore I do not want to cram these commands between the escapechars of lstlisting. I want to measure the full size of the picture, including the main listing and adornments. For example, when I center the picture, the whole pic is centered, not only the main listing. I have checked: Remember coordinate in nested tikzpicture points to a weird place was solved by using a special command \subnode in tikz-qtree. access a coordinate in a nested \tikzpicture was solved by removing nesting.

  • Apply command on each line of an environment automatically (luatex)
    by Salim Bou on May 13, 2026 at 1:12 pm

    This code splits each line of an environment into two parts, places each part in a box of a specified width, and separates them with a small space. What I want is for this to happen automatically without writing the instruction at the beginning of each line, only specifying the split position and the end of the line. % lualatex \documentclass[12pt]{article} \usepackage[margin=1.8cm]{geometry} \def\<#1&#2>{\makebox[7.8cm][s]{#1}\hspace{1cm}\makebox[7.8cm][s]{#2}} \newenvironment{mypoem}{\begin{center}\baselineskip=36pt\bfseries} {\end{center}} \begin{document} \begin{mypoem} \<first part of poem & second part of poem>\\ \end{mypoem} \end{document}

  • "TeXpresso incremental compilation: how are cross-file dependencies and BibTeX aux files handled?"
    by 안수남 on May 13, 2026 at 1:46 am

    TeXpresso's driver maintains an incremental view of the document by re-rendering only modified portions. However, I'm unclear on how it resolves cross-file dependency invalidation specifically: If a shared macro file (macros.tex) is modified, does TeXpresso correctly invalidate and re-render all files that \input{} it, or does it only track the root file's dependency tree? Since TeXpresso requires a separate full compilation pass to generate .aux files for BibTeX, what is the recommended workflow when citations are frequently updated mid-editing session? Does the incremental engine retain stale citation data between full compilation passes? I'm evaluating TeXpresso for a large collaborative project and trying to understand the boundaries of its incremental model before committing to the toolchain.

  • Troubles with negative numbers on bar graph [duplicate]
    by Ismael Joaquim on May 12, 2026 at 9:00 am

    everyone. I'm having troubles with the negative labels in the first graph.Can someone help me with this? \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} \usetikzlibrary{pgfplots.groupplots, calc} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={ group size=2 by 1, horizontal sep=1.2cm }, ybar, width=7.2cm, height=6.2cm, ymode=log, log origin=infty, title style={font=\normal\bfseries}, symbolic x coords={NaCl (B1),TiC (B1),FeSi (B20)}, xtick=data, tick label style={font=\small}, x tick label style={font=\small}, visualization depends on={y \as \originalvalue}, nodes near coords={% \pgfmathprintnumber[fixed,precision=3]{\originalvalue}% }, nodes near coords style={ font=\small, rotate=90, anchor=west }, enlarge x limits=0.20, grid=major, major grid style={dashed, gray!35}, ] % ====================================================== % (a) Regime \pm 10% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(a) Regime $\pm 10\%\,V_0$}, ylabel={RMSE (meV/célula)}, ymin=1e-2, ymax=1e1, legend to name=gruppolegend, legend style={ legend columns=6, draw=black, fill=white, font=\small, column sep=6pt, }, ] % Murnaghan — NaCl: 0.061718, TiC: 0.216179, FeSi: 0.256858 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),0.061718) (TiC (B1),0.216179) (FeSi (B20),0.256858) }; \addlegendentry{Murnaghan} % BM3 — NaCl: 0.027460, TiC: 0.057278, FeSi: 0.072263 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),0.027460) (TiC (B1),0.057278) (FeSi (B20),0.072263) }; \addlegendentry{BM3} % Vinet — NaCl: 0.037637, TiC: 0.105771, FeSi: 0.125342 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),0.037637) (TiC (B1),0.105771) (FeSi (B20),0.125342) }; \addlegendentry{Vinet} % q-EoS (n=2) — NaCl: 0.027461, TiC: 0.057532, FeSi: 0.072068 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),0.027461) (TiC (B1),0.057532) (FeSi (B20),0.072068) }; \addlegendentry{q-EoS $(n=2)$} % q-EoS (n=3) — NaCl: 0.027537, TiC: 0.058481, FeSi: 0.073480 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),0.027537) (TiC (B1),0.058481) (FeSi (B20),0.073480) }; \addlegendentry{q-EoS $(n=3)$} % ====================================================== % (b) Regime \pm 50% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(b) Regime $\pm 50\%\,V_0$}, ymin=1e0, ymax=1e4, ] % Murnaghan — NaCl: 38.483922, TiC: 179.827163, FeSi: 209.918058 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),38.483922) (TiC (B1),179.827163) (FeSi (B20),209.918058) }; % BM3 — NaCl: 2.118186, TiC: 44.043547, FeSi: 63.469045 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),2.118186) (TiC (B1),44.043547) (FeSi (B20),63.469045) }; % Vinet — NaCl: 23.998934, TiC: 27.367181, FeSi: 38.077585 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),23.998934) (TiC (B1),27.367181) (FeSi (B20),38.077585) }; % q-EoS (n=2) — NaCl: 1.962260, TiC: 54.617663, FeSi: 61.961751 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),1.962260) (TiC (B1),54.617663) (FeSi (B20),61.961751) }; % q-EoS (n=3) — NaCl: 3.740124, TiC: 59.084828, FeSi: 68.649034 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),3.740124) (TiC (B1),59.084828) (FeSi (B20),68.649034) }; \end{groupplot} % Legenda centralizada acima dos dois painéis \node at ($(group c1r1.south east)!0.5!(group c2r1.south west)+(0,-1.1cm)$) {\pgfplotslegendfromname{gruppolegend}}; \end{tikzpicture} \end{document}

  • Lstlisting copy paste code properly, without showing ␣
    by gioQ on May 12, 2026 at 8:51 am

    I'm trying to improve the copy paste from a lstlisting code block. Firstly, I removed the possibility to copy the line numbers, but now I can't keep the spaces/tabs as I want. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern} % font \usepackage{accsupp} \usepackage{listings} \usepackage{xcolor} \newcommand{\noncopynumber}[1]{% \BeginAccSupp{ActualText={}}#1\EndAccSupp{}% } \makeatletter \def\lst@outputspace{{\ifx\lst@bkgcolor\empty\color{white}\else\lst@bkgcolor\fi\lst@visiblespace}} \makeatother \lstdefinestyle{BaseProgrammingStyle}{ keywordstyle=\color[HTML]{d8127e}\bfseries, % keyword: bf pink commentstyle=\color[HTML]{009900}, % comments: green backgroundcolor=\color[HTML]{f2f2eb}, % Background: beige numbers=left, numberstyle=\color{gray}\noncopynumber, % line numbers: gray stringstyle=\color[HTML]{9400d1}, % strings: purple aboveskip=1em, belowskip=1em, upquote=true, basicstyle=\ttfamily\small, frame=none, showstringspaces=false, breaklines=true, breakatwhitespace=true, lineskip=0pt, sensitive=false, literate={~} {$\sim$}{1}, % classic tilde keepspaces=true, columns=fullflexible, tabsize=2, } \lstdefinestyle{cstyle}{ style=BaseProgrammingStyle, language=C, morekeywords={system} } \begin{document} \begin{lstlisting}[style=cstyle] #include <stdio.h> int main(){ int s = 0; char buffer[10]; gets(buffer); // any lenght allowed, but adds \0 at the end printf("buffer: %s\n", buffer); printf("s: %d\n", s); } \end{lstlisting} \end{document} This is the solution I found, but when I copy the code, the spaces are shown as ␣.

  • ConTeXt: "inbetween" math option is not working properly
    by Georgian Ilie on May 12, 2026 at 8:49 am

    Good morning everyone, I am encountering a problem while typing systems of equations. I would like to increase the space separating the equations, but I am not finding a sound way to do it. From the best that I have understood from the ConTeXt math documentation, this parameter should be set by the option inbetween, which should be appended to the \startcase...\stopcase environment. This approach was tried unsuccessfully in the simple example reported next: \setuphead[section] [style=\ss\bf, grid=line, method=m, % 'm' stands for 'max'—it forces the line height to the grid max before={\blank[force, 2*line]}, after={\blank[line]}] \setuphead[chapter] [page=right, style=\ss\tfc\bf, header=high, before=, after={\blank[line]\placecontent[criterium=local]\blank[line]}, grid=tolerant] \definecolumnset [example] [n=2] %\definecolumnsetspan[wide][n=2] \setuplayout[grid=yes] % \showgrid \starttext \startcolumnset[example] %\startcolumnsetspan[wide] %\startchapter[title=Introduction,grid=tolerant] %\stopcolumnsetspan \startsection[title=Happy] The quick, brown fox jumps \m{\varepsilon_p^*} over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. \startformula f(x) = \startcases \NC x \NC x \geq 0 \NR \NC -x \NC x < 0 \NR \stopcases \quad \breakhere f(x) = \startcases [spaceinbetween=1\lineheight] \NC x \NC x \geq 0 \NR \NC -x \NC x < 0 \NR \stopcases \stopformula Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just \stopsection \stopcolumnset \stoptext What am I mistaking? Thank you in advance for your help.

  • Accent shift with `yhmath`'s nested `\widehat`/`\hat` command?
    by Explorer on May 12, 2026 at 3:55 am

    I have the following code: \documentclass{article} \usepackage{amsmath} \usepackage{yhmath} \begin{document} $\widehat{AAABCCC}$ $\widehat{AAA\hat{B}CCC}$ $\widehat{AAA\widehat{B}CCC}$ \end{document} Here are some related information I have searched: How to make the \widehat wider? https://tex.stackexchange.com/a/320440 https://tex.stackexchange.com/a/101136 If I don't want mtpro2's style of \widehat(like this), any suggestions on the accent shift issues with nested \widehat/\hat commands? Edited: The symbol used here is common with statistic lession, for example the Asymptotic Standard Error:

  • Why is the current page.center of a beamer page not making my image flush with the edges?
    by Jasper on May 12, 2026 at 2:29 am

    Why is the current page.center of a beamer page not making my image flush with the edges? Compile with lualatex: Learning from samcarter's solution, the code below is okay to put the image: \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame}[plain] \begin{tikzpicture}[remember picture,overlay] \node[at=(current page.center)] { \includegraphics[width=\paperwidth, height=\paperheight]{example-image} }; \end{tikzpicture} \end{frame} \end{document} However, if put inside animateinline, as below: \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} { \setbeamertemplate{navigation symbols}{} \begin{frame}[plain] \begin{animateinline}[autoplay,loop]{10}% % Credit to @Explorer's comment: \begin{tikzpicture}[remember picture,overlay] \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline} \end{frame} } \end{document} The code complained that: ! Package animate Error: Content of first frame must not have zero width. See the animate package documentation for explanation. Type H <return> for immediate help. ... l.20 \end{frame} ? In regard to the comment about https://tex.stackexchange.com/a/656219/319072, the following MWE still is not flush. \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} \AtBeginShipoutNext{% \AtBeginShipoutUpperLeft{% \unitlength=\paperheight% \put(0,-1){% \begin{animateinline}[autoplay,loop]{10}% \begin{tikzpicture} \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline}% }% }% }% { \setbeamertemplate{navigation symbols}{} \begin{frame} \end{frame} } \end{document}

  • Multilingual document: switch main language in order to switch layout within a document
    by ncdipde on May 11, 2026 at 8:27 pm

    I am writing a document whose main language is French. A whole section is in English \section{Abstract} And then other sections are in French \section{Résumé} \section{Méthodes} etc. I would like the English section to respect English typographic rules (note only punctuation or quotes) and other sections in French to respect French typographic rules. Writing \selectlanguage{english} or using otherlanguage environment only change the locale language which changes how quotes render for example, but it does not change first paragraph indentation nor the \labelitemi Is it possible to switch the main language for a whole section ? Thereafter a minimal example: \documentclass[paperletter, 12pt, english, french]{article} \usepackage{babel} \usepackage[inline]{enumitem} \usepackage{lipsum} \title{Plain Latex} \begin{document} \section{Français} Une liste en français \begin{itemize} \item La langue \og principale\fg{} est : \mainlocalename ! \item La langue \og courante\fg{} est : \localename ; \end{itemize} \lipsum[1][1-3]\par \lipsum[1][4-6] \selectlanguage{english} \section{English} A list in English \begin{itemize} \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \lipsum[2][1-3]\par \lipsum[2][4-6]\par \subsection{poor patches} \noindent \lipsum[3][1-3]\par \lipsum[3][4-6]\par \begin{itemize}[label={\textbullet}] \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \end{document}

  • Creating a \hookrightnotleftarrows operator
    by Alma Arjuna on May 11, 2026 at 3:21 pm

    I wish to create a math operator, which I'm calling \hall, similar to \rightleftarrows, but the arrows should be hooked, as in \hookrightarrow and \hookleftarrow; the left arrow (which is below) should be crossed. I've tried to create the symbol with the following code, but it turned out quite ugly because of spacing. \documentclass{standalone} \usepackage{amssymb, amsmath} \usepackage{centernot} \newcommand{\hall}{{\hookrightarrow}\atop{\centernot\hookleftarrow}} \begin{document} $\rightleftarrows$ $\hall$ \end{document} It would also be nice if the hook in the left arrow would be pointed downwards instead of upwards. I tried fixing this with a \rotatebox, but this messed up with the arrow size.

  • Minted–add a box around each token
    by Jean Dubois on May 11, 2026 at 3:00 pm

    I have some minted code blocks in a beamer, such as: \documentclass[compress]{beamer} \usepackage{minted} \setminted[ocaml]{ frame=leftline, framesep=6pt, rulecolor=gray, linenos=true, numbersep=4pt, xleftmargin=20pt, breaklines=true, tabsize=2, } \begin{document} \begin{frame} \inputminted{ocaml}{some_file.ml} %% HERE \end{frame} \end{document} where some_file.ml is, say: let rec sum l = match l with | [] -> 0 | x::q -> x + sum q As expected, this is the output I get: I would like to box every token in the file, either automatically or manually (every snippet is as small as this example), approximately like this: I have absolutely no idea how to do this. I searched in the minted documentation for “token” but found nothing relevant. Is it possible to do this and if so, how can I achieve it? Thank you in advance 🙂

  • How to draw two squares beside each other?
    by Intuition on May 11, 2026 at 11:23 am

    Here is the picture I want to draw: I know how to draw just one colored square, for example here is a code to it: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[a4paper, margin=1.5in]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{tikz-cd} \usepackage{amsmath,amsfonts,amssymb} \usepackage{amsthm} \usepackage{graphicx} \usepackage[all,cmtip]{xy} \usepackage[english]{babel} \usepackage{xurl} \usetikzlibrary{positioning, shapes.geometric} \begin{document} \begin{tikzpicture}[ every path/.style={thick}, every node/.style={circle,fill=black,draw,inner sep = 0pt, minimum size= 2pt} ] \draw[red] (0,0)--(2,0); \draw[cyan] (2,0)--(2,2); \draw[yellow] (2,2)--(0,2); \draw[red] (0,2)--(0,0); \draw[green] (0,0)--(2,2); %\draw[green] (0,2)--(2,0); \foreach \corner in {(0,0), (2,0), (2,2), (0,2)} \node at \corner {}; \end{tikzpicture} \end{document} Also, how to remove the common edge if I aligned the two squares beside each other? Any help will be greatly appreciated.

  • Sans serif font [duplicate]
    by m4r35n357 on May 11, 2026 at 11:04 am

    How do I set a sans-serif document font in Latex? This simple question does not seem to have an answer here at all - everyone already seems to know it and nobody asks. MWE: \documentclass{book} \usepackage[T1]{fontenc} \author{me} \title{Blah} \date{never} \begin{document} \frontmatter \maketitle\tableofcontents \mainmatter Hello \end{document} I have been asked to explain why my question is different to this one. Two reasons: I am looking for a global solution, not tweaking as I go. The answers there are not what I want. The ones here are what I want.

  • Has processing of blank source lines in array environments changed?
    by Klaus on May 11, 2026 at 10:00 am

    I have a LaTeX source text which I could run through pdflatex on April 15 but which fails today May 11. I can make the source text work again by deleting blank lines in array environments (400 places in my case). Here is a minimal failing example of a source text which does not compile: \documentclass{article} \begin{document} \[\begin{array}{l} foo \end{array}\] \end{document} In contrast, this compiles: \documentclass{article} \begin{document} \[\begin{array}{l} foo \end{array}\] \end{document} Also, this compiles: \documentclass{article} \begin{document} \[\begin{array}{l} foo \\ \end{array}\] \end{document} So my question is: what makes the minimal failing example above fail today? Or, equivalently, what made it work on April 15? Between April 15 and today I have upgraded my Fedora Linux installation so, in particular, I have upgraded TeX related packages. My guess is that some TeX related package has changed. My LaTeX source text which worked on April 15 used the following packages: centernot latexsym amssymb graphicx amsmath url enumitem stackengine accents printlen cancel tocloft makeidx tikz. So it could be that one of those packages made the minimal failing example work previously but not anymore.

  • How to use/define longtblr (from tabularray) with two independent caption counters
    by Vitor Coimbra on May 11, 2026 at 12:58 am

    For a document I'm working on, there's a distinction between "frames" and "tables". Long story short, tables are for purely numerical data, while frames can contain text. Because they're separate entities, I need to make sure they're also indexed separately. I managed to somehow figure out how to do that for normal tblrs by creating my own floating environments, which can easily keep track of their own counters. Main issue is that I'm working with some massive tables of numbers and text, meaning I need to use longtblrs for both of these entities pretty much everywhere. longtblrs, however, seem to embed caption stuff into their own innards and so far all my attempts to get independent counters to work have not worked. Here's the latest attempt I've made: \documentclass{article} \usepackage{tabularray} \DeclareTblrTemplate{caption-sep}{default}{ -- } \UseTblrLibrary{counter} \newcounter{framecounter} \NewTblrTheme{frame}{ \DeclareTblrTemplate{caption-tag}{default}{ \stepcounter{framecounter} Frame\ \theframecounter } } \begin{document} \begin{tblr}[ long, caption = {This should be Frame 1}, label = {frm:testframe1}, theme=frame ]{ colspec = {X[c]X[c]}, hlines, vlines } This is & a table test \\ to see & if counters work \\ \end{tblr} \begin{tblr}[ long, caption = {This should be Table 1}, label = {tab:testtable1}, ]{ colspec = {X[c]|X[c]}, hlines } This is & a table test \\ to see & if counters work \\ \end{tblr} \begin{tblr}[ long, caption = {This should be Frame 2}, label = {frm:testframe2}, theme=frame ]{ colspec = {X[c]X[c]}, hlines, vlines } This is & a table test \\ to see & if counters work \\ \end{tblr} References (and what they should be, in brackets): Frame \ref{frm:testframe1} (1), Table \ref{tab:testtable1} (1), Frame \ref{frm:testframe2} (2) \end{document} And what it looks like:

  • Tikz node text width and alignment messed up spaces and indentation
    by aky-her on May 10, 2026 at 5:52 pm

    I have a mono-spaced font (TeX Gyre Cursor), but when I use it in a Tikz node with text width = XYcm the spaces change size. Is there a way to either preserve the space size with the width command, or achieve automatic line breaks in tikz node in some other way that does not break the spaces? Additionally, when using alignemnt, it inserts an indent at the start of the text, which I was not able to remove with \setlength{parindent}{0pt}. What causes this indent and how can I remove it? Here is my full node code: \node at (3, 1.75) [ align = left, text width = 4.6cm, ] {\setlength{\parindent}{0pt}\textbf{\setfontsz{\sztext} Text line 1, Longer text line 2, Even way way way way longer text line 3, Text line 4}}; EDIT: here is the full code: \documentclass{article} \usepackage[paperheight=8cm, paperwidth=6cm, left=0pt, top=0pt, right=0pt, bottom=0pt]{geometry} \usepackage{tikz} \usepackage{fontspec} \usepackage{array} \setmainfont{TeX Gyre Cursor} \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} %% horizontal centering \newcommand{\setfontsz}[1]{ \fontsize{#1}{1.2#1} \selectfont } \pagestyle{empty} %\renewcommand{\arraystretch}{2.2} \newcommand{\sztext}{8pt} \begin{document} %\vspace*{-\baselineskip} \begin{tikzpicture}[remember picture, overlay, shift = {(current page.south west)}] \node at (current page.center) [] {\includegraphics[height=\paperheight]{example-image-a.png}}; \node at (3, 1.75) [ align = left, text width = 4.6cm, ] {\setlength{\parindent}{0pt}\textbf{\setfontsz{\sztext} Text line 1, Longer text line 2, Even way way way way longer text line 3, Text line 4}}; \end{tikzpicture} \end{document}

  • Arrows pointing into dots
    by Tala Cruz on May 10, 2026 at 11:51 am

    I am trying to draw a diagram that shows an equivalence chain between statements. I am trying to use tikz-cd to achieve this, here is my code. \[ \begin{tikzcd} \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R} \;\; f(\alpha_1,\cdots,\alpha_n) < 0 \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1,X_2) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \ar[d, Leftrightarrow] \\ \vdots \ar[d, Leftrightarrow] \\ \exists \alpha_1,\cdots,\alpha_n \in \mathbb{R}(X_1,\cdots,X_n) \;\; f(\alpha_1,\cdots,\alpha_n) \prec 0 \end{tikzcd} \] However, there is an undesired space above the \vdots, as shown: I have tried using \raisebox but it only seems to make the lower gap larger. Is there a way to make the dots’ spacing the same as the other lines? (I am also fine with a solution that does not need tikz-cd).

  • Overriding the column number for enumext inline list items
    by Teepeemm on May 9, 2026 at 2:34 pm

    The enumext package allows inline lists with a set number of columns that can be overridden, like this: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2] \item Short \item Short \item Short \item Short \item(2) A longer item that takes both columns to show \item Short \item Short \item Short \item Short \end{enumext*} \end{document} This works well if most items need the short column, and there's an occasional longer item. I have the opposite setup: most of my items are longer, but there's an occasional pair of short items. I could do this with: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2] \item(2) A longer item that takes both columns to show \item(2) A longer item that takes both columns to show \item Short \item Short \item(2) A longer item that takes both columns to show \item(2) A longer item that takes both columns to show \end{enumext*} \end{document} But writing (2) every time is annoying. Is there a way to say that (2) is the default, and then specify (1) for the short items? Something like: \documentclass{article} \usepackage{enumext} \begin{document} \begin{enumext*}[columns=2,item-columns=2] % Package enumext Error: The key 'item-columns=2' is unknown by environment 'enumext*' and is being ignored. \item A longer item that takes both columns to show \item A longer item that takes both columns to show \item(1) Short \item(1) Short \item A longer item that takes both columns to show \item A longer item that takes both columns to show \end{enumext*} \end{document} I've tried \NewCommandCopy\olditem\item \RenewDocumentCommand\item{D(2)}{\olditem(#1)} Within the {enumext*} environment this causes an error ("! Missing number, treated as zero." and then a fatal error). Outside the environment this causes the next item to display as "()2).[]", but with less spacing. (Note that this document needs to be tagged, so using the enumitem or enumerate packages is not an option.)

  • How to make the `\hrule` in custom math symbol rounded?
    by Explorer on May 9, 2026 at 1:05 pm

    Learning from the classical egreg's solution for example here and here, I try to construct the custom symbols: with the following code: \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\myge}{\mathrel{\mathpalette\myrel@{\@firstoftwo}}} \newcommand{\myle}{\mathrel{\mathpalette\myrel@{\@secondoftwo}}} \newcommand{\myrel@}[2]{% \begingroup \setbox\z@=\hbox{$\m@th#1=$}% \vcenter to \dimexpr.75\ht\z@\relax{% #2{% \hrule width \dimexpr2\wd\z@\relax \vfill \hrule width \wd\z@ }{% \hrule width \wd\z@ \vfill \hrule width \dimexpr2\wd\z@\relax }% }% \endgroup } \makeatother \begin{document} \[ a \myge b \quad a \myle b \] \[ \displaystyle a \myge b \quad \textstyle a \myge b \quad {}_{\scriptstyle a \myge b} \quad {}_{\scriptscriptstyle a \myge b} \] \[ \displaystyle a \myle b \quad \textstyle a \myle b \quad {}_{\scriptstyle a \myle b} \quad {}_{\scriptscriptstyle a \myle b} \] \end{document} but which gives: I want to know that, based on my code, any suggestions to change the rule from butt to rounded? I don't think with tikz is a good choice... here...

  • Lua based solution for tracking equivalent to fontspec LetterSpace Opentype feature
    by David Purton on May 9, 2026 at 10:41 am

    I've been using the OpenType LetterSpace font feature to adjust tracking. It does what I want, but has the side effect of creating a new font instance, which is annoying when babel is in use as the newly created instance is not known to babel. I'd like a drop in alternative implemented in Lua that behaves the same. But it's beyond my skill and understanding. Requirements: No change in the word spacing (like fontspec). Like for like behaviour when same number is supplied as I was using with LetterSpace (I already spent time tuning things to this number). Group safe. Switch-like behaviour (like \bfseries). Optional compatibility with the microtype package if loaded. I probably don't care specifically what happens if you try and use both tracking methods at the same time – one or the other in use is sufficient. But other microtype features need to still work (like protrusion, etc.). Here's a MWE that shows the current behaviour I have with the LetterSpace option. If possible, I'd like the numbers and output to match. %! TeX Program = lualatex \documentclass{article} \pagestyle{empty} \usepackage{fontspec} \setmainfont{Noto Serif} \newlength{\testlen} \newcommand{\settracking}[1]{% \addfontfeatures{LetterSpace=#1}} \begin{document} \begin{tabbing} \settowidth{\global\testlen}{Test Test} Test Test \= width: \the\testlen \\ \settracking{-5}\settowidth{\global\testlen}{Test Test} Test Test \> width: \the\testlen \\ \settowidth{\global\testlen}{Test Test} Test Test \> width: \the\testlen \\ \end{tabbing} \end{document}

  • negating math symbols
    by Antonis on May 9, 2026 at 10:36 am

    I have been asked to introduced negated mathrel symbols in NewCM that do not exist in Unicode standard. Before I get into adding extra symbols in NewCMMath I would like to make sure that a macro does not suffice. I tested with the \not command or relative packages like centernot without good results. Then there is \ooalign. For example, \documentclass{article} \usepackage[olddefault]{fontsetup} \makeatletter \newcommand{\ndisin}{\mathrel{\mathpalette\overlay@slash\disin}} \newcommand{\overlay@slash}[2]{% \ooalign{$\m@th#1#2$\cr\hss$\m@th#1/$\hss}% } \makeatother \begin{document} $y\ndisin A_{y\ndisin A_{y\ndisin A}}$ \end{document} Produces This shows that exactly centering the two symbols is not always good. The slash should be better placed a bit to the right (centered with respect to \in). So the question is if it is possible to make such adjustments on the above or other code to get the desired result, or one has to go to the font level and design new characters.

  • tablenotes, spacing of superscript before right bracket
    by N. Hunt on May 9, 2026 at 4:36 am

    I am having problems with superscripts in tablenotes, specifically, when the superscript comes before a right parenthesis, they are correct, but before a right bracket, extra space is being inserted. I initially was just using the plain tnote, but that behaviour was even worse; I discovered a workaround with 'xspace' and this works apart from what I have just described. This lualatex, by the way. \documentclass[a4paper,14pt]{extarticle} \usepackage[a4paper,left=0.75in,top=0.25in,bottom=0.25in,landscape]{geometry} \usepackage{fontspec} \usepackage[main=greek]{babel} \babelprovide[onchar=ids]{american} \setmainfont[Ligatures=TeX]{Gentium} \usepackage{booktabs} \usepackage{array} \usepackage[flushleft]{threeparttable} \usepackage{xspace} \setlength{\tabcolsep}{10pt} \setlength{\parindent}{0pt} \begin{document} \thispagestyle{empty} \renewcommand{\arraystretch}{1.25} \newcommand{\tss}[1]{\textsuperscript{#1}\xspace} \begin{threeparttable} \begin{tabular}{l !{\kern20pt} l} \multicolumn{2}{c}{\textsc{First Declension}}\\ \multicolumn{1}{c}{\textsc{Masc.}} & \multicolumn{1}{c}{\textsc{Fem.}} \\ xxx, xxxx & xxx, xxx, x \\ xxx, [xxx\tss{9}] & xxx, xxxx \\ x, x & x, x \\ xxx, xxxx\phantom{, xxx} & xxx, (xxx\tss{10}), xxxx \\ xxx, xxx\tss{11}, x & [xxx\tss{12}], xxx, x \\ \multicolumn{2}{c}{x} \\ \multicolumn{2}{c}{xxx} \\ \multicolumn{2}{c}{xxx} \\ \multicolumn{2}{c}{xxx, [xxxx\tss{13}]} \\ \multicolumn{2}{c}{xxx, [xxx, xxxx, xxxx, xxx, xxxx]} \\ \multicolumn{2}{c}{xxxx} \\ \end{tabular} \begin{tablenotes} \small \item [9] Some proper names in Lesser Quux. \item [10] Some proper names in Plat., Xen., Thuc., etc. \item [11] Aristophanes and Plutarch. \item [12] Often in the poets and inscrr.; sometimes in Plato. \item [13] Foobar. \end{tablenotes} \end{threeparttable} \end{document}

  • How to use idiosyncratic fonts in current TeX
    by F. Bartlett on May 8, 2026 at 5:17 pm

    I have been using TeX since 1986 and Type 1 fonts since the early 90s, courtesy of Berthold Horn. Moreover, I created my own fontnames and mappings for T1 fonts and, therefore, tfm files. I should also mention that I have a long-standing allergy to LaTeX and its derivatives, and so work only in plain TeX. But now I have somehow modernized my TeX installation due to a disastrous update to Fedora 44, so none of my non-CM Type 1 fonts work at all. When I attempt to use, say, AGaramond-Regular, I get mktexnam errors (yes, all my font files have Adobe PostScript names): kpathsea: Running mktextfm AGaramond-Regular /usr/share/texlive/texmf-dist/web2c/mktexnam: Could not map source abbreviation A for AGaramond-Regular. /usr/share/texlive/texmf-dist/web2c/mktexnam: Need to update /usr/share/texlive/texmf-dist/fonts/map/fontname/special.map? mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; ; nonstopmode; input AGaramond-Regular This is METAFONT, Version 2.71828182 (TeX Live 2023) (preloaded base=mf) Of course, METAFONT fails in short order. Any suggestions? My preference would be to ignore all the font-handling changes made in the last few years, but I suspect that that’s a lost cause. Thanks! Fred

  • How can I list or visualize all available anchors of a CircuitTikZ component?
    by internet on May 8, 2026 at 9:31 am

    I am using CircuitTikZ and often need to connect wires or labels to component anchors. However, it is not always easy to know which anchors are available for a specific component. For example, different components may provide anchors such as north, south, in, out, gate, collector, emitter, etc., and the available anchors vary depending on the component type. When building more complicated schematics, I frequently need to stop and search through the documentation to check anchor names. I was wondering whether there is a way to programmatically: List all available anchors of a given CircuitTikZ/TikZ shape/components, and/or Visualize those anchors directly on the rendered component. For example, something conceptually like: \showanchors{a component/shape} that would either print all anchor names and draw markers/labels on the component itself. So my question is: Is there a practical way to list all anchors associated with a TikZ/CircuitTikZ shape? My motivation is mainly usability and workflow efficiency. A tool like this would make it much easier to explore unfamiliar components and reduce the need to constantly check the manual, especially for beginners or occasional CircuitTikZ users. This is an example of visualizing the anchors to help wiring from CircuiTikz documentation. A possible MWE (clearly, the pin thing must be adjusted somehow to have a better distribution, and to take into account that labels can have spaces and strange characters, but well...). The task it to substitute the \allanchors definition with something automatic, see the comment above it. \documentclass[border=10pt]{standalone} \usepackage[T1]{fontenc} \usepackage[siunitx, RPvoltages]{circuitikz} \begin{document} \begin{tikzpicture}[every pin/.append style={text=red, inner sep=1pt, font=\tiny\ttfamily}] \node [npn](myshape) at (0,0) {}; % Example: this should be autofilled % Basically, for every shape named, say, "gizmo", the anchor "spot" % is a macro named pgf@anchor@gizmo@spot % --- so to do what you want, you should be able to find all % the macros with that pattern that exist % (and I do not know if this is possible in TeX in general, % maybe in LuaTeX...). \newcommand{\allanchors}{center,E,B,south} \foreach \anc in \allanchors { \node[circ, pin=45:\anc] at (myshape.\anc) {}; } \end{tikzpicture} \end{document}