Hot
- Projective limit spanish tildeby Esteban Saldarriaga-Marin on March 17, 2026 at 7:24 pm
I am using babel package with Spanish style (in amsart class), which puts tildes in math symbols such as \lim, \max, \inf, etc. It is actually nice, because it keeps all the formatting in the same language and style. However, it doesn't put tilde in \varprojlim, which doesn't go with the general layout. Is it possible to make \varprojlim have tilde as everything else? MWE: \documentclass{amsart} \usepackage[spanish]{babel} \usepackage{amssymb,amsfonts,amsmath} \begin{document} [ \lim \; \inf \; \max ] [ \varprojlim ] \end{document} Result:
- How to choose the correct blacker value for 9600 dpi to match the output of the lexmarkr mode?by Apoorv Potnis on March 17, 2026 at 4:37 pm
I want to generate a thicker version of the original bitmap Computer Modern fonts as shown in this answer by mickep, but for 9600 dpi. I get the following output with the lexmarkr mode. The PDF viewer used for the above screenshot was Microsoft Edge (with the #edge-new-pdf-viewer disabled so that the legacy PDF viewer is used) on Windows 11 at 500% zoom on a screen of resolution 1920 by 1080. The lexmarkr mode as defined in modes.mf reads as follows (line 1641 onwards). % Michael Covington's ({\tt mcovingt@ai.uga.edu}) definition for the % Lexmark Optra R (4049), reflecting a taste for a heavier than % normal rendition of the Computer Modern fonts. % % You may prefer a lesser value of blacker (down to maybe 1.0). % Initially tested on 10, 12, 17-point CMR and 10-point math italic. % % While we're talking about the Optra R, here's another useful fact: % it takes 32-bit-wide 72-pin SIMMs, 70 or 80 ns. Contrary to the % documentation, you do not have to use IBM's special SIMMs. % % The resolution of 1200 and the |blacker| value of 3 causes {\tt cmbsy7} % to be generated with incorrect arrows and radical sign. The % |vtftzzlo| mode also fails. Decreasing |blacker| to 2 works around. % From {\tt infovore@xs4all.nl} (Olaf Weber) and Henrik Schmiediche. % mode_def lexmarkr = %\[ Lexmark Optra R 4049 (1200dpi) mode_param (pixels_per_inch, 1200); mode_param (blacker, 2); % used to be 3; works around {\tt cmbsy7} bug mode_param (fillin, 0); mode_param (o_correction, 1); mode_common_setup_; enddef; LexmarkOptraR := lexmarkr; As one can see, the lexmarkr mode defines the pixels_per_inch parameter to be 1200. I want to set it to 9600. For reasons that I don't understand, TeX does not accept the value 9600 directly. But one can write 9600 as 4000 + 4000 + 1600 as defined by the ibx mode (line 1560 onewards). I thus added the following test mode and compiled with this new mode. % Test by Apoorv Potnis mode_def apoorvtest = mode_param (pixels_per_inch, 4000 + 4000 + 1600); mode_param (blacker, 2); mode_param (fillin, 0); mode_param (o_correction, 1); mode_common_setup_; enddef; The result is as follows. I guess I've to 'scale' the blacker parameter to get the same visual output. I tried many values, including cranking it up to 100. I can't see any visual difference even with 100 as the blacker value. How do I find out the correct blacker value in this case? Below is the MWE that I used. % \pdfpkresolution=1200 % \pdfpkmode={lexmarkr} \pdfpkresolution=9600 \pdfpkmode={apoorvtest} \pdfmapfile{} \documentclass{article} \begin{document} Some text, and a formula: $D\tan x=1+\tan^2x$. \end{document} The above MWE was compiled with gsudo fmtutil-sys --byfmt mf && gsudo mktexlsr && Remove-Item -Recurse -Force "C:\Users\apoor\.texlive2026\texmf-var\fonts\pk" && pdflatex test.tex. (TeX Live 2026 on Windows 11 and Powershell)
- how do i uncomment a multiline text?by B Bb on March 17, 2026 at 4:24 pm
i want a simple command just like how you can use ctrl+t for commenting multiline text if there is none, alternative solutions are welcome. I tried selecting the % in the editor and ended up selecting the whole thing making me delete them
- Why can't Fontspec find my font under cygwin?by rpspringuel on March 17, 2026 at 3:46 pm
I'm trying to compile a document from a repository which uses a font in the repository in order to ensure that all versions of the document use the same font. This is working fine on macOS and Linux machines by have a script use realpath "$(dirname "${BASH_SOURCE[0]}")" to figure out where the repository is located on the computer and then using sed to populate the Path argument of font loading command in the TeX files before calling lualatex on the document. Now I'm trying to extend this to Windows using Cygwin. The error I'm getting is as follows: luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "/home/user/repository/fonts/Alegreya-Regular.otf". ! Package fontspec Error: (fontspec) The font "Alegreya-Regular" cannot be found; this (fontspec) may be but usually is not a fontspec bug. Either (fontspec) there is a typo in the font name/file, the font is (fontspec) not installed (correctly), or there is a bug in (fontspec) the underlying font loading engine (fontspec) (XeTeX/luaotfload). An MWE of the type of file I'm trying to compile (after the script has done its magic) is as follows: \documentclass[11pt]{article} \usepackage{fontspec} \setmainfont[ Path = /home/user/repository/fonts/ , Extension = .otf , UprightFont = *-Regular , ]{Alegreya} \begin{document} Testing \end{document} Folder structure is: C └ cygwin64 └ home └ user └ repository └ fonts │ └ Alegreya-Regular.otf └ output └ test-type └ testfile.tex I have tried manually adding /cygdrive/c/cygwin64/ to the Path variable to make the path more "absolute" and get the same result. What am I missing about how fontspec handles Path on a Cygwin machine?
- tikz, scaling widths of linesby Zarko on March 17, 2026 at 2:39 pm
It seems (or is apparently) that thickness of lines is hart coded. Consequently at driving of an line, the use for example scale=2 make line only longer and its thickens is not changes, 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} Does exist some trick by which will be scaled thickness of line too? The best way would be as option of the line style, which will has effect just on this particular line. My quick search on site so far didn't give me any suggestion ...
- TikZ / xint: break a loop at the second term, which is 1.0000by cis on March 17, 2026 at 11:34 am
The following loop is an example of a loop that, starting from a certain sequence member, is rounded to 1.0000. How can I break the loop at the second term, which is 1.0000 (in this example, that's the 13th)? Note: I'm using TikZ and xint; both are possible options. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{tikz} \usepackage{xintexpr} \begin{document} \foreach \x in {1,...,15}{%% \x: \xintround{4}{\xinteval{1-exp(-\x/1.2)}}\par }%% \end{document}
- How to use twocolumn-mode after paracols without a pagebreakby Niranjan on March 17, 2026 at 10:31 am
I have the following code: \documentclass{article} \usepackage{graphicx} \usepackage{microtype} \usepackage{xcolor} \usepackage{paracol} \usepackage{kantlipsum} \begin{document} \title{Sample title} \author{Sample author} \maketitle \begin{paracol}{2} \kant[1-2]% \switchcolumn \color{green}% \kant[1-3]% \end{paracol} \medskip \noindent\rule{\linewidth}{0.5pt} \medskip \begingroup \let\clearpage\relax \twocolumn \endgroup \kant[1-2] \begin{figure*}[t]% \centering \includegraphics{example-image-a}% \caption{Test figure}% \end{figure*} \kant[3-4] \end{document} The objective is to start the twocolumn mode just after the paracols are finished. I can't use multicol package as I need to use table* and figure* environments which are not supported with that package. Is there any way to prevent the twocolumn text from overlapping with the paracols text? Is there any other package that supports this kind of typesetting?
- Setting Up Margins for a Landscape A5 Book with Top Bindingby Thomas on March 17, 2026 at 10:24 am
I'm creating a landscape booklet with top ring binding, and I want it to be read across both pages when opened. I've been trying to set up inner and outer margins, but the information I find mostly covers how to do this when the book is bound on the left edge. What I need is to have different top and bottom margins for odd and even pages, like: Odd pages: 25mm top margin, 10mm bottom margin Even pages: 10mm top margin, 25mm bottom margin I’ve tried using the memoir and book classes, along with geometry, but I’m open to other suggestions as well. Could someone explain the recommended setup for this kind of book format? Any help would be greatly appreciated! A (blurry, will update..) picture of the layout I am thinking of. Thanks!
- Is it possible to pass tikpicture as argument to chapter or section headerby Dieter on March 17, 2026 at 9:57 am
Complete rework of this question to better match my problem. My fist version was just not suitable I need to add margin notes to a two column environment. I am using a solution based on this question: Margin notes, multicols, tikz overlay Everything works fine, but I also need to add marginnotes to section headers. But I get Undefined control sequence. How can I avoid this error message? MWE \documentclass{scrbook} \usepackage{scrlayer-scrpage} \usepackage{babel} \babeltags{dutch=dutch} \babeltags{dan=danish} \babeltags{swed=swedish} \babeltags{brit=british} \babeltags{fren=french} \babeltags{ital=italian} \babeltags{espan=spanish} \babeltags{port=portuguese} \babeltags{german=german} \usepackage[no-math]{fontspec} \usepackage[babel=true,nopatch=footnote,letterspace=150,]{microtype} \usepackage[colaction]{multicol} \usepackage{ragged2e} \usepackage{rotating} \usepackage{enumitem} \newlist{LanguageEntry}{itemize}{1} \setlist[LanguageEntry]{ noitemsep,% partopsep=0pt,% topsep=0pt,% parsep=0.3\baselineskip,% labelindent=2em,% labelwidth=2.8em,% align=parleft,% leftmargin=!,% } \DeclareNewSectionCommand[% style=section,% level=2,% beforeskip=4pt,% afterskip=0pt,% runin=false,% font=\normalfont\Large,% tocindent=0pt,% tocnumwidth=0pt,% ]{dictionaryentry} \RenewCommandCopy{\raggedsection}{\RaggedRight} \newcommand{\entry}[3][]{\def\thedictionaryentry{#2}\dictionaryentry[#1]{#3}\allowbreak}%%edited here \newcommand{\entrygeneric}[3][]{% \begin{LanguageEntry}[#1] \item[\textit{#2}]{\RaggedRight #3} \end{LanguageEntry} }% \newcommand{\entrynl}[2][]{\entrygeneric[#1]{Holl.} {\begin{dutch} #2 \end{dutch}}} \newcommand{\entryda}[2][]{\entrygeneric[#1]{Dän.} {\begin{dan} #2 \end{dan}}} \newcommand{\entrysw}[2][]{\entrygeneric[#1]{Schw.} {\begin{swed} #2 \end{swed}}} \newcommand{\entryen}[2][]{\entrygeneric[#1]{Engl.} {\begin{brit} #2 \end{brit}}} \newcommand{\entryfr}[2][]{\entrygeneric[#1]{Franz.} {\begin{fren} #2 \end{fren}}} \newcommand{\entryit}[2][]{\entrygeneric[#1]{Ital.} {\begin{ital} #2 \end{ital}}} \newcommand{\entryes}[2][]{\entrygeneric[#1]{Span.} {\begin{espan} #2 \end{espan}}} \newcommand{\entrypt}[2][]{\entrygeneric[#1]{Port.} {\begin{port} #2 \end{port}}} % Based on % https://tex.stackexchange.com/questions/163567/margin-notes-multicols-tikz-overlay \usepackage{tikz} \newlength{\test} \def\Note#1{% \begin{tikzpicture}[remember picture,overlay] \coordinate (here) at (0,0); %compute horizontal offset from origin to center \pgfextractx{\test}{\pgfpointdiff{\pgfpointorigin} {\pgfpointanchor{current page}{center}}}% \ifdim\test < 0pt% \draw (current page.east |- here)+(-0.5in,0pt) node[anchor=text,align=left,text width=0.5in]{\strut #1}; \else \draw (current page.west |- here)+(0cm,0pt) node[anchor=text,align=right,text width=0.5in]{\strut #1}; \fi% \end{tikzpicture}% \ignorespaces% }% \begin{document} \begin{multicols}{2}\raggedcolumns%%Edited here % AAK \entry{AKK\Note{Note 1}}{Der Name eines Fahrzeugs für Rheinwein nach Holland gebracht wird.} \entrynl{Aak.} \entryda{Et Fartöj paa Rhinſtrömmen.} \entrysw{Et Farto̊g ſom nyttias på Rhinſtrömen.} \entryen{A ſort of flat bottomed lighter.} \entryfr{Aque, Acque.} \entryit{Un battello con fondo piano, di cui ſi ſervono ſopra il Reno.} \entryes{Una barca con fondo llano. ſobre el Reno.} \entrypt{Eſpecie de barca chata ſobre o Rheno.} Additional text for this dictionary entry.\Note{Note 2} % AAP. (Hochdeutſch Affe.) \entry{AAP.}{(Hochdeutſch Affe.)} \entrynl{Aap.} \entryda{Aben.} \entrysw{Apan.} \entryen{The mizen ſtay-ſail.} \entryfr{Voile d’etay d’artimon.} \entryit{La carbonera, o ſia la vela.} \entryes{Vela del humo, o vela.} \entrypt{Rabeca, ou vela do.} % ABAB \entry{ABAB.}{} \entrynl[beginpenalty=100000]{Een turkſch Matroos.} \entryda{En tyrkiſk Matros.} \entrysw{En tyrkiſk Matros.} \entryen{A turkiſh ſailor.} \entryfr{Un matelot turc.} \entryit{Un marinaro turco.} \entryes{Un marinero turco.} \entrypt{Hum marinheiro turco.} % AAPENFALL \entry{AAPENFALL.}{} \entrynl[beginpenalty=100000]{Aapenval.} \entryda{Abe-Fald.} \entrysw{Apan-eller Aben-Fall.} \entryen{The haliard of the mizen-ſtay-ſail.} \entryfr{La driſſe de la voile d’etay d’artimon.} \entryit{La drizza della carbonera.} \entryes{La driza de la vela del humo.} \entrypt{A driça da rabeca.} % ABAB \entry{ABAB.}{} \entrynl[beginpenalty=100000]{Een turkſch Matroos.} \entryda{En tyrkiſk Matros.} \entrysw{En tyrkiſk Matros.} \entryen{A turkiſh ſailor.} \entryfr{Un matelot turc.} \entryit{Un marinaro turco.} \entryes{Un marinero turco.} \entrypt{Hum marinheiro turco.} % ABANDONNEMENT \entry{ABANDONNEMENT.}{} \entrynl[beginpenalty=100000]{Het Abandoneeren van een Schip \&c. aan den Verzekeraar.} \entryda{En Afſtaaelſe og Overladelſe af Gods eller Skib til Aſſuradeuren.} \entrysw{Abandonera förſäkrade Skepp eller Gods til Aſſecuradeuren.} \entryen{The abandoning of a veſſel or goods to the inſurer for getting paid the inſured ſum.} \entryfr{Abandonnement.} \entryit{Abandonamento, ceſſione.} \entryes{Abandono.} \entrypt{Deixaçaõ, inteira ceſſaõ.} % ABANDONNEMENT \entry{ABANDONNEMENT.}{} \entrynl[beginpenalty=100000]{Het Abandoneeren van een Schip \&c. aan den Verzekeraar.} \entryda{En Afſtaaelſe og Overladelſe af Gods eller Skib til Aſſuradeuren.} \entrysw{Abandonera förſäkrade Skepp eller Gods til Aſſecuradeuren.} \entryen{The abandoning of a veſſel or goods to the inſurer for getting paid the inſured ſum.} \entryfr{Abandonnement.} \entryit{Abandonamento, ceſſione.} \entryes{Abandono.} \entrypt{Deixaçaõ, inteira ceſſaõ.} \end{multicols} \end{document}
- Typesetting a coffin at the start of a text lineby ysalmon on March 17, 2026 at 9:11 am
I am giving a try at coffins, and I joined two coffins to typeset material side by side on a line. However, \TypesetCoffin does not put the resulting coffin at the left hand side of the page, but introduces a small gap, as evidenced by the boxes below. Why is that, and how do I tell it not to ? \documentclass{article} \usepackage{showframe,xcoffins} \fboxsep 0pt \begin{document} \noindent \NewCoffin\CoffinExG \NewCoffin\CoffinExD \SetVerticalCoffin\CoffinExG{.72\textwidth}{material} \SetVerticalCoffin\CoffinExD{.28\textwidth}{\hfill material} \JoinCoffins\CoffinExG[b,r]\CoffinExD[b,l] \fbox{\TypesetCoffin\CoffinExG} \end{document}
- How to correctly place a label on a bent arrow using to[bend] in TikZby Bubble Man on March 17, 2026 at 5:40 am
I draw an arrow with a label like this. \documentclass[dvipdfmx]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[auto=left] \node[name=A] at (0,0) {$A$}; \node[name=B] at (1,0) {$B$}; \draw[->] (A) -- (B) node[pos=0.5]{$f$}; \end{tikzpicture} \end{document} I like this notation because the order is “a coordinate, a coordinate, and a label.” This is more readable than “a coordinate, a label, and a coordinate.” I want to bend the arrow while keeping this order. I tried the following: \documentclass[dvipdfmx]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[auto=left] \node[name=A] at (0,0) {$A$}; \node[name=B] at (1,0) {$B$}; \draw[->] (A) to[bend left=30] (B) node[pos=0.5]{$f$}; \end{tikzpicture} \end{document} However, this does not work properly—the label appears at coordinate A. I know I can achieve this with a \newcommand, but is there another way? Thank you.
- border of standalone missing margin with tabular?by Explorer on March 17, 2026 at 5:15 am
The code comes from Mico's answer. \documentclass[border=6pt,varwidth]{standalone} \usepackage[table]{xcolor} \definecolor{headorange}{RGB}{255,127,0} \definecolor{creamlight}{RGB}{255, 242, 215} \definecolor{creamdark}{RGB}{255, 255, 143} \usepackage{array} \arrayrulecolor{white} \setlength{\arrayrulewidth}{1.6pt} \renewcommand{\arraystretch}{1.9} \setlength{\tabcolsep}{0pt} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} \newcolumntype{H}{>{\columncolor{headorange}\color{white}\boldmath}C{1.25cm}} \newcolumntype{L}{>{\columncolor{creamlight}}C{1.8cm}}%<---- \newcolumntype{D}{>{\columncolor{creamdark}}C{1.8cm}}%<---- \begin{document} \begin{tabular}{|H|L|D|L|D|L|D|} \hline $x$ & $-1$ & $-0.8$ & $-0.4$ & $0$ & $0.4$ & $1$ \\ \hline $y$ & & $1.4$ & & $-1$ & $-0.6$ & \\ \hline \end{tabular} \end{document} Noted that with C{1.8cm}, the right margin missing! Thanks to cfr, the warning shows along: Overfull \hbox (10.65623pt too wide) in paragraph at lines 23--30 [][] while changed to: \newcolumntype{L}{>{\columncolor{creamlight}}C{1.65cm}} \newcolumntype{D}{>{\columncolor{creamdark}}C{1.65cm}} The margin appeared as normal(and what I expected): In texdoc standalone, sec.5.2: This option uses the varwidth package to wrap the content into a varwidth environment, which is based on minipage, but will always use the natural width of the content if it is smaller than the given maximum width. The resulting effect is that the created paragraph will not cause any additional width and that multiple paragraphs can be included as part of the content. The used maximal width (which is provided to the underlying minipageenvironment) is \linewidth by default, but can be set by providing a width as value to the option. Maybe the deafault value here mattered? But why standalone has a \linewidth, the tabular behaviour when C{1.8cm} confused me with the missing right margin. Any paraphase or how to prevent the unexpected case?
- How to align tabular on the left with the table is under another table? [duplicate]by user516076 on March 17, 2026 at 1:08 am
Why can't I use \newline? Even entering and giving it \vspace doesn't work. \documentclass[border=6pt]{standalone} \usepackage[table]{xcolor} \usepackage{array} \definecolor{headorange}{RGB}{255,127,0} \definecolor{creamlight}{RGB}{255, 242, 215} \definecolor{creamdark}{RGB}{255, 255, 143} \arrayrulecolor{white} \setlength{\arrayrulewidth}{1.6pt} \renewcommand{\arraystretch}{1.9} \setlength{\tabcolsep}{0pt} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} \newcolumntype{H}{>{\columncolor{headorange}\color{white}\centering\arraybackslash\bfseries\itshape}m{1.25cm}} \newcolumntype{L}{>{\columncolor{creamlight}\centering\arraybackslash}m{1.8cm}} \newcolumntype{D}{>{\columncolor{creamdark}\centering\arraybackslash}m{1.8cm}} \begin{document} \begin{tabular}{|H|L|D|L|D|L|D|} \hline $x$ & $-1$ & $-0.8$ & $-0.4$ & $0$ & $0.4$ & $1$ \\ \hline $y$ & & $1.4$ & & $-1$ & $-0.6$ & \\ \hline \end{tabular} \newline \vspace{4mm} \begin{tabular}{|H|L|D|L|D|L|} \hline $x$ & $1.2$ & $1.6$ & $2$ & $2.4$ & $2.8$ \\ \hline $y$ & & $2.6$ & & & \\ \hline \end{tabular} \end{document} I want the second table on the right side is exactly under the first table and they are left aligned. Like this:
- How do directional lights work in asymptote?by mlem on March 17, 2026 at 12:17 am
I am trying to draw three intersecting planes in 3D, and I am struggling to get the light right. For some reason the default light settings (White, Headlamp, etc) all render at least one of the planes pitch black, so I am trying to resolve the issue by picking exactly where I want the light. However this seems harder than I thought it would be. For example in the following example I picked the light to be at dir(90,90), which should be somewhere along the $\hat{y}$ axis (as indicated by the point $P$), but instead the $xy$ plane is illuminated while the $yz$ and $zx$ planes are left in the dark, as if the light came from above from the $dir(0,0)$ direction. import three; size(9cm); currentprojection=orthographic(1,-1,0.6); triple P = dir(90,90); currentlight = light(gray(0.9), specular=gray(0.2), specularfactor=2, P); real a = 2.5; // half side-length of the square in the xy-plane real h = 3.5; // height of the vertical planes real opac = .8; // Base squares path3 Sxy = (-a,-a,0)--(a,-a,0)--(a,a,0)--(-a,a,0)--cycle; path3 Syz = (0,-a,0)--(0,a,0)--(0,a,h)--(0,-a,h)--cycle; path3 Szx = (-a,0,0)--(a,0,0)--(a,0,h)--(-a,0,h)--cycle; // Pens pen planepen = rgb(0.45,0.55,1.0)+opacity(opac); // Surfaces draw(surface(Sxy), planepen); draw(surface(Syz), planepen); draw(surface(Szx), planepen); // coordinates picture pic; // axis length real L = 1; // origin triple O = (0,0,0); // draw arrows draw(pic, O--(L,0,0), Arrow3(TeXHead2)); draw(pic, O--(0,L,0), Arrow3(TeXHead2)); draw(pic, O--(0,0,L), Arrow3(TeXHead2)); // labels label(pic, "$x$", (L,0,0), SE); label(pic, "$y$", (0,L,0), NE); label(pic, "$z$", (0,0,L), N); dot(pic, "$P$", P, N, red+linewidth(4)); draw(pic, O--P, red+linewidth(1)); transform3 Tx = shift((-3.5,-3.5,0)); add(Tx*pic); Thanks for the help!
- How to modify the chapter headings using \EditInstanceby polaren on March 16, 2026 at 4:50 pm
Below is the MWE I was too lazy to make yesterday. As noted in comments in the MWE I (surprisingly?) need ragged2e to make it compile and (understandably?) hyperref to make the PDF pass VeraPDF. \DocumentMetadata{ lang = sv, pdfversion = 2.0, pdfstandard = ua-2, tagging = on, } \tagpdfsetup{math/mathml/luamml/load=false} \documentclass[11pt,a4paper,twoside,final]{report} \usepackage[margin=25mm,top=24mm,bottom=24mm,nomarginpar,nohead,footskip=11mm]{geometry} \usepackage[document]{ragged2e} % Needed for compilation. \usepackage{hyperref} % Needed to pass VeraPDF. \hypersetup{ pdftitle={MWE}, pdfauthor={polaren}, pdfsubject={First question to LaTeX Stack Exchange.}, } \EditInstance{heading}{chapter}{ number-format=\makebox[12mm][l]{\theheading.}, number-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, title-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, after-sep=0mm, before-sep=0mm, start-code=\clearpage\vspace*{-10.75mm}\rule{\textwidth}{0.1mm}\newline\vspace*{-18mm}, final-code=\vspace*{-5mm}\rule{\textwidth}{0.1mm}\newline\vspace*{4mm}, headformat-instance=hang, decls=\raggedright\parindent 0pt\rmfamily } \setlength{\parskip}{6pt plus 1pt minus 1pt} %\setlength{\parskip}{0pt} \begin{document} \chapter*{Testing starred chapter} Test. \chapter{Testing numbered chapter} Test. \end{document} I'm trying to make a \chapter (and \chapter*) heading looking like the picture below. The document must be accessible, so I'm using the \EditInstance command. With the following code (found pretty much by trial and error) \EditInstance{heading}{chapter}{ number-format=\makebox[12mm][l]{\theheading.}, number-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, title-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, after-sep=0mm, before-sep=0mm, start-code=\clearpage\vspace*{-10.75mm}\rule{\textwidth}{0.1mm}\newline\vspace*{-18mm}, final-code=\vspace*{-5mm}\rule{\textwidth}{0.1mm}\newline\vspace*{4mm}, headformat-instance=hang, decls=\raggedright\parindent 0pt\rmfamily } I get something that looks okay, but I strongly suspect this is far from the best way to do this. For example, this solution depends on the value of \parskip which doesn't seem right (I have \parskip set to 6pt). Also, the \vspace commands indicate this isn't done right. Any suggestions on how to do this more robustly are most welcome. I'm using lualatex-dev on Windows/MikTeX: "This is LuaHBTeX, Version 1.24.0 (MiKTeX 26.2)".
- Trimming causes compilation failureby BambOo on March 16, 2026 at 2:59 pm
I'm using https://tex.stackexchange.com/a/647838/141947 to operate over a list of image files to include them easily in a document. For some reason, adding a trim option to \includegraphics results in a compilation failure with File ended while scanning use of \Gread@parse@vp Why does it break ? MWE \documentclass{article} \usepackage{graphicx} \ExplSyntaxOn \NewDocumentCommand{\plotloop}{O{.}m} {% #1 = common prefix, default . for the current directory % #2 = list of file names \clist_map_inline:nn { #2 } { \begin{figure}[p] \centering \includegraphics[scale=1, angle=90]{example-image-##1} % Works % \includegraphics[scale=1, angle=90, trim={0cm 0cm 0cm 0cm},clip]{example-image-##1} % Fails \caption{Left~\protect\detokenize\expandafter{example-image-##1}} \end{figure} \begin{figure}[p] \centering \includegraphics[{scale=1, angle=90}]{example-image-##1} \caption{Right~\protect\detokenize\expandafter{example-image-##1}} \end{figure} } } \ExplSyntaxOff \begin{document} \plotloop{a,b,c} \end{document}
- How should (0,-1) -- +([turn]45:2) be interpreted?by D G on March 16, 2026 at 11:57 am
How should I interprete the case B? Case A \documentclass[tikz,border=12pt,12pt]{standalone} \begin{document} \begin{tikzpicture}[dot/.append style={circle,fill,inner sep=3pt}] \draw (-3,-3) grid (3,3); \draw[line width=3pt] (-3,-1) coordinate[dot] -- (0,-1) coordinate[dot] -- ([turn]45:{sqrt(2)}) coordinate[dot]% turn 45 degrees relative to the previous segment direction -- ([turn]90:3) coordinate[dot]; \path (0,0) coordinate[dot,red]; \end{tikzpicture} \end{document} Case B \documentclass[tikz,border=12pt,12pt]{standalone} \begin{document} \begin{tikzpicture}[dot/.append style={circle,fill,inner sep=3pt}] \draw (-3,-3) grid (3,3); \draw[line width=3pt] (-3,-1) coordinate[dot] -- (0,-1) coordinate[dot] -- +([turn]45:{sqrt(2)}) coordinate[dot]% how should this line be interpreted? -- ([turn]90:3) coordinate[dot]; \path (0,0) coordinate[dot,red]; \end{tikzpicture} \end{document}
- Figures in margins and example boxes [closed]by Dmitry Vysochinskiy on March 16, 2026 at 11:48 am
I am currently working on a revised edition of an older book. The author insists on keeping the original formatting style, which includes: examples placed inside colored boxes, and figures placed in the margins. I have been able to put the figures in the margins using the tufte-book class. I have also placed the example text inside boxes using the tcolorbox package. For pure‑text examples, I even managed to make some boxes span the full page width. The problem appears when I have an example box that contains full text and a figure that must go into the margin. I cannot figure out how to create a colored box that spans the full page width but still leaves space for a margin figure inside it. In other words: how can I preserve the original text layout (main text + margin figure) and place a colored box behind it? Any suggestions on how to achieve this in tufte-book or with tcolorbox would be greatly appreciated.
- How can I avoid having to delete the .aux file every time I add a new question?by Laurenso on March 16, 2026 at 11:05 am
I have the following code. Every time I add a new question, I need to delete the .aux file for the changes to take effect. How can I avoid deleting the .aux file each time I add a new question? Shuffle questions in xsim
- Use the main font in math mode (Roboto serif)by Thomas on March 16, 2026 at 9:13 am
I'm writing a document using the font roboto-serif, and I struggle setting the same font to the math mode. Here is an MWE : \documentclass{article} \usepackage{amsmath, amssymb} \usepackage{roboto-serif} \begin{document} Here is a formula : $I_\text{Gauss} :=\displaystyle\int_{-\infty}^{+\infty} \mathrm e^{x^2}\mathrm d x=\sqrt{\pi}$ \end{document} And here is the result : We see that the text is in Roboto font, as well as the content of \text in math mode, but the other symbols are in the default math font. The difference is more striking in my full document with paragraph of text and big formulas. I'm quite sure I'm note the first one writing this question, but it's been a few hours I'm looking online and did not manage to find a solution working for me... Either solution setting a sans serif font for math only (visually worst than the present one), or not working solution (it's the first time I'm trying LuaLaTex, that may explain why). NB: I can change the main font for my document, as long as the math mode is coherent with it (ideally, I'd like to use a serif font, different of the default one, but I'm open to something else)
- DocumentMetadata impeding the processing of otherwise normal fileby Knudsen on March 16, 2026 at 5:38 am
I have an MWE that when processed (lualatex) produces an error ! Argument of \__math_grab_dollar_delim:w has an extra }. which, as far as I know, is not true and impedes the processing of the file. When you comment the DocumentMetadata statement line, the file process fine and produces a PDF fine. \DocumentMetadata{pdfversion=1.7, pdfstandard=A-2b, lang=en-US} \documentclass{report} \usepackage{tikz-cd} % Enable modern LaTeX3 programming syntax \ExplSyntaxOn \NewDocumentCommand{\testinput}{ m } { \file_input:n { #1 } } \ExplSyntaxOff \begin{filecontents*}{diag.tex} \begin{tikzcd}[sep = .8 cm] S^2 \arrow[d, "\pi"] \arrow[r, "\pi"] & (P^2,d) \\ P^2 \arrow[ru, "{\overline{\pi}}"] \end{tikzcd} Since $P^2$ is compact... \end{filecontents*} \begin{document} \testinput{diag.tex} \end{document} I read the DocumentMetadata documentation and it mostly says that the command is a statement, and does not elaborate on the implications that it may have on the processing of the file. The numbers I choose for the example only implies that when you save a file as PDF/A-2b, you are creating a PDF 1.7 file that has been stripped of prohibited features (like JavaScript, encryption, and external references). How does one determine what allows the file to be processed and what not?
- Longtable cell content exceeds column width and alignment seems wrong in custom table setupby user516076 on March 16, 2026 at 4:17 am
I am defining a custom longtable environment for a mark scheme table. The first table below is included only to show that the repeated header works correctly across pages, and also to compare the behaviour when the cells contain \lipsum text versus manually written content. The problem appears in the second table. In the last column, the text can extend outside the cell and appear beyond the table boundary. Also, the vertical and horizontal alignment do not seem to behave as expected. I would like to understand why this happens, not only how to fix it. Here is a minimal working example. try.tex \documentclass[12pt]{article} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{array} \usepackage{longtable} \usepackage{lipsum} \usepackage{pdflscape} \usepackage[table]{xcolor} \usepackage{amsmath} \newlength{\MSAnswerWidth} \newlength{\MSPartialWidth} \newcommand{\MSComputeWidths}{% % Desired layout: % | 2cm | x | 2cm | y | % with x = y + 2cm % and the whole table spanning \linewidth \setlength{\MSPartialWidth}{% \dimexpr(\linewidth - 6cm - 8\tabcolsep - 5\arrayrulewidth)/2\relax }% \setlength{\MSAnswerWidth}{\dimexpr\MSPartialWidth + 2cm\relax}% } \newcommand{\MSHead}[2]{% \cellcolor{cyan!35}% \parbox[c][3.2em][c]{#1}{\centering\bfseries #2}% } \newcommand{\MSHeaderRow}{% \hline \MSHead{2cm}{Question} & \MSHead{\MSAnswerWidth}{Answer} & \MSHead{2cm}{Marks} & \MSHead{\MSPartialWidth}{Partial Marks} \\ \hline } \newenvironment{MarkSchemeTable}{% \MSComputeWidths \setlength{\LTleft}{0pt}% \setlength{\LTright}{0pt}% \renewcommand{\arraystretch}{1.15}% \begin{longtable}{|>{\centering\arraybackslash}p{2cm}|>{\raggedright\arraybackslash}p{\MSAnswerWidth}|>{\centering\arraybackslash}p{2cm}|>{\raggedright\arraybackslash}p{\MSPartialWidth}|} \MSHeaderRow \endfirsthead \MSHeaderRow \endhead \hline \endfoot \hline \endlastfoot }{% \end{longtable} } \newcommand{\MSRow}[4]{% #1 & #2 & #3 & #4 \\ \hline } \begin{document} \begin{landscape} \input{try2} \end{landscape} \end{document} and try2.tex \noindent\textbf{Test table} \vspace{3mm} \begin{MarkSchemeTable} \MSRow{1(a)}{\lipsum[1][1-4]}{M1}{\lipsum[2][1-2]} \MSRow{1(b)}{\lipsum[3][1-4]}{A1}{\lipsum[4][1-2]} \MSRow{2(a)}{\lipsum[5][1-4]}{B1}{\lipsum[6][1-2]} \MSRow{2(b)}{\lipsum[7][1-4]}{M1}{\lipsum[8][1-2]} \MSRow{3(a)}{\lipsum[9][1-4]}{A1}{\lipsum[10][1-2]} \MSRow{3(b)}{\lipsum[11][1-4]}{B1}{\lipsum[12][1-2]} \MSRow{4(a)}{\lipsum[13][1-4]}{M1}{\lipsum[14][1-2]} \MSRow{4(b)}{\lipsum[15][1-4]}{A1}{\lipsum[16][1-2]} \MSRow{5(a)}{\lipsum[17][1-4]}{B1}{\lipsum[18][1-2]} \MSRow{5(b)}{\lipsum[19][1-4]}{M1}{\lipsum[20][1-2]} \end{MarkSchemeTable} \begin{MarkSchemeTable} \MSRow{1}{$80\text{ m}$}{3}{\shortstack[l]{M1 for $40 \div 10 = 4\text{ m per cm}$ or scale factor $=4$\\ M1 for $2(4+6)=20\text{ cm}$ or perimeter of drawing $=20\text{ cm}$\\ A1 for $20 \times 4 = 80\text{ m}$}} \end{MarkSchemeTable} My questions are: Why does the content in the fourth column of the second table extend beyond the cell boundary? Why do the vertical and horizontal alignments appear inconsistent in this setup? What is the correct way to enter multi line content in such a cell without breaking the table layout? I am especially interested in the reason this behaves differently from the \lipsum rows. The codes above render to: Using \lipsum gives a cleaner and neater result, but when I enter the content manually, the second table becomes problematic. Thank you in advance. EDIT: Also it's worth mentioning that I use \shortstack[l] because \\ in one cell will not make a newline, instead, in my code, it will make the next stuff goes to the next cell instead. The default alignments that I set before are: for first and third column after the header, it will be horizontally aligned and start from top. the second and fourth column will start from left top (left-aligned)
- Beamer: Align content to top when having text and bullet listby edjmir on March 16, 2026 at 3:14 am
I wonder if there's a way to align the content of two columns in a Beamer doc. I have this MWE \documentclass{beamer} \begin{document} \begin{frame}{Frame title} \begin{columns}[t] \begin{column}{0.3\textwidth} \bfseries\centering Facilitates \end{column} \begin{column}{0.7\textwidth} \begin{itemize} \item Second column, first item \end{itemize} \end{column} \end{columns} \end{frame} \end{document} I see that the solution with the minipage environment works pretty well, but I was wondering if there's an alternative using columns. The alignment using columns works when both are text or bullet lists, but when they are mixed, it doesn't work. I even tried the solution with the custom environment, but it didn't work. \newenvironment{myitemize}
- add an extra table column for alternative representation of quantitiesby Roel on March 15, 2026 at 9:48 pm
The package siunitx has many nice features to make 'raw' numerical data publication ready. especially being able to change the rounding, formatting of the exponent and changing the units (multiplication, offset by 273.15, etc.) make it possible to fix many formal shortcomings of a draft table, without touching the actual data in the table. In a similar vein, would it be possible to add a derived quantity after an existing one; e.g. could one change the column specification of this table: \begin{tabular}{ S[table-format=3.0] } \toprule {$T / \unit{\kelvin}$} \\ \midrule 300 \\ 250 \\ \bottomrule \end{tabular} so that it looks like the one below? \begin{tabular}{ S[table-format=3.0] S[table-format=-2.0] } \toprule {$T / \unit{\kelvin}$} & {$t / \unit{\celsius}$} & \\ \midrule 300 & 26.85 250 & -23.15 \bottomrule \end{tabular}
- How to get list of installed packages of previous TeX Live installation?by ViToni on March 15, 2026 at 12:35 pm
Recently I switched from TeX Live 2025 to TeX Live 2026. As this is a basic installation I now recognizes that the installations are independent and don't share a list of previously installed packages. I'd like to prevent to have to install everything or go package by package until everything compiles. Is there a way to get the list of installed packages from the previous installation? I'm using MacTeX and I fail to use tlmgr by their full path (and by that using them independently) e.g. to get a list of installed packages: Getting the real path: ❯ which tlmgr /Library/TeX/texbin/tlmgr ❯ realpath /Library/TeX/texbin/tlmgr /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/tlmgr.pl tlmgr for TeX Live 2026: ❯ /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/tlmgr.pl Can't locate TeXLive/TLConfig.pm in @INC (you may need to install the TeXLive::TLConfig module) (@INC contains: /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/../../texmf-dist/scripts/texlive /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/../../tlpkg /Library/Perl/5.34/darwin-thread-multi-2level /Library/Perl/5.34 /Network/Library/Perl/5.34/darwin-thread-multi-2level /Network/Library/Perl/5.34 /Library/Perl/Updates/5.34.1 /System/Library/Perl/5.34/darwin-thread-multi-2level /System/Library/Perl/5.34 /System/Library/Perl/Extras/5.34/darwin-thread-multi-2level /System/Library/Perl/Extras/5.34) at /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/tlmgr.pl line 94. BEGIN failed--compilation aborted at /usr/local/texlive/2026basic/texmf-dist/scripts/texlive/tlmgr.pl line 94. tlmgr for TeX Live 2025: ❯ /usr/local/texlive/2025basic/texmf-dist/scripts/texlive/tlmgr.pl Can't locate TeXLive/TLConfig.pm in @INC (you may need to install the TeXLive::TLConfig module) (@INC contains: /usr/local/texlive/2025basic/texmf-dist/scripts/texlive/../../texmf-dist/scripts/texlive /usr/local/texlive/2025basic/texmf-dist/scripts/texlive/../../tlpkg /Library/Perl/5.34/darwin-thread-multi-2level /Library/Perl/5.34 /Network/Library/Perl/5.34/darwin-thread-multi-2level /Network/Library/Perl/5.34 /Library/Perl/Updates/5.34.1 /System/Library/Perl/5.34/darwin-thread-multi-2level /System/Library/Perl/5.34 /System/Library/Perl/Extras/5.34/darwin-thread-multi-2level /System/Library/Perl/Extras/5.34) at /usr/local/texlive/2025basic/texmf-dist/scripts/texlive/tlmgr.pl line 92. BEGIN failed--compilation aborted at /usr/local/texlive/2025basic/texmf-dist/scripts/texlive/tlmgr.pl line 92.
- Theorem citation style [duplicate]by Davide on March 15, 2026 at 12:23 pm
I would like to cite theorems in my manuscript by specifying the reference in the theorem title. I tried using the following code: \begin{theorem}[{\cite[Thm.~2.5]{reference_paper}}] Statement of the theorem \end{theorem} or \begin{theorem} \cite[Thm.~2.5]{reference_paper}. Statement of the theorem \end{theorem} These produce the first two results shown in the attached image, but I would prefer something similar to the third row. Being able to remove the space after '(' in the first example would also be fine. Do you have any suggestions? Thanks in advance!
- Automatically include -converted version of images in LaTeX if it existsby monty01 on March 14, 2026 at 1:11 pm
I'm working on a LaTeX document where I have multiple image files, some of which have a -converted version. For example, my files might look like this: a.png b.png b-converted.png c.png c-converted.png d.png I want to include the images in my document using a command like: \includegraphics{a.png} % includes a.png \includegraphics{b.png} % include b-converted.png \includegraphics{c.png} % include c-converted.png \includegraphics{d.png} % includes d.png That is, the logic should be: If basename-converted.ext exists, include that. Otherwise, include the original file: basename.ext. MWE \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics{a.png} \includegraphics{b-converted.png} \end{document} EDIT: I should work with multiple multiple file extension, like png, jpg, pdf, svg ...
- Drawing distorted circleby Miguel Forteza on March 14, 2026 at 12:14 pm
I was trying to copy this figure (from Elementary Classic Analysis Marsden Hoffman): And I don't know how. I've already seen various posts about a distorted circles where they drawed it randomly and I tried it but the result I get it's not quite like I want. I want like it's a sketch of a set I could have drawn (like the picture), but I get a circle "that has random noise". I know that making figures can be hard (at least for me) so if someone could just give me some indications I'd be really grateful.
- Trig label Issues on Graphby Nick B on March 13, 2026 at 1:07 pm
I am trying to recreate this picture from the College Board. I am able to recreate the image with the x-axis labeled in fourths (pi). However, the original shows each label being 1/8 (pi). Each time I try to use specific xtick and xlabel, the spacing is incorrect. Is there an easier way I can do this? Here is my code: \documentclass[12pt]{article} \usepackage{fullpage,parskip,pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=middle, axis equal, clip=false, enlargelimits=false, xlabel={\(x\)}, ylabel={\(y\)}, title={Graph of \(f\)}, grid=major, grid style={black!75}, xmin=-2*pi/3,xmax=13*pi/6, ymin=-5,ymax=4, xtick={-0.75*pi, -0.5*pi, -0.25*pi, 0, 0.25*pi, 0.5*pi, 0.75*pi, pi, 1.25*pi, 1.5*pi, 1.75*pi, 2*pi, 2.25*pi}, xticklabels={, $-\frac{\pi}{2}$, , , , $\frac{\pi}{2}$, , $\pi$, , $\frac{3\pi}{2}$, , $2\pi$, }, ytick={-5, -4, -3, -2, -1, 0, 1, 2, 3, 4}, yticklabels={\(-5\), , \(-3\), , \(-1\), , \(1\), , \(3\)}, title style={ font=\Large, anchor=north, at={(rel axis cs: 0.5,0)}, yshift=-3mm, }, ticklabel style={fill=white}, axis line style={ thick,-{Triangle[length=3mm,width=2mm]},shorten >=-4mm,}, ticklabel style={fill=white, inner sep=1pt, font=\normalsize}, ] \addplot[samples=100,thick,domain=-2.09:6.54]{3*sin(deg(2*x-pi/2))}; \end{axis} \end{tikzpicture} \end{document} Any help would be appreciated. TYA
- Count spaces in LaTeXby Vincent on March 12, 2026 at 7:11 pm
I would like to create a fast/optimized fully expandable function that counts the number of spaces in an argument: \documentclass{article} \begin{document} \countspaces{ A B } % Should return 3 (1 is ok too if leading and trailing spaces are removed) \countspaces{A \mycommand B} % Should return 2 (\mycommand is not expanded) \countspaces{A {a b c} B} % Should return 2 (spaces inside groups are not counted) \end{document} Explicit spaces should be counted too. How to achieve that?