• LaTeX forest: Reorder leaves
    by edgelord on March 4, 2026 at 2:52 pm

    I'm using the LaTeX package forest to render "surface grammar trees" of sentences. Using the particular grammar I'm using (Eisenberg), you can get trees where the leaves are not in natural order. E. g. the sentence "Ich suche verzweifelt einen Stift" ("I search desperately a pen") would have the adverb "verzweifelt" ("desperately") attached to the rest of the sentence at the very last layer and the syntactical analysis tree would look something like this: How is this possible in forest without having to put the adverb to the end of the sentence (which wouldn't make sense). This would produce the correct tree structure but with the wrong word order. How can I specifically move the "verzweifelt" node to the third word position without changing the tree structure? \documentclass{article} \usepackage{forest} \usetikzlibrary{calc} \usepackage[T1]{fontenc} \begin{document} \begin{forest} for tree={ grow=south, parent anchor=south, child anchor=north, align=center, l sep=15pt, s sep=10pt, edge path={ \noexpand\path [draw] (!u.south) -- +(0,-5pt) -| (.north)\forestoption{edge label}; }, } [$S_2$ [S [Ich, tier=word] [suche, tier=word] [PrGr [einen, tier=word] [Stift, tier=word] ] ] [verzweifelt, tier=word] ] \end{forest} \end{document}

  • Luatex - Coloring Haraka
    by Mario Fischer on March 4, 2026 at 6:08 am

    I want to colour the harakat (diacritics) of a text in Pashto. I use Luatex, and I want to switch this function on and off. It should look like I tried this code: \documentclass{article} \usepackage{fontspec} \usepackage{xcolor} \usepackage{luacolor} \usepackage[bidi=basic]{babel} % Setup Arabic language \babelprovide[import, main]{arabic} % THE FIX: Use Renderer=Node instead of Harfbuzz \babelfont{rm}[Renderer=Node]{Amiri} % 1. The Lua Script \directlua{ harakat_attr_val = nil local luacolor_attr = luatexbase.attributes['luacolor'] local function color_harakat(head) if not harakat_attr_val then return head end for item in node.traverse_id(node.id("glyph"), head) do local char = item.char -- Unicode range for Arabic harakat (0x064B to 0x065F) -- and the superscript Alef (0x0670) if (char >= 0x064B and char <= 0x065F) or char == 0x0670 then node.set_attribute(item, luacolor_attr, harakat_attr_val) end end return head end % Add the filter so it runs before the font shaper luatexbase.add_to_callback("pre_linebreak_filter", color_harakat, "color_harakat") } % 2. Custom command to safely set the Harakat color \makeatletter \newcommand{\setHarakatColor}[1]{% \begingroup \color{#1}% \directlua{ harakat_attr_val = tex.attribute[luatexbase.attributes['luacolor']] }% \endgroup } \makeatother \begin{document} \begin{center} \Huge % Tell LuaTeX to color all following harakat Red \setHarakatColor{red} بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ \vspace{1cm} % Switch to blue! \setHarakatColor{blue} بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ \end{center} \end{document} But it is not coloring. What might be the problem, or is there an easy option in Luatex?

  • TikZ: How to add a node where a path gets clipped
    by Edoardo Serra on March 3, 2026 at 3:07 pm

    I am designing a square (or “squarish” actually) map protractor in TikZ. So far, I have managed to draw the degree ticks along the four sides by clipping radial lines between two closed paths using the even odd rule like I saw in this answer. The ticks are generated in a \foreach loop. To avoid drawing long ticks on top of short ones, I separated them into two loops using a conditional test. I am not sure whether this separation is actually necessary for correct SVG export/printing, but that is how I implemented it. Below is a MWE: \documentclass[tikz]{standalone} %,convert={outfile=\main.svg} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{intersections, pgfplots.fillbetween} \pgfdeclarelayer{pre main} \pgfdeclarelayer{main} \pgfsetlayers{pre main, main} \usetikzlibrary{shapes} \begin{document} %all of this is needed to easily clip between two closed paths using even odd rule \makeatletter \def\@appendnamedsoftpath#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@temppatha\expandafter\expandafter\expandafter{\expandafter\@temppatha\@temppathb}% \pgfsyssoftpath@setcurrentpath\@temppatha } \def\@appendnamedpathforactions#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\def\expandafter\@temppatha\expandafter{\csname @temppatha\expandafter\endcsname\@temppathb}% \let\tikz@actions@path\@temppatha } \tikzset{ use path for main/.code={% \tikz@addmode{% \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname }% }, append path for main/.code={% \tikz@addmode{% \@appendnamedsoftpath{#1}% }% }, use path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}% }, append path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions \@appendnamedpathforactions{#1}}% }, use path/.style={% use path for main=#1, use path for actions=#1, }, append path/.style={% append path for main=#1, append path for actions=#1 } } \makeatother \begin{tikzpicture} \pgfmathsetmacro\bigside{7} \pgfmathsetmacro\smallsidedelta{0.5} %cuts \draw[rounded corners=12pt, name path=outside] (0,0) rectangle (\bigside,\bigside); \draw[dotted, rounded corners=12pt, name path=inside] (\smallsidedelta,\smallsidedelta) rectangle (\bigside-\smallsidedelta,\bigside-\smallsidedelta); %remove before cutting or printign. Just as reference grid %backside print \tikzfillbetween[of=inside and outside] {white}; %print on transparent plastic so this is needed for better readability %frontside print \pgfmathsetmacro\degreesmallticksize{0.2} \pgfmathsetmacro\degreemidticksize{0.35} \pgfmathsetmacro\outerradius{sqrt(2*\bigside/2*\bigside/2)} \path[rounded corners=12pt, name path=degrees short] (\degreesmallticksize,\degreesmallticksize) rectangle (\bigside-\degreesmallticksize,\bigside-\degreesmallticksize); \path[rounded corners=12pt, name path=degrees mid] (\degreemidticksize,\degreemidticksize) rectangle (\bigside-\degreemidticksize,\bigside-\degreemidticksize); \begin{scope} [even odd rule] %small ticks \clip[use path=outside, append path=degrees short]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=0 \draw[thin] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} %had to add a second scope and for loop since the clipped area is different \begin{scope} [even odd rule] %mid ticks \clip[use path=outside, append path=degrees mid]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=1 \draw[thick] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} \end{tikzpicture} \end{document} And the output is the following: I would now like to add a label at the inner end of each thick (5°) tick, displaying the corresponding degree value (0–355), like this: Now a few nuances: The numbers must always face towards the inside, with the exception, if possible, of the bottom row of numbers from 135° to 225°. When numbers get big, they don't have enough space to fit unless the labels become too small to read (actual printing size of the protractor will be something like 7x7 or 8x8cm). So they need to be shifted in such a way that they fit. 355 in the provided image is a clear example of what I mean. I can consider shifting them radially as well, but they need to stay to the outside of the dotted line, which I can make a little smaller. I really don't know where to start and didn't manage to find anything online. Thank you for your time!

  • How to label axes, points, and curves in a 3D plot using luadraw?
    by Octavius on March 3, 2026 at 2:00 pm

    The question arised from the previous link and the luadraw solution. I am using luadraw to visualize the surface z = x^2 + y^2 together with the intersection curve corresponding to the direction u = (1,0). I would like to know whether it is possible to: Label the coordinate axes $x$, $y$, and $z$, Label the point $c = (0,0)$, Indicate the direction $u = (1,0)$, And label the function $F(t) = t^2$ corresponding to the intersection curve. When I try to use Dtext3d, the document compiles but the output appears blank in Overleaf. Is there a reliable way to add these labels when using luadraw? \documentclass[border=5pt]{standalone} \usepackage[svgnames]{xcolor} \usepackage[3d]{luadraw} \usepackage{fourier-otf} \usepackage{tikz} \begin{document} \begin{luadraw}{name=paraboloid} local g = graph3d:new{ window3d = {-2,2,-2,2,0,8}, window = {-4.5,4,-3,9.5}, size = {10,10,0}, viewdir = perspective("central",30,50,20) } -- Surface local S = cartesian3d(function(x,y) return x^2+y^2 end, 2,-2,-2,2) -- Direction local c = Origin local u = M(1,0,0) local N = pt3d.prod(u, vecK) -- Intersection curve local Curve = g:Intersection3d(S, {c,N}) -- Draw surface g:Dfacet(S, {usepalette={palGasFlame,"z"}, edgecolor="gray", clip=true}) -- Draw curve g:Dedges(Curve, {hidden=true, color="Navy", width=12}) -- Axes g:Dline3d({Origin, M(2,0,0)}, {color="black", width=1, dash="dotted"}) g:Dline3d({Origin, M(0,2,0)}, {color="black", width=1, dash="dotted"}) g:Dline3d({Origin, M(0,0,6)}, {color="black", width=1, dash="dotted"}) g:Show() \end{luadraw} % ---- 2D overlay labels (safe in Overleaf) ---- \begin{tikzpicture}[overlay] \node at (3.7,4.2) {$x$}; \node at (1.1,4.8) {$y$}; \node at (2.5,7.3) {$z$}; \end{tikzpicture} \end{document}

  • Why is it necessary to keep first line of input in 'buffer' array?
    by Igor Liferenko on March 3, 2026 at 6:24 am

    In §331 of tex.web we have this: first:=1; ... if not init_terminal then goto final_end; first:=last+1; {|init_terminal| has set |loc| and |last|} So, before input_ln, which is called by init_terminal, we have: loc is 0, first is 1, last is 0. Let's type x<return> in response to **. Then after init_terminal we will have: loc is 1, first is 1, last is 2. And then (due to above snippet) first will be 3. This means that first line of input is permanently kept in buffer array throughout the entire TeX job. And so the length of the first line will restrict the length of line that TeX can read. In particular, one and the same file will compile cleanly if file name is relative, and will fail to compile if file name is absolute. Why first line of input is kept in buffer array?

  • The sizes of \because and \therefore in exam-zh
    by M. Logic on March 3, 2026 at 1:34 am

    A MWS is as follows. \documentclass{exam-zh} \makeatletter \DeclareSymbolFont{AMSa}{U}{msa}{m}{n} %\DeclareSymbolFont{AMSb}{U}{msb}{m}{n} \DeclareMathSymbol{\therefore}{\mathrel}{AMSa}{"29} \DeclareMathSymbol{\because}{\mathrel}{AMSa}{"2A} \makeatother \begin{document} $\because ABCD=\therefore ABCD$ \end{document} As you see, the sizes of \because and \therefore in exam-zh are very small although I invoke them from amssymb. How to fix this to make the sizes of them be normal when invoking them from amssymb?

  • tabularray - make talltblr caption mirror other captions
    by user20478285 on March 3, 2026 at 12:13 am

    \documentclass{article} \usepackage[font=small, labelfont=bf, format=hang]{caption} \usepackage{tabularray} \usepackage{tblr-extras} \UseTblrLibrary{amsmath, booktabs, caption} \begin{document} \begin{table}[h] \centering \begin{talltblr}[caption={A talltblr table.}]{colspec={cc}} \toprule a & b\\ \midrule x & y\\ \bottomrule \end{talltblr} \end{table} \end{document} Using the code above, I get the following result for my talltblr (i.e. the caption width is limited to the table width). I tried the approach from here: \documentclass{article} \usepackage[font=small, labelfont=bf, format=hang]{caption} \usepackage{tabularray} \usepackage{tblr-extras} \UseTblrLibrary{amsmath, booktabs, caption} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DefTblrTemplate{firsthead}{caption}{% \makebox[\tablewidth]{\parbox{\columnwidth}{% \UseTblrTemplate{caption}{normal}% }}% } \SetTblrTemplate{firsthead}{caption} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \begin{table}[h] \centering \caption{A regular table. A regular table. A regular table. A regular table. A regular table. A regular table. A regular table. A regular table. A regular table.} \begin{tabular}{cc} \toprule a & b\\ \midrule x & y\\ \bottomrule \end{tabular} \end{table} \begin{table}[h] \centering \caption{A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table. A tblr table.} \begin{tblr} { colspec={cc} } \toprule a & b\\ \midrule x & y\\ \bottomrule \end{tblr} \end{table} \begin{table}[h] \centering \begin{talltblr} [ caption={A talltblr table. A talltblr table. A talltblr table. A talltblr table. A talltblr table. A talltblr table. A talltblr table. A talltblr table.} ] { colspec={cc} } \toprule a & b\\ \midrule x & y\\ \bottomrule \end{talltblr} \end{table} \end{document} Now the caption has the right width, but it is too close to the table itself. Also, the caption font is too big and the label is not bold, which I can fix / hack if I add \SetTblrStyle{caption-tag}{font=\small\bfseries} \SetTblrStyle{caption-text}{font=\small} but I'm not sure if this is the way to go (and it does not fix the issue of the caption touching the table). I also tried to have a look at the default caption definitions myself in the source code but I just don't understand even remotely enough of LaTeX3). Edit for clarity: I don't need to be able to control table, talltblr, and tblr with \captionsetup, I am rather looking for a way to get the same consistent captions for figure, table, tblr and talltblr environments in my document. I realise this is not easy, especially since the different caption style for talltblr is apparently a feature: I don't think it is a bug. In many aspects, tabularray is different from traditional tables https://github.com/TeXackers/tabularray/issues/255#issuecomment-1142833319)

  • Improving the visibility of a curve in a 3D PGFPlots surface
    by Octavius on March 2, 2026 at 4:50 pm

    In the left-hand figure, I would like to improve the visualization so that the red curve is more clearly visible. \documentclass[12pt,b5paper,twoside,openany]{book} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath,amssymb,amsfonts,amsthm} \usepackage{graphicx} \usepackage{xcolor} \usepackage{tikz} \usepackage{tikz-3dplot} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \hypersetup{colorlinks=true,linkcolor=black,citecolor=black} \newtheorem{example}{Example} \setlength{\parindent}{0pt} \begin{document} \begin{example} Consider the function \[ f(x,y)=x^2+y^2, \] the point \[ c=(0,0), \] and the direction \[ u=(1,0). \] To study the variation of $f$ at $c$ in the direction $u$, we define the one-variable function \[ F(t)=f(c+tu). \] In this case, \[ c+tu=(t,0), \] and therefore \[ F(t)=f(t,0)=t^2. \] Thus, when we move away from $c$ in the direction $u$, the values of $f$ vary according to the quadratic function $F(t)=t^2$. The directional derivative of $f$ at $c$ in the direction $u$ is given by \[ f'(c;u)=F'(0). \] Since \[ F'(t)=2t, \] we obtain \[ f'(c;u)=F'(0)=0. \] \end{example} \bigskip \begin{center} \begin{tikzpicture} % --- SURFACE --- \begin{axis}[ at={(0,0)}, anchor=origin, view={120}{25}, axis lines=center, axis line style={->}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, domain=-2:2, y domain=-2:2, samples=30, samples y=30, width=8cm, height=8cm ] % Surface z = x^2 + y^2 \addplot3[surf, opacity=0.4] {x^2+y^2}; % Curve corresponding to F(t) \addplot3[very thick, red, domain=0:1.2, samples=100] ({x},{0},{x^2}); \end{axis} % --- GRAPH OF F(t) --- \begin{axis}[ at={(7cm,0)}, anchor=origin, axis lines=middle, axis line style={->}, xlabel={$t$}, ylabel={$F(t)$}, domain=-1.5:1.5, samples=200, width=7cm, height=6cm ] \addplot[very thick, red] {x^2}; \node at (axis cs:1,1) [red, anchor=west] {$F(t)=t^2$}; \end{axis} \end{tikzpicture} \end{center} \end{document}

  • Disable stretching between words while using babel for Thai
    by p_pattedd on March 2, 2026 at 8:04 am

    When typing a document in Thai with babel (using XeLaTeX via MikTeX), sometimes it outputs with these spaces between words, for example: MWE: \documentclass[12pt,a4paper]{article} \usepackage[no-math]{fontspec} \usepackage[thai,provide=*]{babel} \babelfont[thai]{rm}[Scale=1.33333]{TH Sarabun New} \renewcommand\baselinestretch{1.4} \begin{document} เดิมแผ่นดินเมืองจีนทั้งปวงนั้น เปนสุขมาช้านานแล้วก็เปนศึก ครั้นศึกสงบแล้วก็เปนสุข มีพระมหากษัตริย์ทรงพระนามพระเจ้าจิวบูอ๋อง แลพระวงศ์ได้เสวยราชย์ต่อ ๆ ลงมาเปนหลายพระองค์ ได้ความสุขมาถึงเจ็ดร้อยปี จึงมีผู้ตั้งแขงเมืองถึงเจ็ดหัวเมือง ครั้งนั้นพระเจ้าจิ๋นอ๋องได้เสวยราชย์ในเมืองจิ๋นก๊กให้ไปตีเอาหัวเมืองทั้งเจ็ดนั้น เข้าอยู่ในอาณาจักรพระเจ้าจิ๋นอ๋องทั้งสิ้น ครั้นอยู่มาพระเจ้าจิ๋นอ๋องเสียแก่ฮั่นฌ้อ แล้วฮั่นโกโจกับฮั่นฌ้อรบกัน จึงได้ราชสมบัติแก่ฮั่นโกโจ ฮั่นโกโจแลพระราชวงศ์ได้เสวยราชสมบัติต่อ ๆ มาในแผ่นดินจีนนั้นถึงสิบสององค์ มีขุนนางคนหนึ่งชื่ออองมังเปนขบถชิงเอาราชสมบัติได้ เปนเจ้าแผ่นดินอยู่สิบแปดปี แล้วจึงมีหลานพระเจ้าฮั่นโกโจชื่อฮั่นกองบู๊จับอองมังฆ่าเสียชิงเอาราชสมบัติได้เสวยราชย์สืบวงศ์มาสิบสององค์ พระองค์ได้เสวยราชย์ที่สุดนั้น ทรงพระนามพระเจ้าเหี้ยนเต้ จึงแตกเปนสามเมือง ภาษาจีนเรียกว่า สามก๊ก \end{document} How to stop LaTeX from doing this? (I have read babel-thai documentation, but none of the macros seems to work.)

  • Redesign of arrow at circuitikz ccgsw symbol
    by Zarko on March 2, 2026 at 7:20 am

    In circuitikz symbol ccgsw I like to change the color of arrow (by simple in-line selection, if is possible) and arrow head for example from stealth to Straight Barb. How to do this? \documentclass[margin=3mm]{standalone} \usepackage{xcolor} \usepackage{circuitikz} \begin{document} \begin{circuitikz} \draw[gray] (0,0) to [ccgsw={$t=t_b$}] (2,0) ; \end{circuitikz} \end{document}

  • BibLaTeX specified language is not used
    by Knudsen on March 2, 2026 at 6:40 am

    Why would biblatex fill out this entry with Cyrillic while the language being specified is Serbian written in Latin? \documentclass{article} \begin{filecontents*}{test.bib} @book{Mitri-vol1-sr, title={Cauchyjev račun ostataka sa primenama}, author = {Mitrinović, Dragoslav S. and Kečkić, Jovan D.}, series = {Matematički problemi i ekspozicije}, volume = {8}, year = {1978}, publisher = {Naučna Knjiga}, address = {Beograd}, pages = {271}, langid = {serbian}, } \end{filecontents*} \usepackage{fontspec} \newfontfamily\cyrillicfont{STIX Two Text} \usepackage{polyglossia} \usepackage{csquotes} \setmainlanguage{english} \setotherlanguage{serbian} \usepackage[style=authoryear, backend=biber, autolang=other, ]{biblatex} \addbibresource{test.bib} \begin{document} \nocite{*} \printbibliography \end{document}

  • tiered list with a heading with tree-like |- line connectors that enumerate items
    by Mampac on March 1, 2026 at 4:08 pm

    how do i get a list that has a heading (in this example, "Deep Learning Methods" as the heading), from which level-2 entries are connected with solid lines? so far i draw the connector lines with tikz like this: which looks fine except for the extra-bolded trunk of the tree due to multiple retracing of the same connector path in my current implementation. it is super-subtle, but when you zoom out of the PDF file, you can see marginal pixel strips lacking at the upper part of the tree trunk where it's thinner than the rest. the MRE is as follows: \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,calc} \tikzset{ taxonomy/.style={ overlay, remember picture } } \newcommand{\subcatindent}{1.3em} \newcommand{\methodsindent}{2.3em} \begin{document} unrelated text\\ \textbf{\tikzmarknode{dl}{\underline{Deep Learning Methods}}}\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_convo}{Convolution}}\\ \hspace*{\methodsindent}AE-based\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ae}{Autoencoders}}\\ \hspace*{\methodsindent}Method D2\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_gan}{GANs}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_diff}{Diffusion}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_att}{Attention-Driven}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ens}{Ensemble}}\\ \hspace*{\methodsindent}Method D3 \begin{tikzpicture}[taxonomy] \newcommand{\srcOffsetX}{+0.3em} \newcommand{\srcOffsetY}{-1.0ex} \coordinate (dl_start) at ($(dl.south west)+(\srcOffsetX,\srcOffsetY + 0.3ex)$); \coordinate (dl_lowest) at (dl_ens.west); \coordinate (dl_trunk) at ($(dl_start |- dl_lowest)$); \draw (dl_start) -- (dl_trunk); \draw (dl_trunk) |- (dl_convo.west); \draw (dl_trunk) |- (dl_ae.west); \draw (dl_trunk) |- (dl_gan.west); \draw (dl_trunk) |- (dl_diff.west); \draw (dl_trunk) |- (dl_att.west); \draw (dl_trunk) |- (dl_ens.west); \end{tikzpicture} \end{document} is there a way to dynamically and systematically implement this so that the connectors are drawn exactly at the place where the previous one turned 90 degrees to the right? ideally, i could turn this in a custom list environment, but so far i don't see a clear way of solving the retracing problem.

  • How to change "python" language style of listings package
    by Syvshc on March 1, 2026 at 3:28 pm

    I want to define my own style of Python, so I write \documentclass{article} \usepackage{listings, xcolor} \lstset { basicstyle = \ttfamily\small, frame = leftline, framerule = 1pt, } \lstdefinelanguage{python}{ morekeywords = {python, red}, keywordstyle = {\bfseries\color{red}}, rulecolor = {\color{red}}, } \begin{document} \begin{lstlisting}[language=python] python, red \end{lstlisting} \end{document}% after compiling with texlive 2025, I got: It did not work. I thought it might be the problem with the default settings of listings.sty package, i.e. lstlang1.sty. However, I can change the style of matlab language: \documentclass{article} \usepackage{listings, xcolor} \lstset { basicstyle = \ttfamily\small, frame = leftline, framerule = 1pt, } \lstdefinelanguage{python}{ morekeywords = {python, red}, keywordstyle = {\bfseries\color{red}}, rulecolor = {\color{red}}, } \lstdefinelanguage{Matlab}{ morekeywords = {Matlab, lime}, keywordstyle = {\bfseries\color{lime}}, rulecolor = {\color{red}}, } \begin{document} \begin{lstlisting}[language=python] python, red \end{lstlisting} \begin{lstlisting}[language=Matlab] Matlab, lime \end{lstlisting} \end{document}% The output is: I wonder why it happened and how I can actually change the style of "python" language. EDIT: I found that this does not work only on TexLive 2025; my version of listings is 76899, and it's cat-version is 1.11b. If I compile this file with 1.10a and TexLive 2024 on Overleaf, all things worked well. EDIT: I found that listings package is insensitive to the language name, Python, python, and PYTHon point to the same language

  • Automatic italic for foreign words
    by Apothikon on March 1, 2026 at 2:06 pm

    Foreign words or phrases inside a mostly monolingual document should usually be displayed in italic. How can this be achieved automatically using babel? I have produced the following code: \documentclass{article} \usepackage{lipsum} \usepackage[french, british, italian]{babel} % Font for the main language \babelfont{rm}{ebgaramond} % Font for foreign languages, inverting roman and italic \babelfont [french, british]{rm}{ebgaramond-Italic} \begin{document} MAIN LANGUAGE \lipsum[1] \vspace{1em} FOREIGN LANGUAGE \foreignlanguage{british}{\lipsum[1]} \end{document} However, I can see some problems in my approach: If I define new features for the font (ligatures, character variants...) I must repeat them for both the main and the foreign font; If I add new languages I must remember to add them to the list of foreign languages to which the italic must be applied. I am quite sure that the amazing babeltransform can easily make it more automatic.

  • Italic text with upright uppercases
    by Apothikon on March 1, 2026 at 1:45 pm

    Can someone suggest a method to have Roman (upright) capitals in italic texts, in the style of Aldus Manutius and of the early Renaissance books? I believe it could probably be done with the lua.otf.font.handler but I don't know where to start. Also, I think at least two aspects need to be kept in mind: Efficiency: the approach should not be too heavy, in order to be usable also for large documents with many paragraphs in italics; Kerning: it will probably be required to define new kerning pairs for many (or every) capital, and I expect this to be done manually depending on the font used in the document. As an example to test this: \documentclass{article} \usepackage{lipsum} \usepackage{ETbb} % A font in the style of Aldus Manutius \begin{document} A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \vspace{1em} \textit{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \vspace{1em} \lipsum[1] \vspace{1em} \textit{\lipsum[1]} \end{document} Every suggestion, even if not a complete answer, is very appreciated.

  • Reset counter in \newtheorem
    by Afonso Guerra on March 1, 2026 at 10:52 am

    I'm trying to make a title with \newtheorem{case}{Caso} (My code is in Portuguese-Portugal) and it outputs Caso X. "X" being the next number. So here is the thing, I actually need to reset the "X" value, and I have tried the [theorem] parameter, but it doesn't work for me so can anyone help? Here is my code: \documentclass[12pt]{report} \usepackage[]{amsmath,amsthm,amssymb,amscd} \usepackage[a4paper,margin=25mm]{geometry} \usepackage{babel} \usepackage{pgfplots} \usepackage{multirow} \usepackage{booktabs} \usepackage{framed} \newtheorem{case}{Caso} \begin{document} \begin{case} Não conhecemos a distribuição de $X_1$ ou $X_2$, mas os tamanhos das amostras não apresentão assimetrias exageradas. \end{case} \begin{case} % Some text here % \end{case} % Reset the X value % \begin{case} % More text here, but with it saying "Caso 1." % \end{case} \end{document} If you want something else please tell me.

  • How to produce an effect of bracket below with text?
    by Sunshine on March 1, 2026 at 5:29 am

    I want to produce the bracket like this: \documentclass{article} \begin{document} There is a bracket below with text. \end{document}

  • How to fit these items on three separate lines
    by Ricky W. on March 1, 2026 at 3:11 am

    I am trying to make this bullet points look nice in three lines but here is the problem. it won't fit. Here is my code \documentclass{beamer} \setbeamertemplate{theorems}[numbered] \begin{frame} \frametitle{Definitions} \begin{definition}[Normed Linear Space] A linear space $\mathbb{X}$ is a normed linear space if, to each vector $x\in \mathbb{X}$, there is a real-valued norm $\left\|x\right\|$ that satisfies \begin{itemize}[$\bullet$] \item $\left\|x\right\| \geq 0$ for all $x\in \mathbb{X}$, with $\left\|x\right\|=0$ if and only if $x=0$ \item $\left\|x+y\right\| \leq \left\|x\right\| + \left\|y\right\| $ for all $x,y\in \mathbb{X}$ \item $\left\|ax\right\|=|a|\left\|x\right\|$ for all $a\in \mathbb{R}$ and $x\in \mathbb{X}$ \end{itemize} Here is what I got

  • organize images in a table with description
    by Matteo on February 28, 2026 at 6:34 pm

    I'm working on a frame where I progressively show four different images using two different datasets and across two different conditions. Hence, I was thinking to use a 2×2 table to do so. However, I'm facing some issues with the leftmost part of the table I'm working on; specifically, the dataset row should be separated by a vertical line from the below: samples and genomes which also should be rotated and vertically centered in the cell. It also appears the spacing and alignment is akward between dataset and rows below as well as between thier cells content... MWE \documentclass[xcolor=svgnames,aspectratio=149]{beamer} \usepackage[T1]{fontenc} \usetheme{Singapore} \usecolortheme{dolphin} \usepackage{multirow} \usepackage{tikz} \usepackage{tikzducks} \usepackage[table]{xcolor} \begin{document} \begin{frame} \centering \begin{tabular}{@{} cc cc @{}} & \multicolumn{2}{c@{}}{\textbf{approach}} \\ \cline{2-3} & raw \texttt{d-values} & \texttt{KL} corrcted \\ \multirow{2}{*}{\rotatebox[origin=c]{90}{\textbf{dataset}}} \rotatebox{90}{genomes} & \includegraphics<1->[width=1.25in,keepaspectratio]{example-image-a} & \visible<2->{\begin{tikzpicture} \duck[recedinghair=white,beard,book] \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700] \only<2->{\cellcolor{Gainsboro}} \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3); \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4); \draw[white] (0,0) rectangle (5,5); \end{scope} \end{tikzpicture}} \\ \rotatebox{90}{samples} & \visible<3->{\begin{tikzpicture} \duck[recedinghair=white,beard,book] \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700] \only<3->{\cellcolor{Gainsboro}} \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3); \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4); \draw[white] (0,0) rectangle (5,5); \end{scope} \end{tikzpicture}} & \includegraphics<4>[width=1.25in,keepaspectratio]{example-image-a} \end{tabular} \end{frame} \end{document} Final slide output Intended result

  • longtable: gap below first subtable
    by cis on February 28, 2026 at 1:21 pm

    The following longtable always starts at the top of the text-body. I've noticed that the very first subtable in the following longtable has one less row than the other (page-height) subtables - even though the content is almost identical. In individual cases, this can be fixed by adding \hrule height0pt\vskip-22pt before the table - determined by eye. However, this generally doesn't help if the fontsize or page geometry (height) is changed. The question is: How can this be professionally fixed? That is, all subtables (except the last one) should have the same distance from the bottom of the text-body (perhaps this distance is zero), regardless of page height or font size. \documentclass[a5paper]{article} \usepackage[margin=12mm, %paperheight=150mm,% optional 1/3 showframe=true, ]{geometry} \usepackage{pgffor} \usepackage{longtable} \def\OutFilename{\jobname-tabledata.tex} \newwrite\MyFile \immediate\openout\MyFile=\OutFilename \def\Rows{140} \foreach \n in {1,...,\Rows}{%% \ifnum\n=\Rows % \immediate\write\MyFile{\n & 0.1 & 0.2 & 0.3}% \else% \immediate\write\MyFile{\n & 0.1 & 0.2 & 0.3 \\}% \fi% }%% \immediate\closeout\MyFile \begin{document} %\footnotesize% optional 2/3 %\Large% optional 3/3 \begin{longtable}{| c c c c | } %% Very first Header ======================== \hline n & p1 & p2 & p3 \\ \hline \endfirsthead %% Header for subsequent pages ================ \hline n & p1 & p2 & p3 \\ \hline \endhead% %% Footer for all pages except last ================ \hline n & q1 & q2 & q3 \\ \hline \endfoot %% Footer for the very last page ================ \hline n & q1 & q2 & q3 \\ \hline \endlastfoot \input{\OutFilename} \end{longtable} \end{document}

  • How do I use Tikz to create new text characters with serifs?
    by ItsErtHere on February 27, 2026 at 8:59 pm

    I would like to create "half letters" that attach to the left side of letters in a math formula. This would not only allow for the Latin AE character, but also characters like AD, OP, TB, and so on. When using regular Tikz lines, the attachment to the left side of the main letter does not appear to have the same font as the right side. For example, I will merge A and P together: \begin{tikzpicture} \draw[x=1pt,y=1pt,xshift=1.2] (5.3,3.6) node[node font=\itshape] {P}; \draw[x=1pt,y=1pt] (0.3,0) -- (6,7); \draw[x=1pt,y=1pt] (3.1,3.5) -- (6.3,3.5); \draw[x=1pt,y=1pt] (0,0.25) -- (1,0.25); \end{tikzpicture} The result (on Overleaf): The AP merged letter, possibly useful to represent pressure in physics when P is already used for power. We see, when attaching the half-A with the P, the font does not match, and the "serif" that I attached does not match the font. How do I add a serif to the end of the diagonal line on the left half of the character that makes the attachment look like a part of the character? Preferably, I'd like a custom line style to lessen the amount of commands I have to do for each half-letter or a specific command to create a serif to be in line with the math font? Or, in this case, is it easier to just create a font? (I'm doing this for all uppercase Latin and lowercase Greek letters for completeness, so that could become quite tedious). I may also have to consider variable line thickness on the left half of the letters too, as seen on the right-side P. In summary, here are the criteria I'm considering in this project: The general shape of a serif when attached to a line at any angle (strait P versus a diagonal V). The variation of width in some lines, such as the curves on B, D and P. Intersections of lines. Advantages and disadvantages of creating a custom font (.sty), creating a serif shape in Tikz, or creating a custom line style for Tikz. This helps decide what the best option is for this project. The application I'm hoping this is useful for is to allow more characters in formulas for math, physics, and other sciences whose design could hint at what the characters mean. For example, in physics, consider the notation for volume and voltage (both are represented by V). If both volume and voltage are in one calculation, what other symbols can we use to represent either one in order to avoid confusion that still show what those symbols represent? In this case, voltage can be VT, and volume can be VU. (The choice is up to the writer, this is just an example). I plan to write a paper over this topic once I get the attachments created. While this is meant for use in physics, I see this having applications in other areas of science and mathematics as well. Thus, which option would be the best for this project, and how do I get started with it? The TIKZ site is helpful, but I did not find anything that looked immediately useful specifically for creation of Serif fonts. Any help would be appreciated!

  • How can I calculate or approximate the intersection(s) or lack thereof of a line and an exponential curve using Lua?
    by Jasper on February 27, 2026 at 5:58 pm

    How can I calculate or approximate the intersection(s) or lack thereof of a line and an exponential curve. My goal is to avoid using an approach which first tessellates curves into line segments, and tests each line segment pair. That is O(n^2). I want something which can scale. I think Lua is appropriate for this, based on evidence in the comments. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[->] (-2,0) -- (2,0); \draw[->] (0,-2) -- (0,e^2); \draw[domain=-2:2] plot (\x,e^\x); \draw[domain=-2:2] plot (\x,\x+1.5); % two intersections \draw[domain=-2:2] plot (\x,\x+1); % one intersection \draw[domain=-2:2] plot (\x,-\x+4.5); % one intersection \draw[domain=-2:2] plot (\x,\x); % zero intersections % My goal is to use pgfmath to calculate, or if % necessary iteratively approximate, the intersections % of these lines with the exponential curve. % If it is not easy in pgfmath, then I want a Lua-based solution. \end{tikzpicture} \end{document}

  • Problem (warning message) with Calculator package
    by ViToni on February 27, 2026 at 4:03 pm

    This rather small document \documentclass{article} \usepackage{calculator} \newcommand{\myPerCent}[2]{% \DIVIDE{#1}{#2}{\sol}% \MULTIPLY{\sol}{100}{\sol}% \ROUND{\sol}{\sol}% \sol% } \begin{document} Computed \myPerCent{2441}{8667}.\par \end{document} produces this warning (I guess it's a warning and not an error as the PDF is finally built): (\end occurred when \ifdim on line 13 was incomplete) I have no clue how to solve the issue as the code looks ok at first glance, but it seems something is off here. How can I use the package in a proper way? (I'm quite happy I was able to identify the source for the warnings at least as the original document is rather large and I started looking into things like How to diagnose unclosed (incomplete) \iftrue or \ifnum? but somehow I didn't get me anywhere and I don't seem to know anything more than before...)

  • Redefine \gg in ‘unicode-math’
    by mvs on February 27, 2026 at 2:41 pm

    I have: \documentclass{article} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{STIX Two Text}[Ligatures=TeX] \setmathfont{STIX Two Math} \usepackage{amsmath} % need a suitable redefinition of ‘\gg’ \begin{document} $\gg$ \end{document} with Lualatex but I want to redefine \gg to print a boldface g (such as \symbf{g}). I even asked ChatGPT but it could not find any solution which would work. Is there any? (of course I know that I could use a different command....)

  • Align the enumerate item number with the top edge of a tcolorbox?
    by oooh GYC on February 27, 2026 at 2:22 pm

    I am using a custom tcolorbox inside an enumerate environment. By default, the item number aligns with the baseline of the box (the bottom). I want the item number to be aligned with the top edge of the colored background. I have tried setting baseline=\ht\strutbox, but the number only moves up to the baseline of the first line of text, which still leaves a gap between the number and the top edge of the box. Here is my current code and the resulting output: \documentclass{article} \usepackage[most]{tcolorbox} \usepackage{enumitem} \newtcolorbox{bluebox}{ nobeforeafter, % baseline=\ht\strutbox % I tried this, but it is not perfectly aligned to the top } \begin{document} \begin{enumerate} \item \begin{bluebox} This is the first line of the box contents.\\ This is the second line. \end{bluebox} \end{enumerate} \end{document} As, the image shows, the item number (e.g., "1.") sits lower than the top of the blue background. Is there a way to force the baseline of the tcolorbox to be its physical top, or a specific offset that accounts for the font height? I have tried: baseline=\dimexpr\ht\strutbox-\tcbheight\relax baseline=\tcbheight

  • Need a new Latex command for square brackets
    by Ilia on February 27, 2026 at 1:38 pm

    I've already encountered in this site complaints that in the standard font, the horizontal lines (serifs) in the image of square brackets are too short and difficult to visually distinguish. As a workaround, some suggest using overlapping "ceil" and "floor" symbols instead of square brackets. However, this results in unacceptably long serifs. I need a new command for something intermediate and very limited in use. I don't intend to use it for matrices or any other multi-line environment. Just one short text string between brackets. Unable to find a suitable ready-made solution, I decided to write such a command myself. After all, it's just one vertical bar and two horizontal serifs. This is what I got so far. \documentclass[12pt,a4paper,notitlepage]{report} \usepackage[cp1251]{inputenc} \usepackage[T1,T2A]{fontenc} \usepackage[russian]{babel} \usepackage{amsmath, amssymb} \usepackage{mathrsfs} \usepackage{enumitem} \usepackage{relsize} \usepackage{exscale} \usepackage{perpage} \usepackage{nicefrac} \usepackage[all,cmtip]{xy} \MakePerPage{footnote} \newcommand{\LBR}{ \hspace{0.2em}\rule[0.75em]{0.2em}{0.05em}% top serif \hspace{-0.2em}\rule[-0.2em]{0.2em}{0.05em}% bottom serif \hspace{-0.3em}\rule[-0.2em]{0.1em}{1.0em}% vertical bar \hspace{0.2em} } \newcommand{\RBR}{ \hspace{0.1em}\rule[0.75em]{0.2em}{0.05em}% top serif \hspace{-0.2em}\rule[-0.2em]{0.2em}{0.05em}% bottom serif \rule[-0.2em]{0.1em}{1.0em}% vertical bar \hspace{0.2em} } \newcommand{\opni}[1] {{\RBR #1 \LBR}} \newcommand{\opcli}[1]{{\RBR #1 \RBR}} \newcommand{\clopi}[1]{{\LBR #1 \LBR}} \newcommand{\clsi}[1] {{\LBR #1 \RBR}} \begin{document} \[ \begin{array}{ll} \opni{a, b} &=\ \{x\in A: a < x < b\},\\ \opcli{a, b} &=\ \{x\in A: a < x\leqslant b\},\\ \clopi{a, b} &=\ \{x\in A: a\leqslant x < b\},\\ \clsi{a, b} &=\ \{x\in A: a\leqslant x\leqslant b\},\\ \opni{{\gets},a} &=\ \{x\in A: x < a\},\\ \opcli{{\gets},a} &=\ \{x\in A: x\leqslant a\},\\ \opni{a,{\to}} &=\ \{x\in A: a < x\},\\ \clopi{a,{\to}} &=\ \{x\in A: a\leqslant x\}. \end{array} \] $\mathbb{R}^\clsi{a,b}$ \end{document} Although not very pretty, this solution is more or less satisfactory - except for two problems. First, in some random cases the vertical bar and one of serifs are too thick. Second and more important, the brackets are not scaled inside superscript, for example, in an expression like $\mathbb{R}^\clsi{a,b}$. The reason for the first problem I don't understand. The reason for the second I understand, but have no idea what to do about it. Any help is appreciated.

  • Problem with rendering combining diacritics in LuaLaTeX
    by Guilherme on February 27, 2026 at 7:08 am

    I want to use the characters ἄ̱ a̱ typed with "combining macron bellow" ◌̱ (U 0331), but I do not get the correct rendering. I am using EB Garamond here, and this font support both glyphs, as I can see in the font preview software Typeface: When I compile with LuaLaTeX, I get the following result: It works for latin glyphs, but not greek ones. But, when I use other font with support for this (the free avaiable Brill font) the macron get correctly put, as you can see here: Now I am really in doubt if this is a problem on the side of the font, or a problem on the side of LuaLaTeX. Or even if I am missing some option or configuration in fontspec. Here is the minimal document to reproduce this. \documentclass{article} \usepackage{fontspec} \usepackage{babel} \babelprovide{english} % You can test each font. % \setmainfont[Kerning=On, Ligatures=Common]{EB Garamond} % \setmainfont[Kerning=On, Ligatures=Common]{Brill} \begin{document} a̱ ἄ̱ \end{document} My Version of LuaLaTeX: This is LuaHBTeX, Version 1.21.0 (TeX Live 2025) Development id: 7667

  • Replace outside framebox by xy axis
    by Leoborges on February 26, 2026 at 8:31 pm

    In this MWE, how can I replace the outside framebox by ordinary xy axis? \documentclass{article} \usepackage{luamplib} \begin{document} \begin{mplibcode} input graph beginfig(0); draw begingraph(4cm,5cm); setrange(-1,0,2,4); gdraw (-1,1) for x=-0.9 step 0.1 until 2: .. (x,x**2) endfor withpen pencircle scaled 1pt withcolor blue; endgraph; endfig; \end{mplibcode} \end{document}

  • FiraSans and math font in Beamer
    by Dimitrios ANAGNOSTOU on February 26, 2026 at 2:21 pm

    I am using Moloch theme and FiraSans font. When choosing the font for the math text, how to be sure which fonts are compatible with respect to sizes? As an example of comparison: % ============================================================ % CLASSE ET THÈME % ============================================================ \documentclass[10pt]{beamer} \usetheme{moloch} % Thème moloch % ============================================================ % ENCODAGE ET LANGUE % ============================================================ \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage[semibold,light]{FiraSans} \usepackage{FiraMono} \usepackage{mathpazo} %\usepackage{newtxmath} \usefonttheme[onlymath]{serif} \begin{document} \begin{frame} Soit $E$ un espace vectoriel réel de dimension finie. On considère une application linéaire $T : E \to E$ telle que \[ T(\alpha x + \beta y) = \alpha T(x) + \beta T(y). \] On suppose que la matrice associée à $T$ dans une base donnée est \[ A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ \vdots & \ddots & & \vdots \\ a_{n1} & \cdots & & a_{nn} \end{pmatrix}. \] Le déterminant $\det(A)$ permet de caractériser l'inversibilité de $T$. En particulier, \[ \det(A) \neq 0 \Longleftrightarrow T \text{ est bijective}. \] On en déduit que le système linéaire $Ax = b$ admet une solution unique si et seulement si le rang de $A$ est égal à $n$. \end{frame} \end{document} With mathpazo With newtxmath Default

  • Modifying existing math kerns (aka cut-ins or staircase kerning) to OpenType math fonts
    by Apoorv Potnis on February 26, 2026 at 6:53 am

    It seems that the code from this answer works when introducing new math kerns (aka cut-ins or staircase kerning), but does not seem to modify existing ones. \documentclass{article} \usepackage{luacode} %using luacode package to add comments to the Lua code % code adapted from Marcel Kruger's answer https://tex.stackexchange.com/a/760117/128462 \begin{luacode} local kerns = { ["NewCMMath-Book"] = { ["uni211D.bb"] = { topright = { { kern = -70 } } }, -- DOUBLE-STRUCK CAPITAL R (Stylistic Set = 3) ["u1D6F9"] = {bottomright = { { kern = -1000 } } }, -- MATHEMATICAL ITALIC CAPITAL PSI }, } local function addkerns(tfmdata) if tfmdata.mathparameters then local kerns = kerns[tfmdata.properties.fontname] local unicodes = tfmdata.resources.unicodes if kerns then local characters = tfmdata.characters for name, specification in pairs(kerns) do local character = characters[unicodes[name]] if character and not character.mathkerns then character.mathkerns = specification end end end end end fonts.handlers.otf.features.register { name = "mathkerns", description = "additional math kerns", initializers = { position = 1, base = addkerns, node = addkerns, } } \end{luacode} \usepackage{unicode-math} \setmathfont[ StylisticSet={3}, BoldFont = NewCMMath-Bold.otf, RawFeature=+mathkerns ]{NewCMMath-Book.otf} % code copied from here https://tex.stackexchange.com/a/82221/128462 \everymath=\expandafter{% \the\everymath% \Umathsubshiftdown\textstyle=1.5pt\Umathsubshiftdrop\textstyle=0.5pt} \everydisplay=\expandafter{% \the\everydisplay% \Umathsubshiftdown\displaystyle=1.5pt\Umathsubshiftdrop\displaystyle=0.5pt} \usepackage{lua-visual-debug} \lvdset{glyph={show=true}} \begin{document} \(\symit{\Psi}_{\symit{\Psi}}\symbb{R}^n\) \end{document} This is a problem because of the modifications I've made. The math kerns in New Computer Modern Math have been set with the SubscriptShiftDown value set as 247 (1000 units = 10 pt) originally. This causes the subscripts to be placed too low, as compared to the traditional Computer Modern fonts. In order to change that, I've modified this parameter to 1.5pt, using Khaled Hosny's code. I found the 1.5pt value in the newcomputermodern-math.lfg goodie file for NewCM Math provided by ConTeXt (see lines 79 and 80). I wish to increase the math kern values for some glyphs. I've included \symbb{R}^n to show that the newly added math kern works, but does not modify the existing one (set to -1000 which should cause collisions). Answers to other engines are also welcome.