• Twisted Equality
    by Entropy on February 8, 2026 at 8:14 pm

    I am trying to create a new math symbol. Could someone please help me with it? My current code: \documentclass[12pt]{report} \RequirePackage{tikz} \newcommand{\eq}{\begin{tikzpicture}% [scale=.175, line width=0.5pt] \draw (-1,1) -- (0,0); \draw (0,1) -- (-0.5,0.5); \draw (0,-1) -- (-1,0); \draw (-0.5,-0.5) -- (-1,-1); \end{tikzpicture}} \begin{document} \[ u - \eq - u \] \end{document} However, the symbol I am actually going for is this: I was using it for something like this:

  • Table with Numbered Equations and Hyperref Anchors
    by palloc on February 8, 2026 at 4:39 pm

    I have the following code, where there are equations inside the table, formatted as inline with numbering: \documentclass{article} \usepackage{amsmath} \usepackage{booktabs} \usepackage{tabularx} \usepackage{cleveref} \usepackage{float} \begin{document} \begin{equation} P = P_0 + \rho g h \label{eq:pp0rhogh} \end{equation} \begin{table}[H] \centering \begin{tabularx}{\textwidth}{@{}l>{\centering\arraybackslash}Xr@{}} \toprule \textbf{Name} & \textbf{Equation} & \textbf{} \\ \midrule First & \(E = mc^2 \) & \refstepcounter{equation}(\theequation)\label{eq:emc} \\ Second & \(c = h\nu \) & \refstepcounter{equation}(\theequation)\label{eq:chnu} \\ \bottomrule \end{tabularx} \caption{Equations} \label{tab:equations} \end{table} \begin{equation} F = ma \label{eq:fma} \end{equation} \eqref{eq:pp0rhogh}, \eqref{eq:emc}, \eqref{eq:chnu}, \eqref{eq:fma}, \cref{tab:equations} \end{document} Output: What I want is proper hyperref anchoring. I tried the following: First & \(E = mc^2 \) & \refstepcounter{equation}\phantomsection(\theequation)\label{eq:emc} \\ Clicking on \eqref{eq:emc} results in the following output, which is not as expected, the anchor is not in the correct position. Output: I also tried: Second & \(\displaystyle c = h\nu \refstepcounter{equation}\phantomsection{\theequation}\label{eq:chnu}\) & (\ref{eq:chnu}) \\ Clicking on \eqref{eq:chnu} works correctly results in the following output with the hyperlink, but the output shows c = h \nu 3, I do not want to have the extra number 3, and the equation number (3) at the end of the line should not be clickable. Output: Whole code: \documentclass{article} \usepackage{amsmath} \usepackage{booktabs} \usepackage{tabularx} \usepackage{float} \usepackage{caption} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \begin{document} \begin{equation} P = P_0 + \rho g h \label{eq:pp0rhogh} \end{equation} \begin{table}[H] \centering \begin{tabularx}{\textwidth}{@{}l>{\centering\arraybackslash}Xr@{}} \toprule \textbf{Name} & \textbf{Equation} & \textbf{} \\ \midrule First & \(E = mc^2 \) & \refstepcounter{equation}\phantomsection(\theequation)\label{eq:emc} \\ Second & \(\displaystyle c = h\nu \refstepcounter{equation}\phantomsection{\theequation}\label{eq:chnu}\) & (\ref{eq:chnu}) \\ \bottomrule \end{tabularx} \caption{Equations} \label{tab:equations} \end{table} \begin{equation} F = ma \label{eq:fma} \end{equation} \eqref{eq:pp0rhogh}, \eqref{eq:emc}, \eqref{eq:chnu}, \eqref{eq:fma} \end{document} Output:

  • How can I replicate this image using TikZ?
    by Bayaraa Surenjav on February 8, 2026 at 4:11 pm

    My code is: \documentclass[tikz,border=10pt]{standalone} \usepackage[utf8]{inputenc} \usepackage[mongolian]{babel} \usepackage{amsmath} \usetikzlibrary{calc, positioning, arrows.meta, backgrounds, shapes.geometric} \begin{document} \begin{tikzpicture}[ num node/.style={ font=\Large\bfseries\rmfamily, % Serif font, Bold anchor=east, inner sep=3pt, minimum height=0.65cm }, div node/.style={ font=\Large\rmfamily, anchor=east, inner sep=3pt }, arrow style/.style={ ->, >=latex, draw=cyan!80!blue, line width=0.8pt }, label text/.style={ text=cyan!80!blue, font=\itshape, align=right }, % Үйлдлийн тэмдэг (div 2) op label/.style={ text=cyan!80!blue, font=\large, anchor=west, xshift=2pt } ] \def\rowh{0.9} \node[div node] (d1) at (0,0) {2)}; \node[num node] (n1) at (1.8,0) {120}; \draw[thick] (d1.south east) -- (n1.south east); \node[div node] (d2) at (0,-\rowh) {2)}; \node[num node] (n2) at (1.8,-\rowh) {60}; \draw[thick] (d2.south east) -- (n2.south east); \node[div node] (d3) at (0,-2*\rowh) {2)}; \node[fill=cyan!25, inner sep=2pt, minimum height=0.6cm, minimum width=0.8cm, anchor=east] at (1.85,-2*\rowh) {}; \node[num node, text=magenta] (n3) at (1.8,-2*\rowh) {30}; \draw[thick] (d3.south east) -- (n3.south east); \node[div node] (d4) at (0,-3*\rowh) {3)}; \node[num node] (n4) at (1.8,-3*\rowh) {15}; \draw[thick] (d4.south east) -- (n4.south east); \node[num node] (n5) at (1.8,-4*\rowh) {5}; \begin{scope}[on background layer] % Зүүн талын босоо багана (Хуваагчдыг хамарсан) \fill[cyan!15] (-0.8, 0.4) rectangle (0.2, -4.5*\rowh); \fill[cyan!15] (-0.8, -3.65*\rowh) rectangle (2.2, -4.5*\rowh); \end{scope} \def\arm{0.5} \draw[arrow style] (n1.east) -- ++(\arm,0) |- node[pos=0.25, op label] {$\div 2$} (n2.east); \draw[arrow style] (n2.east) -- ++(\arm,0) |- node[pos=0.25, op label] {$\div 2$} (n3.east); \draw[arrow style] (n3.east) -- ++(\arm,0) |- node[pos=0.25, op label] {$\div 2$} (n4.east); \draw[arrow style] (n4.east) -- ++(\arm,0) |- node[pos=0.25, op label] {$\div 3$} (n5.east); \node[label text] (txt1) at (-3.5, 0) {анхны тоогоор хуваах}; \draw[arrow style] (txt1) -- (d1.west); \node[label text] (txt2) at (-4, -4*\rowh) {анхны тоо гартал үргэлжлүүлнэ}; \draw[arrow style] (txt2) -- (n5.west); \end{tikzpicture} \end{document} Current: Intended:

  • I would like to number subcases as well with 1a, 1b
    by palloc on February 8, 2026 at 11:12 am

    I have the following code, I would like to number the subcases with 1a, 1b, so not just one big case with (1). \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} f(x) = \begin{cases} x^2& x \ge 0,\\ -x & x < 0. \end{cases} \end{equation} \end{document}

  • Configure `keytheorems` so that it produces the same output as `ntheorem`
    by Denis Bitouzé on February 8, 2026 at 9:48 am

    For a class of mine, I'm in the process to switch from ntheorem to keytheorems but, for compatibility reason, I would like to make the output of “theorems” as identical as possible. Unfortunately, it is not the case, as shown in the following M( non realistic )CE: \RequirePackage{comment} \includecomment{kt}\excludecomment{nt} % \includecomment{nt}\excludecomment{kt} \documentclass{article} \usepackage[ textwidth=12.75cm, paperwidth=14cm, paperheight=2cm, showframe ]{geometry} \begin{kt} \usepackage{keytheorems} \newkeytheoremstyle{rmk-style}{ inherit-style=definition, notefont=\bfseries, headpunct={~--} } \newkeytheorem{rmk}[style=rmk-style,name=Remark] \end{kt} \begin{nt} \usepackage{ntheorem} \theoremstyle{plain} \theoremheaderfont{\normalfont\bfseries} \theorembodyfont{\normalfont} \theoremseparator{~--} \theoremsymbol{} \newtheorem{rmk}{Remark} \end{nt} \begin{document} \begin{rmk}[Euler's identity] One of the most beautiful mathematical equation: \[ e^{i\pi}+1=0 \] \end{rmk} \end{document} As it is (keytheorems in force), the output is the following: whereas, if the second line is commented and the third one is uncommented (ntheorem in force), the output is the following: How could I configure keytheorems in order it produces the same output as ntheorem?

  • Why do I keep getting "database doesn't exist" error when I try to read a csv with datatool \DTLread[name=gradesDB,format=csv]{data.csv}?
    by nt54 on February 8, 2026 at 5:33 am

    I'm trying to read a simple csv into a datatool database and then populate a table with this data. The persistent error is reported as "Package datatool error: Database 'gradesDB doesn't exist' in the TeXworks console output. I'm using the current TeXworks 2025 full/complete installation. The csv was encoded as uft-8. This csv file is named data.csv (NOTE: In the preview of this post this file appears in a single row format. It is actually written as a 4 row x 3 column form with the first three rows terminated by CRLF) Name,Surname,Grade Albert,Einstein,147 Marie,Curie,159 Thomas,Edison,179 I've consulted online AI and version 3.4.3 2025-12-04 of The Datatool Bundle: Databases and Data Manipulation from Dickimaw Books for documentation. This package is new to me and I have a feeling is there is a simple error I'm not catching. I greatly appreciate any help you might offer. Thanks in advance. \documentclass{article} \usepackage{datatool} \usepackage{booktabs} % Optional: provides better horizontal lines (\\toprule, \\midrule, \\bottomrule) \usepackage[utf8]{inputenc} \DTLloaddb{gradesDB}{data.csv} \begin{document} \section{Student Grades} % Load the CSV file into a database named 'gradesDB' %% Note the following command is now deprecated according to docs %% \DTLloaddb[autonum=false]{gradesDB}{data.csv} \DTLnewdb{gradesDB} \DTLread[name=gradesDB,format=csv]{data.csv} % Begin the table environment \begin{table}[h] \centering \caption{Grades of Students} \label{tab:grades} % Begin the tabular environment with column specifications \begin{tabular}{c c c } \toprule \textbf{Name} & \textbf{Surname} & \textbf{Grade} \\ \midrule % Iterate through each row in the 'gradesDB' database \DTLforeach*{gradesDB}{% \Name=Name,% \Surname=Surname,% \Grade=Grade% }{% % Format each row \Name & \Surname & \Grade \\ } \bottomrule \end{tabular} \end{table} \end{document} The log file: This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex 2026.2.7) 8 FEB 2026 00:19 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **test_read.tex (./test_read.tex LaTeX2e <2025-11-01> L3 programming layer <2026-01-19> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count275 \c@section=\count276 \c@subsection=\count277 \c@subsubsection=\count278 \c@paragraph=\count279 \c@subparagraph=\count280 \c@figure=\count281 \c@table=\count282 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen148 ) (c:/texlive/2025/texmf-dist/tex/latex/datatool/datatool.sty Package: datatool 2025/12/04 v3.4.3 (NLCT) (c:/texlive/2025/texmf-dist/tex/latex/base/ifthen.sty Package: ifthen 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC) ) (c:/texlive/2025/texmf-dist/tex/latex/xfor/xfor.sty Package: xfor 2009/02/05 v1.05 (NLCT) ) (c:/texlive/2025/texmf-dist/tex/latex/etoolbox/etoolbox.sty Package: etoolbox 2025/10/02 v2.5m e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count283 ) (c:/texlive/2025/texmf-dist/tex/latex/tracklang/tracklang.sty Package: tracklang 2025/03/11 v1.6.6 (NLCT) Track Languages (c:/texlive/2025/texmf-dist/tex/generic/tracklang/tracklang.tex)) (c:/texlive/2025/texmf-dist/tex/latex/datatool/datatool-base.sty Package: datatool-base 2025/12/04 v3.4.3 (NLCT) (c:/texlive/2025/texmf-dist/tex/latex/amsmath/amsmath.sty Package: amsmath 2025/07/09 v2.17z AMS math features \@mathmargin=\skip51 For additional information on amsmath, use the `?' option. (c:/texlive/2025/texmf-dist/tex/latex/amsmath/amstext.sty Package: amstext 2024/11/17 v2.01 AMS text (c:/texlive/2025/texmf-dist/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen149 )) (c:/texlive/2025/texmf-dist/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d Bold Symbols \pmbraise@=\dimen150 ) (c:/texlive/2025/texmf-dist/tex/latex/amsmath/amsopn.sty Package: amsopn 2022/04/08 v2.04 operator names ) \inf@bad=\count284 LaTeX Info: Redefining \frac on input line 233. \uproot@=\count285 \leftroot@=\count286 LaTeX Info: Redefining \overline on input line 398. LaTeX Info: Redefining \colon on input line 409. \classnum@=\count287 \DOTSCASE@=\count288 LaTeX Info: Redefining \ldots on input line 495. LaTeX Info: Redefining \dots on input line 498. LaTeX Info: Redefining \cdots on input line 619. \Mathstrutbox@=\box53 \strutbox@=\box54 LaTeX Info: Redefining \big on input line 721. LaTeX Info: Redefining \Big on input line 722. LaTeX Info: Redefining \bigg on input line 723. LaTeX Info: Redefining \Bigg on input line 724. \big@size=\dimen151 LaTeX Font Info: Redeclaring font encoding OML on input line 742. LaTeX Font Info: Redeclaring font encoding OMS on input line 743. \macc@depth=\count289 LaTeX Info: Redefining \bmod on input line 904. LaTeX Info: Redefining \pmod on input line 909. LaTeX Info: Redefining \smash on input line 939. LaTeX Info: Redefining \relbar on input line 969. LaTeX Info: Redefining \Relbar on input line 970. \c@MaxMatrixCols=\count290 \dotsspace@=\muskip17 \c@parentequation=\count291 \dspbrk@lvl=\count292 \tag@help=\toks18 \row@=\count293 \column@=\count294 \maxfields@=\count295 \andhelp@=\toks19 \eqnshift@=\dimen152 \alignsep@=\dimen153 \tagshift@=\dimen154 \tagwidth@=\dimen155 \totwidth@=\dimen156 \lineht@=\dimen157 \@envbody=\toks20 \multlinegap=\skip52 \multlinetaggap=\skip53 \mathdisplay@stack=\toks21 LaTeX Info: Redefining \[ on input line 2950. LaTeX Info: Redefining \] on input line 2951. ) \l__datatool_tmpa_int=\count296 \l__datatool_tmpb_int=\count297 \l__datatool_tmpc_int=\count298 \l__datatool_tmpd_int=\count299 \l__datatool_count_int=\count300 \l__datatool_tmp_datatype_int=\count301 \l__datatool_tmpa_dim=\dimen158 \l__datatool_tmpb_dim=\dimen159 (c:/texlive/2025/texmf-dist/tex/latex/datatool/datatool-l3fp.def File: datatool-l3fp.def 2025/12/04 v3.4.3 (NLCT) ) \@dtl@toks=\toks22 \@dtl@tmpcount=\count302 \dtl@tmplength=\skip54 \l__datatool_measure_box=\box55 \dtl@sortresult=\count303 (c:/texlive/2025/texmf-dist/tex/latex/datatool/datatool-utf8.ldf File: datatool-utf8.ldf 2025/12/04 v3.4.3 (NLCT) ) \@dtl@datatype=\count304 \c_datatool_unknown_int=\count305 \l__datatool_year_int=\count306 \l__datatool_month_int=\count307 \l__datatool_day_int=\count308 \l__datatool_hour_int=\count309 \l__datatool_minute_int=\count310 \l__datatool_second_int=\count311 \l__datatool_tzhour_int=\count312 \l__datatool_tzminute_int=\count313 \l__datatool_julian_int=\count314 \l__datatool_local_julian_int=\count315 \l__datatool_prefix_int=\count316 \l__datatool_suffix_int=\count317 \@dtl@foreach@level=\count318 \dtl@codeA=\count319 \dtl@codeB=\count320 ) \l__datatool_max_cols_int=\count321 \l__datatool_col_idx_int=\count322 \l__datatool_row_idx_int=\count323 \l__datatool_item_type_int=\count324 \l__datatool_action_column_int=\count325 \l__datatool_action_column_ii_int=\count326 \l__datatool_action_row_int=\count327 \l__datatool_action_row_ii_int=\count328 \l__datatool_action_type_int=\count329 \l__datatool_action_datum_round_int=\count330 \dtlcolumnnum=\count331 \dtlrownum=\count332 \@dtl@before=\toks23 \@dtl@after=\toks24 \@dtl@colhead=\toks25 \dtlcurrentrow=\toks26 \dtlbeforerow=\toks27 \dtlafterrow=\toks28 \l__datatool_map_data_max_cols_int=\count333 \l__datatool_map_data_edit_column_int=\count334 \dtlforeachlevel=\count335 \c@DTLrow=\count336 \c@DTLrowi=\count337 \c@DTLrowii=\count338 \c@DTLrowiii=\count339 \dtl@rowi=\count340 \dtl@rowii=\count341 \dtl@rowiii=\count342 \g__filtered_row_i_int=\count343 \g__filtered_row_ii_int=\count344 \g__filtered_row_iii_int=\count345 \@dtl@curi=\toks29 \@dtl@previ=\toks30 \@dtl@nexti=\toks31 \@dtl@curii=\toks32 \@dtl@previi=\toks33 \@dtl@nextii=\toks34 \@dtl@curiii=\toks35 \@dtl@previii=\toks36 \@dtl@nextiii=\toks37 \l_datatool_display_per_row_int=\count346 \l_datatool_display_tab_rows_int=\count347 \@dtl@toksA=\toks38 \@dtl@toksB=\toks39 \@dtl@elements=\count348 \__datatool_sort_data_sortcol_int=\count349 \__datatool_sort_data_grpcol_int=\count350 \dtl@omitlines=\count351 \l__datatool_line_int=\count352 ) (c:/texlive/2025/texmf-dist/tex/latex/booktabs/booktabs.sty Package: booktabs 2020/01/12 v1.61803398 Publication quality tables \heavyrulewidth=\dimen160 \lightrulewidth=\dimen161 \cmidrulewidth=\dimen162 \belowrulesep=\dimen163 \belowbottomsep=\dimen164 \aboverulesep=\dimen165 \abovetopsep=\dimen166 \cmidrulesep=\dimen167 \cmidrulekern=\dimen168 \defaultaddspace=\dimen169 \@cmidla=\count353 \@cmidlb=\count354 \@aboverulesep=\dimen170 \@belowrulesep=\dimen171 \@thisruleclass=\count355 \@lastruleclass=\count356 \@thisrulewidth=\dimen172 ) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count357 ) (./test_read.aux) \openout1 = `test_read.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5. LaTeX Font Info: ... okay on input line 5. \dtldb@grades=\toks40 \dtlkeys@grades=\toks41 \dtlrows@grades=\count358 \dtlcols@grades=\count359 ! Package datatool Error: Database `gradesDB' doesn't exist. See the datatool package documentation for explanation.

  • Helvetica (phv) inconsistency: how to do it correctly?
    by karlh on February 7, 2026 at 7:00 pm

    I am trying to use text in a particular font (in this case, a Helvetica clone) without bringing on an entire package and/or forcing the user to use a particular package. A minimal example is below: \documentclass{article} \usepackage{tikz} \begin{document}\noindent This is document text. \begin{center} \begin{tikzpicture} \begin{scope}[every node/.style={transform shape}] \renewcommand*{\sfdefault}{phv} \node {\resizebox{!}{0.5cm}{\sffamily WOOHOO!}}; \end{scope} \end{tikzpicture} \end{center} This is more document text. \end{document} However, I get different results with different engines, as shown: My questions: (1) why doesn't LuaLaTeX show the same result as PDFLaTeX? (2) What is the "right" (read: most portable) way to include a single piece of Helvetica (or some other font) in this manner without dragging in an entire package or forcing the use of a particular TeX engine?

  • xypic loop error
    by underwhelmer on February 7, 2026 at 6:51 pm

    Here are two different bits of code that difer by exactly one letter: Number 1: \documentclass{amsart} \usepackage[all]{xy} \begin{document} \begin{displaymath} \xymatrix{ { \begin{tabular}{c|c} \hline $x_2$ & 7 \\ \hline $x_3$ & 4 \\ \hline \end{tabular} } \ar@(ul,dl)[]_{\pi^0} } \end{displaymath} \end{document} Number 2: \documentclass{amsart} \usepackage[all]{xy} \begin{document} \begin{displaymath} \xymatrix{ { \begin{tabular}{c|c} \hline $x_2$ & 7 \\ \hline $x_3$ & 4 \\ \hline \end{tabular} } \ar@(l,dl)[]_{\pi^0} } \end{displaymath} \end{document} The difference is that in number 2, the arrow is modified with @(l,dl) while in number 1 it is modified with @(ul,dl) Number 1 doesn't compile. Number 2 does but looks ugly. I'd like Number 1 to compile and look better than Number 2 in the way it should. Since I know it will come up: no, I'm not willing to switch to tikz. Yes, I know tikz is better. But I know the syntax for xypic and have been using it for sneaking up on twenty years and I just turned 40 and am thus officially allowed to be a stick in the mud about things.

  • MakeLowercase not working with lipsum
    by Jonathan Webley on February 7, 2026 at 9:34 am

    This MWE: \documentclass{article} \usepackage{lipsum} \begin{document} \MakeLowercase{\lipsum[1][1]} \end{document} generates: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

  • Where is the l3benchmark.sty file located?
    by Alain Matthes on February 7, 2026 at 8:24 am

    I wanted to test an old file, but I got an error. ! LaTeX Error: File `l3benchmark.sty' not found. My distribution is up to date, so I assume this file has been removed. What can I replace it with? \RequirePackage{l3benchmark} \ExplSyntaxOn \AtEndDocument { \benchmark_toc: } \benchmark_tic: \ExplSyntaxOff \documentclass{article} \usepackage{tikz} \begin{document} \directlua{ function f(t0, t1, n) local filename = tex.jobname .. ".table" local out = assert(io.open(filename, "w")) for t = t0, t1, (t1 - t0) / n do local x = math.sin(5*t) local y = math.cos(3*t) out:write(x, " ", y, " i", string.char(10)) % or out:write(x, " ", y, " i\string\n") end out:close() end } \begin{tikzpicture}[scale=4] \directlua{f(0, 2*math.pi, 256)}% \draw[red] plot[smooth] file {\jobname.table}; \end{tikzpicture} \end{document}

  • How can I get text (marginnote) next to a tabularray-row?
    by lukascbossert on February 6, 2026 at 10:12 pm

    I would like to have short information next to certain rows of tabularray-environment, like a marginnote. The content in the note is a macro (here just text). The issue I face is: ! Undefined control sequence. <argument> \@currbox l.68 \requestedFundingTable[A1] TeXnically it does not necessarily need to be a \marginpar but also anything that would get text next to the specific row. \documentclass{scrartcl} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{siunitx} \UseTblrLibrary{functional} \ExplSyntaxOn \tl_new:N \l__tmp_body_staff_tl \tl_new:N \l__tmp_body_costs_tl \NewDocumentCommand{\requestedFundingTable}{o}{ Table~ #1 :\par \tl_clear:N \l__tmp_body_staff_tl \tl_clear:N \l__tmp_body_costs_tl \tl_put_right:Nn \l__tmp_body_staff_tl { \SetRow{red!20} \SetCell{font=\footnotesize\bfseries,halign=l} Staff & Qty & Sum \\ } \tl_put_right:Nn \l__tmp_body_costs_tl { \SetHline{-}{red,0.5pt} \SetRow{red!20} \SetCell{font=\footnotesize\bfseries,halign=l} Direct~ Costs & \SetCell[c=2]{c} Sum & \\ } % further processing in between \tl_put_right:Ne \l__tmp_body_staff_tl { category & 12 & 123 \\ } \tl_put_right:Ne \l__tmp_body_costs_tl { \SetRow{cmd={\marginpar{A note: #1}}} %<<<<<<<<<<<<<<<<<<<<<<<<< category & \SetCell[c=2]{c} 1234 & \\ } \begin{tblr}[ long, expand= \l__tmp_body_staff_tl \l__tmp_body_costs_tl, ]{ colspec = { *{1}{X[4,m]} *{2}{X[r, si={table-format=4}]} }, row{1,2} = {guard}, } CATEGORY & \SetCell[c=2]{c} year & \\ \l__tmp_body_staff_tl \l__tmp_body_costs_tl \end{tblr} } \ExplSyntaxOff \begin{document} \requestedFundingTable[A1] \requestedFundingTable[A2] \end{document}

  • How to make f\left(x\right) not add extra space after f?
    by Nasser on February 6, 2026 at 8:01 pm

    I tried all answers in Spacing around \left and \right and none of them work. I use code generate by computer CAS. And all the code generates \left(...\right). So not possible to do any manual editing of latex code generated. Only issue is that something like f\left(x\right) adds extra space between function name f and the parentheses. I am not talking about any space inside parentheses, but the space outside between function name and starting (. I only want this space to be the same as if code was written using f(x). Nothing else change. First, here is MWE showing the issue \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Compiled with lualatex gives Notice how the space after function name is larger when using \left(...\right) which is the second equation. I'd like the space after function names and starting ( in the second equation to be same as first equation as it looks better. Below are all my tries. Some of them fix the space after g and not after f and some solution fix the space after f but not after g. But there is no solution which produce same exact output for second equation as the first one. Try 1 (accepted answer in the above link) \documentclass[12pt]{article} \let\originalleft\left \let\originalright\right \renewcommand{\left}{\mathopen{}\mathclose\bgroup\originalleft} \renewcommand{\right}{\aftergroup\egroup\originalright} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Notice the space after g in second equation have become too small. Try 2 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \usepackage{mathtools} \DeclarePairedDelimiter\pars{\lparen}{\rparen} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives No effect. Larger space after function names still exist. Try 3 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \let\originalleft\left \let\originalright\right \def\left#1{\mathopen{}\originalleft#1} \def\right#1{\originalright#1\mathclose{}} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Again, now space after g is too small. Try 4 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \Umathopinnerspacing\displaystyle=0mu \Umathopinnerspacing\textstyle=0mu \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Still, the space between function names and ( is not same in second equation as first equation. try 5 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \def\delim#1#2#3{ \mathopen{\left#1 \vphantom{#2} \right.} \kern-\nulldelimiterspace #2 \kern-\nulldelimiterspace \mathclose{ \left. \vphantom{#2} \right#3 } } \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Still, the space between function names and ( is not same in second equation as first equation. Try 6 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \usepackage{mleftright} \renewcommand{\left}{\mleft} \renewcommand{\right}{\mright} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives The space after f looks same as in equation 1, but the space after g in second equation is now too small.

  • Unequal parens sizes in numerator and denominator of a fraction
    by Knudsen on February 6, 2026 at 2:22 pm

    Why are the parens on the numerator of this construction much bigger than the ones in the denominator? \documentclass{report} \usepackage{amsmath} \begin{document} \[ \frac{\left(q^k\right)} {\left(q^k\right)} \] \end{document}

  • How to use the \convolution operator command provided by fontsetup with OpTeX? (using PUA glyphs in OpTeX)
    by Apoorv Potnis on February 6, 2026 at 11:38 am

    The fontsetup package provides with a \convolution operator command to access a big star symbol from the New Computer Modern fonts. However, fontsetup works only with XeLaTeX and LuaLaTeX. How does one access this glyph from the NewCM fonts with OpTeX? The \convolution command is defined in fspdefault.tex as \DeclareMathOperator*{\convolution}{\mathchoice{\char"E037}{\char"E036}{\char"E038}{\char"E039}}. The question essentially asks about using glyphs not encoded their Unicode slots (Private Use Areas?), as a Unicode slot for the glyph does not exist. LuaLaTeX MWE: \documentclass{article} \usepackage[newcmbb]{fontsetup} \begin{document} \[ \convolution_{1\le i\le n} a_i \] \[ \sum_{i=1}^n \convolution_{i=1}^n x_i \qquad \textstyle \sum\convolution_{i=1}^n x_i \qquad \scriptstyle \sum\convolution_{i=1}^n x_i \qquad \scriptscriptstyle \sum\convolution_{i=1}^n x_i \] \end{document}

  • Finding and displaying the intersection points of two surfaces
    by SH.Madadpour on February 6, 2026 at 10:23 am

    How can I display the intersection of the following two surfaces in LaTeX? I have used the following codes as a default but I am not getting acceptable output. Is it possible to create a form to find its intersection points in LaTeX? Thanks a lot. \documentclass[border=3.14mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{tikzpicture} \begin{axis}[domain=0.01:30,xlabel=$x$] \addplot3[surf,domain={0:1},color=green]{x^3+y^3}; \addplot3[surf,domain={0:1},color=red]{(x*(1-y^2)^(.5)+y*(1-x^2)^(.5))^3}; \end{axis} \end{tikzpicture} \end{document}

  • tikz / xint: Read out (and calc with) fractions from list (or array) with xint or pgfmath
    by cis on February 6, 2026 at 8:45 am

    How can I read out numbers from a list, say \def\pList{0.1, 1/6, 0.25, 0.4} (or array, say \def\pListArray{{\pList}}), with xint? Background: I want to keep fractions, like 1/6 in it's original form (not decimal value 0.1666 here). On the other hand, I need to calc 1-<value> too, and I want, in the case of 1/6 the value 5/6 (=1 - 1/6). I have a main document with a lot of xint content and calculations; therefore, for consistency reasons, it should be done with xint (it's clear that there are other packages or methods for this); and: There must be a method in the xint-package that I can't find in the manual. Does anybody know? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{tikz} \usepackage{xintexpr} \begin{document} \def\pList{0.1, 1/6, 0.25, 0.4}% List \def\pListArray{{\pList}} \section{The pList} \pList \section{pgfmath-test for fraction-readout (bad)} p=\pgfmathprint{\pListArray[0]}, q=\pgfmathprint{1-\pListArray[0]} good. But p=\pgfmathprint{\pListArray[1]}, q=\pgfmathprint{1-\pListArray[1]} bad. \section{xint-test for fractions (good), but how to readout?} p=\xinteval{1/6}, q=\xinteval{1-1/6} \end{document}

  • Make perfect circular diagrams
    by Fran on February 5, 2026 at 12:23 pm

    I know that I can make circular diagrams with the nice smartdiagram package, but arrows do not fit perfectly in a imaginary circle. In fact, the diagram is far from a circle when there are only two or three nodes: \documentclass{standalone} \usepackage{smartdiagram} \begin{document} \smartdiagramset{ connection color=red, module shape= circle, circular distance=2cm, uniform color list=white for 6 items, uniform arrow color=true, arrow color=black} \smartdiagram[circular diagram:clockwise]{foo, bar} \end{document} I know also that there are several examples in this site about making circular diagrams without this package, but translating these examples to diagrams with a different numbers of nodes is complex, so I tried an automated solution with tikz (without really knowing what I was doing, I have to admit) so that I only have to modify a list of nodes in \mylist and little more to obtain the result: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ > = Stealth, every node/.style = {circle, draw, thick, minimum width=1cm, align=center} ] \def\mylist{foo, bar, baz} % play with this \foreach \x [count=\i from 1] in \mylist {\xdef\n{\i}} \def\radio{2cm} % and this if needed \foreach \texto [count=\i from 0] in \mylist{ \pgfmathsetmacro\ang{-\i*360/\n} \node (n\i) at (\ang:\radio) {\texto}; } \foreach \dummy [count=\i from 0] in \mylist{ \pgfmathsetmacro\j{int(mod(\i+1,\n))} \pgfmathsetmacro\angini{-\i*360/\n} \pgfmathsetmacro\angfin{-\j*360/\n} \pgfmathsetmacro\outang{mod(\angini - 90 + 720, 360)} \pgfmathsetmacro\inang {mod(\angfin + 90 + 720, 360)} \draw[->, thick, line width=1.4pt] (n\i) to[out=\outang, in=\inang, looseness=.9] (n\j); % and with the looseness } \end{tikzpicture} \end{document} Mainly it works. The problem is that like in smartdiagram, the arrows don't perfectly follow an imaginary circle, that was the idea behind getting involved in this business. Playing with looseness is possible to correct a bit the curvature of the arrows, but it's tedious and the result is never perfect. So, the result should be ideally near to the image below (that I modified manually in Inkscape) and still require minimal settings to adapt the code to diagrams of n nodes. Fixes of the MWE as well as alternative approaches are welcome. Edit Thank you all for the excellent suggestions. This time, I am truly sorry I can only accept one.

  • LuaLaTeX: changing relative position of letter and its bounding box in math mode
    by Jinwen on February 5, 2026 at 11:26 am

    Using the code adopted from this answer, I am able to modify the position and width of \check, \widehat, etc. for various math characters (as a first step towards answering this earlier question). However, as one can see, the letters are not "centered" in the bounding box. As a result, the spacing between different letters and symbols appears strange. (For example, to make the symbols on top placed at right place, I have to move the letters via xoffset, but then its position relative to the bounding box is not quite appropriate.) With the keywords known to me as in that answer, it seems one could only move the letter, but not its bounding box. Is there some other keywords one could use in order to have more control over this situation? (Actually, just out of curiosity, may I also ask where can one find a list of available keywords/switches that can be tweaked?) Below is a MWE. \documentclass{article} \usepackage{kpfonts-otf} \usepackage{unicode-math} \usepackage{luacode} \begin{luacode*} local adjustments = { ["Asana-Math.otf"] = { ["𝐿"] = { xoffset = 0.03, -- yoffset = -0.5, width = 0.75, -- height = 0.5, -- depth = 0, }, ["𝑀"] = { xoffset = -0.05, -- yoffset = -0.5, width = 0.9, -- height = 0.5, -- depth = 0, }, ["𝑁"] = { xoffset = -0.05, -- yoffset = -0.5, width = 0.9, -- height = 0.5, -- depth = 0, }, } } do local data = io.loaddata(kpse.find_file("font-cff.lmt")) data = data:gsub("<const>", ""):gsub("pack_result_tagged =", "fonts.handlers.otf.pack_result_tagged =") load(data, "font-cff.lua", "t", luaotfload.fontloader)() end luatexbase.add_to_callback( "luaotfload.patch_font", function(tfmdata, specification, font_id) local path = tfmdata.specification.filename local filename = file.basename(path) local by_filename = adjustments[filename] if not by_filename then return end tfmdata.streamprovider = 1 local size = tfmdata.size local units_per_em = tfmdata.units_per_em for character, adjustment in pairs(by_filename) do local codepoint = utf8.codepoint(character) local index = tfmdata.characters[codepoint].index local character = tfmdata.characters[codepoint] local shapes = fonts.hashes.shapes[font_id].glyphs local streams = fonts.hashes.streams[font_id].streams local original_shape = shapes[index] local new_stream = fonts.handlers.otf.pack_result_tagged( original_shape.segments, original_shape.width, (adjustment.xoffset or 0) * units_per_em, -(adjustment.yoffset or 0) * units_per_em ) streams[index] = new_stream for _, dimen in pairs { "width", "height", "depth" } do if adjustment[dimen] then character[dimen] = adjustment[dimen] * size end end end end, "rewrite-characters" ) \end{luacode*} \setmathfont{Asana-Math.otf}[range={it/{Latin,latin},bfit/{Latin,latin},up/num,bfup/num}] \begin{document} \[ \check{L} \check{M} \check{N} \] \[ \widehat{L} \widehat{M} \widehat{N} \] \[ \widetilde{L} \widetilde{M} \widetilde{N} \] \fbox{\( L \)} \fbox{\( \check{L} \)} \fbox{\( \widehat{L} \)} \fbox{\( M \)} \fbox{\( \check{M} \)} \fbox{\( \widehat{M} \)} \fbox{\( N \)} \fbox{\( \check{N} \)} \fbox{\( \widehat{N} \)} \end{document}

  • Looking for a symbol like big \ast
    by Dimitrios ANAGNOSTOU on February 5, 2026 at 9:16 am

    The question is rather simple. How to obtain the following big asterisk symbol? I apologize if it is duplicate. Thank you very much.

  • Left-aligning lines of text to left edge of right-aligned line?
    by Dan Li on February 5, 2026 at 1:36 am

    What I’m trying to accomplish is best illustrated as follows: The first line (“Monday, December 22, 2025, 16:00 EST”) is right-aligned to the text width (possibly by \hfill, but not a hard requirement). The second line (“New York City, New York”) needs to be left-aligned to the left edge of that first line. In other words, the start of the M in “Monday” and N in “New York” are vertically aligned. How can this be done?

  • Improving \widehat, \widetilde, \check etc. with lua code
    by Jinwen on February 4, 2026 at 11:30 am

    For certain (math) font configurations, the result generally look nice but occasionally may produce slightly unpleasant visual result. For example, for \widehat, \widetilde and \check: It would seem that they are not properly centered for certain letters (B, C, E, F, G, H, K, M, N, etc.), and the width is also not quite uniform, compared with visual expectation. Things like this would usually be better fixed directly on the font level. However, before the font got fixed, I know that there exists Lua code that can (manually and temporarily) edit the kerning of math characters, for example, space between letters, space between letter and subscripts/superscripts, etc. Could the same kind of code also modify/redefine the center, the baseline, the character width, etc.? More precisely, I would like to make use of Lua code to adjust the positioning of those symbols (\check, \widehat etc.) on top of the letters (center, and possibly height), and then if possible, also to adjust the (virtual) width of these symbols, so as to make the width of these symbols more pleasant. Hopefully this could be achieved by similar code as below, I just don't know where to find the correct keywords/switches. Here is the lua code I adopted some time ago from this answer that can modify the kerning between letter and scripts. For modifying kerning between symbols, one could see, e.g., this answer. (Unfortunately I do not quite understand how these code work, for example if I change topright to top in wish to change the relative position for hats and tildes, it actually does nothing effective, so this is clearly not the right keyword/switch to use...) Also, I wonder if these lua code can be combined, for example, if I simply put the code for adjusting kerning between symbols/letters inside the code below (within local mathkerns = ...), then nothing effective happens... \directlua { local mathkerns = { ["Asana-Math"] = { [0x1D439] = {% F topright = { {height=0,kern=30}, }, }, [0x1D443] = {% P topright = { {height=0,kern=90}, }, }, [0x1D447] = {% T bottomright = { {height=0,kern=-120}, }, }, [0x1D449] = {% V bottomright = { {height=0,kern=-120}, }, }, [0x1D44A] = {% W bottomright = { {height=0,kern=-30}, }, }, [0x1D453] = {% f bottomright = { {height=0,kern=-135}, }, }, [0x1D44F] = {% b topright = { {height=0,kern=75}, }, }, }, } local function initmathkern(tfmdata) local values = mathkerns[tfmdata.properties.psname] if not values then return end for cp, value in next, values do local tcp = type(cp) if tcp == 'string' then cp = tfmdata.resources.unicodes[cp] end local char = tfmdata.characters[cp] if char then local mathkern = char.mathkerns if not mathkern then mathkern = {} char.mathkerns = mathkern end for corner, v in next, value do mathkern[corner] = v end end end end fonts.constructors.newfeatures'otf'.register{ name = 'mathkern', description = 'Overwrite mathkern values', initializers = { base = initmathkern, }, } } Here is a MWE. \documentclass{article} \usepackage{kpfonts-otf} \usepackage{unicode-math} \setmathfont{KpMath-Sans.otf}[range={\check}] \setmathfont[RawFeature=mathkern]{Asana-Math.otf}[range={it/{Latin,latin},bfit/{Latin,latin},up/num,bfup/num}] \begin{document} \[ \check{A} \check{B} \check{C} \check{D} \check{E} \check{F} \check{G} \check{H} \check{I} \check{J} \check{K} \check{L} \check{M} \check{N} \check{O} \check{P} \check{Q} \check{R} \check{S} \check{T} \check{U} \check{V} \check{W} \check{X} \check{Y} \check{Z} \] \[ \widehat{A} \widehat{B} \widehat{C} \widehat{D} \widehat{E} \widehat{F} \widehat{G} \widehat{H} \widehat{I} \widehat{J} \widehat{K} \widehat{L} \widehat{M} \widehat{N} \widehat{O} \widehat{P} \widehat{Q} \widehat{R} \widehat{S} \widehat{T} \widehat{U} \widehat{V} \widehat{W} \widehat{X} \widehat{Y} \widehat{Z} \] \[ \widetilde{A} \widetilde{B} \widetilde{C} \widetilde{D} \widetilde{E} \widetilde{F} \widetilde{G} \widetilde{H} \widetilde{I} \widetilde{J} \widetilde{K} \widetilde{L} \widetilde{M} \widetilde{N} \widetilde{O} \widetilde{P} \widetilde{Q} \widetilde{R} \widetilde{S} \widetilde{T} \widetilde{U} \widetilde{V} \widetilde{W} \widetilde{X} \widetilde{Y} \widetilde{Z} \] \end{document}

  • How to produce "Ȟ" by mimicking the caron accent, in math mode?
    by Jinwen on February 4, 2026 at 9:21 am

    I would like to produce a Ȟ ("H" with caron accent) in math mode, specifically, for \mathsf. (This is an uncommon notation used for Čech cohomology in a book.) Perhaps this would be easy for pdfLaTeX. However, when using LuaLaTeX, and when this character is not already provided in the font, I can only get very strange output: Is there some way to mimic this caron accent in this situation? More generally, how can one apply this accent to general math symbols? (In the same book, this accent seems to be used to represent the dual objects, e.g., V with caron accent instead of V^{\vee}, possibly to save some space...) (I tried \check, but it looks different and cannot be properly aligned...) \documentclass{article} \usepackage{kpfonts-otf} \usepackage{unicode-math} \begin{document} Ȟ % \v{H} \( \mathsf{Ȟ} \) \( \mathsf{\v{H}} \) \( \check{\mathsf{H}} \) \end{document}

  • How to add fermata symbol to metre package?
    by rensemil on February 3, 2026 at 11:10 am

    I am using the package metre. It has the environment \metra{} used for typesetting latin (and greek) metre notation. This environment has almost all the special characters I need, except one: I need a character that looks somewhat like a fermata 𝄐 but preferrably in the same style as the other metrical symbols. This could, I believe, be achieved by simply taking the character breve that is produced by \documentclass{article} \usepackage[en]{metre} \begin{document} \metra{\a\m\b\bm} \end{document} and have it flipped upside down and a dot put underneath. In a book, this is what it looks like: It's the last symbol of each of the lines in the box. Does anyone know how this could be achieved? I even tried contacting the package's creator but his email address does not seem to exist anymore. My MWE produces the symbols in this picture (the ones inside the brackets): Thanks in advance!

  • How to make nested tabularx work
    by user2609605 on February 3, 2026 at 10:00 am

    Example: \documentclass[a4paper]{article} \overfullrule=10mm \usepackage{tabularx} \begin{document} This document is for experimenting around \texttt{tabularx}. \begin{tabularx}{\linewidth}{|XX}%p{5cm} \begin{minipage}{\linewidth} \begin{tabularx}{\linewidth}{|X}% long text to be \newline long text to be \newline long text to be \newline long text to be \newline long text to be \newline % \the\hsize % \the\linewidth % \the\textwidth long text to be \end{tabularx} \end{minipage} & %\begin{tabularx}{0.25\linewidth}{|X}% 2nd %\end{tabularx} \end{tabularx} \end{document} results in: ! Extra }, or forgotten \endgroup. \TX@trial ...er \tabular \the \toks@ \endtabular } \TX@ckpt \TX@typeout@ {\@s... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ...\csname endtabular*\endcsname } \global \TX@ftn \expandaft... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ... }\the \TX@ftn \ifnum 0=`{\fi } \expandafter \expandafter ... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \@endpbox ...trutbox \par \color@endgroup \egroup \hfil l.80 \end{tabularx} ! Missing \endgroup inserted. <inserted text> \endgroup l.80 \end{tabularx} ... If I replace the inner tabularx by tabular (dropping \linewidth and changing X) it works. I would even like to use without minipage, but that it does not work with minipage, it means that minipage encapsulation is not very strict. I will have a look I think I remember an example where nested tabularx worked.

  • Scoping the value of a l3keys option to the place it is used (part 2)
    by Denis Bitouzé on February 3, 2026 at 8:32 am

    (Sorry again for the vague title of this question (which is a follow-up of another question of mine), I can't think of a more appropriate one.) Suppose I'd like to augment the key set of keytheorems with a Title key which isn't exactly an alias of its title (or its alias name) key but which makes uppercase the first character of its value before passing it to keytheorems' title (or name). In the following MCE, I rely for this on an auxiliary token list which, unfortunately, is not limited to the definition of each defined theorem: only the last value it took is used each time one of the defined theorems is used, so instead of: Abc 1. Foo. Xyz 1. Baz. I get: Xyz 1. Foo. Xyz 1. Baz. How can I work around this problem? \documentclass{article} \usepackage{keytheorems} \ExplSyntaxOn \keys_define:nn { keytheorems/thm } { Title .code:n = { \tl_set:Nn \l_tmpa_tl {\text_titlecase_first:n{#1}} \keys_set:nn { keytheorems/thm } { name=\l_tmpa_tl} } } \NewDocumentCommand{\mynewtheorem}{O{} m} { \newkeytheorem{#2}[#1] } \ExplSyntaxOff \mynewtheorem[Title=abc]{foo} \mynewtheorem[Title=xyz]{baz} \begin{document} \begin{foo} Foo. \end{foo} \begin{baz} Baz. \end{baz} \end{document}

  • Drawing a crystal latice with tikz
    by Nicolas on February 2, 2026 at 9:27 pm

    I'd like to draw crystal structures using TikZ-3Dplot'''. I saw that solutions exist with Asymptote, but for some reason, I can't install it (and I admit I had trouble understanding how the package works). I started with TikZ 3D Plot, which seems to work. I just have one question: I can't keep some lines horizontal, which I find unsightly (I've tried several angle values ​​in the command \tdplotsetmaincoords, but without success). \documentclass{standalone} \usepackage{tikz,tikz-3dplot} \usepackage{xcolor} \begin{document} \tdplotsetmaincoords{75}{10} \begin{tikzpicture}[tdplot_main_coords, scale = 5] % ---- Tracé des traits du réseau ---- \draw[thin] (0,0,0) -- (1,0,0) -- (1,1,0) -- (0,1,0) -- (0,0,0); \draw[thin] (0,0,1) -- (1,0,1) -- (1,1,1) -- (0,1,1) -- (0,0,1); \draw[thin] (0,0,0) -- (0,0,1); \draw[thin] (1,0,0) -- (1,0,1); \draw[thin] (1,1,0) -- (1,1,1); \draw[thin] (0,1,0) -- (0,1,1); \tdplottransformmainscreen{0}{0}{0} \shadedraw[tdplot_screen_coords, ball color = blue] (\tdplotresx,\tdplotresy) circle (0.10); \end{tikzpicture} \end{document}

  • Glossaries: Arbitrarily extend text of acronym in parentheses
    by Jipí on February 2, 2026 at 7:39 pm

    glossaries allows one to include text between an acronym and its long-form spell-out in parentheses like this: The \gls{abc}['s] collation This prints as: The Alphabet’s (ABC) collation However, is it possible also to include arbitrary text in the parentheses, not necessarily on first use (as with \gls above; I know there's the key first={} in definitions), but also more generally using \acrfull? This is to avoid e.g. something like The Alphabet (ABC) (cf. John Doe 1985) in favour of The Alphabet (ABC; cf. John Doe 1985) Basically, it looks like what I'm looking for is a way to one-off change the short key of an acronym definition. MWE: \documentclass{article} \usepackage{glossaries} \newacronym{abc}{ABC}{Alphabet} \makeglossaries \begin{document} The \gls{abc}['s] collation\\ The Alphabet (ABC; cf. John Doe 1985) \end{document}

  • How to fade the background image with multiple opacity?
    by Explorer on February 2, 2026 at 5:58 pm

    I have the following code to add background for the document: \documentclass{article} \usepackage{lipsum} \usepackage{geometry} \usepackage{graphicx} \usepackage{tikz,tikzpagenodes} \usetikzlibrary{calc,fadings} \AddToHook{shipout/background}{ \begin{tikzpicture}[remember picture,overlay] \node[ % path fading=north, inner sep=0pt,outer sep=0pt, anchor=south,opacity=.3, ] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % \path[path picture={ % \node[inner sep=0pt,outer sep=0pt,anchor=south,scope fading=south] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % }]; \coordinate (L) at ($(current page.north west)!.5! (current page text area.north west)$); \coordinate (R) at ($(current page.south east)!.5! (current page text area.south east)$); \fill[white,opacity=.5] (L) rectangle (R); \end{tikzpicture} } \begin{document} \lipsum[1-6] \end{document} It produced: However, the intersection border's color transformation is too sharp! I want the image could smoothly fade to white, with multiple opacity, I have consulted this link, but it doesn't work. The bg.png could be accessed as below(maybe example-image is okay, but its background is pure gray, I would prefer to show that on bg.png):

  • How to resume an enumitem list at lower level
    by mm96 on February 2, 2026 at 4:52 pm

    Similar to this question: similar question I don't know, why the 'resume*=series' approach does not work here. \documentclass{scrartcl} \usepackage{enumitem} \begin{document} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[leftmargin=*] \item asdfg \item afhaf \begin{enumerate}[series=_test] \item adslfa \item adsfadsf \end{enumerate} \end{enumerate} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[resume*=_test] \item adfa \end{enumerate} \end{document}

  • Bug or feature: unexpected behavior of \bar with subscript first and superscript second
    by user470904 on February 2, 2026 at 1:28 pm

    As a physicist, I often need to typeset tensor indices where it matters whether the subscript is to the left or to the right of the superscript. My usual solution is to use {t_A}^B, which puts the superscript B to the right of the subscript A, compared to t_A^B which puts the superscript B vertically aligned with the subscript A. However, I recently noticed that if I use \bar{t} or \tilde{t} instead of t above, the output no longer differs whether I enclose the (xxx)_A part with braces or not. But, \overline{t} still behaves as I expect. Then I tried \widetilde{t}, which still ignores the braces. Is this a bug or a feature? If it's a feature, how should I classify which commands ignore the braces and which do not? In particular, is there a "tilde" command that behaves like \overline that can put the superscript to the right of the subscript? Minimal working example: \documentclass{article} \begin{document} \begin{equation} \begin{array}{lllll} t_A^B & \tilde{t}_A^B & \widetilde{t}_A^B & \bar{t}_A^B & \overline{t}_A^B \\ {t_A}^B & {\tilde{t}_A}^B & {\widetilde{t}_A}^B & {\bar{t}_A}^B & {\overline{t}_A}^B \end{array} \end{equation} \end{document} Output: