• 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.

  • 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}

  • Using a range from TeX Gyre Termes Math causes arithmetic overflow
    by murray on February 26, 2026 at 6:29 pm

    The following source produces the expected output. % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage[russian,english]{babel} \babeltags{russian=russian} \usepackage{fontspec} \usepackage{lua-unicode-math} \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] %\setmathfont{TeX Gyre Termes Math}[Scale=MatchUppercase,math-style=ISO,range={\bigcup,\bigcap}] \ExpandArgs{c}\def{ver@unicode-math.sty}{} \babelfont{rm}[Scale=1.0]{TeXGyreTermesX} \babelfont[russian]{rm}{tempora} \usepackage{newunicodechar} \newunicodechar{♢}{\mdlgwhtdiamond} \usepackage{scalerel} \DeclareRobustCommand\myDiamond{\scalerel*{\mdlgwhtdiamond}{X}} \usepackage[thmtools-compat]{keytheorems} \DeclareRobustCommand{\qed}{% run-in QED: \ifmmode \mathqed \else \leavevmode\unskip\penalty9999 \hbox{}\nobreak%\hfill \quad\hbox{\qedsymbol}% \fi } \newkeytheoremstyle{exstyle}{} \newkeytheorem{example}[name=Example, style=exstyle, qed=$\myDiamond$] \begin{document} \begin{example} $3^{2} + 4^{2} = 5^{2}$. \end{example} \noindent We have $\bigcup_{i \in I} A_{i} = \bigcap_{j \in J} B_{j}$. \end{document} I want to pull the \bigcap and \bigcup symbols not from STIX Two Math but instead from TeX Gyre Termes Math (because in the latter they are lighter weight). However, if the commented-out line \setmathfont{TeX Gyre Termes Math...[...range=...] is uncommented then I get an arithmetic overflow when the qed-like diamond symbol is to appear. But why is the diamond symbol being selected from TeX Gyre Termes Math now, when apparently it was not before? Missing character: There is no ◇ (U+25C7) in font "name:TeX Gyre Termes Math:m ode=base;script=math;language=dflt;+tlig;"! ./clash.tex:39: Arithmetic overflow. <recently read> \calc@denominator l.39 \end{example} I can't carry out that multiplication or division, since the result is out of range.

  • 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

  • Building table lines via conditional
    by daleif on February 26, 2026 at 12:50 pm

    For a book project we're experimenting with configuring glossary. In our case we'd like to use xltabular. But sometimes the term in the first column is a bit wide, in that case we'd like to use \multicolumn and typeset the description on the row below. The naïve approch of course does not work (MWE below). Since we're using this for glossary entrys we can only use a single macro. Anyone have a good approach on how to do this? I'm assuming it is down to what is "allowed" at the start of a table row. Edit, version 2: This at least gets around the incomplete \ifdim error. But if we use the \multicolumn line, we instead get a Misplaced \omit. \multispan ->\omit \@multispan l.31 \Foo{AAAAAAAAAAAAAAAAAA}{BBB} error. One can get around this by starting the entry by \tabularnewline, but then we have an extra blank linie, that we'd need to back track \documentclass[a4paper]{article} \usepackage{array,booktabs} \begin{document} \makeatletter % if #1 is too long, typeset it in \multicolumn, and move description % to next line \NewDocumentCommand\Foo{mm}{ \settowidth\@tempdima{#1} \ifdim\@tempdima> 0.2\textwidth\relax \FooLong{#1}{#2} \else \FooShort{#1}{#2} \fi } \NewDocumentCommand\FooLong{mm}{ % \multicolumn{2}{l}{#1} #1 \tabularnewline & #2 \tabularnewline } \NewDocumentCommand\FooShort{mm}{ #1 & #2 \tabularnewline } \makeatother \noindent \begin{tabular}{@{}l l@{}} \Foo{AAA}{BBB} \Foo{AAAAAAAAAAAAAAAAAA}{BBB} \end{tabular} \end{document} Version 1: \documentclass[a4paper]{article} \usepackage{xltabular} \begin{document} \makeatletter % if #1 is too long, typeset it in \multicolumn, and move description % to next line \NewDocumentCommand\Foo{mm}{ \settowidth\@tempdima{#1} \ifdim\@tempdima> 0.2\textwidth\relax \multicolumn{2}{l}{#1} \tabularnewline & #2 \tabularnewline \else #1 & #2 \tabularnewline \fi } \makeatother \noindent \begin{xltabular}{\textwidth}{@{}l X@{}} \Foo{AAA}{BBB} \Foo{AAAAAAAAAAAAAAAAAA}{BBB} \end{xltabular} \end{document}

  • How to zoom in on an image? [duplicate]
    by Kong on February 26, 2026 at 10:15 am

    How can I crop an image and then keep its aspect ratio automatically resized and keep its resolution the same as what it originally us ? Basically I want to like zoom in on an image. For example, I want to zoom in such that the A fills the top and bottom of the image. Here is a MWE but you dont have to stick to it. I dont know what I am doing at all. \documentclass[twocolumn]{article} \usepackage{graphicx} \usepackage{subcaption} % <-- correct package \usepackage{booktabs} \usepackage[colorlinks]{hyperref} \usepackage{nicematrix} \usepackage[export]{adjustbox} % <-- provides \adjincludegraphics and cropping+scaling tools [1](https://tex.stackexchange.com/questions/57418/crop-an-inserted-image)[2](https://ctan.org/pkg/adjustbox) \begin{document} % ---- Tight frame: no padding between border and content ---- \setlength{\fboxsep}{0pt} \setlength{\fboxrule}{0.4pt} % ---- Cell geometry (ONE truth for all subfigures) ---- \newlength{\cellw} \newlength{\cellh} \setlength{\cellw}{0.23\textwidth} \setlength{\cellh}{0.17\textwidth} % choose the height you want (tweak once, applies everywhere) % ---- Image cell: crop (trim+clip) THEN scale to EXACT cell size ---- % The key trick is using BOTH width and height; adjustbox handles the crop+resize pipeline. [1](https://tex.stackexchange.com/questions/57418/crop-an-inserted-image)[2](https://ctan.org/pkg/adjustbox) \newcommand{\imgcell}[2][]{% \fbox{% \adjincludegraphics[ width=\cellw, height=\cellh, keepaspectratio, clip, #1 ]{#2}% }% } % ---- Text cell: EXACT same outer size; text centered both ways ---- \newcommand{\textcell}[1]{% \fbox{% \parbox[c][\cellh][c]{\cellw}{% \centering\small #1% }% }% } \begin{figure*}[htbp] \centering % --- Row 1 --- \subfloat{% % trim order: left bottom right top (graphicx/adjustbox convention) [1](https://tex.stackexchange.com/questions/57418/crop-an-inserted-image) \imgcell{example-image-a}% }\hfill \subfloat{% \imgcell{example-image-a}% }\hfill \subfloat{% \imgcell{example-image-a}% }\hfill \subfloat{% \imgcell{example-image-a}% } \vspace{0cm} % --- Row 2 --- \subfloat[Text Box]{% \textcell{% This is your\\ custom text\\ for the\\ bottom-left cell.% }% }\hfill \subfloat[Caption 2b]{% \imgcell{example-image-a}% }\hfill \subfloat[Caption 2c]{% \imgcell{example-image-a}% }\hfill \subfloat[Caption 2d]{% \imgcell{example-image-a}% } \caption{Overall figure caption} \label{fig:grid} \end{figure*} \end{document} Here is an example of what happens when I zoom in by cropping. It fails. If the dimensions on paper is 1337x137, then after zooming in via cropping it must still be 1337x137. I dont know how else to say it other than i just want to zoom in on an image. EDIT: Crop certain percent from each side of the figure not the same because cropping a % from 1 side distorts the human in the figure above. I need to crop with correct set of numbers. Alternatively, is there a [zoom] function that I can use ?

  • quotchap with LuaLaTeX and fontsetup
    by user20478285 on February 25, 2026 at 11:41 pm

    How can I have the quotchap package use the utopia font (only for the chapter number) with lualatex and fontsetup, like it does when using pdflatex? \documentclass{book} \usepackage{ifluatex} \ifluatex \usepackage{fontsetup} \else \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \fi \usepackage[grey, utopia]{quotchap} \begin{document} \chapter{Foo} \end{document} Result with pdflatex: Result with lualatex:

  • I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confused
    by Jasper on February 25, 2026 at 7:14 pm

    I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confused. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\SIGMALstart}{-3} \pgfmathsetmacro{\SIGMALstop}{3} \pgfmathsetmacro{\SIGMALsamples}{50} \pgfmathsetmacro{\SIGMALstep}{(\SIGMALstop-\SIGMALstart)/(\SIGMALsamples-1)} \foreach \SIGMAL[parse=true] in {\SIGMALstart,\SIGMALstart+\SIGMALstep,...,\SIGMALstop} { \draw[ variable=\TAUL, domain=-3:3 ] plot ( {\SIGMAL*\TAUL}, {((\TAUL)^2-(\SIGMAL)^2)/2} ); } \end{tikzpicture} \end{document}

  • enumerate with right-aligned labels, the widest is flush-left to left edge of text area without setting widest=
    by tsj on February 25, 2026 at 6:40 pm

    I want the following simple layout with enumitem: Blah blah noindent I. Foo II. Bar blah blah long line paragraph wrapping continues here III. Baz Blah blah noindent non-enumerate text Labels are right aligned, \labelsep can be fixed (e.g. 0.5em), and text continues from the same horizonal position on the next line in the case of a longer paragraph (I think this means \itemsep should be zero). enumitem apparently has the capacity to calculate the width of the widest label and set \labelwidth accordingly, though I can't determine under what circumstances that happens after reading the documentation. I can set widest=<whatever> to achieve the output I want, but I'd like to know if I can achieve the same by setting one or more parameters to ! or *, i.e. computing the parameters automatically. MWE and output are below, basically I just want the widest label (maybe VI or III or IV) label to be left-aligned with the left edge of the VVVVV (the left edge of the text area), everything else the same. \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=\Roman*.,nosep,align=right, leftmargin=*, labelindent=0pt, labelsep=0.5em, itemsep=0pt, % widest=VI, % I don't want to use this! ] \item Alpha. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. \item Gamma \item Delta \item Epsilon \item Zeta \end{enumerate} VVVVV \end{document}

  • \nopagebreak in \paragraph don’t have effect
    by fauve on February 25, 2026 at 4:44 am

    General overview I redefine \paragraph{} in order to get a wrap paragraph title like this : The problem But sometimes, when I reach the bottom page, a \section or \subsection comming just before the \paragraph stay at widow, like this: The MWE \documentclass{article} \usepackage{fontspec} \usepackage{xunicode} \usepackage{fontenc} \usepackage{wrapfig} \usepackage{needspace} \setlength\intextsep{0pt} \newlength{\wrapparwidth} \renewcommand{\paragraph}[1]{% %\needspace{3\baselineskip}% \nopagebreak[4]% \settowidth{\wrapparwidth}{\centering\bfseries\normalsize\small #1}% \ifdim\wrapparwidth>3cm% \setlength{\wrapparwidth}{3cm}% \fi% \begin{wrapfigure}{l}{\wrapparwidth} % l = left, 3cm largeur max \vspace{-0.04em} \centering\bfseries\normalsize\small #1 \end{wrapfigure}% \nopagebreak[4]% } \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \subsection{A random section} \paragraph{A random paragraph} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{document} The question As you see, I used many \nopagebreak and also needspace to avoid this behaviour, but LaTeX wan’t hear my \nopagebreaks. So how do I avoid pagebreak between sectioning commands and the new defined \paragraph ?

  • PDF/UA and stretchable math delimiters
    by Vincent Beffara on February 25, 2026 at 12:12 am

    I am trying to generate PDF/UA-2 compliant PDFs, and so far most of what I tried works with the last updates to the tagging support (thanks!). But with this file: \DocumentMetadata{lang=en,tagging=on,pdfstandard={UA-2}} \documentclass{article} \usepackage{newtxmath} \title{.} \begin{document} \maketitle \[\Bigg|\] \end{document} compiled with LuaLaTeX, verapdf tells me that the produced PDF is not valid because of a font issue, namely: The glyph can not be mapped to Unicode The Font dictionary of all fonts shall define the map of all used character codes to Unicode values, either via a ToUnicode entry, or other mechanisms as defined in ISO 14289-2, 8.4.5.8 I am assuming "the glyph" is the stretched vertical bar, and that the issue is with missing info from the math font loaded by newtxmath. What can I do, given that I would really like to keep newtxmath? Teach LuaLaTeX about the Unicode equivalent to that glyph (and others)? Use stretchable characters from another font? (but how?) Put the info in the font? (but how?)

  • How to write at an angle along a straight line
    by rpapa on February 24, 2026 at 8:33 pm

    Using "sloped" I know how to write text parallel to a line, but how do I make the text also at an angle in the second case? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,matrix,calc} \begin{document} \begin{tikzpicture} \draw [red,ultra thick] (0,0)coordinate(A1)-- (3,5)coordinate(A2); \path (A1) -- (A2) node[sloped,pos=0.3,draw,fill=white]{aa}; \draw [blue,ultra thick] (1,0)coordinate(A3)-- (4,5)coordinate(A4); \foreach \i in {1,...,5} \node [sloped,draw,fill=white] at ($(A3)!{\i*10mm}!(A4)$) {\i}; \end{tikzpicture} \end{document} To be clear, the nodes must have a set distance between them. I am proposing my solution, adapted from your responses. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,matrix,calc} \begin{document} \begin{tikzpicture} \draw [red,ultra thick] (0,0)coordinate(A1)-- (3,5)coordinate(A2); \path (A1) -- (A2) node[sloped,pos=0.3,draw,fill=white]{aa}; \draw [blue,ultra thick] (1,0)coordinate(A3)-- (4,5)coordinate(A4); \foreach \i in {1,...,5} \node [sloped,draw,fill=white] at ($(A3)!{\i*10mm}!(A4)$) {\i}; \draw [blue,ultra thick] (2,0)coordinate(A3)-- (5,5)coordinate(A4); \pgfmathanglebetweenpoints{\pgfpointanchor{A3}{center}}{\pgfpointanchor{A4}{center}} \edef\angleAB{\pgfmathresult} \foreach \i in {1,...,5} \node [rotate=\angleAB,draw,fill=blue,minimum height=2mm,minimum width=8mm,text=yellow] at ($(A3)!{\i*10mm-10mm}!(A4)$) {\i}; \newcommand{\tracepark}[4]{ \draw (#1) -- (#2); \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}} \edef\angleAB{\pgfmathresult} \foreach \i in {#3,...,#4} \node [rotate=\angleAB,draw,fill=blue,minimum height=2mm,minimum width=8mm,text=yellow] at ($(#1)!{\i*10mm-#3*10mm}!(#2)$) {\i}; } \coordinate(A5) at (-3,4); \coordinate(A6) at (3,-8); \tracepark{A5}{A6}{5}{10} \end{tikzpicture} \end{document}

  • Spacing and dot weight in bsmallmatrix (from mathtools)
    by Dimitrios ANAGNOSTOU on February 24, 2026 at 4:45 pm

    MWE \documentclass{article} \usepackage{mathtools} \begin{document} Le signe $(-1)^{i+j}$ suit un motif en damier : \( \begin{bsmallmatrix} + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ \vdots & \vdots & \vdots & \vdots & \ddots \end{bsmallmatrix} \) \end{document} Questions There appears to be some horizontal empty space around the matrix. How can I remove or reduce it? It seems that \cdots is not as bold as \vdots and \ddots. Is this actually the case? If so, is there a way to make the various dots visually consistent? THANKS A LOT!

  • pgfplotstable commands do not work in a foreach loop
    by CarLaTeX on February 24, 2026 at 8:33 am

    I'm trying to put together n files into one with pgfplotstable. This example works: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \pgfplotstableread[header=false]{data2.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \pgfplotstableread[header=false]{data3.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} It gives what I want: But if I put the \pgfplotstableread and \pgfplotstablevertcat in a \foreach loop, they don't work: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \foreach \ind in {2,3} {the loop is executed: \ind\newline \pgfplotstableread[header=false]{data\ind.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} } \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} Even if the loop is executed, I got no errors, and in the log I have: PGFPlots: reading {data1.csv} PGFPlots: reading {data2.csv} PGFPlots: reading {data3.csv}

  • Formatting a sequence of items with comma and ending with 'and' or 'respectively'
    by mf67 on February 23, 2026 at 10:02 pm

    Can someone help me create a macro like \MyList{A;B;C;D;E;F} which returns “A, B, C, D, E[,] respectively F" independently on how many ”arguments” (2+) that are specified and also support math, e.g. \MyList{\(A\);\(B\);\(C\);\(D\);\(E\);\(F\)} ? (I used the [,] notation since I’m not sure if the Oxford comma is used today.) If the number of arguments is two; \MyList{A;B} I would like it to return “A respectively B”. Edit: I tried using sinuitx but it might not be suitable for this task as it mainly(?) handles numbers. Here is a test \documentclass{article} \usepackage{siunitx} \begin{document} \numlist[parse-numbers=false]{A;2;3} \numlist[parse-numbers=false]{\text{A};2;3} \numlist[parse-numbers=false]{\(A+B\);2;3} \end{document} but it gives an error on the last line and I would like to have ”roman letters” if no ”math mode” is used, and avoid using \text{}.

  • Controlling Subsection Visibility in LaTeX Table of Contents
    by Aimar on February 23, 2026 at 10:43 am

    I am using the amsart document class in LaTeX. I would like the table of contents to display all sections while including only a single, specific subsection. All other subsections should remain numbered and visible in the document, but should not appear in the table of contents. \documentclass{amsart} \usepackage{hyperref} \begin{document} \title{title} \author{Author Name} \maketitle \tableofcontents \section{First Section} \subsection*{This subsection should NOT appear in the TOC} \subsection{This subsection SHOULD appear in the TOC} \section{Second Section} \subsection*{Another subsection NOT in the TOC} \end{document}