• \autoref gives wrong type for equations
    by Akira on August 1, 2026 at 7:12 pm

    I have a tex file % Source - https://tex.stackexchange.com/a/737442 % Posted by Akira, modified by community. See post 'Timeline' for change history % Source - https://tex.stackexchange.com/a/737439 % Posted by egreg, modified by community. See post 'Timeline' for change history % Retrieved 2026-08-01, License - CC BY-SA 4.0 \documentclass{article} \usepackage{aliascnt} \usepackage{amsthm} \usepackage{mathtools} % before hyperref \mathtoolsset{showonlyrefs} \usepackage[notcite,notref]{showkeys} \usepackage[hypertexnames=false]{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=blue, urlcolor=red, citecolor=magenta } \numberwithin{equation}{section} \newtheorem{theorem}{Theorem}[section] \newcommand{\addtheorem}[2]{% \newaliascnt{#1}{theorem}% \newtheorem{#1}[#1]{#2}% \aliascntresetthe{#1}% \ExpandArgs{c}\newcommand{#1autorefname}{#2}% } \addtheorem{corollary}{Corollary} \addtheorem{lemma}{Lemma} \addtheorem{proposition}{Proposition} \theoremstyle{definition} \addtheorem{definition}{Definition} \addtheorem{assumption}{Assumption} \addtheorem{remark}{Remark} \addtheorem{example}{Example} \renewcommand{\sectionautorefname}{Section} \begin{document} \section{Introduction} \label{chap} \begin{theorem} \label{thm} If A then \begin{align} B &= C , \label{thm:eq1} \\ X &= Y . \label{thm:eq4} \end{align} \end{theorem} From \autoref{thm} in \autoref{chap}, we have \autoref{thm:eq1}. \end{document} I expect \autoref{thm:eq1} produces something like Equation (1.1) or simply (1.1), and not Theorem 1.1. The problem is due to \mathtoolsset{showonlyrefs}. Nevertheless, I would like to keep this option? Is there anyway to resolve this wrong type?

  • Input command with line ranges
    by Maronite Monks on August 1, 2026 at 6:42 pm

    I'm using MacTeX 2022 on an antique Mojave 10.14.6 system. I employ XeLaTeX with a commercial font and document formatting via the memoir class. I've searched a bit into the minted and listings packages but they don't seem to do what I'd like. What I'd like to do is be able to select ranges of lines (e.g., lines 2-5, 6-9, etc.) and have the input be formatted (i.e., font/size, etc.) by what's in the preamble of the importing document. Minted seems to make what's imported a verbatim format, whereas I'd like any and all the text and markups processed, not printed. I haven't been able to get listings to do anything yet. Is there a package or command to use like this? \input[lines=2, 4, 5-10]{externalfile.tex} Or maybe something comparable to what the lipsum package does? Thanks for your help. fr. mgc Below is the minimum working example, followed by the contents of the external file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass[12pt]{memoir} \usepackage{fontspec,xltxtra,xunicode} \defaultfontfeatures{Mapping=tex-text} \setromanfont[Ligatures=TeX]{TeX Gyre Schola} \usepackage{lipsum} \pagestyle{plain} \begin{document} \lipsum[52] \bigskip \settowidth\versewidth{nor stands in the path with sinners} \begin{verse}[\versewidth] \input{./Ps1} \end{verse} And that says it all! \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % External file contents: Ps1.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \centerline{PSALM 1} 1 Blessed indeed is the man\\ who follows not the counsel of the wicked,\\ nor stands in the path with sinners,\\ nor abides in the company of scorners,\\ 2 but whose delight is the law of the Lord,\\ and who ponders his law day and night.\\! 3 He is like a tree that is planted\\ beside the flowing waters,\\ that yields its fruit in due season,\\ and whose leaves shall never fade;\\ and all that he does shall prosper.\\! 4 Not so are the wicked, not so!\\ For they, like winnowed chaff,\\ shall be driven away by the wind.\\! 5 When the wicked are judged they shall not rise,\\ nor shall sinners in the council of the righteous;\\ 6 for the Lord knows the way of the righteous,\\ but the way of the wicked will perish.

  • How to set `oneside` left-margin with geometry parameter elegantly?
    by Explorer on August 1, 2026 at 4:36 pm

    I want to get a oneside document, whose everypage holds left margin region as below: The target sketch above was the second page given by: \documentclass{book} \usepackage[ showframe, includemp, textwidth=12cm, marginparsep=0.5cm, marginparwidth=5cm, ]{geometry} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \section{Test Test Test Test} \lipsum[1-3] \lipsum[1][1]\marginpar{\raggedright\lipsum[2][1-4]}\lipsum[2-3] \section{Test Test Test Test} \lipsum[1-3] \lipsum[1][1]\marginpar{\raggedright\lipsum[2][1-4]}\lipsum[2-3] \end{document} Now, I want to fix the geometry paramters, change to oneside, and add \reversemarginpar: \documentclass[oneside]{book} \usepackage[ showframe, includemp, textwidth=12cm, marginparsep=0.5cm, marginparwidth=5cm, ]{geometry} \usepackage{amsmath} \usepackage{libertinus-otf} \usepackage{lipsum} \reversemarginpar \begin{document} \section{Test Test Test Test} \lipsum[1-3] \lipsum[1][1]\marginpar{\raggedright\lipsum[2][1-4]}\lipsum[2-3] \section{Test Test Test Test} \lipsum[1-3] \lipsum[1][1]\marginpar{\raggedright\lipsum[2][1-4]}\lipsum[2-3] \end{document} The result was unexpected: My question is that, in my ideal "left margin region" oneside document, the settings: \usepackage[ showframe, includemp, textwidth=12cm, marginparsep=0.5cm, marginparwidth=5cm, ]{geometry} was enough to reverse the margin, I don't want to manually calculate something like left=? within geometry setting. I wonder how to get a "oneside" document with reversed "left margin region" everypage without specifying/calculating parameters other than textwidth=12cm,marginparsep=0.5cm,marginparwidth=5cm.

  • Are there a way to obtain automatically all the "lua-unicode-math" fonts with samples?
    by Mika Ike on August 1, 2026 at 10:19 am

    How can you obtain automatically all the available fonts in "https://ctan.org/pkg/lua-unicode-math" ( https://ctan.org/pkg/lua-unicode-math )

  • Space above section title ignored at pagebreak except if this pagebreak is followed by \vspace*
    by Denis Bitouzé on August 1, 2026 at 10:01 am

    (This is a follow up of the answer to the question of mine: How to get a dedicated geometry only for the two pages following the page dedicated to the chapter title?) In the following MCE, the space above the section title is ignored at pagebreak and hence the texts on the two facing pages start at the same height: so far, so good. \documentclass{article} \usepackage[paperwidth=120mm,paperheight=120mm]{geometry} \usepackage[color=red,showframe,type=alledges]{fgruler} \usepackage{afterpage} \usepackage{lipsum} \newlength\myskip \setlength\myskip{1cm} \begin{document} % \vspace*{\myskip}\afterpage{\vspace*{\myskip}} % Foo bar. \section{Baz} \lipsum[1-2] \end{document} If we uncomment the two commented lines, the result is as expected: the texts on the two facing pages start at the same height, with a common vertical blank space at the top of the pages: But, if only \vspace*{\myskip}\afterpage{\vspace*{\myskip}} is uncommented (that is if the texts on the two facing pages are supposed to start with a common vertical blank space at the top of the pages, but the one on the left page starts with a section), there is an extra vertical space above the section title which induces a vertical shift between the texts on the two facing pages: How to get rid of this vertical shift in the latter case?

  • Stacking multiple number lines on top of each other
    by Muhannad Al Ayoubi on August 1, 2026 at 9:09 am

    I made the following diagram, which is supposed to depict how the intersection of two intervals can be determined. However, as you can see, I could include only one number line, which makes the diagram look rather empty, in my opinion. Is there a away to draw two more number lines above the original one, aligned with the "flying" blue intervals? I have thought about drawing three separate tikz pictures above each other, but then I can't draw the red dashed line, and it would also make it difficult to control the invisible space taken by the y-axis. \documentclass{book} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[every node/.style={font=\small},] \begin{axis}[ clip=false, axis x line=middle, axis y line=none, x axis line style={<->}, xmin=-3.4, xmax=7.4, ymin=-.5, ymax=3, xtick distance=1, x=.6cm, y=1cm, ] % Red dashed lines \draw [red,dashed] (axis cs:-1,0) -- (axis cs:-1,2.2) (axis cs:6,0) -- (axis cs:6,2.2); % Points \addplot[only marks,mark options={fill=white}] coordinates {(6,2) (-1,1) (6,0) (-1,0)}; % Uppermost number line for x < 6 \draw[<-,very thick] (axis cs:-3,2) -- (axis cs:6,2); % Middle number line for x > -1 \draw[->,very thick] (axis cs:-1,1) -- (axis cs:7,1); % Lower number line for intersection of inequalities \draw[very thick] (axis cs:-1,0) -- (axis cs:6,0); % Labels \draw (axis cs:8,2) node[right]{$x<6$} (axis cs:8,1) node[right]{$x>-1$} (axis cs:8,0) node[right]{$x<6$ and $x>-1$, or simply $-1<x<6$.}; \end{axis} \end{tikzpicture} \end{document} Here is what it looks like (note I have removed color and font information from the code to keep things simple).

  • How to format citation of a book reprinted within a multivolume set of works
    by Michael L. on August 1, 2026 at 2:40 am

    Code I am trying to reference a book which has been republished within a multivolume set of the author's works. Here are the relevant bibliography entries: @mvbook{OwenWorks, address={Edinburgh}, author = {Owen, John}, title = {The Works of John Owen}, shorttitle = {Works}, date = {1850}, editor = {William J. Goold}, publisher = {T\&T Clark}, volumes={24}, } @bookinbook{Pneumatologia, crossref={OwenWorks}, title={Pneumatologia}, volume={3}, pages={1–651} } A brief example of the file: \documentclass{turabian-thesis} \usepackage[backend=biber, notes, isbn=false, noibid]{biblatex-chicago} \addbibresource{example.bib} \begin{document} Example text.\autocite{OwenWorks} More example text.\autocite{Pneumatologia} \printbibliography \end{document} Output The footnote for Pneumatologia appears as: John Owen, Pneumatologia, vol. 3 of The Works of John Owen, ed. William J. Goold (Edinburgh: T&T Clark), 1–651. In accordance with Turabian 17.1.4.1, I would like it to read as: John Owen, Pneumatologia, in Works, 3:1–651. If I use \autocite[3:1–651]{OwenWorks}, I get: Owen, Works, 3:1–651. This does not include the title of the work Pneumatologia. If I use \footnote{Owen, *Pneumatologia*, in \cite[3:1–651]{OwenWorks}.}, I get: Owen, Pneumatologia, in Owen, Works, 3:1–651. This list Owen's name twice. What do I need to do to?

  • Examples of use for the block, list, and heading templates?
    by John02139 on July 31, 2026 at 9:06 pm

    The LaTeX format has recently implemented templates for block environments, lists, and headings. Is there a collection of examples of using these templates for document design? (I'm only aware of the examples for ltx-talk.) It's not easy to search for "examples of LaTeX templates" online -- the wrong stuff comes up! Addendum: the ltx-talk examples are here.

  • On Microtype, Linus Libertine O, and Lualatex [duplicate]
    by DDS on July 31, 2026 at 6:23 pm

    Consider the code: \documentclass[openany,12pt]{book} \usepackage{fontspec} %\usepackage{libertine} \setmainfont{Linux Libertine O} %\usepackage[tracking=true]{microtype} \begin{document} \thispagestyle{empty} \begin{center} \LARGE{\textbf{\textsc{On Microtype, Linux Libertine O font, and compiling with lualatex.}}\par} \end{center} \vspace{15pt} \begin{center} \textbf{\Huge{PART I.}} \end{center} \end{document} which produces: And everything is fine! However, when I try to run the code with microtype, I get the following error: QUESTION: Can someone tell me if I am doing something wrong? It seems to me that I should not be getting error messages. Thank you.

  • How can I format the derivative of a long vector function in LaTeX so it does not spill over the page margin?
    by Jasper on July 31, 2026 at 4:58 pm

    How can I format the derivative of a long vector function in LaTeX so it does not spill over the page margin? Is it better to stack the components in a column, use line breaks with hanging indents inside parentheses, or break it down component by component? \documentclass{article} \usepackage{mathtools} \usepackage{unicode-math} \begin{document} \begin{align*} \frac{d}{dt}\biggl( \frac{2at^2}{t^2+1}, \frac{2at^3}{t^2+1}, \frac{2at^4}{t^2+1} \biggr) &=\biggl( \frac{d}{dt}[2at^2](1+t^2)^{-1}+\frac{d}{dt}[(1+t^2)^{-1}](2at^2), \frac{d}{dt}[2at^3](1+t^2)^{-1}+\frac{d}{dt}[(1+t^2)^{-1}](2at^3), \frac{d}{dt}[2at^4](1+t^2)^{-1}+\frac{d}{dt}[(1+t^2)^{-1}](2at^4) \biggr) \end{align*} \end{document}

  • Does plain TikZ have a built-in way to reuse intermediate mathematical calculations across `plot` dimensions?
    by Jasper on July 31, 2026 at 3:29 pm

    Does plain TikZ have a built-in way to reuse intermediate mathematical calculations across plot dimensions? I mean I could just use a foreach loop and pgfmathsetmacro, but that's quite intensive. Is this built in to plot? If not, should/could it be? I mean, I doubt it, but I also doubted that my previous question had a good solution - which I, to my pleasant surprise, turned out to be wrong about. % Source - https://tex.stackexchange.com/a/764941 % Posted by kabenyuk, modified (!) by Jasper. See post 'Timeline' for change history % Retrieved 2026-07-31, License - CC BY-SA 4.0 \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw plot[ domain=0:4, declare function={ f(\t)=(\t)^2-(\t)^3; } ] ( \x, {f(\x-2)}, % A third component requires that I recompute some % values which have already been computed. {f(\x-2) - \x} ) ; \end{tikzpicture} \end{document}

  • How to Produce Thick Gold Book Cover Borders Such as This One?
    by Jethro on July 31, 2026 at 2:29 pm

    Is Latex capable of producing a gold pattern similar, for example, to the (thick) gold border on the outside of this cover: It does not seem that either pgfornament or psvectorian are what is needed here. Is there some other package that I might use that is up to this job? If not, what resource might I use to produce a similar border? I expect to compile with xelatex.

  • Are the any way/code to obtain ALL the fonts (with sample) installed for use in LaTeX?, in the TeX installation. Even with indications TeX vs System
    by Mika Ike on July 31, 2026 at 1:21 pm

    How to obtain (a list) all the fonts installed in the TeX installation and in the system. Similar to https://tug.org/FontCatalogue/alphfonts.html but better in PDF pages.

  • How to make a custom encoding character in a font?
    by Grzegorz Brzęczyszczykiewicz on July 31, 2026 at 11:55 am

    On an older thread, I came across this LaTeX code which I found very satisfactory % Source - https://tex.stackexchange.com/a/762019 % Posted by egreg % Retrieved 2026-07-31, License - CC BY-SA 4.0 \documentclass{article} \usepackage[X2,T1]{fontenc} \DeclareTextSymbol{\eyelet}{T1}{24} \DeclareTextSymbol{\eyelet}{X2}{255} \begin{document} T1: \eyelet \fontencoding{X2}\selectfont X2: \eyelet \end{document} Now I need something more specific: I want a character command \fly to display a specific character by default but on the OT1 encoding it should display a different character for a specific font family (like cmr). something like \DeclareTextSymbol{\fly}{OT1}{2} \DeclareTextSymbol{\fly}{OT1}{3} \DeclareTextSymbol{\fly}{T1}{128} but more specific (I want to restrict the definition with character 3 to be for cmr specifically, while all other OT1 fonts use character 4). I need this for a specific language/conlang I'm working on.

  • Cannot break align* environment in nested tcolorbox environment
    by Drazer on July 31, 2026 at 9:45 am

    I would like to break between pages an align* environment, yet it does not work. I use \tcbsetforeverylayer[breakable] so that all nested tcolorbox environment that I use can break between pages and \allowdisplaybreaks for breaking align* environment in pages. When I try to put an align* environment in my theorem (or leftrule) environment, it breaks between pages. But if I put nested environments, it does not anymore and I get the following warning : Package tcolorbox Warning: The upper box part has become overfull Here is my (maybe not minimal) source code : \documentclass[11pt]{scrbook} \usepackage{amsmath,amsfonts, amsthm, graphicx} \usepackage[margin=1.5cm,bottom=3cm, top=3cm]{geometry} \allowdisplaybreaks \usepackage{tikz} \usepackage[most]{tcolorbox} \tcbsetforeverylayer{enhanced,breakable} \newenvironment{leftrule}{ \begin{tcolorbox}[frame hidden, boxrule=0pt, borderline west={2pt}{0pt}{black}, opacityback=0] } { \end{tcolorbox} } \title{} \author{} \date{} \begin{document} \maketitle \begin{leftrule} \begin{leftrule} \begin{align*} &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= b \\ &= c \end{align*} \end{leftrule} \end{leftrule} \end{document}

  • Centering a table
    by user446112 on July 31, 2026 at 9:20 am

    I'm struggling in centering a table in Beamer. The final result is a horizontally ill centered table. My code is: \documentclass{beamer} \usepackage{nicematrix} \begin{document} \begin{frame} My table \\[5pt] \begin{center} \begin{NiceTabular}{w{l}{1em}w{l}{7em}}[cell-space-limits=2.5pt] \textbf{i.} & My first item, \\ \textbf{ii.} & My second item is very looooooooooooooong, \\ \textbf{iii.} & My third item is not very long. \end{NiceTabular} \end{center} \end{frame} \end{document} (complied via LuaLaTeX). With thanks.

  • How to change \chapterformat only for chapters and not appendices with koma scrbook? [duplicate]
    by Paul on July 31, 2026 at 12:22 am

    I'm trying to redefine \chapterformat with the koma scrbook class to have ordinal chapter numbers (1er, 2e, 3e in french) in the first chapter page (not in the ToC or elsewhere). Except I don't want this for the appendices (which use capital letters A, B, C). Here is my MWE: \documentclass[fontsize=12pt,headinclude=true,footinclude=false, paper=A4,portrait,twoside=on]{scrbook} \usepackage{xcolor,graphicx} \usepackage[french]{babel} \newcommand{\chapterordinal}{% \Ifstr{\chapapp}{Chapitre}{ \ifcase\value{chapter} \or {\fontsize{40}{48}\selectfont\textsuperscript{er}}% \else {\fontsize{40}{48}\selectfont\textsuperscript{e}}% \fi } {} } \KOMAoption{chapterprefix}{true} \RedeclareSectionCommand[innerskip=0.4\baselineskip]{chapter} \newcommand*{\tinierSizeHeadings}{\Large} \newcommand*{\gargantuaSizeHeadings}{\fontsize{60}{72}\selectfont} \newcommand*{\thehackedchapter}{\gargantuaSizeHeadings\color{white}\thechapter\chapterordinal} \addtokomafont{chapterprefix}{\tinierSizeHeadings} \renewcommand*{\chapterformat}{% \colorbox{blue!50}{\begin{minipage}[b][2.5cm][c]{2cm} \centering \thehackedchapter \end{minipage}} \begin{minipage}[b][2.5cm][c]{2cm} \rotatebox{90}{\chapappifchapterprefix{}} \end{minipage} \IfUsePrefixLine{}{\enskip} } \begin{document} \mainmatter \chapter{First chapter} \chapter{Second chapter} \appendix \chapter{First Appendix} \end{document} This is what I get: If I remove the \Ifstr{\chapapp}{Chapitre}{}{} I get the good formating: But the appendices are wrong. How to solve that?

  • Very slow compilation due to complex TikZ page background: How to optimize?
    by Med Elhadi Kh on July 30, 2026 at 11:39 pm

    I am working on a document where I created a custom page border and headers/footers using TikZ and eso-pic. However, the document is extremely heavy to process. The compilation time is very slow, and it gets significantly worse as the number of pages increases. Is there a more efficient way to write this code? For example, is there a way to render the background only once and reuse it across all pages (like saving it to a box), instead of drawing these complex paths and loops on every single page? Here is my MWE (compiled with XeLaTeX/LuaLaTeX): \documentclass[a4paper]{report} \usepackage[right=1.1cm,left=1.3cm,top=2.5cm,bottom=2cm,foot=0mm,head=0mm]{geometry} \usepackage{amsmath,amsfonts,eso-pic,amssymb,mathrsfs,tikz,fancyhdr,multicol,pifont,ifthen,lastpage,graphicx} \usepackage[most]{tcolorbox} \usetikzlibrary{arrows,shapes,calc} \parindent=0mm \colorlet{col1}{blue} \colorlet{col2}{col1!50} \pagestyle{empty} \newcounter{tabb} \newcommand{\shape}[2][1]{\setcounter{tabb}{1}\tabcolsep=0mm\begin{tabular}{c} \whiledo{\thetabb<#2}{\hskip-3pt% \tikz{\path[top color=col2,bottom color=col2,middle color=white] (3.9cm,-.7)rectangle(7.1cm,7mm); \draw[.!50!col1] (3.9,-.7)--(7.1,-.7)(3.9,.7)--(7.1,.7); \draw[line width=3pt,smooth,inner color=white,outer color=gray,draw=.!25!gray] plot[domain=3.9:7.1] (\x,{sin deg(\x)}) plot[domain=3.9:7.1] (\x,{cos deg(\x)}); \draw[transform canvas={yscale=#1},line width=3pt,smooth,inner color=white,outer color=gray,draw=.!25!gray] plot[domain=3.9:7.1] (\x,{sin deg(\x)}) plot[domain=3.9:7.1] (\x,{cos deg(\x)});}\stepcounter{tabb}}% \end{tabular}} \AddToShipoutPicture{ \begin{tikzpicture}[overlay,remember picture] \coordinate (1) at ([shift={(-.8,-1.25)}]current page.north east); \coordinate (2) at ([shift={(.8,-1.25)}]current page.north west); \coordinate (3) at ([shift={(.8,1.25)}]current page.south west); \coordinate (4) at ([shift={(-.8,1.25)}]current page.south east); \path (2)--node[scale=0.2,rotate=90,inner sep=0mm]{\shape{41}}(3); \path (1)--node[scale=0.2,rotate=90,inner sep=0mm]{\shape{41}}(4); \coordinate (5)at ($(1)!1/4!(2)$); \coordinate (6)at ($(1)!3/4!(2)$); \coordinate (7)at ($(4)!1/4!(3)$); \coordinate (8)at ($(4)!3/4!(3)$); \path (1)--node[scale=0.2,inner sep=0mm]{\shape{4}}(5); \path (2)--node[scale=0.2,inner sep=0mm]{\shape{4}}(6); \path (4)--node[scale=0.2,inner sep=0mm]{\shape{4}}(7); \path (3)--node[scale=0.2,inner sep=0mm]{\shape{4}}(8); \foreach \i/\j/\k in {1/1/1,2/-1/1,3/-1/-1,4/1/-1}{ \node [inner sep=0mm,left] at (\i) {\scalebox{\j}[\k]{% \tikz[transform canvas={shift={(-.5mm,-.4mm)}}]{ \coordinate (a)at (0,0); \draw[inner color=white,outer color=gray]([shift={(-2mm,1mm)}]a)to[out=250,in=-45]([xshift=-1.6cm,yshift=-.8mm]a)-|+(.14,2mm)to[out=-45,in=240]([yshift=-3mm,xshift=-2mm]a); \draw[inner color=white,outer color=gray] ([yshift=-.75cm,xshift=1.5mm]a)to[out=40,in=-90]([xshift=-1mm,yshift=2mm]a)--([xshift=-3mm,yshift=2mm]a)to[out=-90,in=10]([shift={(-1mm,-.75cm)}]a); }% }}; \node[inner sep=0mm,scale=2,text=col1] at (\i){% \includegraphics[width=.5cm,height=.5cm]{im1}% }; } \node[text width=0.75\textwidth,inner sep=0mm,baseline={(1.east)}] at ($(1)!.5!(2)$){ %\begin{otherlanguage}{arabic} \begin{tcolorbox}[enhanced,nobeforeafter,right=5mm,left=5mm,frame empty,fontupper=\bfseries\large,interior code={ \path[draw=col1,line width=.8pt,bottom color=col1!50,top color=col1!50,middle color=white] ([yshift=1.5mm]interior.east)to[out=180,in=0]([xshift=-2cm]interior.north east)--([xshift=2cm]interior.north west)to[out=180, in=0]([yshift=1.5mm]interior.west)to[bend left]([yshift=-1.5mm]interior.west)to[out=0,in=180]([xshift=2cm]interior.south west)--([xshift=-2cm]interior.south east)to[out=0,in=180]([yshift=-1.5mm]interior.east)to[bend left]cycle; \path(interior.east)-- node[pos=0.33,yscale=.8,xscale=.5,inner sep=0mm]{\colorlet{gray}{col1}\shape[-1]{2}} node[pos=0.69,yscale=.8,xscale=.5,inner sep=0mm]{\colorlet{gray}{col1}\shape[-1]{2}}(interior.west); }] text left \hfill text center \hfill text right \end{tcolorbox}% %\end{otherlanguage}% \vglue-\baselineskip }; \node[text width=0.75\textwidth,inner sep=0mm] at ($(4)!.5!(3)$){ \begin{tcolorbox}[enhanced,nobeforeafter,right=5mm,left=5mm,frame empty,top=0mm,bottom=0mm,fontupper=\bfseries\large,interior code={ \path[draw=col1,line width=.8pt,bottom color=col1!50,top color=col1!50,middle color=white] ([yshift=1.5mm]interior.east)to[out=180,in=0]([xshift=-2cm]interior.north east)--([xshift=2cm]interior.north west)to[out=180, in=0]([yshift=1.5mm]interior.west)to[bend left]([yshift=-1.5mm]interior.west)to[out=0,in=180]([xshift=2cm]interior.south west)--([xshift=-2cm]interior.south east)to[out=0,in=180]([yshift=-1.5mm]interior.east)to[bend left]cycle; }]\centering Page 1 of 1 \end{tcolorbox}% %\end{otherlanguage}% \vglue-\baselineskip }; \end{tikzpicture} } \begin{document} hey \end{document} image im1: Note: I have attached the image (im1) used in the document. Also, I am using some local Arabic fonts in my code (Aljazeera.ttf and Al Qalam Quran Majeed Web.ttf). If you want to test the code on your machine, you can simply comment them out or replace them with any standard font (like Amiri). My main problem is that compiling this document is extremely slow because of the complex TikZ background (especially the loops and smooth paths). The processing time gets heavier and heavier with every new page added. Is there a way to optimize this? For example, is it possible to render this background only once (saving it into a box) and reuse it on every page to drastically reduce the compilation time? Any help or optimized code would be highly appreciated. Thank you! EDIT/UPDATE: I sincerely apologize for my previous code. I realized it contained local Arabic fonts and packages (polyglossia) which made it impossible for you to compile and test. I have completely cleaned up the code. It is now a proper Minimal Working Example (MWE) using only standard packages and example-image. My issue is that this document is extremely slow to compile because of the complex TikZ background (the loops, \whiledo, and smooth curves). The compilation time increases heavily with every new page. As pointed out in the comments, I need to separate the static parts (the complex borders/decorations) from the variable parts (like the page number), but my code is too entangled with nested tikzpictures and tcolorbox. Could someone please provide a structural example of how to redesign this so the heavy background is drawn/saved only once, drastically reducing compilation time? Here is the clean, compilable MWE (you can test it with pdfLaTeX): \documentclass[a4paper]{report} \usepackage[right=1.1cm,left=1.3cm,top=2.5cm,bottom=2cm,foot=0mm,head=0mm]{geometry} \usepackage{amsmath,amsfonts,eso-pic,amssymb,mathrsfs,tikz,fancyhdr,multicol,pifont,ifthen,lastpage,graphicx} \usepackage[most]{tcolorbox} \usetikzlibrary{arrows,shapes,calc} \parindent=0mm \colorlet{col1}{blue} \colorlet{col2}{col1!50} \pagestyle{empty} \newcounter{tabb} \newcommand{\shape}[2][1]{\setcounter{tabb}{1}\tabcolsep=0mm\begin{tabular}{c} \whiledo{\thetabb<#2}{\hskip-3pt% \tikz{\path[top color=col2,bottom color=col2,middle color=white] (3.9cm,-.7)rectangle(7.1cm,7mm); \draw[.!50!col1] (3.9,-.7)--(7.1,-.7)(3.9,.7)--(7.1,.7); \draw[line width=3pt,smooth,inner color=white,outer color=gray,draw=.!25!gray] plot[domain=3.9:7.1] (\x,{sin deg(\x)}) plot[domain=3.9:7.1] (\x,{cos deg(\x)}); \draw[transform canvas={yscale=#1},line width=3pt,smooth,inner color=white,outer color=gray,draw=.!25!gray] plot[domain=3.9:7.1] (\x,{sin deg(\x)}) plot[domain=3.9:7.1] (\x,{cos deg(\x)});}\stepcounter{tabb}}% \end{tabular}} \AddToShipoutPicture{ \begin{tikzpicture}[overlay,remember picture] \coordinate (1) at ([shift={(-.8,-1.25)}]current page.north east); \coordinate (2) at ([shift={(.8,-1.25)}]current page.north west); \coordinate (3) at ([shift={(.8,1.25)}]current page.south west); \coordinate (4) at ([shift={(-.8,1.25)}]current page.south east); \path (2)--node[scale=0.2,rotate=90,inner sep=0mm]{\shape{41}}(3); \path (1)--node[scale=0.2,rotate=90,inner sep=0mm]{\shape{41}}(4); \coordinate (5)at ($(1)!1/4!(2)$); \coordinate (6)at ($(1)!3/4!(2)$); \coordinate (7)at ($(4)!1/4!(3)$); \coordinate (8)at ($(4)!3/4!(3)$); \path (1)--node[scale=0.2,inner sep=0mm]{\shape{4}}(5); \path (2)--node[scale=0.2,inner sep=0mm]{\shape{4}}(6); \path (4)--node[scale=0.2,inner sep=0mm]{\shape{4}}(7); \path (3)--node[scale=0.2,inner sep=0mm]{\shape{4}}(8); \foreach \i/\j/\k in {1/1/1,2/-1/1,3/-1/-1,4/1/-1}{ \node [inner sep=0mm,left] at (\i) {\scalebox{\j}[\k]{% \tikz[transform canvas={shift={(-.5mm,-.4mm)}}]{ \coordinate (a)at (0,0); \draw[inner color=white,outer color=gray]([shift={(-2mm,1mm)}]a)to[out=250,in=-45]([xshift=-1.6cm,yshift=-.8mm]a)-|+(.14,2mm)to[out=-45,in=240]([yshift=-3mm,xshift=-2mm]a); \draw[inner color=white,outer color=gray] ([yshift=-.75cm,xshift=1.5mm]a)to[out=40,in=-90]([xshift=-1mm,yshift=2mm]a)--([xshift=-3mm,yshift=2mm]a)to[out=-90,in=10]([shift={(-1mm,-.75cm)}]a); }% }}; \node[inner sep=0mm,scale=2,text=col1] at (\i){% \includegraphics[width=.5cm,height=.5cm]{im1}% }; } \node[text width=0.75\textwidth,inner sep=0mm,baseline={(1.east)}] at ($(1)!.5!(2)$){ %\begin{otherlanguage}{arabic} \begin{tcolorbox}[enhanced,nobeforeafter,right=5mm,left=5mm,frame empty,fontupper=\bfseries\large,interior code={ \path[draw=col1,line width=.8pt,bottom color=col1!50,top color=col1!50,middle color=white] ([yshift=1.5mm]interior.east)to[out=180,in=0]([xshift=-2cm]interior.north east)--([xshift=2cm]interior.north west)to[out=180, in=0]([yshift=1.5mm]interior.west)to[bend left]([yshift=-1.5mm]interior.west)to[out=0,in=180]([xshift=2cm]interior.south west)--([xshift=-2cm]interior.south east)to[out=0,in=180]([yshift=-1.5mm]interior.east)to[bend left]cycle; \path(interior.east)-- node[pos=0.33,yscale=.8,xscale=.5,inner sep=0mm]{\colorlet{gray}{col1}\shape[-1]{2}} node[pos=0.69,yscale=.8,xscale=.5,inner sep=0mm]{\colorlet{gray}{col1}\shape[-1]{2}}(interior.west); }] text left \hfill text center \hfill text right \end{tcolorbox}% %\end{otherlanguage}% \vglue-\baselineskip }; \node[text width=0.75\textwidth,inner sep=0mm] at ($(4)!.5!(3)$){ \begin{tcolorbox}[enhanced,nobeforeafter,right=5mm,left=5mm,frame empty,top=0mm,bottom=0mm,fontupper=\bfseries\large,interior code={ \path[draw=col1,line width=.8pt,bottom color=col1!50,top color=col1!50,middle color=white] ([yshift=1.5mm]interior.east)to[out=180,in=0]([xshift=-2cm]interior.north east)--([xshift=2cm]interior.north west)to[out=180, in=0]([yshift=1.5mm]interior.west)to[bend left]([yshift=-1.5mm]interior.west)to[out=0,in=180]([xshift=2cm]interior.south west)--([xshift=-2cm]interior.south east)to[out=0,in=180]([yshift=-1.5mm]interior.east)to[bend left]cycle; }]\centering Page 1 of 1 \end{tcolorbox}% %\end{otherlanguage}% \vglue-\baselineskip }; \end{tikzpicture} } \begin{document} hey \end{document}

  • Hyphenated word has one single letter on next line
    by Robert E on July 30, 2026 at 6:55 pm

    I am typesetting a Dutch text in lualatex / polyglossia. All hyphenation instances occur correctly, but one: Nederlands-Indië, which I coded as Nederlands\hyp{}In\-dië, in order to preserve the dash and to encourage hyphenation between n-d. Correct hyphenations are: Neder- lands-Indië Ne- derlands-Indië Nederlands- Indië Nederlands-In- dië. Note that in all these cases the dash remains. However, in my text it is occasionally also hyphenated as: Nederlands-Indi- e. This is incorrect and ugly typesetting, because of the single e on the new line. It is probably caused by the fact words containing an ë (e-trema) are hyphenated, e.g. in the case of geënt, ë indicates a new syllable. Therefore ge- ent is correct. I tried settings like these, \lefthyphenmin=3 \righthyphenmin=3 \hyphenpenalty=500 but the problem persists. Has anyone a solution?

  • Tag documents with tagpdf and \DocumentMetadata (using TexStudio on Debian) [duplicate]
    by flixB4140 on July 30, 2026 at 5:12 pm

    I have been trying to make my course book more accessible by tagging it with tagpdf as I formulated in the title. I use TexStudio and have tried compiling with PDFLaTeX and LuaLatex (before I used XeLaTeX because of specific font preferences but that's another subject, I am adding it just in case). I added \DocumentMetadata{lang=fr,tagging=on,pdfstandard=UA-2} before \documentclass{book}. The error I get when compiling is: The key 'document/metadata/tagging' is unknown and is being (LaTeX) ignored. ...Metadata{lang=fr,tagging=on,pdfstandard=UA-2} I tried to install the 2026 TexLive version since the one from my Debian distribution (Debian12, upgrading to 13 failed, I am on a 2017 MacbookAir with Debian) seems to date from 2022. I am not a true geek and have not been able to find an accessible solution to my question which is fundamentally, how to best tag my course book if my solution to use TexLive 2026 is correct and the 2022 version may be the origin of the problem of not recognising \DocumentMetadata, how to point TexStudio to the installed 2026 TexLive version or how to compile the file using LuaLaTeX from the 2026 TexLive install? Thanks already!! UPDATE Thanks to @cfr and @ samcarter_is_at_topanswers.xyz : On solution to make \DocumentMetadata (and thus tagging) work is, when the latest TeXLive version is installed, to point TexStudio to it : indicate the directory where TexLive 2026 is located, e.g. in my case on Debian 12 /usr/local/texlive/2026/bin/x86_64-linux/lualatex %, in the "default compiler" field of the texstudio advanced configuration "Build" tab (note the % at the end, which gets replaced by the file name by texstudio). (I chose to keep the default 2022 apt installation/packages of TexLive on Debian in addition to the 2026 installation because of my moderate literacy).

  • Biblatex hyperlink links to the first chapter when using refsegment instead of the current one
    by Tristan Nemoz on July 30, 2026 at 1:16 pm

    I'd like to have a bibliography per chapter using biblatex, along with a final, global bibliography at the end. Here's what I have for now. \documentclass[a4paper, 11pt]{book} \usepackage[english]{babel} \usepackage[% sorting=nty,% style=alphabetic,% backref=true,% refsegment=chapter,% isbn=false,% ]{biblatex} \usepackage{csquotes} % Recommended by biblatex \addbibresource{main.bib} % Hyperlinks \usepackage[linktocpage=true]{hyperref} \begin{document} \chapter{First chapter} Let's cite \cite{AN25} here. \printbibliography[segment=\therefsegment,heading=subbibliography] \selectlanguage{english} \chapter{Second chapter} Let's also cite \cite{AN25} here. \printbibliography[segment=\therefsegment,heading=subbibliography] \appendix \printbibliography \end{document} with main.bib containing @misc{AN25, author={Doe, John}, title={What a title}, year=2025, } There are however two problems with this code, that I think may be related. First of all, the first bibliography contains backreferences to the second chapter. This is not dramatic, though if possible I'd rather not having this, but more importantly may be linked to the second problem, which is that the hyperlink [Doe25] in the second chapter sends to the first bibliography. Is there a way for the hyperlink to send the reader to the current chapter's bibliography? Note that I've also tried to add the method described in this post by adding backend=biber adding natbib=true removing the segment=\therefsegment adding the relevant piece of LaTeX3 code which resulted in the following code: \documentclass[a4paper, 11pt]{book} \usepackage[english]{babel} \usepackage[% sorting=nty,% style=alphabetic,% backref=true,% refsegment=chapter,% isbn=false,% backend=biber, natbib=true, ]{biblatex} \usepackage{csquotes} % Recommended by biblatex \addbibresource{main.bib} \usepackage{xparse} \ExplSyntaxOn \seq_new:N\g_UF_allcitekeys_seq \AtEveryBibitem { \seq_gput_right:Nx\g_UF_allcitekeys_seq{ \thefield{entrykey} } } \NewDocumentCommand\nociteall { } { \seq_map_function:NN\g_UF_allcitekeys_seq\nocite } \ExplSyntaxOff \makeatletter %for the backrefs of the main bib: \let\oriabx@aux@backref\abx@aux@backref \renewcommand\abx@aux@backref[5]{% \oriabx@aux@backref{#1}{#2}{#3}{#4}{#5}% \oriabx@aux@backref{#1}{#2}{0}{#4}{#5} } \makeatother % Hyperlinks \usepackage[linktocpage=true]{hyperref} \begin{document} \chapter{First chapter} Let's cite \cite{AN25} here. \printbibliography[segment=\therefsegment,heading=subbibliography] \selectlanguage{english} \chapter{Second chapter} Let's also cite \cite{AN25} here. \printbibliography[segment=\therefsegment,heading=subbibliography] \appendix \printbibliography \end{document} but both issues persist. Am I missing something obvious?

  • Positioning all elements of a picture created with tikzpicture customly [closed]
    by user446112 on July 30, 2026 at 8:35 am

    I wonder how an entire picture created with tikzpicture can be positioned in a Beamer slide, that is, my purpose is to positioning all tikzpicture in the slide with custom precision (e.g., by using coordinates). I tried \hspace and \vspace but the results are not good. Find my code below: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{tikzmark,calc,positioning,fit,arrows,shapes,backgrounds,shapes.geometric,arrows.meta,patterns.meta,decorations.pathreplacing} \begin{document} \begin{frame} \begin{tikzpicture} \fill[blue] (0,0) circle (0.5); \fill[red] (1,0) circle (0.5); \end{tikzpicture} \end{frame} \end{document} (compiled via Lua LaTeX). With thanks

  • How to include a TikZ .tex file in a large document? I keep getting "LaTeX Error: Environment tikzpicture undefined."
    by ali bab613 on July 30, 2026 at 1:28 am

    I have a fairly complex document, but I extracted this MWE from it. I'm including a similar file tree as what's in the actual document to ensure that its as close to my document as possible. For extra context, I am using Overleaf, and compiling using LuaLaTeX (in case that's relevant). main.tex has this: \documentclass{article} \usepackage{standalone} \usepackage{hyperref} \begin{document} \input{Chapter1} \end{document} The content of Chapter1.tex is as follows: \input{Images/Chapter 1/Tester} and the Tester.tex file referenced is as follows: \documentclass{standalone} \usepackage{tikz} \usepackage{adjustbox} \begin{document} \begin{adjustbox}{margin=2} \begin{tikzpicture} \node [draw,circle,black,scale=0.7,minimum width=46] at (0,0) {Tester}; \end{tikzpicture} \end{adjustbox} \end{document} I should note that when I compile Tester.tex, it generates the circle fine. When I compile main.tex, however, it gives me the line of code itself in the pdf: I was using the standalone package as suggested in the answers to this question, but it was not enough. Any advice is appreciated!

  • How can I handle division by zero and non-Euclidean distortions in Asymptote without erroring?
    by Jasper on July 29, 2026 at 7:05 pm

    How can I handle division by zero and non-Euclidean distortions in Asymptote without erroring? My goal is to illustrate point-at-infinity illustrations. For example, try setting MAIN_PARAMETER to 180, which is a full inversion, and I cannot achieve it due to the error. Moreover, the diagram seems to not handle the distortions well leading up to these errors. import three; import graph3; real MAIN_PARAMETER = 20; unitsize(1cm); currentprojection=orthographic(1,2,3); triple SP(triple point){ return ( point.x / (1 - point.z), point.y / (1 - point.z), 0 ); } triple ISP(triple point){ real temp = point.x^2 + point.y^2; return ( 2 * point.x / (1 + temp), 2 * point.y / (1 + temp), (-1 + temp) / (1 + temp) ); } transform3 R = rotate(MAIN_PARAMETER, (1,1,0)); triple riemann(pair uv){ return R*ISP((uv.x,uv.y,0)); } triple mobius(pair uv){ return SP(riemann(uv)); } surface theriemann = surface(riemann, (-2, -2), (2, 2), Spline); draw(theriemann, green, meshpen=black + 0.5pt); surface themobius = surface(mobius, (-2, -2), (2, 2), Spline); draw(themobius, blue, meshpen=black + 0.5pt); Without much distortion, it is fine: With a lot of distortion, it is not:

  • Using Beamer colours in \addplot command
    by user446112 on July 29, 2026 at 5:59 pm

    How can I use a Beamer colour (e.g., frametitle.fg) in command \addplot of pgfplots? I tried \addplot[frametitle.fg] but I get error. With thanks.

  • How to use csname to reuse command for part and chapter (get \part, \chapter, \thepart, \thechapter)
    by umarcor on July 29, 2026 at 10:55 am

    I'm trying to rewrite the Minimal Working Example (MWE) below to: Use \pctitleformats{part}{blue} instead of \pctitleformats{\part}{part}{blue} Add \partmark{#1}|\chaptermark{#1}. The working reference without auxiliary commands is the following: \titleformat{\part}{\partmark{#1}\Huge\bfseries\color{blue}}{\thepart}{10pt}{#1} \titleformat{\chapter}{\chaptermark{#1}\Huge\bfseries\color{green}}{\thechapter}{10pt}{#1} The naive solution with helper commands is the following: \newcommand*\pctitleformat[4][]{ \titleformat{name=#2, #1}[hang]{\filcenter\bfseries\Huge\color{#4}}{}{0pt}{#3##1} } \newcommand*\pctitleformats[3]{ \pctitleformat{#1}{#2~$|$~}{#3} \pctitleformat[numberless]{#1}{}{#3} } \pctitleformats{\part}{\thepart}{blue} \pctitleformats{\chapter}{\thechapter}{green} However, it is lacking the \*mark{#1}, which the reference has. I got to: \documentclass[twoside,openright]{report} \usepackage{xcolor} \usepackage[explicit,pagestyles]{titlesec} \titleclass{\part}{top} \newcommand*\pctitleformat[5][]{ \titleformat{name=#2, #1}[hang]% {\expandafter\csname #3mark\endcsname{##1}% \filcenter\bfseries\Huge\color{#5}}% {}{0pt}{#4##1} } \newcommand*\pctitleformats[3]{ \pctitleformat{#1}{#2}% {\expandafter\csname the#2\endcsname\relax~$|$~}% {#3} \pctitleformat[numberless]{#1}{#2}% {}% {#3} } \pctitleformats{\part}{part}{blue} \pctitleformats{\chapter}{chapter}{green} \begin{document} \part{Testing} \chapter{Hello} \end{document} I would like to achieve: \documentclass[twoside,openright]{report} \usepackage{xcolor} \usepackage[explicit,pagestyles]{titlesec} \titleclass{\part}{top} \newcommand*\pctitleformat[4][]{ \titleformat{name=\expandafter\csname #2\endcsname\relax, #1}[hang]% {\expandafter\csname #2mark\endcsname{##1}% \filcenter\bfseries\Huge\color{#4} }% {}{0pt}{#3##1} } \newcommand*\pctitleformats[2]{ \pctitleformat{#1}% {\expandafter\csname the#1\endcsname\relax~$|$~}% {#2} \pctitleformat[numberless]{#1}% {}% {#2} } \pctitleformats{part}{blue} \pctitleformats{chapter}{green} \begin{document} \part{Testing} \chapter{Hello} \end{document}

  • Why lipsum package use changes decimal separator in spanish?
    by Mika Ike on July 28, 2026 at 5:00 pm

    Why lorem/lipsum use makes that spanish decimmal is not comma, as expected?. \documentclass[12pt,a4paper]{article} \usepackage[spanish,es-notilde,]{babel} %\spanishdecimal{,} \usepackage{amsmath,mathtools} \usepackage{amssymb} \usepackage{siunitx} \sisetup{output-decimal-marker={,}} \usepackage{lipsum} \begin{document} \lipsum[1] \textbf{If you comment the previous \texttt{lipsum[1]} you obtain comma as decimal separator in the next 2 lines, as expected in spanish.} Decimal: $\dfrac{7}{4}\approx 1.75$ $\angle{3.4;2}$ No problem in the next lines: $\ang{3.4;2}$ $\num{5.5}$ \end{document}

  • Spacing is too small when using TeX Gyre Termes Math font
    by Muhannad Al Ayoubi on July 28, 2026 at 2:01 pm

    I have noticed that when using the TeX Gyre Termes Math font, the spacing is too small. As you can see below, the letter j is practically jammed into the absolute value bars, as well as the ordinary square and round brackets. Is this the expected behavior of the font? If yes, is there a way to fix it? MWE: \documentclass{book} \usepackage{unicode-math} \setmainfont{TeX Gyre Termes}[Scale=1] \setmathfont{TeX Gyre Termes Math}[Scale=1] \begin{document} \[ \lvert j^2 - 1 \rvert \] \[ [j^2+1] \] \[ (j^2+1) \] \end{document}

  • Necessarily high-sampled curve in plain TikZ
    by Jasper on July 28, 2026 at 6:34 am

    I was making a rational double pendulum in Asymptote: // a rational double pendulum import graph; unitsize(3cm); pair truncated_pi(real t) { real t1 = 3.14 * t; return ( cos(t) + cos(t1), sin(t) + sin(t1) ); } path f = graph(truncated_pi, 0, 314, n=10000); draw(f); I wanted to make it in TikZ, but I am running into the issue of needing a number of samples which is beyond the limit imposed by pgfmath. As some of you may be familiar with, I am very fond of plain TikZ. I would like to see if there are ways to achieve this which are not overly ad hoc. For example, one strategy would be to break the domain into separate regions. How would one draw something like this in the spirit of plain TikZ? \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain=0:314, samples=10000, trig format=rad, declare function={ t1(\x) = 3.14 * \x; x(\x) = cos(\x) + cos(t1(\x)); y(\x) = sin(\x) + sin(t1(\x)); } ] plot ({x(\x)},{y(\x)}); \end{tikzpicture} \end{document}

  • Multiple tables with same column widths
    by Tristan on July 27, 2026 at 10:50 pm

    I am currently writing a linguistic document for which I will need to include multiple tables showing the inflection of various classes of word. I want to be able to have multiple noun declension tables, adjective declension tables, and verb inflection tables throughout the document, and for each table of a given type to have corresponding columns with the same widths (if I overlay one table of a given type over another, the column edges should line up). I.e. I have tables belonging to three types, A, B, & C. Each table of a given type has the same number of rows and columns. I want to ensure that each table of a given type is rendered with the same column widths (ideally this would not have to be set manually by me, but determined based on the widest text placed in a given column in a table of that type). The different types of tables may be interspersed with each other, and tables of a given type might occur in different chapters, so any solution would need to be able to handle that. A minimum example: \documentclass{article} \setlength\parindent{0pt} \begin{document} \begin{tabular}{ r l l} Case & Singular & Plural \\ \hline Nominative & -foo & -bar \\ Accusative & -foo & -bar \\ Genitive & -foo & -bar \\ \end{tabular}\\ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dictum, mauris id cursus interdum, ligula libero tristique nisi, eget accumsan risus diam et erat. Nulla dignissim neque a accumsan tincidunt. Integer eleifend vel ante porta fringilla. Praesent et venenatis enim, eget vehicula lorem. Curabitur cursus condimentum sagittis. Curabitur eget facilisis massa. Phasellus vitae scelerisque neque. Pellentesque quis magna sed neque mattis tincidunt.\\ \begin{tabular}{ r l l l l l l} Tense & 1sg & 2sg & 3sg & 1pl & 2pl & 3pl \\ \hline Present & -foo & -foo & -foo & -bar & -bar & -bar \\ Past & -foo & -foo & -foo & -bar & -bar & -bar \\ Future & -foo & -foo & -foo & -bar & -bar & -bar \\ \end{tabular}\\ Donec vitae risus id eros consectetur gravida eget nec erat. Fusce condimentum, sapien id vulputate ultricies, felis lacus sagittis elit, sit amet accumsan purus ante dapibus magna. Cras nec quam ac diam dapibus elementum sit amet vitae turpis. Praesent bibendum eleifend imperdiet. Etiam sit amet congue libero. Donec at mauris vitae mi tristique rhoncus sit amet sed turpis. Phasellus sed velit nec sem sodales molestie. Ut gravida, lorem at euismod elementum, lectus massa viverra dui, a ultrices arcu nulla nec arcu. \\ \begin{tabular}{ r l l} Case & Singular & Plural \\ \hline Nominative & -a-really-long-ending & -bar \\ Accusative & -foo & -bar \\ Genitive & -foo & -bar \\ \end{tabular}\\ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dictum, mauris id cursus interdum, ligula libero tristique nisi, eget accumsan risus diam et erat. Nulla dignissim neque a accumsan tincidunt. Integer eleifend vel ante porta fringilla. Praesent et venenatis enim, eget vehicula lorem. Curabitur cursus condimentum sagittis. Curabitur eget facilisis massa. Phasellus vitae scelerisque neque. Pellentesque quis magna sed neque mattis tincidunt.\\ \begin{tabular}{ r l l l l l l} Tense & 1sg & 2sg & 3sg & 1pl & 2pl & 3pl \\ \hline Present & -foo & -foo & -foo & -bar & -bar & -bar \\ Past & -foo & -foo & -something-that's long & -bar & -bar & -bar \\ Future & -foo & -foo & -foo & -bar & -bar & -bar \\ \end{tabular}\\ \end{document} The first and third table are of the same type, and the second & fourth table are of the same type. Because of this, the two Singular columns of the first and third tables should be of the same width, but because the third table has a longer ending in the table, its Singular column is much longer. Likewise, the 3sg columns of the second and third tables should have the same width, but in the fourth table it's much wider. As seen here, tables of a given type may be separated by other tables (including other tables of a repeating type). There might also be chapter/section/subsection boundaries between the tables of a given type.