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

  • Advice for TeX Live installation and post-installation actions in a multi-user system
    by Snowrabbit on May 22, 2026 at 1:34 pm

    We will have a later version of TeX Live installed in a multi-user system (Linux). The system is a bit special in the sense that no updates will be made once the installation is complete (good or bad is debatable, but it is what it is). Users have read-only file permission to the installation. Any additions that a user wishes, they can make locally. Beyond what is mentioned in the TeX Live Guide, are there any more tips and recommendations for installation and post-installation actions? TeX Live updmap and fmtutil are generally recommended to have in system mode. But for a installation that will not receive updates, is it better to have these in user mode? The non-system variables in texmf.cnf TEXMFHOME = ~/texmf TEXMFVAR = ~/.texliveYYYY/texmf-var TEXMFCONFIG = ~/.texliveYYYY/texmf-config The non-system variables in texmfcnf.lua TEXMFHOME = "home:texmf", TEXMFVAR = "home:texmf/texmf-var", TEXMFCONFIG = "home:texmf/texmf-config",

  • Custom acronym capitalisation using glossaries-extra?
    by amdnim on May 22, 2026 at 12:48 pm

    I'm using the glossaries-extra package for acronyms, and am using it like so to have it in lowercase in text and titlecase in the glossary: \setabbreviationstyle[acronym]{long-short} \glssetcategoryattribute{acronym}{glossdesc}{title} \MFUhyphentrue And this works great. My issue is with an "irregular" acronym like XML (eXtensible Markup Language), or FLOP (FLoating point OPerations) where titlecase isn't enough. Is it possible to have custom titlecase for specific acronyms in the glossary? Failing that, is it possible to disable the titlecase for specific acronyms?

  • How to specify date-written and date-published in biblatex
    by Frisket on May 22, 2026 at 12:05 pm

    What is the best way to encode (for example) an entry from a diary which has been published in book form centuries later? At the moment, it seems the standard styles are unable to handle this, eg: @incollection{pepys-early, author={Samuel Pepys}, title={Up by candlelight}, date={1666-01-02}, booktitle={Pepys' Diary}, year={1928}, editor={A N Other}, publisher={George Morrow}, location={Edinburgh} } This generates the message WARN - Overwriting field 'year' with year value from field 'date' The origdate field is unsupported in the standard styles, it seems. How do others handle the modern publication of old writings, poems, letters, articles, etc with this kind of date disparity?

  • 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?

  • Can't change figure caption sizing when using \DocumentMetadata{}
    by Rachel Birchmier on May 21, 2026 at 9:48 pm

    I am trying to make captions smaller but since adding metadata for alt text use I cannot control the caption size! The document starts with this: \DocumentMetadata{} \documentclass[12pt]{report} and then I have the other packages including the tag PDF and caption parts of the pre-amble. I have tried them in different order and have tried putting the caption part basically everywhere, but the font is stuck at the default. %tag PDF \usepackage{tagpdf} \tagpdfsetup{ activate-all, uncompress, tabsorder=structure, nofloat=true } % Caption setup \usepackage{caption} \usepackage{subcaption} \captionsetup{ font=footnotesize, labelfont=bf } The goal would be to have small footnotsize captions while also being able to use alttext to describe figures. If I remove the \DocumentMetadata{} and tag PDF sections the captions fontsize can be changed by putting the caption block anywhere in the preamble.

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

  • How to avoid code duplication in path along with patterns?
    by Explorer on May 21, 2026 at 1:06 pm

    Here below is my original code: \documentclass[tikz,border=5pt]{standalone} \usepackage{fourier} \usetikzlibrary{bending,patterns.meta,angles,quotes} \begin{document} \begin{tikzpicture}[>=latex] \draw[thick,->] (0,0) -- (10,0) node[below] {$x$}; \draw[thick,->] (0,0) -- (0,-3) node[right] {$y$}; \draw[ultra thick] (7,2) -- (7,0) coordinate (A) -- (8,0) -- (8,-4) -- (7,-4) coordinate (B) -- (7,-6); %%%%%%%%%%%%%%%% path coordinate duplicated \fill[pattern={Lines[angle=-45,distance={5pt}]},preaction={fill=white}] (7,2) -- (7,0) -- (8,0) -- (8,-4) -- (7,-4) -- (7,-6) -- ++(.5,0) -- ++(0,+1.5) -- ++(1,0) -- ++(0,+5) -- ++(-1,0) -- ++(0,1.5) -- cycle; %%%%%%%%%%%%%%%% \draw(0,0) node[label={[label distance=-2.5mm]above left:$O$}] (O) {} -- (7,-4) pic[draw,<->,angle radius=2cm,angle eccentricity=1.15,"$\alpha$"] {angle = B--O--A}; \end{tikzpicture} \end{document} which gives: However, the path: (7,2) -- (7,0) -- (8,0) -- (8,-4) -- (7,-4) -- (7,-6) appeared twice, and I think that is duplicated. How to avoid and make the code more neater?

  • 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?

  • adding \everydisplay{\Umathoperatorsize\displaystyle=5ex} gives error using split inside equation
    by Nasser on May 21, 2026 at 7:33 am

    I wanted to make the integral sign larger. Saw accepted answer in TeX Gyre Pagella Math Integral sign much too small which says to use \everydisplay{\Umathoperatorsize\displaystyle=5ex} I added it and it worked. But when I tried to compile old file which was using \begin{split} .. \end{split} inside equation I get lualatex error. Note the code did not have alignment & inside the equation. I read now that split likes to have & in the long equation. But this old code compiled OK as is for years with no error. Only when I just added \everydisplay I see this error ! Package amsmath Error: \begin{split} won't work here. I can change my Latex to use multline may be. But the question is why this error? Is this known error? Can I still keep the above \everydisplay and keep using the split? Or may be I should look for different way to make the integral sign larger than this method. I am using texlive 2026 on linux. MWE \documentclass[12pt]{article} \usepackage{amsmath} \everydisplay{\Umathoperatorsize\displaystyle=5ex} \begin{document} $\int \sin x dx$ \begin{equation*} \begin{split} 0.0412493 x-0.0826459 x^3+0.0416667 x^4-0.00034374 x^5-1.51283*10^-8 x^6\\ +0.0000984213 x^7-0.0000248515 x^8 +1.64129*10^-7 x^9-3.28259*10^-8 x^{10} \end{split} \end{equation*} \end{document} Compiled >lualatex 5.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) restricted system commands enabled. (./5.tex LaTeX2e <2025-11-01> L3 programming layer <2026-03-20> (/usr/local/texlive/2026/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/2026/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2026/texmf-dist/tex/latex/l3backend/l3backend-luatex.def) (./5.aux) ! Package amsmath Error: \begin{split} won't work here. See the amsmath package documentation for explanation. Type H <return> for immediate help. ... l.12 \end{split} ? Commenting out \everydisplay{\Umathoperatorsize\displaystyle=5ex} now it compiled OK and gives expected result with no error. You see, it did split it, even though there is no & inside the equation. Error only shows when adding \everydisplay

  • 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!

  • Compatibility between a math font .ttf with mtpro2
    by Sebastiano on May 20, 2026 at 7:17 pm

    I was looking for Mathematical Pi One/Two/... clones these days. I noticed that in an old question of mine, I was looking for Mathematical Pi One fonts but at that time I knew almost nothing about how to define and use .ttf fonts in a .tex document. I was experimenting with the following complete example using Arrus BT: \documentclass{article} \usepackage{unicode-math} %\usepackage[lite]{mtpro2} \newfontface\ArrusBT[ ]{arrusbtroman.ttf} \AtBeginDocument{ \newcommand\piN{\mathord{\text{\ArrusBT\symbol{"03C0}}}} } \begin{document} $C=2\piN r$ \end{document} but the use of mtpro2 (lite) with unicode-math generates incompatibilities for me (related mtpro2 and unicode-math). Is it currently possible to overcome this problem with expl3 or other tricks working with XeLaTeX or LuaLaTeX?

  • expanding an argument to control case in \href
    by troy on May 20, 2026 at 5:31 pm

    I see that there some questions and answers related to expanding arguments, but I just don't seem to get it. I'm writing a document in which I'd like to include hyperlinks to our institutional website. I want a macro like \mcmd{Opt}{report} that expands to \href{https://foo.com/extra/ui/command/Opt/ReportCmd.html}{\texttt{Opt.report}}. The problem I'm having is all about transforming "report" into "Report". I'm using the \mdoc macro for other links. Here's my MWE: \documentclass{article} \usepackage{mfirstuc} \usepackage{hyperref} \newcommand{\varn}[1]{\texttt{#1}} \newcommand{\mdoc}[2]{\href{https://foo.com/extra/#1}{#2}} \newcommand*{\mcmd}[2]{\mdoc{ui/command/#1/#2Cmd.html}{\varn{#1.#2}}} \newcommand*{\mcmdu}[2]{\mdoc{ui/command/#1/\makefirstuc{#2}Cmd.html}{\varn{#1.#2}}} \begin{document} \mcmd{Opt}{report} \mcmdu{Opt}{report} \end{document} but \mcmd{Opt}{report} gives me "\href{https://foo.com/extra/ui/command/Opt/reportCmd.html}{\texttt{Opt.report}}". I want "Opt/reportCmd.html" to be "Opt/ReportCmd.html" but "Opt.report" to stay as is. I've tried using \makefirstuc in my \mcmdu macro, but it's not expanding the way I need it to. \mcmdu{Opt}{report} seems to give me \href{https://foo.com/extra/ui/command/Opt/%5Cmakefirstuc%2520%7Breport%7DCmd.html}{\texttt{Opt.report}} I get the impression that this is easier in LaTeX3. While I need to spend some hours learning LaTeX3, I welcome solutions using LaTeX3 or LaTeX2e. I'm happy to have anything that works 🙂 EDIT 5/20: I absentmindedly left out that I need this to preserve case after the first character (for camel-case inputs): \mcmd{Opt}{initCov} should return \href{https://foo.com/extra/ui/command/Opt/InitCovCmd.html}{\texttt{Opt.initCov}}

  • Adding negative vertical space in a complex array macro
    by Stefan Müller on May 20, 2026 at 4:39 pm

    I have a macro for typesetting AVMs depending on the font it is used the distance between the top of the AVM and the type (the first word in italics) is too large. I do not know the reason for this and more importantly, I have no idea how to fix it. It seems to be dependent on the word that is used. "extraposition" in the examples below. The MWE uses either the class scrartcl or langsci-book. langsci-book uses a different font and the problem appears. How can this be solved? A preferred solution would one that does not require manual correction. \documentclass[smallfont]{langscibook} % \documentclass{scrartcl} \usepackage{array} \usepackage{booktabs} \newcommand{\nliste}[1]{% \mbox{$\langle$\upshape\normalfont#1$\rangle$}% } \newcommand{\ms}[2][]{% \ifdim\lastskip=-1pt % flag value \mbox{}\\*[-.8\baselineskip]% \else \ifnum\lastpenalty=-10000 % other flag value \mbox{}\\*[-.8\baselineskip]% \fi \fi \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt\tabcolsep=0pt% $\hspace{-2pt}\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else \multicolumn{2}{>{\normalfont\itshape}l}{#1}% \\% \fi% #2% \end{tabular}% \right]\hspace{-2pt}$% }% % \par\vspace{1mm}% \vspace{1mm}% } \newcommand{\ibox}[1]{{% \setlength{\fboxsep}{1.25pt}% \fbox{$\scriptstyle #1$}% }} \newcommand{\ind}[1]{\mbox{$_{\ibox{#1}}$}} \begin{document} \ms[extraposition]{ cat & \ms{ subj & \nliste{ \ibox{2} }\\ comps & \nliste{ \ldots{} \ibox{1} \ldots{} }\\ arg-st & \ms{ add-arg & \nliste{ \ldots{} \ibox{2} \ldots{} }\\ arg-list & \nliste{ \ldots{} \ibox{2} NP$_{it}$ \ldots{} \ibox{1} S[\emph{fin}] }\\ }\\ }\\ } \end{document} Edit: I think I now found the reason for my frustration. The space at the top depends on what else is in the AVM. The distance at the top of the AVM to "person" is different in the two AVMs. If you uncomment the code for the Mutter-AVM it gets worse. So maybe the array package is doing the harm and something else that does not add or remove space should be used. \documentclass{scrartcl} \usepackage{array} \newcommand{\ms}[2][]{% \ifdim\lastskip=-1pt % flag value \mbox{}\\*[-.8\baselineskip]% \else \ifnum\lastpenalty=-10000 % other flag value \mbox{}\\*[-.8\baselineskip]% \fi \fi \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt\tabcolsep=0pt% $\hspace{-2pt}\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else % https://tex.stackexchange.com/a/762975/18561 % no added vertical spacing on top %\omit\span\omit \normalfont\itshape #1\hfill\mbox{}% % some points of vertical space on top added back in \omit\span\omit \normalfont\itshape\vrule height7pt width0pt\relax #1\hfill\mbox{}% \\\noalign{\vspace{2pt}}% \fi% #2% \end{tabular}% \right]\hspace{-2pt}$% }% % \par\vspace{1mm}% \vspace{1mm}% } \begin{document} \ms[person]{ vorname & Julia\\ nachname & Warbanow $\vee$ Barbanow\\ } \ms[person]{ vorname & max\\ nachname & meier\\ geburtstag & 10.10.1985\\ %mutter & \ms[person]{ % vorname & anna\\ % nachname & meier\\ % }\\ } \end{document}

  • 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}

  • How to make tikzcd diagram possible [closed]
    by Hamza Ayub on May 19, 2026 at 7:30 pm

    I’ve been trying to make this image in LaTeX, but I’m not able to replicate it at all. The uppermost and lowermost down-arrow are becoming super squished. Any help in reproducing it would be really appreciated. Thank you. Edit: here is the code I used and by super squished i mean the downarrow is not visible as you can see by running the code... \[ \begin{tikzcd}[column sep=huge] \mathcal{C} \arrow[r, bend left=80, "I\circ F"{name=IF}] \arrow[r, bend left=40, "J\circ F"{name=JF}] \arrow[r, "J\circ G"{inner sep=0,fill=white,anchor=center,name=JG}] \arrow[r, bend right=40, "K\circ G"'{name=KG}] \arrow[r, bend right=80, "K\circ H"'{name=KH}] \arrow[from=IF.south-|JG,to=JF.north-|JG,Rightarrow,shorten=4pt,"\gamma F"] \arrow[from=JF.south-|JG,to=JG,Rightarrow,shorten=4pt,"J\alpha"] \arrow[from=JG,to=KG.north-|JG,Rightarrow,shorten=4pt,"\delta G"] \arrow[from=KG.south-|JG,to=KH.north-|JG,Rightarrow,shorten=4pt,"K\beta"] & \mathcal{E}. \end{tikzcd} \] this is the ususal procedure i use when there are less arrows (inspired by an answer which i cannot recall whome) and it works but it does not for 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?