Hot
- How do 256+ character pdfLaTeX fonts work, and how to make one?by Grzegorz Brzęczyszczykiewicz on January 28, 2026 at 9:48 am
I am talking about those "fake fonts" that are composed of multiple fonts to have more characters. An example is Computer Modern, which uses multiple fonts, one for text symbols, one for math symbols, and another for Greek letters. Is it possible to make a font that works like this?
- Matching the length of parts of an equationby Jinwen on January 28, 2026 at 9:48 am
In the following expression: is it possible to somehow match the length of the P(T) and Q(T) part, so that the 1+T part is vertically aligned? \documentclass{article} \usepackage{kpfonts} % I'm using this font to make the issue more visible \begin{document} \( \frac{1 \,+\, T\,P(T)}{1 \,+\, T\,Q(T)} \) \end{document}
- custom command to put a bold title, a line break and normal textby user1850133 on January 28, 2026 at 6:16 am
I'm trying to make a command that would put the first argument in bold. Then it must create a line break and put the remaining text normally, which should have been passed as second arg. The problem is that the line-break must occur only if after the bold text there is space enough to put at least two lines from the text in the second argument. Otherwise it must do a page-break and put that line in bold and the normal text thereafter. here is my mwe: \documentclass[a4paper]{article} \usepackage{blindtext} \usepackage[vmargin=1.3in]{geometry} \NewDocumentCommand{\monbloc}{ m m }{\textbf{#1}\par#2} \begin{document} \begin{itemize} \item \monbloc{abc}{\blindtext[1]} \item \monbloc{def}{\blindtext[1]} \item \monbloc{ghi}{\blindtext[1]} \item \monbloc{jkl}{\blindtext[1]} \item \monbloc{mno}{\blindtext[1]} \end{itemize} \end{document}
- tikz diagram works in overleaf but fails in texworksby duality on January 28, 2026 at 6:01 am
I am trying to get the following tikz diagram to work in texworks. It works fine in overleaf but fails in texworks. Any idea how to fix this? \documentclass[11pt]{article} \usepackage{tikz} \usepackage{float} \usetikzlibrary{calc} \usetikzlibrary{external,quotes,chains} \tikzset{vertex/.style={black,fill,draw,minimum size=6pt,inner sep=0pt,circle,thin},bold/.style={black,line width=0.6mm},plain/.style={black,thin},bold edges/.style=bold,plain edges/.style=plain,label distance=1mm,text node/.style={rectangle,fill=none,draw=none},every label/.style=text node,caption node/.style={text node,font=\Large}} \newcommand{\AR}[1]{\overrightarrow{#1}} \title{something} \author{someone} \begin{document} \maketitle \begin{figure}[H] \centering \begin{tikzpicture} [node distance=2cm, base node/.style={circle,draw,minimum size=15pt},scale=0.8] \node[base node, very thick] (5){5}; \node[base node, very thick][left of=5] (3){3}; \node[base node, very thick][above of=5] (1){1}; \node[base node, very thick][below of=5] (4){4}; \node[base node, very thick][right of=5] (2){2}; \path [->, very thick] (3) edge node[left] {} (5); \path [<-, very thick] (5) edge node[right] {} (2); \path [->, very thick](1) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (2); \path [->, very thick](1) edge node[left] {} (2); \path [->, very thick] (5) edge node[left] {} (1); \path [->, very thick] (5) edge node[left] {} (4); % ------- First copy of the circulant ------- \node[base node, very thick] (w1) at ($(90:2) + (3,-4)$) {6}; \node[base node, very thick] (w2) at ($(30:2) + (3,-4)$) {7}; \node[base node, very thick] (w3) at ($(-30:2) + (3,-4)$) {10}; \node[base node, very thick] (w4) at ($(-90:2) + (3,-4)$) {9}; \node[base node, very thick] (w5) at ($(-150:2) + (3,-4)$) {8}; %\node[base node, very thick] (w6) at ($(150:2) + (3,-4)$) {5}; %repeated \path[->, very thick] (w1) edge [bend left=5] (5); \path[->, very thick] (w1) edge (w3); \path[->, very thick] (w2) edge (w1); \path[->, very thick] (w2) edge (w4); \path[->, very thick] (w3) edge (w2); \path[->, very thick] (w3) edge (w5); \path[->, very thick] (w4) edge (w3); \path[->, very thick] (w4) edge [bend right=10] (5); \path[->, very thick] (w5) edge (w4); \path[->, very thick] (w5) edge (w1); \path[->, very thick] (5) edge [bend left=5] (w5); \path[->, very thick] (5) edge [bend left=15] (w2); % ------- Second copy of the circulant ------- \node[base node, very thick] (z1) at ($(90:2) + (9,-4)$) {11}; %2 \node[base node, very thick] (z2) at ($(30:2) + (9,-4)$) {12}; %3 \node[base node, very thick] (z3) at ($(-30:2) + (9,-4)$) {15}; %6 \node[base node, very thick] (z4) at ($(-90:2) + (9,-4)$) {14}; %5 \node[base node, very thick] (z5) at ($(-150:2) + (9,-4)$) {13}; %4 %\node[base node, very thick] (z6) at ($(150:2) + (9,-4)$) {10}; %1 \path[->, very thick] (z1) edge[bend right=10] (w3); \path[->, very thick] (z1) edge (z3); \path[->, very thick] (z2) edge (z1); \path[->, very thick] (z2) edge (z4); \path[->, very thick] (z3) edge (z2); \path[->, very thick] (z3) edge (z5); \path[->, very thick] (z4) edge (z3); \path[->, very thick] (z4) edge[bend left=10] (w3); \path[->, very thick] (z5) edge (z4); \path[->, very thick] (z5) edge (z1); \path[->, very thick] (w3) edge (z5); \path[->, very thick] (w3) edge[bend left=10] (z2); \end{tikzpicture} \caption{A graph $\AR{R_5} \cdot R_6$} \label{fig:gluingToGetAllN} \end{figure} \end{document}
- Ligatures disappear with package spelling under LuaLaTeXby Knudsen on January 28, 2026 at 3:52 am
The package spelling extracts the text from a standard LaTeX file under LuaTeX, but on this MWE: \documentclass{report} \usepackage{spelling} \begin{document} We differentiate using the definition of differentiability and and diffusion efforts offered. \end{document} the standard run of lualatex filename also removes the ligatures ff and fi rendering We dierentiate using the denition of dierentiability and diusion eorts oered in the file filename.spell.txt. The addition of the mapping command: \spellingmapping{0xfb00}{ff} which is supposed to be the default does not change the behaviour. How are ligatures handled in the package?
- Does OpenAI's Prism support project versioning or file history?by Franck Dernoncourt on January 28, 2026 at 3:40 am
OpenAI recently launched Prism, their AI-native LaTeX workspace for scientific writing. As someone looking to transition from Overleaf as they pissed me off when they started charging for compilation time and adding collaborators and because I much prefer Prism's AI assistant, one of my main requirements is a robust way to track changes or revert to previous states of my .tex files. I’ve noticed that Prism (built on the acquisition of Crixet) emphasizes real-time collaboration and "persistent project memory", but I haven't been able to find a specific "History" tab or "Version Control" panel similar to Overleaf’s history or a Git-backed workflow. Does Prism currently have a built-in feature to view and restore previous versions of files in a project?
- 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?
- Table of Contents: prevent line break between dotted line and the page numberby Jinwen on January 28, 2026 at 1:00 am
With \titlecontents of the package titletoc to configure table of contents, I am encountering an issue that if the text is essentially occupying the whole line, then the page number might be wrapped to the beginning of the next line, which looks quite strange. For example, in the following, the last page number "101" is expected to be shown on the right, not at the beginning of a new line: I tried \nolinebreak and \hfill, but neither worked. (Edit: The above result is obtained by using LuaLaTeX, the version shipped with TeX Live 2025. If using pdfLaTeX instead, the result would be: which raises another issue: the dots are somehow not properly aligned due to the automatic line break... ) Is there some way to prevent this behavior? Below is a MWE (I am using an example where the text cannot be hyphened, but this is close to my actual case, where the problematic section title ends with several authors' name like Author1--Author2--Author3 and cannot be properly hyphened...): \documentclass{book} \usepackage{titletoc} \titlecontents{chapter} [2em] % i.e., 0em (part) + 2em {\addvspace{.5pc}\normalfont} {\contentslabel[\thecontentslabel]{2em}} {\hspace*{-2em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{section} [5.75em] % i.e., 2em (chapter) + 2.75em + 1em {\normalfont} {\contentslabel[\thecontentslabel]{2.75em}} {\hspace*{-2.75em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{subsection} [10.5em] % i.e., 5.75em (section) + 3.75em + 1em {\normalfont} {\contentslabel[\thecontentslabel]{3.75em}} {\hspace*{-3.75em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{subsubsection} [15.75em] % i.e., 10.5em (subsection) + 4.25em + 1em {\normalfont\itshape} {\contentslabel[\thecontentslabel]{4.25em}} {\hspace*{-4.25em}} {\titlerule*[1em]{.}\normalfont\contentspage} \setcounter{secnumdepth}{4} \setcounter{tocdepth}{4} \begin{document} \tableofcontents \addtocounter{page}{100} \section{Test} \subsection{Test--Test} \subsubsection{Test--Test--Test--Test--Test--Test--Test--} \end{document}
- Is there a simpler way to define a piecewise function?by xcn on January 28, 2026 at 12:43 am
In the code below, a piecewise function is defined using nested \fp_compare:nNnTF commands. Could this be achieved in a simpler manner? \documentclass{article} \begin{document} % Define a piecewise function \ExplSyntaxOn \NewDocumentCommand{\clampvalue}{m} { % If x < 0.2, return 0.2 \fp_compare:nNnTF {#1} < {0.2} {0.2} { % Otherwise, if x > 1, return 1 \fp_compare:nNnTF {#1} > {1} {1} % Otherwise (0.2 ≤ x ≤ 1), return 0.5 {0.5} } } % Test case \clampvalue{0.1} % Outputs 0.2 \par \clampvalue{0.5} % Outputs 0.5 \par \clampvalue{1.2} % Outputs 1 \ExplSyntaxOff \end{document}
- 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}
- Numbering Issue in Cross-Referencing a Definition Blockby ranaya on January 27, 2026 at 5:38 pm
I have some definition blocks written in my Latex code. These blocks give a nice graphical view to my definitions and here's how the code looks like: In preamb: \newtcbtheorem[number within=section]{definition}{Definition} { theorem style = plain apart, enhanced, frame hidden, breakable, boxrule=2mm,titlerule=0mm,toptitle=1mm,bottomtitle=1mm, fonttitle=\bfseries\large, fontupper=\normalsize, coltitle=black!60!PinkNude, colbacktitle=white!70!PinkNude, colback=white!80!PinkNude }{def} And here's an example definition block: \begin{definition}{}{}\label{def:2_1} \begin{itemize}[leftmargin=*] \item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor. \vspace*{1mm} \item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor. \end{itemize} \end{definition} And the cross reference: we define the inertial delay ($\tau$\textsubscript{D}) of a MOSFET in the definition block \ref{def:2_1}. However, this does not produce the correct cross referencing as shown below: Can anybody shed a light on to what's happening here? Why the cross-referencing is wrong here? Thanks and Regards Anuradha
- Transliteration from cyrillic to latin scriptby Apothikon on January 27, 2026 at 4:39 pm
How can I use babel transform to set a rule of translitteration in which a single cyrillic character corresponds to more than one latin character? I can manage most of the letters (e.g. Б becomes B, Д becomes D...) but how can I say to babel that Х and Ц must become CH and TS? The idea is to use something like this: \babelprehyphenation{russian} { ([ХѾЦѰхѿцѱ]) } { string = {1|ХЦхц|ChTschts} } but this code is not working because cyrillic and latin letters are not in a one-to-one correspondence. Also, how can I force babel to ignore the character Ъ when it occurs at the end of a word? I'm not sure if this happens in russian, but in other languages it does and I don't wont to transliterate it, since it is not pronuonced. Thank you
- How to install sty-File in Overleaf from repository?by UniCoder1966 on January 27, 2026 at 1:36 pm
I'm trying to use Overleaf to compile a tex-Document I created. However, Overleaf doesn't support the eforms-Package I'm using: LaTeX Error: File `eforms.sty' not found. I read that you can manually install packages in Overleaf by uploading the sty-File. The problem is that the sty-File of the eforms-Package is not downloadable. There's a repository that provides said sty-File. My question: How do I install it in Overleaf? The repository: https://github.com/latextemplates/stys-for-overleaf
- 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?
- Calculation error when setting up a thumb index with LaTeX3by lukascbossert on January 27, 2026 at 10:37 am
I am currently trying to rewrite the code of @Tobi (https://tex.stackexchange.com/a/57317/98739) for a thumb index using LaTeX3-syntax. So far so good, my code works for the position of the first thumb index. Coming to position the second thumb index I get ! Illegal unit of measure (pt inserted). <to be read again> - l.162 \clearpage I assume it is burried within ($ (current~page.north\c_space_tl #1)~ -~ (0,\dim_eval:n{ \l_thumb_top_margin_dim + (\l_thumb_index_int - 1) * \l_thumb_height_dim }) $) but I cannot figure it out. \documentclass[twoside]{scrbook} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{xparse} \usepackage{scrlayer-scrpage} % optional, for header macros \usepackage{xcolor} \colorlet{thumbIndexBG}{blue!50} \colorlet{thumbIndexFont}{black!50} \ExplSyntaxOn \bool_new:N \l_custom_thumbindex_bool \int_new:N \l_thumb_pattern_int \int_new:N \l_thumb_index_int \int_set:Nn \l_thumb_pattern_int { 7 } % <-- change to your own value \int_zero:N \l_thumb_index_int % start at 0 % margins and calculated dimensions \dim_new:N \l_thumb_top_margin_dim \dim_new:N \l_thumb_bottom_margin_dim \dim_new:N \l_thumb_height_dim \dim_new:N \l_thumb_width_dim % initialise the simple values (you can change them later) \dim_set:Nn \l_thumb_top_margin_dim {6cm} \dim_set:Nn \l_thumb_bottom_margin_dim {3cm} \dim_set:Nn \l_thumb_width_dim {1cm} % ----------------------------------------------------------------- %----------------------------------------------------------------- % 2. Helper to recompute \l_thumb_height_dim %----------------------------------------------------------------- \cs_new_protected:Npn \thumb_compute_height: { % (\paperheight - top - bottom) / pattern \dim_set:Nn \l_thumb_height_dim { (\int_use:N \paperheight - \int_use:N \l_thumb_top_margin_dim - \int_use:N \l_thumb_bottom_margin_dim) / \int_use:N \l_thumb_pattern_int } } % call it once (you can also call it again after you change any of the % three quantities above) \thumb_compute_height: %----------------------------------------------------------------- % 3. TikZ style (still in normal LaTeX syntax – no harm in an % expl3 block) %----------------------------------------------------------------- \tikzset { thumb/.style= { fill = thumbIndexBG , % colour may be changed later text = thumbIndexFont, minimum~ height = \dim_use:N \l_thumb_height_dim, text~ width = \dim_use:N \l_thumb_width_dim, outer~ sep = 0pt, font = \bfseries\Huge, inner~ xsep = .75cm, } } %----------------------------------------------------------------- % 4. Low‑level node placement helpers %----------------------------------------------------------------- % The <even/odd> macros are now tiny wrappers around a single % protected function that does the arithmetic in expl3. % \cs_new_protected:Npn \thumb_place_node:nnn #1#2#3 { % #1 = west|east (anchor direction) % #2 = left|right (text alignment) % #3 = node contents \begin{tikzpicture}[remember~ picture,overlay] \node[ thumb, align = #2, anchor = base~ #1, ] % --------------------------------------------------------- % absolute position = (current page.north <west/east>) – % (0 , vertical offset) % The whole thing must be inside $ … $. % --------------------------------------------------------- at ($ (current~page.north\c_space_tl #1)~ -~ (0,\dim_eval:n{ \l_thumb_top_margin_dim + (\l_thumb_index_int - 1) * \l_thumb_height_dim }) $) { #3 }; \end{tikzpicture} } \NewDocumentCommand{\evenpageletterthumb}{m} { \thumb_place_node:nnn {west}{left}{#1} } \NewDocumentCommand{\oddpageletterthumb}{m} { \thumb_place_node:nnn {east}{right}{#1} } \prop_new:N \g_thumb_project_color_prop \prop_put:Nnn \g_thumb_project_color_prop {A}{blue} \prop_put:Nnn \g_thumb_project_color_prop {B}{green} \prop_put:Nnn \g_thumb_project_color_prop {Q}{red} %----------------------------------------------------------------- % 6. The user command \thumbIndex %----------------------------------------------------------------- % #1 (optional) – colour definition used when no project is given % #2 (mandatory) – the letter (or any material) to be printed % #3 (optional) – project ID → colour taken from the property list % \NewDocumentCommand{\thumbIndex}{ O{thumbIndexBG} m o } { \bool_if:NT \l_custom_thumbindex_bool { % ---- colour handling ------------------------------------------------ \IfNoValueTF{#3} { \colorlet{thumbIndexBG}{#1} } % no project → use #1 { % try to fetch a colour name from the prop list; if the key is % missing we simply keep the current definition \prop_get:NnNTF \g_thumb_project_color_prop {#3} \l_tmpa_tl { \colorlet{thumbIndexBG}{\l_tmpa_tl} } { % fallback for unknown project ID \colorlet{thumbIndexBG}{#1} } } % ---- reset index if we have reached the bottom of the column ----- \int_compare:nNnT { \l_thumb_index_int } = { \l_thumb_pattern_int } { \int_zero:N \l_thumb_index_int } % ---- step to the *next* position ----------------------------------- \int_incr:N \l_thumb_index_int % ---- actually place the thumb on the current page ------------------ % (the same node is put into both the header and the foot, so it % appears on the page no matter which page‑style you use) \lehead[\evenpageletterthumb{#2}]{\evenpageletterthumb{#2}} \lohead[\oddpageletterthumb{#2}]{\oddpageletterthumb{#2}} } } \ExplSyntaxOff % -------------------------------------------------------------- \begin{document} \ExplSyntaxOn \bool_set_true:N \l_custom_thumbindex_bool \ExplSyntaxOff \thumbIndex{1} %<-default color X \clearpage \thumbIndex{2}[B] Y \clearpage \thumbIndex{3}[Q] Z \end{document}
- Showcase of beautiful 'electrical circuit diagrams' done in TeX & friendsby cis on January 27, 2026 at 7:03 am
When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}
- Cover Page with Border in LaTeX (With decorations)by Ngô Văn Quyền on January 27, 2026 at 6:24 am
(Overleaf) I am trying to make a page border for cover page only (the first page) as shown in the figure. Any idea to achieve this?
- How to confine the dimensions of an overlay used as a frame's background to that of the frame?by Gary on January 27, 2026 at 4:43 am
In the example below, how can the linear-gradient overlay be confined to within the black frame without having to tinker around with the dimensions in \defineoverlay? I suppose that the outer frame and the overlay are siblings in the page box rather than the overlay being a child of the frame, although the overlay is the background of the frame which might be expected to be bound by the frame's size. Is there an equivalent concept as CSS clip or overflow hidden, such that if the text in the frame changes the size of the frame, the overlay will be adjusted automatically? Thank you. \starttext \defineoverlay [OL2] [ \startMPcode % fill fullsquare xyscaled (TextWidth,TextHeight) fill fullsquare xyscaled (35mm,25mm) withshademethod "linear" withshadedirection (3.5,.5) withshadecolors("darkgreen","darkblue"); \stopMPcode ] \framedtext[ width=fit, align=middle, background=OL2, rulethickness=3pt, offset=2mm, ] { \framedtext[ width=fit, align=middle, background=color, backgroundcolor=yellow, frame=off, ] { Some lines of text. }} \stoptext Added If the line is changed to fill fullsquare xyscaled (OverlayWidth,OverlayHeight) the result is that the width of the overlay still excedes the frame on the right. I'm still doing something wrong. Thanks. I was very sloppy in declaring the commands for the overlay, and forget that I'm not writing code but markup with code in it; and those returns after the [ and the line before the ] can't be left like that. Sorry. After fixing that, it works fine.
- decoration.markings arrowheads breaking, Dimension too large error on parametric plotby humanoferth on January 26, 2026 at 9:32 pm
I am trying to graph a parametric equation but I'm getting a "dimension too large error" upon output. The arrowheads on the lefthand side of the graph seem not to be working as well. Any ideas what's breaking? Thanks! \documentclass{report} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{decorations.markings} \begin{document} \[ \begin{matrix} x=2\cos(t)\\ y=1+2\sin(t)\\ 0\leq{}t\leq\pi\\ \end{matrix}\implies\begin{tikzpicture}[baseline={(0,3)}] \begin{axis}[axis lines = center,xlabel = $x(t)$,ylabel = $y(t)$,grid=both,minor x tick num=3,minor y tick num=3,major grid style={gray},minor grid style={gray!20},axis equal, trig format=rad] \addplot [domain=0:pi,samples=50,black,variable=t,thick,decoration={markings,mark=between positions 0.1 and 0.99 step 2em with {\arrow [scale=1.5]{stealth}}}, postaction=decorate] ({2*cos(t)},{1+2*sin(t)}); \end{axis} \end{tikzpicture} \] \end{document}
- Automatic numbering of multiple imagesby Sebastiano on January 26, 2026 at 9:26 pm
I would like to number the following images as shown in the reference image, but what I have so far is only an idea. Other (better) suggestions are more than welcome. Is there perhaps a specific package that can automatically number images in this way? \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{array} \begin{document} \begin{table}[htbp] \centering \begin{tabular}{|c|>{\raggedright\arraybackslash\hspace{0pt}}p{2.5cm}|} \hline \textbf{Immagini} & \textbf{Commento} \\ \hline \includegraphics[width=0.5\textwidth, margin=0pt 1ex 0pt 1ex,valign=m]{example-image} & P1\\ \hline \includegraphics[width=0.5\textwidth,valign=m]{example-image} & P2 \\ \hline \end{tabular} \caption{Un titolo} \label{label1} \end{table} \end{document}
- Install Casio font series FX-CG 50by Sebastiano on January 26, 2026 at 8:26 pm
I wanted to understand how to assign names to fonts GraphicSeriesFontSet from CASIO website https://edu.casio.com/education/fontset/dl/GraphicSeriesFontSet.zip in order to use them without installing them, by copying them directly into a folder on the desktop. My .tex document must be located inside the same folder. The goal is to include the fonts in the document without installing them on the system, for my work. In the folder, I have the following fonts available: CFX06.ttf, CFX01.ttf, CFX02.ttf, CFX04.ttf, CFX05.ttf. I am not sure how to use them correctly in both mathematical mode and regular text mode. Note that I have not able to see the font of the package casiofont (https://github.com/amunn/casiofont?tab=readme-ov-file). In fact I noticed this mistake: \documentclass[12pt]{standalone} \usepackage{casiofont} \begin{document} \Abs \end{document} This is LuaHBTeX, Version 1.24.0 (MiKTeX 25.12) restricted system commands enabled. luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "CASIOClassWiz" not found. ! Package fontspec Error: (fontspec) The font "CASIOClassWiz" cannot be found; this may (fontspec) be but usually is not a fontspec bug. Either there (fontspec) is a typo in the font name/file, the font is not (fontspec) installed (correctly), or there is a bug in the (fontspec) underlying font loading engine (XeTeX/luaotfload). For immediate help type H <return>. ... l.32 \DeclareTextFontCommand {\textcasio}{\casio} ? Any screenshots are welcome.
- Make \refcmpd hyperlinks point to the corresponding scheme label instead of the compound number (chemnum + hyperref)by taiwan12 on January 26, 2026 at 8:08 pm
I was reading the manual for chemnum today and noticed the hyperlinks option for the first time, and the following question occured to me. I am using the chemnum package together with hyperref to reference compounds in reaction schemes. Currently, \refcmpd{...} creates hyperlinks to the compound number itself (the number printed by \replacecmpd inside the scheme). I would like the hyperlink target of \refcmpd{...} to be the corresponding scheme label (i.e. the same target as \ref{sch:...}), not the compound number. \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} \usepackage{chemnum} \usepackage{relsize} \usepackage[colorlinks=true]{hyperref} \setchemnum{hyperlinks = true} \ExplSyntaxOn \NewDocumentCommand{\myScheme}{O{0.8} m m m m} { \begin{scheme}[H] \setchemnum{replace-style=\relscale{#1}} \clist_map_inline:nn { #2 } { \replacecmpd{##1} } \includegraphics[scale=#1]{#3.eps} \caption{#4} \label{#5} \end{scheme} } \ExplSyntaxOff \begin{document} \myScheme{PhH, PhMe}{chem1}{Caption I}{sch:first} \myScheme{PhNH2, PhNO2}{chem2}{Caption II}{sch:second} \refcmpd{PhH, PhMe, PhNH2, PhNO2} \ref{sch:first}, \ref{sch:second} \end{document} chem1.eps: https://drive.google.com/file/d/1n63DFoGzxCLhz96sbnJ5L7hFIiWoh2yN/view?usp=sharing chem2.eps: https://drive.google.com/file/d/11WxMJHW9rwjo7ffSE6Cs3Wjlp31Jj8bR/view?usp=sharing Current behavior: \refcmpd{PhH} links to the compound number 1 in the first scheme \refcmpd{PhMe} links to the compound number 2 in the first scheme \refcmpd{PhNH2} links to the compound number 3 in the second scheme ... Desired behavior: \refcmpd{PhH} and \refcmpd{PhMe} to link to the same target as \ref{sch:first} \refcmpd{PhNH2} and \refcmpd{PhNO2} to link to the same target as \ref{sch:second} In other words, I want each \refcmpd{...} to hyperlink to the corresponding scheme label where the compound is introduced, not to the compound number itself. Is there a way to redefine the hyperlink target used by \refcmpd, or to associate compounds with a scheme label so that the hyperlink jumps to \label{sch:first} / \label{sch:second} instead of the compound anchor? Any solution compatible with chemnum + hyperref would be appreciated.
- 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?
- How to define a LaTeX command with multiple \replacecmpd inputs?by palloc on January 26, 2026 at 5:13 pm
I have the following LaTeX code using the chemstyle and chemnum packages: \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} \usepackage{chemnum} \begin{document} \begin{scheme} \replacecmpd{PhH} \replacecmpd{PhMe} \includegraphics[scale=0.8]{chem.eps} \caption{Caption I} \label{sch:first} \end{scheme} % In my real project the chemicals are different \begin{scheme} \replacecmpd{PhNH2} \replacecmpd{PhNO2} \includegraphics[scale=0.8]{chem.eps} \caption{Caption II} \label{sch:second} \end{scheme} \end{document} I would like to define a new command, for example \schCall, that wraps this structure into a single macro. Desired syntax example: \schCall[0.6]{chem}{PhH, PhMe}{Caption I}{first} Where: the optional argument is the scale (default = 0.8) the first mandatory argument is the image filename (without .eps) the second mandatory argument is a comma-separated list of arguments for \replacecmpd the third argument is the caption text the fourth argument is used for the label
- ConTeXt: insert in the list abbreviations the first page at which an abbreviation is mentionedby Georgian Ilie on January 26, 2026 at 2:16 pm
Good afternoon, I am trying to print my list of abbreviations. At the right side of the abbreaviation I would like to place the first page wherein said abbreviation is mentioned. I tried the code reported below without success: \definesynonyms[abbreviation][abbreviations][\infull] \abbreviation{SCE}{Special carbon electrode} \abbreviation{BFF}{Best friends forever} \setupsynonyms[abbreviation][ pages=yes, referencemethod=first] \starttext \subject[title=Hello] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{SCE} \blank[small] \par Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{BFF} \page \subject[title=Hello1] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{SCE} \blank[small] \starttitle[title=list of abbreviations] \placelistofabbreviations[criterium=all] \stoptitle \stoptext How can I solve this issue? Thank you in advance for your time and help. EDIT I I tried to rewrite partly the code by the advises received so far: \definesynonyms[acro][acros][\myfull] \acro{SCE}{Special carbon electrode} \acro{BFF}{Best friends forever} \setupsynonyms[acro][pages=yes,style=bf] \starttext \subject[title=Hello] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {SCE}. \blank[small] \par Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {BFF} \page \subject[title=Hello1] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {SCE}. \blank[small] \starttitle[title=list of abbreviations] \placelistofacros[criterium=all] \stoptitle \stoptext And I still face issues (now the abbreviations are not displayed when invoked with \myfull.
- Simplifying an Asymptote figure for spherical coordinatesby Sebastiano on January 26, 2026 at 12:58 pm
I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:
- How do I get a stable \noteta?by Frode Alfson Bjørdal on January 26, 2026 at 1:32 am
In some theories on predication \eta is used instead of set theoretical \in. How do I get a useful symbol for \noteta which is to \eta as \notin is to \in? The solutions should be compilable both with pdfLaTeX and LuaLaTeX. \documentclass{article} \begin{document} $\not\eta$ \end{document}
- Merging listoffigures and listofschemes into oneby palloc on January 25, 2026 at 9:38 pm
I am working with the following code: \documentclass{report} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage{chemstyle} \usepackage[colorlinks]{hyperref} \counterwithout{figure}{chapter} \counterwithout{scheme}{chapter} \begin{document} \tableofcontents \chapter{A} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig I} \label{figA} \end{figure} \begin{scheme} \centering \includegraphics[width=0.5\linewidth]{...} \caption{Sch I} \label{schA} \end{scheme} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Fig II} \label{figB} \end{figure} \ref{figA}, \ref{schA}, \ref{figB} \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Figures} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{List of Scheme} \listofschemes \end{document} What I want is the following: Merge the List of Figures and the List of Schemes into a single List of Figures. In that case, a Scheme should be numbered as a Figure (e.g., “Scheme 1” → “Figure 2”). The output of \ref{schA} should be “Figure 2”.
- Different column alignment of first-rowby Werner on January 25, 2026 at 5:19 pm
I like my matrix indices to be center-aligned while numbers within the matrix should be right-aligned for better visual clarity of scale. However, none of my attempts to achieve both have been successful. In the example below, the first option is closest, but fails to align the lost column index. \documentclass{article} \usepackage{nicematrix,xcolor} \newcommand{\mc}{\multicolumn{1}{c}} \begin{document} Manual formatting without \texttt{first-row} - last column index not centered: \[ \begin{NiceArray}{ *{6}{r} } \mc{\color{red}\scriptstyle 0} & \mc{\color{red}\scriptstyle 1} & \mc{\color{red}\scriptstyle 2} & \mc{\color{red}\scriptstyle 3} & \mc{\color{red}\scriptstyle 4} & \mc{\color{red}\scriptstyle 5} \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{\string\RowStyle} - no centering of indices: \[ \begin{NiceArray}{ *{6}{r} } \RowStyle[nb-rows=1]{\color{red}\scriptstyle} 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{first-row} - no centering of indices: \[ \begin{NiceArray}{ *{6}{ r } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] Using \texttt{first-row} with \texttt{c}entered columns - no right-aligned matrix elements: \[ \begin{NiceArray}{ *{6}{ c } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] \end{document} How can I achieve a different alignment for the first row (indices) compared to the rest of the matrix?