• Are table rules untagged in a tagged PDF? Checkers disagree
    by fishface342 on September 6, 2026 at 12:17 am

    Trying to make a long document work well with tagging, I ran into an issue where two accessibility checkers disagree about whether table horizontal lines are tagged correctly. Specifically, for the following example, the current version of PAC (26.1.0.0) reports that the three \hline objects are not tagged, whereas Acrobat's accessibility checker seems fine with this. Same issue with booktabs using \toprule, etc. Not sure whether this is a bug, and if so, whether it's in one of the checkers or in the original pdf generation, but I figured people here will know better than me. Thanks in advance! MWE (compiling with pdfLaTeX): \DocumentMetadata{lang=en-US, pdfversion=1.7, tagging=on} \documentclass{article} \begin{document} \begin{tabular}{ll} \hline A & B\\ \hline C & D\\ \hline \end{tabular} \end{document}

  • Mimicking Automated Contents Chapter Entries by Using \addcontentsline{toc}{chapter}
    by Jethro on September 5, 2026 at 10:27 pm

    This question is motivated by the post: Customized chapter TOC entries with modified roman numeral displays MWE: \documentclass[12pt,openany]{book} \usepackage{titlesec,tocloft} \renewcommand{\thechapter}{\Roman{chapter}} \setlength{\cftchapnumwidth}{3em}% Width of chapter numbers in ToC \renewcommand{\cftchapaftersnum}{.} % Add a period after each chapter number in ToC \renewcommand{\cftchapleader}{\dotfill}% Leader between ToC entry and page number \titleformat {\chapter} % <command> [display] % <shape> {\LARGE\centering\bfseries} % <format> {CHAPTER \thechapter.} % <label> {25pt} % <sep> {} % <before-code> {} % <after-code> \begin{document} \tableofcontents \chapter{This is the First Chapter Heading} \addcontentsline{toc}{chapter}{\hskip 36pt This is the First Chapter Heading} \chapter{This is the Second Chapter Heading} \addcontentsline{toc}{chapter}{\hskip 36pt This is the Second Chapter Heading} \end{document} which produces the Table of Contents: I would like to mimic the chapter entries in the Table of Contents as automatically generated by the command \chapter as manually generated by the command \addcontentsline{toc}{chapter}{}. For example, the first chapter entry manually coded, I have, \addcontentsline{toc}{chapter}{\hskip 36pt This is the First Chapter Heading}. However, I need to somehow add an I., flushleft, without affecting \hskip 36pt starting from I. (Similarly, for the second entry.) This will align me to facilitate some old documents which I have previously added entries to the Table of Contents using \addcontentsline{toc}{chapter}{} previous being made aware of @Werner's excellent Table of Contents macro, somewhat recently. So, is it possible (and if so) how I may easily produce the formatted chapter entries by going the route of \addcontentsline{toc}{chapter}?

  • tabularray diagbox not working with xepersian
    by Shahriar on September 5, 2026 at 6:01 pm

    \documentclass{article} \usepackage{xepersian} \settextfont{IRXLotus} \usepackage{tabularray} \UseTblrLibrary{diagbox} \begin{document} \begin{tblr}{ colspec = {c c c}, hlines, vlines, } \diagbox{X}{Y} & A & B \\ 1 & 2 & 3 \\ \end{tblr} \end{document} Running this, I get Undefined control sequence. \end error. The culprit is xepersian + tabularray (if I remove xepersian it renders correctly). But what's the workaround? Versions: xepersian: 26.01.01 tabularray: 2025C diagbox: 2.4 biditools: (not installed) bidi: 26.01.08 Update \makeatletter \providecommand\UseMathForPositioningText{% \m@th } \makeatother Adding this between the two packages loading command makes it work, but the text is not aligned correctly... I don't know whether it's the expected alignment or not.

  • When a Chapter Title Can be Modified for a Table of Contents Entry? [duplicate]
    by Jethro on September 5, 2026 at 5:29 pm

    This extends the question related in Customized chapter TOC entries with modified roman numeral displays. MWE: \documentclass[12pt,openany]{book} \usepackage{titlesec,tocloft} \renewcommand{\thechapter}{\Roman{chapter}} \setlength{\cftchapnumwidth}{3em}% Width of chapter numbers in ToC \renewcommand{\cftchapaftersnum}{.} % Add a period after each chapter number in ToC \renewcommand{\cftchapleader}{\dotfill}% Leader between ToC entry and page number \titleformat {\chapter} % <command> [display] % <shape> {\LARGE\centering\bfseries} % <format> {CHAPTER \thechapter.} % <label> {25pt} % <sep> {} % <before-code> {} % <after-code> \begin{document} \tableofcontents \chapter{This is the First Chapter Heading} \chapter{This is the Second Chapter Heading but It is Longer Than the First So That It Extends Over Multiple Lines in the ToC} \end{document} The Table of Contents output: In this entry each chapter title is reported exactly in the Table of Contents. I would like to delineate, specifically, the second entry as "This is the Second Chapter Heading" instead of the much longer Chapter II. title. How may I modify chapter entries in the Table of Contents on as as-needed basis; in particular, for the second entry of this MWE?

  • tabto creates overlapping lines when using displaystyle maths
    by AO3 user without CSS knowledge on September 5, 2026 at 5:03 pm

    Using tabto on a line that contains displaystyle math causes the math expression to overlap with the text above it. Expected behavior at the top (what happens when I don't use tabto on the second line) VS what actually happens when I use tabto Here's a MWE : \documentclass{article} \usepackage{tabto} \begin{document} Text with a sum under it The sum :$\displaystyle\sum_{i=0}^{n}i$ Text that gets overlapped The sum :\tabto{\CurrentLineWidth} $\displaystyle\sum_{i=0}^{n}i$ \end{document} I'm doing calculations later on with the value tabto gives me, so I can't just get rid of it. Is there either another package that can give the current line width that isn't tabto and doesn't cause the same issues a way to force it to respect the actual line height Other people had similar issues with the package but the solutions proposed don't seem to work in that case. Edit: Here's what my actual document looks like. The tabto is here to calculate the max width of the following varwidth. \documentclass{article} \usepackage{tabto} \usepackage{varwidth, calc} \begin{document} Some text some text some text some text some text some text. Some more text on a new paragraph \tabto{\CurrentLineWidth}\begin{varwidth}[t]{\linewidth-\TabPrevPos} $\displaystyle\sum_{i=0}^{n}i$ Here is a longer paragraph that I want to be in a box. The tabto at the beginning helps me calculate the width of that box. \end{varwidth} \end{document}

  • how to reduce column separation space for particular column using tabularray
    by MadyYuvi on September 5, 2026 at 2:23 pm

    My code are: \documentclass[twocolumn]{article} \usepackage{amsmath} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs,siunitx} \usepackage{lipsum} \SetTblrInner{ rowsep=0pt, row{1}={l,b}, hborder{1}={belowspace=6pt}, hborder{2}={abovespace=2pt,belowspace=6pt}, hborder{Z}={abovespace=6pt}, width=\linewidth, row{1} = {guard}, } \begin{document} \begin{align} {F_d} = mgf\cos \theta + mg\sin \theta + \delta \tag*{(1)} \end{align} \lipsum[1] \begin{table} \caption{Value of Grid Convergence Index.\label{table1-09544062261479876}} \begin{tblr}{@{}X[1,l]lll@{}} \toprule {} & {\textit{Cpmin}} & {\textit{Cpmin}} & {\textit{Cpmin}}\\ \midrule {GCI N1-N2} & {0.95\%} & {0.46\%} & {0.86\%}\\ {GCI N2-N3} & {0.59\%} & {0.33\%} & {0.58\%}\\ \bottomrule \end{tblr} \end{table} \end{document} which produced the output as below: I need to reduce the column separation (equal space to all column) after first column, I understand that alignment X does the trick, if I applied to all column, but my requirement is all column should be aligned with l, please advise. Expected output:

  • siunitx rounding to figures doesn't always pad trailing 0
    by Jakob on September 5, 2026 at 10:23 am

    I'm having trouble getting my desired figures padded when the number gets rounded. I don't want to use round-mode=places since I have differing amounts of leading 0s. Here's an example: \documentclass{article} \usepackage{siunitx} \sisetup{ round-mode = figures, round-precision = 3, round-pad = true } \begin{document} \num{0.7603} % 0.760: expected behaviour \num{0.9095} % 0.91: missing trailing 0 \end{document}

  • Improved alignment of molecules in a reaction suite
    by Nicolas on September 4, 2026 at 8:58 pm

    To show different possible mechanisms, I code this figure: \documentclass[border=3mm]{standalone} \usepackage{graphicx} % Required for inserting images \usepackage{chemfig} \usetikzlibrary{arrows,bending} % \tikzset {[foo /.tip = {Stealth[sep] Latex[sep]}} % \tikzset{ niv2/.tip = {Stealth[red, sep=5pt]_.} } % \tikzset{ niv1/.tip = {Stealth[red, sep=1pt]_.} } % \tikzset{ niv123/.tip = {Stealth[red, sep=1pt]_.} } \begin{document} \schemestart \chemfig{C(-[:120]H)(-[:240]H_3C)=[@{p1}]C(-[:60]H)(-[:300]H)} \+ \chemfig{@{p2}H-[@{p3}]@{p4}\charge{0=\|,90=\|,270=\|}{Cl}} \hspace{.3cm} \arrow(b--)[,1.3,,,draw=none] \subscheme{ \chemfig{CH_3-CH_2-\charge{90:4pt=$\oplus$}{CH_2}} \arrow(c--d){->}[-90,1.5,,,,draw=none] \chemfig[baseline=15pt]{CH_3-\charge{110:3pt=$\oplus$}{CH}-CH_3} } \subscheme{ \arrow(@c--e){->[\charge{0=\|,90=\|,180=\|,-90=\|,45:4pt=$\ominus$}{Br}]}[,1] \chemfig{CH_3-CH_2-CH_2-Br} \arrow(e--f){->}[-90,1.5,,,,draw=none] \chemfig{CH_3-CH(-[:-90]Br)-CH_3} \arrow(@d--@f){->[\charge{0=\|,90=\|,180=\|,-90=\|,45:4pt=$\ominus$}{Br}]}[,1] } \chemmove{ \draw[thick,shorten >=10pt] (b.east) -- ++(1,0) |- (c.west); \draw[thick,shorten >=10pt] (b.east) -- ++(1,0) |- (d.west); \draw[shorten <=1pt,shorten >=1pt](p1).. controls +(80:20mm) and +(100:10mm)..(p2); \draw[shorten <=1pt,shorten >=4pt](p3).. controls +(80:6mm) and +(100:6mm)..(p4); } \schemestop \end{document} Problem: the molecules are not well aligned which means that the arrows (especially the bottom for the bromide ion) are tilted. How can I align vertically?

  • Customized chapter TOC entries with modified roman numeral displays
    by Jethro on September 4, 2026 at 5:06 pm

    MWE: \documentclass[12pt,openany]{book} \usepackage{titlesec,tocloft} \renewcommand{\thechapter}{\Roman{chapter}} \renewcommand{\cftchapaftersnum}{.} % Add a period after each chapter number in the TOC. \usepackage{titlesec} \titleformat{\chapter}[display]{\Huge\centering\bfseries}{CHAPTER \thechapter.}{25pt}{}{} \makeatletter \def\l@chapter#1#2{% \pagebreak[3] \bfseries \vskip .75em plus 1pt \@tempdima 3em \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \advance\leftskip\@tempdima \hskip -\leftskip \leavevmode %\MakeUppercase {#1} \dotfill \hbox to\@pnumwidth{\hss #2} \par \endgroup } \makeatother \begin{document} \tableofcontents \chapter{This is the First Chapter Heading} \chapter{This is the Second Chapter Heading but It is Longer Than the First So That It Extends Over Multiple Lines in the TOC} \end{document} The output: I am trying to add a period after each roman numeral chapter entry. I figured that \renewcommand{\cftchapaftersnum}{.} should do the trick. It doesn't. How may I add a period after each roman numeral in the TOC?

  • newline in caption of tabularray
    by albert on September 4, 2026 at 4:22 pm

    A bit a similar question to Create a hyper link in caption of tabularray with a different "payload": \begin{DoxyTable}{1}{PRE~\newline POST}{}{0} Some longer text for better visibility\\ \end{DoxyTable} As can be seen in the output there is no newline there: Unfortunately the solution of Create a hyper link in caption of tabularray (using \protect) does not work here. Where DoxyTable is the wrapper as used and shown in the following (and a bit large) MWE: \documentclass[twoside]{book} \usepackage[pdftex,pagebackref=true]{hyperref} \usepackage{tabularray} \usepackage{longtable} \UseTblrLibrary{varwidth} \ExplSyntaxOn \dim_new:N \doxytablewidth \NewDocumentCommand \doxycalculatetablewidth {} { \cs_set_protected:Nn \__tblr_build_whole: { \__tblr_get_table_width: \dim_gset:Nn \doxytablewidth { \tablewidth } } } \ExplSyntaxOff % define a theme for the DoxyTable environment (without caption) \NewTblrTheme{DoxyTableBareTheme}{ \DefTblrTemplate{firsthead}{default}{}% \DefTblrTemplate{middlehead, lasthead}{default}{}% \DefTblrTemplate{contfoot-text}{default}{}% } % define a theme for the DoxyTable environment (with caption) \NewTblrTheme{DoxyTableCaptionTheme}{ \SetTblrStyle{firsthead}{font=\bfseries}{}% \DefTblrTemplate{middlehead, lasthead}{default}{}% \DefTblrTemplate{contfoot-text}{default}{}% } % Define a table environment to use with Doxygen % parameters: % - #1: number of columns % - #2: table caption (can be empty) % - #3: label to refer to the table (can be empty) % - #4: 1=table has a heading row, 0=no heading row % - #5: body of the table (part between start{DoxyTable}..\end{DoxyTable} \NewDocumentEnvironment{DoxyTable}{m +m m m +b}{% \par% \def\hascaption{#2}% \def\haslabel{#3}% \ifx\hascaption\empty% if caption is empty \SetTblrOuter[longtblr]{theme=DoxyTableBareTheme,entry=none}% table without caption or label \else% caption not empty \ifx\haslabel\empty% if label is empty \SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2}}% set table caption \else% label not empty \SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2},label={#3}}% set table caption and label \fi% \fi% \begingroup \doxycalculatetablewidth \sbox0{% first render the table in a savebox to calculate the width of the table which will be stored in \doxytablewidth \begin{tblr}{hlines,vlines,measure=vbox,colspec={*{#1}{l}}}% #5 \end{tblr}% }% end of sbox0 \endgroup \ifdim\doxytablewidth>\linewidth% use flexible columns % now render the table for real \begin{longtblr}{hlines,vlines,% automatically set horizontal and vertical cell lines measure=vbox,% needed to allow nested lists and tables colspec={*{#1}{X[-1]}},% set column type for all columns rowhead=#4} % set which row is the header (0=disable, 1=enable) #5 \end{longtblr}% \else% use fixed left aligned columns % now render the table for real \begin{longtblr}{hlines,vlines,% automatically set horizontal and vertical cell lines measure=vbox,% needed to allow nested lists and tables colspec={*{#1}{l}},% set column type for all columns rowhead=#4} % set which row is the header (0=disable, 1=enable) #5 \end{longtblr}% \fi% }{% no end marker needed anymore }% \usepackage{caption} \captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} \begin{document} Test \hypertarget{index_bbb}{} \begin{DoxyTable}{1}{PRE~\newline POST}{}{0} Some longer text for better visibility\\ \end{DoxyTable} \end{document} How to solve this problem?

  • Create a hyper link in caption of tabularray
    by albert on September 4, 2026 at 3:47 pm

    I want to create a hyper link in the cation of a tabularray like: \begin{DoxyTable}{1}{PRE\hyperlink{index_bbb}{Table}POST}{}{0} Some longer text for better visibility\\ \end{DoxyTable} but I get an error like: ! Undefined control sequence. \hyper@@link ->\let \Hy@reserved@a \relax \@ifnextchar [{\hyper@link@ }{\hyp... l.93 \end {DoxyTable} ? Where DoxyTable is the wrapper as used and shown in the folowing MWE: \documentclass[twoside]{book} \usepackage[pdftex,pagebackref=true]{hyperref} \usepackage{tabularray} \usepackage{longtable} \UseTblrLibrary{varwidth} \ExplSyntaxOn \dim_new:N \doxytablewidth \NewDocumentCommand \doxycalculatetablewidth {} { \cs_set_protected:Nn \__tblr_build_whole: { \__tblr_get_table_width: \dim_gset:Nn \doxytablewidth { \tablewidth } } } \ExplSyntaxOff % define a theme for the DoxyTable environment (without caption) \NewTblrTheme{DoxyTableBareTheme}{ \DefTblrTemplate{firsthead}{default}{}% \DefTblrTemplate{middlehead, lasthead}{default}{}% \DefTblrTemplate{contfoot-text}{default}{}% } % define a theme for the DoxyTable environment (with caption) \NewTblrTheme{DoxyTableCaptionTheme}{ \SetTblrStyle{firsthead}{font=\bfseries}{}% \DefTblrTemplate{middlehead, lasthead}{default}{}% \DefTblrTemplate{contfoot-text}{default}{}% } % Define a table environment to use with Doxygen % parameters: % - #1: number of columns % - #2: table caption (can be empty) % - #3: label to refer to the table (can be empty) % - #4: 1=table has a heading row, 0=no heading row % - #5: body of the table (part between start{DoxyTable}..\end{DoxyTable} \NewDocumentEnvironment{DoxyTable}{m +m m m +b}{% \par% \def\hascaption{#2}% \def\haslabel{#3}% \ifx\hascaption\empty% if caption is empty \SetTblrOuter[longtblr]{theme=DoxyTableBareTheme,entry=none}% table without caption or label \else% caption not empty \ifx\haslabel\empty% if label is empty \SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2}}% set table caption \else% label not empty \SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2},label={#3}}% set table caption and label \fi% \fi% \begingroup \doxycalculatetablewidth \sbox0{% first render the table in a savebox to calculate the width of the table which will be stored in \doxytablewidth \begin{tblr}{hlines,vlines,measure=vbox,colspec={*{#1}{l}}}% #5 \end{tblr}% }% end of sbox0 \endgroup \ifdim\doxytablewidth>\linewidth% use flexible columns % now render the table for real \begin{longtblr}{hlines,vlines,% automatically set horizontal and vertical cell lines measure=vbox,% needed to allow nested lists and tables colspec={*{#1}{X[-1]}},% set column type for all columns rowhead=#4} % set which row is the header (0=disable, 1=enable) #5 \end{longtblr}% \else% use fixed left aligned columns % now render the table for real \begin{longtblr}{hlines,vlines,% automatically set horizontal and vertical cell lines measure=vbox,% needed to allow nested lists and tables colspec={*{#1}{l}},% set column type for all columns rowhead=#4} % set which row is the header (0=disable, 1=enable) #5 \end{longtblr}% \fi% }{% no end marker needed anymore }% \usepackage{caption} \captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} \begin{document} Test \hypertarget{index_bbb}{} \begin{DoxyTable}{1}{PRE\hyperlink{index_bbb}{Table}POST}{}{0} Some longer text for better visibility\\ \end{DoxyTable} \end{document} (Hopefully I didn't strip to much packages, but in that case the missing packages are not relevant for the problem as the specific code is, apparently, not entered). How to solve this problem?

  • Blockwise random order of questions using mcexam
    by Tripedior on September 4, 2026 at 1:14 pm

    I am aware of the "randomizequestions" setting of mcexam, which I would like to use. However, the plan is to ask questions about different fields. Therefore, I would like to randomize the order of questions of each field, but not shuffle questions of different fields together. Below is a MWE. The questions should be consecutively numbered (1,2,3,4 in the MWE). My actual application of course has more than two questions in each block, and also more than two blocks. Could someone please suggest a method for this? PS: I have tried defining two different mcquestions environments, but the second block starts its numbering from 1 again, which is not desired. I tried hacking the mcexam.sty (by trying to adapt Fix first (two) questions with McExam package), but was unsuccessful due to my insufficient LaTeX knowledge. \documentclass[a4paper]{article} \usepackage[ numberofversions=1, seed=11, randomizequestions=true, randomizeanswers=true, writeRfile=false, ]{mcexam} \mcexamoptions{output=exam} \begin{document} \begin{mcquestions} % First block of questions (1-2, random order) \question How much is $2+2$? \question How much is $3+1$? % \end{mcquestions} % -> ending the environment here and opening a new one after achieves the separation, but the question numbering starts from 1 again % \begin{mcquestions} % -> see above % Second block of questions (3-4, random order) \question Is John Doe alive? \question Is Jane Doe alive? \end{mcquestions} \end{document}

  • Problem of vertical placement of two molecules
    by Nicolas on September 4, 2026 at 12:57 pm

    I have the following chemical equation in Chemfigs: \documentclass[border=1mm]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{chemfig} \usepackage{chemmacros} \begin{document} \setchemfig{scheme debug=true} \schemestart \chemfig{*6(--=---)} \arrow{->[\ch{Br2}]} \chemname{\chemfig{*6(--(<Br)-(<:Br)---)}}{trans-1,2-dibromo\\cyclohexane} \schemestop \end{document} The problem is that vertical alignment is not correct between cyclohexene and dibromocyclohexane. I tried the trick to add\arrow{0}[,0] but it does not work. How to properly replace cycles vertically like this ?

  • Unwanted white gaps between \cmidrule lines in tabularray table – how to fill with background color? [duplicate]
    by Ernest on September 4, 2026 at 11:53 am

    I am using the tabularray package to create a table with multi-column headers. The table has three groups of columns (2–4, 5–6, and 7–9), each with its own sub-header. I am using \cmidrule to draw horizontal lines under each group, as shown in the MWE and Figure below. However, there are small white gaps between the \cmidrule segments (where the rules do not meet). These gaps appear as white lines against the colored background of the header cells, which looks visually distracting. MWE: \documentclass{article} \usepackage[margin=2.5cm]{geometry} \usepackage{booktabs} % for \cmidrule \usepackage{xcolor} % for colors \RequirePackage{tabularray} \UseTblrLibrary{siunitx} \UseTblrLibrary{booktabs} \NineColors{saturation=low} \begin{document} \begin{table}[t!h] \centering\vspace{-1pc} \caption{Major elements (wt.\%) of minerals in the studied rocks (Layer~1/1: analcime, Layer~1/2: smectite, Layer~1/3: Ca-Na zeolite). Analyses by SEM}\label{tab:02} \begin{tblr}{ colspec = { X[l,m] X[c,m] X[c,m] X[c,m] X[c,m] X[c,m] X[c,m] X[c,m] X[c,m] }, hline{1,Z} = {-}{0.08em}, hline{4} = {-}{0.03em}, row{even[4]} = {gray9}, row{1-3} = {c,m}{azure9}, rowsep = {1.6pt}, cell{1-3}{1-9} = {azure9}, } \SetCell[r=3]{c}{Major\\ Elements} & \SetCell[c=3]{c}{Sample of Layer 1/1} & & & \SetCell[c=2]{c}{Sample of Layer 1/2} & & \SetCell[c=3]{c}{Sample of Layer 1/3} & & \\ \cmidrule[r]{2-4} \cmidrule[lr]{5-6} \cmidrule[l]{7-9} & Analcime & Analcime & Analcime & Smectite & Smectite & Ca-Na Zeolite & Ca-Na Zeolite & Ca-Na Zeolite \\ \cmidrule{2-9} & \SetCell[c=8]{c}{Major Elements (wt.\%)} \\ % $\mathrm{SiO}_2$ & 57.99 & 59.01 & 59.54 & 45.52 & 47.94 & 64.38 & 64.67 & 66.48 \\ $\mathrm{TiO}_2$ & -- & -- & -- & 0.16 & 0.23 & -- & -- & -- \\ $\mathrm{Al}_2\mathrm{O}_3$ & 18.97 & 19.68 & 19.82 & 11.99 & 12.83 & 14.49 & 13.87 & 14.61 \\ $\mathrm{FeO}_{\mathrm{tot}}$ & -- & -- & -- & 3.73 & 3.91 & -- & -- & -- \\ $\mathrm{MgO}$ & -- & -- & -- & 3.70 & 3.78 & 0.13 & 0.11 & 0.16 \\ $\mathrm{CaO}$ & -- & -- & -- & 1.52 & 1.55 & 4.65 & 4.22 & 4.43 \\ $\mathrm{Na}_2\mathrm{O}$ & 10.43 & 10.55 & 9.35 & 0.09 & 0.18 & 2.96 & 2.40 & 2.87 \\ $\mathrm{K}_2\mathrm{O}$ & -- & -- & -- & 0.09 & 0.09 & 0.45 & 0.46 & 0.52 \\ $\Sigma$ & 87.39 & 89.24 & 88.71 & 66.80 & 70.51 & 87.06 & 85.73 & 89.07 \\ \end{tblr} \end{table} \end{document}

  • How to change the spacing between the title, the text, and the equation itself?
    by Alastair Stratford on September 4, 2026 at 9:04 am

    The spacing between the title and text, and the text itself and equation is bit too much for me. The equation on the middle is also small. This is what I've come up so far. \documentclass[12pt,english]{article} \usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry} \usepackage{blindtext} \title{Formal Definition of Limits\\ (Epsilon-Delta Definition)} \date{} \begin{document} \maketitle A simpler way to understand limits is when a certain function $f(x)$ approaches a certain value $a$, but not exactly to it, thus it has a limit $L$. Or we can write it like this: \[ \lim_{x \to a } f(x) = L \] \end{document} And this is the result so far:

  • batch generate letters with variable content
    by underflow on September 3, 2026 at 10:45 pm

    I need to generate a batch of reports. Each report gives the pass/fail results of a series of labs, with data taken from a text file. Here is a minimal (almost) working example: \documentclass{letter} \begin{document} \newcommand{\lab}[7]{ \begin{letter}{} \signature{Lab director} \opening{Dear #1,} Here are the result of your lab report: \begin{tabular}{ll} {#2}: & {#3} \\ {#4}: & {#5} \\ {#6}: & {#7} \end{tabular} \closing{Sincerely yours,} \pagebreak \end{letter}} \input{mwe_list.tex} \end{document} and here's the data file ("mwe_list.tex"): % Format of the data file: % % \lab{the name of the place} % {name of lab #1} % {pass/fail} % {name of lab #2} % {pass/fail} % {name of lab #3} % {pass/fail} % % NOTE: The number of labs is fixed, but the labs for different people could be % different, and some people attempted fewer than three labs \lab{Alice} {heat fusion} {pass} {energy content} {pass} {acid dissociation} {pass} \lab{Bob} {energy content} {pass} {} {} {} {} As this example shows, some reports have fewer than 3 items. Question: How should I modify the tex code so it only prints the name of lab + results that's carried out? I have in mind something like "if {#3} is not {} then print {#3:}: {#4}", but I don't know how to do that in latex, and I don't know how to combine that with e.g. tabular. I do realize that my MWE is hacky, so I welcome suggestions on how to do this properly. Thanks!

  • why adding a label at the end of the document is not found?
    by R. N on September 3, 2026 at 9:12 pm

    In order to be compliant with a template given by my company, I need to have a main part and optionally an appendix. My problem is that the foot of the main part should contain the total number of pages only for the main part while the appendix's foot should restart the counter. Therefore, I thought about lastpage package. But this one is not accepting that I put 'its' label somewhere else (when I start the appendix), because it redefines the label anyway. So I thought that I could mimic lastpage by adding a label at the end of the document if this label has not been defined. This works correctly if I add my label in the middle of the document, but not if the label is not detected at the end of the document. (So, okay I could do everything manually but since the final purpose is to share this template with co-workers, they will make mistakes for sure and complain) Here is a MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lastpage} % or another \usepackage{fancyhdr} \pagestyle{fancy} \fancyfoot[C]{\thepage{}/\pageref{LastMainPage}} \makeatletter \AddToHook{enddocument}{% or enddocument/afterlastpage \@ifundefined{r@LastMainPage}{% add \label{LastMainPage}% }{def}% } \makeatother \begin{document} page 1/2 \newpage page 2/2 % % appendix are optional so commented for this test % \newpage % \appendix % \label{LastMainPage} % then I will add it to \appendix % \pagenumbering{roman} % \fancyfoot[C]{\thepage{}} % appendix i % \label{LastMainPage} % if I uncomment this is working \end{document} In this example, despite the fact that I can see add on the produced pdf (indicating that the if condition works correctly in the hook at the end of the document), I get the warning: Reference 'LastMainPage' on page 2 undefined on input line 29 and very logically I have 2/?? on the produced foot. EDIT: to be more precise, I just realized that this unwanted behaviour appears when I use latexmk as I will be done on Overleaf. While if I run pdflatex or lualatex twice, on the first compilation the reference is not found while on the second it is as expected. latexmk version: 9 March 2026. Version 4.88 pdfTeX version: 3.141592653-2.6-1.40.29 (TeX Live 2026) luaTeX Version: 1.24.0 (TeX Live 2026) So do you see a simple way to solve this ? Is there a way to add a label at the end of a document without getting the warning/error: Reference 'LastMainPage' on page 2 undefined on input line 29 ? Or is there a way to redirect a label to another (here LastMainPage would point toward LastPage) if it has not been found ?

  • Underscores in header inconsistent between pages [closed]
    by Mstislav Keldysh on September 3, 2026 at 7:27 pm

    Consider the following document: \documentclass[12pt,letterpaper,final]{article} \usepackage[margin=2.54 cm]{geometry} \usepackage{wrapfig} \usepackage{setspace} \usepackage{xcolor} \usepackage{graphicx} \usepackage{caption} \usepackage{hyperref} \usepackage{amssymb} \usepackage{gensymb} \usepackage[fleqn]{amsmath} \usepackage[shortlabels]{enumitem} \usepackage[version=4]{mhchem} %\usepackage[para,bottom]{footmisc} \usepackage{fancyhdr} \fancyhf{} \fancypagestyle{plain}{ \fancyhf{} \lhead{THING} \chead{\textbf{A TITLE}} \rhead{Name} \fancyfoot[C]{\thepage} } \pagestyle{fancy} \lhead{THING} \chead{\textbf{A TITLE}} \rhead{NAME} \fancyfoot[C]{\thepage} \begin{document} LOTS OF TEXT \end{document} When I compile this, on the first page I get two underscores in the header: On the second page, I only get one: I don't know why. I want to have everything like the 2nd page with only one underscore. I use tectonic as my compiler.

  • How to refine the custom `\oplusarc` symbol with more consist looking with `\oplus`?
    by Explorer on September 3, 2026 at 2:39 pm

    With Marjin's hack, I borrowed egreg's code with picture mode to replicate the following symbol: which comes from the following context: Edit Thanks to jlab's suggestions, I have corrected my silly mistake. % https://tex.stackexchange.com/a/765922 % https://tex.stackexchange.com/a/766094 \documentclass{article} \usepackage{amsmath} \usepackage{etoolbox} \usepackage[pstarrows]{curve2e} % a general purpose macro https://tex.stackexchange.com/a/480801/4427 \newcommand{\xmathpalette}[2]{\mathchoice {#1\displaystyle\textfont{#2}}% {#1\textstyle\textfont{#2}}% {#1\scriptstyle\scriptfont{#2}}% {#1\scriptscriptstyle\scriptscriptfont{#2}}% } \let\origoplus\oplus % https://tex.stackexchange.com/a/766094/322482 \def\arrowshift{0} \makeatletter \patchcmd{\@VArc}{\vector(\@xnum,\@ynum){0}}{\vector(\@xnum,\@ynum){\arrowshift}}{}{} \newdimen\oplusarc@dim \newcommand{\oplusarc}{% \mathbin{% \mkern0.5mu \xmathpalette\newoplusarc@\origoplus \mkern0.5mu }% } \newcommand{\newoplusarc@}[3]{% \begingroup \sbox\z@{$#1\m@th#3$}% \oplusarc@dim=\dimeval{\ht\z@+\dp\z@}% \unitlength=0.065\oplusarc@dim% \def\pIIe@CAW{0.1\oplusarc@dim}% \vcenter{\hbox{% \begin{picture}(7,18)(0,-9)% \def\arrowshift{2}% \linethickness{0.7\fontdimen8#2 3}% \VectorArc(0,0)(45:7){260}%{270} % \Line(-3,0)(3,0)% \Line(0,-3)(0,3)% \end{picture}% }}% \endgroup } \makeatother \begin{document} $\origoplus \oplusarc$ $\scriptstyle\origoplus \oplusarc$ $\scriptscriptstyle\origoplus \oplusarc$ \fboxsep=0pt \fboxrule=0.1pt \fbox{$\origoplus$} \fbox{$\oplusarc$} $A \oplus B$, \quad $X_{i \oplusarc j}$ $A \oplusarc B$, \quad $X_{i \oplusarc j}$ \end{document} But the result was not so ideal, with not so consistent size and baseline with oplus(?), thus, I was still want to ask whether any suggestions on my code;-), Why I use curve2e instead of tikz, is that I want a less-dependent (and maybe faster) solution here... Since egreg's code was so sophisticated, I am sure that I was lack of ability to fully understand now...

  • How do you change the math font in ltx-talk?
    by David Purton on September 3, 2026 at 1:33 pm

    When I try to change the math font in ltx-talk it is only partly successful. Operators remain in the original New CM Sans Math font. What's going on and how to fix? \DocumentMetadata{} \documentclass{ltx-talk} \setmathfont{STIX Two Math} \begin{document} $x=\sin y$ \end{document}

  • How to replicate \exists symbol [duplicate]
    by AGI on September 3, 2026 at 12:29 pm

    I want to renew the command and add features to the macro but I want to replicate exactly the symbol without using \exists. Does anybody know how to check its definition or replicate it? It seems it isn't from any package and so don't know where to check its definition.

  • Error in including tcolorbox library while creating class
    by Jolia on September 3, 2026 at 8:46 am

    I want to create a class to replace the default beamer class in my presentations. When I modify my beamer document to include all the packages I want no error to be signaled, but when I try to create the class: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{leçon} \LoadClass[aspectratio=169,10pt]{beamer} \RequirePackage{hyphenat} % Empêche la césure des mots \hyphenpenalty=5000 \RequirePackage{tkz-tab} \RequirePackage{tabularray} \RequirePackage{pifont} \RequirePackage{qrcode} \RequirePackage{makecell} \RequirePackage{mathrsfs} \setbeamertemplate{navigation symbols}{} \RequirePackage{ragged2e} \usetikzlibrary{matrix, arrows, positioning, tikzmark, shadows, shadings, lindenmayersystems} \tcbuselibrary{listings, breakable, skins} % Couleurs \definecolor{rose}{RGB}{216,0,111} \definecolor{vert}{RGB}{100,200,100} \definecolor{bleu}{RGB}{0,150,150} \definecolor{violet}{RGB}{180,100,200} \definecolor{orange}{RGB}{255,134,40} \newcommand{\hl}[2]{\tcbox[on line, highlight math style={enhanced},colback=#1!30,colframe=#1!30,boxsep=1pt,left=0pt,right=0pt,top=0pt,bottom=0pt]{#2}} \newcommand{\plus}{{\color{rose}\bm{+}}} \newcommand{\moins}{{\color{vert}\bm{-}}} \newcommand{\grasprop}[1]{{\color{rose}\textbf{#1}}} \newcommand{\grasdef}[1]{{\color{orange}\textbf{#1}}} \newcommand{\grassub}[1]{{\color{vert}\textbf{#1}}} \newcommand{\grasmeth}[1]{{\color{violet}\textbf{#1}}} \newcommand{\grasex}[1]{{\color{ex}\textbf{#1}}} \newcommand{\grasrmq}[1]{{\color{bleu}\textbf{#1}}} \newcommand{\N}{\mathbf{N}} \newcommand{\R}{\mathbf{R}} \newcommand{\Z}{\mathbf{Z}} \newcommand{\application}[5]{$\begin{array}{ccccc} #1 & : & #2 & \longrightarrow & #3 \\ & & #4 & \longmapsto & #5 \\ \end{array}$} \newcommand{\suiterec}[4]{$\left\{ \begin{array}{ll} #1 & = #2 \\ #3 & = #4 \end{array} \right.$} \newcommand{\vect}[1]{\overrightarrow{#1}} \newcommand{\coop}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}} \newcommand{\cooe}[3]{\begin{pmatrix}#1 \\ #2 \\ #3 \end{pmatrix}} I get an error on the line \tcbuselibrary{listings, breakable, skins} in Overleaf saying "Undefined control sequence". It does compile however (for now but might not if I use different functionalities in my beamer). Any idea what I could do?

  • Unicode-math based solution with bold math binary symbols? [duplicate]
    by Explorer on September 3, 2026 at 2:52 am

    The post comes from this classical one, but the unicode-math version, I want to bold some math binary symbols: \documentclass{article} \usepackage{bm} \begin{document} $a + b$ vs $a \bm{+} b$ $a - b$ vs $a \bm{-} b$ $a \times b$ vs $a \bm{\times} b$ $a \div b$ vs $a \bm{\div} b$ \end{document} However, as we all known, unicode-math was conflict with bm package, what I want was as below: The code with unicode-math.... \documentclass{article} \usepackage{unicode-math} \setmathfont{latinmodern-math.otf} \setmathfont[range={`+,\minus,\times,\div}]{STIX Two Math}% ? \begin{document} $a + b$ % vs $a + b$ $a - b$ ? % vs $a - b$ % ? $a \minus b$ % vs $a \minus b$ % ? $a \times b$ % vs $a \times b$ $a \div b$ % vs $a \div b$ \end{document} I found no solution with unicode-math (I only found that STIX Two Math's symbols are thicker, but not in matched style), any suggestions? Notes that other code in the reference link was not the same bahavior of \bm, I want a more Latin Modern Math-like style (it means the tip of + is rounded, but not butt, for example) here...

  • Related to head note of an article [closed]
    by Rup_LA on September 2, 2026 at 6:04 pm

    I have seen a good head note with many details in the document written and shared by my professor. I want to use it too in my documents. I am showing an example of this here: How can I imitate it in my documents? I've tried but failed. So any help will be appreciated.

  • Math accent placement with LaTeX beamer, sans serif font and lmodern
    by Tripedior on September 2, 2026 at 5:36 pm

    I am using utf8 inputenc, T1 fontenc and lmodern as the font to create a presentation with LaTeX Beamer. However, this combination results in math accents (like tilde and hat) which are not correctly aligned above the italicized letters (variable names) in math mode. A MWE can be found below. When I remove lmodern from the loaded packages then the accents are aligned correctly, but the font itself looks very strange/rough/unpolished, which does not look satisfactory to me. Any advice? \documentclass[aspectratio=169]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{mathtools} \begin{document} \begin{frame} \frametitle{Misplaced accents} Polynomial $\tilde{p}$ of degree $n-1$ with \begin{align*} p(x) = (x - \hat{x}) \cdot \tilde{p}(x) \ \xLeftrightarrow{x \neq \hat{x}}\ p(x) : (x - \hat{x}) = \tilde{p}(x) \end{align*} \end{frame} \begin{frame} \centering\Huge Equations \end{frame} \end{document} Edit: added screenshots, please compare the headlines and the accents in the formula (first one without lmodern, second one with lmodern)

  • How to determine whether a call to \printbibliography will produce output or not?
    by lAtExFaN on September 2, 2026 at 2:52 pm

    I've no clue how to solve this. Although the question should be nearly self explanatory, here's some pseudo code that could be helpful, too: if(\printbibliography will produce output) { insert pagebreak in the document (not in bibliography) } The if-condition is the problem, I would like to get some hints for or even solved. Here's an MWE for experimentation: \documentclass{article} \usepackage{biblatex} \usepackage{filecontents} \begin{filecontents}{general.bib} @misc{A01, author = {Author, A.}, year = {2001}, title = {Alpha}, } @misc{B02, author = {Buthor, B.}, year = {2002}, title = {Bravo}, } \end{filecontents} \addbibresource{general.bib} \begin{document} %As Buthor said in \cite{B02}: \IfFileExists{\jobname.bbl}% {\textbackslash printbibliography expected to produce output}% {\textbackslash printbibliography not expected to produce output} \printbibliography \end{document}

  • How to draw/visualize/simulate to show the diffence between the two almost identical curves?
    by Black Mild on September 1, 2026 at 9:45 am

    This question is related to an interesting question on mathSE. The blue curve $E$ is the ellipse $\left(\frac{4x}{\pi}\right)^2+\left(\frac{y}{\ln\left(\sqrt2+1\right)}\right)^2=1$ and the red curve $L$ is $y^2=\ln^2\left(\sqrt2\cos x-\sqrt{\cos(2x)}\right)$ are almost identical in shapes. So far several answers show that they are different (some 1/10000) but almost identical (it's still open for that exact value/measure of how different they are). Naturally we want to see the difference. The question is to draw/visualize/simulate how different they are. It's interesting in mathematics but challenging in drawing due to very small diffrences. I can draw them (the code below is a MWE); the below left is E over thicker L, the below right is L over a thicker E; however we can not see the difference. Any tools (tikz, pgfplot, asymptote, luadraw, julia, ...) are allowed (standalone can be integrated into LaTeX/beamer). I just think of f(x)-g(x), f(x)/g(x), ... then scale by 10000 in graph, but not yet clear and complete. Please explain some maths behind your way, if any. // https://asymptote.ualberta.ca/ // https://math.stackexchange.com/questions/5147646/why-is-this-curve-almost-an-ellipse-y2-ln2-left-sqrt2-cos-x-sqrt-cos2x/5148177 // The blue curve $E$ is the ellipse $\left(\frac{4x}{\pi}\right)^2+\left(\frac{y}{\ln\left(\sqrt2+1\right)}\right)^2=1$. import graph; usepackage("amsmath"); size(12cm); real a = pi/4; // \approx 0.7854 real b = log(sqrt(2)+1); // = arcsinh(1) \approx 0.8814 write(a); write(b); // The ellipse E real xE(real t) { return a*cos(t); } real yE(real t) { return b*sin(t); } // The curve L real yL_upper(real x) { // Tránh sai số dấu phẩy động lân cận nghiệm bằng hàm max real u = sqrt(max(cos(2*x), 0)); return log(u + sqrt(u^2 + 1)); } real yL_lower(real x) { return -yL_upper(x); } // draw on a picture with pen void draw_curve_E(picture pic=currentpicture, pen p) { draw(pic, graph(xE, yE, 0, 2*pi), p); } void draw_curve_L(picture pic=currentpicture, pen p) { path upper = graph(yL_upper, -a, a, operator ..); path lower = reverse(graph(yL_lower, -a, a, operator ..)); draw(pic, upper -- lower -- cycle, p); } pen penE = blue+1pt; pen penL = red+1pt; pen draw_first = opacity(.3) + 4pt; picture picaxes, picE, picL, picEL, picLE; real extra = .1; xaxis(picaxes, -a-extra, a+extra, gray); yaxis(picaxes, -b-extra, b+extra, gray); add(picE,picaxes); add(picL,picaxes); add(picEL,picaxes); add(picLE,picaxes); draw_curve_E(picE, penE); string sE=" \begin{minipage}[C]{6cm} \[ \left(\frac{4x}{\pi}\right)^2+ \left(\frac{y}{\ln(\sqrt2+1)}\right)^2=1 \] \begin{align*} a&=\pi/4 \approx 0.7854\\ b&=\ln(\sqrt2+1)\\ &=\operatorname{arsinh}(1)\approx0.8814 \end{align*} \[ \frac{x^2}{a^2}+\frac{y^2}{b^2}=1 \] \end{minipage}"; label(picE,Label(scale(.6)*sE,penE),(-a-extra,0),W); draw_curve_L(picL, penL); string sL=" \begin{minipage}[C]{6cm} $$y^2=\ln^2\left(\sqrt2\cos x-\sqrt{\cos(2x)}\right)$$ $$2\sin^2x +\sinh^2 y=1$$ \end{minipage}"; label(picL,Label(scale(.6)*sL,penL),(a+extra,0),E); draw_curve_E(picEL, penE + draw_first); draw_curve_L(picEL, penL); draw_curve_L(picLE, penL + draw_first); draw_curve_E(picLE, penE); real dx=1, dy=1.8; add(shift(-dx,0)*picE); add(shift(dx,0)*picL); add(shift(-dx,-2dy)*picEL); add(shift(dx,-2dy)*picLE); label("They are different but almost identical!",(0,-dy-.2)); label("How do we see their difference ?",(0,-2dy-b-.8)); //shipout(bbox(2mm,invisible)); shipout(bbox(2mm,Fill(.2yellow+.8white)));

  • How to draw realistic, semi-3D chemistry glassware (volumetric flask) in pure TikZ?
    by user446526 on September 1, 2026 at 8:34 am

    I am trying to recreate an educational chemistry diagram illustrating the dilution of a solution using pure TikZ. Here is the target image I want to emulate (specifically the realistic, glossy 3D look of the glassware and liquid): I have made an initial attempt at drawing the volumetric flask and adding some basic gradients to simulate a 3D effect and control the water level. Here is my current Minimal Working Example (MWE), which is stripped of all custom fonts and language packages, along with a screenshot of my current output: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=1cm, y=1cm] % Water level control \def\waterlevel{-0.5} % Main flask path \def\flaskpath{ (0,-2.115) .. controls (1.85,-2.0) and (0.2,-0.45) .. (0.225,-0.01) .. controls (0.15,1.95) and (0.25,1.55) .. (0.25,1.725) .. controls (0.175,2.15) and (0.3,2.15) .. (0.3,2.225) .. controls (0.2,2.35) and (-0.2,2.35) .. (-0.3,2.225) .. controls (-0.3,2.15) and (-0.175,2.15) .. (-0.25,1.725) .. controls (-0.25,1.55) and (-0.15,1.95) .. (-0.225,-0.01) .. controls (-0.2,-0.45) and (-1.85,-2.0) .. cycle } % 1. Flask glass (3D transparent background) \fill[left color=gray!10, right color=gray!30, middle color=white, opacity=0.4] \flaskpath; % 2. Liquid with 3D gradient \begin{scope} \clip \flaskpath; \fill[left color=blue!60!black, right color=blue!40, middle color=blue!15, opacity=0.85] (-2,-2.2) rectangle (2, \waterlevel); % Liquid surface line \draw[blue!80!black, thick, opacity=0.6] (-1, \waterlevel) -- (1, \waterlevel); \end{scope} % 3. Flask outline \draw[line width=1.3pt, color=black!75] \flaskpath; % 4. Top stopper/neck details \draw[line width=1.3pt, color=black!75] (-0.3,2.225) .. controls (-0.15,2.125) and (0.15,2.125) .. (0.3,2.225); \draw[line width=1.3pt, color=black!75] (-0.25,2.275) .. controls (-0.15,2.2) and (0.15,2.2) .. (0.25,2.275); \draw[line width=1.3pt, color=black!75, left color=gray!5, right color=gray!40, middle color=white] (0.25,2.275) .. controls (0.15,2.325) and (0.15,2.375) .. (0.175,2.425) .. controls (0.45,2.5) and (0.3,2.7) .. (0,2.675) .. controls (-0.3,2.7) and (-0.45,2.5) .. (-0.175,2.425) .. controls (-0.15,2.375) and (-0.15,2.325) .. (-0.25,2.275) .. controls (-0.1,2.325) and (0.1,2.325) .. (0.25,2.275); \draw[line width=1.3pt, color=black!75] (-0.25,2.625) .. controls (-0.15,2.575) and (0.15,2.575) .. (0.25,2.625); % 5. Calibration mark (red ring on the neck) \draw[line width=1pt, red!70!black] (-0.23, 1.2) .. controls (-0.1, 1.15) and (0.1, 1.15) .. (0.23, 1.2); \end{tikzpicture} \end{document} My question: How can I further improve the shading, highlights, and transparency of this TikZ code to closely match the professional, glossy 3D rendering seen in the target image? (Note: I am looking for a pure TikZ solution and prefer not to use pst-labo or external 3D software if possible).

  • How to align this text in the first letter?
    by Alastair Stratford on September 1, 2026 at 1:02 am

    I'm currently a freshman taking Math program. I don't have any much to do so I want to learn LaTeX. Yet when I try to align this in the center, it looks like this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} u &= x^2-4 & v &= -2e^{-x/2} \\ du &= 2x & dv &= e^{-x/2} \end{align*} \end{document} I don't now how to compile this here, but here's the picture I want to align the it in the first letter, which is in d, and I want to tighter the space of it. How can I do it?

  • Specify version=bold for specific font using unicode-math
    by moro11 on August 27, 2026 at 5:38 pm

    I am switching to unicode-math and have some trouble with the bold fonts. I know the intended way in unicode-math is to use \symbf, \symbfcal etc. which boldens characters, but no symbols like + or accents like \tilde. This is fine when boldface is used for schematics (e.g. to denote vectors). But sometimes, i want to use mathematics just in an all-bold environment (e.g. in section titles) where just everything should be bold. I know i could set a bold version of a math alphabet and switch to that using \boldmath or \boldsymbol instead of \symbfXY. (of course setting up these fonts has to be done carefully, as one might end up with two different bold fonts otherwise.) Now, i further want to have access to two calligraphic fonts \symcal and \symscr ideally with full support for both, but i can not get that to work. Consider the following MWE (the fonts are available at CTAN): \documentclass[varwidth]{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \begin{document} $\symcal{A}$ (symcal) $\symbfcal{A}$ (symbfcal) {\boldmath$\symcal{A}$} (boldmath + symcal)\\ $\symscr{A}$ (symscr) $\symbfscr{A}$ (symbfscr) {\boldmath$\symscr{A}$} (boldmath + symscr) \end{document} producing What i want to have is I tried other configurations as well, such as: \setmathfont{NewCMMath-Regular.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold, range={scr,bfscr}, StylisticSet=1]{NewCMMath-Bold.otf} I have the bad feeling that i found some hard limits of the unicode-math package. Is there any way to achieve this? I would also be happy with some workarounds if this is not possible. Maybe some adjusted .otf files. Or redefining the mechanic behind \boldmath and \boldsymbol to additionally redefine \symscr and \mathscr with \symbfscr and \mathbfscr or something (i guess these are the only non-bold alphabets, so replacing them with bold version might not be ideal, but probably good enough?) I mean, we are talking about the second calligraphic font in combination with the lesser used bold mechanic, so the use-case is probably not the most relevant. Nevertheless it feels odd to not have support for that at all, especially, as this is no problem without unicode-math using the old 8-bit engine.