• Underline in math mode, at fixed depth and breaking around descenders/subscripts?
    by Peter LeFanu Lumsdaine on January 29, 2026 at 11:20 am

    I’d like to underline some math content in a LaTeX document, but acting like a (good-quality) text underline in that it’s at a fixed depth below the baseline, and breaks around subscripts and ideally also descenders, like the following example (though I only need this in math, not for text as well): This answer, from which the example image is taken, gives just what I want, but in ConTeXt. This question and its answers give high-quality underlining for text (breaking around descenders), but not math. This question and its answers give fixed-depth math underlining, but not breaking around subscripts/descenders.

  • Adjusting text next to a wrapfig environment
    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.

  • Obtaining math symbols' low-level definitions
    by myhsia on January 29, 2026 at 4:52 am

    One can simply obtain the definition of some math symbols that have no arguments, like latexdef alpha \alpha: \mathchar"10B \the\alpha: 267 But for those symbols, which can only be input by a function, for example, the double-stroke letter, I have to type % \usepackage{amssymb} \mathbb{I} It prints the double-stroke I. But I cannot obtain the definition of "\mathbb{I}", and if I execute latexdef -p amssymb mathbb \mathbb: macro:->\protect \mathbb \mathbb : macro:->\relax \ifmmode \else \non@alpherr \mathbb \fi \use@mathgroup \M@U \symAMSb It returns the definition of \mathbb, but the definition contains the control sequence itself. But I just want to input the symbol itself in a trivial way, like \mathchar, or use \fontfamily{...} to call a font. How can I obtain the definition of, for example, \mathbb{I} in terms of some low-level commands, or even primitives?

  • Relative placement of horizontal rule
    by 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 loaded
    by 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}

  • Extend custom \IMG macro: add percentage-based overlay label (white box + letter) at (x%, y%) with separate scale
    by taiwan12 on January 28, 2026 at 10:12 pm

    I have a basic macro that inserts a figure with \includegraphics, caption, and label: \documentclass{report} \usepackage{graphicx} \usepackage{float} \newcommand{\IMG}[4]{ \begin{figure}[H] \centering \includegraphics[scale=#1]{#2} \caption{#3} \label{fig:#4} \end{figure} } \begin{document} \IMG{0.5}{example-image}{Caption}{figA} \IMG{0.6}{example-image}{Caption}{figB} \end{document} I want to extend it so I can overlay a letter inside a white square with a black border on top of the image, with the position given in percentages of the image size, and with a separate scale that affects only the overlay (box + letter), not the image. Desired call syntax: \IMG{imgscale}{filename}{caption}{label}{y}{x}{letter}{overlayscale} Where: imgscale is passed to \includegraphics[scale=...] (scales the image) y and x are relative coordinates inside the image (fractions / percentages of the image size): (y=0, x=0) corresponds to the top-left corner of the image y increases downward (south) x increases to the right (east) e.g. y=0.10 means 10% from the top, x=0.05 means 5% from the left letter is something like A, B, etc. (only one letter) overlayscale scales only the overlay (white square + letter), not the image the letter should be centered inside the square Example usage I want: \IMG{0.5}{example-image}{Caption}{figA}{0.10}{0.05}{A}{1.2} This should place a small white square (black border) near the top-left, at 5% from the left and 10% from the top, and put the letter A inside it. I’m open to tikz, overpic, etc., as long as the coordinates are relative to the image (not the page). Ideally the overlay moves correctly when the image scale changes. It should look like this:

  • Automatically adding support for custom macrogenerating function in VS Code LatexWorkshop for intellisense
    by Klimace on January 28, 2026 at 7:27 pm

    This is a follow up question. When generating new commands with a macro generating command and not directly with latex natives like \newcommand or \providecommand the macros are not added to intellisense. One can do this manually by oneself. But this could become tidious. So I am looking for a way such that after one call of a custom macro generating function the function name is added to intellisense. Here again the example code: \documentclass[12pt]{article} \newcommand{\newmacro}[2]{\newcommand{#1}[1]{#2 ##1}} \newmacro{\Hello}{Hello} \newcommand{\HelloWorld}{Hello World!} \begin{document} \Hello{World !} \HelloWorld \end{document}

  • Match Math Font to Text Font
    by GregH on January 28, 2026 at 6:48 pm

    Using XeLaTeX, one can easily set the math font to match the main text using the mathspec package. For example, using the open font Carlito on Overleaf, the code \documentclass{article} \usepackage{mathspec} \setallmainfonts{Carlito} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces numbers lettering that match the main text font: As LuaLaTeX is now the recommended engine, and XeLaTeX support may not be continued, I am looking for a LuaLaTeX equivalent. I cannot find one. I thought the mathastext package was designed to solve my problem, but using \documentclass{article} \usepackage{fontspec} \setmainfont{Carlito} \usepackage{mathastext} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces Clearly the numbers from math mode are typeset in a different font face. I also tried the unicode-math package with \setmathfont{Carlito}, but that produces the same/similar output with a warning that an OpenType Math font was expected. How do I get mathmode font to match the regular text font?

  • Remove numbering at top of a page in scrlayer-scrpage
    by Sebastiano on January 28, 2026 at 6:32 pm

    How do you remove the upper numbering? \documentclass[a4paper]{article} \usepackage[fontsize=12.5pt]{fontsize} \usepackage[italian]{babel} \usepackage{geometry} \geometry{ paperwidth=21cm, paperheight=29.7cm, textwidth=18cm, textheight=27cm, headsep=0.5cm, top=1cm, left=1.5cm, footskip=.5cm } \usepackage{scrlayer-scrpage} \rofoot*{\pagemark} \begin{document} Test \end{document}

  • Help align the numbers in this bespoke siunitx macro
    by 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.

  • Referencing to figures and tables, hungarian
    by palloc on January 28, 2026 at 5:13 pm

    I'am hungarian, I would like to reference to figures and tables, but none of these works properly. \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{float} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \usepackage[figurewithin=none, tablewithin=none]{caption} \begin{document} \begin{figure}[H] \caption{Caption} \label{fig} \end{figure} \begin{table}[H] \caption{Caption} \label{tab} \end{table} \autoref{fig}, \autoref{tab} \end{document} In Hungarian, the proper format is the number followed by ábra/táblázat (meaning figure/table), for example: 1. ábra, 1. táblázat. I would like both the number and ábra/táblázat to be clickable. Hungarian also uses suffixes, so there is a high chance that I need to use forms like 1. táblázaton or 1. ábrán (and there are other possible suffixes as well).

  • How listoftables creates lot file - aux file processing
    by Marcel Kanter on January 28, 2026 at 4:25 pm

    I try to figure out how to create conditional list of tables without reading the counters or using packages like assoccnt and found an answer that uses \IfFileExists{\jobname.lot}{% \listoftables }{ } There is other code around it (that uses the counters)... The aux file of the document (book class) contains the entries that should be written to the toc file: \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Table to test captions and labels.}}{1}{}\protected@file@percent } This aux file is read in at the beginning and adding some errous commands will throw an error as expected. BUT the lot file is only created when I add \listoffigures without the IfFileExists to the document. How do I manage that the \@writefile actually writes to the file? Open the file, but with which handle? There is no error in the pdflatex output. MWE \documentclass{book} \begin{document} \begin{table}[h] \begin{tabular}{c} abc\\ def \end{tabular} \caption{Table to test captions and labels.} \label{table:1} \end{table} \IfFileExists{\jobname.lot}{% \listoftables }{ % create lot file %\immediate\openout\lotfile=\jobname.lot % ??? } \end{document}

  • Modifing tableofcontents, listoffigures and listoftables with hungarian babel
    by palloc on January 28, 2026 at 4:22 pm

    I am having the following code: \documentclass[11pt]{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{parskip} \usepackage{float} \usepackage{setspace} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none,tablewithin=none]{caption} \captionsetup[figure]{labelsep=colon} % In-text: "1. ábra: ..." \captionsetup[table]{labelsep=colon} % In-text: "1. táblázat: ..." \usepackage{tocloft} \addcontentsline{toc}{chapter}{Ábrák és táblázatok jegyzéke}% \begin{document} \onehalfspacing \tableofcontents \clearpage \chapter{First} \section{First} \begin{figure}[H] \caption{First fig} \end{figure} \begin{table}[!ht] \caption{First tab} \end{table} \section{Second} \begin{table}[!ht] \caption{Second tab} \end{table} \chapter{Second} \begin{figure}[!ht] \caption{Second fig} \end{figure} \end{document} I would like to merge listoffigures and listoftables into one, and its name would be Ábrák és táblázatok jegyzéke which means List of Figures and Tables. And I also want an extra word between figure/table number and figure/table caption (táblázat means table, ábra means figure). This is how it should look like: And I also would like to modify the tableofcontents, adding the extra Fejezet (which means Chapter) word between the chapter number and chapter name

  • Bibliography issues while creating an ADA-compliant pdf with LuaLaTeX
    by ckhenderson on January 28, 2026 at 2:53 pm

    I am trying to convert a set of notes created with pdflatex to ones that are compliant with the new ADA regulations. I have everything working except for the bibliography, which comes with an error: "" when I run it with LuaLaTeX. See screenshot below also. Here is a MWE: \DocumentMetadata{ lang=en-US, pdfstandard=ua-2, testphase={tagpdf,math,table,graphic} } \documentclass{book} \usepackage{amsmath, amsfonts, amssymb} \usepackage{unicode-math} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ pdftitle={MWE}, pdfauthor={Author}, pdfsubject={Technical Documentation}, pdfdisplaydoctitle=true, pdflang={en-US} } \tagpdfsetup{ activate, tabsorder=structure, math/mathml/luamml/load=true } \title{MWE} \author{Author} \begin{document} \maketitle \cite{reference} \begin{thebibliography}{99} \bibitem{reference} Author, \textit{Title}, Publisher, Year. \end{thebibliography} \end{document}

  • Best ways to calculate sums in LaTeX
    by cis on January 28, 2026 at 2:13 pm

    In many CAS-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}

  • Issue interacting with mhchem (\ce) and align environment when fetching dynamic data via csnames / expl3
    by Le Ngoc on January 28, 2026 at 2:06 pm

    The Goal: I am building a chemistry database package (chemdata.sty) where chemical equations and properties are generated from a CSV file (via Python) and stored as control sequences using etoolbox's \csdef (or expl3 property lists). My goal is to call these stored values inside mhchem's \ce{...} command and within align environments. The Problem: I keep encountering expansion issues (Missing \endgroup, Runaway argument, or mhchem Error: Assertion failed: Unexpected input character) when trying to pass the stored data into \ce. Approaches I have tried: I have attempted two main strategies to handle the equations: The "Pre-wrapped" Strategy (Storing formatted code) In this approach, I format the data fully in the backend (Python) and store it with \ce already included. Storage: \csdef{data@H3PO4@eq}{\ce{H3PO4 <=> H+ + H2PO4-}} Usage: \NewDocumentCommand{\getEq}{m}{\csuse{data@#1@eq}} Result: Works fine for simple inline equations. However, it fails when I need to combine data (e.g., redox couples) or when I need to split the equation for align environments (nested \ce calls often break). The "Raw Data + Expansion" Strategy (Storing plain strings) I store raw strings without any formatting and try to force expansion before passing them to mhchem. Storage: \csdef{data@H3PO4@raw}{H3PO4 <=> H+ + H2PO4-} Usage (attempt with expl3): \ExplSyntaxOn \NewDocumentCommand{\getEq}{m}{ \cs_if_exist:cTF { data@#1@raw } { \exp_args:Nv \ce { data@#1@raw } } % Trying to expand variable before \ce sees it { ?? } } \ExplSyntaxOff Result: This often throws Assertion failed: Unexpected input character from mhchem, presumably because mhchem's parser sees the expansion mechanism instead of the chemical characters. Handling the align environment For alignment, I split the equation into LHS and RHS in the database to expose the & token to LaTeX. Storage: \csdef{data@id@lhs}{H3PO4} \csdef{data@id@rhs}{<=> H+ + H2PO4-} Definition: \NewDocumentCommand{\eqAlign}{m}{ \exp_args:Nv \ce {data@#1@lhs} & \exp_args:Nv \ce {data@#1@rhs} } Result: This causes Missing \endgroup or Misplaced alignment tab character &, likely because the expansion order confuses the align scanner. My Question: What is the correct robust way to retrieve a stored string (containing chemical formulas) and pass it into \ce{...} so that it works reliably inside an align environment without breaking mhchem's parsing? Minimal Working Example (MWE): \documentclass{article} \usepackage{amsmath} \usepackage[version=4]{mhchem} \usepackage{etoolbox} \usepackage{xparse} % Simulated Database (Generated by Python) \csdef{mydata@H3PO4@raw}{H3PO4 <=> H+ + H2PO4-} \csdef{mydata@H3PO4@lhs}{H3PO4} \csdef{mydata@H3PO4@rhs}{<=> H+ + H2PO4-} \ExplSyntaxOn % Attempt to expand content before passing to \ce \NewDocumentCommand{\ChemEq}{m}{ \exp_args:Nv \ce { mydata@#1@raw } } \NewDocumentCommand{\ChemAlign}{m}{ \exp_args:Nv \ce { mydata@#1@lhs } & \exp_args:Nv \ce { mydata@#1@rhs } } \ExplSyntaxOff \begin{document} % Case 1: Inline - Sometimes works, sometimes "Assertion Failed" Test Inline: \ChemEq{H3PO4} % Case 2: Align - Fails with "Missing \endgroup" or similar \begin{align} \ChemAlign{H3PO4} \end{align} \end{document}

  • Arithmetic in an enumerate label
    by 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}

  • Environment shown conditionally
    by Federico Poloni on January 28, 2026 at 1:58 pm

    I am trying to define an environment whose content is displayed only if a certain argument appears in a comma-separated list that is given as an optional argument to the environment. I used forcsvlist in etoolbox. Here is a M(not)WE: \documentclass{article} \usepackage{etoolbox,verbatim,xstring} \newcommand{\checkkey}[1]{% \ifstrequal{#1}{inf}{\def\showcontent{true}}{}% } \newenvironment{conditional}[1][]{% \def\showcontent{false}% \forcsvlist{\checkkey}{#1}% \ifstrequal{\showcontent}{true}{\begingroup}{\expandafter\comment}% }{% \ifstrequal{\showcontent}{true}{\endgroup}{\expandafter\endcomment}% } \begin{document} Shown? % only environments whose comma-separated list arg % contains "inf" should be displayed. \begin{conditional}[inf, ich] Yes \end{conditional} \begin{conditional}[foo, bar] No \end{conditional} \end{document} Unfortunately the content of neither environment is shown. How to fix this? I suspect something is going amiss with the expansion order, so that \forcsvlist checks the string "#1" rather than "inf, ich", but I haven't been able to fix the issue. (Feel free to suggest better solutions instead. Use case: in a second moment, I will want to replace "inf" with a string defined conditionally depending on the jobname, to obtain multiple version of a document; but for this question this is irrelevant.)

  • 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.

  • Latex verapdf warning duplicated key /Group
    by Eder on January 28, 2026 at 12:12 pm

    I encountered the same issue described in this question. I generated a PDF/A-compliant document using LuaLaTeX with MiKTeX 25.12. When the resulting file is tested with veraPDF, it passes validation, however, the following warning is reported: WARNING: Dictionary/Stream contains duplicated key /Group(object key = 6 0 obj, offset = 10058) After some investigation, I traced the issue to the inclusion of vectorized PDF images in the document. Below is a minimal working example that reproduces the problem: \documentclass[12pt]{article} \usepackage[a-3b]{pdfx} \usepackage{graphicx} \usepackage{blindtext} \begin{document} \blindtext \includegraphics[width=0.5\linewidth]{shape.pdf} \end{document} I am not a PDF expert, however, after opening the generated PDF in Notepad++, I inferred that the warning is caused by the duplicated occurrence of the /Group key in the following Dictionary/Stream: << /Type /XObject /Subtype /Form /FormType 1 /PTEX.PageNumber 1 /PTEX.InfoDict << /Producer (cairo 1.18.4 (https://cairographics.org)) /Creator (Inkscape 1.4.3 \(https://inkscape.org\)) /CreationDate (D:20260128075234-04'00) >> /BBox [ 0 0 595.275591 841.889764 ] /Group << /Type /Group /S /Transparency /I true /CS /DeviceRGB >> /Resources << /ExtGState << /a0 << /CA 0.616 /ca 0.616 >> >> /XObject << /x7 13 0 R /x8 14 0 R /x9 15 0 R /x10 16 0 R >> >> /Group<</S/Transparency/K false/I false>> /Length 68 /Filter /FlateDecode >> The vectorized image "shape.pdf" was drawn in Inkscape and saved as PDF. EDIT: Available here Interesting to note that this problem does not seem to occur in previous versions of MikTex. I suspect some recent update in LuaLaTeX generated this issue. Is there any way to fix it?

  • Writing a file with Lua on Overleaf
    by 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.

  • How do 256+ character pdfLaTeX fonts work, and how to make one?
    by Grzegorz Brzęczyszczykiewicz on January 28, 2026 at 9:48 am

    I am talking about those "fake fonts" that are composed of multiple fonts to have more characters. An example is Computer Modern, which uses multiple fonts, one for text symbols, one for math symbols, and another for Greek letters. Is it possible to make a font that works like this?

  • Matching the length of parts of an equation
    by Jinwen on January 28, 2026 at 9:48 am

    In the following expression: is it possible to somehow match the length of the P(T) and Q(T) part, so that the 1+T part is vertically aligned? \documentclass{article} \usepackage{kpfonts} % I'm using this font to make the issue more visible \begin{document} \( \frac{1 \,+\, T\,P(T)}{1 \,+\, T\,Q(T)} \) \end{document}

  • tikz diagram works in overleaf but fails in texworks [closed]
    by duality on January 28, 2026 at 6:01 am

    I am trying to get the following tikz diagram to work in texworks. It works fine in overleaf but fails in texworks. Any idea how to fix this? \documentclass[11pt]{article} \usepackage{tikz} \usepackage{float} \usetikzlibrary{calc} \usetikzlibrary{external,quotes,chains} \tikzset{vertex/.style={black,fill,draw,minimum size=6pt,inner sep=0pt,circle,thin},bold/.style={black,line width=0.6mm},plain/.style={black,thin},bold edges/.style=bold,plain edges/.style=plain,label distance=1mm,text node/.style={rectangle,fill=none,draw=none},every label/.style=text node,caption node/.style={text node,font=\Large}} \newcommand{\AR}[1]{\overrightarrow{#1}} \title{something} \author{someone} \begin{document} \maketitle \begin{figure}[H] \centering \begin{tikzpicture} [node distance=2cm, base node/.style={circle,draw,minimum size=15pt},scale=0.8] \node[base node, very thick] (5){5}; \node[base node, very thick][left of=5] (3){3}; \node[base node, very thick][above of=5] (1){1}; \node[base node, very thick][below of=5] (4){4}; \node[base node, very thick][right of=5] (2){2}; \path [->, very thick] (3) edge node[left] {} (5); \path [<-, very thick] (5) edge node[right] {} (2); \path [->, very thick](1) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (2); \path [->, very thick](1) edge node[left] {} (2); \path [->, very thick] (5) edge node[left] {} (1); \path [->, very thick] (5) edge node[left] {} (4); % ------- First copy of the circulant ------- \node[base node, very thick] (w1) at ($(90:2) + (3,-4)$) {6}; \node[base node, very thick] (w2) at ($(30:2) + (3,-4)$) {7}; \node[base node, very thick] (w3) at ($(-30:2) + (3,-4)$) {10}; \node[base node, very thick] (w4) at ($(-90:2) + (3,-4)$) {9}; \node[base node, very thick] (w5) at ($(-150:2) + (3,-4)$) {8}; %\node[base node, very thick] (w6) at ($(150:2) + (3,-4)$) {5}; %repeated \path[->, very thick] (w1) edge [bend left=5] (5); \path[->, very thick] (w1) edge (w3); \path[->, very thick] (w2) edge (w1); \path[->, very thick] (w2) edge (w4); \path[->, very thick] (w3) edge (w2); \path[->, very thick] (w3) edge (w5); \path[->, very thick] (w4) edge (w3); \path[->, very thick] (w4) edge [bend right=10] (5); \path[->, very thick] (w5) edge (w4); \path[->, very thick] (w5) edge (w1); \path[->, very thick] (5) edge [bend left=5] (w5); \path[->, very thick] (5) edge [bend left=15] (w2); % ------- Second copy of the circulant ------- \node[base node, very thick] (z1) at ($(90:2) + (9,-4)$) {11}; %2 \node[base node, very thick] (z2) at ($(30:2) + (9,-4)$) {12}; %3 \node[base node, very thick] (z3) at ($(-30:2) + (9,-4)$) {15}; %6 \node[base node, very thick] (z4) at ($(-90:2) + (9,-4)$) {14}; %5 \node[base node, very thick] (z5) at ($(-150:2) + (9,-4)$) {13}; %4 %\node[base node, very thick] (z6) at ($(150:2) + (9,-4)$) {10}; %1 \path[->, very thick] (z1) edge[bend right=10] (w3); \path[->, very thick] (z1) edge (z3); \path[->, very thick] (z2) edge (z1); \path[->, very thick] (z2) edge (z4); \path[->, very thick] (z3) edge (z2); \path[->, very thick] (z3) edge (z5); \path[->, very thick] (z4) edge (z3); \path[->, very thick] (z4) edge[bend left=10] (w3); \path[->, very thick] (z5) edge (z4); \path[->, very thick] (z5) edge (z1); \path[->, very thick] (w3) edge (z5); \path[->, very thick] (w3) edge[bend left=10] (z2); \end{tikzpicture} \caption{A graph $\AR{R_5} \cdot R_6$} \label{fig:gluingToGetAllN} \end{figure} \end{document}

  • 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 & friends
    by 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 to define a LaTeX command with multiple \replacecmpd inputs?
    by palloc on January 26, 2026 at 5:13 pm

    I have the following LaTeX code using the chemstyle and chemnum packages: \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} \usepackage{chemnum} \begin{document} \begin{scheme} \replacecmpd{PhH} \replacecmpd{PhMe} \includegraphics[scale=0.8]{chem.eps} \caption{Caption I} \label{sch:first} \end{scheme} % In my real project the chemicals are different \begin{scheme} \replacecmpd{PhNH2} \replacecmpd{PhNO2} \includegraphics[scale=0.8]{chem.eps} \caption{Caption II} \label{sch:second} \end{scheme} \end{document} I would like to define a new command, for example \schCall, that wraps this structure into a single macro. Desired syntax example: \schCall[0.6]{chem}{PhH, PhMe}{Caption I}{first} Where: the optional argument is the scale (default = 0.8) the first mandatory argument is the image filename (without .eps) the second mandatory argument is a comma-separated list of arguments for \replacecmpd the third argument is the caption text the fourth argument is used for the label