Week
- Unwanted horizontal shift of equation* on overlay when \label is present and equation ends with , or ;by João Alves Jr. on March 19, 2026 at 7:26 pm
Since sometime between August 2025 and March 2026, a \label inside equation* causes an unwanted horizontal shift of the displayed equation when advancing overlays, provided the equation ends with , or ;. (Text removed: ̶T̶h̶e̶ ̶s̶h̶i̶f̶t̶ ̶d̶o̶e̶s̶ ̶n̶o̶t̶ ̶o̶c̶c̶u̶r̶ ̶w̶h̶e̶n̶ ̶t̶h̶e̶ ̶e̶q̶u̶a̶t̶i̶o̶n̶ ̶e̶n̶d̶s̶ ̶w̶i̶t̶h̶ ̶̶.̶̶,̶ ̶n̶o̶r̶ ̶w̶h̶e̶n̶ ̶̶e̶q̶u̶a̶t̶i̶o̶n̶̶ ̶(̶n̶u̶m̶b̶e̶r̶e̶d̶)̶ ̶i̶s̶ ̶u̶s̶e̶d̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶̶e̶q̶u̶a̶t̶i̶o̶n̶*̶̶,̶ ̶n̶o̶r̶ ̶w̶h̶e̶n̶ ̶̶\̶l̶a̶b̶e̶l̶̶ ̶i̶s̶ ̶a̶b̶s̶e̶n̶t̶.̶ ) Update: Further testing shows that the conditions are more general than initially described. The shift does not occur when \label is absent (this seems to be a necessary condition in all cases identified so far). However, with \label present, the bug also occurs with equation (numbered), and can be triggered by other elements affecting horizontal spacing in math mode, such as an operator defined via \DeclareMathOperator — regardless of the final punctuation character. The conditions listed below reflect only the cases identified so far and may not be exhaustive. The following MWE reproduces the problem: \documentclass{beamer} \begin{document} \begin{frame}{Test} \begin{equation*}\label{E:Test} A, \end{equation*} \pause Text. \end{frame} \end{document} Observed behavior: On overlay 1, the equation appears at one horizontal position. After advancing to overlay 2 (via \pause), the equation shifts slightly to the right. Expected behavior: The equation should remain at the same horizontal position across all overlays. Conditions that trigger the bug (all three must hold simultaneously): (Text removed: ̶e̶q̶u̶a̶t̶i̶o̶n̶*̶̶ ̶(̶u̶n̶n̶u̶m̶b̶e̶r̶e̶d̶)̶;̶ ) equation* (unnumbered) or equation (numbered); \label{...} inside it; (Text removed: t̶h̶e̶ ̶e̶q̶u̶a̶t̶i̶o̶n̶ ̶e̶n̶d̶s̶ ̶w̶i̶t̶h̶ ̶̶,̶̶ ̶o̶r̶ ̶̶;̶̶ ̶(̶m̶a̶t̶h̶e̶m̶a̶t̶i̶c̶a̶l̶ ̶p̶u̶n̶c̶t̶u̶a̶t̶i̶o̶n̶,̶ ̶i̶.̶e̶.̶ ̶̶\̶m̶a̶t̶h̶p̶u̶n̶c̶t̶̶)̶.̶ ) the equation ends with , or ; (mathematical punctuation, i.e. \mathpunct), or contains certain elements that affect horizontal spacing in math mode, such as an operator defined via \DeclareMathOperator. Conditions under which the bug does not occur: \label removed from the equation environment; (Text removed:̶e̶q̶u̶a̶t̶i̶o̶n̶̶ ̶(̶n̶u̶m̶b̶e̶r̶e̶d̶)̶ ̶u̶s̶e̶d̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶̶e̶q̶u̶a̶t̶i̶o̶n̶*̶̶;̶ ) (Text removed: e̶q̶u̶a̶t̶i̶o̶n̶ ̶e̶n̶d̶s̶ ̶w̶i̶t̶h̶ ̶̶.̶̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶̶,̶̶ ̶o̶r̶ ̶̶;̶̶.̶ ) equation ends with . instead of , or ; in some cases. Suspected cause: During the overlay retypsetting pass, the \label inside the equation environment triggers a write to the .aux file. This side effect appears to disturb the internal state of display math mode at the moment the final content is processed. Since , and ; are \mathpunct and insert spacing via \mskip, they are sensitive to the math mode state at that point; . is not a \mathpunct in math mode. Similarly, \DeclareMathOperator also involves spacing adjustments that appear sensitive to the same disturbance. Workaround: Remove \label from equation environments, or place it at the very end of the equation, just before \end{equation*} (credit: greg). Note that a \label inside equation* is semantically questionable in any case, since an unnumbered equation cannot be meaningfully referenced; however, keeping labels in slides that share code with a book may be a legitimate reason to have them. Environment: MiKTeX (updated) with a recent Beamer version. The problem was not present in August 2025 and began occurring by March 2026 or before, suggesting it was introduced by an update to Beamer or one of its dependencies in that interval.
- 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}
- Accessible PDF, include pdf with pdfpages and add alt textby YamiOmar88 on March 19, 2026 at 10:44 am
I am creating an accessible PDF using tagpdf as follows: \DocumentMetadata{ lang = fr-FR, pdfversion = 2.0, pdfstandard = ua-2, pdfstandard = a-4f, %or a-4 tagging = on, tagging-setup={math/setup=mathml-SE} } \documentclass[a4paper,11pt]{article} % Page layout \usepackage[margin=2.5cm]{geometry} \usepackage{pdfpages} % General information \author[]{YamiOmar88} \title{Some Title} \date{} % remove semantic paragraphs: \AssignTaggingSocketPlug{para/semantic/begin}{noop} \AssignTaggingSocketPlug{para/semantic/end}{noop} \begin{document} % --- Poster pages (NOT accessible, marked as artifacts) --- \tagstructbegin{tag=Artifact, alt={Tableau de bord non accessible}} \includepdf[pages=1, fitpaper=true, artifact]{example-image.pdf} \includepdf[pages=1, fitpaper=true, artifact]{example-image.pdf} \tagstructend \end{document} I include pages from another PDF file using the pdfpages package and the command \includepdf. Here, for this example I'm always including the same page #1 and using a sample image to be able to compile it. When I look at my tags I see this: <Document> <Private> <Figure> <p> <Figure> <p> As I declared the artifact, the <Private> tag shows the appropriate alt-text. However, the <Figure> tags contain the path to the image as alt text. How can I change that? I do not want that path to be made public. And what are the <p> tags? Where did they come from? Note: The code is compiled with LuaLaTeX using MiKTeX 26.2. My LaTeX version is LaTeX2e <2025-11-01>, L3 programming layer <2026-01-19>.
- Accessible PDF, declaring an artifact for included pdf pagesby YamiOmar88 on March 19, 2026 at 10:34 am
I am building an accessible PDF using tagpdf as follows: \DocumentMetadata{ lang = fr-FR, pdfversion = 2.0, pdfstandard = ua-2, pdfstandard = a-4f, %or a-4 tagging = on, tagging-setup={math/setup=mathml-SE} } \documentclass[a4paper,11pt]{article} % Page layout \usepackage[margin=2.5cm]{geometry} \usepackage{lipsum} \usepackage{pdfpages} % General information \author[]{YamiOmar88} \title{Some Title} \date{} % remove semantic paragraphs: \AssignTaggingSocketPlug{para/semantic/begin}{noop} \AssignTaggingSocketPlug{para/semantic/end}{noop} \begin{document} \maketitle \section*{Some Section} \lipsum[1] \clearpage % --- Poster pages (NOT accessible, marked as artifacts) --- \tagstructbegin{tag=Artifact, alt={Tableau de bord non accessible}} \includepdf[pages=1, fitpaper=true, artifact]{example-image.pdf} \includepdf[pages=1, fitpaper=true, artifact]{example-image.pdf} \tagstructend \end{document} As it can be seen, I add pages using \includepdf. For this example purpose, I'm adding the example-image.pdf as a page so the code can be compiled without external files. The <Artifact> I declare shows as a <Private> tag inside the <Sect> tag. But in this particular file I'm working, it would make more sense for it to be at the same level as the <Sect> tag instead of inside it. Is this possible? In other words, I want this: <Document> <p> <p> <Sect> <H1> <p> <Private> instead of this: <Document> <p> <p> <Sect> <H1> <p> <Private> Note: The code is compiled with LuaLaTeX using MiKTeX 26.2. My LaTeX version is LaTeX2e <2025-11-01>, L3 programming layer <2026-01-19>.
- Drawing a parallel line that is perpendicular to another line and connecting the end linesby user516076 on March 19, 2026 at 9:39 am
I wish to draw something like this: I can draw the two lines, though it is difficult to be precise. However I don't know what to do next as for the dashed line and the arrow line. The dashed lines are perpendicular to MK and JL, but the arrow line are parallel to those lines. And the difficult part is connecting the dashed line with the arrow line. I failed to draw the 90 degree sign, it looks too big and ugly. My attempt: \documentclass[tikz,border=3pt]{standalone} \usepackage{amsmath} \usetikzlibrary{calc,intersections,angles,quotes,arrows.meta} \begin{document} \begin{tikzpicture}[line cap=round,line join=round,>=Stealth] % ---------- circle ---------- \def\r{3.0} \coordinate (O) at (0,0); % points on the circle chosen by polar coordinates % (this is the important part) \coordinate (J) at (86:\r); \coordinate (M) at (142:\r); \coordinate (L) at (232:\r); \coordinate (K) at (332:\r); % circle \draw[black,line width=0.9pt] (O) circle (\r); % ---------- cyan lines ---------- \colorlet{mycyan}{cyan!70!blue} % main solid chords \path[name path=JL] (J) -- (L); \path[name path=MK] (M) -- (K); \draw[mycyan,line width=1.1pt] (J) -- (L); \draw[mycyan,line width=1.1pt] (M) -- (K); % intersection N \path[name intersections={of=JL and MK, by=N}]; % ---------- right-angle mark at N ---------- \coordinate (Nu) at ($(N)!0.42!(M)$); \coordinate (Nv) at ($(N)!0.42!(J)$); \coordinate (Nw) at ($(Nu)+(Nv)-(N)$); \draw[black,line width=0.8pt] (Nu) -- (Nw) -- (Nv); % ---------- center ---------- \fill (O) circle (2.2pt); % ---------- labels ---------- \node[font=\fontsize{21}{21}\selectfont] at ($(J)+(0.02,0.35)$) {$J$}; \node[font=\fontsize{21}{21}\selectfont] at ($(M)+(-0.45,0.08)$) {$M$}; \node[font=\fontsize{21}{21}\selectfont] at ($(L)+(-0.28,-0.18)$) {$L$}; \node[font=\fontsize{21}{21}\selectfont] at ($(K)+(0.5,-0.02)$) {$K$}; \node[font=\fontsize{21}{21}\selectfont] at ($(N)+(0.38,0.02)$) {$N$}; \node[font=\fontsize{25}{25}\selectfont] at ($(O)+(0,-0.55)$) {$O$}; \end{tikzpicture} \end{document} Also, explain to me what the trick is, so that I can implement it in other cases.
- Extra Part tags in accessible, tagged PDFby YamiOmar88 on March 19, 2026 at 9:10 am
I am creating an accessible PDF using tagpdf as follows: \DocumentMetadata{ lang = fr-FR, pdfversion = 2.0, pdfstandard = ua-2, pdfstandard = a-4f, %or a-4 tagging = on, tagging-setup={math/setup=mathml-SE} } \documentclass[a4paper,11pt]{article} % Page layout \usepackage[margin=2.5cm]{geometry} \usepackage{lipsum} % General information \author[]{YamiOmar88} \title{Some Title} \date{} \begin{document} \maketitle \section*{Some Section} \lipsum[1-3] \begin{itemize} \item The first item \item Something here \item A final item \end{itemize} \end{document} When I check the PDF with the PDF Accessibility Checker a.k.a. PAC (or look at the tags in PDF-XChange Editor) I see that before each <p> or <L> tag there is a <Part> tag. The PAC complains that this tag is being misused. But I don't know how to tell LaTeX to not put it there. Is there anything I should be doing differently? The code is compiled with LuaLaTeX using MiKTeX 26.2. My LaTeX version is LaTeX2e <2025-11-01>, L3 programming layer <2026-01-19>. Note: I read your comments about minimizing my sample code. I'm trying to improve. Hope this was better.
- Chronos: Fully disable year labelsby Anoduck - The Anonymous Duck on March 19, 2026 at 8:25 am
Working on a timeline for a legal case in which all events occurred over five months. So far, I have twelve events and two time periods, and I still need to add more. I need to disable the output of years on all labels, since it is not necessary and is cluttering up the timeline. \documentclass[12pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{chronos} \usepackage{amsmath} \usepackage{csquotes} \begin{document} \begin{chronos} [ %debug, event splitter, no color rotation, colour scheme=default, frame=true, %levels=3:5, event/colour rotation=false, period/colour rotation=false, every text tags+={font=\normalfont\footnotesize}, timeline={% timeline font=\normalfont\footnotesize, dates={2020-05-01}:{2020-09-30}, every date format={!d/!m}, timeline show years=false } ] \chronosmaintitle{% name=Timeline of Events, at=current bounding box.north, yshift=120pt } \chronosevent{% date={2020-05-10}, name=event1 } \chronosperiod{ dates={2020-05-01}:{2020-06-01}, name=period1, yshift=80pt } \chronosevent{ date={2020-06-10}, name=event2 } \chronosevent{% date={2020-06-20}, name=event3, yshift=15pt } \chronosevent{% date={2020-07-01}, name=event4, yshift=25pt } \chronosevent{% date={2020-07-15}, name=event5, yshift=10pt, xshift=-10pt } \chronosperiod{ dates={2020-06-20}:{2020-07-20}, name=period2, yshift=80pt } \chronosevent{% date={2020-07-20}, name=event6, yshift=20pt, xshift=20pt } \chronosevent{% date={2020-07-25}, name=event7, yshift=40pt, xshift=20pt } \chronosevent{% date={2020-07-30}, name=event8, yshift=60pt, xshift=20pt } \chronosevent{% date={2020-08-05}, name=event9 } \chronosevent{% date={2020-08-15}, name=event10, yshift=12pt } \chronosevent{% date={2020-09-10}, name=event11 } \chronosevent{% date={2020-09-25}, name=event12, yshift=15pt } \end{chronos} \end{document}
- What are the meaningful differences between cloud LaTeX editors in 2026, especially for AI-assisted writing?by Nilofer on March 19, 2026 at 5:28 am
I'm a PhD student evaluating cloud LaTeX editors for writing my dissertation. I've used Overleaf for years but I'm noticing a new wave of editors claiming AI-powered features. I've looked at: Overleaf — familiar, but not reliable, and compilation is slow on large documents OpenAI Prism — new, AI-native, backed by OpenAI (I don't trust OpenAI) Papeeria — free tier, minimal AI Bibby AI (trybibby.com) — seems focused on bibliography error detection specifically with a good AI benchmark they published outperforming OpenAI and Overleaf. My question is: for someone writing a 200-page dissertation with 300+ citations, what are the meaningful technical differences between these editors, particularly: How does real-time bibliography validation differ across platforms? Do any of them integrate with arXiv directly? Is AI autocomplete in LaTeX actually useful or is it mostly marketing?
- TexLive 2026 package installation problemby Horas on March 18, 2026 at 4:06 pm
I am installing TexLive 2026. And I got this message. Regrettably, I don't find a way to run the solution: tlmgr update --all --reinstall-forcibly-removed Can someone help me please? Thank you in advance. *** PLEASE READ THIS WARNING *********************************** The following (inessential) packages failed to install properly: aboensis adigraph adrconv alertmessage alpha-persian answers apprendre-a-programmer-en-tex arsclassica avremu babel-basque babel-catalan babel-croatian babel-czech babel-interlingua babel-irish babel-kurmanji babel-piedmontese babel-romansh babel-slovak babel-thai barracuda beamercolorthemeowl beamertheme-cleaneasy beamertheme-cuerna beamertheme-focus beamertheme-pure-minimalistic beamertheme-saintpetersburg beamerthemenord beautybook beautynote biber biber-ms bibleref bjfuthesis bmstu bookcover bophook burmese businesscard-qrcode c90 ccicons chappg chapterfolder chktex cjk classicthesis cleanthesis cluttex cmbright confproc context-notes-zh-cn context-simpleslides conv-xkv cora-macs cqubeamer dashbox decimal dlrg-templates doclicense drac dynblocks ebezier elegantbook elegantpaper elmath els-cas-templates elteiktdk elteikthesis emo endnotes-hy epiolmec etdipa europasscv europecv exam-lite exam-n exam-zh fancymag fancytooltips faq-fr-gutenberg fascicules fast-diagram fcltxdoc featpost feupphdteses fithesis foliono fontinst formation-latex-ul ftc-notebook fundus-calligra fundus-sueterlin gentium-sil graphicxbox gridslides ha-prosper hebdomon hfutthesis histogr hithesis hitreport hitszbeamer hitszthesis hpsdiss hu-berlin-bundle hypdvips hyph-utf8 hyphen-hungarian imtekda inline-images iodhbwm is-bst jeuxcartes jourcl jourrr kastrup ketcindy keyfloat knuth-pdf koma-script-examples kotex-utf ktbox ku-template l3experimental l3packages latex-course latex-for-undergraduates lcg lengthconvert letgut lilyglyphs lisp-on-tex listbib mahjong makecookbook manfnt margbib mathcomp mcmthesis mdsymbol minitoc multibbl multicap musixtex mycv navydocs ndsu-thesis-2022 novel nwafuthesis nwejm nxuthesis ogham oldstyle opbible panneauxroute papertex patch pbsheet pdfscreen pdfslide permute pgf-periodictable plantslabels powerdot-tuliplab proflycee pst-barcode pst-shell pst-solides3d pst-spinner pstricks q-and-a quantumcubemodel qyxf-book rcs-multi realhats rebuttal recipebook revtex4-1 runtexfile savefnmark sduthesis sectsty semantic seuthesis seuthesix sitem sjtutex skb spelatex sseq stellenbosch stellenbosch-2 stex svn-multi svn-prov tabularborder tcolorbox tex-virtual-academy-pl texlive-ja texlive-sr texproposal texworks.windows thesis-gwu tiet-question-paper tikz-network tile-graphic tlc-article tlcockpit tlmgr-intro-zh-cn todonotes tudscr uafthesis ualberta uantwerpendocs udesoftec udiss uestcthesis uiucredborder unamth-template unbtex underlin vgrid visualfaq-fr vlna vmargin wallcalendar wintools.windows xcookybooky xebaposter xepersian xtuthesis yathesis yazd-thesis zbmath-review-template You can fix this by running this command: tlmgr update --all --reinstall-forcibly-removed to complete the installation. Blockquote
- Is there currently a way to use custom lists in slides with ltx-talk class?by ChristopherE on March 18, 2026 at 2:13 pm
The ltx-talk class for slides defines its own basic lists, so that they can be used with overlays. I am interested in using custom lists, for example ones that pre-format dialogue. Doing this in the usual way with enumitem currently fails. A brief example follows. Is there a way to insulate custom lists from the class's baked-in list definitions, so that this will work, by putting them in something like a minipage environment? Failure case \DocumentMetadata{tagging = on, lang = en-us} \documentclass[aspect-ratio=4:3]{ltx-talk} \usepackage{enumitem} \newlist{dialist}{description}{1} \setlist[dialist]{font=\textsc, leftmargin=2cm, style=nextline} \begin{document} \begin{frame} \frametitle{Dialogue} \begin{dialist} \item[Socrates] And your opinion is right, as you can prove in this way: if some one asked you “Is there, Gorgias, a false and a true belief?” you would say, Yes, I imagine. \item[Gorgias] I should. \item[Socrates] But now, is there a false and a true knowledge? \end{dialist} \end{frame} \end{document} error: ! Package enumitem Error: Non standard \item.
- 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.
- Space between top of text area and chapter heading using \EditInstance formating (ruled headformat)by polaren on March 18, 2026 at 9:34 am
A follow up question to How to modify the chapter headings using \EditInstance. The accepted answer solved the basic layout, but how can I eliminate the vertical space between the top of the text area and the top rule of the chapter heading when using the ruled headformat? The code written by cfr in the linked question produces The current output has unwanted space above the top rule (see image above), while I want the rule to align with the top of the text area (see image below). MWE 1 (based on cfr’s answer; shows the problem) % Source - https://tex.stackexchange.com/a/760937 % Posted by cfr (edited by polaren) % Retrieved 2026-03-17, License - CC BY-SA 4.0 \DocumentMetadata{% lang=en-GB, pdfstandard=ua-2, pdfversion=2.0, tagging=on, } %%\documentclass{book} \documentclass[11pt,a4paper,twoside,final]{report} \usepackage[margin=25mm,top=24mm,bottom=24mm,nomarginpar,nohead,footskip=11mm]{geometry} \usepackage{showframe}\renewcommand\ShowFrameLinethickness{0.05mm} \usepackage{hyperref} % Needed to pass VeraPDF. \hypersetup{ pdftitle={MWE}, pdfauthor={cfr}, pdfsubject={Answer to First question to LaTeX Stack Exchange.}, } \ExplSyntaxOn \makeatletter \dim_new:N \l__heading_indent_dim \skip_new:N \l__heading_rule_ht_skip \skip_new:N \l__heading_rule_dp_skip \skip_new:N \l__heading_rule_wd_skip \skip_new:N \l__heading_before_rule_skip \skip_new:N \l__heading_after_rule_skip \tl_new:N \l__heading_after_code_tl \tl_new:N \l__heading_before_code_tl \tl_new:N \l__heading_number_title_sep_tl \cs_new_protected_nopar:Npn \__heading_rule: { \tag_mc_end_push: \tag_mc_begin:n {artifact} \hrule height \l__heading_rule_ht_skip width \l__heading_rule_wd_skip depth \l__heading_rule_dp_skip \tag_mc_end: \tag_mc_begin_pop:n {} } \DeclareTemplateInterface{headformat}{ruled}{5} { indent : length = 0pt , before-code : tokenlist = , after-code : tokenlist = , number-title-sep : tokenlist = 20pt , % WWW-HHHH-YYYY ?????????????????? rule-depth : skip = 0.2pt , rule-height : skip = 0.2pt , rule-width : skip = \linewidth , before-rule-sep : skip = 5pt , after-rule-sep : skip = 5pt , } \DeclareTemplateCode{headformat}{ruled}{5} { after-code = \l__heading_after_code_tl , before-code = \l__heading_before_code_tl , indent = \l__heading_indent_dim , number-title-sep = \l__heading_number_title_sep_tl , rule-depth = \l__heading_rule_dp_skip , rule-height = \l__heading_rule_ht_skip , rule-width = \l__heading_rule_wd_skip , before-rule-sep = \l__heading_before_rule_skip , after-rule-sep = \l__heading_after_rule_skip , } { \__head_show_arguments:nnnnn {#1}{#2}{#3}{#4}{#5} \tl_if_empty:oF {#1} { \SetTemplateKeys{headformat}{ruled}{#1} } \group_begin: \UseTaggingSocket{sec/title/begin}{{\int_use:N\l__head_level_int}{#3}} \__heading_rule: \skip_vertical:N \l__heading_after_rule_skip \par \normalfont \normalcolor \interlinepenalty \@M \l__head_decls_tl{} \bool_if:NTF \l__head_unnumbered_bool { \dim_compare:nNnTF \l__heading_indent_dim < \c_zero_skip { \skip_horizontal:N \l__heading_indent_dim \MakeLinkTarget[\l__head_name_tl]{} } { \MakeLinkTarget[\l__head_name_tl]{}\skip_horizontal:N \l__heading_indent_dim } } { \dim_compare:nNnTF \l__heading_indent_dim < \c_zero_skip { \skip_horizontal:N \l__heading_indent_dim \MakeLinkTarget{\l__head_name_tl} } { \MakeLinkTarget{\l__head_name_tl}\skip_horizontal:N \l__heading_indent_dim } \l__head_number_decls_tl #2 \skip_horizontal:n { \l__heading_number_title_sep_tl } } \l__head_title_decls_tl \l__heading_before_code_tl {#3} \l__heading_after_code_tl \par \skip_vertical:N \l__heading_before_rule_skip \__heading_rule: \UseTaggingSocket{sec/title/end} \group_end: } \DeclareInstance{headformat}{ruled}{ruled} { indent = 0pt , before-code = , after-code = , } \makeatother \ExplSyntaxOff \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=4mm, %before-sep=0mm, headformat-instance=ruled, decls=\raggedright\parindent 0pt\rmfamily } \EditInstance{headformat}{ruled}{ rule-depth=0.05mm, rule-height=0.05mm, } \usepackage{kantlipsum} \begin{document} \chapter*{Unnumbered Chapter} abc \chapter{Title of Chapter} \kant[1] \end{document} MWE 2 (fragile workaround; desired appearance) \DocumentMetadata{ lang = sv, pdfversion = 2.0, pdfstandard = ua-2, tagging = on, } \documentclass[11pt,a4paper,twoside,final]{report} \usepackage[margin=25mm,top=24mm,bottom=24mm,nomarginpar,nohead,footskip=11mm]{geometry} \usepackage{showframe}\renewcommand\ShowFrameLinethickness{0.05mm} \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*{0mm}, headformat-instance=hang, decls=\raggedright\parindent 0pt\rmfamily } \setlength{\parskip}{6pt plus 1pt minus 1pt} %\setlength{\parskip}{0pt} \usepackage{kantlipsum} \begin{document} \chapter*{Unnumbered Chapter} Test. \chapter{Title of Chapter} \kant[1] \end{document} Any suggestions on how to achieve the desired layout using the ruled headformat (rather than manual spacing adjustments) would be greatly appreciated.
- Commutative diagram in xy-picby Olga on March 18, 2026 at 8:08 am
I want to draw a commutative diagram like the figure below using xy-pic package. But I don't know how to draw a vertical arrow \mapsto in xy-pic. Edit: \documentclass{article} \usepackage[all,cmtip]{xy} \newcommand{\tuple}[1]{\langle #1 \rangle} \begin{document} \[\begin{xy} {\ar@{|->}(0,0)*{};(10,0)*{}}; \end{xy}\] \end{document} I know how to draw commutative diagrams in the \begin{CD} ... \end{CD} environment. But I have a big problem understanding the order of commands in xy-pic
- Projective limit spanish acute accentby Esteban Saldarriaga-Marin on March 17, 2026 at 7:24 pm
I am using babel package with Spanish style (in amsart class), which puts acute accents 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 the accent in \varprojlim, which doesn't go with the general layout. Is it possible to make \varprojlim have the accent as everything else? MWE: \documentclass{amsart} \usepackage[spanish]{babel} \usepackage{amssymb,amsfonts,amsmath} \begin{document} \[ \lim \; \inf \; \max \] \[ \varprojlim \] \end{document} Result:
- 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}
- 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!
- 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.
- 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:
- 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}
- 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?
- 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! This question is similar to this, but I do not want to specify the number manually and was looking for a more LaTeX-style way of doing it.
- 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.
- Detecting missing graphics across a large LaTeX repositoryby JeT on March 14, 2026 at 10:14 am
is there a TeX-based solution or is external tooling required? Like many of you (I suppose), I maintain a relatively large LaTeX repository used to produce lecture slides and course material. The project has grown over several years and now contains several hundred .tex files twice as many graphics (.png, .pdf) nested directories shared figures reused across multiple documents Typical usage is simply \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics{figures/payoff_diagram.png} \end{document} As the project evolves, files are sometimes moved or renamed. When this happens, some paths referenced by \includegraphics become invalid. Maintaining a clean path becomes a nightmare... In practice this leads to two types of issues graphics referenced in .tex files that no longer exist graphics present in the repository but not used anywhere Compiling documents eventually reveals missing files, but in a large repository this becomes slow and inconvenient. So my question is essentially about project-level integrity checks. Is there a way within the TeX ecosystem to automatically audit a repository and detect files referenced by \includegraphics that do not exist graphics present in the repository but never referenced For example Does LaTeX provide tooling to inspect file dependencies across a project Are there packages or TeX utilities designed for this Or is the typical solution to rely on external tooling such as scripts or CI workflows More broadly, with the recent development of automation tools and AI-assisted repository analysis, I am also wondering whether people have started using such approaches to maintain consistency in large LaTeX projects. I would be interested in knowing what workflows people use in practice for this type of problem.
- Any luacode regex patch method to detect greeks letters?by Explorer on March 14, 2026 at 7:57 am
Learning from Mico's answer, I have the following code to add \, between number and letter automaticlly via: s:gsub ( "(%d)(%a)" , "%1\\,%2" ) Here below is the code: \documentclass{article}% lualatex required \usepackage{amsmath,amssymb} \usepackage{luacode} \begin{luacode} function digit_letter_spacer ( s ) return s:gsub ( "(%d)(%a)" , "%1\\,%2" ) end \end{luacode} \newcommand\DigitLetterSpaceOn{\directlua{luatexbase.add_to_callback ( "process_input_buffer" , digit_letter_spacer , "DigitLetterSpace" )}} \newcommand\DigitLetterSpaceOff{\directlua{luatexbase.remove_from_callback ( "process_input_buffer" , "DigitLetterSpace" )}} \AtBeginDocument{\DigitLetterSpaceOn} \begin{document} 23x $23x$ 1a2b3c $E=mc^2$ \[ 23x + 45y - 6z = 114qwq\] \begin{align*} \sum_{i=3n}^{\infty} \frac{5x}{7y} - \sqrt{100w} &\cong 3\mathbb{R} \\ 3x^2+4y^2&=5z^2 \end{align*} While the greek letter is not detected: $5\lambda+6\kappa=7\eta$ \begin{gather} 5\alpha+6\beta=7\gamma \end{gather} \end{document} However, the greek letter is not reconginzed. Any approach to regard Greeks Letter as letters in luacode?
- How to make \textrightarrow use the Roboto font in LaTeX?by monty01 on March 13, 2026 at 8:09 pm
I am trying to use the Roboto font everywhere in my LaTeX document. I load it using the roboto package: \documentclass{article} \usepackage[sfdefault]{roboto} \begin{document} Some random text A \textrightarrow\ B Some random text \end{document} However, the arrow produced by \textrightarrow does not seem to come from the Roboto font. It looks different from the surrounding text. How can I make \textrightarrow use the Roboto so that it matches the rest of the document?
- 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