Week
- The choice between pdflatex and xelatex, and the use of newcomputermodernby Ho Man-Ho on January 31, 2026 at 9:07 am
It is kind of a short and soft question. Let me provide some background for my question: I am compiling a latex project, which involves a main tex file and more than 100 other tex files with no figures (except for a few simple diagrams) or pictures. The resulting pdf file has more than 600 pages. Initially, I was using pdflatex and newtxtext for font, and to save time for compilation, I put a % for the tex files whenever I am not typing or editing them. However, recently I am more inclined to use NewComputerModern, in particular I like the slightly thicker font. As we know, to use NewComputerModern, we must either use xelatex or lulatex. I chose the former because it seems to be slightly faster than using lulatex, but it is slower than pdflatex. So I ended up spending more time for compliation, especially when I am editing the tex files for the pages of the end of the pdf file. The packages I am using are: amsfonts, amsmath, amscd, amssymb, euscript, amsthm, fancyhdr, pgf, tikz, pgfplots, caption, subcaption, enumitem, thmtools, color, centernot, mathtools, afterpage, amsbsy, systeme, sectsty, multirow, float, tikz-cd, etoolbox, microtype, mathrsfs, fontspec, fncychap, xy, appendix My question is: is there any get around for this problem? I want to minimize the time for compilation while keep looking at NewComputerModern rather than newtxtext. I considered using pdflatex and newtxtext during editing, and xelatex and NewComputerModern right before finish editing. But I think we should be able to do better than this.
- Too much space after primeby bubba on January 30, 2026 at 10:38 am
When I write M'(t) or H''(t) to denote derivatives, I get an unpleasantly large space between the "prime" symbol and the parenthesis. I'm wondering if I perhaps have a corrupted font. Or do people think the output is good and as expected, and my tastes are weird? Second question: what's the best way to fix this? \documentclass{article} \begin{document} $$ \mathbf{M}'(t) = \mathbf{H}''(t) $$ \end{document}
- Make certain item "titles" of enumerate bold textby Roberto Rastapopoulos on January 30, 2026 at 10:06 am
For my homework I would like to make the hand in exercises in bold text, and the practice exercises in normal text. Currently, I have: \documentclass[12pt]{exam} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=Exercise \arabic*.] \item \item \end{enumerate} \end{document} Which results in . But I would like to be able to say something like this: \begin{enumerate}[label=Exercise \arabic*.] \item* \item \end{enumerate} to give . Is there a way to edit the enumerate environment to achieve this in this simple manner?
- Calculate values of standard normal distribution table as macroby cis on January 30, 2026 at 9:18 am
I calc values of the Standard normal table (with 5-digit accuracy). So I wrote a calculation with numerica.sty (using approximate values of the error function). This works so far; if I put in a concrete value like ... [..., x=0.61]. But I would like to have this as a macro, say \sn{<#1>}, for example \sn{0.61} → 0.72907. I tried to put the whole thing into a newcommand, but this seems to be not that easy. I'd like to implement this inside pdflatex, using a package (not Lua, Mathematica, etc.). I've implemented it here using the numerica package because it worked without problems (including the use of the help-variable h, see MWE). However, I'm not sure if numerica is the best choice. The xintexpr package seems promising, but I'm currently unclear on its syntax. In any case: if anyone knows of a better implementation using a different package (e.g., xint.sty), it would be nice too. \documentclass[margin=10mm, varwidth]{standalone} \usepackage{numerica} \begin{document} \section{Test with \texttt{numerica}} \xdef\x{0.61} sn(\x) = \eval*{% 0.5 (2-h \exp( -0.5 x^2 -1.26551223 +1.00002368 h +0.37409196 h^2 +0.09678418 h^3 -0.18628806 h^4 +0.27886807 h^5 -1.13520398 h^6 +1.48851587* h^7 -0.82215223 h^8 +0.17087277 h^9)) }[h=1/(1+0.25*\sqrt{2}*x), x=0.61% cannot use \x here 🙁 ][5] \section{Test with \texttt{xint}} ... ? .... \end{document}
- Diagbox in a table: how to align elements to the right or belowby cis on January 30, 2026 at 6:11 am
Is it possible to configure \diagbox[*]{*}{*} so that the elements to the right or below are aligned? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{diagbox} \begin{document} \begin{tabular}{c | c | *{3}{c}} \hline a & \diagbox{$b$}{$c$} & 0.1 & 0.2 & 0.3 \\ \hline 2 & 0 & 0.1 & 0.2 & 0.3 \\ 2 & 1 & 2.1 & 2.2 & 2.3 \\ 2 & 2 & 4.1 & 4.2 & 4.3 \\ \end{tabular} \end{document}
- Fail to construct spiral gradually with beamer framesby D G on January 30, 2026 at 2:40 am
Objective: The spiral construction is shown gradually. Each iteration is on a separate frame. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{frame}{step by step spiral construction} \begin{tikzpicture} \draw (0,0) foreach \a in {1,...,120} { \only<\a->{ -- ++({10*\a}:{pow(0.99,\a)}) } }; \end{tikzpicture} \end{frame} \end{document} Error: No file test.nav. ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.16 \end{frame} ?
- Fill plot area with rainbow colorsby Brasil on January 29, 2026 at 11:53 pm
I would like to fill the plot area with the rainbow colors. The wavelength of the colors corresponds to the wavelength of the x-axis. I have the MWE example below. It works fine uless for the line \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); How can I fix it, please? \documentclass[tikz, border=1mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \usepackage{color} \begin{document} \begin{tikzpicture} \small \begin{axis}[% width = 70mm, height = 50mm, % grid = both, xmin = 0.41, xmax = 0.73, % xtick = \empty, % xtick distance = 100, ymin = 1.4, ymax = 2.0, ytick distance = 0.2, xlabel = Wavelength ($\mu$m), ylabel = Refractive index, ] %--> FILL PLOT AREA \foreach \wl in {410,...,729}{ \definecolor{tmpcol}{wave}{\wl} \colorlet{mycol}[rgb]{tmpcol} \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); } %--> Borosilicate glass BK7 \addplot[thick, domain=0.41:0.73] {1.5046 + 0.00420/x^2}; \node at (axis cs: 0.7, 1.57) [above]{BK7}; %--> Barium crown glass BaK4 \addplot[thick, domain=0.41:0.73] {1.5690 + 0.00531/x^2}; \node at (axis cs: 0.7, 1.52) [below]{BaK4}; %--> Dense flint glass SF10 \addplot[thick, domain=0.41:0.73] {1.7280 + 0.01342/x^2}; \node at (axis cs: 0.7, 1.745) [above]{SF10}; \end{axis} \end{tikzpicture} \end{document}
- Tagging: Alternative text to symbolby Svend Tveskæg on January 29, 2026 at 7:11 pm
Code Consider the following MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{article} \usepackage{siunitx} \begin{document} Displayed text on screen: \qty{15}{\celsius} Text read by screen reader: My green horse is awesome. \end{document} Question How do I make a screen reader read out, say, "My green horse is awesome." while the displayed text/symbol in the PDF file is the output from, say, \qty{15}{\celsius}?
- Unicode math + LuaLatex issue with fractions in exponentsby MagiicMushroom on January 29, 2026 at 12:45 pm
I am having a bug with Unicode math, where fractions in exponents do not behave well if there are multiple fonts loaded. Here is a MWE demonstration (LuaLatex 2025, replicated locally and on Overleaf): \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath}[version=NCMM] \setmathfont{XITS Math}[range = {}, version = XITS] % edit: the `version = XITS` is not required to replicate the bug \mathversion{NCMM} \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} This results in the following output: From testing, all exponents after the \lim seem to be fixed, though on my larger documents this disgrace of a workaround seems to have no effect. Interestingly, it has something to do with the \mathversion, because \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \setmathfont{XITS Math}[range = {}] \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} Produces two bugged exponents: For context, if I remove the \setmathfont{XITS Math}... line or compile either MWE in XeLaTeX, there is no sizing bug with the exponents. I am not experienced with the internals of Unicode math, this range thing was to solve an issue with \mathcal (see here). Any temporary workaround would be appreciated.
- make datatool sort numericallyby Leo on January 29, 2026 at 11:50 am
I've got a problem with datatool. I already know a little about datatool, but couldn't find any answer in the documentation. The problem is the following: I read a csv file and want to sort the database by a column, which contains numbers (integers in fact, but it could be also real ones). The following mwe illustrates the problem: \documentclass{scrarticle} \begin{filecontents*}{data.csv} A, 20, 15 B, 21, 3 C, 6, 0 \end{filecontents*} \usepackage{datatool} \newcommand{\diff}{} \begin{document} \section*{initial csv} \DTLloaddb[noheader]{data}{data.csv} \DTLdisplaydb{data} \section*{sorted by Column2 (descending)} \DTLsort{Column2=descending}{data} \DTLdisplaydb{data} \section*{add Column4 as difference of C2 and C3} \DTLaddcolumn{data}{Column4} \DTLforeach{data}{ \x=Column2, \y=Column3 }{ \DTLgsub{\diff}{\x}{\y} \DTLappendtorow{Column4}{\diff} } \DTLdisplaydb{data} \section*{Sorted by Column4 (descending)} \DTLsort{Column4=descending}{data} \DTLdisplaydb{data} \end{document} Here the sorting by column 2 works just fine, but the sorting by column 4 doesn't. The logs give a warning, that there is no associated datatype for column 4, so datatool assumes a string and compares by letter. I couldn't find a way to add a datatype to that column (the docs say nothing, or I didn't find it). How can I add a datatype to the column?
- Adjusting text next to a wrapfig environment [closed]by Perch on January 29, 2026 at 10:35 am
Is there a way of getting the text starting from '1.3...' back to its position? This is how I coded it: \begin{wrapfigure}{l}{4cm} \begin{tikzpicture} \draw [thick ,->] (-2,0) -- (2,0); \draw [thick,->] (0,-2) -- (0,2); \draw [thick] (0,0) circle (1.5); \draw[thick,->] (0,0) -- (1.08,1.08); \draw (0.7,0.3) node {$r$}; \end{tikzpicture} \end{wrapfigure} \hspace{-5pt} Tomamos la parametrización de la circunferencia de centro $(0,0)$ y radio $r$ dada por $\alpha: t \in [0,2\pi] \mapsto (r\cos t, r \sin t)$. \\Se tiene que $\alpha'(t) = (-r\sin t,r\cos t)$, así, $$L(\alpha|_{[a,b]}) = \int_0^{2\pi} || \alpha'(t)|| dt = \int_0^{2\pi} \sqrt{(-r \sin t)^2 + (r \cos t)^2}dt = r \int _0^{2\pi}dt = 2\pi r,$$lo que coincide con la intuición. Cabe preguntarse ahora si la longitud depende de nuestra parametrización (que no debería). \subsection{Reparametrización de una curva.} \begin{defi}[]{} Supongamos que tenemos una curva parametrizada $\alpha:I \subset \R \to \R^n$. Se $f: I \subset \R \to I \subset \R$ un difeomorfismo (diferenciable, biyectiva y con inversa diferenciable). Decimos que $\beta:= \alpha \circ f$ es una \textbf{reparametrización } de $\alpha$. \end{defi} Note: the environment 'defi' is a newtcolorbox custom environment.
- Relative placement of horizontal ruleby speech1 on January 29, 2026 at 1:51 am
I want to format a document in latex with horizontal lines under each section heading that start at the beginning of the text and extend to the right margin. I have figured out how to manually space it, but I would like to find a way to get it to adjust based on the text. Here is my example document: \documentclass{article} \usepackage[letterpaper, margin=0.5in]{geometry} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[T1]{fontenc} \usepackage{lipsum} \begin{document} \setlength{\leftskip}{0.5in} \setlength{\rightskip}{0.5in} \centerline{\large \textbf{Section}} \hspace{6.98cm}\rule{10.27cm}{4pt} % how to calculate distance to match text above? \par \lipsum[1] \par \bigskip \centerline{\large \textbf{Additional Section}} \hspace{5.92cm}\rule{11.34cm}{4pt} % same question here \par \lipsum[2-3] \par \bigskip \hrule height 2pt depth 2pt width \textwidth \end{document} I found an example in another question for defining blank space: \-\pseudo{The length of blank space} Is there a way to subtract this length from the full text width to get the hspace width I need? Or is there a better way to solve this problem? I'm new to tex and this is my first time asking a question here, please let me know if more is needed, thanks!
- White space is missing in Chinese typesetting if hyperref package is loadedby W.J on January 29, 2026 at 1:34 am
[cfr: The original question concerned cleveref together with hyperref. Further analysis shows the problem can be reproduced without cleveref.] When I use cleveref and hyperref packages together, the white space between the number label and the following Chinese character is missing, while the output is normal if loading cleveref alone. Here is a MWE which uses xelatex and is compiled in TeXstudio with texlive2024. \documentclass{ctexbook} \usepackage{mathtools} %\usepackage[hidelinks]{hyperref} \usepackage{cleveref} \crefname{figure}{图}{图} \begin{document} \begin{figure}[t] \centering This is a figure! \caption{Text figure.\label{fig}} \end{figure} 结果由\cref{fig}给出, which means the result is shown in Fig. 1. \end{document} The output when loading cleveref package alone is given by However, if loading hyperref package before (necessary condition when loading cleveref and hyperref together), the output is given by which can be seen that the white space is missing. I don't know how to handle this problem. Could someone do me a favor? Thanks a lottt! This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex 2025.7.3) 29 JAN 2026 12:38 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **document.tex (./document.tex LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-02-20> (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexbook.cls (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexbackend.cfg File: ctexbackend.cfg 2022/07/14 v2.5.10 Backend configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty Package: expl3 2024-02-20 L3 programming layer (loader) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def File: l3backend-xetex.def 2024-02-20 L3 backend support: XeTeX \g__graphics_track_int=\count184 \l__pdf_internal_box=\box51 \g__pdf_backend_object_int=\count185 \g__pdf_backend_annotation_int=\count186 \g__pdf_backend_link_int=\count187 )) Document Class: ctexbook 2022/07/14 v2.5.10 Chinese adapter for class book (CTE X) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty Package: ctexhook 2022/07/14 v2.5.10 Document and package hooks (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty Package: ctexpatch 2022/07/14 v2.5.10 Patching commands (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty Package: fix-cm 2020/11/24 v1.1t fixes to LaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file LaTeX Font Info: Redeclaring font encoding TS1 on input line 47. )) \l__ctex_tmp_int=\count188 \l__ctex_tmp_box=\box52 \l__ctex_tmp_dim=\dimen140 \g__ctex_section_depth_int=\count189 \g__ctex_font_size_int=\count190 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg File: ctexopts.cfg 2022/07/14 v2.5.10 Option configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/book.cls Document Class: book 2023/05/17 v1.4n Standard LaTeX document class (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/bk10.clo File: bk10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) ) \c@part=\count191 \c@chapter=\count192 \c@section=\count193 \c@subsection=\count194 \c@subsubsection=\count195 \c@paragraph=\count196 \c@subparagraph=\count197 \c@figure=\count198 \c@table=\count199 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \bibindent=\dimen141 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def File: ctex-engine-xetex.def 2022/07/14 v2.5.10 XeLaTeX adapter (CTEX) (c:/wswApps/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.sty Package: xeCJK 2022/08/05 v3.9.1 Typesetting CJK scripts with XeLaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st y (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate-20 23-10-10.sty Package: xtemplate 2023-10-10 L3 Experimental prototype document functions \l__xtemplate_tmp_dim=\dimen142 \l__xtemplate_tmp_int=\count266 \l__xtemplate_tmp_muskip=\muskip16 \l__xtemplate_tmp_skip=\skip50 )) \l__xeCJK_tmp_int=\count267 \l__xeCJK_tmp_box=\box53 \l__xeCJK_tmp_dim=\dimen143 \l__xeCJK_tmp_skip=\skip51 \g__xeCJK_space_factor_int=\count268 \l__xeCJK_begin_int=\count269 \l__xeCJK_end_int=\count270 \c__xeCJK_CJK_class_int=\XeTeXcharclass1 \c__xeCJK_FullLeft_class_int=\XeTeXcharclass2 \c__xeCJK_FullRight_class_int=\XeTeXcharclass3 \c__xeCJK_HalfLeft_class_int=\XeTeXcharclass4 \c__xeCJK_HalfRight_class_int=\XeTeXcharclass5 \c__xeCJK_NormalSpace_class_int=\XeTeXcharclass6 \c__xeCJK_CM_class_int=\XeTeXcharclass7 \c__xeCJK_HangulJamo_class_int=\XeTeXcharclass8 \l__xeCJK_last_skip=\skip52 \c__xeCJK_none_node=\count271 \g__xeCJK_node_int=\count272 \c__xeCJK_CJK_node_dim=\dimen144 \c__xeCJK_CJK-space_node_dim=\dimen145 \c__xeCJK_default_node_dim=\dimen146 \c__xeCJK_CJK-widow_node_dim=\dimen147 \c__xeCJK_normalspace_node_dim=\dimen148 \c__xeCJK_default-space_node_skip=\skip53 \l__xeCJK_ccglue_skip=\skip54 \l__xeCJK_ecglue_skip=\skip55 \l__xeCJK_punct_kern_skip=\skip56 \l__xeCJK_indent_box=\box54 \l__xeCJK_last_penalty_int=\count273 \l__xeCJK_last_bound_dim=\dimen149 \l__xeCJK_last_kern_dim=\dimen150 \l__xeCJK_widow_penalty_int=\count274 Package xtemplate Info: Declaring object type 'xeCJK/punctuation' taking 0 (xtemplate) argument(s) on line 2396. \l__xeCJK_fixed_punct_width_dim=\dimen151 \l__xeCJK_mixed_punct_width_dim=\dimen152 \l__xeCJK_middle_punct_width_dim=\dimen153 \l__xeCJK_fixed_margin_width_dim=\dimen154 \l__xeCJK_mixed_margin_width_dim=\dimen155 \l__xeCJK_middle_margin_width_dim=\dimen156 \l__xeCJK_bound_punct_width_dim=\dimen157 \l__xeCJK_bound_margin_width_dim=\dimen158 \l__xeCJK_margin_minimum_dim=\dimen159 \l__xeCJK_kerning_total_width_dim=\dimen160 \l__xeCJK_same_align_margin_dim=\dimen161 \l__xeCJK_different_align_margin_dim=\dimen162 \l__xeCJK_kerning_margin_width_dim=\dimen163 \l__xeCJK_kerning_margin_minimum_dim=\dimen164 \l__xeCJK_bound_dim=\dimen165 \l__xeCJK_reverse_bound_dim=\dimen166 \l__xeCJK_margin_dim=\dimen167 \l__xeCJK_minimum_bound_dim=\dimen168 \l__xeCJK_kerning_margin_dim=\dimen169 \g__xeCJK_family_int=\count275 \l__xeCJK_fam_int=\count276 \g__xeCJK_fam_allocation_int=\count277 \l__xeCJK_verb_case_int=\count278 \l__xeCJK_verb_exspace_skip=\skip57 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (c:/wswApps/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty Package: xparse 2024-02-18 L3 Experimental document command parser ) Package: fontspec 2024/02/13 v2.9a Font selection for XeLaTeX and LuaLaTeX (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty Package: fontspec-xetex 2024/02/13 v2.9a Font selection for XeLaTeX and LuaLaTe X \l__fontspec_script_int=\count279 \l__fontspec_language_int=\count280 \l__fontspec_strnum_int=\count281 \l__fontspec_tmp_int=\count282 \l__fontspec_tmpa_int=\count283 \l__fontspec_tmpb_int=\count284 \l__fontspec_tmpc_int=\count285 \l__fontspec_em_int=\count286 \l__fontspec_emdef_int=\count287 \l__fontspec_strong_int=\count288 \l__fontspec_strongdef_int=\count289 \l__fontspec_tmpa_dim=\dimen170 \l__fontspec_tmpb_dim=\dimen171 \l__fontspec_tmpc_dim=\dimen172 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (c:/wswApps/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg File: xeCJK.cfg 2022/08/05 v3.9.1 Configuration file for xeCJK package )) \ccwd=\dimen173 \l__ctex_ccglue_skip=\skip58 ) \l__ctex_ziju_dim=\dimen174 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty Package: zhnumber 2022/07/14 v3.0 Typesetting numbers with Chinese glyphs \l__zhnum_scale_int=\count290 \l__zhnum_tmp_int=\count291 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg File: zhnumber-utf8.cfg 2022/07/14 v3.0 Chinese numerals with UTF8 encoding )) \l__ctex_heading_skip=\skip59 (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese-b ook.def File: ctex-scheme-chinese-book.def 2022/07/14 v2.5.10 Chinese scheme for book ( CTEX) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg File: ctex-name-utf8.cfg 2022/07/14 v2.5.10 Caption with encoding UTF-8 (CTEX) )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/ctex-c5size.clo File: ctex-c5size.clo 2022/07/14 v2.5.10 c5size option (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows .def File: ctex-fontset-windows.def 2022/07/14 v2.5.10 Windows fonts definition (CTE X) Package fontspec Info: Could not resolve font "KaiTi/B" (it probably doesn't (fontspec) exist). Package fontspec Info: Could not resolve font "SimHei/I" (it probably doesn't (fontspec) exist). Package fontspec Info: Could not resolve font "SimSun/BI" (it probably doesn't (fontspec) exist). Package fontspec Info: Font family 'SimSun(0)' created for font 'SimSun' with (fontspec) options (fontspec) [Script={CJK},BoldFont={SimHei},ItalicFont={KaiTi}]. (fontspec) (fontspec) This font family consists of the following NFSS (fontspec) series/shapes: (fontspec) (fontspec) - 'normal' (m/n) with NFSS spec.: (fontspec) <->"SimSun/OT:script=hani;language=dflt;" (fontspec) - 'small caps' (m/sc) with NFSS spec.: (fontspec) - 'bold' (b/n) with NFSS spec.: (fontspec) <->"SimHei/OT:script=hani;language=dflt;" (fontspec) - 'bold small caps' (b/sc) with NFSS spec.: (fontspec) - 'italic' (m/it) with NFSS spec.: (fontspec) <->"KaiTi/OT:script=hani;language=dflt;" (fontspec) - 'italic small caps' (m/scit) with NFSS spec.: )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/ctex/config/ctex.cfg File: ctex.cfg 2022/07/14 v2.5.10 Configuration file (CTEX) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/mathtools/mathtools.sty Package: mathtools 2024/03/11 v1.30 mathematical typesetting tools (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks17 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/tools/calc.sty Package: calc 2023/07/08 v4.3 Infix arithmetic (KKT,FJ) \calc@Acount=\count292 \calc@Bcount=\count293 \calc@Adimen=\dimen175 \calc@Bdimen=\dimen176 \calc@Askip=\skip60 \calc@Bskip=\skip61 LaTeX Info: Redefining \setlength on input line 80. LaTeX Info: Redefining \addtolength on input line 81. \calc@Ccount=\count294 \calc@Cskip=\skip62 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/mathtools/mhsetup.sty Package: mhsetup 2021/03/18 v1.4 programming setup (MH) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2023/05/13 v2.17o AMS math features \@mathmargin=\skip63 For additional information on amsmath, use the `?' option. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks18 \ex@=\dimen177 )) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen178 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count295 LaTeX Info: Redefining \frac on input line 234. \uproot@=\count296 \leftroot@=\count297 LaTeX Info: Redefining \overline on input line 399. LaTeX Info: Redefining \colon on input line 410. \classnum@=\count298 \DOTSCASE@=\count299 LaTeX Info: Redefining \ldots on input line 496. LaTeX Info: Redefining \dots on input line 499. LaTeX Info: Redefining \cdots on input line 620. \Mathstrutbox@=\box55 \strutbox@=\box56 LaTeX Info: Redefining \big on input line 722. LaTeX Info: Redefining \Big on input line 723. LaTeX Info: Redefining \bigg on input line 724. LaTeX Info: Redefining \Bigg on input line 725. \big@size=\dimen179 LaTeX Font Info: Redeclaring font encoding OML on input line 743. LaTeX Font Info: Redeclaring font encoding OMS on input line 744. \macc@depth=\count300 LaTeX Info: Redefining \bmod on input line 905. LaTeX Info: Redefining \pmod on input line 910. LaTeX Info: Redefining \smash on input line 940. LaTeX Info: Redefining \relbar on input line 970. LaTeX Info: Redefining \Relbar on input line 971. \c@MaxMatrixCols=\count301 \dotsspace@=\muskip17 \c@parentequation=\count302 \dspbrk@lvl=\count303 \tag@help=\toks19 \row@=\count304 \column@=\count305 \maxfields@=\count306 \andhelp@=\toks20 \eqnshift@=\dimen180 \alignsep@=\dimen181 \tagshift@=\dimen182 \tagwidth@=\dimen183 \totwidth@=\dimen184 \lineht@=\dimen185 \@envbody=\toks21 \multlinegap=\skip64 \multlinetaggap=\skip65 \mathdisplay@stack=\toks22 LaTeX Info: Redefining \[ on input line 2953. LaTeX Info: Redefining \] on input line 2954. ) \g_MT_multlinerow_int=\count307 \l_MT_multwidth_dim=\dimen186 \origjot=\skip66 \l_MT_shortvdotswithinadjustabove_dim=\dimen187 \l_MT_shortvdotswithinadjustbelow_dim=\dimen188 \l_MT_above_intertext_sep=\dimen189 \l_MT_below_intertext_sep=\dimen190 \l_MT_above_shortintertext_sep=\dimen191 \l_MT_below_shortintertext_sep=\dimen192 \xmathstrut@box=\box57 \xmathstrut@dim=\dimen193 ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/cleveref/cleveref.sty Package: cleveref 2018/03/27 v0.21.4 Intelligent cross-referencing ) (./document.aux) \openout1 = `document.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid (fontspec) this). \symlegacymaths=\mathgroup4 LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold' (Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 7. LaTeX Font Info: Redeclaring math accent \acute on input line 7. LaTeX Font Info: Redeclaring math accent \grave on input line 7. LaTeX Font Info: Redeclaring math accent \ddot on input line 7. LaTeX Font Info: Redeclaring math accent \tilde on input line 7. LaTeX Font Info: Redeclaring math accent \bar on input line 7. LaTeX Font Info: Redeclaring math accent \breve on input line 7. LaTeX Font Info: Redeclaring math accent \check on input line 7. LaTeX Font Info: Redeclaring math accent \hat on input line 7. LaTeX Font Info: Redeclaring math accent \dot on input line 7. LaTeX Font Info: Redeclaring math accent \mathring on input line 7. LaTeX Font Info: Redeclaring math symbol \Gamma on input line 7. LaTeX Font Info: Redeclaring math symbol \Delta on input line 7. LaTeX Font Info: Redeclaring math symbol \Theta on input line 7. LaTeX Font Info: Redeclaring math symbol \Lambda on input line 7. LaTeX Font Info: Redeclaring math symbol \Xi on input line 7. LaTeX Font Info: Redeclaring math symbol \Pi on input line 7. LaTeX Font Info: Redeclaring math symbol \Sigma on input line 7. LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 7. LaTeX Font Info: Redeclaring math symbol \Phi on input line 7. LaTeX Font Info: Redeclaring math symbol \Psi on input line 7. LaTeX Font Info: Redeclaring math symbol \Omega on input line 7. LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 7. LaTeX Font Info: Redeclaring symbol font `operators' on input line 7. LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font (Font) `operators' in the math version `normal' on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) OT1/cmr/m/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font (Font) `operators' in the math version `bold' on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) OT1/cmr/bx/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) TU/lmr/m/n --> TU/lmr/m/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' (Font) OT1/cmr/m/it --> TU/lmr/m/it on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' (Font) OT1/cmr/bx/n --> TU/lmr/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' (Font) OT1/cmss/m/n --> TU/lmss/m/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' (Font) OT1/cmtt/m/n --> TU/lmtt/m/n on input line 7. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) TU/lmr/m/n --> TU/lmr/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' (Font) OT1/cmr/bx/it --> TU/lmr/b/it on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' (Font) OT1/cmss/bx/n --> TU/lmss/b/n on input line 7. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> TU/lmtt/b/n on input line 7. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2021/08/11 v1.11 sin cos tan (DPC) ) (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: xetex.def on input line 107. (c:/wswApps/texlive/2024/texmf-dist/tex/latex/graphics-def/xetex.def File: xetex.def 2022/09/22 v5.0n Graphics/color driver for xetex )) \Gin@req@height=\dimen194 \Gin@req@width=\dimen195 ) [1 ] (./document.aux) *********** LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2022/07/14> *********** ) Here is how much of TeX's memory you used: 10349 strings out of 474772 277375 string characters out of 5757709 1920842 words of memory out of 5000000 32429 multiletter control sequences out of 15000+600000 559831 words of font info for 53 fonts, out of 8000000 for 9000 1348 hyphenation exceptions out of 8191 93i,5n,97p,3268b,271s stack positions out of 10000i,1000n,20000p,200000b,200000s Output written on document.pdf (1 page). A shorter MWE without cleveref: \documentclass{ctexbook} % \usepackage{hyperref} %% Uncomment this line to reproduce \pagestyle{empty} \begin{document} \begin{figure}[h]\caption{caption\label{ref}}\end{figure} \clearpage \tracingoutput=1 \tracingonline=1 \showboxdepth=\maxdimen \showboxbreadth=\maxdimen \shipout\hbox{由\ref{ref}} \end{document} Correct output (with hyperrref commented out): \hbox(8.14693+1.65466)x19.31866 .\TU/FandolSong-Regular(0)/m/n/10.53937 由 .\glue 3.50961 plus 1.7548 minus 1.16986 .\TU/lmr/m/n/10.53937 1 .\kern -0.0002 .\kern 0.0002 .\hbox(0.0+0.0)x0.0 Incorrect output (with hyperrref enabled): \vbox(8.14693+1.65466)x15.80905 .\vbox(0.0+0.0)x0.0, glue set - 20.99626fil ..\kern 0.0 ..\kern 22.0 ..\kern -1.00374 ..\hbox(0.0+0.0)x0.0, glue set - 87.99626fil ...\kern 0.0 ...\kern 89.0 ...\kern -1.00374 ...\special{pdf:dest (page.2) [@thispage /XYZ @xpos @ypos null]} ...\penalty 10000 ...\glue 0.0 plus 1.0fil minus 1.0fil ..\glue 0.0 plus 1.0fil minus 1.0fil .\glue(\lineskip) 0.0 .\hbox(8.14693+1.65466)x15.80905 ..\TU/FandolSong-Regular(0)/m/n/10.53937 由 ..\kern -0.00017 ..\kern 0.00017 ..\special{pdf:bann<</Type/Annot/Subtype/Link/Border[0 0 1]/H/I/C[1 0 0]/A<</S/GoTo/D(figure.0.1)>>>>} ..\TU/lmr/m/n/10.53937 1 ..\kern -0.0002 ..\kern 0.0002 ..\special{pdf:eann}
- Help align the numbers in this bespoke siunitx macroby Miloop on January 28, 2026 at 5:36 pm
I am writing a document where I keep having to write variables that fall between two numbers, say, 10 < x \leq 3 or in some cases even between two quantities such as 12.5 mg < x \leq 3.5 mg. I wrote a macro named \nestednumrange and \nestedqtyrange. Here is my minimal example: \documentclass{article} \usepackage{siunitx} \newcommand{\nestednumrange}[3]{% \ensuremath{\num{#1} #2 \num{#3}}% } \newcommand{\nestedqtyrange}[4]{% \ensuremath{\qty{#1}{#4} #2 \qty{#3}{#4}}% } \begin{document} \nestednumrange{3}{\leq x}{<2} \nestedqtyrange{3}{\leq c}{\leq 3}{\milli\gram} \end{document} I'm happy that is (somehow) works, but the output is a bit ugly, imho: How do I "center" the variable correctly? Should I perhaps add two more {}s specifically for the signs, so that they aren't linked to any element in the macro? Unfortunately, I don't know how to make the macro only accept operators like <, >, \leq, \geq, and =, and throw errors at others.
- Best ways to calculate sums in LaTeXby cis on January 28, 2026 at 2:13 pm
In many computer algebra systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}
- Arithmetic in an enumerate labelby marmistrz on January 28, 2026 at 2:01 pm
I'm doing a hybrid-argument based proof: \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} Can I somehow automate it? The following doesn't work because it doesn't do the arithmetic \begin{enumerate}[label=$H_{\arabic*} \approx H_{\arabic*+1}$] \item (argue indistinguishability) \item (argue indistinguishability) \item (argue indistinguishability) \end{enumerate} Here's a minimal working example: \documentclass{article} \begin{document} \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} \end{document}
- tikz Wiener sausage [duplicate]by 20-sided-dice on January 28, 2026 at 1:41 pm
Let's say I have a curve defined by y=f(x) with some explicit function f for x between 0 and 1. I define the sausage of that curve to be the set of points (x,y) at distance less than 1 from any point of the curve. How do I draw the sausage in TikZ without deriving mathematically the actual shape of the sausage ? Even with simple functions it's quickly painful to derive by hand. I would prefer if TikZ could directly draw it.
- Writing a file with Lua on Overleafby N. Virgo on January 28, 2026 at 11:11 am
The following code works as expected if I run it in LuaLaTeX on my machine, creating a file containing the text "Hello, World!". \documentclass{article} \begin{document} \directlua{ local file = assert(io.open("output.txt", "w")) assert(file:write("Hello, World!")) assert(file:close()) tex.print("Hopefully this worked?") } \end{document} However, if I run it on Overleaf the file doesn't appear. It generates the pdf and there are no errors or warnings or anything else in the logs suggesting that anything has gone wrong, I just don't see the output.txt file. It could be that Overleaf disables this for security reasons, but their documentation mentions file:write explicitly, and other documentation even says running external commands should work on Overleaf, so I have the impression I should expect it to work. Does anyone know if this can be made to work on Overleaf, and if so how I can access the generated file? edit: as @samcarter_is_at_topanswers.xyz and @daleif pointed out, the file is there in the logs and can be downloaded (using the 'Other logs and files' button at the bottom right of the log screen in the new editor), it just can't be viewed in the editor. So the question becomes, how can I bring the file into the editor so that I can view its contents there? (While still having it update when I compile.) I tried creating an empty output.txt file manually, but unfortunately it stays empty after compiling, and output.txt disappears from the "other files and logs" list.
- Is there a expl3 interface for lttemplate?by Noiv on January 28, 2026 at 1:26 am
in developing a class I have come to use the so called templates documented in lttemplate. It is a expl3-Class therefore I looked at ways to define Template Types, Templates and Instances in expl3 Syntax but there are no such interfaces. Is there a particular reason why templates do not have a expl3 interface? Or was I not capable enough to find it?
- How can I map TFM data for a type1 font in LuaLaTeX (probably using luaotfload.patch_font_unsafe) when the font encoding has unused slots?by cfr on January 28, 2026 at 12:06 am
This code is derived from code by Max Chernoff, but the mangling is entirely my responsibility. Aim: to add tounicode mappings to the characters in uzdr.pfb (URW's clone of Zapf Dingbats) when compiling with a LuaLaTeX format based on the LuaHBTeX binary in (updated) TeX Live 2025. Note that I am NOT asking for a practical solution to the problem of typesetting these symbols with correct tounicode values, which would be better done using a Unicode font. I apologise for the length of this example. Usually, I would reduce the data file to a couple of lines, but then I would need a type1 font in TeX Live with a 'gappy' but very short encoding. Or I could eliminate lines here, but then it might seem as if that in itself is part of the problem. \begin{filecontents*}[overwrite]{fixit.lua} The Lua code: pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes Now the overly-long data file: \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} The actual example: \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document} This loses characters from the font. Not only are the tounicode mappings missing, the characters also disappear from the PDF. LuaTeX warns me something is wrong: </usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr.pfb warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): embedded subset is smaller than expected: 136 instead of 188 glyph s warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): invalid real value to pack. Continuing, but the font looks wrong. > The mappings are not obviously-to-me wrong: Adding callback for pzdr uzdr table: 0x437e5320 (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/pifont.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/upzd.fd) Lua's listing of the inputs for the function (abbreviated to satisfy SE character limit): id 16 spec pzdr tfmdata table: 0x43833f70 Mapping tounicode values for pzdr uzdr table: 0x437e5320 pzdr uzdr 1 -1 ... pzdr uzdr 31 -1 pzdr uzdr 32 32 pzdr uzdr 33 9985 pzdr uzdr 34 9986 ... ... pzdr uzdr 126 10078 pzdr uzdr 127 -1 ... pzdr uzdr 160 -1 pzdr uzdr 161 10081 ... pzdr uzdr 239 10159 pzdr uzdr 240 -1 pzdr uzdr 241 10161 ... pzdr uzdr 254 10174 These seem to get used correctly when mapping the TFM data i.e. only the values corresponding to actual characters get used: Mapping: 32 33 32 table: 0x4383bfd0 Mapping: 33 34 9985 table: 0x4383c050 Mapping: 34 35 9986 table: 0x4383c0d0 Mapping: 35 36 9987 table: 0x4383c150 Mapping: 36 37 9988 table: 0x4383c1d0 Mapping: 37 38 9742 table: 0x4383c250 Mapping: 38 39 9990 table: 0x4383c2d0 Mapping: 39 40 9991 table: 0x4383c350 Mapping: 40 41 9992 table: 0x4383c400 Mapping: 41 42 9993 table: 0x4383c4b0 Mapping: 42 43 9755 table: 0x4383c560 Mapping: 43 44 9758 table: 0x4383c610 Mapping: 44 45 9996 table: 0x4383c6c0 Mapping: 45 46 9997 table: 0x4383c770 Mapping: 46 47 9998 table: 0x4383c820 Mapping: 47 48 9999 table: 0x4383c8d0 Mapping: 48 49 10000 table: 0x4383c980 Mapping: 49 50 10001 table: 0x4383ca30 Mapping: 50 51 10002 table: 0x4383cae0 Mapping: 51 52 10003 table: 0x4383cb90 Mapping: 52 53 10004 table: 0x4383cc40 Mapping: 53 54 10005 table: 0x4383ccf0 Mapping: 54 55 10006 table: 0x4383cda0 Mapping: 55 56 10007 table: 0x4383ce50 Mapping: 56 57 10008 table: 0x4383cf00 Mapping: 57 58 10009 table: 0x4383cfb0 Mapping: 58 59 10010 table: 0x4383d060 Mapping: 59 60 10011 table: 0x4383d110 Mapping: 60 61 10012 table: 0x4383d1c0 Mapping: 61 62 10013 table: 0x4383d270 Mapping: 62 63 10014 table: 0x4383d320 Mapping: 63 64 10015 table: 0x4383d3d0 Mapping: 64 65 10016 table: 0x4383d480 Mapping: 65 66 10017 table: 0x4383d530 Mapping: 66 67 10018 table: 0x4383d5e0 Mapping: 67 68 10019 table: 0x4383d690 Mapping: 68 69 10020 table: 0x4383d740 Mapping: 69 70 10021 table: 0x4383d7f0 Mapping: 70 71 10022 table: 0x4383d8a0 Mapping: 71 72 10023 table: 0x4383d950 Mapping: 72 73 9733 table: 0x4383da00 Mapping: 73 74 10025 table: 0x4383dab0 Mapping: 74 75 10026 table: 0x4383db60 Mapping: 75 76 10027 table: 0x4383dc10 Mapping: 76 77 10028 table: 0x4383dcc0 Mapping: 77 78 10029 table: 0x4383dd70 Mapping: 78 79 10030 table: 0x4383de20 Mapping: 79 80 10031 table: 0x4383ded0 Mapping: 80 81 10032 table: 0x4383df80 Mapping: 81 82 10033 table: 0x4383e030 Mapping: 82 83 10034 table: 0x4383e0e0 Mapping: 83 84 10035 table: 0x4383e190 Mapping: 84 85 10036 table: 0x4383e240 Mapping: 85 86 10037 table: 0x4383e2f0 Mapping: 86 87 10038 table: 0x4383e3a0 Mapping: 87 88 10039 table: 0x4383e450 Mapping: 88 89 10040 table: 0x4383e500 Mapping: 89 90 10041 table: 0x4383e5b0 Mapping: 90 91 10042 table: 0x4383e660 Mapping: 91 92 10043 table: 0x4383e710 Mapping: 92 93 10044 table: 0x4383e7c0 Mapping: 93 94 10045 table: 0x4383e870 Mapping: 94 95 10046 table: 0x4383e920 Mapping: 95 96 10047 table: 0x4383e9d0 Mapping: 96 97 10048 table: 0x4383ea80 Mapping: 97 98 10049 table: 0x4383eb30 Mapping: 98 99 10050 table: 0x4383ebe0 Mapping: 99 100 10051 table: 0x4383ec90 Mapping: 100 101 10052 table: 0x4383ed40 Mapping: 101 102 10053 table: 0x4383edf0 Mapping: 102 103 10054 table: 0x4383eea0 Mapping: 103 104 10055 table: 0x4383ef50 Mapping: 104 105 10056 table: 0x4383f000 Mapping: 105 106 10057 table: 0x4383f0b0 Mapping: 106 107 10058 table: 0x4383f160 Mapping: 107 108 10059 table: 0x4383f210 Mapping: 108 109 9679 table: 0x4383f2c0 Mapping: 109 110 10061 table: 0x4383f370 Mapping: 110 111 9632 table: 0x4383f420 Mapping: 111 112 10063 table: 0x4383f4d0 Mapping: 112 113 10064 table: 0x4383f580 Mapping: 113 114 10065 table: 0x4383f630 Mapping: 114 115 10066 table: 0x4383f6e0 Mapping: 115 116 9650 table: 0x4383f790 Mapping: 116 117 9660 table: 0x4383f840 Mapping: 117 118 9670 table: 0x4383f8f0 Mapping: 118 119 10070 table: 0x4383f9a0 Mapping: 119 120 9687 table: 0x4383fa50 Mapping: 120 121 10072 table: 0x4383fb00 Mapping: 121 122 10073 table: 0x4383fbb0 Mapping: 122 123 10074 table: 0x4383fc60 Mapping: 123 124 10075 table: 0x4383fd10 Mapping: 124 125 10076 table: 0x4383fdc0 Mapping: 125 126 10077 table: 0x4383fe70 Mapping: 126 127 10078 table: 0x4383ff20 Mapping: 161 162 10081 table: 0x4383ffd0 Mapping: 162 163 10082 table: 0x43840080 Mapping: 163 164 10083 table: 0x43840130 Mapping: 164 165 10084 table: 0x438401e0 Mapping: 165 166 10085 table: 0x43840290 Mapping: 166 167 10086 table: 0x43840340 Mapping: 167 168 10087 table: 0x438403f0 Mapping: 168 169 9827 table: 0x438404a0 Mapping: 169 170 9830 table: 0x43840550 Mapping: 170 171 9829 table: 0x43840600 Mapping: 171 172 9824 table: 0x438406b0 Mapping: 172 173 9312 table: 0x43840760 Mapping: 173 174 9313 table: 0x43840810 Mapping: 174 175 9314 table: 0x438408c0 Mapping: 175 176 9315 table: 0x43840970 Mapping: 176 177 9316 table: 0x43840a20 Mapping: 177 178 9317 table: 0x43840ad0 Mapping: 178 179 9318 table: 0x43840b80 Mapping: 179 180 9319 table: 0x43840c30 Mapping: 180 181 9320 table: 0x43840ce0 Mapping: 181 182 9321 table: 0x43840d90 Mapping: 182 183 10102 table: 0x43840e40 Mapping: 183 184 10103 table: 0x43840ef0 Mapping: 184 185 10104 table: 0x43840fa0 Mapping: 185 186 10105 table: 0x43841050 Mapping: 186 187 10106 table: 0x43841100 Mapping: 187 188 10107 table: 0x438411b0 Mapping: 188 189 10108 table: 0x43841260 Mapping: 189 190 10109 table: 0x43841310 Mapping: 190 191 10110 table: 0x438413c0 Mapping: 191 192 10111 table: 0x43841470 Mapping: 192 193 10112 table: 0x43841520 Mapping: 193 194 10113 table: 0x438415d0 Mapping: 194 195 10114 table: 0x43841680 Mapping: 195 196 10115 table: 0x43841730 Mapping: 196 197 10116 table: 0x438417e0 Mapping: 197 198 10117 table: 0x43841890 Mapping: 198 199 10118 table: 0x43841940 Mapping: 199 200 10119 table: 0x438419f0 Mapping: 200 201 10120 table: 0x43841aa0 Mapping: 201 202 10121 table: 0x43841b50 Mapping: 202 203 10122 table: 0x43841c00 Mapping: 203 204 10123 table: 0x43841cb0 Mapping: 204 205 10124 table: 0x43841d60 Mapping: 205 206 10125 table: 0x43841e10 Mapping: 206 207 10126 table: 0x43841ec0 Mapping: 207 208 10127 table: 0x43841f70 Mapping: 208 209 10128 table: 0x43842020 Mapping: 209 210 10129 table: 0x438420d0 Mapping: 210 211 10130 table: 0x43842180 Mapping: 211 212 10131 table: 0x43842230 Mapping: 212 213 10132 table: 0x438422e0 Mapping: 213 214 8594 table: 0x43842390 Mapping: 214 215 8596 table: 0x43842440 Mapping: 215 216 8597 table: 0x438424f0 Mapping: 216 217 10136 table: 0x438425a0 Mapping: 217 218 10137 table: 0x43842650 Mapping: 218 219 10138 table: 0x43842700 Mapping: 219 220 10139 table: 0x438427b0 Mapping: 220 221 10140 table: 0x43842860 Mapping: 221 222 10141 table: 0x43842910 Mapping: 222 223 10142 table: 0x438429c0 Mapping: 223 224 10143 table: 0x43842a70 Mapping: 224 225 10144 table: 0x43842b20 Mapping: 225 226 10145 table: 0x43842bd0 Mapping: 226 227 10146 table: 0x43842c80 Mapping: 227 228 10147 table: 0x43842d30 Mapping: 228 229 10148 table: 0x43842de0 Mapping: 229 230 10149 table: 0x43842e90 Mapping: 230 231 10150 table: 0x43842f40 Mapping: 231 232 10151 table: 0x43842ff0 Mapping: 232 233 10152 table: 0x438430a0 Mapping: 233 234 10153 table: 0x43843150 Mapping: 234 235 10154 table: 0x43843200 Mapping: 235 236 10155 table: 0x438432b0 Mapping: 236 237 10156 table: 0x43843360 Mapping: 237 238 10157 table: 0x43843410 Mapping: 238 239 10158 table: 0x438434c0 Mapping: 239 240 10159 table: 0x43843570 Mapping: 241 242 10161 table: 0x43843620 Mapping: 242 243 10162 table: 0x438436d0 Mapping: 243 244 10163 table: 0x43843780 Mapping: 244 245 10164 table: 0x43843830 Mapping: 245 246 10165 table: 0x438438e0 Mapping: 246 247 10166 table: 0x43843990 Mapping: 247 248 10167 table: 0x43843a40 Mapping: 248 249 10168 table: 0x43843af0 Mapping: 249 250 10169 table: 0x43843ba0 Mapping: 250 251 10170 table: 0x43843c50 Mapping: 251 252 10171 table: 0x43843d00 Mapping: 252 253 10172 table: 0x43843db0 Mapping: 253 254 10173 table: 0x43843e60 Mapping: 254 255 10174 table: 0x43843f10 What am I doing wrong? Note that I know there are lots of font options and that I can easily find OpenType fonts with suitable symbols for use with LuaTeX. There are lots of practical solutions, but this is not a practical question. I'm just curious about what is happening and how this should be corrected. I'm also aware than the problem will hopefully disappear in a few weeks time when TeX Live 2026 is released. I want to ask now precisely because this will be harder to reproduce soon and that just isn't a satisfying solution to the puzzle. Complete code as a single block: \begin{filecontents*}[overwrite]{fixit.lua} pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 -- Needed for Type 1 fonts end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document}
- How to thicken the subpath's segment with specific position?by Explorer on January 27, 2026 at 12:37 pm
This question is similar to this question, but not exactly the same. I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw[help lines] (-1,-1) grid (7,2); \draw[thick,magenta] (0,0) .. controls (3,3) and (4,-1) .. % coordinate[pos=.3] (A) %<- point start of thick line % coordinate[pos=.5] (B) %<- point end of thick line (6,0); \clip (2,0) rectangle (3,3); \draw[line width=3pt,cyan] (0,0) .. controls (3,3) and (4,-1) .. (6,0); \end{tikzpicture} \end{document} Noted that the GREEN cut is what I was after, the cut should along the path, but not the \clip-ed rectangle. What I saied is not the same as Paul Gaborit's solution, is that I want to control the proportion of (says 0.3 and 0.5, and coloe them thicker) the "subpath". The solution with: decoration={ show path construction, curveto code={ \addtocounter{pos}{1} \pgfmathtruncatemacro{\min}{#1 - 1} \ifthenelse{\thepos < #2 \AND \thepos > \min}{ \draw[#3] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast); }{} } } points here \tikzinputsegmentfirst, \tikzinputsegmentsupportX and \tikzinputsegmentlast looks not easy to control two points position as pos=0.3, is there any better solution? Any possible(plain-TikZ,tkz-elements,luadraw) are all welcome!
- How to expand the macros in tabularray first with `expand` key?by Explorer on January 27, 2026 at 11:30 am
I want the following result: There are two features I want to control: The columns: First Col to be itshape Second Col to add cmdA left Third Col to add cmdB right The rows: What's more, every line's content is the same, replicated for THREE times. It could be achieved by: \documentclass[border=1cm]{standalone} \usepackage{tabularray} \DeclareRobustCommand{\cmdA}[1]{cmdA#1}% \DeclareRobustCommand{\cmdB}[1]{#1cmdB}% \newcommand\columnA[1]{\textit{#1}} \newcommand\columnB[1]{\cmdA{#1}} \newcommand\columnC[1]{\cmdB{#1}} \NewExpandableDocumentCommand{ \addcols }{ m }{ {#1} & {#1} & {#1} \\} \begin{document} \begin{tblr}[expand=\addcols]{ colspec = {*{3}{X[c,m,5cm]}}, row{1} = {font=\Large\bfseries}, cell{2-Z}{1} = {cmd=\columnA}, cell{2-Z}{2} = {cmd=\columnB}, cell{2-Z}{3} = {cmd=\columnC}, hlines={1.5pt}, vlines={1.5pt}, } ColA & ColB & ColC \\ % \addcols{Line1} % \addcols{Line2} % \addcols{Line3} Line1 & Line1 & Line1 \\ Line2 & Line2 & Line2 \\ Line3 & Line3 & Line3 \end{tblr} \end{document} Now, assuming that there are too many columns(for example,10 columns), it's diffcult to type it for so many times. So I tried with \addcols, but the expand and cell{...}={cmd=...} complained with: ! Misplaced alignment tab character &. \addcols code #1-> {#1} & {#1} & {#1} \\ l.26 \end {tblr} ? Is that possible to achieve this at the same time?
- Showcase of beautiful 'electrical circuit diagrams' done in TeX & friendsby cis on January 27, 2026 at 7:03 am
When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}
- How can I accessibly make my pdf have an H1 heading?by Teepeemm on January 26, 2026 at 7:03 pm
My accessibility checker (Ally) complains that the following "PDF does not have headings": \DocumentMetadata{tagging=on,lang=en-US,pdfstandard=ua-2, tagging-setup={ math/setup=mathml-SE, % role/new-tag=Title/H1, } } \documentclass{article} \usepackage{lipsum} \title{Title} \begin{document} \maketitle \lipsum[1-9] \end{document} I understand this means that Ally is looking for a \section command (or similar), but that doesn't make sense for this document. I saw elsewhere that uncommenting the role line would cause the title to become an H1, satisfying the need for headings. This satisfies Ally, but now the compilation gives a warning Parent-Child 'pdf2:H1' --> 'pdf2:P'. Relation is not allowed! and VeraPDF says that the PDF is no longer UA-2. Is there a way to make the title become H1 and not P? (Related: Ally requires pdfs to have headings once they have at least three pages: https://help.anthology.com/ally-lms/en/administrators/ally-accessibility-checklist.html)
- Simplifying an Asymptote figure for spherical coordinatesby Sebastiano on January 26, 2026 at 12:58 pm
I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:
- Merging listoffigures and listofschemes into oneby palloc on January 25, 2026 at 9:38 pm
I am working with the following code: \documentclass{report} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage{chemstyle} \usepackage[colorlinks]{hyperref} \counterwithout{figure}{chapter} \counterwithout{scheme}{chapter} \begin{document} \tableofcontents \chapter{A} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig I} \label{figA} \end{figure} \begin{scheme} \centering \includegraphics[width=0.5\linewidth]{...} \caption{Sch I} \label{schA} \end{scheme} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig II} \label{figB} \end{figure} \ref{figA}, \ref{schA}, \ref{figB} \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Figures} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Scheme} \listofschemes \end{document} What I want is the following: Merge the List of Figures and the List of Schemes into a single List of Figures. In that case, a Scheme should be numbered as a Figure (e.g., “Scheme 1” → “Figure 2”). The output of \ref{schA} should be “Figure 2”.
- Why is my METAFONT code wrong?by Grzegorz Brzęczyszczykiewicz on January 25, 2026 at 9:11 pm
mode_setup; thick#:=10pt#; thin#:=5pt#; xoo#:=15pt#; yoo#:=20pt#; dot#:=4pt#; slant#:=0pt#; define_pixels(thick, thin, xoo, yoo, dot, slant); ascender:=3; descender:=1; def be(expr x, y) = (x*xoo+y*slant, y*yoo) enddef; path bowl; bowl := be(1, 0) .. controls be(1.6, 0) and be(2, 0.4) .. be(2, 1) .. controls be(2, 1.6) and be(1.6, 2) .. be(1, 2) .. controls be(0.4, 2) and be(0, 1.6) .. be(0, 1) .. controls be(0, 0.4) and be(0.4, 0) .. cycle; def stick(expr height, length) = be(0-length, height)--be(0, height)--be(0, 0) enddef; def serif(expr length) = be(0-length, 0)--be(length, 0) enddef; pen thinP; thinP := pencircle scaled thin; %a thin, circular pen pen thickP; thickP := pencircle xscaled thick yscaled thin; %a thick, elliptical pen numeric theta_v, theta_n, A, k; theta_v := angle(slant, yoo); A := theta_v / 2; theta_n := angle(yoo, -slant); k := sqrt( 25 - (2.5*sin(theta_n - A))**2 ) / ( 5*cos(theta_n - A) ); pen p; p := thickP xscaled k rotated A; beginchar("o", 3*xoo#, 2*yoo#, 0); pickup thickP; draw bowl; endchar; beginchar("l", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(ascender, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); endchar; beginchar("b", 3.2*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(ascender-1, 0.5)) shifted be(0.25, 1); pickup p; draw be(0.25, 1.5)--be(0.25, 0.1) endchar; beginchar("d", 3.3*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(1.5, ascender)--be(2, ascender)--be(2, 0)--be(2.5, 0); endchar; beginchar("p", 3.2*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(2+descender, 0.5)) shifted be(0.25, 0-descender); draw (serif(0.5)) shifted be(0.25, 0-descender); endchar; beginchar("q", 3.1*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(2, 1)--be(2, 0-descender); draw (serif(0.5)) shifted be(2, 0-descender); pickup p; draw be(2, 1.9)--be(2, 0.75) endchar; beginchar("i", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(2, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); pickup pencircle scaled (thick+dot); draw be(0.425, 2.75) endchar; beginchar("h", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(ascender, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; beginchar("n", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(2, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; end there are errors and it should be correct, it throws "Missing )" and "Extra tokens will be flushed" errors. For slant = 0, k should work out to sqrt(1.75) = 1.32287565553..., and A = 45°, however due to a bug, the k is a few eyelets shy of the expected sqrt(1.75), and the line becomes too thin. As for the A, it maybe is correct but I don't know if it is. There are bugs and I don't know how to fix them.
- Different column alignment of first-rowby Werner on January 25, 2026 at 5:19 pm
I like my matrix indices to be center-aligned while numbers within the matrix should be right-aligned for better visual clarity of scale. However, none of my attempts to achieve both have been successful. In the example below, the first option is closest, but fails to align the lost column index. \documentclass{article} \usepackage{nicematrix,xcolor} \newcommand{\mc}{\multicolumn{1}{c}} \begin{document} Manual formatting without \texttt{first-row} - last column index not centered: \[ \begin{NiceArray}{ *{6}{r} } \mc{\color{red}\scriptstyle 0} & \mc{\color{red}\scriptstyle 1} & \mc{\color{red}\scriptstyle 2} & \mc{\color{red}\scriptstyle 3} & \mc{\color{red}\scriptstyle 4} & \mc{\color{red}\scriptstyle 5} \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{\string\RowStyle} - no centering of indices: \[ \begin{NiceArray}{ *{6}{r} } \RowStyle[nb-rows=1]{\color{red}\scriptstyle} 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{first-row} - no centering of indices: \[ \begin{NiceArray}{ *{6}{ r } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] Using \texttt{first-row} with \texttt{c}entered columns - no right-aligned matrix elements: \[ \begin{NiceArray}{ *{6}{ c } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] \end{document} How can I achieve a different alignment for the first row (indices) compared to the rest of the matrix?
- Where does this 1pt extra space between paragraphs come from, and how to configure it?by H. Weirauch on January 25, 2026 at 2:09 pm
In the MWE \documentclass{article} \usepackage{lua-visual-debug} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \begin{document} \rule{6mm}{6mm} \rule{7mm}{6mm} \end{document} the code contains an empty line (= new paragraph) between the two \rules. This is what it looks like in the output: Between the paragraphs, some vertical spacing is inserted. As far as I can tell, it is exactly 1pt. Where does this come from, and how am I supposed to modify it? This space does not occur when using minimal document class; it apparently is limited to article (or other high-level classes like KOMA).
- How can I tag an l3pdftextfield?by cfr on January 25, 2026 at 6:53 am
I'm trying to create a text field in a tagged PDF. My real document uses ltx-talk, which complicates things slightly, but the MWE below uses article. I mention ltx-talk in case somebody has a solution which would work for article, but not for ltx-talk, so that I do not waste people's time. \DocumentMetadata{% lang=en-GB, tagging=on, pdfversion=2.0, pdfstandard=UA-2, } \documentclass{article} \usepackage{bookmark} \usepackage{l3pdffield} \title{Tools} \ExplSyntaxOn \cs_new_eq:NN \textfield \pdffield_textfield:n \ExplSyntaxOff \begin{document} \Form \textfield { name=fieldA, width=50mm, height=12pt, depth=50pt, setfieldflags=Multiline, altname=a, } \end{document} I'm having some difficulty understanding how much I'm supposed to do here and how much I'm supposed to let happen. tagpdf.pdf suggests that form fields created with l3pdffield should be automatically added to the structure. I think this indeed happens1: <PDF> <StructTreeRoot> <Document xmlns="http://iso.org/pdf2/ssn" id="ID.02" > <text-unit xmlns="https://www.latex-project.org/ns/dflt" id="ID.05" rolemaps-to="Part" > <text xmlns="https://www.latex-project.org/ns/dflt" id="ID.06" xmlns:Layout="http://iso.org/pdf/ssn/Layout" Layout:TextAlign="Justify" rolemaps-to="P" > <Form xmlns="http://iso.org/pdf2/ssn" id="ID.07" > <?ReferencedObject type="Annot" page="1" ?> </Form> </text> </text-unit> </Document> </StructTreeRoot> </PDF> What I'm not sure about is how to configure a Contents entry for the field - or maybe where I am supposed to put altname, which is presumably in the wrong place at the moment? The document compiles without errors with either LuaLaTeX or pdfLaTeX. However, the PDF fails to validate against UA-22,3. verapdf says <?xml version="1.0" encoding="utf-8"?> <report> <buildInformation> <releaseDetails id="core" version="1.28.2" buildDate="2025-07-15T16:07:00+01:00"></releaseD etails> <releaseDetails id="validation-model" version="1.28.2" buildDate="2025-07-15T16:12:00+01:00 "></releaseDetails> <releaseDetails id="gui" version="1.28.2" buildDate="2025-07-15T16:59:00+01:00"></releaseDe tails> </buildInformation> <jobs> <job> <item size="23750"> <name>/path/to/test-file.pdf</name> </item> <validationReport jobEndStatus="normal" profileName="PDF/UA-2 + Tagged PDF validation pro file" statement="PDF file is not compliant with Validation Profile requirements." isCompliant=" false"> <details passedRules="1722" failedRules="1" passedChecks="175" failedChecks="1"> <rule specification="ISO 14289-2:2024" clause="8.10.2.3" testNumber="1" status="faile d" failedChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Accessibility validation p rofile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant ="false"> <details passedRules="1718" failedRules="1" passedChecks="171" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Reuse validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false" > <details passedRules="1705" failedRules="1" passedChecks="169" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <duration start="1769321531153" finish="1769321531866">00:00:00.713</duration> </job> </jobs> <batchSummary totalJobs="1" failedToParse="0" encrypted="0" outOfMemory="0" veraExceptions="0 "> <validationReports compliant="0" nonCompliant="1" failedJobs="0">1</validationReports> <featureReports failedJobs="0">0</featureReports> <repairReports failedJobs="0">0</repairReports> <duration start="1769321531030" finish="1769321531917">00:00:00.887</duration> </batchSummary> </report> From what I gathered from the PDF spec, I want to add a Contents here, because a label would correspond to a visible label in the PDF, which does not exist. 1 However, some parts of the documentation for l3pdfmanagement suggest that perhaps only link annotations, as opposed to widget annotations, are currently handled fully automatically by the tagging code. So I'm not sure that I do not need to do something additional here, but the problem does not seem to be adding the widget to the structure? 2 In fact, the text field here is not supposed to make sense on its own. It is only meant to make sense when I am standing there talking. It's just a place for me to type. Its purpose will make sense by the end of class, because it will then have content. 3 So marking the field up for accessibility is actually a bit strange. It isn't 'accessible' to sighted readers either in advance of the relevant class.