• **How in the heck** can I generate a triangulated implicit surface, such as the ones from https://math.stackexchange.com/a/46222?
    by Jasper on December 5, 2025 at 10:42 pm

    This is a shameless do-if-for-me question :-). I might answer it myself, if I find a solution before someone else does. How in the heck can I generate a triangulated implicit surface, such as the ones from https://math.stackexchange.com/a/46222? It needs to be triangulated.

  • expl3 function not expand inside \tl_set:Nx?
    by Erwann on December 5, 2025 at 10:22 pm

    Every now and then I need a refresher on LaTeX logic. In the example below I expected either an error or at least a different result — certainly not the value 2, which is the behavior I would have expected only if the increment function were protected. Could someone please clarify what’s going on? \documentclass{article} \ExplSyntaxOn \int_new:N \g__erw_counter_int \cs_new:Npn \__erw_bad_increment: { \int_gincr:N \g__erw_counter_int } \cs_new_protected:Npn \__erw_good_increment: { \int_gincr:N \g__erw_counter_int } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \int_gset:Nn \g__erw_counter_int { 0 } \tl_set:Nx \l_tmpa_tl { \__erw_bad_increment: } \tl_set:Nx \l_tmpb_tl { \__erw_good_increment: } \tl_use:N\l_tmpa_tl \tl_use:N\l_tmpa_tl Value:~\int_use:N\g__erw_counter_int % Outputs Value:2 \ExplSyntaxOff \end{document}

  • How to parse an STY definition manually to find an error?
    by jeffbiss on December 5, 2025 at 8:48 pm

    I am getting the following error message: (biblatex-ext-tabular) 'bibtabular' undefined. See the biblatex-ext-tabular package documentation for explanation. Type H for immediate help. ... l.146 \referencepage Please supply a suitable definition with \defbibtabular. See the documentation for more details. biblatex-ext-tabular defines defbibtabular as follows: % user-level command for defining tabular bibliography format \newrobustcmd*{\defbibtabular}[4]{% \long\csdef{extblxtab@env@#1}{#2}% \long\csdef{extblxtab@endenv@#1}{#3}% \long\csdef{extblxtab@tabrow@format@#1}{#4}} The definition in the STY file that I'm using, I didn't create this, it's beyond my capability, defines \defbibtabular as follows: \defbibtabular{bibtabular} {\setlength{\LTpre}{0pt}% \setlength{\LTpost}{0pt}% \begin{longtable}{% @{} |C{1in} |L{5.1in}| @{}} \hline \cellcolor{deepBlue} {\bfseries\color{white} Reference} & \cellcolor{deepBlue} {\bfseries\color{white} Document Title} \\ \hline \endfirsthead \hline \cellcolor{deepBlue} {\bfseries\color{white} Reference} & \cellcolor{deepBlue} {\bfseries\color{white} Document Title} \\ \hline \endhead \end{longtable}} {\printtext[labelnumberwidth]{% \plainlang{\printfield{labelnumber}}} & \plainlang{\printfield{title}}\\\hline} I am using OverLeaf and so I can't type H for help as that appears for local use. I am not experienced enough yet to understand what the definition parameters, such as extblxtab@env@#1, might be in error generating \defbibtabular{bibtabular} and so would like to know how I would manually parse it such that I can figure out what I need to do to fix it?

  • Vertical text with multicolumn and tabularx looks weird
    by domi on December 5, 2025 at 7:18 pm

    I have the following snippet \documentclass{article} \usepackage{tabularx} \usepackage{rotating} \usepackage{multirow} \newcolumntype{C}{>{\centering\arraybackslash}X} \newcolumntype{V}{>{\centering\arraybackslash}m{1.5cm}} \newcommand{\verttext}[1]{\rotatebox{90}{\parbox{3cm}{\centering\textbf{#1}}}} \renewcommand{\arraystretch}{1.5} \begin{document} \begin{table}[h] \centering \begin{tabularx}{\textwidth}{V | V | C | C |} \multicolumn{2}{c}{} & \multicolumn{2}{c}{Ausmass des Interesses am Unternehmen} \\ \cline{3-4} \multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & Gering & Hoch \\ \cline{2-4} \multirow{2}{*}{\verttext{Ausmass der Macht}} & \verttext{Hoch} & Zufrieden stellen & Key Players \\ \cline{2-4} & \verttext{Gering} & minimal betreuen & informieren \\ \cline{2-4} \end{tabularx} \end{table} \end{document} which looks like this: as you can see, the "Ausmass der Macht" isnt centered (its two cell high) and shouldn't be wrapped. The two cells (Hoch + Gering) are high enough so the text shouldn't be wrapped. I already found a kinda similar question here: Vertical Text using multirow in the Table though I have no clue how to resolve that issue. Thanks in advance 🙂

  • `\mathfrak` not working after use of `\boldsymbol`
    by Fin H on December 5, 2025 at 5:52 pm

    For some reason, when using \mathfrak{}, everything works up until using \boldsymbol{}, after which it gives me an error saying, "Use of \reserved@a doesn't match its definition". Here is an example: \documentclass{article} \usepackage{graphicx} \usepackage{lmodern} \usepackage[dvipsnames]{xcolor} \usepackage[T1]{fontenc} \usepackage{amsthm, amsmath, amssymb, amsfonts, mathrsfs} \usepackage[fixamsmath]{mathtools} \usepackage[cal=cm, scr=rsfs, frak=euler, bb=ams]{mathalpha} \usepackage{tikz} \usetikzlibrary{shapes.geometric,positioning} \newtheorem{theorem}{Theorem}[subsection] \begin{document} $\mathfrak{X}$ $\boldsymbol{\gamma}$ $\mathfrak{X}$ \end{document} This gives the following with the error occurring at the second \mathfrak{X}. Is it an issue with any of the packages/libraries I am using? Is my preamble overloaded with them?

  • What is math mode used for?
    by Grzegorz Brzczyszczykiewicz on December 5, 2025 at 5:25 pm

    Do people creatively use math mode for things other than math? If so, when and why?

  • How to use Bézier curves in `TikZ` to draw a quotation mark?
    by Mihai Constantin on December 5, 2025 at 5:17 pm

    In a previous question (i.e., How to align the visual bottom of a large quotation mark with the cap height of the text?) I was looking for a solution for how to properly align a quotation mark. As cfr also suggests in one of his comments, using TikZ seems more appropriate. To this end, I would like to replicate the following quotation mark in TikZ (i.e., a single one will do; see image below). I managed to get somewhat close, but not quite there: \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[p, osf, swashQ]{cochineal} \usepackage{tikz} \begin{document} % Model. {\fontsize{1000}{0}\selectfont\textcolor{lightgray}{`'}} % Implementation. \begin{tikzpicture}[baseline=0pt, scale=10] % Grid. \draw[help lines, color=lightgray, step=0.1] (-1, -1.2) grid (0.2, 0); % Zoom. \draw[red] (0, 0) -- (0, -1) -- (-1, -1) -- (-1, 0) -- cycle; % Coordinates. \fill[blue] (0, 0) circle (0.2pt) node[above] {$(0, 0)$}; \fill[blue] (0, -1) circle (0.2pt) node[below] {$(0, -1)$}; \fill[blue] (-1, 0) circle (0.2pt) node[above] {$(-1, 0)$}; \fill[blue] (-1, -1) circle (0.2pt) node[below] {$(-1, -1)$}; % Junction points. \fill[red] (0, 0) circle (0.1pt); \fill[red] (-0.4, -1) circle (0.1pt) node[below] {$(-0.4, -1)$}; \fill[red] (-0.5, -0.9) circle (0.1pt) node[left] {$(-0.5, -0.9)$}; \fill[red] (-0.2, -0.5) circle (0.1pt) node[left] {$(-0.2, -0.5)$}; % The curve with new control points \draw[thick, color=blue] % Start. (0, 0) % Curved back. .. controls (0.4, -0.43) and (-0.38, -1) .. % (-0.4, -1) % The tip. .. controls (-0.4, -1) and (-0.5, -0.95) .. % (-0.5, -0.9) % The curved inner. .. controls (-0.4, -0.9) and (-0.1, -0.5) .. % (-0.2, -0.5) % The bulge. .. controls (-0.6, -0.15) and (-0.2, 0.05) .. % End. cycle; \end{tikzpicture} \end{document} Based on the attempt above, I obtained the following shape below. However, some of the "control points" are not properly "rounded," e.g., (-0.2, -0.5) or (-0.4, -1). I'd appreciate any ideas.

  • Better font for epigraphs
    by Cham on December 5, 2025 at 4:17 pm

    I'm still really a noob with fonts in LaTeX. I'm looking for a better font display than the one used in the code below. What other nice font codes should I try on line marked with a comment, to get better results in the epigraphs? This is for an adventure novel (no maths here), and I'm looking for something a bit poetic, lyrical, without fancy hard to read curvy fonts, but still something elegant for an epic novel. Here's a MWE to play with: \documentclass[11pt,twoside]{report} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt]{geometry} \usepackage{epigraph} \renewcommand{\textflush}{flushleft} \setlength{\epigraphrule}{0pt} \newcommand*{\styling}{\usefont{T1}{qzc}{m}{it}\selectfont} % ANOTHER FONT TO BE USED HERE! \newcommand{\epig}[2]{\epigraphhead[70]{\epigraph{\styling{#1}}{\styling{#2}}}} \begin{document} \chapter{Nice chapter title} \epig{ Some nice epic epigraph, To be written here, Some words to shows up the style. }{} Blabla bla blabla bla. \end{document} Here's a preview of what this MWE code is doing: The question here is how should I edit the MWE code to use other fonts just for the epigraphs, without touching the main text font (libertinus)?

  • Reduce chapter title using titlesec package
    by Will Kim on December 5, 2025 at 11:33 am

    Experience Latex users The following code is the template I am using for my notes. Since the top margin of Chapter 1 is a lot greater than I thought and this pushes the last bullet point (circle in pink) to the next page. Reducing the set chapter title of titlesec margin would solve this problem. Could you please give me some tips on this? Thank you. \documentclass[12pt]{book} \usepackage[margin=0.5in]{geometry} % % Packages \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsfonts} % math symbols \usepackage{geometry} \usepackage{graphicx} % figures \usepackage{tikz} % drawings \usepackage{hyperref} % clickable links \usepackage{fancyhdr} % headers/footers \usepackage{titlesec} % formatting chapter titles % Page layout % \usepackage{pgfplots} \usepackage{mathtools} \usepackage{cancel} \usepackage{pgfplots} \usepackage{array} \usepackage{amsmath} \newtheorem{theorem}{THEOREM} \newtheorem{proof}{PROOF} \usepackage{tikz} \usepackage{amssymb} \usetikzlibrary{patterns} \usepackage{bigints} \usepackage{color} \usepackage{tcolorbox} \usepackage{cancel} \usepackage{soul} \usepackage{multirow} \usepackage{dcolumn} \usepackage{graphicx} % Required for \includegraphics %\usepackage{background} %\usepackage{fullpage, lipsum, tikz} %\usepackage{eso-pic} % % Headers and footers \pagestyle{fancy} \fancyhf{} \fancyhead[LE,RO]{\thepage} \fancyhead[LO]{\rightmark} \fancyhead[RE]{\leftmark} % \titlespacing{\chapter}{0pt}{-128pt}{1cm}% <-- CHANGE DONE HERE!! \begin{document} % % Title \begin{titlepage} \centering \vspace*{3cm} {\Huge\bfseries TITLE}\\[1cm] %{\Large Covering Five Core Topics}\\[2cm] \vfill {\Large ME}\\ %{\Large \today} \end{titlepage} \tableofcontents \newpage %\voffset -2.0cm % \chapter{Natural Numbers} \textbf{01 DIVISORS AND MULTIPLES}\\ \\ \textbf{QUOTIENTS AND REMAINDERS}\\ \\ Let $A$, $B$, $Q$, and $R$ be whole numbers\\[0.15cm] When dividing $A$ by $B$, let the quotient be $Q$ and the remainder be $R$.\\[0.15cm] Then\\ \\ $A = B \times Q + R$, where $0 \le R < B$.\\ \\ If $R = 0$, then $A$ is said to be divisible by $B$.\\ \\\\ \textbf{DIVISORS AND MULTIPLES}\\ \\ If $A$ is divisible by $B$, that is, if $A = B \times Q$, then $A$ is a multiple of $B$, and $B$ is a divisor of $A$.\\ \\ For example, $24$ is divisible by $6$.\\[0.15cm] Since $24 = 6 \times 4$, $24$ is a multiple of $6$ and $6$ is a divisor of $24$.\\ \\ Note that $0$ is a multiple of every non-zero whole number.\\[0.15cm] This is because, for any non-zero whole number $K$, we have\\ \\ $0 = K \times 0$.\\ \\ In other words, every non-zero whole number is a divisor of $0$.\\ \\\\ \textbf{TESTS FOR MULTIPLES}\\ \\ $\bullet$ A number is a multiple of $4$ if its last two digits are a multiple of $4$.\\ \\ $\bullet$ A number is a multiple of $8$ if its last three digits are a multiple of $8$.\\ \\ $\bullet$ A number is a multiple of $9$ if the sum of its digits is a multiple of $9$.\\ \\ $\bullet$ A number is a multiple of $3$ if the sum of its digits is a multiple of $3$.\\ \\ % \newpage \voffset 0cm \text{}\\ \\ $\bullet$ A number is a multiple of $11$ if the difference between the sum of its digits in odd positions and the sum\\[0.15cm] \hspace*{4mm}of its digits in even positions is $0$ or a multiple of $11$.\\ \\\\ \textbf{02 POWERS AND PRIME NUMBERS}\\ \\ \textbf{POWERS}\\ \\ A power is a notation used to show repeated multiplication of a number or variable. \end{document}

  • Is there a way to write a Lua function to be compatible with both LaTeX and ConTeXt key interfaces?
    by Jasper on December 5, 2025 at 8:33 am

    I have a lua function which does a specific task. The task is the same for both LaTeX and ConTeXt. Of course, to output, I need a specialized command for both formats. I would like to write these functions all in one file, so I only have one file to update. How can I properly interface these files, so that they don't interfere with each other, but can be run from exactly one Lua file? Is there a way to write the function to be compatible with both key interfaces? LaTeX setup \documentclass[tikz,border=1cm]{standalone} \usepackage{latex-keys} \begin{document} \begin{tikzpicture} \appendcurve[ ustart = {0} ,ustop = {1} ,usamples = {20} ,x = {u} ,y = {u^2} ,draw options = {draw} ] \displaysegments \end{tikzpicture} \end{document} % latex-keys.sty \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesExplPackage{latex-keys}{2025/12/05}{v1.0.0}{% Minimal LuaLaTeX package for 2D parametric curves in TikZ. } \RequirePackage{tikz} \tikzset{ /lua-tikztdtools/.is~family ,/lua-tikztdtools/.cd ,/lua-tikztdtools/parametric/.cd ,/lua-tikztdtools/parametric/curve/.cd ,ustart/.estore~in = \luatikztdtools@p@c@ustart ,ustop/.estore~in = \luatikztdtools@p@c@ustop ,usamples/.estore~in = \luatikztdtools@p@c@usamples ,x/.code = {\protected@edef\luatikztdtools@p@c@x{#1}} ,y/.code = {\protected@edef\luatikztdtools@p@c@y{#1}} ,draw~options/.estore~in = \luatikztdtools@p@c@drawoptions ,ustart = {0} ,ustop = {6.28318} ,usamples = {100} ,x = {cos(u)} ,y = {sin(u)} ,draw~options = {thick,red} } \lua_load_module:n { lua-backend } \NewDocumentCommand { \appendcurve } {o} { \group_begin: \tikzset{ /lua-tikztdtools/parametric/curve/.search~also = {/tikz} ,/lua-tikztdtools/parametric/curve/.cd ,#1 } \__lua_tikztdtools_appendcurve: \group_end: } \NewDocumentCommand { \displaysegments } {} { \group_begin: \__lua_tikztdtools_displaysegments: \group_end: } -- Minimal 2D Curve Generator (MWE) local segments = {} -- Evaluate a string as a Lua expression in a math environment local function single_string_expression(str) local func = load("return " .. str, "expression", "t", math)() return func end local function single_string_function(str) return load("return function(u) return " .. str .. " end", "expression", "t", math)() end -- Register a TeX command to call a Lua function local function register_tex_cmd(name, func, args) name = "__lua_tikztdtools_" .. name .. ":" .. ("n"):rep(#args) local scanners = {} for _, arg in ipairs(args) do scanners[#scanners+1] = token['scan_' .. arg] end local scanning_func = function() local values = {} for _, scanner in ipairs(scanners) do values[#values+1] = scanner() end func(table.unpack(values)) end local index = luatexbase.new_luafunction(name) lua.get_functions_table()[index] = scanning_func token.set_lua(name, index) end -- 2D parametric curve generator local function append_curve(hash) local ustart = single_string_expression(hash.ustart) local ustop = single_string_expression(hash.ustop) local usamples = single_string_expression(hash.usamples) local x = single_string_function(hash.x) local y = single_string_function(hash.y) local drawoptions = hash.drawoptions local ustep = (ustop - ustart) / (usamples - 1) for i = 0, usamples - 2 do local u = ustart + i * ustep local A = { x(u), y(u) } local B = { x(u + ustep), y(u + ustep) } table.insert(segments, { segment = {A, B}, drawoptions = drawoptions, type = "line segment" }) end end register_tex_cmd( "appendcurve", function() append_curve{ ustart = token.get_macro("luatikztdtools@p@c@ustart"), ustop = token.get_macro("luatikztdtools@p@c@ustop"), usamples = token.get_macro("luatikztdtools@p@c@usamples"), x = token.get_macro("luatikztdtools@p@c@x"), y = token.get_macro("luatikztdtools@p@c@y"), drawoptions = token.get_macro("luatikztdtools@p@c@drawoptions"), } end, { } ) -- Display all segments as TikZ paths local function display_segments() for _, segment in ipairs(segments) do if segment.type == "line segment" then local S, E = segment.segment[1], segment.segment[2] tex.sprint(string.format( "\\path[%s] (%f,%f) -- (%f,%f);", segment.drawoptions or "", S[1], S[2], E[1], E[2] )) end end segments = {} end register_tex_cmd("displaysegments", function() display_segments() end, { }) ConTeXt setup \ctxloadluafile{lua-backend-context.lua} \processMPfigurefile{context-keys.mp} \starttext \startMPpage append_curve [ ustart = "0", ustop = "6.28318", usamples = "100", fx = "cos(u)", fy = "sin(u)", specifications = "withcolor red" ] ; display_segments ; \stopMPpage \stoptext presetparameters "jasper_append_curve" [ ustart = "0", ustop = "6.28318", usamples = "100", fx = "cos(u)", fy = "sin(u)", specifications = "withcolor red" ] ; def append_curve = applyparameters "jasper_append_curve" "jasper_do_append_curve" enddef ; vardef jasper_do_append_curve = pushparameters "jasper_append_curve" ; lua.mp.jasper_append_curve_generate() ; popparameters ; enddef ; presetparameters "jasper_display_segments" [ ] ; def display_segments = applyparameters "jasper_display_segments" "jasper_do_display_segments" enddef ; vardef jasper_do_display_segments = pushparameters "jasper_display_segments" ; lua.mp.jasper_display_segments_generate() ; popparameters ; enddef ; -- lua-backend-context.lua -- MWE: Only 2D parametric curves as line segments local segments = {} -- Math environment for user expressions local backend_math = {} for k, v in pairs(_G) do backend_math[k] = v end for k, v in pairs(math) do backend_math[k] = v end -- Parameter extraction helpers local function MG(key) return metapost.getparameterset(key) end local function sse(key) local str = metapost.getparameterset(key) local chunk, err = load("return " .. str, "expr", "t", backend_math) if not chunk then error("Failed to parse expression: " .. tostring(str) .. "\nError: " .. tostring(err)) end local ok, result = pcall(chunk) if not ok then error("Error evaluating expression: " .. tostring(result)) end return result end local function ssf(key) local expr = metapost.getparameterset(key) local func = load("return function(u) return " .. expr .. " end", "func", "t", backend_math) if not func then error("Failed to parse function: " .. expr) end local ok, result = pcall(func) if not ok then error("Error evaluating function: " .. tostring(result)) end return result end -- Only 2D parametric curves as line segments function mp.jasper_append_curve_generate() local ustart = sse("ustart") local ustop = sse("ustop") local usamples = sse("usamples") local x = ssf("fx") local y = ssf("fy") local drawoptions = MG("specifications") local ustep = (ustop - ustart) / (usamples - 1) for i = 0, usamples - 2 do local u = ustart + i * ustep local A = { x(u), y(u) } local B = { x(u + ustep), y(u + ustep) } table.insert(segments, { segment = { A, B }, drawoptions = drawoptions, }) end end function mp.jasper_display_segments_generate() for _, segment in ipairs(segments) do local S, E = segment.segment[1], segment.segment[2] mp.print(string.format( [[path jasper_tmp ; jasper_tmp := (%f,%f) -- (%f,%f) ; draw jasper_tmp scaled 1cm %s ;]], S[1], S[2], E[1], E[2], segment.drawoptions or "" )) end segments = {} end

  • Tagging Math in Tabular Environment
    by John W on December 5, 2025 at 3:47 am

    hope you are well. Currently I am attempting to write mathematics in tabular format with tagging on. Here is a sample: along with its code: \DocumentMetadata{ lang = en-US, pdfstandard = ua-2, pdfstandard = a-4f, tagging=on, } \documentclass[12pt]{article} \UseName{sys_if_engine_opentype:TF} {\usepackage{unicode-math}} {\usepackage{amsmath}} \begin{document} \tagpdfsetup{table/header-rows={1}} \begin{tabular}{|c|c|}\hline \textbf{Guidelines} & \textbf{Example}\\\hline Assume $A$. & Assume $n$, $m$, and $\ell$ are three consecutive integers.\\\hline \end{tabular} \end{document} On NVDA+MathCat the table reads as the following with cues for header labels and row/column numbers removed. Guidelines Example Assume ... Assume .., .., and .. are three consecutive integers. Does the tagging project not yet support tagging in-line mathematics in tabular-like environments, or am I missing something? Thanks in advance.

  • Problem with tagging non-floating lstlisting
    by user2609605 on December 4, 2025 at 11:07 pm

    This is related with another question about tagging floating lstlisting environment. The example file is the following: \DocumentMetadata{lang=en-US,tagging=on} \documentclass{article} \usepackage{unicode-math} \usepackage{listings} \title{listings always problems} \author{E. Lister} \date{\today} \begin{document} \maketitle some text \begin{lstlisting}[language=tex, basicstyle=\small] \RequirePackage[l2tabu, orthodox]{nag} % optional \documentclass{...} \begin{document} ... \end{document} \end{lstlisting} \end{document} The result is as follows: Package tagpdf Warning: Parent-Child 'pdf:StructTreeRoot' --> 'pdf2:Part'. (tagpdf) Relation is not allowed! on line 27 (tagpdf) struct 1, StructTreeRoot --> struct 24, text-unit Package tagpdf Warning: Parent-Child 'pdf:StructTreeRoot' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 27 (tagpdf) struct 24, text-unit --> struct 25, text Package tagpdf Warning: Parent-Child 'pdf:StructTreeRoot' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 27 (tagpdf) struct 24, text-unit --> struct 26, text Package tagpdf Warning: Parent-Child 'pdf:StructTreeRoot' --> 'pdf2:Part'. (tagpdf) Relation is not allowed! on line 27 (tagpdf) struct 1, StructTreeRoot --> struct 28, text-unit Package tagpdf Warning: Parent-Child 'pdf:StructTreeRoot' --> 'pdf2:P'. (tagpdf) Relation is not allowed! on line 27 (tagpdf) struct 28, text-unit --> struct 29, text [2]<<latex-list-css.html>><<latex-align-css.html>> (./test2.aux) ! Package tagpdf Error: The number of automatic begin (10) and end (11) (tagpdf) text-unit para hooks differ! For immediate help type H <return>. ... l.27 \end{document} ? so does not even compile any more.. What happened?? Note that Understanding and avoiding tagpdf warning caused by floating lstlisting environment is a solution if lstlisting is floating. The solution is to insert after loading listings \usepackage{unicode-math} \usepackage{listings} \ExplSyntaxOn % Internal variable, temporary work-around! \prop_gput:Nnn\g__tag_float_sect_prop{lstlisting-struct}{\tag_get:n{current_Sect}} \ExplSyntaxOff Then the result is better but not good at all: al/texlive/2025/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]<<latex-list-css. html>><<latex-align-css.html>> (./test2.aux) ! Package tagpdf Error: The number of automatic begin (8) and end (9) (tagpdf) text-unit para hooks differ! For immediate help type H <return>. ... l.33 \end{document} I would also like to know the meaning of the errors.

  • Tagging seems to have wrong text [closed]
    by user2609605 on December 4, 2025 at 10:42 pm

    Short document: \DocumentMetadata{lang=en-US,tagging=on,pdfversion=2.0,pdfstandard={a-4f,UA-2}} \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage{color} \usepackage{unicode-math} \NewTaggingSocket{extFigAlt}{2} \NewTaggingSocketPlug{extFigAlt}{default} {% \par \tagstructbegin{tag=Figure,alt={#1}}% \tagmcbegin{}% \SuspendTagging{}% #2% \par \ResumeTagging{}% \tagmcend \tagstructend } \AssignTaggingSocketPlug{extFigAlt}{default} \title{On Tagging created pictures} \author{E. dos Santos} \date{\today} \begin{document} \maketitle \section{Introduction} Some text. \UseTaggingSocket{extFigAlt}% {Transformation of pics from fig format to TEX picture including a PDF.}% {\input{thePic}} \UseTaggingSocket{extFigAlt}% {Transformation of pics from gnuplot format to TEX picture including a PDF.}% {\input{F4_02gp2pdf.ptx}} {\setkeys{Gin}{alt={foo bar}}\input{thePic}} \end{document} compiles with lualatex without a warning. Verification with verapdf shows all standards claimed are reached. Also pdfinfo shows that the PDF created is tagged (clear for UA-2). BUT: pdfinfo -struct-text test.pdf unveils: Document <ID.002> Part <ID.005> P <ID.006> (block) P <ID.007> (block): /TextAlign /Center "On Tagging created pictures" P <ID.008> (block): /TextAlign /Center " E. Reißner" P <ID.009> (block): /TextAlign /Center "December 4, 2025" Sect <ID.010> H1 <ID.011> "��" (block) Span <ID.012> (inline) "1 " "Introduction" Part <ID.013> P <ID.014> (block): /TextAlign /Justify "Some text." Figure <ID.015> "postscriptxxx.figxxx.pdfxxx.ptxxxx.epsfig2dev -L pdftex_tfig2dev -L pstex_tfig2dev -L pdftexfig2dev -L pstex\includegraphics{xxx}\includegraphics{xxx}" Figure <ID.016> "xxx.gpxxx.pdfxxx.ptxxxx.epsgnuplot pdfgnuplot eps\includegraphics{xxx}\includegraphics{xxx}" Part <ID.017> P <ID.018> (block): /TextAlign /Justify Figure <ID.019>: /BBox [139.746 564.995 139.746 564.995] "postscript" Figure <ID.020>: /BBox [139.746 564.995 407.228 716.092] "xxx.figxxx.pdfxxx.ptxxxx.epsfig2dev -L pdftex_tfig2dev -L pstex_tfig2dev -L pdftexfig2dev -L pstex\includegraphics{xxx}\includegraphics{xxx}" Whereas I recognize the headline, the tagging of the figures seems heavily wrong. I would expect the alt text to occur somewhere. Instead some random labels from the figures, essentially picture environment seems to be in place. Note that the figures are created by fig2dev and so there is not alt text. If I modify inserting alt by hand, \begin{picture}[alt=some pdf](0,0) \includegraphics{thePic}% \end{picture}% % % Conversion of xxx.fig into xxx.ptx, xxx.pdf and xxx.eps % \setlength{\unitlength}{2072sp}% \begin{picture}[alt=some picture env](8492,4797)(1114,-4621) ... then pdfinfo returns something different, but alt text does not appear either. Maybe my expectations are wrong???

  • Vertical alignment of equations inside tabularx
    by Andi Bauer on December 4, 2025 at 8:34 pm

    I'm trying to put multiple numbered equations into one line to save space. One way to do this is to put the equations inside a tabularx table. However, when I try to put an equation environment inside a tabularx the vertical alignment is off: \documentclass{article} \usepackage{tabularx,amsmath} \begin{document} \begin{equation*} \begin{tabularx}{\textwidth}{m{0.4\textwidth}m{0.4\textwidth}} \begin{equation} \begin{pmatrix}1\\2\\3\end{pmatrix} \end{equation} & \begin{equation} x \end{equation} \end{tabularx} \end{equation*} \end{document} produces As you can see, the vertical alignment between the two labels (1) and (2) is slightly off. I've not been able to figure out what latex aligns in this case, it seems erratic to me. Changing the column type from m to p or b didn't fix the problem.

  • TikZ word search diagram v2
    by yannis on December 4, 2025 at 7:16 pm

    As a continuation of TikZ word search diagram here is the problem I'm facing. I did what Explorer suggested and it worked fine except that my rounded rectangles look like sausages or like Hieroglyphic cartouches because at their narrow ends they have lines on the secondary axis: Here is the code: \documentclass{article} \usepackage[cmyk]{xcolor} \definecolor{myPB}{cmyk}{0.85,0.75,0,0} \definecolor{myLB}{cmyk}{0.1,0.06,0,0} \usepackage{tikz} \usetikzlibrary{matrix,backgrounds} \newlength{\mydrawlinewidth} \setlength{\mydrawlinewidth}{1pt} \NewDocumentCommand{\markA}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5, line width=2pt,myPB,fill=myLB] ([xshift=5pt,yshift=-5pt]yannis-#2.north west) rectangle ([xshift=-5pt,yshift=5pt]yannis-#3.south east); } \NewDocumentCommand{\markB}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([yshift=2pt]yannis-#2.north) -- ([xshift=2pt]yannis-#3.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#2.west) -- cycle; } \NewDocumentCommand{\markC}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([xshift=2pt]yannis-#2.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#3.west) -- ([yshift=2pt]yannis-#2.north) -- cycle; } \begin{document} \begin{tikzpicture} \matrix (yannis) [% matrix of nodes,% column sep=0mm,% row sep=0mm, nodes={ % draw, rectangle,anchor=center, line width=0.5pt, inner sep=2pt,outer sep=0pt, %font=\bfseries\huge, minimum size=1.1cm, } ] { S & G & A & Q & Q & T & C & E & F & R & E & P & Y & W & R \\ W & L & Q & E & L & B & A & R & A & P & M & O & C & E & L \\ Y & I & T & S & X & E & L & I & Y & A & H & U & W & R & A \\ B & K & E & E & Y & C & W & L & J & T & M & A & K & B & F \\ J & E & R & I & O & R & T & M & K & E & R & L & Q & E & T \\ P & N & P & L & S & B & R & W & H & D & U & U & E & H & E \\ E & E & R & R & E & W & V & S & S & M & L & N & K & E & R \\ H & S & E & E & H & T & A & P & H & Y & S & I & C & A & L \\ S & S & T & D & S & H & E & U & Q & V & L & V & R & Z & I \\ O & R & N & N & I & F & L & L & A & S & N & E & E & K & F \\ M & T & I & U & N & L & G & E & P & H & U & R & A & S & E \\ W & K & O & Q & U & P & U & H & A & M & G & S & T & M & I \\ A & F & A & R & P & J & M & S & L & R & O & E & E & H & C \\ B & X & H & C & A & I & H & S & A & M & S & C & D & F & G \\ I & P & R & O & P & H & E & T & S & N & S & I & F & X & Q \\ }; \begin{scope}[on background layer] \markA{1-6}{1-12} \markA{1-14}{6-14} \markC{1-15}{7-9} \markA{2-2}{9-2} \markA{2-4}{2-13} \markA{3-3}{11-3} \markA{3-4}{11-4} \markA{3-6}{3-12} \markA{3-15}{11-15} \markC{4-11}{9-6} \markA{6-5}{13-5} \markA{6-12}{13-12} \markA{7-1}{11-1} \markB{7-5}{14-12} \markA{8-8}{8-15} \markA{8-13}{14-13} \markB{10-7}{15-12} \markB{11-2}{15-6} \markA{14-3}{14-10} \markA{15-2}{15-9} \end{scope} \end{tikzpicture} \end{document} How can I fix this? @mickep I replaced the snippets by a complete minimal example.

  • In `zref-clever` global options ovverride local ones
    by Máté Wierdl on December 4, 2025 at 4:43 pm

    Some global options to zref-clever override a local one. This seems to contradict the documentation which says "zcsetup has local effects, so it can be issued inside the respective environments for the purpose." Here is an example for the options cap and abbrev \documentclass{article} \usepackage{zref-clever} \zcsetup{nocap,noabbrev,reftype=lemma} % \AddToHook{env/theorem/begin} % {\zcsetup{cap,abbrev,reftype=equation}} \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem} \zcsetup{cap,abbrev,reftype=equation} \label{thm:1} We have $a=b$ \end{theorem} Setting \verb!cap! and \verb!abbrev! as direct options to \verb!\zcref! works: \zcref[cap,abbrev]{thm:1}, but otherwise it has no effect: \zcref{thm:1}. On the other hand, \verb!reftype! does work locally. \end{document} I remark that what I originally wanted to do was setting cap=true globally but nocap,abbrev for all equation and similar environments. I still don't know how to do that. If I set nocap,abbrev globally then figure is also affected.

  • Using acronyms in longtable causes a warning
    by jonnybolton16 on December 4, 2025 at 4:36 pm

    When using acronym commands inside a longtable alongside cleveref , I get the warning Label(s) may have changed. Rerun to get cross-references right., however clearing the cache / rerunning the compile doesn't fix it. It appears the problem is caused by a repeated use of the acronym inside the table, when it hasn't been used before the table but is subsequently used after it. Is there any way to fix this? \documentclass{article} \usepackage[parfill]{parskip} \usepackage{acronym} \usepackage{hyperref,cleveref} \usepackage{longtable} \usepackage{booktabs} \makeatletter \newcommand*{\org@overidelabel}{} \let\org@overridelabel\AC@verridelabel \renewcommand*{\AC@verridelabel}[1]{% \@bsphack \protected@write\@auxout{}{\string\AC@undonewlabel{#1@cref}}% \org@overridelabel{#1}% \@esphack }% \makeatother \begin{document} \section*{List of Abbreviations} \begin{acronym} \acro{ABC}{Australian Broadcasting Corporation} \acro{BBC}{British Broadcasting Corporation} \acro{CBC}{Canadian Broadcasting Corporation} \end{acronym} \section{Latex warning} The presence of acronyms in \Cref{tab:mylabel} causes Latex to produce the following warning: \textit{Label(s) may have changed. Rerun to get cross-references right.} Clearing the cache and rerunning has no effect. % In the table below, there is a repeated use of the \ac{BBC} acronym, % but there is only one use of the \ac{ABC} acronym; with both % acronyms in use here. There are also two uses of the CBC acronym in % the table, but that hasn't been used here. The problem is the % combination of the use of \ac{BBC} outside of the table, together % with two uses of it inside the table. Because \ac{ABC} is only used % once in the table, there is no warning. Similarly, because CBC is % not used outside the table, there is no warning. However, note that % because this paragraph comes before the table, the use of \ac{BBC} % before the table removes the warning. Commenting out this paragraph % causes the warning to appear. \begin{longtable}{ll} \caption{My caption.} \label{tab:mylabel}\\ Acronym & Meaning\\ \midrule \endfirsthead \multicolumn{2}{@{}l}{\small{Table \thetable{} (continued)}}\\ Acronym & Meaning\\ \midrule \endhead \multicolumn{2}{r@{}}{\footnotesize{(continued on next page)}}\\ \endfoot \endlastfoot \acs{ABC} & Australian Broadcasting Corporation\\ \acs{BBC} & \acl{BBC}\\ \acs{CBC} & \acl{CBC} \\ \end{longtable} In the table above, there is a repeated use of the \ac{BBC} acronym, but there is only one use of the \ac{ABC} acronym; with both acronyms in use here. There are also two uses of the CBC acronym in the table, but that hasn't been used here. The problem is the combination of the use of \ac{BBC} outside of the table, together with two uses of it inside the table. Because \ac{ABC} is only used once in the table, there is no warning. Similarly, because CBC is not used outside the table, there is no warning. (commenting out the \ac{BBC} line of the table proves this). \end{document}

  • During (expl3) *-map_inline, get the index of the considered item without any auxiliary integer
    by Denis Bitouzé on December 4, 2025 at 3:29 pm

    In the following MCE, I apply to every item stored within the \l_tmpa_clist clist an inline function that displays this item preceded by its index (its position in the list). For this index, an auxiliary integer is manually incremented at each item considered: \documentclass{article} \begin{document} \ExplSyntaxOn \clist_set:Nn \l_tmpa_clist {Foo,Bar,Baz} The~ \verb|\l_tmpa_clist|~ list~ has,~ as: \begin{itemize} \clist_map_inline:Nn \l_tmpa_clist { \int_incr:N \l_tmpa_int \item element~ \# \int_use:N\l_tmpa_int :~ #1 } \end{itemize} \ExplSyntaxOff \end{document} My question, not restricted to clists' mapping, is as follows: during *-map_inline, is it possible to access to the index of the considered item without the need to resort an auxiliary integer?

  • is it possible to keep the space when using url in latex
    by Dolphin on December 4, 2025 at 2:10 pm

    when facing the text in latex: Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser it could not wrap properly, so I tried to put the text with \url like this: \url{Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser} but the space was moved automatically. is it possible to keep the space? this is the full reproduce demo: \documentclass{article} \usepackage{xurl} \usepackage{hyperref} \usepackage{path} \begin{document} hello world!12\url{Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser} \end{document} this is the result has no space: I also tried to use \href command, still did not work.

  • Float too large with minipage of \textheight
    by schtandard on December 4, 2025 at 12:38 pm

    I sometimes want to put the content of a float on a page by itself and control the alignment in the usual type area. To do this, I use a minipage that has exactly the size \textwidth x \textheight. However, depending on the content (and the packages loaded), I get Float too large warnings. In the following example, both figures contain only a minipage with some text in them, the second one additionally has a footnote. For the first one I get a warning about the float being too large by 1.94397pt, for the second one by 2.85002pt. If I remove \usepackage[T1]{fontenc}, the first warning goes away, but the second stays. If I switch to LuaLaTeX, the first warning is back, this time about 2.06pt. Why does the minipage not perfectly fit the type area and how can I fix this? Why does it even depend on the minipage's content? I would have thought the whole point of a fixed-height minipage is that the height is, well, fixed. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lipsum} \begin{document} Hello World! \begin{figure}[p] \begin{minipage}[b][\textheight]{\textwidth} \lipsum[1] \end{minipage} \end{figure} \begin{figure}[p] \begin{minipage}[b][\textheight]{\textwidth} \lipsum[1]\footnote{test} \end{minipage} \end{figure} \end{document}

  • How to both use and pass on an option in a package
    by dedded on December 4, 2025 at 12:11 pm

    I can't figure out how to both use an option in a package and pass it to a second package. This will store to \cmdA in mwe_pkgA, but will not pass to mwe_pkgB: % -------------------------------- % mwe_pkgA.sty \ProvidesPackage{mwe_pkgA} \providecommand\cmdA{default-A} \DeclareKeys{ optA.store = \cmdA, } \PassOptionsToPackage{optA}{mwe_pkgB} \ProcessKeyOptions \RequirePackage{mwe_pkgB} \endinput This will pass optA to mwe_pkgB, but how can I also store to \cmdA in mwe_pkgA?: % -------------------------------- % mwe_pkgA.sty \ProvidesPackage{mwe_pkgA} \providecommand\cmdA{default-A} \DeclareKeys{ optA.code = \PassOptionsToPackage{\CurrentOption}{mwe_pkgB} } \ProcessKeyOptions \RequirePackage{mwe_pkgB} \endinput The mwe_pkgB.sty: % -------------------------------- % mwe_pkgB.sty \ProvidesPackage{mwe_pkgB} \providecommand\cmdB{default-B} \DeclareKeys{ optA.store = \cmdB, } \ProcessKeyOptions \endinput The document loading mwe_pkgA.sty: % -------------------------------- % mydoc.tex \documentclass{article} \usepackage[optA=newA]{mwe_pkgA} \begin{document} cmdA: \cmdA cmdB: \cmdB \end{document}

  • Embedding Arabic using polyglossia and lualatex
    by MJM on December 4, 2025 at 11:19 am

    I am trying to make a document with English and Arabic letters. Due to package support, I need to use PDFLaTeX or LuaLaTex. I have Amiri and Noto Sans Arabic installed, but when I use the \begin{arabic} command I get an error about a missing number. Here's a minimum (non)working document: \documentclass[10pt, twocolumn]{article} \usepackage{polyglossia} \setmainlanguage[variant=us]{english} \setotherlanguage{arabic} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \title{Arabic} \author{} \date{} \begin{document} \maketitle Hello world \begin{arabic}عائشة\end{arabic} \end{document} I get the following error: ! Missing number, treated as zero. <to be read again> \c@ع l.18 \begin{arabic}ع ائشة\end{arabic} ? S OK, entering \scrollmode... Missing character: There is no ا (U+0627) in font [lmroman10-regular]:+tlig;! The errors continue that the characters aren't found. What number is missing? Why are the characters not showing?

  • Diagonal Arrows Under an Equation
    by Lucy on December 4, 2025 at 10:13 am

    I need to put diagonal arrows under an equation (the red ones in the picture). I tried using \swarrow \qquad \searrow, but they are not positioned where I need them. I would prefer not to use tikzmark. Is there another way to achieve this? Thanks for your help. \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage[T1]{fontenc} \usepackage{pgfplots} \usepackage{multicol,array,tabularx,xcolor,enumitem} \usepackage{amsmath,amsfonts,amssymb,mathrsfs} \pagestyle{empty} % % % % \definecolor{modra}{cmyk}{1,0,0,0} %%%%DEFINCIE%%%%%BARVY \definecolor{cerna}{cmyk}{0,0,0,1} \definecolor{bila}{cmyk}{0,0,0,0} % %\color{modra} % \begin{document} \begin{align*} S & = \rho \cdot \dfrac{a + b +c}{2} & S & = \dfrac{a \cdot b}{2} \\ \rho \cdot \dfrac{a + b +c}{2} & = \dfrac{a \cdot b}{2} \qquad | \cdot 2 & & \\ 18 (a +b+ c ) & = a \cdot b & a & = b \\ 18 (a + a + c ) & = a \cdot a & c^2 & = a^2 + b^2 \\ 18 (2a + c ) & = a^2 & c^2 & = a^2 + a^2 = 2a^2 \\ 36 a + 18 c & = a^2 & c & = \sqrt{2a^2} = a \sqrt{2} \\ 36 a + 18 a \sqrt{2} & = a^2 & & \\ a^2 - 36 a - 18 a \sqrt{2} & = 0 & & \\ a \left( a - 36 - 18 \sqrt{2} \right) & = 0 & & \\ \Large \swarrow \qquad \searrow \end{align*} % % \end{document}

  • Is that possible to tweak the related location and scale in the nested integral formula?
    by Explorer on December 4, 2025 at 10:02 am

    My previous question's actual case is as below: In this YouTube link, it introduced a following nested integral question: Or the simpler the SAME one: The most important patterns, here, is described as below, the Recursive Formula: Now I have the following code: \documentclass[border=5pt]{standalone} \usepackage{amsmath} \usepackage{fourier} \usepackage{cmupint} \usepackage{fixdif} \parindent=0pt % \DeclareMathOperator{\myint}{\int\nolimits} \DeclareRobustCommand{\myint}{\int\nolimits} \newcommand{\basicint}{\myint_0^1xdx} \newcommand{\basicintt}{\myint_{\basicint}^{\basicint}xdx} % https://tex.stackexchange.com/a/5192/322482 \makeatletter \newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}} \newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}} \makeatother \newcommand{\originintunit}{% \displaystyle\myint_{ \textstyle\myint^{0}_{\basicintt} }^{ \textstyle\myint_{1}^{\basicintt} } }% \newcommand{\intunit}[2]{% \myint_{ \myint^{0}_{\myint_{#1}^{\basicint}xdx} }^{ \myint_{1}^{\myint_{\basicint}^{#2}xdx} } } \ExplSyntaxOn % \cs_generate_variant:Nn \tl_use:N {V} \tl_new:N \l_explorer_base_tl \tl_new:N \l_explorer_tmp_tl \tl_new:N \l_explorer_script_tl \tl_new:N \g_explorer_tmp_tl \cs_new_protected:Npn \typeset_integral_recursive:Nn #1#2 { % #1:tl to store % #2:depth \group_begin: \tl_set_eq:NN \l_explorer_tmp_tl #1 \int_compare:nNnTF { #2 } = { 1 } { \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\basicint}{\basicint} } } { \tl_clear:N \l_explorer_script_tl \typeset_integral_recursive:Nn \l_explorer_script_tl { \int_eval:n { #2 - 1 } } \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\l_explorer_script_tl}{\l_explorer_script_tl} } } \tl_put_right:Nn \l_explorer_tmp_tl { xdx } \tl_gset_eq:NN \g_explorer_tmp_tl \l_explorer_tmp_tl \group_end: \tl_set_eq:NN #1 \g_explorer_tmp_tl } % \typeset_integral_recursive:Nn \l_explorer_base_tl { 4 } \NewDocumentCommand{\explorerint}{ m }{ \begingroup \typeset_integral_recursive:Nn \l_explorer_base_tl { #1 } $\l_explorer_base_tl$ \endgroup } \ExplSyntaxOff \begin{document} \explorerint{3} \end{document} But it gives the following, with no tweak of the location of subscript and superscript. I don't think in this case, l3coffin could handle better than just recursion with l3tl, but it's not easy for me, now, to tweak the sub/superscript's position, and the \int's scale, to make the final result looks more like an \int "tower". Any suggestions or perspectives would be welcome! And IMO, this question, deserved my bounty😀. I would start one in three days.

  • The defined date command doesn't work before \today when invoking babel
    by M. Logic on December 4, 2025 at 4:41 am

    A MWS is as follows. \documentclass{ctexart} \usepackage[main=chinese, provide=*]{babel}% \babelprovide{greek} \babelfont[greek]{rm}[Scale=MatchUppercase, ItalicFont={GFSArtemisiaIt.otf}, BoldFont={GFSArtemisiaBold.otf}, BoldItalicFont={GFSArtemisiaBoldIt.otf}]{GFSArtemisia.otf} \usepackage{datetime}%after babel package \newdateformat{eightdate}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}} \title{测试} \author{佚名} \date{} \begin{document} \maketitle \verb|\today| works fine, i.e., it produces \today. While \verb|\eightdate| doesn't work before \verb|\today|, i.e., \verb|\eightdate\today| also produces \today, but I'd like \verb|\eightdate\today| to produce 20251204. \end{document} \today works fine, i.e., it produces 2025年12月4日. While \eightdate doesn't work before \today, i.e., \eightdate\today also produces 2025年12月4日, but I'd like \eightdate\today to produce 20251204. Then how to make both \today and \eightdate\today work as desired when invoking babel and datetime? Note that \usepackage[main=chinese, provide=*]{babel} is for special use.

  • How to reset poles of coffins with two attachment?
    by Explorer on December 3, 2025 at 5:07 pm

    I have the following code: \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_int_left_coffin \coffin_new:N \l_int_right_coffin \coffin_new:N \l_base_int_coffin \hcoffin_set:Nn \l_base_int_coffin { \myint } \coffin_new:N \l_dx_int_coffin \hcoffin_set:Nn \l_dx_int_coffin { $\d x$ } \coffin_new:N \l_tmp_coffin \coffin_set_eq:NN \l_tmp_coffin \l_base_int_coffin \coffin_scale:Nnn \l_tmp_coffin { .5 } { .5 } % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_join:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_base_int_coffin \coffin_display_handles:Nn \l_base_int_coffin {magenta} \ExplSyntaxOff \end{document} Now the poles is as below: What I want, is the GREEN coffin's border. The key code here is: % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_join:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } If I use two join, two small \int is not vertical align. I also try to make the final \l_base_int_coffin into a \fbox, together with two attach, but also failed, the border is still not what I want: \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_int_left_coffin \coffin_new:N \l_int_right_coffin \coffin_new:N \l_base_int_coffin \hcoffin_set:Nn \l_base_int_coffin { \myint } \coffin_new:N \l_dx_int_coffin \hcoffin_set:Nn \l_dx_int_coffin { $\d x$ } \coffin_new:N \l_tmp_coffin \coffin_set_eq:NN \l_tmp_coffin \l_base_int_coffin \coffin_scale:Nnn \l_tmp_coffin { .5 } { .5 } % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_base_int_coffin \hcoffin_set:Nn \l_tmpa_coffin { \fbox{\coffin_typeset:Nnnnn \l_base_int_coffin{l}{vc}{0pt}{0pt}} } \coffin_display_handles:Nn \l_tmpa_coffin {magenta} \ExplSyntaxOff \end{document} Is there elegant method to get my desired \l_base_int_coffin's border? Edit with more general case Since cfr has given a tricky r handles' solution to solve my original question, but my case has a more widely-extensive case(Let's consider that the TWO sub-coffins is not hold the some width): \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_explorer_int_left_coffin \coffin_new:N \l_explorer_int_right_coffin \coffin_new:N \l_explorer_base_int_coffin \coffin_new:N \l_explorer_dx_int_coffin \coffin_new:N \l_explorer_tmp_coffin \coffin_new:N \l_explorer_tmpA_coffin \coffin_new:N \l_explorer_tmpB_coffin \hcoffin_set:Nn \l_explorer_base_int_coffin { \myint } \hcoffin_set:Nn \l_explorer_dx_int_coffin { $\d x$ } \coffin_set_eq:NN \l_explorer_tmp_coffin \l_explorer_base_int_coffin \coffin_set_eq:NN \l_explorer_tmpA_coffin \l_explorer_base_int_coffin \coffin_set_eq:NN \l_explorer_tmpB_coffin \l_explorer_base_int_coffin \coffin_scale:Nnn \l_explorer_tmpA_coffin { .5 } { .5 } \coffin_scale:Nnn \l_explorer_tmpB_coffin { 1.5 } { .25 } % first \coffin_attach:NnnNnnnn \l_explorer_base_int_coffin { r } { t } \l_explorer_tmpA_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_attach:NnnNnnnn \l_explorer_base_int_coffin { r } { b } \l_explorer_tmpB_coffin { l } { vc } { 0pt } { 0pt } % just use `r' would shift back too much, for not the same width of `\l_explorer_tmpA_coffin' and `\l_explorer_tmpB_coffin' % \coffin_join:NnnNnnnn \l_explorer_base_int_coffin { r } { b } \l_explorer_tmpB_coffin { r } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_explorer_base_int_coffin \coffin_display_handles:Nn \l_explorer_base_int_coffin {magenta} \ExplSyntaxOff \end{document}

  • Why does forest baseline alignment seem to stop, once drawing circles around each node?
    by MS-SPO on December 3, 2025 at 10:05 am

    Situation While working on this forest-based solution I was puzzled by the vertical alignment, once I draw circles around the nodes. So for test purposes I copied said basic tree three times: left: without any forest preamble right: preamble only names nodes (for later use) middle: also draws a circle around each node Observations Comparing left and right all characters seem to align by their baselines (light-blue). For the middle one this is more puzzling: light-pink: b, c, d seem to match baselines, but this can be accidental e and f as well, while g and i clearly don't light-blue: k, l, m, y, z seem to "do what they want" orange: there seems to be a tendency to roughly align the circles south (with content dependent size variation from Tikz) Question Actually I have two questions, which are connected like face and back of a coin: how to understand the forest-way of these vertical alignments (middle)? how to obtain baseline alignments for the nodes content (characters, light-blue) instead of the shapes south? I see that this solution seems to solve a similar problem, but honestly I'm lost at the moment in identifying the relevant alignment statements introduced. Code \documentclass[10pt,border=3mm]{standalone} \usepackage{forest} \begin{document} % ~~~ correct baselining ~~~~~~~~~~~ \begin{forest} [a, label=north:baselined [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} % ~~~ incorrect/unexpected ~~~~~~~~~~~~ \begin{forest} delay={ for tree={ name/.option=content,% now node name is same as content circle,draw, % nodes as circles, }, } [a, label=north:{well \dots} [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} % ~~~ correct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{forest} delay={ for tree={ name/.option=content,% now node name is same as content % circle,draw, % nodes as circles, }, } [a, label=north:baselined [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} \end{document}

  • Re-typesetting the result of \unvbox
    by Frisket on December 2, 2025 at 10:30 pm

    If I typeset some text into a \vbox narrower than the rest of the document, I can \vsplit some of it to use, but I then want the remainder re-typeset to the text width of the document. Here is an example of it not working (the \unvbox'd material is at the width it was set at and is not being reset to the main width): \documentclass{article} \usepackage{lipsum} \begin{document} \setbox0=\vbox{\divide\hsize by2\lipsum[2]} \vsplit0 to2cm \hrule % added to show where the split occurs \unvbox0 \end{document} In my innocence I understood from the TeXbook and elsewhere that the glue at the top level in the remainder of the box after \vsplitting would be unset, making the contents available for use (in my case, the contents will always be plain text with no macros). I see a number of specialist solutions (eg Centering contents after \unvbox) but they all involve taking special action on the \unvbox'd material, which contains all kinds of other stuff like alignments, whereas I need to have it treated as if it were fresh text.

  • Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)?
    by Jasper on December 2, 2025 at 5:38 pm

    Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)? The only way I can think of it so string check each letter, but that sounds too computationally expensive. M(non)WE: \documentclass[tikz,border=1cm]{standalone} \newcommand{\letterpos}[1]{ \pgfmathparse{#1 == a} \ifnum\pgfmathresult=1 1 \fi \pgfmathparse{#1 == ab} \ifnum\pgfmathresult=1 2 \fi \pgfmathparse{#1 == c} \ifnum\pgfmathresult=1 3 \fi \pgfmathparse{#1 == d} \ifnum\pgfmathresult=1 4 \fi \pgfmathparse{#1 == e} \ifnum\pgfmathresult=1 5 \fi } \begin{document} \begin{tikzpicture} \foreach \letter in {a,b,...,e} { \node at (\letterpos{\letter},0) {\letter}; } \end{tikzpicture} \end{document}

  • Section title with \star
    by Roberto Rastapopoulos on December 2, 2025 at 1:47 pm

    I am trying to get the following: But when I insert it in this way: \documentclass[a4paper,12pt]{amsart} \usepackage{hyperref} \begin{document} \tableofcontents \section{Introduction} \subsection{$\star$ N-Soliton solutions} Some text about N-soliton solutions... \end{document} I get the error "Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `math shift' [...]". When I write \subsection{\star N-Soliton solutions} I get How can I get the first one without the error? I have tried several things, but all come with another problem.