• Count the number of no-empty delimited arguments
    by myhsia on July 9, 2026 at 8:31 am

    I defined a function \__foo:w #1+#2+#3, like the MWE below \documentclass{article} \begin{document} \ExplSyntaxOn \cs_new:Npn \__foo:w #1 + #2 + #3 \q_stop { \textbf{#1},~ \textit{#2} \tl_if_blank:eF {#3} { ,~ \texttt{#3} } } \__foo:w tex + live + 2026 \q_stop % \__foo:w tex+live \q_stop \ExplSyntaxOff \end{document} But if users use \foo:w tex+live, due to the second delimiter + could not be founded, then error arises: File ended while scanning use of \foo:w <inserted text> Certainly, I know I can use l3seq, but I think it is not an elegant way. Is there a way to allow the usage \__foo:w tex+live \q_stop? Note \textbf, \textit, \texttt are just for demoing; in fact, I will use other personal defined functions.

  • How to make a relatively more beautiful classification table of quadratic functions?
    by D G on July 9, 2026 at 12:16 am

    Objectives: remove top left cell all contents are vertically and horizontally centered well balanced padding in each cell make it relatively much more beautiful \documentclass[12pt,border=12pt]{standalone} \usepackage{amsmath,array,tikz} \usetikzlibrary{math} \newcommand{\graph}[2][]{ \begin{tikzpicture}[baseline=(current bounding box.center)] \draw[blue,thick,->] (-1.5,#2)--(1.5,#2) node[right]{$x$}; \draw[red,thick,domain=-1.5:1.5,samples=100] plot(\x,{#1\x*\x/2}); \end{tikzpicture} } \renewcommand{\arraystretch}{1.8} \setlength{\tabcolsep}{18pt} \begin{document} \begin{tabular}{| >{\centering\arraybackslash}m{2.2cm}| >{\centering\arraybackslash}m{5.2cm}| >{\centering\arraybackslash}m{5.2cm}|} \cline{2-3} & $\mathbf{a>0}$ & $\mathbf{a<0}$ \\ \hline $\mathbf{D<0}$ & \graph{-1/2} & \graph[-]{1/2} \\ \hline $\mathbf{D=0}$ & \graph{0} & \graph[-]{0} \\ \hline $\mathbf{D>0}$ & \graph{1/2} & \graph[-]{-1/2} \\ \hline \end{tabular} \end{document} Any improvements are always welcome!

  • Inside a longtblr, how can I split an itemize list — wrapped in a minipage — across pages?
    by Ommo on July 8, 2026 at 9:54 pm

    I found that "itemize" works inside "longtblr" when it is wrapped with a "minipage": \usepackage [ a4paper, left = 0.2cm, right = 0.2cm, top = 0.1cm, bottom = 0.2cm, ] {geometry} \usepackage{tabularray} \usepackage{lipsum} \newcommand{\rowgap}{10pt} \begin{document} \begin{center} \DefTblrTemplate{firsthead, middlehead,lasthead}{default}{} \begin{longtblr}[presep=-4pt,postsep=0pt] {colspec = {p{3.2cm}X},width=\textwidth,colsep=0pt,rowsep=0pt} 1 December 1871 & Some intro text:\\ & \lipsum[1-3] \\[\rowgap] 15 June 2016 & Some text:\\ & \begin{minipage}[t]{\linewidth} \begin{itemize} \item \lipsum[7] \item \lipsum[8] \item \lipsum[9] \end{itemize} \end{minipage} \\[\rowgap] 30 March 2051 & Other intro text:\\ & Hello man! \\[\rowgap] \end{longtblr} \end{center} \end{document} That code produces the following output: However, if one of the "itemize" entries is made longer, for example, \item \lipsum[7] \item \lipsum[8] \item \lipsum[9-11] the "minipage" prevents the "itemize" environment from breaking across pages. As a result, the entire list is moved to the second page instead of being split between the first and second pages, producing the following output: My question: inside a "longtblr", how can I split an "itemize" list — wrapped in a "minipage" — across pages? Should I wrap my "itemize" list in a different environment that allows it to split across pages? If so, which one? Are there any other solutions for using "itemize" inside "longtblr"? EDIT (9 July 2026): Thanks, everyone, for your comments! I realize I didn't explain why I chose to use a table here. My intention is to take advantage of some features that — to my understanding — are specific to the table environment. For example, the ability to highlight particular rows and columns by applying different colors: \documentclass[11pt,english]{article} \usepackage [ a4paper, left = 0.2cm, right = 0.2cm, top = 0.1cm, bottom = 0.2cm, ] {geometry} \usepackage{tabularray} \usepackage{lipsum} \newcommand{\rowgap}{10pt} \usepackage{xcolor} \definecolor{MyColor1}{rgb}{0.22,0.45,0.70} % light blue \definecolor{MyColor2}{rgb}{0.55,0.75,0.65} % mint green \begin{document} \begin{center} \DefTblrTemplate{firsthead, middlehead,lasthead}{default}{} \begin{longtblr}[presep=-4pt,postsep=0pt] {colspec = {p{3.2cm}X},width=\textwidth,colsep=0pt,rowsep=0pt} 1 December 1871 & Some intro text:\\ & \lipsum[1-3] \\[\rowgap] \SetRow{bg=MyColor1!20} 15 June 2016 & Some text:\\ & \begin{minipage}[t]{\linewidth} \begin{itemize} \item \lipsum[7] \item \lipsum[8] \item \lipsum[9] \end{itemize} \end{minipage} \\[\rowgap] \SetRow{bg=MyColor2!20} 30 March 2051 & Other intro text:\\ & Hello man! \\[\rowgap] \end{longtblr} \end{center} \end{document} Which gives this output: I was therefore wondering whether \begin{description} ... \end{description} can provide the same functionality. So far, I have not been able to find a way to reproduce this feature within the "description" environment.

  • How to escape @ character while inputting a file in TeXInfo?
    by niru on July 8, 2026 at 1:58 pm

    I want to load luaotfload.sty with TeXInfo and here is my minimal code: \input texinfo @documentencoding UTF-8 @setfilename sample.info @settitle sample @include luaotfload.sty @bye If I use PDFTEX=luatex texi2pdf inn.texi, it produces the following: : Undefined control sequence. l.3 %% by Elie Roux <elie.roux@telecom -bretagne.eu> ? If I understand correctly, TeXInfo treats @ as a special character and turns the words following it into TeX control sequences, but the issue is that it should ignore TeX comments, which it is not. This could be a bug, but I thought I might have missed something very obvious.

  • Trail or trace of a moving charged particle
    by Sebastiano on July 8, 2026 at 12:31 pm

    I think in 2019 I built the following image with Adobe Illustrator for my book. Now, since there are so many images in pdf, I am slowly creating them in TikZ code. I wanted to know if there is something to create a trail for the blue particle similar to the main image or any other idea you have. Thank you. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{rhtip/.tip={Triangle[line width=1pt, fill=white, length=9pt, width=9pt]}, pics/clock/.style args={#1/#2}{ code={ \def\dist{0.38} \draw[thin] (0,0) circle (\dist); \draw[line width=.7pt] (0,0) -- ({0.16*cos(90-30*#1-0.5*#2)}, {0.16*sin(90-30*#1-0.5*#2)}); \draw[line width=.7pt] (0,0) -- ({0.28*cos(90-6*#2)}, {0.28*sin(90-6*#2)}); } } } \begin{document} \begin{tikzpicture}[scale=.8] \draw[->] (0,0) -- (4.8,0) node[right] {$x$}; \draw[->] (0,0) -- (0,4.8) node[above] {$z$}; \draw[->] (0,0) -- (1.8,1.1) node[above] {$y$}; \node at (-0.4,4.3) {$\Sigma$}; \shade[ball color=cyan] (2.7,1.2) circle (0.2); \draw[brown!80!black,line width=2pt,-rhtip] (2.9,1.2)--(3.8,1.2) node[midway,above left] {$\mathbf{u}$}; \pic at (2.5,2.5) {clock={1/10}}; \node[blue!60!black] at (3.35,2.9) {$C(u)$}; \begin{scope}[shift={(5,1)}] \draw[->] (0,0)--(4.5,0) node[right] {$x'$}; \draw[->] (0,0)--(0,4.8) node[above] {$z'$}; \draw[->] (0,0)--(1.8,1.1) node[above] {$y'$}; \node at (-0.4,4.3) {$\Sigma'$}; \draw[magenta,line width=2pt,-rhtip] (0,3.6)--(1.8,3.6) node[midway,above] {$\mathbf{v}$}; \draw[green!60!black,line width=2pt,-rhtip] (2.1,1.3)--(3.7,1.3) node[midway,below] {$\mathbf{u}'$}; \pic at (2.5,2.5) {clock={2/20}}; \node[blue!60!black] at (3.55,2.9) {$C'(u')$}; \end{scope} \end{tikzpicture} \end{document}

  • How to custom arrow style with `chemfig` within `\hreac`?
    by Explorer on July 8, 2026 at 12:23 pm

    This post is the follow-up of my previous question and jlab's answer, together with the comment: You can't use custom arrows with \hreac. It's why I redefined an existing one. Here below is the code to show "You can't use custom arrows with \hreac." % https://tex.stackexchange.com/a/764525 % https://tex.stackexchange.com/a/484655 \documentclass{article} \usepackage{chemfig} \ExplSyntaxOn \definearrow3{===}{% \CF_arrowshiftnodes{#3}% \path[allow ~ upside ~ down](\CF_arrowstartnode)--(\CF_arrowendnode)% node[pos=0,sloped,yshift=\CF_arrowdoublesep](\CF_arrowstartnode @u0){}% node[pos=0,sloped,yshift=-\CF_arrowdoublesep](\CF_arrowstartnode @d0){}% node[pos=1,sloped,yshift=\CF_arrowdoublesep](\CF_arrowstartnode @u1){}% node[pos=1,sloped,yshift=-\CF_arrowdoublesep](\CF_arrowstartnode @d1){};% \draw (\CF_arrowstartnode @u0)--(\CF_arrowstartnode @u1);% \draw (\CF_arrowstartnode @d1)--(\CF_arrowstartnode @d0);% \CF_arrowdisplaylabel{#1}{0.5}+\CF_arrowstartnode{#2}{0.5}-\CF_arrowendnode% } \ExplSyntaxOff \begin{document} \schemestart A\arrow{===}B \schemestop \hreac A >{===} B \endhreac \end{document} The custom arrow style === here, was allowed in \schemestart...\schemeend, but NOT within \hreac...\endhreac: \CF_error ...e {Package \CFname \space Error: #1.} l.28 >{===} ? Any suggestion on allowing === with \hreac? IMHO, === was common-seen with stoichiometric equation (see texdoc chemformula, sec 9. Arrows). If possible, if chemfig could provide more user-friendly interface to custom arrow, that would be better.

  • Nomenclature in 4 columns in 2 column document
    by Hkp on July 8, 2026 at 8:13 am

    I am trying to create a two-column nomenclature section in LaTeX. My goal is to have the nomenclature entries fill the first column and then continue automatically in the second column on the same page (similar to the normal behavior of a two-column document). I am currently using the following code: \input{nomenclature} \begin{multicols}{2} \printnomenclature[0.06\textwidth] \end{multicols} The code successfully creates two columns, but the nomenclature only fills the first column. Instead of continuing to the second column on the same page, it starts a new page. I have attached an example showing the issue. Could anyone please suggest how to fix this problem or recommend a better approach? Thank you very much for your help. Here is one one of my example with the same problem: \documentclass[10pt,twocolumn,a4paper]{article} \usepackage{nomencl} \makenomenclature \usepackage{multicol} \begin{document} \title{Test} \author{} \date{} \maketitle % Problematic part \begin{multicols}{2} \printnomenclature[0.06\textwidth] \end{multicols} \nomenclature[Y]{AR}{Aspect Ratio} \nomenclature[Y]{EOC}{Extended Outlet Channel} \nomenclature[Y]{HEx}{Heat Exchanger} %Roman \nomenclature[A]{$a$}{Dimensionless thermal diffusivity} \nomenclature[A]{${A_{cr,d}}$}{As-designed cross-sectional area of channels in the HEx} \nomenclature[A]{${A_{s,d}}$}{As-designed surface area of the channels in the HEx} \nomenclature[A]{${A_{s,Iso,eff.}}$}{Isolation effective surface area} \nomenclature[A]{$A_j$}{Eigenfunction coefficient} \nomenclature[A]{Bi}{Biot number} \nomenclature[A]{$c_{p,m}$}{Specific heat capacity under constant pressure} \nomenclature[A]{$c_{s}$}{Mean adiabatic speed of sound} \nomenclature[A]{$D_h$}{Hydraulic diameter} % Greek \nomenclature[G]{$\alpha$}{mean heat transfer coefficient (Biot number calculations)} \nomenclature[G]{$\alpha_{CWHF}$}{mean heat transfer coefficient with the constant wall heat flux calculation methodology} \nomenclature[G]{$\alpha_{CWT}$}{mean heat transfer coefficient with the constant wall temperature calculation methodology} \nomenclature[G]{$\Delta p$}{pressure drop} \nomenclature[G]{$\Delta\xi$}{standard error of the arithmetic mean} \nomenclature[G]{$\zeta$}{measured quantity} \nomenclature[G]{$\Theta$}{Dimensionless temperature} \nomenclature[G]{$\theta$}{Alternative dimensionless temperature notation (if used)} \nomenclature[G]{$\lambda$}{mean heat conductivity (Biot number calculations)} \nomenclature[G]{$\lambda_m$}{mean heat conductivity} \nomenclature[G]{$\lambda_j$}{Eigenvalue (j-th mode)} \nomenclature[G]{$\mu_m$}{mean dynamic viscosity} \nomenclature[G]{$\Phi_j$}{Eigenfunction (j-th mode)} \nomenclature[G]{$\xi$}{arithmetic mean} \nomenclature[G]{$\rho$}{mean density} \nomenclature[G]{$\sigma$}{standard deviation} % Subscripts \nomenclature[L]{$0$}{Reference (2D thermally fully developed length calculations)} \nomenclature[L]{$avg.$}{Average} \nomenclature[L]{$b$}{Bulk} \nomenclature[L]{$con$}{Contraction} \nomenclature[L]{$expn$}{Expansion} \nomenclature[L]{$h$}{Hydraulic} \nomenclature[L]{$hyd$}{Hydrodynamic} \nomenclature[L]{$i$}{individual data point over time} \nomenclature[L]{$in$}{Inlet} \nomenclature[L]{$j$}{individual measurement position at one axial position} \nomenclature[L]{$m$}{Mean} \nomenclature[L]{$out$}{Outlet} \nomenclature[L]{$w$}{Wall} \nomenclature[L]{$\infty$}{Infinity} \end{document} I also created one additional TEX file to create nomenclature: TEXFile name(without .tex extension)= latexmkrc add_cus_dep('nlo', 'nls', 0, 'makenomenclature'); sub makenomenclature { system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\""); }

  • How to tweak baseline in the state of chemical substances in chemfig `hreac` environment?
    by Explorer on July 8, 2026 at 8:11 am

    I want to replicate the following: Where (l) for liquid, and (g) for gas, now I have the following code: \documentclass{article} \usepackage[stixtwo]{fontsetup} \usepackage{chemfig} \usepackage{extarrows} \begin{document} \setchemfig{atom sep=1.5em} \hreac \chemfig{CO_2}(g) + \chemfig{[:210]O*3(--(-)-)}(g) % > ${}\xlongequal{\phantom{xxxx}}{}$ % not work with good baseline \chemfig{[:-90]O=*5(-O--(-)-O-)}(l) \endhreac \end{document}

  • How to prevent \setmainfont from affecting \mathbf in LaTeX? [duplicate]
    by Vincent on July 8, 2026 at 8:05 am

    I want to set the main text font to Arial using:\setmainfont{Arial} but I don't want the font used by \mathbf to be affected by Arial. I want \mathbf to keep the original default font. How can I achieve this? The following is my code: \documentclass{ctexart} \usepackage{amsmath,amssymb} \setmainfont{Arial} \begin{document} Hello world! with \verb|\setmainfont{Arial}| $\mathbf{N}_{+}$ \end{document} which gives: Noted that \mathbf also changed the N, which was not I was after, I want the Hello world! to be sans serif with Arial, while the \mathbf{N} gives the default bold N symbol with latinmodernmath.otf, the serif one as below:

  • tex4ht: different math generated for math in array on the HTML than PDF
    by Nasser on July 8, 2026 at 3:59 am

    This MWE \documentclass[12pt,oneside]{book} \usepackage{amsmath} \usepackage{array} \begin{document} \[ \begin {array}{>{\displaystyle }r @{\;} >{\displaystyle }l} y'&=y^{{1}/{3}}\\ y \left (0\right )&=1\\ \end {array} \] \end{document} compiled with lualatex gives But using make4ht -ulm default -a debug B.tex "mathjax,htm" gives The raw html is <!DOCTYPE html> <html lang='en-US' xml:lang='en-US'> <head><title></title> <meta charset='utf-8' /> <meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> <meta content='width=device-width,initial-scale=1' name='viewport' /> <link href='B.css' rel='stylesheet' type='text/css' /> <meta content='B.tex' name='src' /> <script>window.MathJax = { tex: { tags: "ams", }, }; </script> <script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script> </head><body> <div class='mathjax-block'>\[ \begin {array}{&gt;{\displaystyle }r @{\;} &gt;{\displaystyle }l} y'&amp;=y^{{1}/{3}}\\ y \left (0\right )&amp;=1\\ \end {array} \]</div> </body> </html> Is there a way to fix the formatting in HTML so it is like the PDF (i.e. the spacings around the = is off in mathjax) ps. I know I can change the latex. But I have important reason for using \begin {array}{>{\displaystyle }r @{\;} >{\displaystyle }l} instead of say align or something else (too long to explain here, it depends on context I am using this latex code in). This is only a MWE to show the difference. So I do not want to change the latex code. ps. It should be possible to correct this using new mathjax configuration in my .cfg, but I am not sure how. I think I know of only one person who would know how to do this 🙂 Update Here is screen shot showing difference between fonts used by V 3.5 and V 4.0

  • Cleveref custom cross-reference type gets swallowed in presence of amsmath
    by Ben Steffan on July 7, 2026 at 5:51 pm

    I am trying to solve the same problem as the OP of this question, that is, set up some way to distinguish between equations and diagrams in a document and have it automatically be recognized by cleveref. The top answer there works beautifully... that is, as long as you don't load amsmath. If you do load it, then \cref will start referring to diagrams as equations again. For sake of self-containedness, here's an MWE based on that in the linked answer: \documentclass{article} \usepackage{tikz} \usetikzlibrary{cd} %\usepackage{amsmath} \usepackage{hyperref} \usepackage[noabbrev]{cleveref} \newcounter{diagram} \newenvironment{diagram}[1][]{% \begin{equation}% \begin{tikzcd}[#1]% \setcounter{diagram}{\value{equation}}% \addtocounter{diagram}{-1}% \refstepcounter{diagram}% }{% \end{tikzcd}% \end{equation}% } \crefname{diagram}{diagram}{diagrams} \creflabelformat{diagram}{(#2#1#3)} \begin{document} \begin{diagram}\label{diag:a} A \ar[r] & B \end{diagram} The above is \cref{diag:a}. \end{document} This produces the diagram together with "The above is diagram (1).", as desired. If you uncomment line 5, it instead produces the diagram with "The above is equation (1)." I'd be grateful for a solution with a similar use pattern that works in the presence of amsmath. In particular, I'd like to avoid the triple nesting \begin{diagram} \begin{equation} \begin{tikzcd} % ... \end{tikzcd} \end{equation} \end{diagram} that is common to the other answers at the linked question, if possible.

  • Vertically center cells in tabularray [duplicate]
    by Thomas on July 7, 2026 at 12:19 pm

    I'm trying to display three logos for the first slide of a presentation, that have various sizes and dimensions. I'm trying to align them vertically, but I do not manage to set the option of my tblr environment right. I found a silimar question on this forum, but the solution proposed (vertically center the last column only) is not working in my case. The example of this previous topic works well, but when I try to use it with my images, the other cells are no longer vertically centered but aligned at the bottom... Here is a MWE, I my beamer I use \includegraphics instead of the TikZ macros here, but the results is the same. \documentclass{article} \usepackage{tikz} \usepackage{tabularray} \newcommand{\logoA}{\tikz \draw [fill=red!50] (0,0) rectangle (2,1);} \newcommand{\logoB}{\tikz \draw [fill=blue!50!yellow] (0,0) rectangle (3,1);} \newcommand{\logoC}{\tikz \draw [fill=green!50] (0,0) circle (1.2cm);} \begin{document} \begin{tblr}{colspec = {Q[c,m]Q[c,m]Q[c,m]}} \hline \logoA & \logoB & \logoC \\ \hline % hline only for visualize the border of the table \end{tblr} \end{document}

  • `\lastpagenumber` is off by one [closed]
    by guemax on July 7, 2026 at 7:32 am

    I noticed that the \lastpagenumber is always one higher than the actual amount of pages (for example, showing 2 in a one page PDF instead of 1). It does not depend on the number of pages, I have seen this in one, two and three page PDFs. This is my MWE: \setuppagenumbering[location=,] \starttext Current: \pagenumber \\ Last: \lastpagenumber \stoptext This also applies to \totalnumberofpages, \lastpage. My version is 2026.02.19 11:49. Thanks in advance!

  • Left indices for atoms
    by Brasil on July 6, 2026 at 10:03 pm

    Is it possible to right align the left upper and lower indices that characterize atomic properties using \chemfig? Example: \chemfig{^{14}_6C} prints out the following: However, I would like to have the following: How to get it? EDIT: adding a MWE \documentclass[border=1mm]{standalone} \usepackage{chemfig} \begin{document} \chemfig{^{14}_6C} \end{document}

  • Simplest way to fill format text using a loop, preferably using built in loops?
    by scribe on July 6, 2026 at 9:29 pm

    Here is what I want to do in LaTeX but in Python, data = [ ('path/to/file1', 'Caption for file1.', 'fig:label1'), ('path/to/file2', 'Caption for file2.', 'fig:label2'), ('path/to/file3', 'Caption for file3.', 'fig:label3'), ('path/to/file4', 'Caption for file4.', 'fig:label4') ] for entry in data: print( f'\\begin{{figure}}[htbp]\n\ \\centering\n\ \\includegraphics[width=0.8\\textwidth]{{{entry[0]}}}\n\ \\caption{{{entry[1]}}}\n\ \\label{{{entry[2]}}}\n\\end{{figure}}' ) This will result in the following text over the console, \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file1} \caption{Caption for file1.} \label{fig:label1} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file2} \caption{Caption for file2.} \label{fig:label2} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file3} \caption{Caption for file3.} \label{fig:label3} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file4} \caption{Caption for file4.} \label{fig:label4} \end{figure} How do I do this but in LaTeX? I know how to run simple loops like shown here: https://www.dickimaw-books.com/latex/admin/html/docsvlist.shtml \newcommand*{\mylist}{Parrot,Canary,Zebra,Arara,Duck}% \makeatletter \@for\thisitem:=\mylist\do{\thisitem. } \makeatother However, I not sure how to run a loop over a list of lists and index the inner list.

  • Heavy bold \mathsf{} in mtpro2
    by Sebastiano on July 6, 2026 at 2:45 pm

    What is the command to use in mtpro2 (here the v. lite https://ctan.org/pkg/mtp2lite) the heavy bold \mathsf{F}? Actually I not remembering this. I have tried with \boldsymbol, \boldmath but nothing. \documentclass{article} \usepackage{amsmath} \usepackage[lite]{mtpro2} \begin{document} $\mathsf{F}\mathbold{\mathsf{F}} \mbf{\mathsf{F}}$ \end{document} I can't use bm package because there is mtpro2. I have seen the pag. 6/7 of the documentation: https://tug.ctan.org/fonts/mtp2lite/texmf/doc/fonts/mtpro2/mtpro2.pdf.

  • Why itemize move upward in the second frame? [duplicate]
    by vi pa on July 6, 2026 at 9:17 am

    \documentclass{beamer} \usepackage{tikz} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame} \begin{itemize} \item why \item itemize \item move \item upwards \item in the second frame? \end{itemize} \end{frame} \begin{frame} \begin{itemize} \item why \item itemize \item move \item upwards \item in the second frame? \end{itemize} \begin{tikzpicture}[remember picture,overlay] \fill (current page.center) circle[radius=.5cm]; \end{tikzpicture} \end{frame} \end{document} tikzpictures with overlay should have no bounding box. Why in the second frame the same itemize of the first frame move upward?

  • Custom enumerate items using item options
    by profj on July 5, 2026 at 9:04 pm

    I'm trying to customize item labels within an enumerate list on the fly, using the item options. However, I don't fully understand how it works. The code below produces unexpected results, and different patterns emerge for the first layer of the list and the second layer of the list. I'm trying to do this without using the enumitem package, if possible. I know how to manually edit the items, but want the counter to be more automated in the inner list. Here is a minimum working example: \documentclass{article} \begin{document} \begin{enumerate} \item[\theenumi.] Why is this 0, instead of 1? \begin{enumerate} \item[\theenumii.] Why is this blank? \item[\theenumii.] Why is this blank? \item[\theenumii.] Why is this blank? \end{enumerate} \item And this adds one to the counter \item And this adds one to the counter \end{enumerate} \begin{enumerate} \setcounter{enumi}{1} \item[\theenumi.] Now this is 1, as expected. \begin{enumerate} \setcounter{enumii}{1} \item[\theenumii.] And this is a, as expected. \item[\theenumii.] Why doesn't this add one to the counter? \item[\theenumii.] Why doesn't this add one to the counter? \end{enumerate} \item And why does this still add one to the counter? \item And why does this still add one to the counter? \end{enumerate} \end{document} Here's the output:

  • PDF Type 6 shadings: How to properly build them using TeX?
    by Jasper Habicht on July 5, 2026 at 8:19 pm

    This question might be off-topic, but the reason I ask it here is that I want to eventually create a module for a LaTeX package to enable the use of conic gradients via PDF Type 6 shadings which are also known as Coons Patch Mash Tiling. Also, please do not read this as "fix my issue for me" question. Rather, I appreciate any pointers to where I could be wrong. I understand that this topic is highly specialised, so I don't expect anybody to actually fix it completely or even partially. Now, as far as I understand, such shadings are essentially encoded as object stream in a PDF with the following object structure as basis (of course the object number and the contents of the stream and its length are different in a real document): 1 0 obj << /ShadingType 6 /ColorSpace /DeviceRGB /BitsPerCoordinate 16 /BitsPerComponent 8 /BitsPerFlag 2 /Decode [ 0 100 0 100 0 1 0 1 0 1 ] /Length 0 >> stream 00... endstream The stream defines the patches. Each path can be thought of a (distorted) rectangle of which the four sides are described as cubic Bézier curves. Therefore, each of the four edges of the patch has four control points, which means that there are twelve such points needed to describe a patch. Also, each corner of the patch is assigned a color. Now, in a mesh, the patches are attached to each other so that they share a common edge. To identify the shared edge, a flag is added to each patch which describes which edge is shared. A 0 flag identifies the initial patch, a 1 flag means that the right edge of the previous patch is used as the left edge of the current patch. There are more flags, but we only need these two for this case. If edges are shared, the relevant control points and colors are omitted in the description of the patch in the stream. So, if we take the sizes as described by /BitsPerCoordinate, \BitsPerComponent and /BitsPerFlag (let us assume 16, 8, and 2 respectively, also let us assume RGB), we get the following binary representation of the a patch with flag 0: Flag: 2 bits Points: 12 points, 16 bits for the x coordinate, 16 bits for the y coordinate Colors: 4 colors, 8 bits for the red part, 8 bits for the green part, 8 bits for the blue part For a patch with flag 1, we get: Flag: 2 bits Points: 8 points, 16 bits for the x coordinate, 16 bits for the y coordinate Colors: 2 colors, 8 bits for the red part, 8 bits for the green part, 8 bits for the blue part Maybe I got something wrong here already, which might explain why things don't work. Anyways, my question is why the following does not result in the desired output. My idea for a conic shading was to create patches that look like slices of a pie. Like this: I first tried without the rounded edge and just set the control points to be equal to the relevant corner, hoping that this would result in a triangle-shaped rectangle. So my patches would adhere to the following logic: Patch 1: Flag = 0 Points: (50, 50) (50, 50) (100, 50) (100, 50) (100, 50) (50, 100) (50, 100) (50, 100) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (255,0,0) (191,0,64) (191,0,64) (255,0,0) Patch 2: Flag = 1 Points: (50, 100) (0, 50) (0, 50) (0, 50) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (128,0,128) (128,0,128) Patch 3: Flag = 1 Points: (0, 50) (50, 0) (50, 0) (50, 0) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (64,0,191) (64,0,191) Patch 4: Flag = 1 Points (50, 0) (100, 50) (100, 50) (100, 50) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (0,0,255) (0,0,255) But, the output is totally not what it should look like although I think that the stream is correct. Acrobat also complains about something being wrong. It looks like this: 21 0 obj << /ShadingType 6 /ColorSpace /DeviceRGB /BitsPerCoordinate 16 /BitsPerComponent 8 /BitsPerFlag 2 /Decode [ 0 100 0 100 0 1 0 1 0 1 ] /Length 350 >> stream 20002000200020003FFFE0003FFFE0003FFFE00020003FFFE0003FFFE0003FFFE00020002000200020002000200020003FC0002FC0102FC0103FC00018000FFFF00008000000080000000800080008000800080008000800080008000800080800080400020002000000020000000200000002000200020002000200020002000200010002FD0002FD80000000FFFF8000FFFF8000FFFF8000800080008000800080008000800080000000FF0000FF endstream endobj So, my question is: What am I missing? Where is the probably simple but basic problem? The following is an MWE intended for testing. It contains a few helper funcitons and the relevant functions from the package where the code eventually is supposed to be included. It should work with PDFLaTeX and LuaLaTeX: \DocumentMetadata{uncompress} \documentclass[]{article} \usepackage{l3draw} \ExplSyntaxOn % a few helper functions \cs_new:Npn \__hawkdraw_tuple_use_i:w ( #1 , #2 ) {#1} \cs_new:Npn \hawkdraw_tuple_use_i:n #1 { \fp_to_dim:n { \exp_last_unbraced:Ne \__hawkdraw_tuple_use_i:w { \fp_eval:n {#1} } } } \cs_new:Npn \__hawkdraw_tuple_use_ii:w ( #1 , #2 ) {#2} \cs_new:Npn \hawkdraw_tuple_use_ii:n #1 { \fp_to_dim:n { \exp_last_unbraced:Ne \__hawkdraw_tuple_use_ii:w { \fp_eval:n {#1} } } } \cs_new_protected:Npn \hawkdraw_support_pdfliteral:n #1 { \sys_if_engine_luatex:TF { \tex_pdfextension:D literal {#1} } { \tex_pdfliteral:D {#1} } } \cs_new_protected:Npn \hawkdraw_support_pdfxform:nnN #1#2#3 { \tex_immediate:D \tex_pdfxform:D \tl_if_empty:nF {#1} { attr {#1} } resources {#2} #3 } \cs_new_protected:Npn \hawkdraw_support_pdflastxform: { \tex_pdflastxform:D } \cs_new_protected:Npn \hawkdraw_support_pdfrefxform:N #1 { \tex_pdfrefxform:D \int_use:N #1 \scan_stop: } \cs_generate_variant:Nn \hawkdraw_support_pdfrefxform:N { c } % === % relevant code from the package \box_new:N \l__hawkdraw_shading_object_box \cs_new_protected:Npn \hawkdraw_shading_set:nnn #1#2#3 { \hbox_set_to_wd:Nnn \l__hawkdraw_shading_object_box { 100bp } { \vbox_to_ht:nn { 100bp } { \skip_vertical:n { 0pt plus 1fil } \hawkdraw_support_pdfliteral:n { /Sh ~ sh } } \skip_horizontal:n { 0pt plus 1fil } } \pdf_object_new:n { hawkdraw_shading_ #1 } \tl_if_empty:nTF {#3} { \pdf_object_write:nne { hawkdraw_shading_ #1 } { dict } { #2 } } { \pdf_object_write:nne { hawkdraw_shading_ #1 } { stream } { {#2} {#3} } } \hawkdraw_support_pdfxform:nnN { } { /Shading ~ << ~ /Sh ~ \pdf_object_ref:n { hawkdraw_shading_ #1 } ~ >> } \l__hawkdraw_shading_object_box \int_const:cn { c__hawkdraw_shading_ #1 _int } { \hawkdraw_support_pdflastxform: } } \cs_new_protected:Npn \hawkdraw_shading_use:n #1 { \hawkdraw_support_pdfrefxform:c { c__hawkdraw_shading_ #1 _int } } % === \cs_new:Npn \hawkdraw_convert_bin_to_hex:n #1 { \__hawkdraw_convert_bin_to_hex_aux:w #1 \q_stop } \cs_generate_variant:Nn \hawkdraw_convert_bin_to_hex:n { e } \cs_new:Npn \__hawkdraw_convert_bin_to_hex_aux:w #1 \q_stop { \int_compare:nNnF { \tl_count:n {#1} } < { 4 } { \__hawkdraw_convert_bin_to_hex_aux:NNNNw #1 \q_stop } } \cs_new:Npn \__hawkdraw_convert_bin_to_hex_aux:NNNNw #1#2#3#4#5 \q_stop { \int_format:nn { \int_from_bin:n {#1#2#3#4} } { 1X } \__hawkdraw_convert_bin_to_hex_aux:w #5 \q_stop } % === \cs_generate_variant:Nn \color_export:nnN { e } \cs_generate_variant:Nn \str_set_convert:Nnnn { Ne } \seq_new:N \l__hawkdraw_shading_conic_colors_seq \seq_new:N \l__hawkdraw_shading_conic_colors_bin_seq \cs_new_protected:Npn \hawkdraw_shading_conic_stream:N #1 { \tl_set:Ne #1 { \hawkdraw_convert_bin_to_hex:e { \seq_map_indexed_function:NN \l__hawkdraw_shading_conic_colors_bin_seq \__hawkdraw_shading_conic_stream_aux:nn } } } \cs_new:Npn \__hawkdraw_shading_conic_stream_aux:nn #1#2 { % skip first entry representing color at first edge \int_compare:nNnF {#1} = { 1 } { % flag (2 bit) \int_format:nn { \int_compare:nNnTF {#1} = { 2 } { 0 } { 1 } } { 0>2b } % four patches for each of the n colors % patch is pie segment going from 0 to 360 / ( n * 4 ) % points of first patch (12 points, 2 x 16 bits each \int_compare:nNnT {#1} = { 2 } { \prg_replicate:nn { 2 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } } \prg_replicate:nn { 2 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } } } \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } \prg_replicate:nn { 3 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 1 ) } } \prg_replicate:nn { 3 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 1 ) } } \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } % colors (4 colors, 3 x 8 bits each) \int_compare:nNnT {#1} = { 2 } { \seq_item:Nn \l__hawkdraw_shading_conic_colors_bin_seq { #1 - 1 } } #2 #2 \int_compare:nNnT {#1} = { 2 } { \seq_item:Nn \l__hawkdraw_shading_conic_colors_bin_seq { #1 - 1 } } } } \cs_new:Npn \__hawkdraw_shading_conic_stream_point_polar:nn #1#2 { % get from point polar % normalize to 65535 \int_format:nn { \fp_to_int:n { \hawkdraw_tuple_use_i:n { ( 50bp , 50bp ) + ( \draw_point_polar:nn { #1 * 50bp } {#2} ) } / 100bp * 65535 } } { 0>16b } \int_format:nn { \fp_to_int:n { \hawkdraw_tuple_use_ii:n { ( 50bp , 50bp ) + ( \draw_point_polar:nn { #1 * 50bp } {#2} ) } / 100bp * 65535 } } { 0>16b } } \cs_new_protected:Npn \__hawkdraw_shading_color_set_bin_value:n #1 { \seq_put_right:Ne \l__hawkdraw_shading_conic_colors_bin_seq { \int_format:nn { \int_from_hex:n {#1} } { 0>24b } } } \cs_generate_variant:Nn \__hawkdraw_shading_color_set_bin_value:n { V } % start , % start!25!mid , start!50!mid , start!75!mid , mid , % mid!25!end , mid!50!end , mid!75!end , end \cs_new_protected:Npn \hawkdraw_shading_color_set_bin_values:n #1 { \seq_clear:N \l__hawkdraw_shading_conic_colors_bin_seq \seq_set_from_clist:Nn \l__hawkdraw_shading_conic_colors_seq {#1} \seq_map_indexed_inline:Nn \l__hawkdraw_shading_conic_colors_seq { \int_compare:nNnTF {##1} = { 1 } { \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { 1 } } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl } { \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 75 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 50 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 25 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl } } } \cs_new_protected:Npn \hawkdraw_shading_conic:n #1 { \int_if_exist:cF { c__hawkdraw_shading_ conic . #1 _int } { \hawkdraw_shading_color_set_bin_values:n {#1} \hawkdraw_shading_conic_stream:N \l_tmpa_tl \hawkdraw_shading_set:nnn { conic . #1 } { /ShadingType ~ 6 ~ /ColorSpace ~ /DeviceRGB ~ /BitsPerCoordinate ~ 16 ~ /BitsPerComponent ~ 8 ~ /BitsPerFlag ~ 2 ~ /Decode ~ [ ~ 0 ~ 100 ~ % x 0 ~ 100 ~ % y 0 ~ 1 ~ % R 0 ~ 1 ~ % G 0 ~ 1 ~ % B ] ~ } { \tl_use:N \l_tmpa_tl } } } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \hawkdraw_shading_conic:n { red , blue } \hbox_set:Nn \l_tmpa_box { \hawkdraw_shading_use:n { conic.red,blue } } \box_use:N \l_tmpa_box \ExplSyntaxOff \end{document}

  • French text in superscript
    by Phil8544 on July 5, 2026 at 4:08 pm

    What package I have to use if I want to get French text in superscript? I want to write "57ème croche sur 92" with the term "ème" in superscript.

  • How can I format the total value of a counter (as printed by `total` from totcount)?
    by modallyFragile on July 5, 2026 at 12:36 pm

    I use countwords to count the number of words in some LaTeX documents. The package counts words into a standard LaTeX counter. I then use totcount to display this wordcount at the beginning of the document. The number is generally in the thousands. Totcount provides a single macro \total{<counter>} for printing the eventual value of a counter, but it doesn't do any intelligent formatting, like dividing thousands with a comma/space (and fair enough -- very few situations call for counters in the thousands!). I would like to print the eventual value of the counter at the beginning of the document in a nicely formatted way. How can I do this? Based on other discussions of formatting counters, I have tried using numprint and siunitx, but neither of these work -- MWEs below. TIA! Failure #1 numprint \documentclass{article} \title{Foobar} % For counting words \usepackage{countwords} \newcounter{words} \setcounter{words}{0} % For printing final value \usepackage{totcount} \regtotcounter{words} % For dummy text \usepackage{lipsum} \usepackage{numprint} \begin{document} \maketitle % Prints `1112' (no comma) \total{words} % `Should' print `1,112', but gives an error. \numprint{\total{words}} \countwordsstart{words} \lipsum[1-12] \countwordsstop{words} \end{document} I get an error: ./test.tex:27: Package numprint Error: Invalid characters `\def ' in mandatory argument of (numprint) \numprint. Allowed are (numprint) `0123456789.,eEdD+-\pm '. Failure #2 siunitx \documentclass{article} \title{Foobar} % For counting words \usepackage{countwords} \newcounter{words} \setcounter{words}{0} % For printing final value \usepackage{totcount} \regtotcounter{words} % For dummy text \usepackage{lipsum} \usepackage{siunitx} \begin{document} \maketitle % Prints `1112' (no comma) \total{words} % `Should' print `1,112', but gives an error. \num[group-separator={,}]{\total{words}} \countwordsstart{words} \lipsum[1-12] \countwordsstop{words} \end{document} I get an error: ./test.tex:27: Package siunitx Error: Invalid number '\def \c@words@totc {\c@words@totc (siunitx) }1112'. I also looked at fmtcount but found it doesn't cover thousands separators.

  • Spacing of `\hline`
    by zgrizz on July 4, 2026 at 10:46 pm

    I'm wondering why columns in tabular seem to not add space but \hline does. Is there a way to make it so that everything overlaps? \documentclass{article} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \setlength{\tabcolsep}{0pt} \begin{document} Line\\ Line \vspace*{-2\baselineskip} \begin{tabular}{|l|} \hline Line\\ \hline Line\\ \hline \end{tabular}%\par\prevdepth=\dp\strutbox \vspace*{-2\baselineskip} Line\\ Line \end{document} EDIT: Thank you to all who answered. Using David Carlisle's comment, I now have the below: \documentclass{article} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \setlength{\tabcolsep}{0pt} \setlength{\lineskip}{0pt} \begin{document} \def\newhline{% \noalign{\kern-.5\arrayrulewidth}\hline\noalign{\kern-.5\arrayrulewidth}% } Line\\ Line \vspace*{-2\baselineskip} \begin{tabular}[t]{|l|} \newhline % <- causing problems Line\\ \newhline Line\\ \newhline \end{tabular}\par\prevdepth=\dp\strutbox % for overlap \vspace*{-2\baselineskip} Line\\ Line \end{document} Seems the top \newhline prevents everything from lining up.

  • Adjusting a tikz picture
    by Joao Paulo Guardieiro on July 4, 2026 at 1:59 pm

    I want to draw the graph of z = x^2 + y^2, and I am using tikz for that. I used the following command: \begin{tikzpicture}[ x={(1cm,0cm)}, y={(-0.6cm,-0.35cm)}, z={(0cm,1cm)}, line join=round, line cap=round, scale=1, ] % Axes \draw[->] (0,0,0) -- (2,0,0); \draw[->] (0,0,0) -- (0,2.5,0); \draw[->] (0,0,0) -- (0,0,4); % Graph \draw[thick,smooth,variable=\t,domain=-1.8:1.8] plot ({\t},{0},{\t*\t}); % Circle that gives a 3d impression \draw[thick,smooth,variable=\t,domain=0:360] plot ({1.8*sin(\t)},{1.8*cos(\t)},{3.24}); \end{tikzpicture} However, the circle does not "fit" the graph: How can I adjust this?

  • Is there today 2026 any use case for dvi files other than creating html and that like with tex4ht?
    by user2609605 on July 3, 2026 at 10:33 pm

    I am aware for creating historical documents, the DVI format is still in use. And there is still tex4ht, as far as I know the only way to convert latex to HTML offered in TeXlive, but, apart from this, is there any use case for the DVI format? Maybe another package relying on it. I ask because i maintain a kind of build tool (very roughly comparable with latexmk) and ask myself on the details of supporting the dvi format.

  • Asymptote Light Rendering with a Unit Cube
    by LuckElixir on July 3, 2026 at 9:44 pm

    I'm having trouble understanding Asymptote's (3.11) light rendering. When I run this code below: import three; size(8cm); currentprojection = orthographic((5,4,2), up=Y); currentlight = light(new pen[]{white}, new triple[]{(1,1,1)}); draw(unitcube, surfacepen=material(cyan)); real L = 2; draw(O--L*X, Arrow3); draw(O--L*Y, Arrow3); draw(O--L*Z, Arrow3); label("$x$", L*X, E); label("$y$", L*Y, N); label("$z$", L*Z, Z); I expected it to light up the whole cube (from my viewpoint; I understand the backside might not be lit). However, I instead got this: The left side of the cube is completely dark, which does not make sense considering the unit cube should essentially be lit with the placement of the light. However, changing the perspective to (5, 4, -2) yields this: The side that's pitch black here is the side that was initially lit in the first image. Considering there was no change to the light's position, I did not expect this to happen. I experimented with the emissive argument, however that is not what I wish to do. How does the lighting actually work in asymptote, and how do I fully illuminate all three sides of the cube, using the initial orthographic projection?

  • latexml: how to remove ( ) around \date{\today} in title?
    by Nasser on July 3, 2026 at 8:01 pm

    I've been working with google AI on this for 2 hrs. It can't figure a solution. One time it gave me 100 lines javascript code to fix this. Then it gave 50 lines .css code which made the date vanish. Here is MWE \documentclass[12pt]{article} \usepackage{latexml} \begin{document} \title{my book} \author{me} \date{\today} \maketitle \tableofcontents \section{first section} text \end{document} latexml always adds () around the date for some reason: How to tell it not to do that? commands used >latexml --dest=A.xml A.tex >latexmlpost --format=html5 --dest=A.htm A.xml

  • How to redefine amsmath's implicit-base logarithm operator (\log) according to typesetting conventions whenever it's not followed by a subscript?
    by Nyx on July 3, 2026 at 1:36 pm

    The following is my MWE: \documentclass{article} \usepackage{mathtools} % Loads amsmath and defines \shortintertext % Logarithms \DeclareMathOperator{\lb}{lb} \NewCommandCopy{\oldlog}{\log} \newcommand*{\implicitbaselog}{% Uncomment only one of the following lines \oldlog % Uncomment to set ambiguous logarithm as default % \lb % Uncomment to set binary logarithm as default % \lg % Uncomment to set common logarithm as default % \ln % Uncomment to set natural logarithm as default } \newcommand*{\useambiguouslog}{\renewcommand*{\implicitbaselog}{\oldlog}} \newcommand*{\usebinarylog}{\renewcommand*{\implicitbaselog}{\lb}} \newcommand*{\usecommonlog}{\renewcommand*{\implicitbaselog}{\lg}} \newcommand*{\usenaturallog}{\renewcommand*{\implicitbaselog}{\ln}} \RenewDocumentCommand{\log}{e{_}}{ \IfNoValueTF{#1}{\implicitbaselog}{\oldlog_{#1}} } \begin{document} \begin{alignat*}{4} \shortintertext{With default definition of \texttt{\textbackslash implicitbaselog}: } \log x &= \oldlog x, && && && \\ \shortintertext{after \texttt{\textbackslash usebinarylog}: } \usebinarylog \log x &= \lb x \; &&\text{ and } && \; \log_3 x &&= \oldlog_3 x, \\ \shortintertext{after \texttt{\textbackslash usecommonlog}: } \usecommonlog \log x &= \lg x \; &&\text{ and } && \; \log_4 x &&= \oldlog_4 x, \\ \shortintertext{after \texttt{\textbackslash usenaturallog}: } \usenaturallog \log x &= \ln x \; &&\text{ and } && \; \log_5 x &&= \oldlog_5 x, \\ \shortintertext{after \texttt{\textbackslash useambiguouslog}: } \useambiguouslog \log x &= \oldlog x \; &&\text{ and } && \; \log_6 x &&= \oldlog_6 x. \end{alignat*} \end{document} Essentially, I would like to simply use \useambiguouslog, \usebinarylog, \usecommonlog, and \usenaturallog to change how \log is typeset in the document whenever it is not followed by a subscript indicating a specific base. Is there a way to improve my solution? Thank you in advance.

  • context: Workaround for context not generating a valid XML file. after
    by Nasser on July 2, 2026 at 8:21 pm

    I am learning context and found this problem below and looking for workaround. Below are two examples where context generates invalid XML EXAMPLE 1 When there is more than ONE paragraph in section, the XML generated is not valid. This works \setupbackend[export=yes, xhtml=yes] \starttext \startsection[title={Introduction}] A \stopsection \stoptext The XML is valid <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- input filename : A processing date : 2026-07-02 15:56:59-05:00 context version : 2026.04.10 18:55 exporter version : 0.36 --> <?xml-stylesheet type="text/css" href="styles/A-defaults.css" ?> <?xml-stylesheet type="text/css" href="styles/A-images.css" ?> <?xml-stylesheet type="text/css" href="styles/A-fonts.css" ?> <?xml-stylesheet type="text/css" href="styles/A-styles.css" ?> <?xml-stylesheet type="text/css" href="styles/A-templates.css" ?> <document context="2026.04.10 18:55" date="2026-07-02 15:56:59-05:00" file="A" language="en" title="A" version="0.36" xml:lang="en"> <section detail="section" chain="section" implicit="1" level="3"> <sectioncaption> <sectionnumber>1</sectionnumber> <sectiontitle>Introduction</sectiontitle> </sectioncaption> <sectioncontent> A </sectioncontent> </section> </document> Adding second paragraph, it now generates bad XML \setupbackend[export=yes, xhtml=yes] \starttext \startsection[title={Introduction}] A B \stopsection \stoptext The XML is <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- input filename : A processing date : 2026-07-02 15:58:06-05:00 context version : 2026.04.10 18:55 exporter version : 0.36 --> <?xml-stylesheet type="text/css" href="styles/A-defaults.css" ?> <?xml-stylesheet type="text/css" href="styles/A-images.css" ?> <?xml-stylesheet type="text/css" href="styles/A-fonts.css" ?> <?xml-stylesheet type="text/css" href="styles/A-styles.css" ?> <?xml-stylesheet type="text/css" href="styles/A-templates.css" ?> <document context="2026.04.10 18:55" date="2026-07-02 15:58:06-05:00" file="A" language="en" title="A" version="0.36" xml:lang="en"> <section detail="section" chain="section" implicit="1" level="3"> <sectioncaption> <sectionnumber>1</sectionnumber> <sectiontitle>Introduction</sectiontitle> </sectioncaption> <sectioncontent> A <break/> B </sectioncontent> </section> </document> <break/> Notice the break is inserted after end of document. This gives error with xsltproc >xsltproc transform.xsl A-export/A-raw.xml > A.htm A-export/A-raw.xml:29: parser error : Extra content at the end of the document <break/> ^ unable to parse A-export/A-raw.xml EXAMPLE 2 When using \startalignment there is extra break after document: \setupbackend[export=yes, xhtml=yes] \starttext \startalignment[middle] \setupblank[big] {\definedfont[SerifBold at 24pt]\setupinterlinespace[line=58pt] the title} \blank[medium] {\tfa m} \blank[medium] {\tfa \currentdate} \stopalignment \stoptext The XML generated also has a break after document ends: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!-- input filename : A processing date : 2026-07-02 16:15:24-05:00 context version : 2026.04.10 18:55 exporter version : 0.36 --> <?xml-stylesheet type="text/css" href="styles/A-defaults.css" ?> <?xml-stylesheet type="text/css" href="styles/A-images.css" ?> <?xml-stylesheet type="text/css" href="styles/A-fonts.css" ?> <?xml-stylesheet type="text/css" href="styles/A-styles.css" ?> <?xml-stylesheet type="text/css" href="styles/A-templates.css" ?> <document context="2026.04.10 18:55" date="2026-07-02 16:15:24-05:00" file="A" language="en" title="A" version="0.36" xml:lang="en"> the title <break/> m <break/> July 2, 2026</document> <break/> Is there a workaround? TL 2026

  • Incorrect spacing around digits with newpx and tagged PDFs
    by user444613 on July 2, 2026 at 2:29 pm

    Turning on LaTeX3’s experimental Tagged PDF support with the newpx fonts sometimes causes spacing between characters to be incorrect, especially when there are digits next to commas. Am I doing something wrong, or is there a workaround? The LaTex3 Project’s tagging status page lists newpx as compatible with tagging. The problem disappears if either tagging is turned off or if a different typeface (e.g. Computer Modern) is used. I am using TeXLive 2026 with pdftex. Minimal example: \DocumentMetadata{tagging=on} \documentclass{article} \usepackage{newpx} \listfiles \begin{document} \((1,2)_3\) \begin{tabular}{cccc} \((1,2)_3\) \\ \(J\) & \((1,2)_3\) \end{tabular} \end{document} Further technical info (output with \listfiles): This is pdfTeX, Version 3.141592653-2.6-1.40.29 (TeX Live 2026/Debian) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./example.tex LaTeX2e <2025-11-01> L3 programming layer <2026-05-15> (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/documentmetadata-support.ltx (/usr/share/texlive/texmf-dist/tex/latex/pdfmanagement/pdfmanagement-testphase. sty (/usr/share/texlive/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty) (/usr/share/texlive/texmf-dist/tex/latex/pdfmanagement/pdfmanagement.ltx))) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (/usr/share/texlive/texmf-dist/tex/latex/pdfmanagement/l3backend-testphase-pdft ex.def) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-latest.s ty (/usr/share/texlive/texmf-dist/tex/latex/tagpdf/tagpdf.sty (/usr/share/texlive/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-names.st y) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-2 .sty (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-footnotes.ltx )) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.st y (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-kernel-changes.sty (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/glyphtounicode-cmex.tex)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-context. sty)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-sec.sty) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-toc.sty ) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-minipage .sty (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-1 .sty)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-graphic. sty) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-float.st y) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-bib.sty) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-text.sty ) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-marginpa r.sty) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-title.st y) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-table.st y (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-math.sty (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-math.ltx) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-mathpkg.ltx) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-mathintent.ltx)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-firstaid .sty) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-tikz.sty )) (/usr/share/texlive/texmf-dist/tex/latex/pdfmanagement/pdfmanagement-firstaid.s ty) (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (/usr/share/texlive/texmf-dist/tex/latex/newpx/newpx.sty `newpx'v1.551, 2025/10/30 Integrated loading of newpxmath and a text font for all latex engines (msharpe) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/fontaxes/fontaxes.sty (/usr/share/texlive/texmf-dist/tex/latex/figureversions/figureversions.sty)) (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty) (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty) (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/carlisle/scalefnt.sty) (/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty) (/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty)) (/usr/share/texlive/texmf-dist/tex/generic/xstring/xstring.sty (/usr/share/texlive/texmf-dist/tex/generic/xstring/xstring.tex)) IV (/usr/share/texlive/texmf-dist/tex/latex/newpx/newpxmath.sty `newpxmath' v1.551, 2025/10/30 Math macros based on pxfonts (msharpe) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/latex-lab/latex-lab-amsmath.ltx) (/usr/share/texlive/texmf-dist/tex/generic/kastrup/binhex.tex) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex))) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/centernot.sty) amsthm NOT loaded ) (/usr/share/texlive/texmf-dist/tex/latex/newpx/newpxtext.sty `newpxtext' v1.542, 2025/06/07 Text macros taking advantage of TeXGyre Pagella and its extensions (msharpe) (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/newpx/t1minzpl.fd)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def) (/usr/share/texlive/texmf-dist/tex/latex/graphics/mathcolor.ltx)) (/usr/share/texlive/texmf-dist/tex/latex/pdfmanagement/xcolor-patches-tmp-ltx.s ty) (/usr/share/texlive/texmf-dist/tex/latex/xpatch/xpatch.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty) (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty) (/usr/share/texlive/texmf-dist/tex/latex/newpx/t1zpllf.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/t1zpltlf.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/t1zplosf.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/t1zpltosf.fd))) (./example.aux) (/usr/share/texlive/texmf-dist/tex/latex/newpx/omlnpxmi.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/unpxexa.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/lmsnpxsy.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/lmxnpxexx.fd) Info: mathml file example-mathml does not exist Info: mathml file example-luamml-mathml does not exist (/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) LaTeX DocumentMetadata Warning: The language has not been set in (DocumentMetadata) \DocumentMetadata. (DocumentMetadata) Setting it to 'en' as fallback. (/usr/share/texlive/texmf-dist/tex/latex/newpx/ot1minzpl.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/unpxmia.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/unpxsym.fd) (/usr/share/texlive/texmf-dist/tex/latex/newpx/unpxsyc.fd) [1{/var/lib/texmf/fo nts/map/pdftex/updmap/pdftex.map}{/usr/share/texlive/texmf-dist/fonts/enc/dvips /newpx/px-lms.enc}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/newtx/ntx-ot1- tlf.enc}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/newtx/ntx-ec-tlf.enc}]<< latex-list-css.html>><<latex-align-css.html>> (./example.aux) *File List* documentmetadata-support.ltx pdfmanagement-testphase.sty 2026-05-26 v0.97c LaTeX PDF management bundle tagpdf-base.sty 2026-05-17 v1.0c part of tagpdf - provide base, no-op versio ns of the user commands pdfmanagement.ltx 2026-05-26 v0.97c PDF management code l3backend-pdftex.def 2026-02-18 L3 backend support: PDF output (pdfTeX) l3backend-testphase-pdftex.def latex-lab-testphase-latest.sty 2025-09-13 v0.1d latex-lab modules tagpdf.sty 2026-05-17 v1.0c LaTeX kernel code for PDF tagging tagpdf-mc-code-generic.sty 2026-05-17 v1.0c part of tagpdf - code related to marking chunks - generic mode latex-lab-testphase-names.sty 2025-08-14 v0.8f Code related to the names of tags latex-lab-testphase-new-or-2.sty 2025-05-10 v0.86d Changes to the output rou tine latex-lab-footnotes.ltx 2025-07-04 v0.8o changes to the footnote interfaces latex-lab-testphase-block.sty 2025-07-26 v0.9k blockenv implementation latex-lab-kernel-changes.sty 2025-07-09 v0.85i General kernel and class chan ges glyphtounicode-cmex.tex latex-lab-testphase-context.sty 2025-10-09 v0.5b Providing context for insta nce, etc. latex-lab-testphase-sec.sty 2025-10-20 v0.84k Code related to the tagging of sectioning commands latex-lab-testphase-toc.sty 2025-07-02 v0.85h Code related to the tagging o f toc-like lists latex-lab-testphase-minipage.sty 2025-05-10 v0.81g Code related to the taggi ng of minipages and parboxes latex-lab-testphase-new-or-1.sty 2025-05-10 v0.85d Temporary output patches for tagging and better link support -- no longer active latex-lab-testphase-graphic.sty 2025-09-25 v0.80i Code related to the taggin g of graphics latex-lab-testphase-float.sty 2025-10-17 v0.81l Code related to the tagging of floats latex-lab-testphase-bib.sty 2025-05-09 v0.81c Code related to the tagging of bibliography and cite command latex-lab-testphase-text.sty 2025-05-10 v0.85f Code related to the tagging o f various small text commands latex-lab-testphase-marginpar.sty 2025-07-23 v0.85h Changes related to the t agging of the margin notes latex-lab-testphase-title.sty 2025-03-08 v0.85d Changes related to the taggi ng of the title latex-lab-testphase-table.sty 2025-08-01 v0.85s Code related to the tagging of tables array.sty 2025/09/25 v2.6n Tabular extension package (FMi) latex-lab-testphase-math.sty 2025-03-10 v0.8d code related to the math taggi ng latex-lab-math.ltx 2025-10-02 v0.6w Grab all the math(s) and tag it (experim ents) latex-lab-mathpkg.ltx 2025-06-20 v0.1c mathpkg adaptions latex-lab-mathintent.ltx 2025-08-03 v0.1c MathML intent attributes latex-lab-testphase-firstaid.sty 2025-11-03 v2025-11-03 Temporary patches to external packages needed for the tagging project latex-lab-testphase-tikz.sty 2025-09-27 v0.80d Code related to the tagging o f tikz pictures pdfmanagement-firstaid.sty 2026-05-26 v0.97c LaTeX PDF management bundle / f irstaid-patches article.cls 2025/01/22 v1.4n Standard LaTeX document class size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) newpx.sty 2025/10/30 v1.551 LaTeX and unicode LaTeX support for newpxmath and newpxtext, or for newpxtext and an otf math package (Michael Sharpe) fontenc.sty 2025/07/18 v2.1d Standard LaTeX package fontaxes.sty 2026-01-02 v2.0.2 Font selection axes (deprecated) figureversions.sty 2025-04-29 v1.0.1 Figure versions ifthen.sty 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC) iftex.sty 2024/12/12 v1.0g TeX engine tests etoolbox.sty 2025/10/02 v2.5m e-TeX tools for LaTeX (JAW) scalefnt.sty trimspaces.sty 2009/09/17 v1.1 Trim spaces around a token list kvoptions.sty 2022-06-15 v3.15 Key value format for package options (HO) keyval.sty 2022/05/29 v1.15 key=value parser (DPC) ltxcmds.sty 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) kvsetkeys.sty 2022-10-05 v1.19 Key value parser (HO) xstring.sty 2023/08/22 v1.86 String manipulations (CT) newpxmath.sty 2025/10/30 v1.551 LaTeX math support for newpx (Michael Sharpe ) amsmath.sty 2025/07/09 v2.17z AMS math features amstext.sty 2024/11/17 v2.01 AMS text amsgen.sty 1999/11/30 v2.0 generic functions amsbsy.sty 1999/11/29 v1.2d Bold Symbols amsopn.sty 2022/04/08 v2.04 operator names latex-lab-amsmath.ltx 2025-09-29 v0.1i amsmath adaptions binhex.tex xkeyval.sty 2025/11/04 v2.10 package option processing (HA) xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) centernot.sty 2016/05/16 v1.4 Centers the not symbol horizontally (HO) newpxtext.sty 2025/06/07 v1.542 LaTeX and unicode LaTeX support for TeXGyreP agellaX (Michael Sharpe) fontenc.sty 2025/07/18 v2.1d Standard LaTeX package t1minzpl.fd 2021/05/25 v1.0 font definition file for T1/minzpl/TLF xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration pdftex.def 2025/09/29 v1.2d Graphics/color driver for pdftex mathcolor.ltx xcolor-patches-tmp-ltx.sty 2026-05-26 v0.97c patch xcolor for l3color xpatch.sty 2020/03/25 v0.3a Extending etoolbox patching commands expl3.sty 2026-05-15 L3 programming layer (loader) xparse.sty 2025-10-09 L3 Experimental document command parser textcomp.sty 2024/04/24 v2.1b Standard LaTeX package t1zpllf.fd 2021/05/25 v1.0 font definition file for T1/zpl/lf t1zpltlf.fd 2021/05/25 v1.0 font definition file for T1/zpl/tlf t1zplosf.fd 2021/05/25 v1.0 font definition file for T1/zpl/osf t1zpltosf.fd 2021/05/25 v1.0 font definition file for T1/zpl/tosf omlnpxmi.fd 2013/03/21 Fontinst v1.933 font definitions for OML/npxmi. unpxexa.fd 2013/03/24 Fontinst v1.933 font definitions for U/npxexa. lmsnpxsy.fd 2016/07/04 Fontinst v1.933 font definitions for LMS/npxsy. lmxnpxexx.fd 2016/07/04 Fontinst v1.933 font definitions for LMX/npxexx. supp-pdf.mkii ot1minzpl.fd 2021/05/25 v1.0 font definition file for OT1/minzpl/TLF unpxmia.fd 2013/03/24 Fontinst v1.933 font definitions for U/npxmia. unpxsym.fd 2023/08/16 Fontinst v1.933 font definitions for U/npxsym. unpxsyc.fd 2013/03/24 Fontinst v1.933 font definitions for U/npxsyc. *********** LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. Package tagpdf Info: Finalizing the tagging structure: (tagpdf) Writing out ~24 structure objects (tagpdf) with ~21 '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 )</usr/share/texlive/texmf-dist/fonts/type1/public/newpx/NewPXMI.pfb></usr/sha re/texlive/texmf-dist/fonts/type1/public/newpx/pxsys.pfb></usr/share/texlive/te xmf-dist/fonts/type1/public/newpx/zplr.pfb> Output written on example.pdf (1 page, 50114 bytes). Transcript written on example.log.

  • Strange behavior of custom itemize in marginblock
    by Aviroum on July 2, 2026 at 12:08 pm

    I asked this question before. Puttting this custom itemize in marginblock, I get this: As you can see, vertical lines disappear. Maybe this is the problem? in log : backgrounds > shapes > invalid region for 'tbg:1' %%%%%%%%%%%%%%%%%%%%%% %%% Implementation %%% %%%%%%%%%%%%%%%%%%%%%% %% Define the variables. \definecolor [MyItemizeColor] [red] \definemeasure[MyItemizeOffset] [1em] \definemeasure[MyItemizeThickness][1pt] %% Draw the rule to the left of the items. \definetextbackground[MyItemize][ mp=mpos:region:sideline, location=paragraph, framecolor=MyItemizeColor, rulethickness=\measure{MyItemizeThickness}, frameoffset=\measure{MyItemizeOffset}, ] %% Draw the bullet symbol. \startreusableMPgraphic{MyBullet} path p ; p := unitcircle scaled 5pt ; fill p withcolor white ; draw p withcolor "MyItemizeColor" withpen pencircle scaled \measure{MyItemizeThickness} ; setbounds currentpicture to boundingbox currentpicture leftenlarged ( -0.5bbwidth(currentpicture) + 0.5*\measure{MyItemizeThickness} ) ; \stopreusableMPgraphic \definesymbol[MyBullet][\reuseMPgraphic{MyBullet}] %% Define the itemize environment to use the custom symbol and rule. \defineitemgroup[MyItemize][itemize][ symbol=MyBullet, before={% \godown[0.5\measured{MyItemizeOffset}]% \starttextbackground[MyItemize]% \godown[0.5\measured{MyItemizeOffset}]% }, after={% \godown[0.5\measured{MyItemizeOffset}]% \stoptextbackground% \godown[0.5\measured{MyItemizeOffset}]% }, width=\measure{MyItemizeOffset}, ] \setupmarginblock[location=left,align=flushleft,width=3cm] %\showframe %%%%%%%%%%%%%%%%%%%%% %%% Demonstration %%% %%%%%%%%%%%%%%%%%%%%% \setuppapersize[A4, portrait] \setuplayout[ width=16cm, backspace=4cm, cutspace=1.5cm, leftmargin=3cm, leftmargindistance=4mm, ] %% Demonstration text. \starttext \startmarginblock \startMyItemize \item First item. \item Second item. \item Third item. \item Fourth item. \item Fifth item. \item Next page. \item Seventh item. \item Eighth item. \item Ninth item. \stopMyItemize \stopmarginblock \input ward \startMyItemize \item First item. \item Second item. \item Third item. \item Fourth item. \item Fifth item. \item Next page. \item Seventh item. \item Eighth item. \item Ninth item. \stopMyItemize Text after. \stoptext