• Fill plot area with rainbow colors
    by Brasil on January 29, 2026 at 11:53 pm

    I would like to fill the plot area with the rainbow colors. The wavelength of the colors corresponds to the wavelength of the x-axis. I have the MWE example below. It works fine uless for the line \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); How can I fix it, please? \documentclass[tikz, border=1mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \usepackage{color} \begin{document} \begin{tikzpicture} \small \begin{axis}[% width = 70mm, height = 50mm, % grid = both, xmin = 0.41, xmax = 0.73, % xtick = \empty, % xtick distance = 100, ymin = 1.4, ymax = 2.0, ytick distance = 0.2, xlabel = Wavelength ($\mu$m), ylabel = Refractive index, ] %--> FILL PLOT AREA \foreach \wl in {410,...,729}{ \definecolor{tmpcol}{wave}{\wl} \colorlet{mycol}[rgb]{tmpcol} \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); } %--> Borosilicate glass BK7 \addplot[thick, domain=0.41:0.73] {1.5046 + 0.00420/x^2}; \node at (axis cs: 0.7, 1.57) [above]{BK7}; %--> Barium crown glass BaK4 \addplot[thick, domain=0.41:0.73] {1.5690 + 0.00531/x^2}; \node at (axis cs: 0.7, 1.52) [below]{BaK4}; %--> Dense flint glass SF10 \addplot[thick, domain=0.41:0.73] {1.7280 + 0.01342/x^2}; \node at (axis cs: 0.7, 1.745) [above]{SF10}; \end{axis} \end{tikzpicture} \end{document}

  • Tagging: Alternative text to symbol
    by Svend Tveskæg on January 29, 2026 at 7:11 pm

    Code Consider the following MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{article} \usepackage{siunitx} \begin{document} Displayed text on screen: \qty{15}{\celsius} Text read by screen reader: My green horse is awesome. \end{document} Question How do I make a screen reader read out, say, "My green horse is awesome." while the displayed text/symbol in the PDF file is the output from, say, \qty{15}{\celsius}?

  • Unicode math + LuaLatex issue with fractions in exponents
    by MagiicMushroom on January 29, 2026 at 12:45 pm

    I am having a bug with Unicode math, where fractions in exponents do not behave well if there are multiple fonts loaded. Here is a MWE demonstration (LuaLatex 2025, replicated locally and on Overleaf): \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath}[version=NCMM] \setmathfont{XITS Math}[range = {}, version = XITS] % edit: the `version = XITS` is not required to replicate the bug \mathversion{NCMM} \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} This results in the following output: From testing, all exponents after the \lim seem to be fixed, though on my larger documents this disgrace of a workaround seems to have no effect. Interestingly, it has something to do with the \mathversion, because \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \setmathfont{XITS Math}[range = {}] \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} Produces two bugged exponents: For context, if I remove the \setmathfont{XITS Math}... line or compile either MWE in XeLaTeX, there is no sizing bug with the exponents. I am not experienced with the internals of Unicode math, this range thing was to solve an issue with \mathcal (see here). Any temporary workaround would be appreciated.

  • make datatool sort numerically
    by Leo on January 29, 2026 at 11:50 am

    I've got a problem with datatool. I already know a little about datatool, but couldn't find any answer in the documentation. The problem is the following: I read a csv file and want to sort the database by a column, which contains numbers (integers in fact, but it could be also real ones). The following mwe illustrates the problem: \documentclass{scrarticle} \begin{filecontents*}{data.csv} A, 20, 15 B, 21, 3 C, 6, 0 \end{filecontents*} \usepackage{datatool} \newcommand{\diff}{} \begin{document} \section*{initial csv} \DTLloaddb[noheader]{data}{data.csv} \DTLdisplaydb{data} \section*{sorted by Column2 (descending)} \DTLsort{Column2=descending}{data} \DTLdisplaydb{data} \section*{add Column4 as difference of C2 and C3} \DTLaddcolumn{data}{Column4} \DTLforeach{data}{ \x=Column2, \y=Column3 }{ \DTLgsub{\diff}{\x}{\y} \DTLappendtorow{Column4}{\diff} } \DTLdisplaydb{data} \section*{Sorted by Column4 (descending)} \DTLsort{Column4=descending}{data} \DTLdisplaydb{data} \end{document} Here the sorting by column 2 works just fine, but the sorting by column 4 doesn't. The logs give a warning, that there is no associated datatype for column 4, so datatool assumes a string and compares by letter. I couldn't find a way to add a datatype to that column (the docs say nothing, or I didn't find it). How can I add a datatype to the column?

  • Adjusting text next to a wrapfig environment
    by Perch on January 29, 2026 at 10:35 am

    Is there a way of getting the text starting from '1.3...' back to its position? This is how I coded it: \begin{wrapfigure}{l}{4cm} \begin{tikzpicture} \draw [thick ,->] (-2,0) -- (2,0); \draw [thick,->] (0,-2) -- (0,2); \draw [thick] (0,0) circle (1.5); \draw[thick,->] (0,0) -- (1.08,1.08); \draw (0.7,0.3) node {$r$}; \end{tikzpicture} \end{wrapfigure} \hspace{-5pt} Tomamos la parametrización de la circunferencia de centro $(0,0)$ y radio $r$ dada por $\alpha: t \in [0,2\pi] \mapsto (r\cos t, r \sin t)$. \\Se tiene que $\alpha'(t) = (-r\sin t,r\cos t)$, así, $$L(\alpha|_{[a,b]}) = \int_0^{2\pi} || \alpha'(t)|| dt = \int_0^{2\pi} \sqrt{(-r \sin t)^2 + (r \cos t)^2}dt = r \int _0^{2\pi}dt = 2\pi r,$$lo que coincide con la intuición. Cabe preguntarse ahora si la longitud depende de nuestra parametrización (que no debería). \subsection{Reparametrización de una curva.} \begin{defi}[]{} Supongamos que tenemos una curva parametrizada $\alpha:I \subset \R \to \R^n$. Se $f: I \subset \R \to I \subset \R$ un difeomorfismo (diferenciable, biyectiva y con inversa diferenciable). Decimos que $\beta:= \alpha \circ f$ es una \textbf{reparametrización } de $\alpha$. \end{defi} Note: the environment 'defi' is a newtcolorbox custom environment.

  • Relative placement of horizontal rule
    by speech1 on January 29, 2026 at 1:51 am

    I want to format a document in latex with horizontal lines under each section heading that start at the beginning of the text and extend to the right margin. I have figured out how to manually space it, but I would like to find a way to get it to adjust based on the text. Here is my example document: \documentclass{article} \usepackage[letterpaper, margin=0.5in]{geometry} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[T1]{fontenc} \usepackage{lipsum} \begin{document} \setlength{\leftskip}{0.5in} \setlength{\rightskip}{0.5in} \centerline{\large \textbf{Section}} \hspace{6.98cm}\rule{10.27cm}{4pt} % how to calculate distance to match text above? \par \lipsum[1] \par \bigskip \centerline{\large \textbf{Additional Section}} \hspace{5.92cm}\rule{11.34cm}{4pt} % same question here \par \lipsum[2-3] \par \bigskip \hrule height 2pt depth 2pt width \textwidth \end{document} I found an example in another question for defining blank space: \-\pseudo{The length of blank space} Is there a way to subtract this length from the full text width to get the hspace width I need? Or is there a better way to solve this problem? I'm new to tex and this is my first time asking a question here, please let me know if more is needed, thanks!

  • Help align the numbers in this bespoke siunitx macro
    by Miloop on January 28, 2026 at 5:36 pm

    I am writing a document where I keep having to write variables that fall between two numbers, say, 10 < x \leq 3 or in some cases even between two quantities such as 12.5 mg < x \leq 3.5 mg. I wrote a macro named \nestednumrange and \nestedqtyrange. Here is my minimal example: \documentclass{article} \usepackage{siunitx} \newcommand{\nestednumrange}[3]{% \ensuremath{\num{#1} #2 \num{#3}}% } \newcommand{\nestedqtyrange}[4]{% \ensuremath{\qty{#1}{#4} #2 \qty{#3}{#4}}% } \begin{document} \nestednumrange{3}{\leq x}{<2} \nestedqtyrange{3}{\leq c}{\leq 3}{\milli\gram} \end{document} I'm happy that is (somehow) works, but the output is a bit ugly, imho: How do I "center" the variable correctly? Should I perhaps add two more {}s specifically for the signs, so that they aren't linked to any element in the macro? Unfortunately, I don't know how to make the macro only accept operators like <, >, \leq, \geq, and =, and throw errors at others.

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

    In many CAS-systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values ​​for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}

  • Arithmetic in an enumerate label
    by marmistrz on January 28, 2026 at 2:01 pm

    I'm doing a hybrid-argument based proof: \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} Can I somehow automate it? The following doesn't work because it doesn't do the arithmetic \begin{enumerate}[label=$H_{\arabic*} \approx H_{\arabic*+1}$] \item (argue indistinguishability) \item (argue indistinguishability) \item (argue indistinguishability) \end{enumerate} Here's a minimal working example: \documentclass{article} \begin{document} \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} \end{document}

  • tikz Wiener sausage [duplicate]
    by 20-sided-dice on January 28, 2026 at 1:41 pm

    Let's say I have a curve defined by y=f(x) with some explicit function f for x between 0 and 1. I define the sausage of that curve to be the set of points (x,y) at distance less than 1 from any point of the curve. How do I draw the sausage in TikZ without deriving mathematically the actual shape of the sausage ? Even with simple functions it's quickly painful to derive by hand. I would prefer if TikZ could directly draw it.

  • Writing a file with Lua on Overleaf
    by N. Virgo on January 28, 2026 at 11:11 am

    The following code works as expected if I run it in LuaLaTeX on my machine, creating a file containing the text "Hello, World!". \documentclass{article} \begin{document} \directlua{ local file = assert(io.open("output.txt", "w")) assert(file:write("Hello, World!")) assert(file:close()) tex.print("Hopefully this worked?") } \end{document} However, if I run it on Overleaf the file doesn't appear. It generates the pdf and there are no errors or warnings or anything else in the logs suggesting that anything has gone wrong, I just don't see the output.txt file. It could be that Overleaf disables this for security reasons, but their documentation mentions file:write explicitly, and other documentation even says running external commands should work on Overleaf, so I have the impression I should expect it to work. Does anyone know if this can be made to work on Overleaf, and if so how I can access the generated file? edit: as @samcarter_is_at_topanswers.xyz and @daleif pointed out, the file is there in the logs and can be downloaded (using the 'Other logs and files' button at the bottom right of the log screen in the new editor), it just can't be viewed in the editor. So the question becomes, how can I bring the file into the editor so that I can view its contents there? (While still having it update when I compile.) I tried creating an empty output.txt file manually, but unfortunately it stays empty after compiling, and output.txt disappears from the "other files and logs" list.

  • Is there a expl3 interface for lttemplate?
    by Noiv on January 28, 2026 at 1:26 am

    in developing a class I have come to use the so called templates documented in lttemplate. It is a expl3-Class therefore I looked at ways to define Template Types, Templates and Instances in expl3 Syntax but there are no such interfaces. Is there a particular reason why templates do not have a expl3 interface? Or was I not capable enough to find it?

  • How can I map TFM data for a type1 font in LuaLaTeX (probably using luaotfload.patch_font_unsafe) when the font encoding has unused slots?
    by cfr on January 28, 2026 at 12:06 am

    This code is derived from code by Max Chernoff, but the mangling is entirely my responsibility. Aim: to add tounicode mappings to the characters in uzdr.pfb (URW's clone of Zapf Dingbats) when compiling with a LuaLaTeX format based on the LuaHBTeX binary in (updated) TeX Live 2025. Note that I am NOT asking for a practical solution to the problem of typesetting these symbols with correct tounicode values, which would be better done using a Unicode font. I apologise for the length of this example. Usually, I would reduce the data file to a couple of lines, but then I would need a type1 font in TeX Live with a 'gappy' but very short encoding. Or I could eliminate lines here, but then it might seem as if that in itself is part of the problem. \begin{filecontents*}[overwrite]{fixit.lua} The Lua code: pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes Now the overly-long data file: \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} The actual example: \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document} This loses characters from the font. Not only are the tounicode mappings missing, the characters also disappear from the PDF. LuaTeX warns me something is wrong: </usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr.pfb warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): embedded subset is smaller than expected: 136 instead of 188 glyph s warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): invalid real value to pack. Continuing, but the font looks wrong. > The mappings are not obviously-to-me wrong: Adding callback for pzdr uzdr table: 0x437e5320 (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/pifont.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/upzd.fd) Lua's listing of the inputs for the function (abbreviated to satisfy SE character limit): id 16 spec pzdr tfmdata table: 0x43833f70 Mapping tounicode values for pzdr uzdr table: 0x437e5320 pzdr uzdr 1 -1 ... pzdr uzdr 31 -1 pzdr uzdr 32 32 pzdr uzdr 33 9985 pzdr uzdr 34 9986 ... ... pzdr uzdr 126 10078 pzdr uzdr 127 -1 ... pzdr uzdr 160 -1 pzdr uzdr 161 10081 ... pzdr uzdr 239 10159 pzdr uzdr 240 -1 pzdr uzdr 241 10161 ... pzdr uzdr 254 10174 These seem to get used correctly when mapping the TFM data i.e. only the values corresponding to actual characters get used: Mapping: 32 33 32 table: 0x4383bfd0 Mapping: 33 34 9985 table: 0x4383c050 Mapping: 34 35 9986 table: 0x4383c0d0 Mapping: 35 36 9987 table: 0x4383c150 Mapping: 36 37 9988 table: 0x4383c1d0 Mapping: 37 38 9742 table: 0x4383c250 Mapping: 38 39 9990 table: 0x4383c2d0 Mapping: 39 40 9991 table: 0x4383c350 Mapping: 40 41 9992 table: 0x4383c400 Mapping: 41 42 9993 table: 0x4383c4b0 Mapping: 42 43 9755 table: 0x4383c560 Mapping: 43 44 9758 table: 0x4383c610 Mapping: 44 45 9996 table: 0x4383c6c0 Mapping: 45 46 9997 table: 0x4383c770 Mapping: 46 47 9998 table: 0x4383c820 Mapping: 47 48 9999 table: 0x4383c8d0 Mapping: 48 49 10000 table: 0x4383c980 Mapping: 49 50 10001 table: 0x4383ca30 Mapping: 50 51 10002 table: 0x4383cae0 Mapping: 51 52 10003 table: 0x4383cb90 Mapping: 52 53 10004 table: 0x4383cc40 Mapping: 53 54 10005 table: 0x4383ccf0 Mapping: 54 55 10006 table: 0x4383cda0 Mapping: 55 56 10007 table: 0x4383ce50 Mapping: 56 57 10008 table: 0x4383cf00 Mapping: 57 58 10009 table: 0x4383cfb0 Mapping: 58 59 10010 table: 0x4383d060 Mapping: 59 60 10011 table: 0x4383d110 Mapping: 60 61 10012 table: 0x4383d1c0 Mapping: 61 62 10013 table: 0x4383d270 Mapping: 62 63 10014 table: 0x4383d320 Mapping: 63 64 10015 table: 0x4383d3d0 Mapping: 64 65 10016 table: 0x4383d480 Mapping: 65 66 10017 table: 0x4383d530 Mapping: 66 67 10018 table: 0x4383d5e0 Mapping: 67 68 10019 table: 0x4383d690 Mapping: 68 69 10020 table: 0x4383d740 Mapping: 69 70 10021 table: 0x4383d7f0 Mapping: 70 71 10022 table: 0x4383d8a0 Mapping: 71 72 10023 table: 0x4383d950 Mapping: 72 73 9733 table: 0x4383da00 Mapping: 73 74 10025 table: 0x4383dab0 Mapping: 74 75 10026 table: 0x4383db60 Mapping: 75 76 10027 table: 0x4383dc10 Mapping: 76 77 10028 table: 0x4383dcc0 Mapping: 77 78 10029 table: 0x4383dd70 Mapping: 78 79 10030 table: 0x4383de20 Mapping: 79 80 10031 table: 0x4383ded0 Mapping: 80 81 10032 table: 0x4383df80 Mapping: 81 82 10033 table: 0x4383e030 Mapping: 82 83 10034 table: 0x4383e0e0 Mapping: 83 84 10035 table: 0x4383e190 Mapping: 84 85 10036 table: 0x4383e240 Mapping: 85 86 10037 table: 0x4383e2f0 Mapping: 86 87 10038 table: 0x4383e3a0 Mapping: 87 88 10039 table: 0x4383e450 Mapping: 88 89 10040 table: 0x4383e500 Mapping: 89 90 10041 table: 0x4383e5b0 Mapping: 90 91 10042 table: 0x4383e660 Mapping: 91 92 10043 table: 0x4383e710 Mapping: 92 93 10044 table: 0x4383e7c0 Mapping: 93 94 10045 table: 0x4383e870 Mapping: 94 95 10046 table: 0x4383e920 Mapping: 95 96 10047 table: 0x4383e9d0 Mapping: 96 97 10048 table: 0x4383ea80 Mapping: 97 98 10049 table: 0x4383eb30 Mapping: 98 99 10050 table: 0x4383ebe0 Mapping: 99 100 10051 table: 0x4383ec90 Mapping: 100 101 10052 table: 0x4383ed40 Mapping: 101 102 10053 table: 0x4383edf0 Mapping: 102 103 10054 table: 0x4383eea0 Mapping: 103 104 10055 table: 0x4383ef50 Mapping: 104 105 10056 table: 0x4383f000 Mapping: 105 106 10057 table: 0x4383f0b0 Mapping: 106 107 10058 table: 0x4383f160 Mapping: 107 108 10059 table: 0x4383f210 Mapping: 108 109 9679 table: 0x4383f2c0 Mapping: 109 110 10061 table: 0x4383f370 Mapping: 110 111 9632 table: 0x4383f420 Mapping: 111 112 10063 table: 0x4383f4d0 Mapping: 112 113 10064 table: 0x4383f580 Mapping: 113 114 10065 table: 0x4383f630 Mapping: 114 115 10066 table: 0x4383f6e0 Mapping: 115 116 9650 table: 0x4383f790 Mapping: 116 117 9660 table: 0x4383f840 Mapping: 117 118 9670 table: 0x4383f8f0 Mapping: 118 119 10070 table: 0x4383f9a0 Mapping: 119 120 9687 table: 0x4383fa50 Mapping: 120 121 10072 table: 0x4383fb00 Mapping: 121 122 10073 table: 0x4383fbb0 Mapping: 122 123 10074 table: 0x4383fc60 Mapping: 123 124 10075 table: 0x4383fd10 Mapping: 124 125 10076 table: 0x4383fdc0 Mapping: 125 126 10077 table: 0x4383fe70 Mapping: 126 127 10078 table: 0x4383ff20 Mapping: 161 162 10081 table: 0x4383ffd0 Mapping: 162 163 10082 table: 0x43840080 Mapping: 163 164 10083 table: 0x43840130 Mapping: 164 165 10084 table: 0x438401e0 Mapping: 165 166 10085 table: 0x43840290 Mapping: 166 167 10086 table: 0x43840340 Mapping: 167 168 10087 table: 0x438403f0 Mapping: 168 169 9827 table: 0x438404a0 Mapping: 169 170 9830 table: 0x43840550 Mapping: 170 171 9829 table: 0x43840600 Mapping: 171 172 9824 table: 0x438406b0 Mapping: 172 173 9312 table: 0x43840760 Mapping: 173 174 9313 table: 0x43840810 Mapping: 174 175 9314 table: 0x438408c0 Mapping: 175 176 9315 table: 0x43840970 Mapping: 176 177 9316 table: 0x43840a20 Mapping: 177 178 9317 table: 0x43840ad0 Mapping: 178 179 9318 table: 0x43840b80 Mapping: 179 180 9319 table: 0x43840c30 Mapping: 180 181 9320 table: 0x43840ce0 Mapping: 181 182 9321 table: 0x43840d90 Mapping: 182 183 10102 table: 0x43840e40 Mapping: 183 184 10103 table: 0x43840ef0 Mapping: 184 185 10104 table: 0x43840fa0 Mapping: 185 186 10105 table: 0x43841050 Mapping: 186 187 10106 table: 0x43841100 Mapping: 187 188 10107 table: 0x438411b0 Mapping: 188 189 10108 table: 0x43841260 Mapping: 189 190 10109 table: 0x43841310 Mapping: 190 191 10110 table: 0x438413c0 Mapping: 191 192 10111 table: 0x43841470 Mapping: 192 193 10112 table: 0x43841520 Mapping: 193 194 10113 table: 0x438415d0 Mapping: 194 195 10114 table: 0x43841680 Mapping: 195 196 10115 table: 0x43841730 Mapping: 196 197 10116 table: 0x438417e0 Mapping: 197 198 10117 table: 0x43841890 Mapping: 198 199 10118 table: 0x43841940 Mapping: 199 200 10119 table: 0x438419f0 Mapping: 200 201 10120 table: 0x43841aa0 Mapping: 201 202 10121 table: 0x43841b50 Mapping: 202 203 10122 table: 0x43841c00 Mapping: 203 204 10123 table: 0x43841cb0 Mapping: 204 205 10124 table: 0x43841d60 Mapping: 205 206 10125 table: 0x43841e10 Mapping: 206 207 10126 table: 0x43841ec0 Mapping: 207 208 10127 table: 0x43841f70 Mapping: 208 209 10128 table: 0x43842020 Mapping: 209 210 10129 table: 0x438420d0 Mapping: 210 211 10130 table: 0x43842180 Mapping: 211 212 10131 table: 0x43842230 Mapping: 212 213 10132 table: 0x438422e0 Mapping: 213 214 8594 table: 0x43842390 Mapping: 214 215 8596 table: 0x43842440 Mapping: 215 216 8597 table: 0x438424f0 Mapping: 216 217 10136 table: 0x438425a0 Mapping: 217 218 10137 table: 0x43842650 Mapping: 218 219 10138 table: 0x43842700 Mapping: 219 220 10139 table: 0x438427b0 Mapping: 220 221 10140 table: 0x43842860 Mapping: 221 222 10141 table: 0x43842910 Mapping: 222 223 10142 table: 0x438429c0 Mapping: 223 224 10143 table: 0x43842a70 Mapping: 224 225 10144 table: 0x43842b20 Mapping: 225 226 10145 table: 0x43842bd0 Mapping: 226 227 10146 table: 0x43842c80 Mapping: 227 228 10147 table: 0x43842d30 Mapping: 228 229 10148 table: 0x43842de0 Mapping: 229 230 10149 table: 0x43842e90 Mapping: 230 231 10150 table: 0x43842f40 Mapping: 231 232 10151 table: 0x43842ff0 Mapping: 232 233 10152 table: 0x438430a0 Mapping: 233 234 10153 table: 0x43843150 Mapping: 234 235 10154 table: 0x43843200 Mapping: 235 236 10155 table: 0x438432b0 Mapping: 236 237 10156 table: 0x43843360 Mapping: 237 238 10157 table: 0x43843410 Mapping: 238 239 10158 table: 0x438434c0 Mapping: 239 240 10159 table: 0x43843570 Mapping: 241 242 10161 table: 0x43843620 Mapping: 242 243 10162 table: 0x438436d0 Mapping: 243 244 10163 table: 0x43843780 Mapping: 244 245 10164 table: 0x43843830 Mapping: 245 246 10165 table: 0x438438e0 Mapping: 246 247 10166 table: 0x43843990 Mapping: 247 248 10167 table: 0x43843a40 Mapping: 248 249 10168 table: 0x43843af0 Mapping: 249 250 10169 table: 0x43843ba0 Mapping: 250 251 10170 table: 0x43843c50 Mapping: 251 252 10171 table: 0x43843d00 Mapping: 252 253 10172 table: 0x43843db0 Mapping: 253 254 10173 table: 0x43843e60 Mapping: 254 255 10174 table: 0x43843f10 What am I doing wrong? Note that I know there are lots of font options and that I can easily find OpenType fonts with suitable symbols for use with LuaTeX. There are lots of practical solutions, but this is not a practical question. I'm just curious about what is happening and how this should be corrected. I'm also aware than the problem will hopefully disappear in a few weeks time when TeX Live 2026 is released. I want to ask now precisely because this will be harder to reproduce soon and that just isn't a satisfying solution to the puzzle. Complete code as a single block: \begin{filecontents*}[overwrite]{fixit.lua} pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 -- Needed for Type 1 fonts end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document}

  • How to thicken the subpath's segment with specific position?
    by Explorer on January 27, 2026 at 12:37 pm

    This question is similar to this question, but not exactly the same. I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw[help lines] (-1,-1) grid (7,2); \draw[thick,magenta] (0,0) .. controls (3,3) and (4,-1) .. % coordinate[pos=.3] (A) %<- point start of thick line % coordinate[pos=.5] (B) %<- point end of thick line (6,0); \clip (2,0) rectangle (3,3); \draw[line width=3pt,cyan] (0,0) .. controls (3,3) and (4,-1) .. (6,0); \end{tikzpicture} \end{document} Noted that the GREEN cut is what I was after, the cut should along the path, but not the \clip-ed rectangle. What I saied is not the same as Paul Gaborit's solution, is that I want to control the proportion of (says 0.3 and 0.5, and coloe them thicker) the "subpath". The solution with: decoration={ show path construction, curveto code={ \addtocounter{pos}{1} \pgfmathtruncatemacro{\min}{#1 - 1} \ifthenelse{\thepos < #2 \AND \thepos > \min}{ \draw[#3] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast); }{} } } points here \tikzinputsegmentfirst, \tikzinputsegmentsupportX and \tikzinputsegmentlast looks not easy to control two points position as pos=0.3, is there any better solution? Any possible(plain-TikZ,tkz-elements,luadraw) are all welcome!

  • How to expand the macros in tabularray first with `expand` key?
    by Explorer on January 27, 2026 at 11:30 am

    I want the following result: There are two features I want to control: The columns: First Col to be itshape Second Col to add cmdA left Third Col to add cmdB right The rows: What's more, every line's content is the same, replicated for THREE times. It could be achieved by: \documentclass[border=1cm]{standalone} \usepackage{tabularray} \DeclareRobustCommand{\cmdA}[1]{cmdA#1}% \DeclareRobustCommand{\cmdB}[1]{#1cmdB}% \newcommand\columnA[1]{\textit{#1}} \newcommand\columnB[1]{\cmdA{#1}} \newcommand\columnC[1]{\cmdB{#1}} \NewExpandableDocumentCommand{ \addcols }{ m }{ {#1} & {#1} & {#1} \\} \begin{document} \begin{tblr}[expand=\addcols]{ colspec = {*{3}{X[c,m,5cm]}}, row{1} = {font=\Large\bfseries}, cell{2-Z}{1} = {cmd=\columnA}, cell{2-Z}{2} = {cmd=\columnB}, cell{2-Z}{3} = {cmd=\columnC}, hlines={1.5pt}, vlines={1.5pt}, } ColA & ColB & ColC \\ % \addcols{Line1} % \addcols{Line2} % \addcols{Line3} Line1 & Line1 & Line1 \\ Line2 & Line2 & Line2 \\ Line3 & Line3 & Line3 \end{tblr} \end{document} Now, assuming that there are too many columns(for example,10 columns), it's diffcult to type it for so many times. So I tried with \addcols, but the expand and cell{...}={cmd=...} complained with: ! Misplaced alignment tab character &. \addcols code #1-> {#1} & {#1} & {#1} \\ l.26 \end {tblr} ? Is that possible to achieve this at the same time?

  • Showcase of beautiful 'electrical circuit diagrams' done in TeX & friends
    by cis on January 27, 2026 at 7:03 am

    When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}

  • How can I accessibly make my pdf have an H1 heading?
    by Teepeemm on January 26, 2026 at 7:03 pm

    My accessibility checker (Ally) complains that the following "PDF does not have headings": \DocumentMetadata{tagging=on,lang=en-US,pdfstandard=ua-2, tagging-setup={ math/setup=mathml-SE, % role/new-tag=Title/H1, } } \documentclass{article} \usepackage{lipsum} \title{Title} \begin{document} \maketitle \lipsum[1-9] \end{document} I understand this means that Ally is looking for a \section command (or similar), but that doesn't make sense for this document. I saw elsewhere that uncommenting the role line would cause the title to become an H1, satisfying the need for headings. This satisfies Ally, but now the compilation gives a warning Parent-Child 'pdf2:H1' --> 'pdf2:P'. Relation is not allowed! and VeraPDF says that the PDF is no longer UA-2. Is there a way to make the title become H1 and not P?

  • Simplifying an Asymptote figure for spherical coordinates
    by Sebastiano on January 26, 2026 at 12:58 pm

    I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:

  • Merging listoffigures and listofschemes into one
    by palloc on January 25, 2026 at 9:38 pm

    I am working with the following code: \documentclass{report} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage{chemstyle} \usepackage[colorlinks]{hyperref} \counterwithout{figure}{chapter} \counterwithout{scheme}{chapter} \begin{document} \tableofcontents \chapter{A} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig I} \label{figA} \end{figure} \begin{scheme} \centering \includegraphics[width=0.5\linewidth]{...} \caption{Sch I} \label{schA} \end{scheme} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig II} \label{figB} \end{figure} \ref{figA}, \ref{schA}, \ref{figB} \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Figures} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Scheme} \listofschemes \end{document} What I want is the following: Merge the List of Figures and the List of Schemes into a single List of Figures. In that case, a Scheme should be numbered as a Figure (e.g., “Scheme 1” → “Figure 2”). The output of \ref{schA} should be “Figure 2”.

  • Why is my METAFONT code wrong?
    by Grzegorz Brzęczyszczykiewicz on January 25, 2026 at 9:11 pm

    mode_setup; thick#:=10pt#; thin#:=5pt#; xoo#:=15pt#; yoo#:=20pt#; dot#:=4pt#; slant#:=0pt#; define_pixels(thick, thin, xoo, yoo, dot, slant); ascender:=3; descender:=1; def be(expr x, y) = (x*xoo+y*slant, y*yoo) enddef; path bowl; bowl := be(1, 0) .. controls be(1.6, 0) and be(2, 0.4) .. be(2, 1) .. controls be(2, 1.6) and be(1.6, 2) .. be(1, 2) .. controls be(0.4, 2) and be(0, 1.6) .. be(0, 1) .. controls be(0, 0.4) and be(0.4, 0) .. cycle; def stick(expr height, length) = be(0-length, height)--be(0, height)--be(0, 0) enddef; def serif(expr length) = be(0-length, 0)--be(length, 0) enddef; pen thinP; thinP := pencircle scaled thin; %a thin, circular pen pen thickP; thickP := pencircle xscaled thick yscaled thin; %a thick, elliptical pen numeric theta_v, theta_n, A, k; theta_v := angle(slant, yoo); A := theta_v / 2; theta_n := angle(yoo, -slant); k := sqrt( 25 - (2.5*sin(theta_n - A))**2 ) / ( 5*cos(theta_n - A) ); pen p; p := thickP xscaled k rotated A; beginchar("o", 3*xoo#, 2*yoo#, 0); pickup thickP; draw bowl; endchar; beginchar("l", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(ascender, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); endchar; beginchar("b", 3.2*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(ascender-1, 0.5)) shifted be(0.25, 1); pickup p; draw be(0.25, 1.5)--be(0.25, 0.1) endchar; beginchar("d", 3.3*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(1.5, ascender)--be(2, ascender)--be(2, 0)--be(2.5, 0); endchar; beginchar("p", 3.2*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(2+descender, 0.5)) shifted be(0.25, 0-descender); draw (serif(0.5)) shifted be(0.25, 0-descender); endchar; beginchar("q", 3.1*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(2, 1)--be(2, 0-descender); draw (serif(0.5)) shifted be(2, 0-descender); pickup p; draw be(2, 1.9)--be(2, 0.75) endchar; beginchar("i", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(2, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); pickup pencircle scaled (thick+dot); draw be(0.425, 2.75) endchar; beginchar("h", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(ascender, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; beginchar("n", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(2, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; end there are errors and it should be correct, it throws "Missing )" and "Extra tokens will be flushed" errors. For slant = 0, k should work out to sqrt(1.75) = 1.32287565553..., and A = 45°, however due to a bug, the k is a few eyelets shy of the expected sqrt(1.75), and the line becomes too thin. As for the A, it maybe is correct but I don't know if it is. There are bugs and I don't know how to fix them.

  • Different column alignment of first-row
    by Werner on January 25, 2026 at 5:19 pm

    I like my matrix indices to be center-aligned while numbers within the matrix should be right-aligned for better visual clarity of scale. However, none of my attempts to achieve both have been successful. In the example below, the first option is closest, but fails to align the lost column index. \documentclass{article} \usepackage{nicematrix,xcolor} \newcommand{\mc}{\multicolumn{1}{c}} \begin{document} Manual formatting without \texttt{first-row} - last column index not centered: \[ \begin{NiceArray}{ *{6}{r} } \mc{\color{red}\scriptstyle 0} & \mc{\color{red}\scriptstyle 1} & \mc{\color{red}\scriptstyle 2} & \mc{\color{red}\scriptstyle 3} & \mc{\color{red}\scriptstyle 4} & \mc{\color{red}\scriptstyle 5} \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{\string\RowStyle} - no centering of indices: \[ \begin{NiceArray}{ *{6}{r} } \RowStyle[nb-rows=1]{\color{red}\scriptstyle} 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{first-row} - no centering of indices: \[ \begin{NiceArray}{ *{6}{ r } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] Using \texttt{first-row} with \texttt{c}entered columns - no right-aligned matrix elements: \[ \begin{NiceArray}{ *{6}{ c } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] \end{document} How can I achieve a different alignment for the first row (indices) compared to the rest of the matrix?

  • Where does this 1pt extra space between paragraphs come from, and how to configure it?
    by H. Weirauch on January 25, 2026 at 2:09 pm

    In the MWE \documentclass{article} \usepackage{lua-visual-debug} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \begin{document} \rule{6mm}{6mm} \rule{7mm}{6mm} \end{document} the code contains an empty line (= new paragraph) between the two \rules. This is what it looks like in the output: Between the paragraphs, some vertical spacing is inserted. As far as I can tell, it is exactly 1pt. Where does this come from, and how am I supposed to modify it? This space does not occur when using minimal document class; it apparently is limited to article (or other high-level classes like KOMA).

  • How can I tag an l3pdftextfield?
    by cfr on January 25, 2026 at 6:53 am

    I'm trying to create a text field in a tagged PDF. My real document uses ltx-talk, which complicates things slightly, but the MWE below uses article. I mention ltx-talk in case somebody has a solution which would work for article, but not for ltx-talk, so that I do not waste people's time. \DocumentMetadata{% lang=en-GB, tagging=on, pdfversion=2.0, pdfstandard=UA-2, } \documentclass{article} \usepackage{bookmark} \usepackage{l3pdffield} \title{Tools} \ExplSyntaxOn \cs_new_eq:NN \textfield \pdffield_textfield:n \ExplSyntaxOff \begin{document} \Form \textfield { name=fieldA, width=50mm, height=12pt, depth=50pt, setfieldflags=Multiline, altname=a, } \end{document} I'm having some difficulty understanding how much I'm supposed to do here and how much I'm supposed to let happen. tagpdf.pdf suggests that form fields created with l3pdffield should be automatically added to the structure. I think this indeed happens1: <PDF> <StructTreeRoot> <Document xmlns="http://iso.org/pdf2/ssn" id="ID.02" > <text-unit xmlns="https://www.latex-project.org/ns/dflt" id="ID.05" rolemaps-to="Part" > <text xmlns="https://www.latex-project.org/ns/dflt" id="ID.06" xmlns:Layout="http://iso.org/pdf/ssn/Layout" Layout:TextAlign="Justify" rolemaps-to="P" > <Form xmlns="http://iso.org/pdf2/ssn" id="ID.07" > <?ReferencedObject type="Annot" page="1" ?> </Form> </text> </text-unit> </Document> </StructTreeRoot> </PDF> What I'm not sure about is how to configure a Contents entry for the field - or maybe where I am supposed to put altname, which is presumably in the wrong place at the moment? The document compiles without errors with either LuaLaTeX or pdfLaTeX. However, the PDF fails to validate against UA-22,3. verapdf says <?xml version="1.0" encoding="utf-8"?> <report> <buildInformation> <releaseDetails id="core" version="1.28.2" buildDate="2025-07-15T16:07:00+01:00"></releaseD etails> <releaseDetails id="validation-model" version="1.28.2" buildDate="2025-07-15T16:12:00+01:00 "></releaseDetails> <releaseDetails id="gui" version="1.28.2" buildDate="2025-07-15T16:59:00+01:00"></releaseDe tails> </buildInformation> <jobs> <job> <item size="23750"> <name>/path/to/test-file.pdf</name> </item> <validationReport jobEndStatus="normal" profileName="PDF/UA-2 + Tagged PDF validation pro file" statement="PDF file is not compliant with Validation Profile requirements." isCompliant=" false"> <details passedRules="1722" failedRules="1" passedChecks="175" failedChecks="1"> <rule specification="ISO 14289-2:2024" clause="8.10.2.3" testNumber="1" status="faile d" failedChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Accessibility validation p rofile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant ="false"> <details passedRules="1718" failedRules="1" passedChecks="171" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Reuse validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false" > <details passedRules="1705" failedRules="1" passedChecks="169" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <duration start="1769321531153" finish="1769321531866">00:00:00.713</duration> </job> </jobs> <batchSummary totalJobs="1" failedToParse="0" encrypted="0" outOfMemory="0" veraExceptions="0 "> <validationReports compliant="0" nonCompliant="1" failedJobs="0">1</validationReports> <featureReports failedJobs="0">0</featureReports> <repairReports failedJobs="0">0</repairReports> <duration start="1769321531030" finish="1769321531917">00:00:00.887</duration> </batchSummary> </report> From what I gathered from the PDF spec, I want to add a Contents here, because a label would correspond to a visible label in the PDF, which does not exist. 1 However, some parts of the documentation for l3pdfmanagement suggest that perhaps only link annotations, as opposed to widget annotations, are currently handled fully automatically by the tagging code. So I'm not sure that I do not need to do something additional here, but the problem does not seem to be adding the widget to the structure? 2 In fact, the text field here is not supposed to make sense on its own. It is only meant to make sense when I am standing there talking. It's just a place for me to type. Its purpose will make sense by the end of class, because it will then have content. 3 So marking the field up for accessibility is actually a bit strange. It isn't 'accessible' to sighted readers either in advance of the relevant class.

  • circuitikz: position and adjust current and voltage arrows
    by cis on January 24, 2026 at 7:17 pm

    I'm trying to recreate this image on 5mm grid paper using the original dimensions. It's not a big problem; I'm just looking for some fine-tunings inside the circuitikz-package. I've tested a few keys, but I'm wondering: What is the correct method: to add a longer voltage arrow that's a bit further away from the source? to add a current arrow at the shown position in a package-like way (regular TikZ is clear)? PS: I would also like to reduce the (global setting!) size of the arrowheads and the control points ("poles", I haven't quite understood chapter 6.1 yet); but that might be too much for one thread. MWE: [I've only set a small excerpt here to address the problems. I can easily add the rest later by myself.] \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[font=\footnotesize\sffamily, european resistors, circuitikz/resistors/width=0.425,% default 0.8 circuitikz/bipoles/generic/height=0.165,% default 0.3 circuitikz/bipoles/thickness=1.0, % default 2 circuitikz/bipoles/vsource/width=0.35, circuitikz/bipoles/vsource/height=0.35, %circuitikz/bipole/is voltage=false, %circuitikz/voltage/distance from node=5.0875,% old: 0.8 %circuitikz/voltage shift sources adjust=4.525,% default: 0.5 %voltage shift=0.125,% optional ] \draw[gray!25, step=5mm] (-1.5,0.5) grid (4,-4); \draw[] (0,-2) to[vsource, v<=12V, mirror] (0,0) -- (1.5,0); \draw[] (0.5,0) to[R=15, *-*] (0.5,-1) to[R, a=25, -*] (0.5,-2); \end{circuitikz} \end{document}

  • Help trying to customise toc with tagging support
    by David Purton on January 24, 2026 at 12:25 pm

    I'm trying to customise the TOC using built in commands to allow for tagging support, but I'm running in to some behaviour I can't figure out. In the following MWE, the I set \contentsline@text@2@format to \emph and the the line is formatted as expected. But if I set it to \MakeUppercase the label structure breaks (in this case notice the missing space after the subsection number). Am I doing this wrong? I'm struggling to trace the code through to find out why this happens. %! TeX Program = lualatex \DocumentMetadata{ lang=en, pdfstandard = ua-2, pdfstandard = a-4f, tagging=on } \documentclass{article} \ExplSyntaxOn \cs_set_nopar:cpn { contentsline@text@2@format } { \emph % Fails with \MakeUppercase } \ExplSyntaxOff \begin{document} \tableofcontents \subsection{A section heading} \end{document}

  • A new kind of ligature, connected d/p
    by ivo Welch on January 24, 2026 at 3:58 am

    I have been trying to coerce Claude to help me, but it is hilariously bad. I am trying to create a new character that looks like d <space> p, where the <space> becomes a connector. The font is charter, math, which I can pull off from newtxmath or mathdesign, which means the input is modestly slanted. \documentclass[12pt]{standalone} \usepackage{XCharter} \usepackage[charter,vvarbb]{newtxmath} \usepackage{amsmath} \begin{document} \fontsize{200}{172}\selectfont \ensuremath{d \kern22pt p} \end{document} I have blown this up here, but I shall need it in my normal font lateron. The result is supposed to look somewhat like: Obviously, one can do quite a bit better than me and my pen, especially, but not only at the lower left corner of my new connector. I will use this, in standard font size, a few hundred times in my document. Is it easy to create such a character? What program should I use? A low learning curve is a lot more important than versatility for further designs in the future. Once I have the character, how do I best use it in my document? Should I try to create its own one-character font, or just create a few PNG files at the right sizes that a \dp\ macro then inserts?

  • Can I add a symbol to indicate that a footnote has been split across pages?
    by Draconis on January 23, 2026 at 9:05 pm

    My university's thesis formatting guidelines are extremely stringent about margins, which means when a footnote gets split across pages (because the \footnotemark is on the bottom line of the page, so including the entire footnote would push the mark onto the next page), there's not much I can do to fix it. I can't, for example, expand the text box slightly, or insert some additional whitespace at the bottom. Proofreaders have found this confusing. So with the better typographical solutions being off-limits, I would like to at least indicate to the reader that the footnote continues on the next page. Is it possible to indicate some sort of symbol, such as a rightward-pointing arrow, at the point where a footnote has been split across pages, to indicate that it's continued elsewhere? I know some periodicals do this when an article is split across pages. MWE adapted from here: \documentclass[oneside]{book} \usepackage{lipsum} \usepackage[splitrule]{footmisc} \begin{document} \lipsum[1-3] \lipsum[1] New paragraph, which is really long, so long in fact that it spans more than one line. New paragraph, which is really long, so long in fact that it spans more than one line. \footnote{Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour.} % \lipsum \end{document} Current result: What I would like: some kind of symbol (perhaps a ➤?) at the end of the first page, showing that the footnote continues elsewhere and isn't just broken off. \usepackage[splitrule]{footmisc} indicates on the next page that there's a continuation, but I would like a marker on the first page as well. This question, this question, and this question ask the same thing, but none of them includes a MWE; I'm hoping that providing one will help find an answer.

  • How to position TikZ shapes directly centered under text labels in a table-like layout?
    by Oregon Math Tutor on January 23, 2026 at 7:13 pm

    I'm creating a geometry reference sheet with a table-like layout using TikZ. I need: the shape label horizontally centered in the cell each figure centered beneath the label As the image shows, I can't achieve this alignment. This image shows my desired output: This image (partial screen shot) shows what the current code renders: Current approach: Using \node for labels positioned with anchor=east Drawing shapes inside \begin{scope}[shift={...}] blocks Each row has a label on the left, shape in the middle-left, and properties on the right Thanks very much for taking time to assist me! mwe: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{amssymb} \usetikzlibrary{calc, shapes.geometric, arrows.meta, decorations.markings} % Use Helvetica (similar to Arial) for a clean look since custom fonts caused errors \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} % Define colors to match the original image \definecolor{colSquare}{RGB}{156, 188, 156} % Muted Green \definecolor{colRect}{RGB}{128, 128, 128} % Greyish \definecolor{colPara}{RGB}{255, 105, 120} % Pink/Red \definecolor{colRhom}{RGB}{190, 140, 190} % Purple \definecolor{colKite}{RGB}{180, 230, 200} % Mint Green \definecolor{colTrap}{RGB}{245, 170, 60} % Orange \definecolor{colText}{RGB}{128, 0, 128} % Purple text for headers \definecolor{colLine}{RGB}{70, 130, 180} % Blue grid lines \begin{document} \begin{tikzpicture}[ thick, % Style for shape outlines myshape/.style={draw=black, line width=1pt}, % Custom tick marks for sides tick/.style={postaction={decorate, decoration={markings, mark=at position 0.5 with {\draw[black, line width=1pt] (-2.5pt,-2.5pt) -- (2.5pt,2.5pt);}}}}, dtick/.style={postaction={decorate, decoration={markings, mark=at position 0.5 with {\draw[black, line width=1pt] (-1.5pt,-2.5pt) -- (2.5pt,2.5pt) (-4.5pt,-2.5pt) -- (-0.5pt,2.5pt);}}}}, % Custom arrows for parallel lines parrow/.style={postaction={decorate, decoration={markings, mark=at position 0.55 with {\arrow[scale=1.5,black]{>}}}}} ] % --- Grid Layout --- % Horizontal lines \draw[colLine] (-4, 1.5) -- (12, 1.5); \draw[colLine] (-4, 0) -- (12, 0); \draw[colLine] (-4, -4) -- (12, -4); \draw[colLine] (-4, -8) -- (12, -8); \draw[colLine] (-4, -12) -- (12, -12); \draw[colLine] (-4, -16) -- (12, -16); \draw[colLine] (-4, -20) -- (12, -20); \draw[colLine] (-4, -24) -- (12, -24); % Vertical separator \draw[colLine] (3.5, 1.5) -- (3.5, -24); % Headers \node[text=colText, scale=2] at (-0.25, 0.75) {Shape}; \node[text=colText, scale=2] at (7.75, 0.75) {Properties}; % --- Row 1: Square --- \begin{scope}[shift={(0,-2)}] \node[text=colText, scale=1.5, anchor=east] at (2,0) {Square}; \coordinate (S1) at (2.5, -1.2); \coordinate (S2) at (4.9, -1.2); \coordinate (S3) at (4.9, 1.2); \coordinate (S4) at (2.5, 1.2); \fill[colSquare] (S1) -- (S2) -- (S3) -- (S4) -- cycle; % Ticks drawn manually to ensure rotation alignment looks just like the image \draw[myshape] (S1) -- (S2) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S2) -- (S3) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S3) -- (S4) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S4) -- (S1) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw (S1) -- (S3); \draw (S2) -- (S4); % Right angle at center \draw (3.7,0) ++(0.2,0.2) -- ++(-0.2,0.2) -- ++(-0.2,-0.2); % Corner right angles \draw (S1) ++(0.3,0) -- ++(0,0.3) -- ++(-0.3,0); \draw (S2) ++(-0.3,0) -- ++(0,0.3) -- ++(0.3,0); \draw (S3) ++(-0.3,0) -- ++(0,-0.3) -- ++(0.3,0); \draw (S4) ++(0.3,0) -- ++(0,-0.3) -- ++(-0.3,0); \node[anchor=west, align=left] at (4.2, 0) { \begin{minipage}{8cm} \begin{itemize} \setlength\itemsep{0.2em} \item All sides are equal. \item All angles are $90^\circ$. \item Diagonals are equal. \item Diagonals bisect at $90^\circ$. \end{itemize} \end{minipage} }; \end{scope} % --- Row 2: Rectangle --- \begin{scope}[shift={(0,-6)}] \node[text=colText, scale=1.5, anchor=east] at (2,0) {Rectangle}; \coordinate (R1) at (2.5, -0.9); \coordinate (R2) at (5.0, -0.9); \coordinate (R3) at (5.0, 0.9); \coordinate (R4) at (2.5, 0.9); \fill[colRect] (R1) -- (R2) -- (R3) -- (R4) -- cycle; % Sides ticks \draw[myshape] (R1) -- (R2) node[midway] {\tikz \draw[line width=1pt] (-1.5pt,-2.5pt)--(2.5pt,2.5pt) (-4.5pt,-2.5pt)--(-0.5pt,2.5pt);}; \draw[myshape] (R2) -- (R3) node[midway] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (R3) -- (R4) node[midway] {\tikz \draw[line width=1pt] (-1.5pt,-2.5pt)--(2.5pt,2.5pt) (-4.5pt,-2.5pt)--(-0.5pt,2.5pt);}; \draw[myshape] (R4) -- (R1) node[midway] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw (R1) -- (R3); \draw (R2) -- (R4); % Corners \draw (R1) ++(0.2,0) -- ++(0,0.2) -- ++(-0.2,0); \draw (R2) ++(-0.2,0) -- ++(0,0.2) -- ++(0.2,0); \draw (R3) ++(-0.2,0) -- ++(0,-0.2) -- ++(0.2,0); \draw (R4) ++(0.2,0) -- ++(0,-0.2) -- ++(-0.2,0); % Diagonal marks (triple tick) % Manually drawing triple ticks on diagonals \draw[line width=0.8pt] (3.2, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.3, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.4, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.1, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.2, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.3, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.2, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (3.3, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (3.4, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.1, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.2, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.3, -0.1) -- ++(0.1,-0.2); \node[anchor=west, align=left] at (4.2, 0) { \begin{minipage}{8cm} \begin{itemize} \setlength\itemsep{0.2em} \item Opposite sides are equal. \item All angles are $90^\circ$. \item Diagonals are equal. \item Diagonals bisect each other. \end{itemize} \end{minipage} }; \end{scope} \end{tikzpicture} \end{document}

  • Raise integral signs with limits
    by Knudsen on January 23, 2026 at 2:14 pm

    Is there a way to raise an integral sign slightly and bring the limits together with it? For example, in \documentclass{report} \begin{document} \[ \int_0^1 \sqrt{a+b\sqrt{a+b\sqrt{a+b\sqrt{x}}}} dx \] \end{document} the integral can benefit from being enlarged and moved up a small bit, even if it going to take it out of alignment with part of the formula.

  • Is it possible simplify this lualatex code?
    by xcn on January 23, 2026 at 8:39 am

    The following code is used to retrieve and round a variable defined via \directlua. Is it possible to remove the luaround function and replace {\IfValueTF{#1} {luaround(#2, #1)} {#2}} with something like {\IfValueTF{#1} {("%." .. #1 .. "f"):format(#2)} {#2}}? \documentclass[12pt]{article} \usepackage{luacode} \begin{luacode*} function luaround(x, n) return string.format('%.' .. n .. 'f', x ) end \end{luacode*} \NewExpandableDocumentCommand{\usevar}{om}{% \directlua{tex.sprint(% {\IfValueTF{#1} {luaround(#2, #1)} {#2} } % IfValueTF )} } \begin{document} \directlua{ x=0.345 y=2 } \usevar[2]{x} \end{document}