• Why can't TeX \par remove these spaces?
    by Elayson Abreu on May 23, 2026 at 11:30 pm

    I encountered a problem while writing. Consider the following example in Plain TeX: \def\cmd{ \par\noindent\hfil ??? \par\noindent\hfil ??? \par\noindent\hfil ??? } {\cmd} \par \bye The compilation generates: Note the last misaligned line. Why didn't \par remove the two spaces preceding it? Note that if I add a percentage mark to the end of the definition of \cmd or to the end of {\cmd}, the problem disappears: \def\cmd{ \par\noindent\hfil ??? \par\noindent\hfil ??? \par\noindent\hfil ???% } {\cmd} \par \bye Or \def\cmd{ \par\noindent\hfil ??? \par\noindent\hfil ??? \par\noindent\hfil ??? } {\cmd}% \par \bye Generates: The original code that generated this question is similar to (the definition of \eject in Plain TeX is \def\eject{\par\break}): \def\printA{ \par\noindent\hfil City \par\noindent\hfil Year } \def\printB{ \eject more... } \def\printC{ \printA \printB } \printC \bye

  • Sequence of functions: easing package
    by Sebastiano on May 23, 2026 at 8:20 pm

    I was trying to understand how the easing package works and whether it can be useful for plotting a sequence of functions in order to study uniform convergence. I am not sure whether the package only allows plotting a set of predefined functions, or whether it also enables the representation of arbitrary sequences of functions. In particular, I would like to know whether there is a way to use this package (or other similar LaTeX packages) to effectively visualize any sequence of functions. If there is a more suitable tool, I would appreciate it if you could suggest it. Additionally I not understand the reason of a ugly graph for $n=1, 2$. Here an example: \documentclass{article} \usepackage{pgfplots} \usepgflibrary{easing} \pgfplotsset{compat=1.18} \begin{document} \begin{center} \begin{tikzpicture} \begin{axis}[ width=12cm, height=7cm, domain=0:1, axis equal image, samples=300, xmin=0, xmax=1, ymin=0, ymax=1.05, axis lines=left, xlabel={$x$}, ylabel={$x^n$}, legend pos=north west, thick ] \pgfkeys{/easing/pow/exponent=1} \addplot[blue] {poweasein(0,1,x)}; \addlegendentry{$n=1$} \pgfkeys{/easing/pow/exponent=2} \addplot[red] {poweasein(0,1,x)}; \addlegendentry{$n=2$} \pgfkeys{/easing/pow/exponent=4} \addplot[green!60!black] {poweasein(0,1,x)}; \addlegendentry{$n=4$} \pgfkeys{/easing/pow/exponent=8} \addplot[orange] {poweasein(0,1,x)}; \addlegendentry{$n=8$} \addplot[black, dotted] { (x==1 ? 1 : 0) }; \addlegendentry{$\lim f_n$} \end{axis} \end{tikzpicture} \end{center} \end{document}

  • How can I define a custom sinusoidal voltage source in circuitikz using pic?
    by Marco Moldenhauer on May 22, 2026 at 3:37 pm

    I am trying to define a custom electrical symbol for use with circuitikz. The symbol is a sinusoidal voltage source consisting of: a circle, a sinusoidal waveform inside the circle, + / − polarity markings, and a voltage label such as v_1 (which should be customizable). I would like to implement it as a TikZ pic so that it behaves similarly to built-in circuitikz components and allows easy connection of wires to its terminals. The symbol I want to reproduce is shown below (from Engineering Circuit Analysis by Hayt): I noticed that circuitikz already provides a sinusoidal voltage source. If possible, I would like to use that existing implementation as a reference (or perhaps extend it) so that the custom symbol matches the standard circuitikz style, dimensions, and line thickness used by the library.

  • How to extend the decoration path with multiple arrows?
    by Explorer on May 22, 2026 at 2:05 pm

    What I want is the arrow path patterns as below, but not only work for straight line, but ployline, curve, as path style/decoration: \documentclass[tikz,border=6pt]{standalone} \begin{document} \begin{tikzpicture} \foreach \i in {1,...,5} \draw[-latex,shorten >=2pt, shorten <=2pt] (\i,0) -- ({\i+1},0); \end{tikzpicture} \begin{tikzpicture} \draw[-latex,shorten >=2pt, shorten <=2pt] (0.5,0) -- (1,0); \foreach \i in {1,...,5} \draw[-latex,shorten >=2pt, shorten <=2pt] (\i,0) -- ({\i+1},0); \node[text width=5.5cm,align=left,anchor=north] at (3,-.25) {If the length is not exactly N cm, then I hope the starting point could be shortened. For instance, the 5.5cm here, I want the first arrow to start at 0.5cm, then follows five 1cm arrows.}; \end{tikzpicture} \end{document} I don't think the following is the same as my case: Draw consecutive arrows with TikZ Generating Multiple Arrow Decorations in Series Here below is my attempt with decoration, but not what I want: \documentclass[tikz,border=6pt]{standalone} \usetikzlibrary{decorations.markings,arrows.meta} \tikzset{ multiarrow/.style={ decoration={ markings, mark=between positions 0.1 and 0.9 step 0.2 with { \draw[-Stealth,shorten >=1pt, shorten <=1pt] (-10pt,0) -- (10pt,0); % the gap here not what I want... and hard to control the `0.1 and 0.9 step 0.2' } }, postaction=decorate } } \begin{document} \begin{tikzpicture} \path[multiarrow] (-2,-3) -- (2,-3); % good! \path[multiarrow,yshift=-1cm] (-2,-3) -- (2,-3)-- (5,-2); % not good! % \draw[multiarrow] plot[ % domain=-5:5, % samples=160, % smooth, % variable=\x % ] ({\x},{sin(\x r)}) % -- (5,-2) % -- (-5,-2) % -- cycle; \end{tikzpicture} \end{document} I want every arrow to be, says, fixed, 1cm length, shorten 1pt of both sides, for example of the closed path, I want something as below: (Quite sure that may be duplicated post, but I can't find that...) More information of the original purpose: \documentclass[tikz,border=5pt]{standalone} \usepackage{fourier} \usetikzlibrary{bending,decorations.pathmorphing} \begin{document} \begin{tikzpicture}[>=latex,line join=round,line cap=round] \draw[semithick,->] (0,0) -- (-1,0) node[below] {$y$}; \draw[semithick,->] (0,0) -- (0,-3) node[right] {$x$}; \draw[thick] (-110:2.5) -- node[left=5pt] {$q$} (0,0) node[above] {$O$} -- node[right=5pt] {$q$} (-70:2.5); \def\tmp{\fpeval{2.5*sind(20)}} \draw[thick, decorate, decoration={random steps, segment length=1pt, amplitude=.75pt}] (-110:2.5) arc[start angle=-110, end angle=-70, radius=2.5]; \foreach \i in {1,...,5}{ \draw[->,shorten <=1.5pt] (-.1,0) ++(-110:{(\i-1)*0.5}) -- ++(-110:0.5); \draw[->,shorten <=1.5pt] (+.1,0) ++(-70:{(\i-1)*0.5}) -- ++(-70:0.5); } \end{tikzpicture} \end{document} I use the code above to plot the following: I found that quite difficult to decide the (-.1,0) and ++(-110:{(\i-1)*0.5}) -- ++(-110:0.5) here, I want "extend the decoration path with multiple arrows" and put it together with the offset trick...

  • A \bigboxtimes symbol?
    by M.G. on May 22, 2026 at 11:45 am

    The tensor product symbol \otimes comes with a big version \bigotimes. Then there is also the external / box product symbol \boxtimes, however it doesn't come with a big version unlike the tensor product. Is there a way to get a big version of \boxtimes, e.g. \bigboxtimes, that behaves similarly to the good ol' \bigotimes in math mode? Here is a MWE with the symbol packages in use: \documentclass[11pt,a4paper,twoside]{report} \usepackage[utf8]{inputenc} \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsthm} \usepackage{latexsym} \usepackage{mathtools} \usepackage{mathrsfs} \usepackage{graphicx} \usepackage{gensymb} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{tikz-cd} \usepackage{mathcomp} \begin{document} Here are the three products in display math mode: \[ \otimes,\bigotimes,\boxtimes \] \end{document} Here is a comparison between \bigboxtimes from kabenyuk's solution and \bigotimes: I feel like typographically it would more aesthetic if \bigboxtimes were a little smaller due to the fact that it's a square. I think the right size comparison should be that both inside crosses should be of equal size.

  • How to create this table on every page?
    by Bakamashine on May 22, 2026 at 11:28 am

    Sorry, my Latex skills and English are bad. My college requires me to put this table on every page. Please help me, I don't know how to resolve this. Table example: My table: My code: \RequirePackage{array} \RequirePackage{tabularx} \RequirePackage{geometry} \RequirePackage{eso-pic} \geometry{ a4paper, left=25mm, right=15mm, top=25mm, bottom=25mm } \usepackage{tabularx} \usepackage{multirow} \newcommand{\BackgroundTopTable}{% \begin{tabularx}{\textwidth}{|c|c|c|c|c|X|c|} \hline & & & & & \multirow{3}{=}{\centering 09.02.07 Ф 2484 25 КП-ПЗ} & \multirow{2}{2em}{\centering Page} \\ \cline{1-5} & & & & & & \\ \cline{1-5}\cline{7-7} Изм. & Page & № Document. & Signature & Date & & \thepage \\ \hline \end{tabularx} } \AddToShipoutPictureBG{% \AtPageLowerLeft{% \raisebox{20mm}{% \makebox[\paperwidth]{% \hspace*{0mm}\BackgroundTopTable }% }% }% } My main.tex is default: \documentclass[a4paper, 14pt]{extarticle} \usepackage{gost} \usepackage{table} \begin{document} Hello world \end{document}

  • `colorlinks` URL loses color on page break inside footnote
    by user442187 on May 22, 2026 at 10:54 am

    When a \url{} command inside a footnote spans two pages, the link is correctly colored on the first page but appears black on the second page. The problem reproduces with pdfLaTeX, XeLaTeX, and LuaLaTeX. MWE: \documentclass[a4paper,12pt]{article} \usepackage[dvipsnames]{xcolor} \usepackage[colorlinks=true, urlcolor=blue]{hyperref} \usepackage{lipsum} \begin{document} \lipsum[1-4] \footnote{et avec beaucoup de blblaba avant et avec beaucoup de blblaba avant et avec beaucoup de beaucoup de blblaba avant et avec beaucoup de blblaba avant \url{https://www.une-url-tres-longue-qui-passe-sur-deux-pages.com/avec/un/chemin/tres/longne-url-tres-longue-qui-passe-sur-deux-pages.com/avec/un/chemin/tres/longne-url-tres-longue-qui-passe-sur-deux-pages.com/avec/un/}} \lipsum[6-7] \end{document} Environment: TeXLive 2026 Reproduces with pdfLaTeX, XeLaTeX, and LuaLaTeX hyperref (latest from TeXLive 2026) xcolor with dvipsnames Expected behavior: the URL should be rendered in blue on both pages. Observed behavior: the URL is blue on the first page, then turns black on the second page where the footnote continues. I also tried adding \DocumentMetadata{} before \documentclass (as suggested for the new LaTeX PDF management layer), but the problem persists. Is this a known limitation of hyperref? Is there a workaround short of preventing the URL from breaking across pages?

  • Placement of wraptable under minipages
    by Martin on May 21, 2026 at 6:26 pm

    I have two minipages side by side (the left one being larger than the right one) and want to have a wraptable under the right one (of same width). If I do this, I have 2 problem: The wraptable is wider than the minipage if I specify the same width. Why is this the case? Since the left minipage is larger, there is space beneath the right minipage. I want the wraptable to begin right under the smaller minipage. How can I do this? (I have multiple such pages, where the size of the smaller minipage may vary. How can I get the wraptable to the correct space automatically, depending on the space available) MWE: \documentclass{report} \usepackage{showframe} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document}\noindent \begin{minipage}[t][][b]{0.65\textwidth} \includegraphics[width=\textwidth]{example-image-a} \end{minipage} \begin{minipage}[t][][b]{0.34\textwidth} \begin{tabular}{cc} aa&aa\\aa&aa\\aa&aa\\ \end{tabular} \includegraphics[width=\textwidth]{example-image-b} \end{minipage} \begin{wraptable}{r}{0.34\textwidth} \begin{tabular}{cc} aa&aa\\aa&aa\\aa&aa\\aa&aa\\aa&aa\\aa&aa\\aa&aa\\aa&aa\\aa&aa\\ \end{tabular} \end{wraptable} \lipsum[1] \end{document}

  • Is that possible to extend the path pattern decoration solution with `nfold` and `offset`?
    by Explorer on May 21, 2026 at 5:18 pm

    This post is partly the follow-up of my previous question and the samcarter's excellent answer based on the "wheel". However, I came across a more easy solution with nfolds and offset here. Unfortunely, I found it only work with closed path, but not an open one: % Source - https://tex.stackexchange.com/a/738063 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{patterns,nfold} \makeatletter \tikzset{ remove inside/.code={% \tikzset{even odd rule}% \tikz@addmode{\pgfsyssoftpath@getcurrentpath\tikz@temp \pgfoffsetpath\tikz@temp{#1}}}} \makeatother \tikzset{ EDR/.style ={ line width=+1pt, preaction={remove inside=#13mm, fill=white},%<-add `fill=white' as preaction preaction={remove inside=#13mm, pattern=north west lines, pattern color=black!75} } } \begin{document} \begin{tikzpicture} \draw[thick,teal] (0,0) -- (10,4); \draw[EDR] (1,0) -- (4.5,1.5) -- (4,4) -- (1,3.5) -- (2.5,2) -- cycle; \draw[magenta,EDR=-] (5,0) rectangle (9,4) ; \draw[cyan,EDR] (6,1) rectangle (8,3); \end{tikzpicture} \begin{tikzpicture} \draw[EDR] (-3,0) -- (-1,0) -- (-1,2) -- (1,2) -- (1,0) -- (3,0); \draw[thick,teal] (-3,1) -- (3,1); \end{tikzpicture} \end{document} which gives: I wonder whether any extension could be added with the thought of nfold and \pgfoffsetpath?

  • LaTeX dash warnings and ISO8601 dates
    by ana on May 21, 2026 at 2:42 pm

    ISO 8601 dates are written as 2026-05-01. Using these dates in LaTeX generates errors of: Wrong length of dash may have been used. What is the solution to this? Suppress warning? Or use -- instead? Neither seems correct. -- Seems people need an example??? \documentclass{article} \begin{document} 2026-05-01 \end{document}

  • Can This Somewhat Long textnormal Title be Displayed Over Two Lines?
    by DDS on May 21, 2026 at 1:10 pm

    Consider the code: \documentclass[12pt]{book} \usepackage{bookman,scalerel} \textwidth=4.00in \begin{document} \thispagestyle{empty} \vstretch{2}{\textnormal{\Huge{{\bf CAN THIS SOMEWHAT LONG TITLE BE EASILY BROKEN?}}}} \end{document} which produces the output: QUESTION: How may I easily (without resorting to two separate such titles) break this \textnormal title into two pieces; say, "CAN THIS SOMEWHAT LONG TITLE" and "BE EASILY BROKEN?" with aesthetically sufficient vertical space between the two? Remark: Standard tricks such as vspace{8pt} or \\[8pt] do not work. Thank you.

  • When are variables in texmfcnf.lua used as opposed to texmf.cnf in TeX Live?
    by Snowrabbit on May 21, 2026 at 11:16 am

    I am using lualatex in the TeX Live distribution to generate pdf-files. The TeX Live installation is in a multi-user computer system, where users of TeX Live have read-only file permission to the installation. I have noted two configuration files, ../texlive/YYYY/texmf.cnf and ../texlive/YYYY/texmfcnf.lua where I interpreted the latter to be a configuration file for lualatex (but maybe that's incorrect?). Both files contains variables like TEXMFHOME, TEXMFVAR, TEXMFCONFIG but they are set to different search paths. When I run lualatex it seem to use values from ../texlive/YYYY/texmf.cnf and not the lua-file. When are the variables set in ../texlive/YYYY/texmfcnf.lua used? Is there a precedance order to use variables from ../texlive/YYYY/texmf.cnf and ../texlive/YYYY/texmfcnf.lua, for example if TEXMFVAR is not in the first file use it from the latter when lualatex run? Recommended reading about texmfcnf.lua?

  • Passing string from class option then using the string to load the corresponding key set
    by myhsia on May 21, 2026 at 10:09 am

    I configured a set of choices mode: {fooa, foob, bar}, which will be loaded as the class option. I also configured 3 set of keys: { fooa / set }, { foob / set }, { bar / set }. My goal is that when loading the class option, the string \g_classoption_mode_str will be set as the value of the key mode, then, the macro \docset #1 will execute \keys_set:nn { \g_classoption_mode_str / set } {#1}. For example, if I write \documentclass[mode = foob]{mycls} Then, \docset{} will load the key set: { foob / set }. The following is my MWE: In mycls.cls: I've assigned different initial values for the test -> \testtl key. \ProvidesExplClass {mycls} {2026-05-21} {v0.0.1} {} \str_new:N \g_classoption_mode_str \keys_define:nn { classoption } { mode .choices:nn = { fooa, foob, bar } { \exp_args:Ne \AtEndOfClass { \str_gset_eq:NN \g_classoption_mode_str \l_keys_choice_str } }, mode .initial:n = { fooa }, } \keys_define:nn { fooa / set } { test .tl_set:N = \testtl, test .initial:n = { fooa }, } \keys_define:nn { foob / set } { test .tl_set:N = \testtl, test .initial:n = { foob }, } \keys_define:nn { bar / set } { test .tl_set:N = \testtl, test .initial:n = { barr }, } \ProcessKeyOptions [ classoption ] \LoadClass { article } \DeclareDocumentCommand \docset { m } { \keys_set:nn { \g_classoption_mode_str / set } {#1} } In test.tex: \documentclass[mode = bar]{mycls} \docset{} \begin{document} \testtl 1 \end{document} Under this MWE, I hope \testtl will output fooa if the class option is mode = fooa, foob if the class option is mode = foob, bar if the class option is mode = barr. But the MWE returns the error: Missing control sequence inserted. <inserted text> Update: 2026-05-21 If I remove the line in .cls \exp_args:Ne \AtEndOfClass The error disappeared. But the output isn't right, if I type \documentclass[mode = fooa]{mycls} \testtl will output barr.

  • (Semi-)Globally set `table` options in `\addplot table`?
    by Denis Bitouzé on May 21, 2026 at 7:36 am

    Suppose I need to plot data from many files using pgfplots, and these files are not properly formatted (8 header lines not prefixed with % or #, and commas instead of periods as decimal separators). This can be managed using the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot table [skip first n=8,/pgf/number format/read comma as period] {data1.dat}; \addplot table [skip first n=8,/pgf/number format/read comma as period] {data2.dat}; \end{axis} \end{tikzpicture} \end{document} But it is tedious to have to specify these table options each time \addplot table appears. I haven't found any way in the pgfplots documentation to declare these parameters in a (semi-)global manner. Have I missed something?

  • Background picture for part page
    by Martin on May 20, 2026 at 9:07 pm

    I want to add a background picture for the page(s) that get created for using the \part command. But when I do this, the picture instead goes to the next side and not to the part page. How can I get the picture to the correct page? MWE: \documentclass{report} \usepackage{tikz} \usepackage[newparttoc]{titlesec} \usepackage{titletoc} \usepackage{tocloft} \titleformat{\part}[display]{\Huge\scshape\filright\centering}{}{20pt}{\thispagestyle{empty}} \titlecontents{part}[0pt]{\addvspace{2pc}\centering\large\bfseries}{}{}{} \begin{document} \part{A}\tikz[remember picture, overlay] \node[opacity=0.3, inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth, height=\paperheight]{example-image-a}}; \part{B}\tikz[remember picture, overlay] \node[opacity=0.3, inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth, height=\paperheight]{example-image-b}}; \end{document}

  • Spaces between steps in xcookybooky
    by Martin on May 20, 2026 at 9:02 pm

    When typesetting a recipe with the xcookybooky package, there is no space between the step numbers if the respective preparations are only in one line. How can I get spaces between the numbers like there are if the preparations have at least two lines? MWE: \documentclass{report} \usepackage{xcookybooky} \renewcommand{\step} {% \stepcounter{step}% \lettrine [% lines=2, lhang=0, % space into margin, value between 0 and 1 loversize=0.15, % enlarges the height of the capital slope=0em, findent=1em, % gap between capital and intended text nindent=0em % shifts all intended lines, begining with the second line ]{\thestep}{}% } \begin{document} \begin{recipe}{test} \preparation{ \step short \step short \step long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long \step short \step long long long long long long long long long long long long long long long long long long long long long long long long long long long \step short \step long long long long long long long long long long long long long long long long long long long long long long long \step short } \end{recipe} \end{document} EDIT: With the solution provided here (see next MWE), space will be added after each step, even if there already was space (it seems like prevgraf is 0 in each case). MWE2: \documentclass{report} \usepackage{xcookybooky} \renewcommand{\step} {% \stepcounter{step}% \lettrine [% lines=2, lhang=0, % space into margin, value between 0 and 1 loversize=0.15, % enlarges the height of the capital slope=0em, findent=1em, % gap between capital and intended text nindent=0em % shifts all intended lines, begining with the second line ]{\thestep}{}% } \usepackage{xpatch} \pretocmd{\lettrine}{\checklettrine}{}{} \newcommand{\checklettrine}{% \ifnum\prevgraf<2 \vspace{\baselineskip}\fi } \begin{document} \begin{recipe}{test} \preparation{ \step short \step short \step long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long \step short \step long long long long long long long long long long long long long long long long long long long long long long long long long long long \step short \step long long long long long long long long long long long long long long long long long long long long long long long \step short } \end{recipe} \end{document}

  • Change the font size of title 'Contents' ('List of Figures', List of Tables') in header and body separately
    by W.J on May 20, 2026 at 8:08 pm

    The following is an MWE. My question is how to change the font size of 'Contents' (by the way, 'List of Figures', 'List of Tables') in header and body separately? That is to say, for example, how to change the size of the title 'Contents' on the contents page, while dispaly it in header according to the size command in \fancyhead (same question for 'List of Figures' and 'List of Tables')? \documentclass{book} \usepackage{lipsum} \renewcommand{\contentsname}{\Large Contents} % **The points where problems occur** \renewcommand{\listfigurename}{\Large Figure} \renewcommand{\listtablename}{\Large Table} \begin{document} \frontmatter \tableofcontents \listoffigures \listoftables \mainmatter \chapter{Cha1} \section{sec1} \lipsum[1-8] \end{document} Unfortunately, the \renewcommand command simultaneously change the size in the header, even when I use the package fancyhdr to design a new page style as follows, where the size command in \fancyhead doesn't work for 'Contents', 'List of Figures' or 'List of Tables' at the time. \documentclass{book} \usepackage{fancyhdr} \pagestyle{fancy} \fancypagestyle{frontmatterstyle}{ \fancyhf{} \fancyhead[EC]{\footnotesize\leftmark} % **Size command doesn't work for contentsname/listfigurename/listtablename in header** \fancyhead[OC]{\footnotesize Test} } \usepackage{lipsum} \renewcommand{\contentsname}{\Large Contents} % **The points where problems occur** \renewcommand{\listfigurename}{\Large Figure} \renewcommand{\listtablename}{\Large Table} \begin{document} \frontmatter \pagestyle{frontmatterstyle} \tableofcontents \listoffigures \listoftables \mainmatter \chapter{Cha1} \section{sec1} \lipsum[1-8] \end{document} I tried the relevant packages like sectsty, titlesec or tocloft, but I still failed. I don't know how to change them separately. Could someone do me a favor? Thanks a lot!

  • Marks inside of boxes and \mark_get_marks_for_reinsertion:nNN
    by David Purton on May 20, 2026 at 2:49 pm

    LaTeX marks inserted inside of boxes are ignored. I want to set some material inside a \vbox then split that box if needed to allow for a page break. There are marks inserted inside the \vbox and I want them to work as normal across the page break. It seems like this should be possible using \mark_get_marks_for_reinsertion:nNN, but I don't understand how to make it work. How can I recover marks from the \vbox around the split? Here's a MWE example showing what I mean and what I want: \documentclass[twocolumn]{article} \usepackage{parskip} \ExplSyntaxOn \mark_new_class:n { dcp } \tl_new:N \g_dcp_first_box_mark_tl \tl_new:N \g_dcp_last_box_mark_tl \cs_new_protected:Npn \mk #1 { \textsuperscript {#1} \mark_insert:nn { dcp } {#1} \tl_if_empty:NT \g_dcp_first_box_mark_tl { \tl_gset:Nn \g_dcp_first_box_mark_tl {#1} } \tl_gset:Nn \g_dcp_last_box_mark_tl {#1} } \ExplSyntaxOff \usepackage{fancyhdr} \fancyhf{} \lhead{First Mark: \FirstMark[previous-column]{dcp}; Last Mark: \LastMark[previous-column]{dcp} (I want 3)} \rhead{First Mark: \FirstMark[column]{dcp} (I want 4); Last Mark: \LastMark[column]{dcp}} \pagestyle{fancy} \begin{document} I can get the first mark inside \verb+\l_tmpa_box+ by saving it globally. \ExplSyntaxOn \vbox_set:Nn \l_tmpa_box { \hbox:n { \mk { 1 } Some ~ text. } \hbox:n { \mk { 2 } Some ~ text. } \hbox:n { \mk { 3 } Some ~ text. } \hbox:n { \mk { 4 } Some ~ text. } \hbox:n { \mk { 5 } Some ~ text. } \hbox:n { \mk { 6 } Some ~ text. } } \int_set:Nn \vbadness { 10000 } \vbox_set_split_to_ht:NNn \l_tmpb_box \l_tmpa_box { 8ex } \mode_leave_vertical: \mark_insert:nn {dcp} { \g_dcp_first_box_mark_tl } \box_use_drop:N \l_tmpb_box \ExplSyntaxOff How can I know what the last mark inserted before the split was so that I can re-insert it after \verb+\l_tmpb_box+ is used? \newpage And similarly, how can I know what the first mark after the split was so that I can re-insert it before \verb+\l_tmpa_box+ is used? \ExplSyntaxOn \mode_leave_vertical: \box_use_drop:N \l_tmpa_box \mark_insert:nn {dcp} { \g_dcp_last_box_mark_tl } \ExplSyntaxOff I can get the last mark in \verb+\l_tmpa_box+ by saving it globally. \end{document}

  • How can I run this hello world C code from TeX using Lua's ffi?
    by Jasper on May 20, 2026 at 12:49 pm

    How can I run this hello world C code from TeX using Lua's ffi? See https://luajit.org/ext_ffi.html Edit: This problem was produced on Windows 11. I solved it by using Linux, as was suggested in an answer. \documentclass{article} \usepackage{luacode} \begin{document} \begin{luacode*} local ffi = require("ffi") ffi.cdef[[ int printf(const char *fmt, ...); ]] ffi.C.printf("Hello %s!", "world") \end{luacode*} Test \end{document} (./test.aux)[\directlua]:5: failed to find function/global printf stack traceback: [C]: in metamethod '__index' [\directlua]:5: in main chunk. \luacode@dbg@exec ...code@maybe@printdbg {#1} #1 } l.10 \end{luacode*}

  • Defining a detailed operational amplifier subcircuit (with input/output anchors) in circuitikz
    by Marco Moldenhauer on May 20, 2026 at 12:45 pm

    I am trying to create an electrical circuit symbol motivated by the textbook Engineering Circuit Analysis (Edition 8, Hayt, Page 192, Figure 6.24). Here is the reference image of what I am trying to achieve: I want to define this into a new symbol in circuitikz. Ideally, I am looking for an elegant way to define this with three main anchor points: NodePlus, NodeMinus, and NodeOut. What is the best/most elegant way to wrap this drawing into a reusable component where I can easily connect wires to the three defined input/output nodes? my code \documentclass{article} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \node (NodeMinus) at (0,0) {}; \node (NodePlus) at (0,3) {}; \node (NodeOut) at (6,1.5) {}; %% input resistor \draw(NodeMinus.center) node[above]{$-$} to[short, o-] ++(1,0) node[below]{$-$} to[R, l_=$R_i$] (1,3) node[above]{$+$} to[short, -o] (NodePlus.center) node[below]{$+$}; %% input voltage label \path(NodeMinus.center) -- (NodePlus.center) node[midway]{$v_d$}; %% output voltage source and output resitor \draw(NodeOut.center) to[short, o-] ++(-1,0) -- ++(0,1) to[R,l_=$R_o$] ++(-2,0) to[american controlled voltage source, l=$A\cdot v_d$] ++(0,-2.5) node[ground]{}; \end{circuitikz} \end{document} my output THANKS to the community (here my final solution) \documentclass{article} \usepackage{circuitikz} \usetikzlibrary{tikzmark} \begin{document} \tikzset{pics/myOA/.style={ code={ \coordinate (-NodeMinus) at (-.5,0) {}; \coordinate (-NodePlus) at (-.5,2) {}; \coordinate (-NodeOut) at (6.5,1) {}; %% input resistor \draw(-NodeMinus.center) node[above]{$-$} to[short, o-] ++(1.5,0) node[below]{$-$} to[R, l_=$R_i$] (1,2) node[above]{$+$} to[short, -o] (-NodePlus) node[below]{$+$}; %% input voltage label \path(-NodeMinus) -- (-NodePlus) node[midway]{$v_d$}; %% output voltage source and output resitor \draw(-NodeOut.center) to[short, o-] ++(-2.2,0) -- ++(0,0.65) to[R,l=$R_o$] ++(-1.8,0) to[american controlled voltage source, name=VCVS] ++(0,-1.7) node[ground]{} (VCVS) node[right=6pt,yshift=-10pt] {$A\cdot v_d$}; %% equilateral triangle, adjust it \draw (0.5,-2) -- (0.5,4) -- ({0.5+3*sqrt(3)},1) -- cycle; } } } \begin{circuitikz}[european] \draw (0,0) pic(detailedOpAmp){myOA}; \draw[red] (detailedOpAmp-NodeOut) -- ++(1,-1); \draw[red] (detailedOpAmp-NodePlus) -- ++(-1,1); \draw[red] (detailedOpAmp-NodeMinus) -- ++(-1,-1); \end{circuitikz} \end{document}

  • L3kernel latest update introduce an incompatibility with TikZ library `spath3`?
    by brunoh on May 20, 2026 at 11:16 am

    After updating the l3kernel package to its latest version, I cannot compile anymore my Latex Files and I get the following error message in my console window /usr/local/texlive/2026/texmf-dist/tex/latex/spath3/spath3.sty:3112: LaTeX Error: Variant form same as base fo rm '\spath_maybe_gsplit_curve:NNn'. For immediate help type H <return>. ... l.3112 ...\spath_maybe_gsplit_curve:NNn {NNn, NNV} My preamble use librairies from TikZ. Hopefully using Texlive Utility I was able to restore my installation to the previous version before the update. What else could be done to get around this incompatibility?

  • How to convert pdflatex to latex?
    by Hania Yaseen on May 19, 2026 at 7:27 am

    How to convert pdflatex to latex so we don't have to use package epstopdf and we can directly run eps figures without converting them into pdf.

  • Lualatex error when adding accent package with oldStandard math package and unicode-math
    by Nasser on May 19, 2026 at 7:09 am

    I am using code from Old math fonts with proper math table which works great. I'd like to use that font. But once I add package accents lualatex gives error. I am using laulatex with TL 2026 on Linux Ubuntu Here is MWE (same code as above in preamble) \documentclass[12pt]{article} \usepackage{microtype} \usepackage{unicode-math} \setmainfont[% ItalicFont=OldStandard-Italic.otf, BoldFont=OldStandard-Bold.otf, BoldItalicFont=OldStandard-BoldItalic.otf, SmallCapsFeatures={Numbers=OldStyle}, FakeBold=0.1]{OldStandard-Regular.otf} \setmathfont[FakeBold=1]{OldStandard-Math.otf} \usepackage{amsmath} \usepackage{accents} \begin{document} \[ \left( i-1\right) \bar{z}=\left( 2-3i\right) ^{2}% \] \end{document} Compiled using lualatex gives >lualatex 4.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) restricted system commands enabled. (./4.tex LaTeX2e <2025-11-01> .... ex))) (/usr/local/texlive/2026/texmf-dist/tex/latex/accents/accents.sty) (./4.aux) ! Missing number, treated as zero. <to be read again> \protect l.19 \left( i-1\right) \bar{z} =\left( 2-3i\right) ^{2}% ? If I comment out the accent package, then everything works fine >lualatex 4.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) restricted system commands enabled. .... Output written on 4.pdf (1 page, 6142 bytes). Transcript written on 4.log. > I also saw an answer here Is accents package incompatible with unicode-math? which says to load the accent package before unicode-math But this did not work for me. \documentclass[12pt]{article} \usepackage{accents} \usepackage{microtype} \usepackage{unicode-math} \setmainfont[% ItalicFont=OldStandard-Italic.otf, BoldFont=OldStandard-Bold.otf, BoldItalicFont=OldStandard-BoldItalic.otf, SmallCapsFeatures={Numbers=OldStyle}, FakeBold=0.1]{OldStandard-Regular.otf} \setmathfont[FakeBold=1]{OldStandard-Math.otf} \usepackage{amsmath} \begin{document} \[ \left( i-1\right) \bar{z}=\left( 2-3i\right) ^{2}% \] \end{document} Now I get this error >lualatex 4.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) .... (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsopn.sty) ! LaTeX Error: Command \dddot already defined. Or name \end... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.746 \hbox{\,\normalfont...}\vss}}}} ? I'd like to use accent package for something else. I was wondering why this happens and if it is possible to use the accent package with this font?

  • How do I suppress MetaFun’s “overloading primitive” log messages?
    by Harry on May 19, 2026 at 6:07 am

    In ConTeXt/MetaFun, I am intentionally saving/redefining primitive tokens locally. For example: \starttext \startMPcode def my_example = begingroup; save [; save ]; endgroup; enddef; my_example; \stopMPcode \stoptext This produces a log message like: metafun > log > overloading primitive '[' metafun > log > overloading primitive ']' Is there a supported way to disable or suppress these specific MetaFun diagnostic messages? I am not trying to hide TeX errors or MetaPost errors generally. I only want to suppress MetaFun’s informational logging about primitive overloading inside specific macros, because the logging is becoming unmanageable, i.e., hundreds of lines during just testing alone.

  • Having an Elliptical Frame Go Around the Elliptical Image (on the Outside)
    by DDS on May 18, 2026 at 8:56 pm

    Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} %\definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.235} \definecolor{Gold}{RGB}{228,168,73} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \clip (0,0) ellipse[x radius=4.25cm, y radius=5.5cm]; %\fill[cadmiumgreen] ellipse[x radius=4.25cm, y radius=5.5cm]; \node at (0,0) {\includegraphics[scale=1.31,clip, trim = 0 0 0 0]{example-image-a}}; \draw[line width=12pt,Gold!75!black] (225:4.25cm and 5.5cm) arc[start angle=225, end angle=-45, x radius=4.25cm, y radius=5.5cm]; \end{tikzpicture} \end{center} \end{document} with the output: QUESTION: How may I get the from to go around the ellipse on the outside? (In other words, I don't want any part of the interior of the elliptical image to be covered by the frame.) Thank you.

  • Remove extra vertical spacing with boxpos=t in listings
    by Bordaigorl on May 18, 2026 at 8:27 pm

    I want to put few listings using lstlisting in a tabular. They are of varying number of lines, so I'd like them to appear aligned at the top. I know I can control vertical alignment using the boxpos=t parameter. It works but inserts extra space at the top which for the life of me I cannot remove. The second table is almost perfect, how do I remove the extra empty line at the top? And why is it there? MWE: \documentclass[acmsmall]{acmart} \usepackage{listings} % for good measure: \lstset{aboveskip=0pt,belowskip=0pt} \begin{document} Spacing is good but vertically centered: \begin{tabular}{cc} \hline \begin{lstlisting} hello := "world"; there := 1; \end{lstlisting} & \begin{lstlisting} hello := "world"; there := 1; there := 1; \end{lstlisting} \\\hline \end{tabular} \bigskip Aligned at top by \texttt{[boxtop=t]} but extra space: \begin{tabular}{cc} \hline \begin{lstlisting}[boxpos=t] hello := "world"; there := 1; \end{lstlisting} & \begin{lstlisting}[boxpos=t] hello := "world"; there := 1; there := 1; \end{lstlisting} \\\hline \end{tabular} \end{document}

  • How to define a new labeled list environment (max depth = 1, label count = 2 or possibly alternating) for the two cases of mathematical induction?
    by Nyx on May 18, 2026 at 12:40 pm

    Here is my MWE: % !TEX program = lualatex \documentclass{article} \usepackage{enumitem} \usepackage{amsthm} \usepackage{unicode-math} \usepackage[default]{fontsetup} % For NewCM \usepackage{scalerel} % For \widthof \usepackage{kantlipsum} % For placeholder text % Redefine proof environment \NewEnvironmentCopy{oldproof}{proof} \renewenvironment{proof}[1][\proofname]{% \oldproof[\bfseries#1]% }{\endoldproof} % Configure list environments \setlist{% nosep, align = left, itemindent = 0pt, font = \normalsize\normalfont, before = \normalsize\normalfont } \newlist{inductioncases}{enumerate}{1} \setlist[inductioncases]{% leftmargin = \widthof{(Base case)} + 4pt, label = (Base case), labelsep = 4pt, labelwidth = \widthof{(Base case)}, listparindent = \parindent } % Number sets \newcommand*{\numberset}[1]{\symbf{#1}} \newcommand*{\nonnegativeintegers}{\numberset{Z}_{\geq 0}} \begin{document} \begin{proof} \begin{inductioncases} \item \kant[1][1-2] We have shown that \(P(0)\) is true. \item[(Induction step)] \kant[2][1-2] We have shown that for every \(k\) in \(\nonnegativeintegers\), \(P(k)\) being true implies \(P(k + 1)\) is true. \end{inductioncases} Therefore, by the principle of mathematical induction, we have sufficiently proven that for every \(n\) in \(\nonnegativeintegers\), \(P(n)\) is true. \end{proof} \end{document} I suppose I'm looking for a conditional/if-else way of labeling odd-numbered inductioncases \items with (Base case) and labeling even-numbered inductioncases \items with (Induction step). How would I achieve this?

  • Line across sphere
    by Sokoban on May 18, 2026 at 12:21 pm

    I am currently solving some Putnam problems for fun, and I wanted to visualize a few geometry questions. One exercise goes as follows: Let S be a spherical cap, where the distance between two points is given by the length of the shortest great-circle arc. Then there is no distance-preserving mapping to the Euclidean plane. I solved the exercise (which is not particularly difficult), and now I want to visualize the cap. I managed to draw almost everything except the distance between the north pole and a point on the rim of the cap. This is what I have so far: \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=3] \draw (0,0) circle (1); \draw[thick] (-1,0) arc (180:360:1 and 0.28); \draw (-1,0) arc (180:0:1 and 0.28); \draw[dashed] (-0.85,0.5) arc (180:360:0.85 and 0.18); \draw[dashed] (-0.85,0.5) arc (180:0:0.85 and 0.18); \fill (0,1.) circle (0.015); \node[right] at (0,1.1) {$N$}; \fill (0,0.5) circle (0.015); \node[left] at (0,0.5) {$O$}; \coordinate (P) at (0.85,0.5); \fill (P) circle (0.015); \draw[thick] (0,0.5) -- (P); \node[above] at (0.4,0.5) {$r$}; \node[blue,right] at (0.45,0.93) {$R$}; \node[left] at (-0.88,0.55) {$C$}; \end{tikzpicture} \end{document} What is still missing is a spherical arc from the north pole to the rim. However, I would like it to appear three-dimensional, rather than like the current 2D curve, but instead more like this: I tried my best, but I have no idea how to achieve this. Can someone help me? Also, I think I only need the spherical cap itself, not the entire sphere.

  • Why are `{` and `}` printed as `-` and `"` instead of as themselves when their category codes are changed to normal letters?
    by H4XeO6 on May 18, 2026 at 2:22 am

    Here is my minimal example (main.tex): \catcode`\{=11 \catcode`\}=11 hello}{ \bye I compiled it with tex main && dvipdfmx main.dvi and obtained main.pdf, which contains a single page printed as hello˝–. Actually, the issue could fixed up when I switch to a typewriter font: \catcode`\{=11 \catcode`\}=11 \tt hello}{ \bye Why does the default font produce this unexpected output? What is the underlying reason?

  • Effects of "intertext" within "align"
    by Michael Hardy on May 17, 2026 at 9:48 pm

    In the code below, the use of "intertext" with the words "and in general" has the effect that instances of ":=" above and below those words will be vertically aligned with each other. However, the last "intertext" near the end, was a (possibly misguided?) attempt to prevent that last phrase, beginning with the word "where", getting separated from what appears above it in case the house style of a publication to which I will submit this does not allow display breaks. But this causes extra vertical blank space to appear below that phrase: the space where something would appear on the next line if there were a next line. Is there a simple way to prevent a page break between the "where" phrase and the stuff above it without getting that extra which space below that? \begin{align} f_0\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{even } n\ge0} (-1)^{n/2} \sum_{A\in\binom In} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ \label{sine of sum} f_1\big( (\alpha)_{\alpha\in I} \big) : = % \sin \sum_{\alpha\in I} \alpha = {} & \sum_{\text{ odd } n\ge1} (-1)^{(n-1)/2} \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ f_2\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{even } n\,\ge\,2} (-1)^{(n-2)/2} n \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ f_3\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{ odd } n\,\ge\,3} (-1)^{(n-3)/2} (n-1) \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \intertext{and in general,} f_i\big( (\alpha)_{\alpha\in I} \big) := {} & \!\!\!\! \sum_{\begin{smallmatrix} n \, \ge\,i \\ n\,\equiv\,i\bmod 2 \end{smallmatrix}} (-1)^{(n-i)/2} c_i(n) \sum_{A\in\binom In} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha \intertext{where $c_i(n)$ is the minimal polynomial of the set $\{\,n\in\{\,0,1,2,\ldots,i-1\,\} : n\equiv i\bmod2\,\}$.} \nonumber \end{align}