• How to easily draw and parameterize various pH titration curves (including diprotic/dibasic) for a beginner?
    by user446526 on August 6, 2026 at 8:23 am

    I am a complete beginner when it comes to drawing complex functional plots in LaTeX. I am trying to create several types of pH titration curves for a document, but I am struggling to write the code from scratch. I found a very helpful French website that seems to have the exact mathematical logic and LaTeX code for what I need: https://www.astrolabe-science.fr/courbes-titrages-acido-basiques-latex/ However, as a beginner, I find it quite difficult to extract just the essential parts to create a simple, easily editable template. I need to recreate the following types of curves (I have attached images of what I am aiming for): The 4 basic monoprotic titrations: Strong Acid, Strong Base, Weak Acid, and Weak Base. Diprotic acid titration: A curve with two equivalence points (increasing pH). Dibase titration: A curve with two equivalence points (decreasing pH). My request: Could someone help provide a simplified, beginner-friendly pgfplots (or TikZ) template based on the math from that website? Ideally, I am looking for a code structure where the main parameters (like initial concentrations, volumes, and pK_a values) are defined at the top so I can easily change them. It would be incredibly helpful if you could include brief comments/instructions inside the code explaining how to switch between the different types of curves (e.g., "change this sign for a base", "uncomment this for a diprotic acid"). Thank you so much for your time and help! I have attached images of what I am aiming for.

  • \documentclass[14pt]{extarticle} does not seem to work with \DeclareMathSizes{14}{14}{7}{4}
    by D G on August 6, 2026 at 5:52 am

    \documentclass[14pt]{extarticle} \usepackage{amsmath} \DeclareMathSizes{14}{14}{7}{4} \begin{document} $x_P=1$ does not produce the expected output. \end{document}

  • How to work sidenote in solution environment
    by 조문수 on August 6, 2026 at 3:14 am

    I would like to know how to use sidenotes in the solution environment as well. The solution environment I created is similar to an amsthm proof, and the source code is as follows: % sidenote settings \newcommand{\sidenote}[1]{% \refstepcounter{sidenote}\mbox{\textsuperscript{\arabic{sidenote}}} \marginpar{\footnotesize\mbox{\textsuperscript{\arabic{sidenote}}}% \sffamily\scriptsize\, #1} } \newcounter{sidenote} Sidenotes work well in regular paragraphs. What I want is for sidenotes to function normally in both the proof and solution environments. I ask for help from experts.

  • How to make \imath and \jmath to obey math alphabet changes?
    by mathrm alpha on August 5, 2026 at 11:15 pm

    I discovered that \mathrm and \mathnormal (the default math symbol font) both have dotless i and j characters, but because their TeX font encodings for dotless i and j don't match, characters like \mathrm{\imath} and \mathrm{\jmath} don't work. The dotless i and j glyphs are encoded in slots '020 and 021 in OT1, while \imath and \jmath are encoded in slots "7B and "7C, So even if I try \DeclareSymbolFont{it}{OT1}{cmr}{m}{it} \DeclareMathSymbol{\imath}{\mathord}{it}{'020} \DeclareMathSymbol{\jmath}{\mathord}{it}{'021} This makes \mathrm{\imath} or \mathrm{\jmath} truly become upright style \imath, \jmath, it also retains the original italic style of \imath and \jmath. However, since cmmi10 is a mathematical italic font, its spacing will differ from that of cmti10, which is the \mathit style.

  • Empty Clef is not working on Musixtex
    by ABV on August 5, 2026 at 10:41 pm

    It is needed to use Empty Clef, but it is not working on Musixtex. The basic code is as follow: \documentclass[% border={2pt -11pt 90pt 8pt},% left bottom right top %border=8pt varwidth]{standalone}% Ejemplo 28 \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \usepackage{amsmath} \usepackage{xcolor} \xdefinecolor{red-undar}{RGB}{179,35,79} \xdefinecolor{naranja}{RGB}{246,146,30} \xdefinecolor{conchevino}{RGB}{179,35,79} \xdefinecolor{plomoOscuro}{RGB}{52,52,52} \begin{document} \begin{music} \hsize=1.25\linewidth% \resetlyrics \setlyrics{AcordesB}{\B I \B II \B I \B II \B I \B IV \B IV6 \B II I\raisebox{0.5ex}{\bfseries\musFig[l]{{7} {\noFig}}} \B I \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{5} {6}}} \B I6 \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{3} {4}}} \B I6}% \setlyrics{AcordesA}{\B 8 \B Np \B 5 \B Np \B 5 \B 5 \B Np \B 8 \B Np \B 6 \B 3 \B 8 \B 6 \B Np \B 5 _} %\setsongraise{1}{1.5cm} %\setsongraise{2}{2.5cm} \lyrraisemulti{1}{2}{a -1.9cm} \font\A=phvb8t at 10pt% added for letter type. \font\B=phvb8t at 13pt% added for letter type. \parindent0mm \sepbarrules \generalsignature{0} %\generalmeter{\meterfrac{2}2} \instrumentnumber{1} \interstaff{10}%espacio entre pentagramas del piano \setclef{1}{61}%Clave de Do en 4ta linea \setstaffs1{2}% \nobarnumbers% \startpiece% \A\assignlyricsmulti{1}{2}{AcordesA}%,AcordesX,AcordesY,AcordesB} \A\assignlyricsmulti{1}{1}{AcordesB}%,AcordesX,AcordesY,AcordesB} \Notes\qsk\wh{J}\zcharnote{33}{\hspace{0.5cm}\begin{tikzpicture} \node (point) at (0,0)[text width=24mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Apertura 8va}}}; \end{tikzpicture}}\zcharnote{0}{\hspace{-0.65cm}\begin{tikzpicture} \node (point) at (0,0)[text width=16mm,align=center] {\textcolor{red-undar}{\A\textbf{}}}; \draw[line width=2pt,draw=red-undar] (0.118,2.27) -- ++(0.1,0)-- ++(0,-2.2)-- ++(-0.1,0); \end{tikzpicture}}% |\qsk\hp\hl{j}\en\bar% \notes\wh{K}|\ql{ih}\hl{i}\en\bar \NOtes\sk|\sk\en\doublebar% \setclef18\zchangeclefs % apply empty clef (no space) \setclef{1}{61}\changeclefs% \notes\wh{J}\zcharnote{33}{\hspace{0.5cm}\begin{tikzpicture} \node (point) at (0,0)[text width=27mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Apertura 5ta}}}; \end{tikzpicture}}|\qp\ql{gnm}\en\bar% \notes\wh{L}\zcharnote{-3}{\hspace{-4.2cm}\begin{tikzpicture} \node (point) at (0,0)[text width=16mm,align=center] {\textcolor{red-undar}{\A\textbf{}}}; \draw[line width=2pt,draw=red-undar] (0.118,2.27) -- ++(0.1,0)-- ++(0,-1.9)-- ++(-0.1,0); \end{tikzpicture}}% |\ql{lkj}\qsk\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece \end{music} \end{document} The current output is as follow: The desired output is as follow:

  • LyX adding erroneous AtBeginDocument commands to custom environment preamble
    by Robly18 on August 5, 2026 at 9:29 pm

    Consider the following MWE, which is a part of my LyX theorem setup. [I removed some of the pretty-printing commands to make the code shorter.] #\DeclareLyXModule{MWE Theorems} #\DeclareCategory{My Custom Modules} #DescriptionBegin #My standard ntheorem theorems #DescriptionEnd Format 104 Preamble \usepackage[amsmath,thmmarks]{ntheorem} EndPreamble OutlinerName thm "Definitions & Theorems" Style Theorem Category Reasoning LatexType Environment LatexName thm LabelType Static LabelString "Theorem." Preamble \theoremstyle{plain} \theorembodyfont{\upshape} \theoremheaderfont{\bfseries} \theoremseparator{.} \theoremnumbering{arabic} \theoremsymbol{} \newtheorem{thm}{Theorem} EndPreamble Requires ntheorem Requires refstyle End Style Proof CopyStyle Theorem DependsOn Theorem LatexName proof LabelString "Proof:" LabelCounter "" AddToToc "" Preamble \theoremstyle{nonumberplain} \theoremheaderfont{\itshape} \theorembodyfont{\upshape} \theoremseparator{:} \theoremsymbol{\ensuremath{\blacksquare}} \newtheorem{proof}{Proof} \theoremstyle{plain} \theorembodyfont{\upshape} \theoremheaderfont{\bfseries} \theoremseparator{.} \theoremnumbering{arabic} \theoremsymbol{} EndPreamble LabelFont Shape Italic Series Medium EndFont EndLabelType Filled_Box Requires amssymb End Expected behavior: When I use, for example, a proof environment, the Preamble section of the style definition should be added to the preamble of the generated LaTeX. Instead, I obtain the following code in my preamble: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \usepackage[amsmath,thmmarks]{ntheorem} \newref{thm}{refcmd={Theorem~\ref{#1}}} \theorembodyfont{\upshape} \theoremheaderfont{\bfseries} \theoremseparator{.} \theoremnumbering{arabic} \theoremsymbol{} \AtBeginDocument{ \theoremstyle{plain} \newtheorem{thm}{Theorem} } \theoremheaderfont{\itshape} \theorembodyfont{\upshape} \theoremseparator{:} \theoremsymbol{\ensuremath{\blacksquare}} \theorembodyfont{\upshape} \theoremheaderfont{\bfseries} \theoremseparator{.} \theoremnumbering{arabic} \theoremsymbol{} \AtBeginDocument{ \theoremstyle{nonumberplain} \newtheorem{proof}{Proof} \theoremstyle{plain} } Note the erroneous AtBeginDocument commands, and the reordering of the theorem definitions commands. I have figured out that I can get around the issue by not putting the \newtheorem commands on their own line, or adding a % to the end of their line, but I don't understand why this is happening. This feature does not seem to be documented, and I don't remember it happening until recently. I have been playing around with some settings to get synctex to work, but I don't know what could have caused this.

  • Problems wih tagging a tblr table from tabularray
    by Svend Tveskæg on August 5, 2026 at 6:16 pm

    Consider the following table: \DocumentMetadata{ lang = da, tagging = on } \documentclass[ landscape, 12pt ]{article} \usepackage{fontspec} \setmainfont[ NFSSFamily = tgp, Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, Ligatures = { TeX, CommonOff } ]{texgyrepagella} \usepackage{ amsthm, thmtools } \usepackage[ math-style = TeX ]{unicode-math} \setmathfont{texgyrepagella-math.otf} \setmathfont[ version = bold, FakeBold = 4 ]{texgyrepagella-math.otf} \DeclareSymbolFont{textdigits}{TU}{tgp}{m}{n} \SetSymbolFont{textdigits}{bold}{TU}{tgp}{b}{n} \Umathcode`0="7 \symtextdigits `0 \Umathcode`1="7 \symtextdigits `1 \Umathcode`2="7 \symtextdigits `2 \Umathcode`3="7 \symtextdigits `3 \Umathcode`4="7 \symtextdigits `4 \Umathcode`5="7 \symtextdigits `5 \Umathcode`6="7 \symtextdigits `6 \Umathcode`7="7 \symtextdigits `7 \Umathcode`8="7 \symtextdigits `8 \Umathcode`9="7 \symtextdigits `9 \usepackage{polyglossia} \setdefaultlanguage{danish} \usepackage[ a3paper, vmargin = 2cm, hmargin = 0.6cm ]{geometry} \usepackage{bm} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{diagbox} \definecolor{matematik}{rgb}{0.89, 0.0, 0.13} \definecolor{biologi}{rgb}{0.55, 0.71, 0.0} \definecolor{geografi}{rgb}{0.68, 0.85, 0.9} \definecolor{fysik}{rgb}{0.99, 0.99, 0.59} \definecolor{nattek}{rgb}{0.0, 0.5, 0.0} \forcsvlist{\listadd\darkcolors}{ matematik, nattek% } \ExplSyntaxOn \NewDocumentCommand\tid{ m m }{% \tl_set:Nn \l__temp_tl { #1 }% \regex_replace_once:nnN { :\d+ } { } \l__temp_tl% \if_int_compare:w \str_count:N \l__temp_tl = 1% \hphantom{0}% \fi:% #1\,--\,#2% } \ExplSyntaxOff \NewTableCommand\fag[1]{ \SetCell{ font = \Huge\bfseries, bg = #1 } \ifinlist{#1}{\darkcolors}{ \SetCell{ fg = white } }{} } \begin{document} \def\mlr{-0.5} \def\str{\large} \LARGE \begin{center} \begin{tblr}{ colspec = { Q[l, m, 6.2cm] *{5}{Q[c, m, 6cm, rightsep = 10pt, leftsep = 10pt]} }, hlines, vlines, rows = {1cm, abovesep = 4pt, belowsep = 4pt}, row{1} = {font = \bfseries}, } \SetCell{c, m} \diagbox{Tidsrum}{Ugedag} & Mandag & Tirsdag & Onsdag & Torsdag & Fredag \\[\mlr ex] \SetCell{m} \tid{8:00}{8:45} & \fag{geografi} {Geografi \\ {\str 9.~C \hfill C-04/C-35}} & \fag{geografi} {Geografi \\ {\str 8.~B \hfill C-11/C-35}} & \fag{nattek} {Natur/tekn. \\ {\str 6.~A \hfill B-68}} & & \fag{biologi} {Biologi \\ {\str 9.~C \hfill C-35}} \\[\mlr ex] \SetCell{m} \tid{8:45}{9:30} & & \fag{matematik} {Matematik \\ {\str 8.~A \hfill C-10}} & \fag{nattek} {Natur/tekn. \\ {\str 6.~A \hfill B-68}} & \fag{fysik} {Fysik/kemi \\ {\str 9.~C \hfill C-29}} & \fag{biologi} {Biologi \\ {\str 9.~C \hfill C-35}} \\[\mlr ex] \SetCell{m} \tid{9:30}{10:00} & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause \\[\mlr ex] \SetCell{m} \tid{10:00}{10:45} & \fag{matematik} {Matematik \\ {\str 8.~A \hfill C-10}} & \fag{matematik} {Matematik \\ {\str 8.~A \hfill C-10}} & \fag{geografi} {Geografi \\ {\str 9.~B \hfill C-02/C-35}} & \fag{fysik} {Fysik/kemi \\ {\str 9.~C \hfill C-29}} & \fag{matematik} {Matematik \\ {\str 8.~A \hfill C-10}} \\[\mlr ex] \SetCell{m} \tid{10:45}{11:30} & & \fag{geografi} {Geografi \\ {\str 7.~A \hfill C-14}} & & \fag{biologi} {Biologi \\ {\str 8.~A \hfill C-35}} & \\[\mlr ex] \SetCell{m} \tid{11:30}{12:15} & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause \\[\mlr ex] \SetCell{m} \tid{12:15}{13:00} & & \fag{geografi} {Geografi \\ {\str 7.~A \hfill C-14}} & \fag{nattek} {Natur/tekn. \\ {\str 6.~B \hfill B-64}} & \fag{matematik} {Matematik \\ {\str 8.~A \hfill C-10}} & \fag{fysik} {Fysik/kemi \\ {\str 9.~B \hfill C-29}} \\[\mlr ex] \SetCell{m} \tid{13:00}{13:45} & \fag{biologi} {Biologi \\ {\str 9.~B \hfill C-35}} & \fag{fysik} {Fysik/kemi \\ {\str 8.~A \hfill C-29}} & \fag{nattek} {Natur/tekn. \\ {\str 6.~B \hfill B-64}} & & \fag{fysik} {Fysik/kemi \\ {\str 9.~B \hfill C-29}} \\[\mlr ex] \SetCell{m} \tid{13:45}{13:55} & & & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause & \SetCell[c = 1]{c, m, font = \bfseries} Pause \\[\mlr ex] \SetCell{m} \tid{13:55}{14:40} & \fag{biologi} {Biologi \\ {\str 9.~B \hfill C-35}} & \fag{fysik} {Fysik/kemi \\ {\str 8.~A \hfill C-29}} & \fag{geografi} {Geografi \\ {\str 8.~A \hfill C-10}} & & \\[\mlr ex] \SetCell{m} \tid{14:50}{16:30} & & \SetCell[c = 1]{c, m, font = \itshape} PF / forberedelse & & \SetCell[c = 1]{c, m, font = \itshape} Team~8 / C-hus & \\[\mlr ex] \end{tblr} \end{center} \end{document} When I compile using an up-to-date (as of August 5th, 2026) TL26 distribution, I get the following warnings: Package tagpdf Info: luamml has been enabled and will create a MathML file. Package tagpdf Warning: Alternative text for graphic is missing. (tagpdf) Using 'picture environment' instead. Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 116, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 120, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 124, text Package tagpdf Warning: Alternative text for graphic is missing. (tagpdf) Using 'picture environment' instead. Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 127, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 128, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 129, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 130, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 131, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 132, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 133, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 134, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 135, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 136, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 137, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 138, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 139, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 140, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 141, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 142, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 143, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 144, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 145, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 146, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 147, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 148, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 149, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 150, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 151, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 152, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 153, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 154, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 155, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 156, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 157, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 158, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 159, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 160, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 161, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 162, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 163, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 164, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 165, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 166, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 167, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 168, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 169, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 170, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 171, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 172, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 173, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 174, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 175, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 176, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 177, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 178, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 179, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 180, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 181, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 182, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 183, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 184, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 185, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 186, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 187, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 188, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 189, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 190, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 191, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 192, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 193, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 194, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 195, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 196, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 197, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 198, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 199, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 200, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 201, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 202, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 203, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 204, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 205, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 206, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 207, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 208, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 209, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 210, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 211, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 212, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 213, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 214, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 215, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 216, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 217, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 218, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 219, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 220, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 221, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 222, text Package tagpdf Warning: Parent-Child 'pdf2:P' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 195 (tagpdf) struct 115, text --> struct 223, text [1{/usr/local/texlive/2026/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]<<late x-list-css.html>><<latex-align-css.html>> (./test.aux) MathML statistic ================ ==> 2 MathML fragments read ==> 1 different MathML fragments ==> 2 math fragments found ==> 2 fitting MathML AF found ==> 2 MathML AF attached Package tagpdf Info: Finalizing the tagging structure: (tagpdf) Writing out ~223 structure objects (tagpdf) with ~215 'MC' leaf nodes. (tagpdf) Be patient if there are lots of objects! Package tagpdf Info: writing ParentTree Package tagpdf Info: writing IDTree Package tagpdf Info: writing RoleMap Package tagpdf Info: writing ClassMap Package tagpdf Info: writing NameSpaces Package tagpdf Info: writing StructElems Package tagpdf Info: writing Root ) 533 words of node memory still in use: 6 hlist, 2 vlist, 2 rule, 2 glue, 4 kern, 2 glyph, 11 attribute, 58 glue_spe c, 7 attribute_list, 1 write nodes avail lists: 1:1,2:7251,3:914,4:152,5:177,6:198,7:5908,8:1,9:3416,10:3,11:16 2 How can I change the code in order to get a proper tagging?

  • Latest kernel breaks `xeCJKfntef`'s highlight?
    by Explorer on August 5, 2026 at 5:56 pm

    Here below is my MWE: % `xelatex` needed \listfiles \documentclass{article} \usepackage[fontset=fandol]{ctex} \usepackage{xcolor} \usepackage{xeCJKfntef} \begin{document} \CJKunderanyline*{0.5ex}{\color{yellow}\rule{2pt}{2.5ex}}{虚室生白,吉祥止止} \end{document} I run tlmgr update today, and I guessed that the latest kernel that cause this bug: *File List* article.cls 2025/01/22 v1.4n Standard LaTeX document class size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ctex.sty 2026/07/14 v2.6.4 Chinese adapter in LaTeX (CTEX) expl3.sty 2026-07-20 L3 programming layer (loader) l3backend-xetex.def 2026-02-18 L3 backend support: XeTeX ctexhook.sty 2026/07/13 v2.6.4 Document and package hooks (CTEX) ctexpatch.sty 2026/07/13 v2.6.4 Patching commands (CTEX) fix-cm.sty 2020/11/24 v1.1t fixes to LaTeX ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file ctexopts.cfg 2026/07/13 v2.6.4 Option configuration file (CTEX) ctex-engine-xetex.def 2026/07/15 v2.6.4 XeLaTeX adapter (CTEX) xeCJK.sty 2026/07/22 v3.10.4 Typesetting CJK scripts with XeLaTeX xtemplate.sty 2025-10-09 L3 Experimental prototype document functions fontspec.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX xparse.sty 2025-10-09 L3 Experimental document command parser fontspec-xetex.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX fontenc.sty 2025/07/18 v2.1d Standard LaTeX package fontspec.cfg xeCJK.cfg 2026/07/22 v3.10.4 Configuration file for xeCJK package zhnumber.sty 2022/07/14 v3.0 Typesetting numbers with Chinese glyphs zhnumber-utf8.cfg 2022/07/14 v3.0 Chinese numerals with UTF8 encoding ctex-scheme-chinese.def 2026/07/13 v2.6.4 Chinese scheme for generic (CTEX) ctex-name-utf8.cfg 2026/07/13 v2.6.4 Caption with encoding UTF-8 (CTEX) indentfirst.sty 2023/07/02 v1.03 Indent first paragraph (DPC) ctex-c5size.clo 2026/07/14 v2.6.4 c5size option (CTEX) ctex-fontset-fandol.def 2026/07/22 v2.6.4 Fandol fonts definition (CTEX) ctex.cfg xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration xetex.def 2025/11/01 v5.0p Graphics/color driver for xetex mathcolor.ltx xeCJKfntef.sty 2026/07/22 v3.10.4 xeCJK font effect ulem.sty 2019/11/18 *********** Anyone knows what happened? And any possible solution to fix this?

  • Fast and feature-complete LaTeX formatters
    by Akira on August 5, 2026 at 3:10 pm

    I am looking for a LaTeX formatter that is both fast and feature-complete. By being fast, I mean it can format a very large tex file (e.g., more than 30,000 lines) in under a second. By being feature-complete, I mean it can handle nested alignment environments. For example, given \begin{align}a&= \begin{aligned}&b + c \\ & d + f\end{aligned} \\ g&= h\end{align} I would expect the formatter to produce something like \begin{align} a & = \begin{aligned} & b + c \\ & d + f \end{aligned} \\ g & = h \end{align} My motivation: I use VSCode where I configure latexindent to format a tex file whenever I save the changes. That being said, I format a tex file multiple times during an edit. Due to this frequent usage, I can feel the delay when using latexindent even on an average tex file I am aware of the following tools: latexindent is mature and feature-complete, but it is not fast enough for large files. For example, it takes about 25 seconds to format this paper source (36,192 lines), as discussed in this issue. tex-fmt is very fast (being implemented in Rust), but it does not yet handle the above example. It formats \begin{align}a&= \begin{aligned}&b + c \\ & d + f\end{aligned} \\ g&= h\end{align} as \begin{align}a&= \begin{aligned}&b + c \\ & d + f \end{aligned} \\ g&= h \end{align} Are there LaTeX formatters that satisfy both of these requirements?

  • How to position some text independent of document flow?
    by lindes on August 5, 2026 at 4:41 am

    I'm relatively new to LaTeX, but... I very much suspect it's a decent tool for what I'm trying to do, but I'm having trouble quite getting the behavior I want. My goal is to create a cover, on a5 paper (ultimately, I'll print 2 on a single sheet of A4 paper), to wrap around an a6-sized booklet (the contents of which I've already created, using just pandoc, and thus LaTeX only implicitly). I've found ways to get two-column text that gets me the basics of things (and also a background image, not shown here), but I'd like to also put some text along what amounts to the spine of the booklet, but I'm having troubles getting the positioning of that correct. Here's what I've got so far (including adding showframe just for debugging purposes): \documentclass[a5paper,landscape]{article} \usepackage{rotating} % sideways, turn \usepackage{multicol} % columns \setlength{\columnsep}{1cm} \usepackage[left=0.5cm,right=0.5cm,top=2cm,bottom=2cm,showframe]{geometry} \pagenumbering{gobble} \begin{document} \begin{multicols}{2} \begin{center} Text here for the back cover... \end{center} \columnbreak \begin{center} {\huge A title here} \vspace{2cm} {\large And a subtitle} \end{center} \end{multicols} \makebox[\textwidth][c]{ \begin{turn}{270} Spine text ends up after subtitle... \end{turn} } \end{document} Which generates this: My hope was that the "S" of the "Spine text..." part would start at the same line as the top of the "A" in "A title here", but instead it seems to come at the roughly the same vertical position (acually a little lower, even) on the page as I'd get if I added another line of text... and if I indeed do that, it goes even lower. So, clearly its getting its positioning information from the other stuff on the page. I presume this is because it's in "Paragraph mode". Because I'm still new to LaTeX, though, I'm not sure what I would need to do to get this either into a different mode, or reset the positioning, or treat this as a third (middle) column, of a much narrower width, or... something I haven't even thought of, yet, perhaps. Any solutions (perhaps a different \documentclass, or adding some other packages, or what have you) would be appreciated. (Especially if they can also get me a simpler page layout -- without the space for headings and such that I see thanks to showframe.) Perhaps something to create a minipage with absolute positioning on the page? Or to just position that one line of text? Anyway, something to a least treat the spine text as somehow separate, positioning-wise, from the rest. I've dug around on this site and various others, and tried a few things, but not yet found something that I've been able to figure out how to apply to the challenge at hand. Hopefully that can soon change. 🙂 Thanks!

  • How to define a conditional to check if a LaTeX file is being compiled on TeXlyre?
    by Nyx on August 4, 2026 at 11:19 pm

    In a similar spirit to the questions How can my LaTeX files detect if they're being compiled on Overleaf? and Automatic detection of Overleaf for fallback images, I would like to ask (and self-answer) the question of how to define a conditional to check if a LaTeX file is being compiled on the web editor TeXlyre.

  • How to get the exact width of a tabbing row?
    by mbert on August 4, 2026 at 9:14 pm

    In source2e, the box \@curline is described as the contents of current line, excluding left margin skip, and excluding contents of current field Thus I would expect that the width of \@curline in the last field would be everything up to but not including the last field. This is almost correct, but it seems this width is slightly larger than expected. Here's an example. \documentclass{article} \newlength{\firstrowlen} \newlength{\secondrowlen} \begin{document} \makeatletter \begin{tabbing} some text \= some more text \= even more text \= blub \`\global\firstrowlen=\wd\@curline \\ abc \> def \> ghi \> jkl \`\global\secondrowlen=\wd\@curline \end{tabbing} \noindent \raisebox{36pt}[0pt]{\rule{\firstrowlen}{1pt}} \noindent \raisebox{36pt}[0pt]{\rule{\secondrowlen}{1pt}} \end{document} As can be seen, the length of the rules, which are the width of \@curline from each row, extend slightly farther than the actual content. It seems they extend the same amount for both rows. What is this extra amount and where is it coming from? I could not seem to figure this out from the code in source2e.

  • more hooks timing of `\SetTblrInner` in `tabularray`?
    by Explorer on August 4, 2026 at 4:14 pm

    This is the follow-up of my previous answer. Let's consider the following example: \documentclass{article} \usepackage{array} \usepackage{tabularray} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% \noindent\begin{tblr}{ colspec={@{}XW{20pc}@{}}, row{1} = {l,b}, cell{2}{1} = {c=2}{c,font=\itshape}, } \toprule Variable & Sources\break Bottom\\ \midrule Supply variables & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \end{document} It gives what we want: However, consider the following code, note the order: \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% \noindent\begin{tblr}{ row{1} = {l,b},%<-------------- colspec={@{}XW{20pc}@{}}, cell{2}{1} = {c=2}{c,font=\itshape}, } \toprule Variable & Sources\break Bottom\\ \midrule Supply variables & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \end{document} If I put row{1} = {l,b} before colspec={@{}XW{20pc}@{}}, the W would overwrite the b. Thus, row{1} = {l,b} not work. Now Let's consider original requirement, says that we have multiple tabulars with different colspec, now the global setting \SetTblrInner, could only insert the settings at the beginning of the Inner-Specification, that was not so fliexble, any suggestion or workaround? \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% \SetTblrInner{row{1} = {l,b}} \noindent\begin{tblr}{ colspec={@{}XW{20pc}@{}}, } \toprule Variable & Sources\break Bottom\\ \midrule Supply variables & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \bigskip \noindent\begin{tblr}{ colspec={@{}XW{15pc}X@{}}, } \toprule Variable & Sources\break Bottom & Variable\\ \midrule Supply variables & & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities & has been examined\\ \bottomrule \end{tblr} \bigskip \noindent\begin{tblr}{ colspec={@{}XW{12pc}XX@{}}, } \toprule Variable & Sources\break Bottom & Variable & Variable\\ \midrule Supply variables & & & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities & has been examined under three types of agglomeration externalities & has been examined\\ \bottomrule \end{tblr} \end{document} I want the \SetTblrInner{row{1} = {l,b}} could be inserted after variable colspec={@{}XW{12pc}XX@{}}, but I seemly found not built-in support. Key edits To make my question more easy to understand, here below is more detailed explaination: I have three tblr, with two columns, three columns and four columns: \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% % \SetTblrInner{row{1} = {l,b}} %<-not work.... \noindent\begin{tblr}{ colspec={@{}XW{20pc}@{}}, row{1} = {l,b} } \toprule Variable & Sources\break Bottom\\ \midrule Supply variables & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \bigskip \noindent\begin{tblr}{ colspec={@{}XW{15pc}X@{}}, row{1} = {l,b} } \toprule Variable & Sources\break Bottom & Variable\\ \midrule Supply variables & & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities & has been examined\\ \bottomrule \end{tblr} \bigskip \noindent\begin{tblr}{ colspec={@{}XW{12pc}XX@{}}, row{1} = {l,b} } \toprule Variable & Sources\break Bottom & Variable & Variable\\ \midrule Supply variables & & & \\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities & has been examined under three types of agglomeration externalities & has been examined\\ \bottomrule \end{tblr} \end{document} There are three row{1} = {l,b} elements after colspec={@{}XW{12pc}XX@{}}, thus they push Variable to the bottom. However, if I want to set row{1} = {l,b} global for all three tblr tables, it failed. I want to know any suggeestions to set them in this case.

  • table column heading bottom alignment - tabularray
    by MadyYuvi on August 4, 2026 at 2:33 pm

    I need to align the column heads are in base alignment format, my tags are: \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% \begin{tblr}{@{}XW{20pc}@{}} \toprule \SetCell[c=1]{l} Variable & \SetCell[c=1]{l} Sources\break Bottom\\ \midrule \SetCell[c=2]{c} \textit{Supply variables}\\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit employees & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit financials & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \end{document}

  • Multiple cross-references with only hyperref
    by Akira on August 4, 2026 at 11:27 am

    I have a tex file \documentclass{article} \usepackage{amsthm} \usepackage{mathtools} % before hyperref \mathtoolsset{showonlyrefs} \usepackage[hypertexnames=false]{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=blue, urlcolor=red, citecolor=magenta } \begin{document} \begin{align} B & = C , \label{thm:eq1} \\ X & = Y . \label{thm:eq4} \end{align} We have \eqref{thm:eq1,thm:eq4} and \autoref{thm:eq1,thm:eq4}. \end{document} Both cleveref and zref-clever seem not to be maintained anymore. So I would like to stick to hyperref. Can \eqref{thm:eq1,thm:eq4} and \autoref{thm:eq1,thm:eq4} produce Equations (0.1) and (0.2)? I am aware of the solution in Multiple references with \autoref, which is 15 years old. I wonder if recent development is able to provide a simpler solution.

  • Only prevent line breaks if text fits within one line
    by Rincewind on August 4, 2026 at 10:30 am

    I am trying to define a command which I do not want to line break if possible. I know this can be done by wrapping the entire command into an \mbox command. However, I may use this command with very long arguments which cannot fit into a single line. But as far as I am aware \mbox will prevent line breaks even if the argument is longer than one line. Is there a way to prevent line breaks only if the argument can fit within one line or do I have to define two separate commands, one that allows line breaking and one that does not? Edit: Here is a smallish example \documentclass[a4paper]{article} \newcommand{\ProdType}[2]{#1 \times #2} \newcommand{\Pair}[2]{{(#1,\mkern2mu#2)}} \newcommand{\Sum}[2]{{#1 \mathop{+} #2}} \newcommand{\AnnotateType}[2]{#1_{#2}} \newcommand{\SumType}[2]{#1 + #2} \newcommand{\listT}[1][\tau]{list~#1} \newcommand{\type}{\AnnotateType{(\SumType{\AnnotateType{unit}{\emptyset}}{\AnnotateType{(\ProdType{\tau}{\AnnotateType{\listT}{D}})}{\emptyset}})}{\emptyset}} \begin{document} This text defines a reasonably long type namely the type $\type$ that is broken up against my will. On the other hand if I mbox it, it is not broken up, even if it needs to be: \mbox{$\Pair{\SumType{\Pair{\type}{\type}}{\Pair{\type}{\type}}}{\SumType{\Pair{\type}{\type}}{\Pair{\type}{\type}}}$}. \end{document}

  • How can xeCJK support both the CJK main font and two fallback CJK extension fonts?
    by mathrm alpha on August 4, 2026 at 7:55 am

    I discovered that xeCJK has a fallback mechanism, but it can only apply to one fallback CJK font. If I use two fonts simultaneously, the following error occurs: Package xeCJK Warning: Redefining CJKfamily `rm/FallBack` (Jigmo2.ttf). Package xeCJK Warning: CJKfamily `Jigmo.ttf(0)` (FallBack/FallBack) does not contain glyph `𠀁` (U+20001) on line \documentclass{article} \usepackage[fallback]{xeCJK} \setCJKmainfont{Jigmo.ttf} \setCJKfallbackfamilyfont{rm}{Jigmo2.ttf} \setCJKfallbackfamilyfont{rm}{Jigmo3.ttf} \begin{document} Jigmo display: 1. 五 2. 𠀁 3. 𰀀 \end{document} How can I adjust the fallback font order to prioritize Jigmo2.ttf (which has Unicode characters) and then switch from Jigmo2.ttf to Jigmo3.ttf?

  • tabularray: Text does not wrap in a spanned \SetCell across X columns
    by Rounak Niloy on August 4, 2026 at 5:04 am

    I am using tabularray (v2024A on Overleaf) and have encountered an issue with a longtblr table. I have a table with one X column followed by eight X columns. For one row, I span the last eight columns using \SetCell[c=8]{l,m}{...}. However, the text inside the merged cell does not wrap. Instead, it continues beyond the page width as a single line. I expected the merged cell to have the combined width of the eight X columns and automatically wrap the text. The following MWE reproduces the problem: \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{pifont} \newcommand{\cmark}{\ding{51}} \newcommand{\xmark}{\ding{55}} \begin{document} \begin{longtblr}[ caption = {Dummy table}, label = {tab:test}, ]{ width = \linewidth, colsep = 2pt, rowsep = 2pt, colspec = {X[0.225,l,m] *{8}{X[0.2,c,m]}}, hline{1-Z} = {solid}, columns = {font=\footnotesize}, rowhead = 1, row{1} = {font=\footnotesize\bfseries}, } \SetCell{c} Reference & \SetCell{c} Col 1 & \SetCell{c} Col 2 & \SetCell{c} Col 3 & \SetCell{c} Col 4 & \SetCell{c} Col 5 & \SetCell{c} Col 6 & \SetCell{c} Col 7 & \SetCell{c} Col 8 \\ Foo & \cmark & \xmark & \cmark & \xmark & \cmark & \xmark & \cmark & \xmark \\ Bar & \xmark & \cmark & \xmark & \cmark & \xmark & \cmark & \xmark & \cmark \\ Baz & \xmark & \xmark & \xmark & \xmark & \xmark & \xmark & \xmark & \xmark \\ Qux & \SetCell[c=8]{l,m} {Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.} \\ \midrule Present work & \cmark & \cmark & \cmark & \cmark & \cmark & \cmark & \cmark & \cmark \\ \end{longtblr} \end{document} Output: The text extends beyond the page instead of wrapping within the merged cell. Expected behaviour: The merged cell should behave like a paragraph cell spanning the combined width of the eight X columns, with the text wrapped automatically. Is this expected behaviour of tabularray, or am I using \SetCell incorrectly? If this is the intended behaviour, what is the recommended way to create a multi-column paragraph cell that wraps automatically?

  • Placing text at the end of the last line of center environment
    by mbert on August 3, 2026 at 11:04 pm

    I'm working on some code to improve amsthm's \qedhere in various list-type environments, e.g., center. I'm having trouble getting the placement right in the last line of the center environment. The default of amsthm is to insert an \hfill which causes the text on the last line to be placed flush left. Here's an example showing the effect of \hfill and amsthm's default behavior. \documentclass{article} \usepackage[nopar]{kantlipsum} \usepackage{amsthm} \begin{document} \begin{center} \kant[1][1-2] \hfill\qedsymbol % not good \end{center} \begin{center} \kant[1][1-2]% this doesn't work \makebox[0pt]{\mbox{}\hfill\qedsymbol} \end{center} \begin{proof} \begin{center} \kant[1][1-2] \qedhere % not good \end{center} \end{proof} \end{document} Is there a way to place the \qedsymbol at the end of the line without affecting the text in that line? My first idea was to use a zero-width box but I couldn't figure out the right combination of (possibly nested) \makeboxes. Ideally, if the last line did not have room for the \qedsymbol, it would be moved to the end of the following line. I'm hoping to do this without writing to the aux with \pdfsavepos (as in the linegoal package).

  • Fairy chess pieces with xskak
    by baristocrona on August 3, 2026 at 10:23 pm

    A few weeks ago I stumbled upon a strange bug: when I tried to place numbers on squares, I got some fairy chess pieces instead. The problem turned out to be related to the use of the beamerposter package (the issue disappears when beamerposter is not loaded). \documentclass{beamer} \usepackage[LSBC5, T1]{fontenc} \usepackage[orientation=portrait, size=custom,width=38,height=40.5,scale=1.0]{beamerposter} \usepackage{xskak} \usepackage{xcolor} \begin{document} \chessboard[ clearboard, % --- NUMBERS --- pgfstyle={[base, at={\pgfpoint{0pt}{-0.4ex}}]text}, % Degree 2 text=\fontsize{1ex}{1ex} 158, markfield=a1, text=\fontsize{1ex}{1ex} 138, markfield=a8, text=\fontsize{1ex}{1ex} 168, markfield=h1, text=\fontsize{1ex}{1ex} 168, markfield=h8, % Degree 3 text=\fontsize{1ex}{1ex} 112, markfield=a2, text=\fontsize{1ex}{1ex} 112, markfield=a7, text=\fontsize{1ex}{1ex} 112, markfield=b1, text=\fontsize{1ex}{1ex} 112, markfield=b8, text=\fontsize{1ex}{1ex} 112, markfield=g1, text=\fontsize{1ex}{1ex} 112, markfield=g8, text=\fontsize{1ex}{1ex} 112, markfield=h2, text=\fontsize{1ex}{1ex} 112, markfield=h7, % Degree 4 text=\fontsize{1ex}{1ex} 84, markfield=a3, text=\fontsize{1ex}{1ex} 84, markfield=a4, text=\fontsize{1ex}{1ex} 84, markfield=a5, text=\fontsize{1ex}{1ex} 84, markfield=a6, text=\fontsize{1ex}{1ex} 84, markfield=b2, text=\fontsize{1ex}{1ex} 84, markfield=b7, text=\fontsize{1ex}{1ex} 84, markfield=c1, text=\fontsize{1ex}{1ex} 84, markfield=c8, text=\fontsize{1ex}{1ex} 84, markfield=d1, text=\fontsize{1ex}{1ex} 84, markfield=d8, text=\fontsize{1ex}{1ex} 84, markfield=e1, text=\fontsize{1ex}{1ex} 84, markfield=e8, text=\fontsize{1ex}{1ex} 84, markfield=f1, text=\fontsize{1ex}{1ex} 84, markfield=f8, text=\fontsize{1ex}{1ex} 84, markfield=g2, text=\fontsize{1ex}{1ex} 84, markfield=g7, text=\fontsize{1ex}{1ex} 84, markfield=h3, text=\fontsize{1ex}{1ex} 84, markfield=h4, text=\fontsize{1ex}{1ex} 84, markfield=h5, text=\fontsize{1ex}{1ex} 84, markfield=h6, % Degree 6 text=\fontsize{1ex}{1ex} 56, markfield=b3, text=\fontsize{1ex}{1ex} 56, markfield=b4, text=\fontsize{1ex}{1ex} 56, markfield=b5, text=\fontsize{1ex}{1ex} 56, markfield=b6, text=\fontsize{1ex}{1ex} 56, markfield=c2, text=\fontsize{1ex}{1ex} 56, markfield=c7, text=\fontsize{1ex}{1ex} 56, markfield=d2, text=\fontsize{1ex}{1ex} 56, markfield=d7, text=\fontsize{1ex}{1ex} 56, markfield=e2, text=\fontsize{1ex}{1ex} 56, markfield=e7, text=\fontsize{1ex}{1ex} 56, markfield=f2, text=\fontsize{1ex}{1ex} 56, markfield=f7, text=\fontsize{1ex}{1ex} 56, markfield=g3, text=\fontsize{1ex}{1ex} 56, markfield=g4, text=\fontsize{1ex}{1ex} 56, markfield=g5, text=\fontsize{1ex}{1ex} 56, markfield=g6, % Degree 8 text=\fontsize{1ex}{1ex} 42, markfield=c3, text=\fontsize{1ex}{1ex} 42, markfield=c4, text=\fontsize{1ex}{1ex} 42, markfield=c5, text=\fontsize{1ex}{1ex} 42, markfield=c6, text=\fontsize{1ex}{1ex} 42, markfield=d3, text=\fontsize{1ex}{1ex} 42, markfield=d4, text=\fontsize{1ex}{1ex} 42, markfield=d5, text=\fontsize{1ex}{1ex} 42, markfield=d6, text=\fontsize{1ex}{1ex} 42, markfield=e3, text=\fontsize{1ex}{1ex} 42, markfield=e4, text=\fontsize{1ex}{1ex} 131, markfield=e5, text=\fontsize{1ex}{1ex} 10, markfield=e6, text=\fontsize{1ex}{1ex} 42, markfield=f3, text=\fontsize{1ex}{1ex} 42, markfield=f4, text=\fontsize{1ex}{1ex} 22, markfield=f5, text=\fontsize{1ex}{1ex} 42, markfield=f6, boardfontsize=20pt] \end{document} Now, I'm actually working with fairy chess pieces, and the only way I see to get them is to build them myself. Could someone help me get those amazing pieces back? As a minimal working example I'm placing a board with just a knight. Could somebody make him vary its shape (i.e., turn it into a fairy chess piece)? \documentclass{article} \usepackage[LSBC5,T1]{fontenc} \usepackage{xskak} \begin{document} \chessboard[setpieces={Nd4}] \end{document} For the time being, I define new pieces using the following code: \makeatletter \cbDefineNewPiece{white}{E} {\raisebox{\depth}{\cfss@whitepiececolor $\includegraphics[width=0.5em]{new-chess-piece.png}$}} {\BlackEmptySquare% \makebox[0pt][r]{\cfss@whitepiececolor \raisebox{\depth}{% \makebox[1em]{$\includegraphics[width=1em]{new-chess-piece.png}$}}}}

  • Mixing different text and math fonts [closed]
    by scriptor on August 3, 2026 at 8:37 pm

    To be honest, I can't stand Computer Modern in text anymore, I think Libertinus Serif is much better, however I still wanna use CM (specifically NewCM) for maths. Is it okay to mix text and math fonts or should I stick with Libertinus across the board?

  • Octavo class. Is it possible to obtain a oneside document?
    by Yves on August 3, 2026 at 7:00 pm

    I am trying to evaluate the best possible option for a friend to compose a book of her poems. I have found that the poetrytex package has the necessary features. However I sense my friend could be attracted by the appearance created by the octavo class. She intends to have her book printed, but also wishes to obtain a pdf file to share easily with remote friends. I was unable to get the oneside option working in the octavo class, which may be by design. A file containing poems with a change of margins on each page is not visually attractive, while a book obviously is. \documentclass[12pt,oneside,titlepage,imperial]{octavo} \usepackage{lipsum} \begin{document} \title{Test octavo class} \maketitle \lipsum[1-10] \newpage \lipsum[5-9] \end{document}

  • Mathalpha mathbb font choice overwritten by Fourier package
    by Matthew on August 3, 2026 at 4:37 pm

    After being recommended it in a previous post, I'm using the mathalpha package to specify which alphabets use which package. I'm using the fourier package for the main text and math fonts, because I like the look of the greek letters in the Utopia font. I wish to use the blackboard bold font from mathpazo, which is done using \usepackage[bb=pazo]{mathalpha}, but importing the fourier package beforehand seems to overwrite this (but weirdly, does not overwrite the calligraphic font?). Here's an example: When I don't import fourier this displays as intended \documentclass{article} \usepackage{amsmath} %\usepackage{fourier} % not importing fourier \usepackage[cal=cm, bb=pazo]{mathalpha} \begin{document} $$ ABCDEFGHIJKLMNOPQRSTUVWXYZ $$ % CM math font $$ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ % CM calligraphic $$ \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ % pazo blackboard bold \end{document} But when I import fourier the blackboard bold font now renders as Utopia blackboard bold, while the calligraphic font still (correctly) renders as computer modern \documentclass{article} \usepackage{amsmath} \usepackage{fourier} % importing fourier \usepackage[cal=cm, bb=pazo]{mathalpha} \begin{document} $$ ABCDEFGHIJKLMNOPQRSTUVWXYZ $$ % now Utopia font $$ \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ % still CM calligraphic $$ \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$ % should be pazo blackboard bold, renders as Utopia \end{document} How can I use the Utopia font at the same time as pazo's blackboard bold? Cheers in advance.

  • \SI{}{} Units Are Converted into Multiple MathML Elements Instead of a Single MathML Element
    by rcv on August 3, 2026 at 3:36 pm

    Issue: Each \SI{}{} unit is converted into two separate MathML elements instead of a single MathML element. Requirement: How can each \SI{}{} expression be converted into a single MathML element? Example: For example, \SI{14.7}{\percent} is currently converted into two separate MathML elements—one for 14.7 and another for %. It should instead be converted into a single MathML element representing the complete SI value and unit. MWE: \documentclass{book} \usepackage{siunitx} \usepackage{algorithm2e} \usepackage{algpseudocode} \begin{document} Manufacturing decarbonization requires emission control that remains auditable under regulatory uncertainty. We propose Carbon-Conformal Manufacturing (CCM), which uses one-sided conformal upper bounds and Carbon Compliance Certificates to connect hourly control decisions with EU ETS and CBAM reporting logic in paper-mill energy systems. On 12 months of source-plant data, CCM reduces carbon emissions by \SI{14.7}{\percent} while maintaining \SI{99.1}{\percent} of production and achieving \SI{96.2}{\percent} empirical coverage at a \SI{95}{\percent} target. In two validated digital-twin variants, coverage remains between \SI{95.4}{\percent} and \SI{96.6}{\percent}, with carbon reduction between \SI{14.2}{\percent} and \SI{14.7}{\percent}. Point optimization reaches \SI{11.3}{\percent} reduction, Bayesian uncertainty intervals reach \SI{93.8}{\percent} coverage, and removing conformal calibration reduces coverage to \SI{87.0}{\percent} while increasing violation events by \SI{23}{\percent}. CCM improves carbon reduction per compute-hour by \SI{11.5}{\percent} over RL-noCP and yields annualized savings of 2,831 tCO$_2$e and 244 kEUR at 86 EUR/t. Temporal and stress tests show stable monthly coverage, and an 8-week shadow deployment sustains weekly monitoring performance under operator review. Live closed-loop actuation remains future work, and the paper's claim boundary is limited to source-plant, digital-twin, and shadow-deployment evidence. \end{document} Produced Output: <!--l. 8--><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mn>1</mn><mn>4</mn><mo class="MathClass-punc" stretchy="false">.</mo><mn>7</mn></math> <!--l. 8--><math xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="normal"><mi >%</mi></mstyle></math>

  • Using a font package without overwriting the default \mathcal command
    by Matthew on August 3, 2026 at 3:18 pm

    I want to use the fourier package for the Utopia font, but I'm not a fan of how mathcal font changes to something reminiscent of mathscr. How do I use fourier while retaining the usual mathcal alphabet?

  • Code Review: A custom TikZ package for drawing Chemistry Reaction Progress Tables (ICE tables)
    by Natsu on August 3, 2026 at 2:33 pm

    As part of my workflow for typesetting educational materials, I frequently need to draw Chemistry Reaction Progress Tables (often known as ICE tables). To automate this, I am developing a small custom package using tikz called tkzPhysTab. The package calculates the grid coordinates automatically based on the number of reactants and products, places the $+$ and $\rightarrow$ signs, and allows adding rows dynamically. Here is the package code (tkzPhysTab.sty): \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{tkzPhysTab}[2025/11/07 Physical Reaction Table by Khaldi] \RequirePackage{tikz} % ============================= % Default Values % ============================= \def\tkzPhysTabFirstColWidth{1.5} % Width of the first column \def\tkzPhysTabColWidth{2.5} % Width of the data columns \def\tkzPhysTabRowHeight{1.0} % Row height % ============================= % Setup pgfkeys % ============================= \pgfkeys{ /tkzPhysTab/.is family, /tkzPhysTab, firstcol/.store in = \tkzPhysTabFirstColWidth, colwidth/.store in = \tkzPhysTabColWidth, rowheight/.store in = \tkzPhysTabRowHeight, reset/.code = { \def\tkzPhysTabFirstColWidth{1.5} \def\tkzPhysTabColWidth{2.5} \def\tkzPhysTabRowHeight{1.0} } } % Counters (Note: I am aware calling \newcounter here might cause issues if called twice, looking for better alternatives) \newcounter{tkzcolsOne} \newcounter{tkzcolsTwo} \newcounter{tkzlevel} \newcounter{tkzrows} % ============================= % Table Initialization Command % ============================= \newcommand{\tkzPhysicsTabInit}[4][]{% % Reset default values \pgfkeys{/tkzPhysTab/reset} % Apply custom options from [options] \pgfkeys{/tkzPhysTab,#1} \setcounter{tkzcolsOne}{0} \setcounter{tkzcolsTwo}{0} \setcounter{tkzlevel}{1} \setcounter{tkzrows}{0} \foreach \c in {#3}{\stepcounter{tkzcolsOne}} \foreach \c in {#4}{\stepcounter{tkzcolsTwo}} \foreach \r in {#2}{\stepcounter{tkzrows}} \pgfmathtruncatemacro{\ncolData}{\thetkzcolsOne + \thetkzcolsTwo} \pgfmathtruncatemacro{\nrows}{\thetkzrows + 1} \pgfmathsetmacro{\W}{\tkzPhysTabFirstColWidth + \ncolData * \tkzPhysTabColWidth} \pgfmathsetmacro{\H}{\nrows * \tkzPhysTabRowHeight} \coordinate (T) at (0,0); \draw[very thick] (T) rectangle (\W,-\H); % Vertical lines \draw (\tkzPhysTabFirstColWidth, 0) -- (\tkzPhysTabFirstColWidth, -\H); \foreach \i in {1,...,\ncolData}{ \pgfmathsetmacro{\xpos}{\tkzPhysTabFirstColWidth + \i * \tkzPhysTabColWidth} \draw (\xpos, -\tkzPhysTabRowHeight) -- (\xpos, -\H); } % Horizontal lines \foreach \j in {1,...,\nrows}{ \draw (0, -\j*\tkzPhysTabRowHeight) -- (\W, -\j*\tkzPhysTabRowHeight); } % Reactants \foreach [count=\i from 1] \c in {#3} { \pgfmathsetmacro{\xcenter}{\tkzPhysTabFirstColWidth + (\i - 0.5) * \tkzPhysTabColWidth} \node at (\xcenter, -\tkzPhysTabRowHeight/2) {\c}; \ifnum\i>1 \pgfmathsetmacro{\xplus}{\tkzPhysTabFirstColWidth + (\i - 1) * \tkzPhysTabColWidth} \node at (\xplus, -\tkzPhysTabRowHeight/2) {$+$}; \fi } % Arrow between reactants and products \pgfmathtruncatemacro{\nReact}{\thetkzcolsOne} \pgfmathsetmacro{\xarrow}{\tkzPhysTabFirstColWidth + \nReact * \tkzPhysTabColWidth} \node at (\xarrow, -\tkzPhysTabRowHeight/2) {$\rightarrow$}; % Products \foreach [count=\i from 1] \c in {#4} { \pgfmathsetmacro{\xcenter}{\xarrow + (\i - 0.5) * \tkzPhysTabColWidth} \node at (\xcenter, -\tkzPhysTabRowHeight/2) {\c}; \ifnum\i>1 \pgfmathsetmacro{\xplus}{\xarrow + (\i - 1) * \tkzPhysTabColWidth} \node at (\xplus, -\tkzPhysTabRowHeight/2) {$+$}; \fi } % Row labels \foreach [count=\j from 1] \r in {#2} { \pgfmathsetmacro{\ycenter}{-(\j + 0.5) * \tkzPhysTabRowHeight} \node at (\tkzPhysTabFirstColWidth/2, \ycenter) {\r}; } } % ============================= % Add Row Command % ============================= \newcommand{\tkzPhysicsTabLine}[1]{% \stepcounter{tkzlevel} \foreach [count=\i from 1] \val in {#1} { \pgfmathsetmacro{\xcenter}{\tkzPhysTabFirstColWidth + (\i - 0.5) * \tkzPhysTabColWidth} \pgfmathsetmacro{\ycenter}{-(\thetkzlevel - 0.5) * \tkzPhysTabRowHeight} \node at (\xcenter, \ycenter) {\val}; } } And here is the Minimum Working Example (MWE) generating the table: \documentclass[border=5mm]{standalone} \usepackage{tkzPhysTab} \begin{document} \begin{tikzpicture} \tkzPhysicsTabInit[firstcol=2.0,colwidth=3,rowheight=1.2]% {$x=0$,$x=t$,$x=f$}% {$Fe_3O_4$,$4H_2$}% {$3Fe$,$4H_2O$} \tkzPhysicsTabLine{$2.18$,$9.65$,$0$,$0$} \tkzPhysicsTabLine{$2.18-x$,$-4x$,$?$,$?$} \tkzPhysicsTabLine{$2.18-x_{\max}$,$-4x_{\max}$,$??$,$??$} \end{tikzpicture} \end{document} My questions for the experts: I initially defined \newcounter inside \tkzPhysicsTabInit, which caused an error when calling the table twice. I fixed this by declaring the counters globally in the package file and using \setcounter inside the macro to reset them. Is this the standard LaTeX best practice, or is there a more elegant way to handle local counters/variables in this context without polluting the global namespace? Is manually calculating coordinates using \pgfmathsetmacro the most efficient way to draw this grid, or would you recommend using TikZ libraries like matrix or integrating with packages like tabularray? Are there any other optimizations or best practices you would suggest to make this package more robust for general users? Thank you in advance for your insights!

  • How to draw a complex shaded ribbon with a central jewel using TikZ? [closed]
    by Natsu on August 2, 2026 at 7:48 am

    I am looking for guidance on how to recreate the attached image (image.png) entirely within LaTeX using TikZ. The image consists of two main complex elements: A red ribbon with intricate curves and realistic 3D-like gradient shading. A multi-faceted jewel/diamond in the center with sharp light reflections. Initially, I thought simulating this 3D effect in TikZ would be too complex, but following the community's helpful feedback and advice on providing a Minimal Working Example (MWE), I decided to tackle both the ribbon and the central jewel to demonstrate my progress. I managed to draw the ribbons using manual Bézier curves and custom shadings to simulate the folds. For the jewel, I used a clipping mask and layered semi-transparent polygons (opacity) to mimic the glass facets and light reflections. Here is my current MWE: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{shadings,calc} \definecolor{ribbonred}{RGB}{215,10,28} \begin{document} \begin{tikzpicture}[x=3cm,y=3cm] \begin{scope} \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=150] (-0.463,-0.006) .. controls (-0.497,-0.017) and (-0.649,-0.048) .. (-0.672,-0.073) .. controls (-0.680,-0.110) and (-0.637,-0.134) .. (-0.601,-0.158) .. controls (-0.563,-0.147) and (-0.467,-0.035) .. (-0.445,-0.010) .. controls (-0.423,0.015) and (-0.464,-0.008) .. (-0.468,-0.008); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=150] (-0.188,-0.128) .. controls (-0.204,-0.135) and (-0.236,-0.149) .. (-0.281,-0.167) .. controls (-0.320,-0.207) and (-0.380,-0.306) .. (-0.372,-0.502) .. controls (-0.372,-0.717) and (-0.372,-0.842) .. (-0.562,-0.776) .. controls (-0.684,-0.438) and (-0.369,-0.102) .. (-0.231,-0.080) .. controls (-0.199,-0.102) and (-0.195,-0.127) .. (-0.188,-0.136); \fill[% top color=ribbonred!50!black, bottom color=ribbonred!50!black, middle color=ribbonred!80, shading angle=140] (-0.182,-0.067) .. controls (-0.437,-0.096) and (-0.598,-0.685) .. (-0.497,-0.794) .. controls (-0.664,-0.762) and (-0.983,-0.545) .. (-0.870,-0.355) .. controls (-0.742,-0.221) and (-0.518,-0.079) .. (-0.410,0.012) .. controls (-0.295,0.059) and (-0.217,-0.054) .. (-0.180,-0.069) .. controls (-0.142,-0.084) and (-0.196,-0.091) .. (-0.199,-0.095); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=30] (-0.178,0.212) .. controls (-0.206,0.278) and (-0.189,0.365) .. (-0.246,0.416) .. controls (-0.280,0.438) and (-0.328,0.400) .. (-0.328,0.369) .. controls (-0.315,0.330) and (-0.208,0.214) .. (-0.182,0.186) .. controls (-0.157,0.159) and (-0.178,0.209) .. (-0.177,0.213); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=30] (-0.160,0.197) .. controls (-0.221,0.247) and (-0.283,0.409) .. (-0.387,0.469) .. controls (-0.469,0.505) and (-0.508,0.420) .. (-0.521,0.365) .. controls (-0.488,0.312) and (-0.254,0.183) .. (-0.192,0.154) .. controls (-0.129,0.125) and (-0.166,0.190) .. (-0.161,0.198); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=90] (-0.141,0.178) .. controls (-0.350,0.409) and (-0.606,0.510) .. (-0.676,0.366) .. controls (-0.690,0.282) and (-0.678,0.169) .. (-0.660,0.115) .. controls (-0.634,0.025) and (-0.692,-0.075) .. (-0.665,-0.108) .. controls (-0.604,0.016) and (-0.319,-0.044) .. (-0.258,-0.059) .. controls (-0.171,-0.008) and (-0.165,0.163) .. (-0.147,0.207); \end{scope} \begin{scope}[shift={(-0.04, 0.03)}, xscale=-1, shift={(0.04, -0.03)}] \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=30] (-0.463,-0.006) .. controls (-0.497,-0.017) and (-0.649,-0.048) .. (-0.672,-0.073) .. controls (-0.680,-0.110) and (-0.637,-0.134) .. (-0.601,-0.158) .. controls (-0.563,-0.147) and (-0.467,-0.035) .. (-0.445,-0.010) .. controls (-0.423,0.015) and (-0.464,-0.008) .. (-0.468,-0.008); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=30] (-0.188,-0.128) .. controls (-0.204,-0.135) and (-0.236,-0.149) .. (-0.281,-0.167) .. controls (-0.320,-0.207) and (-0.380,-0.306) .. (-0.372,-0.502) .. controls (-0.372,-0.717) and (-0.372,-0.842) .. (-0.562,-0.776) .. controls (-0.684,-0.438) and (-0.369,-0.102) .. (-0.231,-0.080) .. controls (-0.199,-0.102) and (-0.195,-0.127) .. (-0.188,-0.136); \fill[% top color=ribbonred!50!black, bottom color=ribbonred!50!black, middle color=ribbonred!80, shading angle=30] (-0.182,-0.067) .. controls (-0.437,-0.096) and (-0.598,-0.685) .. (-0.497,-0.794) .. controls (-0.664,-0.762) and (-0.983,-0.545) .. (-0.870,-0.355) .. controls (-0.742,-0.221) and (-0.518,-0.079) .. (-0.410,0.012) .. controls (-0.295,0.059) and (-0.217,-0.054) .. (-0.180,-0.069) .. controls (-0.142,-0.084) and (-0.196,-0.091) .. (-0.199,-0.095); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=160] (-0.178,0.212) .. controls (-0.206,0.278) and (-0.189,0.365) .. (-0.246,0.416) .. controls (-0.280,0.438) and (-0.328,0.400) .. (-0.328,0.369) .. controls (-0.315,0.330) and (-0.208,0.214) .. (-0.182,0.186) .. controls (-0.157,0.159) and (-0.178,0.209) .. (-0.177,0.213); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=160] (-0.160,0.197) .. controls (-0.221,0.247) and (-0.283,0.409) .. (-0.387,0.469) .. controls (-0.469,0.505) and (-0.508,0.420) .. (-0.521,0.365) .. controls (-0.488,0.312) and (-0.254,0.183) .. (-0.192,0.154) .. controls (-0.129,0.125) and (-0.166,0.190) .. (-0.161,0.198); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=90] (-0.141,0.178) .. controls (-0.350,0.409) and (-0.606,0.510) .. (-0.676,0.366) .. controls (-0.690,0.282) and (-0.678,0.169) .. (-0.660,0.115) .. controls (-0.634,0.025) and (-0.692,-0.075) .. (-0.665,-0.108) .. controls (-0.604,0.016) and (-0.319,-0.044) .. (-0.258,-0.059) .. controls (-0.171,-0.008) and (-0.165,0.163) .. (-0.147,0.207); \end{scope} \begin{scope} \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred, shading angle=0] (-0.189,-0.118) .. controls (-0.262,-0.210) and (-0.334,-0.412) .. (-0.198,-0.646) .. controls (-0.186,-0.647) and (0.020,-0.234) .. (-0.118,-0.126) .. controls (-0.131,-0.134) and (-0.179,-0.123) .. (-0.191,-0.123); \fill[% top color=ribbonred!20!black, bottom color=ribbonred, shading angle=60] (-0.131,-0.812) .. controls (-0.045,-0.966) and (0.098,-1.214) .. (0.060,-1.606) .. controls (0.142,-1.512) and (0.204,-1.281) .. (0.179,-1.065) .. controls (0.245,-1.127) and (0.337,-1.249) .. (0.337,-1.479) .. controls (0.516,-1.078) and (0.167,-0.702) .. (0.064,-0.552) .. controls (-0.015,-0.442) and (-0.101,-0.777) .. (-0.136,-0.819); \fill[% top color=ribbonred!20!black, bottom color=ribbonred!20!black, middle color=ribbonred!90, shading angle=0] (-0.167,-0.091) .. controls (0.030,-0.372) and (-0.401,-0.822) .. (-0.420,-1.051) .. controls (-0.489,-1.248) and (-0.417,-1.580) .. (-0.277,-1.714) .. controls (-0.351,-1.499) and (-0.303,-1.285) .. (-0.258,-1.233) .. controls (-0.250,-1.456) and (-0.057,-1.685) .. (0.073,-1.730) .. controls (-0.079,-1.540) and (-0.159,-1.035) .. (0.050,-0.742) .. controls (0.218,-0.479) and (0.235,-0.219) .. (0.058,-0.085) .. controls (0.019,0.022) and (-0.140,-0.101) .. (-0.179,-0.104); \end{scope} \begin{scope}[shift={(-0.04, 0.03)}] \shadedraw[draw=ribbonred, very thick, inner color=white, outer color=black!85] (0,0) circle (0.25); \begin{scope} \clip (0,0) circle (0.24); \def\rTable{0.12} \def\rEdge{0.25} \fill[black, opacity=0.35] (67.5:\rTable) -- (112.5:\rTable) -- (90:\rEdge) -- cycle; \fill[black, opacity=0.5] (202.5:\rTable) -- (247.5:\rTable) -- (225:\rEdge) -- cycle; \fill[black, opacity=0.2] (247.5:\rTable) -- (292.5:\rTable) -- (270:\rEdge) -- cycle; \fill[white, opacity=0.6] (22.5:\rTable) -- (67.5:\rTable) -- (45:\rEdge) -- cycle; \fill[white, opacity=0.4] (292.5:\rTable) -- (337.5:\rTable) -- (315:\rEdge) -- cycle; \fill[white, opacity=0.7] (112.5:\rTable) -- (135:\rEdge) -- (180:\rEdge) -- cycle; \fill[white, opacity=0.8] (0,0) -- (45:0.1) -- (0:0.15) -- cycle; \fill[white, opacity=0.5] (0,0) -- (135:0.1) -- (180:0.15) -- cycle; \draw[white, thin, opacity=0.7] (22.5:\rTable) \foreach \a in {67.5, 112.5, 157.5, 202.5, 247.5, 292.5, 337.5} { -- (\a:\rTable) } -- cycle; \foreach \a in {22.5, 67.5, 112.5, 157.5, 202.5, 247.5, 292.5, 337.5} { \draw[white, thin, opacity=0.6] (\a:\rTable) -- (\a+22.5:\rEdge); \draw[white, thin, opacity=0.5] (\a:\rTable) -- (\a-22.5:\rEdge); } \draw[white, thin, opacity=0.8] (0:\rEdge) -- (180:\rEdge); \draw[white, thin, opacity=0.4] (90:\rEdge) -- (270:\rEdge); \end{scope} \tikzset{sparkle/.pic={ \fill[white, opacity=0.9] (0,0.03) .. controls (0.005,0.005) .. (0.03,0) .. controls (0.005,-0.005) .. (0,-0.03) .. controls (-0.005,-0.005) .. (-0.03,0) .. controls (-0.005,0.005) .. cycle; }} \pic at (0.08, 0.12) {sparkle}; \pic[scale=0.7] at (-0.12, 0.05) {sparkle}; \pic[scale=0.5] at (-0.05, -0.15) {sparkle}; \pic[scale=0.8] at (0.15, -0.08) {sparkle}; \end{scope} \end{tikzpicture} \end{document} And here is the resulting output I am very happy with the jewel, but I am looking for advice on how to improve the overall code structure (e.g., making the ribbon code more modular). Additionally, I really struggled with color coordination and picking the right shades for the gradients. If anyone could help me adjust the color palette to make the ribbon look more naturally glossy and realistic, I would be very grateful. I also want to thank kabenyuk for their excellent answer which showed how to modularize the ribbon drawing! Any further improvements or tips on combining these elements effectively would be greatly appreciated.

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

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

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

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

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

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