Hot
- Tikz-cd arrow labels conflict with background colourby Amitai on March 22, 2026 at 6:11 pm
I'm using q.uiver.app to make commutative diagrams for a project. There is a feature that allows for the label of an arrow to be displayed directly above it. This creates a white background for the label, which clashes visually with the background box. Here is an example of what it looks like: Here is an example of the code for the commutative diagram, using {description} to overlay the text above the arrow: \[\begin{tikzcd} Q &&& \\ & P && X \\ \\ & {X'} && Y \arrow["{\exists!h}"{description}, dashed, from=1-1, to=2-2] \arrow["p"{description}, from=1-1, to=2-4] \arrow["q"{description}, from=1-1, to=4-2] \arrow["a"{description}, from=2-2, to=2-4] \arrow["b"{description}, from=2-2, to=4-2] \arrow["f"{description}, from=2-4, to=4-4] \arrow["g"{description}, from=4-2, to=4-4] \end{tikzcd}\] I'm using a template for the project; here is what the stylesheet uses to define the lemma/proof boxes: % proofs: proof \definecolor{prooflinecolor}{RGB}{103, 103, 103} % rgba(40, 40, 40, 180) %FORMAT \definecolor{proofbgcolor}{RGB}{247, 247, 247} % rgba(40, 40, 40, 10) %FORMAT \linedbox{@proof}{Proof}{proof}{proofbgcolor}{prooflinecolor} % this numbers the proofs, so we renew the environment to prevent that; but we still allow a title, so you can do e.g. "Proof (of Theorem 1.2.3)" \def\qed{\null\nobreak\hfill\ensuremath{\blacksquare}} % qed square %FORMAT switch \blacksquare to \square for the not-filled-in version \renewenvironment{proof}[1][]{\csname @proof*\endcsname{#1}{}}{\qed\csname end@proof*\endcsname} \def\flushproof{\vspace{-\parskip}} % put this before a proof to make it flush with the result it's proving How do I make this white background transparent? Or, if necessary, how do I set it to a certain colour (so that I can just choose the backdrop colour)?
- I am trying to make a really cool animation using Koch snowflakes, but don't know howby Jasper on March 22, 2026 at 3:28 pm
I was scrolling through reels earlier and came across a really cool animation: https://www.youtube.com/shorts/aQbq_Fpyyb4. Note: You can analyze the gif frame by frame using the method suggested by MS-SPO in the comments, or by using the website ez-gif, or by using custom python scripts. I interchangeably use ez-gif and python for these sorts of things, and in this instance used ez-gif. I did some digging and found this old post, which I modified slightly. % Source - https://tex.stackexchange.com/a/205608 % Posted by Mark Wibrow % Retrieved 2026-03-22, License - CC BY-SA 3.0 \documentclass[tikz, border=5]{standalone} \usetikzlibrary{lindenmayersystems} \tikzset{koch snowflake/.style={insert path={% l-system [l-system={rule set={F -> F-F++F-F}, axiom=F++F++F, step=0.75cm/3^#1, angle=60, order=#1,anchor=center}] -- cycle}}} \begin{document} \begin{tikzpicture} \path[fill=orange,koch snowflake=4]; \end{tikzpicture} \end{document} I am however without a clue as to how to go about producing this gif I found. I am seeking assistance in creating this gif.
- Creating a cube with labels on its faces [duplicate]by Maroon Racoon on March 22, 2026 at 3:15 pm
How do I create this cube, the arrows are now neccesay, I just want to make it clear what temperature is on each surface, maybe a system of colors woudl be better.
- fonts: strange representation for capital deltaby fft on March 22, 2026 at 1:55 pm
I'm trying to generate texfonts.h from mimetex package. According to documentation I execute next TeX/METAFONT commands: mf "\mode=eighthre; input cmr10" # produces cmr10.83gf gftype -i cmr10.83gf > typeout Most of chars looks as expected (latin letters, capital Gamma and Theta), but capital Delta looks strange. See fragment of typeout file: 1561: beginning of char 0 .<--This pixel's lower left corner is at (0,8) in METAFONT coordinates ****** * * * * * * * * *** .<--This pixel's upper left corner is at (0,0) in METAFONT coordinates 1588: beginning of char 1 .<--This pixel's lower left corner is at (0,8) in METAFONT coordinates * * * * * ** ** * * * * * * .<--This pixel's upper left corner is at (0,0) in METAFONT coordinates 1623: beginning of char 2 .<--This pixel's lower left corner is at (1,8) in METAFONT coordinates ** * * * * * ** * * * * * * * ** .<--This pixel's upper left corner is at (1,0) in METAFONT coordinates If I repeat the same, but use mode=preview, Delta looks ok also. Whether this is sort of bug? If yes, and if I understand correctly, cmr10.mf includes roman.mf, which includes greeku.mf, where description of how to draw Δ is placed. But I can't understand syntax and unable even to determine, whether first step (mf) or second (gftype) cause error. Anyway, seems this files weren't updated recently. I have almost no knowledge about TeX fonts, just want to repeat abovementioned header file. Most of letters for cmr10.83 converted successfully (i.e. I got same hex representation), but not this Delta.
- Footnote numbers invisible when using ELSP.clsby user3009980 on March 22, 2026 at 1:41 pm
When using ELSP.cls, the template uses a \let\thefootnote\relax to create a copyright note as a footnote without a footnote number. This breaks all subsequent footnotes.
- Setting longindentation to 0 in letter class makes the closing collapse to the leftby s.k on March 22, 2026 at 10:45 am
I was told to use \setlength{\longindentation}{0pt} in order for the \signature{} no to disappear when using the letter package class, but when doing so, the text of the \closing{} element is collapsed to the left. This isn't a problem for very short closings, but as soon as they reach the width of the letter body, it looks strange — or at least unusual in some cultures, such as in French. Here is a MWE: \documentclass[a4paper]{letter} \signature{Your Name} \address{Your Address} \date{\today} \setlength{\longindentation}{0pt} \begin{document} \begin{letter}{Recipient Name \\ Recipient Address} \opening{Madame, Monsieur,} This is the body of the letter. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin gravida augue at eleifend vestibulum. Nullam mollis molestie mi eget viverra. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut scelerisque dui in eros imperdiet consectetur. Cras venenatis elit nec orci elementum pellentesque. \closing{Nous vous prions d'agréer, Madame, Monsieur, l'expression de nos salutations distinguées, en espérant avoir le plaisir de vous retrouver lors de notre prochaine rencontre.} \end{letter} \end{document} Which renders as: whereas I want the closing to span all across the text width as the main body does. As a bonus question, I'd like the signature to be on the right part of the page, somewhere around 0.6\textwidth{}. EDITS: If I add \setlength{\indentedwidth}{\textwidth} before \begin{document} then the closing spreads across the textwidth but the text is not justified:
- evenly-padded horizontal line separator in a table with rows with graphicsby Mampac on March 22, 2026 at 10:35 am
when defining a figure that holds a table of images, how do i ensure even and symmetric padding when using \hline in it? by default, there's no padding before the row that was \hlined. i have the following MRE: \documentclass{article} \usepackage{array} \usepackage{graphicx} \newcolumntype{I}{>{\centering\arraybackslash}m{0.18\linewidth}} % simulate images \newcommand{\fakeimg}{\rule{\linewidth}{2.5cm}} \begin{document} \begin{tabular}{c I I I} & A & B & C \\ row1 & \fakeimg & \fakeimg & \fakeimg \\ \hline row2 & \fakeimg & \fakeimg & \fakeimg \\ \end{tabular} \end{document} this produces the following image, where the rule is stuck tightly to the images on the second row: how do i define the padding in a controlled (tunable) manner so that the optional rule perfectly divides it in half (i want to add the divider only between specific pairs of rows)? i've tried interjecting a bunch of artifical spaces and padding in the rows before/after, but they all break apart when i wish for a small-scale padding of, say, 0.3ex: my attemps yield assymetrical padding where the padding before second row is smaller than padding after the first row.
- Placing floating figures inside multicolsby Opusci on March 22, 2026 at 9:12 am
There was this question long time ago And there was answer given by multicols creator Frank Mittelbach with code to implement at least a trivial implementation of floats. It seems that that code is not working anymore. There were changes in LaTeX a few year ago and I suppose they had caused code to brake. I'm honestly interested if there is a way to restore the code in order to get back Frank's trivial implementation of floats insede multicols columns? I am using Frank's multicol-floats.sty as given in old post. Here is code I have used \documentclass{article} \usepackage{multicol} \usepackage{microtype} \usepackage{lipsum,caption,graphicx} \usepackage{multicol-floats} \begin{document} \begin{multicols}{2} \multicolfloat{2}{2}{\centering \includegraphics[scale=0.2]{cat.png} \captionof{figure}{A test} } Some text goes here............ \lipsum Lorem ipsum dolor sit amet, con- sectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adip- iscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, non- \lipsum %\lipsum \end{multicols} \end{document} Error I get is Undefined control sequence on line \multicolfloat{2}{2}{\centering.... UPDATE: I'm testing David's solution and multiple figures on the same page and in the same column will be placed one below the other. Positioning of figures is possible at any location except on the very last page.
- Abnormal Blank Space at the Bottom of Footnotes in cas-dc Templatesby Clara on March 22, 2026 at 8:06 am
While writing paper, I found that abnormal vertical blank space appears at the bottom of footnotes in the first column of the cas-dc template. Even after replacing the original paper content with other characters, the issue still persists, and the reproducible code provided below is just an example rather than the only scenario that triggers this problem. I am using TeX Live 2026 on the Windows system and compiling documents with pdflatex, and I aim to identify the root cause of this abnormal blank space and find corresponding methods to avoid it. \documentclass[a4paper,fleqn]{cas-dc} \begin{document} \shorttitle{} \title[mode=title]{consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in} \tnotemark[1] \tnotetext[1]{ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse} \author[1]{alice bob} \ead{123456789@abc.com} \author[1]{alice bob} \ead{123456789@abc.com} \author[1]{alice bob} \ead{123456789@abc.com} \author[2]{alice bob} \cormark[1] \ead{123456789@abc.com} \author[1]{alice bob} \ead{123456789@abc.com} \cortext[cor1]{Corresponding author} \affiliation[1]{organization={consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse}} \affiliation[2]{organization={consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse}} \begin{abstract} consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse \end{abstract} \maketitle \section{consequat} consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse \par consequat consequat consequat consequat consequat consequat consequat, consequat consequat consequat consequat consequat consequat consequat consequat quat (consequat) XX and consequat consequat consequat consequat consequat (consequat) XX consequat consequat consequat, consequat consequat consequat consequat xxx sds-consequat sdsdsdff. consequatsd, yuiyuiy-consequat conseq consequ consequat sdsd consequat, consequat consequat consequat XX, consequat consequat Regression consequat, consequat-VVV-XXOXXX-XXXXXX (XXXX) XX, and xxxxx Gradient xxxxxxx xxxxxxx (xxxxxxx) XX xxxxxxxx the modeling xx hjkshdsjkhd sdsdsdss by reprehender reprehenderit reprehenderit reprehenderit reprehenderit \end{document}
- Using spy to zoom in on a curveby Nicolas on March 22, 2026 at 7:31 am
I want to show a zoom on a part of my curve with ``'spy```. The compilation of the code returns several errors to me : ! Missing \endcsname inserted. ; ! Extra \endcsname ; ! Illegal unit of measure (pt inserted) ... When I compile without the line of the spy, it works its problem. I don't understand where the problem is. If someone has an idea? \documentclass[12pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{xcolor} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usetikzlibrary{spy} \usepackage{siunitx} \sisetup{ output-decimal-marker={,}, inter-unit-product = \ensuremath{{}\cdot{}} } \definecolor{bleu}{RGB}{25, 90, 185} % Paramètres \pgfmathsetmacro{\Cb}{0.10} % mol/L (NaOH) \pgfmathsetmacro{\Va}{10} % mL \pgfmathsetmacro{\Vdil}{100} % mL \pgfmathsetmacro{\Vzero}{\Va+\Vdil} \pgfmathsetmacro{\na}{0.0008} % mol CH3COOH \pgfmathsetmacro{\Veq}{8} % mL \pgfmathsetmacro{\Ka}{1.8e-5} \pgfmathsetmacro{\lH}{349.6} \pgfmathsetmacro{\lNa}{50.1} \pgfmathsetmacro{\lOH}{198.0} \pgfmathsetmacro{\lAc}{40.9} % Ionisation initiale \pgfmathsetmacro{\Ca}{\na/(\Vzero/1000)} \pgfmathsetmacro{\Hinit}{sqrt(\Ka*\Ca)} \pgfmathsetmacro{\nHinit}{\Hinit*(\Vzero/1000)} \pgfmathsetmacro{\Vneutr}{\nHinit/\Cb*1000} % mL \begin{document} \begin{tikzpicture}[spy using outlines={circle, magnification=4, size=2cm, connect spies}] \begin{axis}[ width=15cm, height=10cm, xlabel={$V_b$ (\si{mL})}, ylabel={$\sigma$ (\si{\milli\siemens\per\centi\meter})}, xmin=0, xmax=26, ymin=0, ymax=4, grid=both, axis lines=left ] % -------------------------- % Neutralisation des H+ initiaux % -------------------------- \addplot[magenta, line width=1.7pt, smooth] coordinates { (0, 0.126) (0.398,0.018) }; % Avant Veq \addplot[magenta, domain=0.398:\Veq, samples=200,line width=1.7pt, smooth] { ( (\lNa*(\Cb*x/1000) + \lAc*(\Cb*x/1000) + \lH*sqrt(\Ka*((\na - \Cb*x/1000)/((\Vzero + x)/1000))) * ((\Vzero + x)/1000) ) / ((\Vzero + x)/1000) ) }; \addlegendentry{avant Veq} % Après Veq \addplot[magenta, domain=\Veq:25, samples=200, smooth, line width=1.7pt, forget plot] { (\lNa*(\Cb*x/1000) + \lAc*\na + \lOH*(\Cb*x/1000 - \na))/((\Vzero+x)/1000) }; % Volume équivalent \draw[black, line width=1.4pt, densely dotted] (axis cs:\Veq,0) -- (axis cs:\Veq,0.6); \node at (axis cs:\Veq,0.2) [ right, font=\small\bfseries] {$V_{\text{eq}}$}; % Zoom spy \spy [red] on (axis cs:0.4,0.05) in node[left] at (axis cs:1,2); \end{axis} \end{tikzpicture} \end{document}
- How do I add a prefix in front of a label in the cwl file (TexStudio)?by zlaaemi on March 22, 2026 at 4:08 am
Basically, I have a custom theorem environment from the tcolorbox package, it doesn't admit regular labels, so instead you have to put the label as the second argument and when you want to reference it you need to add a custom preface in front of it, for example in my case I add "teo:". \documentclass[a4paper,10pt, dvipsnames]{article} %\documentclass[a4paper,10pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{amsfonts} \usepackage{mathtools} \usepackage{amsmath,amssymb,amsthm} \usepackage{geometry} \usepackage[spanish]{babel} \usepackage{enumerate} \usepackage{hyperref} \usepackage[autostyle=true]{csquotes} \usepackage[breakable,many, listings, skins]{tcolorbox} \tcbuselibrary{theorems} \usepackage{cleveref} \newtcbtheorem [number within=section]% init options {theorem}% name {Teorema}% title {% colback=blue!5, colframe=blue!35!black, fonttitle=\bfseries, breakable , drop shadow , }% options {teo}% prefix \crefname{tcb@cnt@theorem}{\itshape\bfseries{Teorema}}{Teoemas} \begin{document} \begin{theorem}{(Integración por Partes)}{integracion-por-partes} Si $f \in R(\alpha)$ en $[a, b]$, entonces $\alpha \in R(f)$ en $[a, b]$ y se tiene: $$\int_a^b f(x)d\alpha(x) + \int_a^b \alpha(x)df(x) = f(b)\alpha(b) - f(a)\alpha(a)$$ \end{theorem} \cref{teo:integracion-por-partes} \end{document} I managed to add all theorem labels to the list of labels TexStudio recognizes by adding a custom cwl file that basically just says: \begin{theorem}{title}{label}#l And the labels do show up as you can see here: Only problem is, I would like for them to show up with the preface "teo:" so that I don't have to add it manually every time, since it also shows up without it in autocompletion.
- luadraw - Why is one of my points out of frame?by Matthew Leingang on March 21, 2026 at 9:35 pm
I'm new to luadraw and I'm trying to recreate the diagram below: Here is my code so far, and the result: % !TEX TS-program = LuaLaTeX \documentclass{standalone} \usepackage[3d]{luadraw} \begin{document} \begin{luadraw}{name=wedge} local a, b, c = 8, 6, 4 local xmax, ymax, zmax = a+1, b+1, c+1 local g = graph3d:new{ window3d = {0,xmax,0,ymax,0,zmax}, viewdir = {30,60}, size={10,10,0} } local xIntcpt, yIntcpt, zIntcpt = M(a,0,0), M(0,b,0), M(0,0,c) local P = M(4,0,0) local Q = interDD({P,vecJ},{xIntcpt,yIntcpt-xIntcpt}) local R = interDD({P,vecK},{xIntcpt,zIntcpt-xIntcpt}) g:Dscene3d( g:addPolyline({ {Origin,xmax*vecI}, {Origin,ymax*vecJ}, {Origin,zmax*vecK}, }), g:addPolyline( {xIntcpt,yIntcpt,zIntcpt}, {close=true,color="cyan"}), g:addFacet( {P,Q,R}, {color="cyan",opacity=0.5} ), g:addPolyline( {P,Q,R}, {close=true,color="cyan",style="dashed"} ), g:addLabel( "\\(x\\)",P,{pos="NW",dist=0.1}, a,xIntcpt,{pos="NW",dist=0.1}, b,yIntcpt,{pos="N",dist=0.1}, c,zIntcpt,{pos="NW",dist=0.1} ) ) g:Show() \end{luadraw} \end{document} The issue, as you can see, is that the point (0,6,0) is out of frame. I tried increasing ymax, that seems to have no effect. I tried changing the width in the size option, but that only stretches the diagram horizontally. I have tried different viewdir options, but they all cut the diagram off at one edge. I'm sure it's something basic that I'm missing, but I'm too much of a novice to notice. Any clues?
- Duplicate index entries with endnotes packageby SirBedevere on March 21, 2026 at 7:35 pm
I'm writing a document that must use endnotes (rather than footnotes), and the endnotes must be indexed along with the main text. I'm having trouble with how the endnotes package is manipulating index entry formatting constructs, resulting in duplicate index entries. Importantly, the \string trick given in previous posts about duplicate index entries doesn't seem to work. MWE: \documentclass[letterpaper,11pt]{article} \usepackage{endnotes} \let\footnote=\endnote \usepackage{mhchem} \usepackage{makeidx} \makeindex \begin{document} The bacterium \emph{E. coli}\index{Escherichia coli@\emph{Escherichia coli}} tolerates environments with oxygen\index{dioxygen@dioxygen ($\ce{O2}$)}. This sentence has a note with index entries encoded in exactly the same way as the text above.\footnote{See references for more about \emph{E. coli} \index{Escherichia coli@\emph{Escherichia coli}} and oxygen\index{dioxygen@dioxygen ($\ce{O2}$)}.} This sentence has a note with index entries modified according to the old \texttt{\\string} trick described in Stack Exchange posts from ten years ago. \footnote{See references for more about \emph{E. coli} \index{Escherichia coli@\string\emph{Escherichia coli}} and oxygen \index{dioxygen@dioxygen ($\string\ce{O2}$)}.} \theendnotes \printindex \end{document} This leads to the index file: \indexentry{Escherichia coli@\emph{Escherichia coli}}{1} \indexentry{dioxygen@dioxygen ($\ce{O2}$)}{1} \indexentry{Escherichia coli@\emph {Escherichia coli}}{1} \indexentry{dioxygen@dioxygen ($\ce {O2}$)}{1} \indexentry{Escherichia coli@\string \emph {Escherichia coli}}{1} \indexentry{dioxygen@dioxygen ($\string \ce {O2}$)}{1} Naively inserting identical index entries in the footnotes leads to an extra space after control sequences like \emph and \ce. However, the trick of putting \string in front of each control sequence (which works great in normal \footnote environments, as well as in \caption and the like) breaks here. Looking over endnotes.sty, I'm guessing the problem arises from how it writes out the notes to a temporary file, inserting newlines after each token, and then inserts spaces when it reads it back? Any ideas how to get this working right? Sadly, I don't know enough TeX to redefine \index to strip those spaces, but it would seem like there must be some way?
- How to direct all LaTeX auxiliary files to a build folder except the final PDF (VS Code + latexmk + nomencl) [duplicate]by palloc on March 21, 2026 at 2:56 pm
I’m working on a multi-file LaTeX project in VS Code using latexmk, biblatex (with biber), and nomencl. My project structure looks like this: main.tex \documentclass{article} \usepackage{geometry} \usepackage{lipsum} \usepackage[backend=biber]{biblatex} \addbibresource{bib.bib} \usepackage{nomencl} \makenomenclature \begin{document} \nomenclature{A}{a} \printnomenclature \input{a/a.tex} \input{b/b.tex} \end{document} a/a.tex \section{First} \lipsum[1] \cite{knuth1984texbook} b/b.tex \section{Second} \lipsum[1] bib.bib @book{knuth1984texbook, title={The texbook}, author={Knuth, Donald Ervin and Bibby, Duane}, volume={15}, year={1984}, publisher={Addison-Wesley Reading} } VS Code settings.json { "latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "%DOC%" ] }, { "name": "makenomenclature", "command": "makeindex", "args": [ "%DOCFILE%.nlo", "-s", "nomencl.ist", "-o", "%DOCFILE%.nls" ] } ], "latex-workshop.latex.recipes": [ { "name": "latexmk → nomencl → latexmk", "tools": [ "latexmk", "makenomenclature", "latexmk" ] } ], "latex-workshop.latex.recipe.default": "latexmk → nomencl → latexmk", "latex-workshop.latex.autoBuild.run": "never" } What I want: I would like all generated auxiliary files (.aux, .bbl, .bcf, .nlo, .nls, etc.) to be placed in a build/ folder, while keeping the final main.pdf in the root project folder.
- Subfigures are not referring with correct figure number when using minipageby Shreya Chauhan on March 21, 2026 at 1:19 pm
I am writing my thesis and I am adding a figure having subfigure. The code is below: \begin{figure} \centering \begin{minipage}{6cm} \centering \includegraphics[width=7cm,height=7cm]{ring_2D_dom.eps} \captionof{subfigure}{Quarter of annulus domain.} \label{3fig:firstring} \end{minipage} \hspace{1.5cm} \begin{minipage}{6cm} \centering \includegraphics[width=7cm,height=7cm]{thick_ring.eps} \captionof{subfigure}{Thick ring shaped domain.} \label{3fig:thick_ring} \end{minipage} \vspace{1cm} \begin{minipage}{6cm} \centering \includegraphics[width=7cm,height=7cm]{igloo.eps} \captionof{subfigure}{Igloo shaped domain.} \label{3fig:second} \end{minipage} \caption{Computational domains.} \label{3fig4} \end{figure} I know I should be using the subfigure command, but after many trials this is the only solution I got to add subfigures without any errors. Now, when I am referring the first subfigure in the text it is displaying Figure 3.0(a) rather than showing Figure 3.1(a). Can anyone help me to get this correct?
- Signature disapears when renewing closing command of the letter classby s.k on March 21, 2026 at 12:34 pm
I need to align the \closing{} of the letter package with the body of the letter, on the left, while keeping the \signature{} but this code is actually removing the \signature{} from the rendered document: \documentclass[a4paper]{letter} \signature{Your Name} \address{Your Address} \date{\today} % I renew the closing command here, before beginning the document: \renewcommand{\closing}[1]{\par\noindent#1\par} \begin{document} \begin{letter}{Recipient Name \\ Recipient Address} \opening{Dear Sir or Madam,} This is the body of the letter. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin gravida augue at eleifend vestibulum. Nullam mollis molestie mi eget viverra. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut scelerisque dui in eros imperdiet consectetur. Cras venenatis elit nec orci elementum pellentesque. \closing{Sincerely,} \vspace{1cm} \hspace*{0.6\textwidth} \signature{} \end{letter} \end{document} Here's the corresponding result using Texmaker 5.0.3 on Ubuntu 22.04.5:
- thin rule at breaking tcolorbox, but don't want [duplicate]by GowriSaro on March 21, 2026 at 4:49 am
\documentclass{article} \usepackage[]{xcolor} \usepackage{lipsum} \usepackage[most,skins,breakable]{tcolorbox}% \tcbuselibrary{skins,breakable}% \tcbset{enhanced,breakable}% \usetikzlibrary{patterns}% %\usepackage{tikz}% \begin{document} \begin{tcolorbox}[enhanced,arc=9pt,colback=white,colframe=red,boxrule=3pt]% \lipsum[1-10] \end{tcolorbox} \end{document} Above code works fine, but a thin colored rule comes at the bottom of the page, and the top of next page, if the box continues page to page, how can I fix it?
- Vertical spacing in \polylongdiv from the polynom packageby ThomasO on March 21, 2026 at 3:51 am
When using fractions in \polylongdiv, the vertical spacing turns out rather awkward. If no fractions are used for the coefficients, the spacing is fine. I have tried to adjust the vertical spacing using arrayrowsep=..., but without any visible change. Is it possible to adjust this vertical spacing for fractions? \documentclass{article} \usepackage{polynom} \polyset{style=C,div=:,arrayrowsep=1cm} \begin{document} \polylongdiv[arrayrowsep=1cm]{(1/5)x^2-(3/7)x+4/9}{x-1/2} \polylongdiv[arrayrowsep=1cm]{5x^2-5x+6}{x-3} \end{document}
- Can I make a numbered tcolorbox have a number from a previous section?by LaTeXereXeTaL on March 21, 2026 at 12:42 am
I have a working exercise/solution engine based on that from the tcolorbox documentation and it works perfectly. There is one thing I would like to change if possible. In my MWE, I create three exercises and their corresponding solutions and I also create new autorefnames for their respective counters. The exercises are in two different sections but all the solutions are in a new section and that causes the solution numbers typeset when I cite them with \autoref to reflect the new section, not the sections of the corresponding exercises. In other words, the names of the solutions to Exercise 1.1 and Exercise 2.1 typeset as Solution 3.1 and Solution 3.2 whereas I would like them to be Solution 1.1 and Solution 2.1 respectively even if they are in the third section. I think my question is: can I make a solution's number retain the value of the number of its corresponding exercise even when the solution is in a different section of the document? I have experimented and nothing I have tried works. This is for a larger book project and I can live with the situation but I want to know if my question has a relatively simple answer. MWE: % !TEX program = lualatexmk % !TEX encoding = UTF-8 Unicode \documentclass{article} \usepackage[language=english]{lipsum} \usepackage{tcolorbox} \usepackage{hyperref} \hypersetup{colorlinks} \tcbuselibrary{skins,theorems} \newcounter{exercisecounter} \newcounter{solutioncounter} \newcommand{\exercisecounterautorefname}{Exercise} \newcommand{\solutioncounterautorefname}{Solution} \NewTColorBox[use counter=exercisecounter,number within=section]{exercise}{m +!O{}} {% coltitle=black,% title={Exercise~\thetcbcounter:},% label={exer:#1},% attach title to upper=\quad,% after upper={\par\hfill {Solution on page~\pageref{soln:#1}}},% lowerbox=ignored,% savelowerto=exercise-\thetcbcounter.tex,% record={\string\solution{#1}{exercise-\thetcbcounter.tex}},% #2 }% \NewTotalTColorBox[use counter=solutioncounter,number within=section]{\solution}{m m}{% coltitle=black,% title={Solution of Exercise~\ref{exer:#1} on page~\pageref{exer:#1}:},% label={soln:#1},% attach title to upper=\par,% }{\input{#2}} \tcbset{no solution/.style={no recording,after upper=}} \begin{document} \section{Exercises} \lipsum[1] \tcbstartrecording\relax \begin{exercise}{one} This is the first exercise. \tcblower This is the first solution. \end{exercise} I can cite \autoref{exer:one} on page~\pageref{exer:one} and solution \autoref{soln:one} on page~\pageref{soln:one}. \section{Another Section} \lipsum[1] \begin{exercise}{two} This is the second exercise. \tcblower This is the second solution. \end{exercise} \begin{exercise}{three} This is the third exercise. \tcblower This is the third solution. \end{exercise} \tcbstoprecording I can cite \autoref{exer:two} on page~\pageref{exer:two} and solution \autoref{soln:two} on page~\pageref{soln:two}. I can cite \autoref{exer:three} on page~\pageref{exer:three} and solution \autoref{soln:three} on page~\pageref{soln:three}. \newpage \section{Solutions} \tcbinputrecords \end{document}
- How do I get the actual height available for text on a page with a chapter title? (\textheight includes the title height)by demented hedgehog on March 21, 2026 at 12:06 am
How can I get the actual height available for content on a chapter title page excluding the space for chapter title etc at the top? Some context, I have code that generates latex with an \adjustbox{max totalheight=\textheight} box on a page (so I don't know beforehand whether this will occur on a page with a title or not). \textheight does not factor out the height of the chapter title. Is there some reasonably robust and "correct" way of getting the actual text height available? Minimal example that demonstrates that \textheight is the same on pages with or without a chapter title: \documentclass[a4paper]{book} \usepackage{lipsum} \begin{document} \chapter{A Chapter Title} \lipsum[2] \textbf{Text Height \the\textheight} \\ \lipsum[2] \newpage \lipsum[2] \textbf{Text Height \the\textheight} \\ \lipsum[2] \end{document}
- How do I make it so that the orbs have the same relative position to their images?by Nico on March 20, 2026 at 11:10 pm
Idk how to really describe this, but notice how the 1 sits at the bottom of the first image and the 2 sits at the top. I've used an enumerate environment here and I also used columns, because I just don't want to waste all this empty space and make 2 half slides instead of 1 full one. Here's a minimal work example: \documentclass{beamer} \begin{document} \begin{frame} \begin{columns} \begin{column}{0.4 \textwidth} \begin{enumerate} \item \includegraphics[scale = 0.2]{picture 1} \item \includegraphics[scale = 0.2]{picture 2} \end{enumerate} \end{column} \hfill \begin{column}{0.4 \textwidth} Why does it work? \begin{itemize} \item \end{itemize} \end{column} \end{columns} \end{frame} \end{document} Also here's picture 1 and picture 2:
- Disappearing labelsby John McHugh on March 20, 2026 at 10:30 pm
I am editing a paper with about 30 authors divided into groups, each responsible for one or two sections. I have a master file with header information (title, abstract, etc.) and trailer information, author list, acknowledgements, bibliography. In between, each section is incorporated with \Secin{<file>} directives (see below). In the header, before the \begin{document} is a \input{Include} statement. The file Include.tex contains a \includeonly{} line, and a \newcommand{} line that defines \Secin{} to use either \input{} or \include{}. This is necessary because the document is an article, not a book and has \sections{} rather than \chapters{} and when processing the whole paper, \inputs are needed to avoid page breaks. I have a shell script that takes as an argument a digit, N, 1 - 6 to process group N's section(s). It renames the existing output pdf file, copies the group's IncludeN.tex file to Include.tex, runs pdflatex on the primary file, renames the resulting pdf file adding an N before the .pdf and copies Include00.tex, the default (which uses \input{} and has no \includeonly{}) to Include.tex and renames the old pdf file back to its original name. At each iteration in the editing, I send the authors in each group, their section(s) as pdf and LaTeX. Some are LaTex users and can edit their source. For others, I make the changes based on their inputs. So far, so good, but when I added labels to each section to allow cross referencing, strange things happened. When I process the whole document using the default Input.tex, and the references stabilize, I find \newlabel{}s in the primary aux file for all labels in all sections. There are no aux files for the sections because these runs are being done with \input{}s. The first time, I ran my script to select a single group's section, I got a "labels may have changed, rerun" message. Fair enough, but when I rerun, I get an undefined label message for a label defined in another section, but referenced in one I am processing. At this point, the primary aux file has no \newlabel for the label I am referencing and there is no aux file for the other sections. My solution is to define the Include0.tex file (For the group of all authors) to set the input method to \include{} but to omit an \includeonly{} directive. When I run this, I get a pdf for the entire document with each section starting on a new page and the per section .aux files. The default Include.tex file is left with the \Secin{} command defined as \input{} so the pdf is in the publication form with no forced page breaks if I run pdflatex directly on the primary input file. I figured out what was going on while writing the question, and this works, but it seems that there ought to be a better way. When \includeonly is used on a chaptered document or any one in which each input file's output should start on a new page, the \input{} and \include{} results are the same. Is there any way to suppress the page break on \include{}?
- How can Initials with special characters (e.g. German Umlaute) be designed? [duplicate]by Thomkrates on March 20, 2026 at 6:56 pm
I would like to use Initials in a nice poetry book and need for German Umlaute (Ä Ö Ü) those designs. And the general question is: Why are Initials always without special characters, also for other languages other than German? And for now: How is it possible to produce Ä Ü Ö manually? \documentclass[a4paper]{article} \input Zallman.fd \pagestyle{empty} \begin{document} \begin{center} \fontsize{60pt}{72pt}\usefont{U}{Zallman}{xl}{n} ABCDE \\ FGHIJK \\ LMNOP \\ QRSTU \\ VWXYZ \\ ÄÖÜ \\%<-- Special characters Umlaute Initials?! \end{center} \vfill \begin{center} Font name: ``Zallman'' (ZallmanCaps) \end{center} \end{document} Is there a trick to get them nice?
- How to rotate the watermark text in a tcolorbox?by Mika Ike on March 20, 2026 at 6:48 pm
\documentclass[12pt]{article} \usepackage[spanish]{babel} \usepackage[dvipsnames,svgnames,x11names,table]{xcolor} \usepackage[most]{tcolorbox} \tcbset{ enhanced jigsaw, boxsep=0.1cm, colframe=red, colback=red!16, coltitle=red!16, colupper=blue, collower=blue, breakable, pad at break*=1mm } \usepackage{lipsum} \usepackage{graphicx} % \begin{document} Hello \rotatebox[origin=c]{45}{France} \begin{tcolorbox}[enhanced jigsaw, watermark color=purple!64!white,watermark text={My name will be here. My company will be here. Letters will be here.},remember as=one] %,watermark tikz={rotate=1, scale=1} \lipsum[1] \end{tcolorbox} % $x^2-x-1=0$ % \end{document} O tried with this option in the tcolorbox enviroment ,watermark tikz={rotate=1, scale=1} but no success.
- Cropping an image using a lookup tableby mf67 on March 20, 2026 at 2:36 pm
I have a large set of images that I reuse in a book. They all have different bottom crop and so far I have used the macro \image{21}{002} to show image 002.pdf with a 21 bottom crop. I would like to use a macro that, based on the image ID (e.g. 002), looks up the corresponding value (21) and applies the crop consistently. I have tried \documentclass[11pt]{book} \usepackage{graphicx} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \def\image#1#2{ \medskip\par\nobreak \centerline{ \begin{tikzpicture} \draw[below right] (0, 0) node[inner sep=0] {\fbox{\includegraphics[trim={25 #1 25 10},clip]{graphics/chorales/#2.pdf}}}; \end{tikzpicture} } } \def\imageAuto#1{ \medskip\par\nobreak \def\cropvalue{10} \ifnum #1=002 \def\cropvalue{21} \fi \centerline{ \begin{tikzpicture} \draw[below right] (0, 0) node[inner sep=0] {\fbox{\includegraphics[trim={25 \cropvalue 25 10},clip]{graphics/chorales/#1.pdf}}};}; \end{tikzpicture} } \begin{document} \image{21}{002} \imageAuto{002} \end{document} with \imageAuto a ‘basic’ solution for a look-up-function (with the default 10), but it does not work. Is there a (better) solution to my problem? PS. The reason for using TikZ is that I need to place text objects on the image, but I have removed those lines for clarity in this post.
- xint: calc array with binomial coefficients only one timeby cis on March 20, 2026 at 2:12 pm
I need all binomial coefficients for n=1..100 and k=1..100 several times, so I wrote a code with xint: \xintdefvar BinomialArray = ndseq(binomial(n,k), n=1..100; k=1..100); \xintdeffunc abinomial(n,k):=BinomialArray[n-1,k-1]; I measured out for that: ******************************************** *** TOTAL COMPILATION TIME REPORT: *** (l3benchmark) + TOC: 2.27 s ******************************************** This is OK, but I asked myself: Is there any way I can store the array (in a file?) so that it doesn't have to be recalculated on every new run? \documentclass[paper=a5, paper=landscape]{scrarticle} \usepackage[margin=10mm]{geometry} \usepackage{xintexpr} \usepackage{amsmath} \begin{document} \xintdefvar BinomialArray = ndseq(binomial(n,k), n=1..100; k=1..100); \xintdeffunc abinomial(n,k):=BinomialArray[n-1,k-1]; %Test: \xinteval{BinomialArray[100-1,50-1]} works Test: $\dbinom{100}{50}=\xinteval{abinomial(100, 50)}$ % Show complete array - on your own risk :() %\newpage %\begingroup %\tiny %BinomialArray = \xintthealign\xintexpr BinomialArray\relax %\endgroup \end{document}
- Creating a triangle using intersection and automatically clipping the exceeding lineby user516076 on March 20, 2026 at 3:18 am
As what my knowledge could tell, It's possible to create a triangle with only 2 coordinates to make real angles to be exact, and using path to create long rays and naming the intersection of those rays and finally connect them with \draw. MWE: \documentclass[tikz, border=10pt]{standalone} \usepackage{siunitx} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[scale=2] \clip (0,0) rectangle (5,2.1); \coordinate (A) at (0,0); \coordinate (C) at (5,0); \path[name path=AB] (A) -- ++(37:4); \path[name path=BC] (C) -- ++(137:4); \path[name intersections={of=AB and BC, by=B}]; \draw[thick] (A) -- (B) -- (C) -- cycle; \end{tikzpicture} \end{document} There is a noticable difference if I comment \clip in the 6th line. Without it, it's going to be a white space... It's impractical to calculate the height of the object if I make another drawing with more complicated shape. So, is it possible to autocrop the exceeding lines? What I meant by exceeding lines is like the cyan lines in the figure below. It's because they contribute to white space if I change \draw to \path: So, if possible, I want TikZ to automate cropping the intersection, in other words, getting rid of those exceeding lines without estimating like how much the height is (would consume loads of time if I make other complicated figures with intersections). To illustrate what I actually want, roughly I want something like this: Yes, I deliberately cropped it poorly to give an example as to what it shows if I gave them an incorrect clipping, which I wish I didn't need to clip it, but instead, I wish TikZ only read the intersection point and two given coordinates to draw.
- xint / pgffor: Loop-wise calculation of the values of the cumulative binomial distribution - performanceby cis on March 19, 2026 at 3:53 pm
I have some code here that calculates the functions \bdceval{\n}{\p}{\k}, row by row, for fixed \n and \k values and values p from a list \def\pList{0.1, 1/6, 0.25, 0.3, 0.4, 0.5}. It works and is correct. But I'm wondering: Is this well-designed in terms of performance? I can only manage to implement \makePListRow{\n}{\k} with two commands. \documentclass{article} \usepackage{tikz} \usepackage{xintexpr} \def\pList{0.1, 1/6, 0.25, 0.3, 0.4, 0.5} % Function: \xintNewFloatExpr{\bdceval}[3]{add(binomial(#1,v)*#2^v*(1-#2)^(#1-v), v=0..#3)} % Commands for List: \newcommand{\myRowMapper}[1]{\xintRound{4}{\bdceval{\n}{#1}{\k}}} \NewExpandableDocumentCommand{\makePListRow}{mm}{% \xintListWithSep{, }{% \xintApply{\myRowMapper}{\xintCSVtoList{\pList}}% }% } \begin{document} \foreach \n in {2,3,7}{% \foreach \k in {0,...,\n}{% \n, \k, \makePListRow{\n}{\k} \par }% } \end{document}
- plain TeX to LaTeX conversionby GowriSaro on March 18, 2026 at 10:22 am
I'm having bunch of Plain TeX equations, few examples given below: $$ a+b=c $$ $$ - {\pi \over 2} < \theta < {\pi \over 2}.\eqno{(1)} $$ $$ \left\{ \matrix{ \dot{\varphi}_1 = \varphi_2 \cr \dot{\varphi}_2 = M^{-1} ( \varphi_1) \cr } \right. , $$ \bye Is there any possibility to convert those to LaTeX format, please advise.
- tikz, scaling widths of linesby Zarko on March 17, 2026 at 2:39 pm
It seems (or is apparently) that thickness of lines is hard coded. Consequently when drawing a line, the use for example of scale=2 only makes the line longer and its thickness is not changed, see MWE below: \documentclass[margin=3mm, varwidth]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{LA/.style = {-Straight Barb, line width=1mm}} \begin{document} \begin{tikzpicture} \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \begin{tikzpicture}[scale=2] \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \end{document} Is there some trick by which the thickness of the line will also be scaled? The best way would be as option of the line style, which will have effect just on this particular line. My quick search on this site so far didn't give me any suggestion ...