• fix spacing in ∰ \oiiint
    by mathrm alpha on June 14, 2026 at 5:59 am

    Although I used his/her method and got \oiiint, the not big display mode spacing wasn't handled well. https://tex.stackexchange.com/a/404609/329597 \documentclass{article} \usepackage{esint} \newcommand{\oiiint}{\oiint \hspace{-13.5pt} \int} \begin{document} $A\oiiint B$\\ \[A \oiiint B\] \end{document}

  • Coil decoration on curved path looks strange
    by nogrodrigo on June 13, 2026 at 3:52 pm

    I am trying to achieve something like this in TikZ: The black path should go straight up and the red one should go down bent to the right, both must look like a coil. I have tried to do this using bezier curves and arcs, but the coil decoration of the bent path looks very strange, it's pointy in some parts. What am I doing wrong? MWE: \documentclass{article} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture} \draw[-latex, decorate, decoration = {coil, aspect = 1.2}, color = red] (0,2) arc (90:-90:1); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}] (0,0) -- (0,2); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}] (3,0) -- (3,2); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}, color = red] (3,2) .. controls (4,2) and (4,0) .. (3,0); \end{tikzpicture} \end{document}

  • Tikz customize in big operators symbols, can't display big tikz operators
    by mathrm alpha on June 13, 2026 at 8:59 am

    I followed the LaTeX question reference below to adapt it to the tikz big operators version, but it didn't display in tikz "⅌" symbol. How can I define a big plus operator that works like \bigcup? ⅌ apply in tikz text symbols? % Source - https://tex.stackexchange.com/a/394912 % Posted by GuM, modified by community. See post 'Timeline' for change history % Retrieved 2026-06-13, License - CC BY-SA 3.0 \documentclass{article} \usepackage{tikz,iftex,amsmath} \usepackage{graphicx} \makeatletter \newcommand*\@bigper[1]{\vcenter{\hbox{#1$\m@th ⅌$}}} \newcommand*\bigper{% \DOTSB % omit this line if you are not using the amsmath package \mathop{% \mathchoice {\@bigper ⅌}% {\@bigper \LARGE}% {\@bigper {}}% {\@bigper \footnotesize}% }% \slimits@ % omit this line if you are not using the amsmath package } \makeatother \ifPDFTeX \usepackage[utf8]{inputenc} \else \usepackage{newunicodechar} \fi \DeclareRobustCommand{\TikZPerSign}{% \tikz[ baseline=-.25ex, x=.13em, y=.13em, line cap=round, line join=round ]{% % Fixed box: this is important for text-like behaviour. \path[use as bounding box] (-3.05,-3.35) rectangle (3.95,4.35); % 1. The horizontal ellipse \draw[line width=.05em] (0.4,0) ellipse[x radius=2.2,y radius=.7]; % 2. The main U shape \draw[line width=.05em] (-.6,1.5) .. controls (-.6,-3.2) and (.6,-3.2) .. (.6,1.5); % 3. The top-left flourish \draw[line width=.05em] (-.6,1.5) .. controls (-1.8,2.8) and (-3.0,1.5) .. (-2.2,1.2); \fill (-.5,1.9) circle[radius=.22]; % 4. The large right loop \draw[line width=.05em] (.6,1.5) .. controls (.6,4.2) and (3.5,3.2) .. (3.5,.5) .. controls (3.5,-.8) and (2.5,-1.2) .. (1.8,-1.0); }% } \ifPDFTeX \DeclareUnicodeCharacter{214C}{\TikZPerSign} \else \newunicodechar{⅌}{\TikZPerSign} \fi \begin{document} $$\sum^1_2 \bigper^3_4$$ \end{document}

  • Moving from listings to piton
    by Pablo González L on June 13, 2026 at 1:04 am

    I'm trying to migrate from listings to piton, but unfortunately, piton doesn't have native support for Lua. From what I can understand of the documentation, I've modified lstlang2 and converted it to piton, but I don't understand how \NewPitonLanguage works or how to color things with \SetPitonStyle. This is my compiled file, but it's not producing the expected result: \documentclass{article} \usepackage[osf,nomath,mono=false,ScaleSF=0.95,ScaleRM=0.95]{libertinus-otf} \usepackage{sourcecodepro} \defaultfontfeatures[\ttfamily] { Numbers = OldStyle, Scale = 0.84249, Extension = .otf, } \setmonofont[ UprightFont = *-Regular, ItalicFont = *-RegularIt, BoldFont = *-Semibold, BoldItalicFont = *-SemiboldIt, RawFeature = {+zero,+ss01}]{SourceCodePro} \usepackage{unicode-math} \setmathfont[Scale = 0.95]{latinmodern-math.otf} \usepackage{piton} % (Pygments colors) \definecolor{pyg_comment}{HTML}{408080} \definecolor{pyg_string}{HTML}{BA2121} \definecolor{pyg_keyword}{HTML}{000080} \definecolor{pyg_builtin}{HTML}{008000} \definecolor{pyg_function}{HTML}{0000FF} \definecolor{pyg_punct}{HTML}{A020F0} % New languaje \NewPitonLanguage{SpintentLua}{ sensitive = true, alsoletter = {.}, morecomment = [l]{--}, morecomment = [s]{--[[}{]]}, morestring = [b]", morestring = [b]', morestring = [s]{[[}{]]}, morekeywords = [Delim]{ (, ), [, ] }, % Clase nativa: Keyword (Por defecto si no se especifica corchetes) morekeywords = { and, break, do, else, elseif, end, false, for, function, goto, if, in, local, nil, not, or, repeat, return, then, true, until, while }, % Clase nativa: Name.Builtin (Para funciones del sistema) morekeywords = [Name.Builtin]{ _ENV, _G, _PROMPT, _PROMPT2, _VERSION, arg, assert, collectgarbage, coroutine, coroutine.create, coroutine.isyieldable, coroutine.resume, coroutine.running, coroutine.status, coroutine.wrap, coroutine.yield, debug, debug.debug, debug.gethook, debug.getinfo, debug.getlocal, debug.getmetatable, debug.getregistry, debug.getupvalue, debug.getuservalue, debug.sethook, debug.setlocal, debug.setmetatable, debug.setupvalue, debug.setuservalue, debug.traceback, debug.upvalueid, debug.upvaluejoin, dofile, error, getmetatable, io, io.close, io.flush, io.input, io.lines, io.open, io.output, io.popen, io.read, io.stderr, io.stdin, io.stdout, io.tmpfile, io.type, io.write, ipairs, load, loadfile, math, math.abs, math.acos, math.asin, math.atan, math.ceil, math.cos, math.deg, math.exp, math.floor, math.fmod, math.huge, math.log, math.max, math.maxinteger, math.min, math.mininteger, math.modf, math.pi, math.rad, math.random, math.randomseed, math.sin, math.sqrt, math.tan, math.tointeger, math.type, math.ult, next, os, os.clock, os.date, os.difftime, os.execute, os.exit, os.getenv, os.remove, os.rename, os.setlocale, os.time, os.tmpname, package, package.config, package.cpath, package.loaded, package.loadlib, package.path, package.preload, package.searchers, package.searchpath, pairs, pcall, print, rawequal, rawget, rawlen, rawset, require, select, setmetatable, string, string.byte, string.char, string.dump, string.find, string.format, string.gmatch, string.gsub, string.len, string.lower, string.match, string.pack, string.packsize, string.rep, string.reverse, string.sub, string.unpack, string.upper, table, table.concat, table.insert, table.move, table.pack, table.remove, table.sort, table.unpack, tonumber, tostring, type, utf8, utf8.char, utf8.charpattern, utf8.codepoint, utf8.codes, utf8.len, utf8.offset, xpcall }, % Clase nativa: Name.Function (custom API) morekeywords = [Name.Function]{ register_tex_cmd, scan_string, set_macro, clean_lexical_accents, luafun_spmoney_parse, __spintent_money_render, luafun_spdate_parse, luafun_sptime_parse, spintent_gcd_algorithm } } \SetPitonStyle { Comment = \color{pyg_comment}\fontfamily{lmtt}\small\itshape, String = \color{pyg_string} , Keyword = \color{pyg_keyword}\bfseries , Name.Builtin = \color{pyg_builtin}\bfseries , Name.Function = \color{pyg_function} , Delim = \color{pyg_punct}, } \NewPitonEnvironment{luapiton}{ !O{} } {\PitonOptions{language=SpintentLua, #1}}{} \begin{document} \begin{luapiton} -- "Submódulo Financiero: Core de validación estructural spintent" local token = token local luatexbase = luatexbase function luafun_spmoney_parse() -- Captura bidireccional nativa libre de expansiones TeX local raw_input = token.scan_string() local clean_num = string.gsub(raw_input, "%s+", "") if not clean_num:match("^[%+%-]?%d+$") then token.set_macro("l__spintent_money_status_str", "error") return "error" end -- El Puente del Millón requiere inyección canónica token.set_macro("l__spintent_money_bridge_str", "true") return "success" end local function spintent_gcd_algorithm(val_a, val_b) while val_b ~= 0 do val_a, val_b = val_b, val_a % val_b end return val_a end \end{luapiton} \end{document} How do I define a new language in piton so that it's beautifully colored? I want to copy more or less the style of the lua-widow-control documentation (which is written in ConTeXt).

  • Why doesn't \DeclareMathAlphabet applied with \bm or \boldsymbol automatically search for bx style edition?
    by mathrm alpha on June 12, 2026 at 9:26 pm

    Although you can define \mathsfit or \mathsfbfit using \DeclareMathAlphabet, it \mathsfit doesn't work within \bm or \boldsymbol. The key point is that using \bm or \boldsymbol with the \DeclareMathAlphabet math-fonts format will not automatically search for the bx edition style. \documentclass{article} \usepackage{bm} \DeclareMathAlphabet{\mathsfit}{OT1}{lmss}{m}{sl} \DeclareMathAlphabet{\mathsfbfit}{OT1}{lmss}{bx}{sl} \begin{document} use boldsymbol: $\boldsymbol{\mathsfit{ABCabc}}$\\ use bm: $\bm{\mathsfit{ABCabc}}$\\ direct sans-serif bold italic: $\mathsfbfit{ABCabc}$\\ \end{document}

  • vertical line between items symbol in itemize environment
    by Aviroum on June 12, 2026 at 2:07 pm

    Is it possible to add a vertical line to the itemize environment, starting before the first item and continuing between each item until the end? similar to this, but line start before. \starttext \startitemize[5] \item text \item text \item text text. \stopitemize \stoptext

  • Unexpected sansmath behaviour after recent TeXLive update
    by Marius Jansen on June 12, 2026 at 7:26 am

    I have noticed that after a recent TexLive update, the behaviour of the sansmath package has changed. The two example below illustrate: The instructions: \documentclass{article} \usepackage{sansmath} \begin{document} \sansmath This is normal text. \begin{tabular}{ll} One & Two \\ \end{tabular} and the rest of the document follows. \end{document} result in the contents of the tabular environment to be italized (as if it is in a math environment). This is new, unexpected behaviour. If the \sansmath is omitted, then the content of the tabular environment is not placed in italics: \documentclass{article} \usepackage{sansmath} \begin{document} This is normal text. \begin{tabular}{ll} One & Two \\ \end{tabular} and the rest of the document follows. \end{document} I will greatly appreciate any advice on how to revert to the behaviour of \sansmath to what is expected: it impacts only math environments.

  • How do I draw the feedback loop in my latex code for my research paper?
    by Sajid Mahfuz on June 11, 2026 at 10:21 pm

    How do I create the feedback loop shown in the image? I’ve also been trying to make all the arrow lengths uniform, but I keep failing (bear with me, I’m a beginner in LaTeX), and I need the diagram to be larger. I’ve attached my code and the image. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, calc} \begin{document} \begin{center} \begin{tikzpicture}[ node distance=1.2cm and 1.2cm, block/.style={ draw, rectangle, minimum width=2.5cm, minimum height=0.9cm, line width=1pt, align=center }, innerblock/.style={ draw, rectangle, minimum width=1.8cm, minimum height=0.9cm, line width=1pt, % changed from 0.5pt to 1pt align=center }, disturbance/.style={ draw, rectangle, minimum width=1.8cm, minimum height=0.9cm, fill=red!10, line width=1pt, align=center }, arrow/.style={-{Triangle[length=2mm,width=2mm]}, line width=1pt} ] % ================= INPUT ================= \node[circle, draw, minimum size=0.8cm, line width=1pt] (sum) at (0,0) {}; % changed to 1pt % X inside circle (also 1pt) \draw[line width=1pt] (sum.north east) -- (sum.south west); \draw[line width=1pt] (sum.north west) -- (sum.south east); \draw[arrow] (-1.2,0) -- (sum.west); \node[left=1.2cm] {$Z_D$}; % ================= CONTROL ================= \node[block, above right=0.5cm and 1.0cm of sum] (sdre) {SDRE}; \node[block, below right=0.5cm and 1.0cm of sum] (pi) {PI}; \draw[arrow] (sum.east) -- ++(0.2,0) |- (sdre.west); \draw[arrow] (sum.east) -- ++(0.2,0) |- (pi.west); % ================= ACTUATION ================= \node[block, right=1.0cm of sdre] (actuator) {Actuator}; \node[block, right=1.0cm of pi] (thrust) {Thrust}; \draw[arrow] (sdre.east) -- (actuator.west); \draw[arrow] (pi.east) -- (thrust.west); % ================= THRUST MAP ================= \node[block, below=0.8cm of pi] (thrustMap) {Thrust Map}; \draw[arrow] (pi.south) -- (thrustMap.north); \draw[arrow] (thrustMap.east) -| (thrust.south); % ================= DYNAMICS ================= \node[innerblock, right=1.0cm of actuator] (att_dyn) {Attitude Dynamics}; \node[innerblock, right=1.0cm of thrust] (alt_dyn) {Altitude Dynamics}; \draw[arrow] (actuator.east) -- (att_dyn.west); \draw[arrow] (thrust.east) -- (alt_dyn.west); % ================= DISTURBANCES ================= \node[disturbance, above=0.6cm of att_dyn] (distAtt) {Gust}; \node[disturbance, below=0.6cm of alt_dyn] (distAlt) {Gust}; \draw[arrow] (distAtt.south) -- (att_dyn.north); \draw[arrow] (distAlt.north) -- (alt_dyn.south); % ================= OUTPUT MERGE ================= \coordinate (mergeTop) at ($(att_dyn.east)+(0.6,0)$); \coordinate (mergeBottom) at ($(alt_dyn.east)+(0.6,0)$); \draw[line width=1pt] (att_dyn.east) -- (mergeTop); \draw[line width=1pt] (alt_dyn.east) -- (mergeBottom); \draw[line width=1pt] (mergeTop) -- (mergeBottom); % Midpoint of the vertical line \coordinate (mergeMid) at ($(mergeTop)!0.5!(mergeBottom)$); % Output arrow from that midpoint \draw[arrow] (mergeMid) -- ++(0.8,0) node[right] {Output}; \end{tikzpicture} \end{center} \end{document}

  • How to define a 'smart', resizeable paired-brace delimiter macro that supports set-builder notation and line-breaking at commas in inline math mode?
    by Nyx on June 11, 2026 at 3:00 pm

    In [1] we have the following MWE of the definition and use-cases of a \set macro, which is a resizeable paired-brace delimiter with \suchthat detection for set-builder notation. \documentclass[varwidth]{standalone} \usepackage{amsmath} \usepackage{xparse} \newcommand{\suchthat}{\mid} \ExplSyntaxOn \NewDocumentCommand{\set}{som} { % limit the scope for \suchthat \group_begin: \cs_set_protected:Npn \suchthat { \tl_use:N \l__egreg_set_st_tl } \IfBooleanTF{#1} { \egreg_set_auto:n { #3 } } { \egreg_set_fixed:nn { #2 } { #3 } } \group_end: } \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_st:n { \tl_set:Nn \l__egreg_set_st_tl { #1 } } \cs_new_protected:Nn \egreg_set_auto:n { \__egreg_set_st:n { \nonscript\; \middle\vert \nonscript\; } \left\{ #1 \right\} } \cs_new_protected:Nn \egreg_set_fixed:nn { \tl_if_novalue:nTF { #1 } { \__egreg_set_st:n { \mid } \lbrace #2 \rbrace } { \__egreg_set_st:n { \mathrel{#1\vert} } \mathopen{#1\lbrace} #2 \mathclose{#1\rbrace} } } \ExplSyntaxOff \begin{document} $\set{a,b,c}\cup\set[\big]{a,b,c}$ $\set{x\suchthat a<x<b}$ $\set[\Big]{x\suchthat a<x<b}$ $\set*{x\suchthat \dfrac{1}{2}<x<3}$ \end{document} In [2] we have the following MWE of the definition and use-cases of a \splitatcommas macro, which allows for line breaks at commas inside inline math mode. \documentclass{article} \ExplSyntaxOn \NewDocumentCommand{\splitatcommas}{m} { \group_begin: \int_compare:nNnF { \char_value_mathcode:n {`,} }= {"8000} { \char_set_active_eq:nN {`,} \__kennytm_comma: \char_set_mathcode:nn {`,} {"8000} } #1 \group_end: } \cs_new_protected:Ne \__kennytm_comma: { \mathchar\char_value_mathcode:n {`,}~ \penalty0~\exp_not:n { \hspace{0pt plus 1em} } } \ExplSyntaxOff \newcommand{\tuple}[1]{(\splitatcommas{#1})} \newcommand{\set}[1]{\{\splitatcommas{#1}\}} \begin{document} \setlength{\lineskiplimit}{2pt}\setlength{\lineskip}{3pt} % for this particular case \setlength{\parindent}{0pt} % just for this example $\splitatcommas{ \frac{1}{2},\frac{3}{5},\frac{8}{13},\frac{21}{34},\frac{55}{89}, \frac{144}{233},\frac{377}{610},\frac{987}{1597},\frac{2584}{4181}, \frac{6765}{10946},\frac{17711}{28657},\frac{46368}{75025}, \frac{121393}{196418},\frac{317811}{514229},\frac{832040}{1346269}, \frac{2178309}{3524578},\frac{5702887}{9227465}, \frac{14930352}{24157817},\frac{39088169}{63245986},\frac{102334155}{165580141} }$ \medskip $\set{ \tuple{a,b,c,d},\tuple{1,2,3,4,5,6},\tuple{11,22,33,44,55,66,77,88}, \tuple{a,b,c,d},\tuple{1,2,3,4,5,6},\tuple{11,22,33,44,55,66,77,88}, \tuple{a,b,c,d},\tuple{1,2,3,4,5,6},\tuple{11,22,33,44,55,66,77,88}, \tuple{a,b,c,d},\tuple{1,2,3,4,5,6},\tuple{11,22,33,44,55,66,77,88} }$ \end{document} My question is How can I define a 'smart', resizeable paired-brace delimiter macro that supports set-builder notation and line-breaking at commas in inline math mode (i.e., combine \set from [1] and \splitatcommas from [2])? The following is an MWE of my attempt so far. \documentclass[ border={10pt}, varwidth, ]{standalone} \usepackage{unicode-math} % \usepackage{amsmath} % Loaded by `unicode-math` \usepackage[default]{fontsetup} % For NewCM \usepackage{mleftright} % \usepackage{xparse} % Integrated into the kernel from 2020-10-01 \newcommand{\suchthat}{\mid} \ExplSyntaxOn \NewDocumentCommand{\setaux}{som} { % limit the scope for \suchthat \group_begin: \cs_set_protected:Npn \suchthat { \tl_use:N \l__egreg_set_st_tl } \IfBooleanTF{#1} { \egreg_set_auto:n { #3 } } { \egreg_set_fixed:nn { #2 } { #3 } } \group_end: } \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_st:n { \tl_set:Nn \l__egreg_set_st_tl { #1 } } \cs_new_protected:Nn \egreg_set_auto:n { \__egreg_set_st:n { \nonscript\; \middle\vert \nonscript\; } \left\{ #1 \right\} } \cs_new_protected:Nn \egreg_set_fixed:nn { \tl_if_novalue:nTF { #1 } { \__egreg_set_st:n { \mid } \lbrace #2 \rbrace } { \__egreg_set_st:n { \mathrel{#1\vert} } \mathopen{#1\lbrace} #2 \mathclose{#1\rbrace} } } \NewDocumentCommand{\splitatcommas}{m} { \group_begin: \int_compare:nNnF { \char_value_mathcode:n {`,} }= {"8000} { \char_set_active_eq:nN {`,} \__kennytm_comma: \char_set_mathcode:nn {`,} {"8000} } #1 \group_end: } \cs_new_protected:Ne \__kennytm_comma: { \mathchar\char_value_mathcode:n {`,}~ \penalty0~\exp_not:n { \hspace{0pt plus 1em} } } \ExplSyntaxOff % Combined macro \NewDocumentCommand{\set}{som}{ \IfBooleanTF{#1}{\splitatcommas{\setaux*{#3}}}{% \IfNoValueTF{#2}{% \splitatcommas{\setaux{#3}}% }{% \splitatcommas{\setaux[#2]{#3}}% } } } % Empty set \setmathfont[CharacterVariant=2]{NewCMMath-Regular.otf} \AtBeginDocument{% \renewcommand{\emptyset}{\char"2300}% \renewcommand{\varnothing}{\char"2205}} \begin{document} % \setlength{\lineskiplimit}{2pt}\setlength{\lineskip}{3pt} \setlength{\parindent}{0pt} % \(\set{a,b,c}\cup\set[\big]{a,b,c}\) \(\set{x\suchthat a<x<b}\) \(\set[\Big]{x\suchthat a<x<b}\) \(\set*{x\suchthat \dfrac{1}{2}<x<3}\) We have \(\emptyset = \set{}\) and \(\omega_0 = \set{ \emptyset, \set{\emptyset}, \set{\emptyset, \set{\emptyset}}, \set{\emptyset, \set{\emptyset}, \set{\emptyset, \set{\emptyset}}}, \set{\emptyset, \set{\emptyset}, \allowbreak {\set{\emptyset, \set{\emptyset}}, \set{\emptyset, \set{\emptyset}, \set{\emptyset, \set{\emptyset}}}}}, \dots }. \) % \end{document} References [1] E. Gregorio. (2020). TeX, LaTeX and math. TUGboat, 41(1), 43–53. https://www.latex-project.org/publications/2020-egreg-TUB-tb127gregorio-math.pdf [2] E. Gregorio. (2025, May 17). Allowing line break at ',' in inline math mode? (answer). TeX Stack Exchange. https://tex.stackexchange.com/a/309558

  • Querying CTAN packages by licence
    by Psychonaut on June 10, 2026 at 4:29 pm

    Packages on CTAN are tagged according to their licence; this information is displayed on each package's page along with other basic metadata such as its name, version, maintainer, and topics. I know that I can browse or search for all packages assigned to a given topic using the topics index or using the extended search form. Is there any similarly easy way of finding all CTAN packages with a given licence? Here's what I've tried so far: I checked the master licence list, but if I click on one of the licences in the list, the page I'm taken to gives me only basic information about the licence and (in some cases) some statistics about the number of packages that use that licence. I checked the extended search form form. It doesn't have a dedicated field for the licence. If I do search for a licence name, then it returns only the individual licence pages described above, not the packages that use that licence. I checked the XML API and JSON API. They provide endpoints for listing all licences, and for listing all packages, but not for listing packages by licence. The entries returned by the "List of licenses" endpoints list only a unique ID, name, and free/non-free status for each licence, but not which packages use that licence. The entries returned by the "List of Packages" endpoints list only a unique ID, name, and brief description for that package, but not its licence. I could use the XML or JSON API to get a full list of packages, extract the unique IDs to construct the URL for each package's page on CTAN, download each of those pages, and then scrape the licence data. But there are currently almost 7000 packages, so scraping the site in this way will take a long time, and I'm not sure that the site operators would appreciate all that traffic. (My use case, in case anyone is wondering, is finding packages that are available on CTAN but that are not distributed with TeX Live due to licensing restrictions. I'm curious as to what sort of functionality I and other TeX Live users might be missing out on, and might decide to code freely licensed replacements for any seemingly useful non-free packages.)

  • tikz: absolute coordinates of a node placed in a second node positioned relative to a third node
    by pluton on June 10, 2026 at 4:18 pm

    A MWE is probably better than lengthy explanations: \documentclass[tikz,10pt]{standalone} \usetikzlibrary{positioning} % savedbox with a sketch \newsavebox{\sdbox} \sbox{\sdbox}{% \begin{tikzpicture}[scale=0.35] \node (rbox) [fill=red] at (1,0) {}; \node (bbox) [fill=blue] at (1,1) {}; \end{tikzpicture}% } \begin{document} \begin{tikzpicture}[scale=0.5,font=\small] % blocks \node (comp) {computer}; \node[right = 1cm of comp] (sb) {\usebox{\sdbox}}; % arrow \draw[->] (rbox) -- (comp); \end{tikzpicture} \end{document} Upon compilation, you'll notice that the arrow does not link the node (rbox) from its absolute position after the node (sb) is drawn, as it should go from the red rectangle to the computer box. Would it be possible to achieve that goal?

  • How do I directly input foreign scripts into LuaLaTeX equations?
    by Sageof6Paths on June 10, 2026 at 4:03 pm

    How do I directly input foreign scripts into LuaLaTeX equations? I'm using LuaLaTeX with the unicode-math package. I have text mode setup that uses fallback font for any glyphs not covered. I also want to do the same for math mode, but with different font choices. I'm currently unable to input a foreign script like Kanji and Thai without adding commands like \text{} around it, despite having fonts that support Kanji and Thai. I want to be able to input scripts like Kanji and Thai into equations without extra commands as long as I have the proper font for it. \documentclass{article} \usepackage{unicode-math} \directlua{ luaotfload.add_fallback ("textFallback", { "SimSun:mode=harf;", } ) } \setmainfont{Arial}[RawFeature={fallback=textFallback}] \setmathfont{Latin Modern Math} \begin{document} This is a sample text. この文章は日本語です。 $∀天∈ℝ, ∀ค∈ℝ, 天+ค∈ℝ$ \end{document} Edit: Added clarification and included the Thai script.

  • Good way to write dynamical physics problems [closed]
    by Rassine Orange on June 10, 2026 at 3:58 pm

    I'm a physics teacher and I'd like to share here my way to write "dynamical" exercises. After posting a couple of questions more or less related, I've read comments implying that my way of doing could be improved. When I say "dynamical" I mean that the variables of my problem (\mass, \speed, ...) are coded in the questions. I don't wanna hard-code for the following reasons: If I write everything with, say, m=3kg, and then I wanna change to m=2kg, I don't wanna rewrite everything. I can reuse the questions very fast with different values, e.g. for exams or for the students to practise. Below a MWE of a "typical" problem. Please, do not focus on the Physics, but on the LaTeX ideas, mainly: Could I improve the way I store variables and compute other quantities? For the units, which command should I use: mathrm; text ; textup; ... ? Anything else? I want to make clear that, even if in this example I use basic maths (mainly the 4 operations), I typically need all the usual fonctions (powers, log, sqrt, exp, trigo), so any solution that you suggest should handle all these functions. \documentclass{article} \usepackage{xfp} % provides \fpeval \usepackage{amsmath} \begin{document} \def\mass{3} \def\speed{10} \def\distance{1} \edef\Ekin{\fpeval{0.5*\mass*\speed^2}} \edef\force{\fpeval{0.5*\mass*\speed^2/\distance}} A mass $m=\mass\, \mathrm{kg}$ starts moving from rest. After a distance $d=\distance\, \textup{m}$ its velocity is $\speed\, \text{m} \times \text{s}^{-1}$\,. Compute the force. \vspace{5cm} Solution First you compute the kinetic energy $$ E=\frac 12 mv^2 = \Ekin\, \mathrm{J} $$ blabla more details, more equations, blablabla Use the work theorem to find $$ F=\frac{mv^2}{2d} = \force\, \mathrm{N}\,. $$ \end{document} Community Edit: Current output

  • Custom section formatting with titlesec and ulem: making subsection underline span both number and title
    by Nevpzo on June 10, 2026 at 2:52 pm

    I found a section formatting style on TeX Stack Exchange that I really like. The only issue is that it applies the same formatting to sections, subsections, and subsubsections, whereas I would like a clearer hierarchy with sections having boxed number + colored underline; subsections having colored number + underline; subsubsections having colored number and text (no underline). My current implementation is below. It mostly works, but for some reason, there is a gap in the underline between the section number box and the title. I am using titlesec and ulem for the underlining. \documentclass{article} % === Required packages === \RequirePackage[explicit]{titlesec} \RequirePackage{soul} \RequirePackage{xcolor} \definecolor{titlepagecolor}{rgb}{.13, .36, .38} % === Underline helper === \newbox\TitleUnderlineTestBox \newcommand*\TitleUnderline[1]{% \bgroup \setbox\TitleUnderlineTestBox\hbox{\colorbox{titlepagecolor}\strut}% \setul{\dimexpr\dp\TitleUnderlineTestBox-.3ex\relax}{.3ex}% {\color{titlepagecolor}\ul{\mbox{#1}}}% \egroup } % === (sub)Section numbers === \newcommand*\SectionNumberBox[1]{% \colorbox{titlepagecolor}{% \makebox[2.5em][c]{% \color{white}\strut\csname the#1\endcsname }% }% \hspace{0.5em}% } \newcommand*\SubsectionNumberColored{% {\color{titlepagecolor}\thesubsection}% } % === Section === \titleformat{\section} {\Large\bfseries\sffamily\color{titlepagecolor}} {\SectionNumberBox{section}} {0pt} {\TitleUnderline{#1}} % === Subsection === \titleformat{\subsection} {\large\bfseries\sffamily} {} {0pt} {% \TitleUnderline{% \SubsectionNumberColored\hspace{0.8em}#1% }% } % === Subsubsection === \titleformat{\subsubsection} {\normalsize\bfseries\sffamily} {} {0pt} {\textcolor{titlepagecolor}{\thesubsubsection\hspace{0.8em}#1}} \begin{document} \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \end{document}

  • rowcolor not fill properly when \multicolumn comes
    by MadyYuvi on June 10, 2026 at 1:47 pm

    In my table, column heads are in shade and the text should be in white color, and the table body have alternative shades, I've try with: \documentclass{article} \usepackage{tabularx} \usepackage[table]{xcolor} \begin{document} \newcommand{\colhead}[1]{\color{white}#1} \newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}% \def\toprule{\rowcolor{black!70}} \def\midrule{\relax} \rowcolors{0}{black!10}{black!20}% \arrayrulecolor{white} \setlength{\arrayrulewidth}{1pt} \begin{table} \caption{Party identification, by social characteristics, 2024} \begin{tabularx}{\textwidth}{ P{50pt}| P{45pt}|X|X|X|X|X|X|} \toprule \colhead{Category (Percentage of Sample)} &\multicolumn{2}{X}{\colhead{Democrats}} &\multicolumn{3}{X}{\colhead{Independents}} &\multicolumn{2}{X}{\colhead{Republicans}}\\ \toprule \colhead{} & \colhead{Strong} & \colhead{Weak} & \colhead{Lean Dem} & \colhead{Pure} & \colhead{Lean Rep} & \colhead{Weak} & \colhead{Strong}\\ \hline \midrule Men\index{Men} (48) & 20 & 9 & 17 & 5 & 20 & 10 & 19\\ \hline Women\index{Women} (52) & 24 & 16 & 16 & 6 & 13 & 9 & 16\\ \hline Whites (72) & 21 & 10 & 12 & 6 & 14 & 12 & 26\\ \hline \end{tabularx} \end{table} \end{document} when \multicolumn comes, shades for column heads not coming properly: Please advise.

  • Custom optional parameters for classes in LaTeX
    by Zerina on June 10, 2026 at 9:46 am

    I have customized a MyReport.cls file with a custom optional parameter "Reference", which functions as follows: It defaults to None. If the user passes a bib file path via \documentclass[Reference={ref.bib}]{MyReport}, then execute: \RequirePackage[hyperref=true,backend=biber,url=false,doi=false,sorting=none,style=gb7714-2015]{biblatex} \AtBeginDocument{\addbibresource{ref.bib}} \AtEndDocument{\printbibliography[heading=bibintoc]} How can I implement this feature? Here is the MyReport.cls \NeedsTeXFormat{LaTeX2e} \RequirePackage{expl3} \ProvidesClass{MyReport}[2024/01/01 v1.0.0 My custom report class] \def\xjtuthesis{MyReport} \def\meta@version{1.0.0} \def\metaversion{\meta@version} \newcommand{\MyReport@bibfile}{} \DeclareOption{Reference}{ \renewcommand{\MyReport@bibfile}{#1} } \ProcessOptions\relax \LoadClass[twoside]{article} \RequirePackage[zihao=-4]{ctex} \RequirePackage[a4paper,left=2.54cm,right=2.54cm,top=3.18cm,bottom=3.18cm]{geometry} \RequirePackage[hidelinks,bookmarksnumbered=true]{hyperref} \makeatletter \ifx\MyReport@bibfile\@empty % do nothing \else \RequirePackage[hyperref=true,backend=biber,url=false,doi=false,sorting=none,style=gb7714-2015]{biblatex} \AtBeginDocument{\addbibresource{\MyReport@bibfile}} \AtEndDocument{ \clearpage \printbibliography[heading=bibintoc] } \fi \makeatother and the below is the main.tex \documentclass[Reference={ref.bib}]{MyReport} \begin{document} \section{test} text\cite{Deb2014} \end{document} the ref.bib: @article{Deb2014, title = {An {{Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach}}, {{Part I}}: {{Solving Problems With Box Constraints}}}, shorttitle = {An {{Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach}}, {{Part I}}}, author = {Deb, Kalyanmoy and Jain, Himanshu}, date = {2014-08}, journaltitle = {IEEE Transactions on Evolutionary Computation}, shortjournal = {IEEE Trans. Evol. Computat.}, volume = {18}, number = {4}, pages = {577--601}, issn = {1089-778X, 1089-778X, 1941-0026}, doi = {10.1109/TEVC.2013.2281535}, url = {http://ieeexplore.ieee.org/document/6600851/}, urldate = {2025-11-08}, langid = {english} } No matter how I try, although the compilation does not report an error, it prompts: LaTeX: Unused global option(s): [Reference]. LaTeX: Empty bibliography. In fact, there is no "References" section, as if the operation to generate the references was not executed. How can I solve this problem? Note: \documentclass{MyReport} \addbibresource{ref.bib} \begin{document} \section{test} text\cite{Deb2014} \printbibliography[heading=bibintoc] \end{document} This main.tex can be compiled successfully, indicating that the basic functionalities of ref.bib and MyReport.cls are correct.

  • Make a special integral symbols in tikz
    by mathrm alpha on June 10, 2026 at 8:34 am

    Although you can draw \int extended parts "\qsymb" in Tikz, it doesn't fit when zoomed in with math-mode. \documentclass{article} \usepackage{tikz} \usepackage{graphicx} \usepackage{amsmath} \usepackage[margin=0.5in]{geometry} \newcommand{\qsymb}{% \mathbin{ \vcenter{\hbox{ \scalebox{0.075}{ \begin{tikzpicture}[line width=2.5pt, line cap=round, line join=round, yscale=0.6] \draw (0.2, 2.4) -- (2.7, 3.9) -- (4.7, 2.9) -- (2.2, 1.4) -- cycle; \draw (2.2, 1.4) -- (4.2, 0.4) -- (1.7, -0.6) -- (-0.3, 0.4) -- cycle; \end{tikzpicture}% }% }}% }% } \newcommand{\qint}{\int\!\!\!\!\!\!\!\!\qsymb} \newcommand{\qiint}{\iint\!\!\!\!\!\!\!\!\!\!\qsymb} \begin{document} $A \qint B \qiint C$\\ $$A \qint B \qiint C$$ \end{document}

  • flipped \sum symbols
    by mathrm alpha on June 10, 2026 at 7:57 am

    I found that using it this way doesn't result in the same subscript and superscript positions as \sum, and it's even crooked, which is really undesirable. % Source - https://tex.stackexchange.com/a/689279 % Posted by egreg % Retrieved 2026-06-10, License - CC BY-SA 4.0 % Code modified by: @mathrm alpha \documentclass{article} \usepackage{amsmath,graphicx} \makeatletter \NewDocumentCommand{\flippedsum}{e{_^}}{% \mathop{\mathpalette\flippedsum@{{#1}{#2}}}% } \NewDocumentCommand{\flippedsum@}{mm}{% \flippedsum@@#1#2% } \NewDocumentCommand{\flippedsum@@}{mmm}{% \begingroup \sbox\z@{$\m@th#1\sum$}% \reflectbox{\usebox\z@}% \IfValueT{#2}{% subscript _{#2}% }% \IfValueT{#3}{% superscript ^{\kern-\ifx#1\displaystyle0.5\else0.4\fi\wd\z@#3}% }% \endgroup } \makeatother \begin{document} \[ \flippedsum_a^b \] \begin{center} $\flippedsum_a^b$\\ $\scriptstyle\flippedsum_a^b$\\ $\scriptscriptstyle\flippedsum_a^b$ \end{center} \end{document} References: Superscript horizontal alignment on flipped integral symbol

  • Why loading autobreak package breaks code even when not using the command?
    by Nasser on June 10, 2026 at 7:05 am

    This old code used to compile OK. \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} Substituting $\sqrt{-x}$ in first equation gives% \begin{align} y-e^{\frac{\sqrt{-x}}{-x-x}} & =0\nonumber\\ y & =e^{\frac{\sqrt{-x}}{-2x}}\nonumber\\ \ln y & =\frac{\sqrt{-x}}{-2x}\nonumber\\ \left( \ln y\right) ^{2} & =\frac{-x}{4x^{2}}\nonumber\\ 4x\left( \ln y\right) ^{2}+1 & =0\nonumber\\ y_{s} & =\left\{ \begin{array} [c]{c}% e^{\frac{-i}{2\sqrt{x}}}\\ e^{\frac{i}{2\sqrt{x}}}% \end{array} \right. \tag{4}% \end{align} \end{document} Compiling gives no error: >lualatex 9.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) restricted system commands enabled. (./9.tex LaTeX2e <2025-11-01> L3 programming layer <2026-03-20> (/usr/local/texlive/2026/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class ... Output written on 9.pdf (1 page, 73469 bytes). Transcript written on 9.log. > But when changing preamble to this \usepackage{amsmath} \usepackage{autobreak} %added this with no code change at all, Now lualatex gives error >lualatex 9.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) restricted system commands enabled. (./9.tex LaTeX2e <2025-11-01> L3 programming layer <2026-03-20> (/usr/local/texlive/2026/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/2026/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2026/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2026/texmf-dist/tex/latex/autobreak/autobreak.sty (/usr/local/texlive/2026/texmf-dist/tex/generic/catchfile/catchfile.sty (/usr/local/texlive/2026/texmf-dist/tex/generic/infwarerr/infwarerr.sty) (/usr/local/texlive/2026/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/local/texlive/2026/texmf-dist/tex/generic/etexcmds/etexcmds.sty (/usr/local/texlive/2026/texmf-dist/tex/generic/iftex/iftex.sty)))) (/usr/local/texlive/2026/texmf-dist/tex/latex/l3backend/l3backend-luatex.def) (./9.aux) ! Missing # inserted in alignment preamble. <to be read again> \cr l.22 \end{align} ? Notice there is no usage of the autobreak command in code. Only loading the package itself causes this error. Is this supposed to happen? Or is this a bug? TL 2026 on Linux ps. please do not complain about the code itself. It is auto-generated by external software.

  • How to change arrow style for a NPN component in CircuiTikZ
    by Forrest on June 10, 2026 at 1:35 am

    I want to change the arrow style of NPN when I use circuiTikz. I read the manual of CircuiTikz. All I found is that: I can only change the arrow position in 4.15.5.2 \ctikzset{transistors/arrow pos=end} It do change the position of arrow. Then, I tried to change the arrow style. I tried the following ways: \draw (7, 0) node[npn, scale=2.0, flow arrow/.style={->, >=Stealth}] (T) {}; \ctikzset{bipoles/npn/arrow/.style={>=Stealth}} None works! Could you kindly give me a solution? Thanks!

  • Compression for subequations parent numbers with cleveref
    by Jonk on June 9, 2026 at 5:15 pm

    With TeX Live 2024 cleveref can compress cross-references including subequations parent numbers, like so: \documentclass{article} \usepackage{amsmath} \usepackage{cleveref} \begin{document} \begin{subequations}\label{eqn:one} \begin{align} a\label{eqn:onea}\\ b\label{eqn:oneb} \end{align} \end{subequations} \begin{align} c\label{eqn:two}\\ d\label{eqn:three} \end{align} \cref{eqn:one,eqn:two,eqn:three} \end{document} The \cref command gives as desired eqs. (1) to (3) However, with TeX Live 2025 and 2026, the compression does not occur and I get eqs. (1), (2) and (3) Is there a way to obtain the compressed output with TeX Live 2025 and 2026, without explicitly requiring a range (e.g., with \crefrange)? (This question is similar to this one, but the answer seems to indicate that I shouldn't get the compressed output with TeX Live 2024, which I do.)

  • autobreak. How make all lines flush to left when first line is long?
    by Nasser on June 9, 2026 at 12:17 pm

    Consider this MWE \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{autobreak} \begin{document} \begin{align*} \begin{autobreak} A= (x + a + b +c+d+e+f+g) +y +z +(x + a + b +c+d+e+f+g) +e +d \end{autobreak} \end{align*} \end{document} Compile with lualatex gives I do not know how to make the output something like this (*), i.e. shift second and the rest of the lines more to the left. Using \MoveEqLeft from mathtools made it worst \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{autobreak} \usepackage{mathtools} %\MoveEqLeft \begin{document} \begin{align*} \MoveEqLeft \begin{autobreak} A= (x + a + b +c+d+e+f+g) +y +z +(x + a + b +c+d+e+f+g) +e +d \end{autobreak} \end{align*} \end{document} Without modifying the lines themselves inside the autobreak manually by rewriting them, is it possible to obtain the desired output shown above in (*) by adding something in preamble or some other option for autobreak? Lualatex, TL 2026

  • How to make the parenthesis around equation number be colorful and hyperlinked too when using \eqref?
    by M. Logic on June 9, 2026 at 11:07 am

    A minimal working sample is as follows. \documentclass{article} \usepackage{amsmath} \usepackage[colorlinks=true]{hyperref} %\makeatletter %\def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}} %\DeclareRobustCommand{\eqref}[1]{\textup{\tagform@{\ref{#1}}}} %\makeatother \begin{document} \begin{equation}\label{eq} 1+2=3 \end{equation} TEXT \eqref{eq} TEXT \end{document} As you see, when using \eqref on the equation number, it produce only colorful equation number but black parenthesis, and also it produce a hyperlink only on equation number but including no parenthesis. Then how to make the parenthesis around equation number be colorful and hyperlinked too when using \eqref? I hope, the color could change when I reset linkcolor in hyperref. is it possible to redefine some setting to make the equation number be around with parenthesis when using \ref? In this case I think the parenthesis must be colorful and hyperlinked too.

  • Incompatibility between memoize and luacolor
    by PHL on June 9, 2026 at 5:13 am

    The following MWE compile correctly, but if luacolor is uncommented the triangle is black instead of red. % !TEX TS-program = lualatex \documentclass{article} \usepackage{memoize} %\usepackage{luacolor} \usepackage{tikz} \begin{document} \begin{tikzpicture} \fill[red] (0,0)--(1,1)--(2,0)--cycle; \end{tikzpicture} \end{document} Is there a workaround? Or is this a bug in memoize and/or luacolor? (luacoloris needed for kerning reasons, that do not show in the above MWE.)

  • How can I get less than one frame per second in \animategraphics?
    by Jasper on June 9, 2026 at 3:50 am

    How can I get less than one frame per second in \animategraphics? \documentclass{article} \usepackage{animate} \usepackage{graphicx} \begin{document} \animategraphics{ % a framerate less than one, say 1/3. }{cow}{}{} \end{document}

  • ltx-talk overlay and tcolorbox?
    by Richard Wong on June 8, 2026 at 3:25 pm

    I'm trying to modify the theorem environment in ltx-talk so that it visually resembles the theorem environment in beamer. I was able to do so using talkthemetcolorbox. However, my attempt breaks the uncover overlay specification in a way that I don't quite understand. (MWE example below) \DocumentMetadata{tagging = on} \documentclass[aspect-ratio=4:3]{ltx-talk} \usepackage{talkthemetcolorbox} %Create a custom tcolorbox style for theorems \newtcolorbox{mythmbox}[1]{ title=#1, boxrule=0pt, enhanced, } \newtheorem{theorem}{Theorem} \RenewDocumentEnvironment{theorem}{D<>{all} +m}{ \begin{uncoverenv}<#1> \begin{mythmbox}{Theorem (#2)} }{ \end{mythmbox} \end{uncoverenv} } \begin{document} \begin{frame} Text \pause \begin{theorem}<3->{Pythagoras} The square of the hypotenuse is equal to the sum of the squares of the other two sides: \[ a^2 + b^2 = c^2 \] \end{theorem} Text \end{frame} \end{document} The code above changes the theorem environment visually as I desire, but it doesn't have the intended uncover behavior. (e.g. I see the theorem on all three slides). However, the code does have the right visual theorem environment and respects the overlay if I replace uncoverenv with onlyenv. (e.g. I see the theorem only on slide 3, but the spacing on slide 2 is not what I desire). It also has the right uncover behavior, but the wrong visual theorem environment if I replace D<>{all} +m with d<>{all} +m. (e.g. I see the theorem only on slide 3 , and the spacing on slide 2 is right, but there is no tcolorbox).

  • Hyperref and xindy with new hyperxindexformat
    by Francesco Endrici on June 8, 2026 at 1:13 pm

    I have a file written about 10 years ago that at the moment is not working on an updated Texlive2026 due to a problem with the new \hyperxindexformat command of hyperref. This is a mwe \documentclass{article} \usepackage{imakeidx} \makeindex[name=alfabetico,title=Indice alfabetico,program=truexindy,options=-M texindy -C utf8 -L italian -M xindystyle] \newcounter{mynum} \newcommand{\mystring}[1]{% \stepcounter{mynum} #1.\themynum \index[alfabetico]{#1|textit{\themynum}}} \usepackage{hyperref} \begin{document} \mystring{pear} \mystring{apricot} \pagebreak \mystring{apple} \printindex[alfabetico] \end{document} (of course my real command is not \textit 🙂 ) If I compile his with lualatex I get an .idx file like: \indexentry{pear|hyperxindexformat{\textit{1}}}{1} \indexentry{apricot|hyperxindexformat{\textit{2}}}{1} \indexentry{apple|hyperxindexformat{\textit{3}}}{2} and when I run the command xindy -M texindy -C utf8 -L italian -M xindystyle alfabetico.idx I receive the error WARNING: unknown cross-reference-class `hyperxindexformat'! (ignored) and no valid .ind file is generated. If I manually change hyperxindexformat to hyperindexformat I get what I want. Any idea? xindystyle.xdy follows: ;; $Id: xindystyle.xdy,v 0.1 2015_10_25 Endrici $ ;; Define all attributes appearing in your document. Your attributes ;; are all encapsulators you use in your \index commands following the ;; vertical bar sign `|'. For example `foo' is the attribute in the ;; command \index{...|foo}. Here you specify the set of attributes ;; that appear in your document, the order in which they appear in the ;; index and which one superdes the other. ;; (define-crossref-class "indexanchor") (markup-crossref-list :class "indexanchor" :open "\indexanchor{" :sep ";" :close "}" ) (markup-index :open "\begin{theindex}~n \providecommand*\lettergroupDefault[1]{} \providecommand*\lettergroup[1]{% \par\penalty-50\textbf{#1}\nopagebreak }" :close "~n~n\end{theindex}~n" :tree) ;; The indexentries (item_<..> specifiers) (markup-indexentry :open "~n \item " :depth 0) (markup-indexentry :open "~n \subitem " :depth 1) (markup-indexentry :open "~n \subsubitem " :depth 2) ;; Location-references (markup-locclass-list :open "\dotfill" :sep ", ") (markup-crossref-layer-list :class "see" :sep ", ") ;; delim_n <string> ", " (markup-locref-list :sep "," :class "see") ;; delim_r <string> "--" (markup-range :sep "--") ;; Local Variables: ;; mode: lisp ;; End :

  • ⅌ apply in tikz text symbols?
    by mathrm alpha on June 8, 2026 at 11:58 am

    The original drawing instructions in ⅌: \documentclass{article} \usepackage{tikz} \usepackage[margin=0.5in]{geometry} \begin{document} \centering \begin{tikzpicture}[scale=2] % The stylized symbol is a calligraphic character, likely a script 'P' or 'V' with an ellipse. % We recreate it using thick paths and curves. % 1. The horizontal ellipse \draw[line width=6pt] (0.4, 0) ellipse (2.2 and 0.7); % 2. The main "U" shape (the stems) % Left stem starts from the flourish, goes down, curves at the bottom, and goes up to form the right stem. \draw[line width=14pt, line cap=round] (-0.6, 1.5) .. controls (-0.6, -3.2) and (0.6, -3.2) .. (0.6, 1.5); % 3. The flourish on the top left % A decorative hook and a small "bud" on top of the left stem. \draw[line width=14pt, line cap=round] (-0.6, 1.5) .. controls (-1.8, 2.8) and (-3.0, 1.5) .. (-2.2, 1.2); \fill (-0.5, 1.9) circle (0.25); % 4. The large loop on the right (completing the 'P' shape) % It starts from the top of the right stem, loops over to the right, and curves back down. \draw[line width=14pt, line cap=round] (0.6, 1.5) .. controls (0.6, 4.2) and (3.5, 3.2) .. (3.5, 0.5) .. controls (3.5, -0.8) and (2.5, -1.2) .. (1.8, -1.0); \end{tikzpicture} \end{document} However, after reading his/her command usage, This convert to can typed ⅌ text symbols method doesn't seem to work for multiple overlapping shapes in tikz (or maybe I just don't know how to use it). Is there better method to declare tikz picture with proper baseline and fontsize?

  • Example of how to set up a custom tagged structure
    by David Purton on June 8, 2026 at 3:29 am

    I'm trying to learn how to set up tagging for a document with a custom structure. For example, consider a document containing a quotation from the Bible. This has built in structure with things like chapters, verses, (potentially headings), different layouts, and maybe a reference at the end. At a minimum, I need to use the new block code to set up the blocks. But I'm guessing I also need to tag other elements like chapters and verses. But there's still minimal examples out there of how to do all this. If I want to to support tagging in my scripture package, I need to make good design decisions up front. And I don't really know what I'm doing. Here's a MWE example showing a basic structure for a quote from the Bible along with my best guesses relating to tagging. I'm interested in knowing if I'm on the right track or not, things that should be done differently or anything else to be aware of. MWE \DocumentMetadata{ lang=en, pdfstandard=ua-2, tagging=on } \documentclass{article} \pagestyle{empty} \DeclareInstance{blockenv}{scripture/main}{std} { , name = scripture/main , transparent-level = true , max-inner-levels = 0 , block-instance = scripture/main } \DeclareInstance{block}{scripture/main-1}{std} { , begin-vspace = 0pt , begin-extra-vspace = 0pt , left-margin = 0pt , right-margin = 0pt , para-indent = \parindent } \DeclareInstance{blockenv}{scripture/poetry}{std} { , name = scripture/poetry , transparent-level = true , max-inner-levels = 0 , block-instance = scripture/poetry , tagging-suppress-paras = true , final-code = \obeylines\ignorespaces } \DeclareInstance{block}{scripture/poetry-1}{std} { , begin-vspace = \medskipamount , begin-extra-vspace = 0pt , left-margin = 2em , right-margin = 0pt } \NewDocumentEnvironment{scripture}{o} {\SimpleBlockEnv{scripture/main}{}} { \IfNoValueF{#1}{% \par \reference{#1}}% \BlockEnvEnd } \NewDocumentEnvironment{poetry}{!O{}} {\SimpleBlockEnv{scripture/poetry}{#1}} {\BlockEnvEnd} \NewStructureName{scripture/reference} \AssignStructureRole{scripture/reference}{Span} \NewStructureName{scripture/chapter} \AssignStructureRole{scripture/chapter}{Span} \NewStructureName{scripture/verse} \AssignStructureRole{scripture/verse}{Span} \NewDocumentCommand\reference{m} {% \begingroup \leavevmode \UseTaggingSocket{inline/begin}{tag=\UseStructureName{scripture/reference}}% \hfill\textbf{(#1)}% \UseTaggingSocket{inline/end}% \endgroup } \NewDocumentCommand\ch{m} {% \begingroup \leavevmode \UseTaggingSocket{inline/begin}{tag=\UseStructureName{scripture/chapter}}% \textbf{#1}\kern0.5em% \UseTaggingSocket{inline/end}% \endgroup } \NewDocumentCommand\vs{m} {% \begingroup \leavevmode \UseTaggingSocket{inline/begin}{tag=\UseStructureName{scripture/verse}}% \textsuperscript{#1}% \UseTaggingSocket{inline/end}% \endgroup } \begin{document} \begin{scripture}[Book 1:1--5] \ch{1}A chapter start. \vs{2}A verse. A paragraph. \begin{poetry} \vs{3}A line Another line \vs{4}A line Another line \end{poetry} \vs{5}Another verse. \end{scripture} \end{document} Here's the output from show-pdf-tags: Document (http://iso.org/pdf2/ssn): └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): └─Div (http://iso.org/pdf2/ssn): ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ ├─Span (http://iso.org/pdf2/ssn): │ │ └─Marked content on page 1: 1 │ ├─Marked content on page 1: A chapter start. │ ├─Span (http://iso.org/pdf2/ssn): │ │ └─Span (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextPosition: "Sup" │ │ └─Marked content on page 1: 2 │ └─Marked content on page 1: A verse. ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ └─Marked content on page 1: A paragraph. ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─Div (http://iso.org/pdf2/ssn): │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Justify" │ │ ├─Span (http://iso.org/pdf2/ssn): │ │ │ └─Span (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextPosition: "Sup" │ │ │ └─Marked content on page 1: 3 │ │ └─Marked content on page 1: A line │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Justify" │ │ └─Marked content on page 1: Another line │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Justify" │ │ ├─Span (http://iso.org/pdf2/ssn): │ │ │ └─Span (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextPosition: "Sup" │ │ │ └─Marked content on page 1: 4 │ │ └─Marked content on page 1: A line │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ └─Marked content on page 1: Another line ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ ├─Span (http://iso.org/pdf2/ssn): │ │ └─Span (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextPosition: "Sup" │ │ └─Marked content on page 1: 5 │ └─Marked content on page 1: Another verse. └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): ┝━━Attributes: │ └/Layout: │ └TextAlign: "Justify" └─Span (http://iso.org/pdf2/ssn): └─Marked content on page 1: (Book 1:1–5) Out the PDF output: Just for fun, here's another go. For my use case I think it makes sense to have headings and paragraphs as the main structural elements rather than chapters and verses since modern Bibles can place chapter breaks within paragraphs and verses can split across paragraphs. The below example does validate with VeraPDF and seems to give sane output at ngpdf.com But from Ulrike's answer below it seems like there's not a correct answer to this question at the moment. %! TeX = lualatex \DocumentMetadata { , lang = en , pdfstandard = ua-2 , tagging = on , tagging-setup = { math/mathml/luamml/load = false } } \documentclass{article} \ExplSyntaxOn % Tagging set up \tagpdfsetup { , role / new-tag = chapter / Span , role / new-tag = heading / H3 , role / new-tag = poetry / Div , role / new-tag = reference / Part , role / new-tag = scripture / Div , role / new-tag = verse / Span , role / user-NS = scripture } \NewStructureName { sec / 6 } \AssignStructureRole { sec / 6 } { Sect } \NewStructureName { sec / 6 / title } \AssignStructureRole { sec / 6 / title } { heading } % Block environments \DeclareInstance { blockenv } { scripture / main } { std } { , block-instance = scripture / main , max-inner-levels = 0 , name = scripture / main , tag-name = scripture , transparent-level = true } \DeclareInstance { block } { scripture / main-1 } { std } { , begin-extra-vspace = 0pt , begin-vspace = 0pt , left-margin = 0pt , para-indent = \parindent , right-margin = 0pt } \DeclareInstance { blockenv } { scripture / poetry } { std } { , block-instance = scripture / poetry , final-code = \raggedright \obeylines \ignorespaces , max-inner-levels = 0 , name = scripture / poetry , tag-name = poetry , tagging-suppress-paras = true , transparent-level = true } \DeclareInstance { block } { scripture / poetry-1 } { std } { , begin-extra-vspace = 0pt , begin-vspace = \medskipamount , left-margin = 1em , right-margin = 0pt } \NewDocumentEnvironment { scripture } { m } { \SimpleBlockEnv { scripture / main } { } } { \par \UseTaggingSocket { sec / end } { 6 } \reference #1 \BlockEnvEnd } \NewDocumentEnvironment { poetry } { } { \SimpleBlockEnv { scripture / poetry } { } } { \BlockEnvEnd } % Headings \DeclareInstance { heading } { scripture / heading } { display } { , name = scripture / heading , level = 6 , before-vspace = \medskipamount , after-vspace = \smallskipamount , heading-decls = \normalfont \itshape , headformat-instance = scripture / heading } \DeclareInstanceCopy { headformat } { scripture / heading } { std } \DeclareDocumentCommand \heading { s = { shorttitle } o m } { \ParseLaTeXeHeading { scripture / heading } { \BooleanTrue } {#2} {#3} } % Functions \NewDocumentCommand \reference { m m m } { \group_begin: \AssignStructureRole { para / semantic } { reference } \raggedleft \mode_leave_vertical: \UseTaggingSocket { inline / begin } { , actualtext = #1 ~ chapter ~ #2 ~ verse ~ #3 , tag = Span } \textbf { ( #1 ~ #2 : #3 ) } \UseTaggingSocket { inline / end } \par \group_end: } \NewDocumentCommand \ch { m } { \par \group_begin: \noindent \UseTaggingSocket { inline / begin } { , actualtext = { Chapter   #1 ~ verse   1 :   } , tag = chapter } \textbf {#1} \kern 0.5em \UseTaggingSocket { inline / end } \group_end: } \NewDocumentCommand \vs { m } { \group_begin: \mode_leave_vertical: \UseTaggingSocket { inline / begin } { , actualtext = { Verse   #1 :   } , tag = verse } \textsuperscript {#1} \UseTaggingSocket { inline / end } \group_end: } \ExplSyntaxOff \begin{document} \title{Scripture test} \author{David Purton} \maketitle \begin{scripture}{{Book}{1}{1–5}} \heading{Non-canonical heading} \ch{1}A chapter start. \vs{2}A verse. A paragraph. \begin{poetry} \vs{3}A line Another line \vs{4}A line Another line \end{poetry} \vs{5}Another verse. \heading{Another non-canonical heading} \ch{2}A chapter start. \vs{2}Another verse. \end{scripture} \end{document} Tagging structure: Document (http://iso.org/pdf2/ssn): ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ ├─Title (http://iso.org/pdf2/ssn): │ │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Center" │ │ └─Marked content on page 1: Scripture test │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Center" │ │ └─Marked content on page 1: David Purton │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Center" │ └─Marked content on page 1: June 10, 2026 └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): └─scripture (https://www.latex-project.org/ns/local/scripture) / Div (http://iso.org/pdf2/ssn): ├─Sect (http://iso.org/pdf2/ssn): │ ├─heading (https://www.latex-project.org/ns/local/scripture) / H3 (http://iso.org/pdf2/ssn): │ │ ┝━━Title: Non-canonical heading │ │ └─Marked content on page 1: Non-canonical heading │ ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Justify" │ │ ├─chapter (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ │ ┝━━Actual text: Chapter 1 verse 1:  │ │ │ └─Marked content on page 1: 1 │ │ ├─Marked content on page 1: A chapter start. │ │ ├─verse (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ │ ┝━━Actual text: Verse 2:  │ │ │ └─Span (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextPosition: "Sup" │ │ │ └─Marked content on page 1: 2 │ │ └─Marked content on page 1: A verse. │ ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Justify" │ │ └─Marked content on page 1: A paragraph. │ ├─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ │ └─poetry (https://www.latex-project.org/ns/local/scripture) / Div (http://iso.org/pdf2/ssn): │ │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextAlign: "Start" │ │ │ ├─verse (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ │ │ ┝━━Actual text: Verse 3:  │ │ │ │ └─Span (http://iso.org/pdf2/ssn): │ │ │ │ ┝━━Attributes: │ │ │ │ │ └/Layout: │ │ │ │ │ └TextPosition: "Sup" │ │ │ │ └─Marked content on page 1: 3 │ │ │ └─Marked content on page 1: A line │ │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextAlign: "Start" │ │ │ └─Marked content on page 1: Another line │ │ ├─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ │ ┝━━Attributes: │ │ │ │ └/Layout: │ │ │ │ └TextAlign: "Start" │ │ │ ├─verse (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ │ │ ┝━━Actual text: Verse 4:  │ │ │ │ └─Span (http://iso.org/pdf2/ssn): │ │ │ │ ┝━━Attributes: │ │ │ │ │ └/Layout: │ │ │ │ │ └TextPosition: "Sup" │ │ │ │ └─Marked content on page 1: 4 │ │ │ └─Marked content on page 1: A line │ │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextAlign: "Start" │ │ └─Marked content on page 1: Another line │ └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ ├─verse (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ ┝━━Actual text: Verse 5:  │ │ └─Span (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextPosition: "Sup" │ │ └─Marked content on page 1: 5 │ └─Marked content on page 1: Another verse. ├─Sect (http://iso.org/pdf2/ssn): │ ├─heading (https://www.latex-project.org/ns/local/scripture) / H3 (http://iso.org/pdf2/ssn): │ │ ┝━━Title: Another non-canonical heading │ │ └─Marked content on page 1: Another non-canonical heading │ └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): │ └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): │ ┝━━Attributes: │ │ └/Layout: │ │ └TextAlign: "Justify" │ ├─chapter (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ ┝━━Actual text: Chapter 2 verse 1:  │ │ └─Marked content on page 1: 2 │ ├─Marked content on page 1: A chapter start. │ ├─verse (https://www.latex-project.org/ns/local/scripture) / Span (http://iso.org/pdf2/ssn): │ │ ┝━━Actual text: Verse 2:  │ │ └─Span (http://iso.org/pdf2/ssn): │ │ ┝━━Attributes: │ │ │ └/Layout: │ │ │ └TextPosition: "Sup" │ │ └─Marked content on page 1: 2 │ └─Marked content on page 1: Another verse. └─reference (https://www.latex-project.org/ns/local/scripture) / Part (http://iso.org/pdf2/ssn): └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): ┝━━Attributes: │ └/Layout: │ └TextAlign: "End" └─Span (http://iso.org/pdf2/ssn): ┝━━Actual text: Book chapter 1 verse 1–5 └─Marked content on page 1: (Book 1:1–5)

  • How to place the `pic` in a recursive layer order more elegantly?
    by Explorer on June 7, 2026 at 2:06 pm

    What I want to replicate is something as below: My very first (failed) attempt is as below: \documentclass[tikz,border=5pt]{standalone} \definecolor{myyellow}{RGB}{224,239,158} \definecolor{myteal}{RGB}{47,89,85} \begin{document} \begin{tikzpicture}[ cover/.style={line width=3pt,myyellow,fill=myteal}, myrect/.pic={\draw[cover] (0,0) rectangle (3,3) --cycle;} ] \foreach \i in {0,45,...,315} {\pic[rotate=\i] {myrect};} % \foreach \i in {0,10,...,350} {\pic[rotate=\i] {myrect};} \end{tikzpicture} \end{document} The last layer's order should be at the behind of the first one, which is not easy to be handle within the forloop \pic. Here below is my workaround: \documentclass[tikz,border=5pt]{standalone} \definecolor{myyellow}{RGB}{224,239,158} \definecolor{myteal}{RGB}{47,89,85} \begin{document} \tikzset{cover/.style={line width=3pt,myyellow,fill=myteal},myrect/.pic={\draw[cover] (0,0) |- (3,3) --++(0,-\fpeval{3*(2-sqrt(2))}) --(45:3)--cycle;}} \begin{tikzpicture} \pic{myrect}; \end{tikzpicture} \begin{tikzpicture} \foreach \i in {0,45,...,315} {\pic[rotate=\i] {myrect};} % \foreach \i in {0,10,...,350} {\pic[rotate=\i] {myrect};} \end{tikzpicture} \end{document} However, if I want to extend the angle step: \foreach \i in {0,10,...,350} {\pic[rotate=\i] {myrect};} that is not quite easy to get the code: \draw[cover] (0,0) |- (3,3) --++(0,-\fpeval{3*(2-sqrt(2))}) --(45:3)--cycle; exactly, the ++(0,-\fpeval{3*(2-sqrt(2))}) here. Any suggestions to solve the layer order issues?