• tikz: using the pos key to place nodes along a plot
    by Jasper on January 11, 2026 at 7:39 pm

    In this tikz MWE, why is the node placement not even close to pos=0.7 on a plotted curve? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain = 0:2, samples = 100, variable = \y ] plot (\y*\y,\y) node[pos = 0.7, above left] {\(x=y^2\)} ; \end{tikzpicture} \end{document}

  • How get ISO math style with lua-unicode-math package?
    by murray on January 11, 2026 at 12:26 am

    The commented-out line in the source below, if used instead of the line preceding it, produces ISO-style for upper-case Greek math letters, namely, Italic insead of upright. How does one get the same result with lua-unicode-math instead of just unicode-math? % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage{fontspec,lua-unicode-math} %\usepackage[math-style=ISO]{unicode-math} % Italic upper-case Greek math \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] \begin{document} $a, z, B, X, \quad \alpha, \beta, \Gamma, \Xi $ \end{document}

  • Redefine `$...$` to `\(...\)`
    by weisj on January 10, 2026 at 2:44 pm

    The mathtools package can automatically insert italics correction when using \(...\) for inline math mode. See this answer. However, I much prefer $...$ for inline math as I find it more readable and comfortable to type on my keyboard layout. I am currently using the following hack to keep using the $...$ syntax while preserving the italics correction. \catcode`\$=13% \def$#1${\(#1\)}% I haven't had issues with it in my current document, but I was wondering whether there are reasons this might be a bad idea. I would image that if this was harmless the mathtools package would use it to also patch the $...$ syntax for the mathic feature. So my question is: Is this safe and are there any caveats I might be overseeing?

  • circuitikz: how to get all in the same line width thickness
    by cis on January 9, 2026 at 1:37 pm

    Is there an easy way to get all in the same line width thickness? I tried to calc some things but I do not think this was correct: \pgfmathsetlengthmacro\lw{2.1pt}% wanted linewidth (circuitikz default 0.8pt) \pgfmathsetlengthmacro\lwc{0.8pt}% circuitikz default linewidth 0.8pt % ----> could this be read out somehow? \pgfmathsetmacro\th{\lwc/\lw}% needed bipoles/thickness % ---> do not think, this is correct \documentclass[margin=5pt]{standalone} \usepackage{tikz} \usepackage[]{circuitikz} %\ctikzset{bipoles/thickness=3} \pgfmathsetlengthmacro\lw{2.1pt}% wanted linewidth (circuitikz default 0.8pt) \pgfmathsetlengthmacro\lwc{0.8pt}% circuitikz default linewidth 0.8pt % ----> could this be read out somehow? \pgfmathsetmacro\th{\lwc/\lw}% needed bipoles/thickness % ---> do not think, this is correct \begin{document} \begin{tikzpicture}[european, line width=\lw, circuitikz/bipoles/thickness=\th,% default 2 %circuitikz/sources/symbol/thickness=\th,% default 1 ] \draw (0,3) to [sinusoidal voltage source, v=$u(t)$, ] (0,0); \draw (0,3) to[C=$C$] (4,3) to[resistor={$R$}] (4,0) to[battery1, invert] (0,0); \node[align=left, anchor=north west, fill=yellow!25] at (0,-1) { \textbf{Values}: \\ lw: \lw \\ th: \th \\ bipoles/thickness: \ctikzvalof{bipoles/thickness} \\ circuitikz/sources/symbol/thickness: \ctikzvalof{circuitikz/sources/symbol/thickness} ? \\ ...... }; \end{tikzpicture} \end{document}

  • Rafael Bombelli's mathematical power notation
    by Eff on January 9, 2026 at 12:02 am

    In the 1572 algebra book L'Algebra by Rafael Bombelli, he uses his own notation for powers. I want to reproduce this notation in LaTeX. Below is a screenshot from the book that shows how he wrote to the sixth power, the fifth power, etc. In general, x to the power of n is written as n above a kind of circular arc. I have found a good example where it is made nicely in LaTeX. But I don't know how to reproduce it. Can anyone offer a solution to writing this power notation in LaTeX?

  • PDF/A and PDF/X compatibility: Color questions
    by schade96 on January 8, 2026 at 5:43 pm

    In my previous question I attempted to make my PDF PDF/A-2B and PDF/X-4 conform. I went a bit further with this and discovered another issue: PDF/X-4 does not support bookmarks, which I definitely want. As a consequence, I actually need PDF/X-6 (which also seems to make external links easier to handle) and thus, because it is based on PDF 2.0, also need to bump the A-conformity to PDF/A-4. This is my current version of the latex code: \documentclass[a4paper]{article} \RequirePackage{pdfmanagement} % Bug patch, see https://github.com/latex3/pdfresources/issues/110#issue-3789290014 \ExplSyntaxOn \keys_define:nn { document / metadata } { _pdfstandard / X-6 .code:n = { \AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6} \__pdfmeta_xmp_add_pdfxid: } } \ExplSyntaxOff % Now set the actual metadata \SetKeys[document/metadata]{ pdfstandard = {A-4,X-6}, lang = en-US, pdfversion = 2.0, colorprofiles = { A = FOGRA39L_coated.icc,% X = FOGRA39L_coated.icc% } } % For now, keep it RGB. \usepackage[rgb]{xcolor} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{fontspec} \usepackage{hyperref} \hypersetup{ colorlinks=true,% urlcolor={blue},% linkcolor={blue},% citecolor={blue},% pdfauthor={me},% pdftitle={pdfxtest},% pdfsubject={subject},% pdfversionid={someversion},% pdfkeywords={a,b,c}% } \ExplSyntaxOn \pdfmeta_xmp_add:n{<xmpMM:RenditionClass>default</xmpMM:RenditionClass>} \__pdfmeta_xmp_schema_new:nnn {Adobe~PDF~Schema} {pdf} {http://ns.adobe.com/pdf/1.3/} \__pdfmeta_xmp_property_new:nnnnn {pdf} {Trapped} {Text} {internal} {Indicates~whether~the~document~has~been~trapped.} \pdfmeta_xmp_add:n{<pdf:Trapped>True</pdf:Trapped>} \pdfmanagement_add:nnn{Info}{Trapped}{/True} % Don't forget to set the page size to A4. \pdfmanagement_add:nnx{Page}{TrimBox} {[0~0~595.276~841.89]} \pdfmanagement_add:nnx{Page}{BleedBox} {[0~0~595.276~841.89]} \ExplSyntaxOff \begin{document} document \\ \href{mailto:nobody}{mail to nobody} % % Construct the image for example like this: % python3 -c "import matplotlib.pyplot as p; p.scatter([0, 1], [0, 1], s=1, rasterized=True); p.savefig('testimage.pgf')" % sed -i '' 's/interpolate=true/interpolate=false/g' testimage.pgf \par\input{testimage.pgf} \end{document} As shown above, the final document only has one remaining compliance issue with the colors: RGB used but PDF/X OutputIntent not RGB If the destination profile of the OutputIntent in a PDF is not RGB, PDF/X prohibits that an object uses DeviceRGB. for all instances where any color is used. This applies to both PDF/A and PDF/X compliance. First of all, it seems that RGB is not generally forbidden by PDF/X, as long it is not DeviceRGB. So the first question is: Do I have an "alternative RGB" available here that is supported by (lua)latex? Sidenote: If it turns out there is no way around CMYK, the question is how I would convert the png files in a compatible way. One solution I found was converting them to pdfs using imagemagick: $ magick image.png -profile FOGRA39L_coated.icc -colorspace CMYK output.pdf More generally, one issue here is: For PDF/X-6 (and predecessors), the color profile must be a prtr (Printer) color profile. The second question is therefore: Are there any RGB printer profiles? I would assume that, if there are any, that these are very rare. Thus, for the moment, I need to assume that I need to make all colors CMYK and load \usepackage[cmyk]{xcolor} instead of \usepackage[rgb]{xcolor} or \usepackage{xcolor}. This however means that all colors now look different. This is of course somewhat expected, since those are different color models. However, I find that the difference is a bit too obvious. Consider this example: \documentclass{article} % Testing these two options: %\usepackage[rgb]{xcolor} \usepackage[cmyk]{xcolor} \definecolor{bluecmyk}{cmyk}{1, 1, 0, 0} \definecolor{bluergb}{rgb}{0, 0, 1} \begin{document} \color{blue}{\rule{1cm}{1cm}} \color{bluecmyk}{\rule{1cm}{1cm}} \color{bluergb}{\rule{1cm}{1cm}} \end{document} which becomes these two: As I understand it, what happens here and how close these colors match is very much device-dependent. After all, the monitor I am viewing this on is ultimately RGB. Is there anything I can do to get a better match between these two colors that I am missing? My ultimate goal is to keep the on-screen colors as close to the ones I am seeing with RGB. Of course, when printed, it may be that the colors are not fully reproduced, since printers are CMYK. Still, the digital version is slightly more important here. In principle I would be open to recompute all colors manually in terms of CMYK if necessary, but then I need to know if I can get a closer match.

  • How can I make a multi-line table structure with repeated parameter values more visually appealing?
    by mingabua on January 7, 2026 at 6:07 pm

    I have the following table. I am particularly interested in columns 1-2. There, I have three different values of \mathcal{T} for each value of \mathcal{J}. Unfortunately, I find the current display somewhat meaningless. How can I optimize it and make it look better? \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs} \usepackage{multirow} \usepackage{array} \usepackage{rotating} % für sidewaystable \usepackage{lipsum} % für Blindtext \usepackage{geometry} \geometry{a4paper, margin=2.5cm} \begin{document} \section{Introduction} \lipsum[1-3] \begin{sidewaystable}[p] \centering \footnotesize \caption{Comprehensive performance analysis over 25 scenarios per instance. Values denote: \textbf{Min / Median / Max} (top) and \textbf{Std. Dev.} (bottom). Time components MP, SP, Heur, Branch are reported as percentages of Total Time.} \label{tab:comp_results_comprehensive} \setlength{\tabcolsep}{2pt} \renewcommand{\arraystretch}{1.3} \begin{tabular}{cc cc c cccccc c ccc c ccccc} \toprule % HEADER ROW 1 \multicolumn{2}{c}{\textbf{Inst.}} & \multicolumn{2}{c}{\textbf{Compact}} & & \multicolumn{6}{c}{\textbf{B\&P: Solution \& Reliability}} & & \multicolumn{3}{c}{\textbf{B\&P: Tree}} & & \multicolumn{5}{c}{\textbf{B\&P: Time Breakdown}} \\ \cmidrule(r){1-2} \cmidrule(lr){3-4} \cmidrule(lr){6-11} \cmidrule(lr){13-15} \cmidrule(l){17-21} % HEADER ROW 2 $|\mathcal{J}|$ & $|\mathcal{T}|$ & Time [s] & Gap [\%] & & $t_{tot}$ [s] & Gap [\%] & $t_{1st}$ [s] & $N_{Sol}$ & Opt? & Root Int. & & $D_{max}$ & Root Gap & Nodes & & $t_{MP} [\%]$ & $t_{SP} [\%]$ & $t_{Heur} [\%]$ & $t_{Root} [s]$ & $t_{Br} [\%]$ \\ \midrule % --- Block J = 5 --- \multirow{3}{*}{5} & 7 & \shortstack{10/12/15\\1.2} & \shortstack{0/0/0\\0} & & \shortstack{2/3/5\\0.8} & \shortstack{0/0/0\\0} & \shortstack{0.5/0.8/1\\0.2} & \shortstack{2/3/5\\1.1} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.2} & & \shortstack{1/1/1\\0} & \shortstack{0.5/1/2\\0.4} & \shortstack{1/1/1\\0} & & \shortstack{5/10/15\\2} & \shortstack{40/45/50\\3} & \shortstack{10/15/20\\4} & \shortstack{1/2/3\\0.5} & \shortstack{0/0/0\\0} \\ \addlinespace & 14 & \shortstack{40/45/55\\4.1} & \shortstack{0/0/0\\0} & & \shortstack{6/8/11\\1.5} & \shortstack{0/0/0\\0} & \shortstack{1/2/3\\0.5} & \shortstack{3/5/8\\1.5} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/5\\1} & \shortstack{0.2/0.8/1.5\\0.3} & \shortstack{1/5/12\\3} & & \shortstack{8/12/18\\3} & \shortstack{55/60/65\\4} & \shortstack{10/12/15\\2} & \shortstack{3/4/5\\1} & \shortstack{1/2/5\\1} \\ \addlinespace & 28 & \shortstack{150/180/210\\15} & \shortstack{0/0/0\\0} & & \shortstack{18/22/29\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{5/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/8/12\\3} & \shortstack{0/0.5/1\\0.2} & \shortstack{10/25/45\\10} & & \shortstack{10/15/20\\3} & \shortstack{70/75/80\\5} & \shortstack{5/8/10\\2} & \shortstack{10/12/15\\2} & \shortstack{2/5/8\\2} \\ \midrule % --- Block J = 10 (Base Case) --- \multirow{3}{*}{10} & 7 & \shortstack{90/110/140\\12} & \shortstack{0/0/0\\0} & & \shortstack{10/12/18\\2} & \shortstack{0/0/0\\0} & \shortstack{2/3/5\\1} & \shortstack{4/6/9\\2} & \shortstack{1/1/1\\0} & \shortstack{0/0/1\\0.1} & & \shortstack{1/1/3\\0.5} & \shortstack{1/1.5/2.5\\0.5} & \shortstack{1/1/3\\0.5} & & \shortstack{15/20/25\\4} & \shortstack{35/40/55\\6} & \shortstack{15/20/25\\3} & \shortstack{5/6/8\\1} & \shortstack{0/1/2\\0.5} \\ \addlinespace & 14 & \shortstack{1.1k/1.2k/1.5k\\150} & \shortstack{0/0/2\\0.5} & & \shortstack{35/45/60\\6} & \shortstack{0/0/0\\0} & \shortstack{10/15/20\\4} & \shortstack{8/12/18\\4} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{5/10/15\\4} & \shortstack{0.5/1.1/1.8\\0.4} & \shortstack{20/55/110\\25} & & \shortstack{12/18/22\\4} & \shortstack{50/58/65\\5} & \shortstack{8/10/15\\2} & \shortstack{15/20/25\\4} & \shortstack{5/10/15\\3} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{2/4.5/8\\1.8} & & \shortstack{95/115/145\\14} & \shortstack{0/0/0\\0} & \shortstack{30/45/60\\10} & \shortstack{15/25/40\\8} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{20/35/60\\12} & \shortstack{0.1/0.4/0.9\\0.2} & \shortstack{150/320/580\\110} & & \shortstack{10/15/20\\3} & \shortstack{65/72/85\\8} & \shortstack{2/5/8\\2} & \shortstack{40/55/70\\10} & \shortstack{10/15/20\\5} \\ \midrule % --- Block J = 15 --- \multirow{3}{*}{15} & 7 & \shortstack{480/540/650\\55} & \shortstack{0/0/1.5\\0.3} & & \shortstack{22/29/40\\4} & \shortstack{0/0/0\\0} & \shortstack{5/8/12\\2} & \shortstack{6/10/15\\3} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{1/3/8\\2} & \shortstack{1.5/2.2/3.5\\0.8} & \shortstack{1/5/12\\3} & & \shortstack{20/25/30\\4} & \shortstack{40/45/55\\4} & \shortstack{15/20/25\\3} & \shortstack{10/12/18\\3} & \shortstack{1/3/5\\1} \\ \addlinespace & 14 & \shortstack{TL/TL/TL\\0} & \shortstack{5/8/12\\2} & & \shortstack{80/98/130\\12} & \shortstack{0/0/0\\0} & \shortstack{25/35/50\\8} & \shortstack{20/30/50\\10} & \shortstack{1/1/1\\0} & \shortstack{0/0/0\\0} & & \shortstack{10/25/45\\10} & \shortstack{0.8/1.5/2.2\\0.6} & \shortstack{80/150/280\\45} & & \shortstack{10/15/20\\3} & \shortstack{55/65/75\\7} & \shortstack{5/8/12\\2} & \shortstack{35/45/60\\8} & \shortstack{8/12/18\\4} \\ \addlinespace & 28 & \shortstack{TL/TL/TL\\0} & \shortstack{12/18/25\\4} & & \shortstack{210/245/320\\35} & \shortstack{0/0/0.1\\0.02} & \shortstack{80/120/180\\25} & \shortstack{40/60/90\\15} & \shortstack{0/1/1\\0.2} & \shortstack{0/0/0\\0} & & \shortstack{45/80/120\\25} & \shortstack{0.2/0.6/1.2\\0.3} & \shortstack{500/1.2k/3.5k\\850} & & \shortstack{5/10/15\\3} & \shortstack{70/80/90\\9} & \shortstack{1/3/5\\1} & \shortstack{80/110/150\\20} & \shortstack{15/20/25\\5} \\ \bottomrule \end{tabular} \end{sidewaystable} \section{Results Discussion} \lipsum[4-6] \section{Conclusion} \lipsum[7-8] \end{document}

  • Is that possible to balance two columns `longtblr` with `tabularray` package?
    by Explorer on January 6, 2026 at 12:19 pm

    This question is nearly the same as this: \documentclass[twocolumn]{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{cuted} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \begin{strip} \lipsum[2] \bigskip \hrule \bigskip \end{strip} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]}} 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{document} which gives: Noted that I want to typeset something like a university transcript. Thus, unbalanced layout is not elegant, is that possible to hack with some tricks? Edited: longtblr solution conflicted with multicol: \documentclass{article} \usepackage[showframe,paperheight=15cm]{geometry} \usepackage{lipsum} \usepackage{multicol} \usepackage{tabularray} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked} \begin{document} \lipsum[2] \bigskip \hrule \bigskip \begin{multicols}{2} \begin{mytblr}{hlines,vlines,width=\linewidth,colspec={X[c]X[c]X[c]},rowhead=1} Header 1 & Header 2 & Header 3 \\ 1alpha & beta & gamma \\ 2alpha & beta & gamma \\ 3alpha & beta & gamma \\ 4alpha & beta & gamma \\ 5alpha & beta & gamma \\ 6alpha & beta & gamma \\ 7alpha & beta & gamma \\ 8alpha & beta & gamma \\ 9alpha & beta & gamma \\ 10alpha & beta & gamma \\ 11alpha & beta & gamma \\ 12alpha & beta & gamma \\ 13alpha & beta & gamma \\ 14alpha & beta & gamma \\ 15alpha & beta & gamma \\ 16alpha & beta & gamma \\ 17alpha & beta & gamma \\ 18alpha & beta & gamma \\ 19alpha & beta & gamma \\ 20alpha & beta & gamma \\ 21alpha & beta & gamma \\ 22alpha & beta & gamma \\ 23alpha & beta & gamma \\ 24alpha & beta & gamma \\ 25alpha & beta & gamma \\ 26alpha & beta & gamma \\ 27alpha & beta & gamma \\ 28alpha & beta & gamma \\ 29alpha & beta & gamma \\ 30alpha & beta & gamma \\ 31alpha & beta & gamma \\ 32alpha & beta & gamma \\ 33alpha & beta & gamma \\ 34alpha & beta & gamma \\ 35alpha & beta & gamma \\ 36alpha & beta & gamma \\ 37alpha & beta & gamma \\ 38alpha & beta & gamma \\ 39alpha & beta & gamma \\ 40alpha & beta & gamma \\ 41alpha & beta & gamma \\ 42alpha & beta & gamma \\ 43alpha & beta & gamma \\ 44alpha & beta & gamma \\ 45alpha & beta & gamma \\ 46alpha & beta & gamma \\ 47alpha & beta & gamma \\ 48alpha & beta & gamma \\ 49alpha & beta & gamma \\ 50alpha & beta & gamma \\ \end{mytblr} \end{multicols} \end{document} It failed resulted: Edited Again: Learning from David's comment, and this 13-years-old solution, I still found some drawbacks with longtable: \documentclass[11pt, a4paper]{article} \usepackage[paperheight=18cm]{geometry} \usepackage{lipsum} \usepackage{longtable} \usepackage{multicol} \newsavebox\ltmcbox \newcounter{entryno} \setcounter{entryno}{1} \def\tabline{Test & \the\value{entryno} & Description\addtocounter{entryno}{1}\\\hline} \def\tablines{\tabline\tabline\tabline\tabline} \def\tabliness{\tablines\tablines\tablines\tablines} \begin{document} \section{Test} \lipsum[1] \begin{multicols}{2} \medskip \setbox\ltmcbox\vbox{ \makeatletter\col@number\@ne \begin{longtable}{|l|l|l|} \hline \tabliness\tabliness\tabliness\tabliness\tabliness\tabliness \end{longtable} \unskip \unpenalty \unpenalty} \unvbox\ltmcbox \medskip \end{multicols} \lipsum[2] \end{document}

  • Where to post / read news about TeX/ LaTeX and similar?
    by topskip on January 5, 2026 at 9:52 am

    This is not a technical question about LaTeX or TeX. Imagine I have created a cool LaTeX package or a new TeX engine or something similar. Is there a good place to post this? I see special mailing lists (for example tex-live), these don't seem to fit. Where can / should I place announcements like this?

  • circuitikz: set 'rounded corners' of a 'oscopeshape' to a smaler value
    by cis on January 4, 2026 at 11:23 pm

    Due to a chat-talk with @Rmano, I asked myself wether there is a methode to set the rounded corners of a oscopeshape to 0pt or to a very small value. The rounded corners can become weird, if I set a small scale: \documentclass[margin=10pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[font=\footnotesize] \node[oscopeshape] (A){scale=1}; \node[oscopeshape, right of=A, scale=0.5](B) {scale=0.5}; \node[oscopeshape, right of=B, scale=0.35] {scale=0.35}; \end{circuitikz} \end{document}

  • Is there an incompatibility between the lettrine and beamer packages?
    by AndréC on January 4, 2026 at 8:24 pm

    The sentence below wraps to a new line too soon: the word "rapporteur" should not be on a new line. This problem occurs whenever the sentence is too long to fit on a single line. \documentclass[aspectratio=1610,12pt,french]{beamer} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage[locale=FR]{siunitx} \usepackage{lettrine} \usepackage{tikz} \usetikzlibrary{angles} \begin{document} \begin{frame}{} \lettrine[lraise=.25]{S}{ans} utiliser de rapporteur donner la mesure de chacun des angles sachant que $\widehat{xOz}=\ang{60}$. \bigskip \lettrine[lraise=.25]{S}{ans} utiliser de rapporteur donner la mesure de chacun des angles sachant que l'angle xOz mesure 60 degrés. \end{frame} \end{document} Here's what's displayed:

  • circuitikz: internal node annotations (maybe 'path picture'?) to a styled 'muxdemux'
    by cis on January 3, 2026 at 3:35 pm

    I need a styled muxdemux like this. I asked myself: is it possible to get some annotations with path picture here (as a style addition)? For example a line and a node, which I only was able to add outside the style definition in the usual way. PS: Using a pic is clear; but that's a different topic. \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \ctikzset{muxdemux/outer label font={\tiny\ttfamily\color{blue}}} \tikzset{ mychip/.style={muxdemux, muxdemux def={ Lh=4, Rh=4, w=6,% sizes NR=0, NL=0, NB=3, NT=3,}, muxdemux label={ T1=T1, T2=T2, T3=T3, B1=B1, B2=B2, B3=B3, BR1=br1, BL1=bl1, BR2=br2, BL2=bl2, BR3=br3, BL3=bl3,% TR1=tr1, TL1=tl1, TR2=tr2, TL2=tl2, TR3=tr3, TL3=tl3,% }, alias=FG, % Does not have any effect ====================== path picture={%% \draw[red] (FG.bbpin 2) -- (FG.btpin 1) node[font=\tiny, align=center, midway, below, sloped] {internal annotation \\ works not}; },%% }, } \node[mychip]{chip}; \draw[brown] (FG.bbpin 2) -- (FG.btpin 3) node[font=\tiny, align=center, midway, below, sloped] {external annotation \\ works}; \end{circuitikz} \end{document}

  • How can I make the marginnote appear on the margin side of the column they were called from in a two-column book? [closed]
    by stefaniecg on January 2, 2026 at 11:39 am

    My problem is that in a two-column book, when the marginnote is placed as the last word (or near the last word) of the left column line end, the note jumps to the right margin instead of being placed on the left margin. How can I make the marginnote appear on the margin side of the column they were called from in a two-column book? \documentclass{book} \usepackage{lipsum} \usepackage{geometry} \usepackage{marginnote} \begin{document} \newgeometry{left=20mm,right=20mm,top=20mm,bottom=20mm,twocolumn=true,marginparwidth=15mm} \edef\marginnotetextwidth{\the\textwidth} \chapter{A short story} Lorem ipsum ipsum \marginnote{ok1} OK1 dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, \marginnote{wrong1} WRONG1 placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. \marginnote{wrong2} WRONG2 Mauris utleo. Cras viverra metus rhoncus sem. Nulla et lectusvestibulum urna fringilla ultrices. Phasellus eu tellussit amet tortor gravida placerat. Integer sapien est,iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. \marginnote{ok2} OK2 Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollisac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \lipsum[1-3] Lorem ipsum dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam \marginnote{ok3} OK3 arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \marginnote{ok4} OK4 Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris utleo. Cras \marginnote{ok5} OK5 viverra metus rhoncus sem. Nulla et lectusvestibulum urna fringilla ultrices. Phasellus eu tellussit amet tortor gravida placerat. Integer sapien est,iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollisac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus \marginnote{ok6} OK6. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \end{document}

  • How to get spaced dots in unicode-math
    by dedded on December 31, 2025 at 3:10 pm

    The unicode-math package re-defines ellipsis to be the ellipsis character in whatever font you're using, instead of spaced dots. This looks bad in my opinion, and violates the guidance on ellipses in every style guide I own. A solution for \ldots is provided here: variations-in-ldots. But that solution does not fix \cdots, \vdots, or \ddots. I managed to find a solution for \cdots that works in this MWE, but seems to fail in other instances that I haven't figured out a reliable way to reproduce. And I can't figure out a solution for \vdots or \ddots at all. \documentclass{article} \usepackage{unicode-math} \AtBeginDocument{ % From https://tex.stackexchange.com/questions/120627/variations-in-ldots \renewcommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}} \renewcommand\cdots{\mathinner{\cdotp\cdotp\cdotp}} % sometimes works %\renewcommand\vdots{\mathinner{\vdotp\vdotp\vdotp}} % doesn't work %\renewcommand\ddots{\mathinner{\ddotp\ddotp\ddotp}} % doesn't work } \begin{document} $\dots, \ldots, \cdots, \vdots, \ddots$ \end{document} Found an example of where my solution for \cdots didn't work. It's when \dots is used instead of \cdots explicitly to centrally place dots: \documentclass{article} \usepackage{unicode-math} \AtBeginDocument{ \renewcommand\mathellipsis{\mathinner{\ldotp\ldotp\ldotp}} \renewcommand\cdots{\mathinner{\cdotp\cdotp\cdotp}} % sometimes works } \begin{document} $x+\dots+ y$ % Do not get spaced dots $x+\cdots+ y$ % Do get spaced dots \end{document}

  • Bizarre interaction between `microtype` package and \eqref macro
    by John Pardon on December 30, 2025 at 11:14 pm

    I would have thought that if I declare \let\stdeqref\eqref, then the \stdeqref macro and the \eqref macro would be interchangeable. But here is an example where it fails! Moreover, this failure is (somehow) caused by the microtype package?! What is going on, and how to fix it? \documentclass{article} \usepackage{microtype} \usepackage{amsmath} \let\stdeqref\eqref \begin{document} \begin{equation}\label{a} A \end{equation} This is good spacing: \eqref{a}\allowbreak\eqref{a} This is bad spacing: \stdeqref{a}\allowbreak\stdeqref{a} But the bad spacing becomes good if we remove microtype! \end{document} The reason I'm asking is that I would like to redefine the \eqref macro in a way which uses the usual \eqref macro as a subcomponent, via the usual strategy I've seen time and time again on this site: \let\stdeqref\eqref \renewcommand\eqref[1]{Something fancy containing \stdeqref{#1} etc.} but that doesn't work anymore if \let isn't behaving as expected . . .

  • Use some characters from the text font instead of the corresponding ones from mtpro2
    by ncant on December 29, 2025 at 2:10 pm

    I'm typesetting my math document in Times New Roman using XeLaTeX and the fontspec package. I'm using mtpro2 as the math font, but I've noticed that certain letters, such as u, v and w, look quite different from their TNR italic counterparts (maybe because it's advertised as a Times-compatible font). Considering I'm already using the fontspec package, I tried ditching mtpro2 entirely and using other math fonts. I consulted the LaTeX Stack Exchange master list of maths fonts and tried XITS Math, TeX Gyre Termes Math and STIX Two Math. However, these fonts lack some features that I really like about mtpro2, such as round brackets (especially for matrices) and the letter z identical to the letter z in TNR. mtpro2 is here to stay. Next, I found the 'mathastext' package, which enables alphanumeric glyphs from the text font to be used in maths environments. For example, \usepackage[basic, italic]{mathastext} replaces all the alphanumeric characters in the maths font with the corresponding characters in the text font. However, this approach led me to another issue: the spacing between letters is awful, especially the subscripted ones. Since my only issue is with the letters u, v, and w, is there a way to just replace those three and use the rest of the mtpro2 glyphs? The code I'm using for my document is really bog standard: \documentclass{memoir} % Throw an error if this is not XeLaTeX. \usepackage{ifxetex} \RequireXeTeX \usepackage[lite]{mtpro2} \usepackage[no-math]{fontspec} \setmainfont{Times New Roman} \begin{document} \end{document} Any help would be appreciated.

  • Overleaf error regarding \verb
    by DavidIsDumb on December 28, 2025 at 2:31 am

    I'm writing some math stuff using overleaf but it broke mysteriously. I wrote: \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[shortlabels]{enumitem} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{epigraph} \usepackage[colorlinks]{hyperref} \usepackage{microtype} \usepackage{mathtools} \usepackage[headsepline]{scrlayer-scrpage} \usepackage{thmtools} \usepackage{listings} \mdfdefinestyle{mdgreenbox} \mdfdefinestyle{mdredbox}{frametitlefont=\bfseries,innerbottommargin=8pt, nobreak=true,backgroundcolor=Salmon!5,linecolor=RawSienna,} \declaretheoremstyle[headfont=\bfseries\color{RawSienna}, mdframed={style=mdredbox},headpunct={\\[3pt]},postheadspace=0pt,]{thmredbox} \declaretheorem[style=thmredbox,name=Problem]{problem} \begin{document} \begin{problem} \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} \end{document} When I compile there is no error message, but the last line has a red circle saying "unexpected \end{problem} after $" and the line before that says "unclosed $ found at \end{problem}". All the other probs with this format didn't break, so there's probably no problem with the \end. However, I found that if I type \begin{problem}[some text here] Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} instead for the problem part nothing happens! No error if I delete one line. Can somebody explain what is happening? Edit: Also in the first case autocompile doesn't work, saying that my code has errors that must be fixed first before that can run, but for the second case autocompile works. I also found out that autocompile works when I type: \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0.) \end{problem} for the problem, but the last line has the following error message: LaTeX Error: Command \end{mdframed} invalid in math mode. \ (button saying suggest fix using AI) \ Missing $ inserted. \ Missing } inserted. \ Extra }, or forgotten \endgroup.

  • aligned inside tikz-cd
    by Jinwen on December 27, 2025 at 9:11 am

    I would like to reproduce the following diagram in Yves André's book: However, it is unclear to me how to produce the multi-line node inside the diagram. Currently, what I could achieve is this: However, the alignment inside aligned is not working the way I expected. May I ask what is the correct way to do this? Thanks! Below is a MWE. \documentclass{article} \usepackage{mathtools,amssymb} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} {\{\,{\text{\( k \)-schémas étales finis}}\,\}} & {\begin{aligned} &\{\, \text{ensembles finis munis}\\ &\quad\text{d'une action continue de \( \mathrm{Gal}(\overline{k}/k) \)}\,\} \end{aligned}} \\ {AM(k)_{\mathbb{Q}}} & {\begin{aligned} &\{\, \text{\( \mathbb{Q} \)‑espaces vectoriels de dimension finie munis}\\ &\quad\text{d'une action linéaire continue de \( \mathrm{Gal}(\overline{k}/k) \)}\,\} \end{aligned}} \arrow["\sim", from=1-1, to=1-2] \arrow["{\mathfrak{h}}"', from=1-1, to=2-1] \arrow["{\mathfrak{l}}", from=1-2, to=2-2] \arrow["\sim", from=2-1, to=2-2] \end{tikzcd} \] \end{document}

  • Don't get decimal output with luacas
    by Fa-Mat on December 26, 2025 at 10:38 am

    First of all "Merry Christmas" to everyone. I'm trying to get decimal output with luacas and don't get it. \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \directlua{ a=3 b=8 c=a/b tex.print('$',c,'$') } \end{document} The code above gives the expectet 0.375. Changing to \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ \end{document} gives 3, 8, the fraction 3 over 8, 3 and 8. In the manual there is the funtion :asnumber() given but \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) d=c:asnumber() \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ $\print{d}$ \end{document} gives Lua-Error and the $\print{d}$ is ignored. I also tried something like d=Rational:asnumber(c) or used the funktions ZZ(), QQ() and RR() but without any success. Also $\print{c:asnumber()}$ fails. Trying to print the decimal with $\directlua{tex.print(string.format("\csstring\%.3f",c))}$ gives also a Lua error ('c' is a table but a number is expected by 'string.format()'). I'm not having any ideas how to solve it any more. Thank you for your help.

  • Graph of a projection function
    by Octavius on December 22, 2025 at 9:49 pm

    I have the following code, but I can’t manage to replicate the figure shown in the attached image. Could you help me with the code and provide the figure? Thank you very much. \documentclass[12pt]{article} % --- Márgenes (opcional) --- \usepackage[margin=2.2cm]{geometry} % --- Idioma y acentos --- \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} % --- Matemática y TikZ --- \usepackage{amsmath,amssymb} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta,calc,3d} \pagestyle{empty} \begin{document} \begin{center} % --- TU FIGURA --- \begin{tikzpicture}[ scale=1.15, line cap=round, line join=round, x={(-0.95cm,-0.55cm)}, % Eje X: oblicuo hacia abajo-izquierda y={(1.15cm,0cm)}, % Eje Y: horizontal z={(0cm,1.15cm)} % Eje Z: vertical ] % Colores/estilos \definecolor{axisblue}{RGB}{20,90,130} \tikzset{ axis/.style={very thick, draw=axisblue, -Latex}, proj/.style={dashed, black, line width=0.8pt}, edge/.style={black, line width=0.9pt}, face/.style={draw=black, fill=gray!35, opacity=0.55}, topface/.style={draw=black, fill=gray!25, opacity=0.55}, frontface/.style={draw=black, fill=gray!45, opacity=0.55} } % Ejes \draw[axis] (0,0,0) -- (4.8,0,0) node[below left] {Eje X}; \draw[axis] (0,0,0) -- (0,5.4,0) node[right] {Eje Y}; \draw[axis] (0,0,0) -- (0,0,4.8) node[above] {Eje Z}; % Título \node[anchor=west] at (0.9,2.4,4.0) {\Large Gráfico de $g(x,y)=x$}; % -------- PRISMA 1: x in [0,1], y in [-1,1], altura 1 -------- \def\xa{0}\def\xb{1} \def\ya{-1}\def\yb{1} \def\hA{1} % Vértices base \coordinate (A1) at (\xa,\ya,0); \coordinate (B1) at (\xb,\ya,0); \coordinate (C1) at (\xb,\yb,0); \coordinate (D1) at (\xa,\yb,0); % Vértices top \coordinate (A1t) at (\xa,\ya,\hA); \coordinate (B1t) at (\xb,\ya,\hA); \coordinate (C1t) at (\xb,\yb,\hA); \coordinate (D1t) at (\xa,\yb,\hA); % Proyecciones (sombras) al plano z=0 \draw[proj] (A1) -- (A1t); \draw[proj] (B1) -- (B1t); \draw[proj] (C1) -- (C1t); \draw[proj] (D1) -- (D1t); % Caras visibles \filldraw[frontface] (A1) -- (B1) -- (B1t) -- (A1t) -- cycle; % cara "frontal" \filldraw[face] (B1) -- (C1) -- (C1t) -- (B1t) -- cycle; % cara derecha \filldraw[topface] (A1t) -- (B1t) -- (C1t) -- (D1t) -- cycle; % tapa % Aristas principales \draw[edge] (A1) -- (B1) -- (C1) -- (D1) -- cycle; \draw[edge] (A1t) -- (B1t) -- (C1t) -- (D1t) -- cycle; \draw[edge] (A1) -- (A1t); \draw[edge] (B1) -- (B1t); \draw[edge] (C1) -- (C1t); \draw[edge] (D1) -- (D1t); % Etiquetas \node at (\xa,\ya,\hA) [above left] {$1$}; \node at (0.55,0, -0.02) [below, yshift=-2pt] {$[0,1]\times(-1,1)$}; % -------- PRISMA 2: x in [2,3], y in [-1,1], altura 2 -------- \def\xc{2}\def\xd{3} \def\hB{2} \coordinate (A2) at (\xc,\ya,0); \coordinate (B2) at (\xd,\ya,0); \coordinate (C2) at (\xd,\yb,0); \coordinate (D2) at (\xc,\yb,0); \coordinate (A2t) at (\xc,\ya,\hB); \coordinate (B2t) at (\xd,\ya,\hB); \coordinate (C2t) at (\xd,\yb,\hB); \coordinate (D2t) at (\xc,\yb,\hB); % Proyecciones \draw[proj] (A2) -- (A2t); \draw[proj] (B2) -- (B2t); \draw[proj] (C2) -- (C2t); \draw[proj] (D2) -- (D2t); % Caras \filldraw[frontface] (A2) -- (B2) -- (B2t) -- (A2t) -- cycle; \filldraw[face] (B2) -- (C2) -- (C2t) -- (B2t) -- cycle; \filldraw[topface] (A2t) -- (B2t) -- (C2t) -- (D2t) -- cycle; % Aristas \draw[edge] (A2) -- (B2) -- (C2) -- (D2) -- cycle; \draw[edge] (A2t) -- (B2t) -- (C2t) -- (D2t) -- cycle; \draw[edge] (A2) -- (A2t); \draw[edge] (B2) -- (B2t); \draw[edge] (C2) -- (C2t); \draw[edge] (D2) -- (D2t); % Etiquetas \node at (\xc,\ya,\hB) [above left] {$2$}; \node at (2.55,0,-0.02) [below, yshift=-2pt] {$[2,3]\times(-1,1)$}; % Marcas -1 y 1 sobre eje Y (opcional) \node at (0,-1,0) [below] {$-1$}; \node at (0, 1,0) [below] {$1$}; \end{tikzpicture} \end{center} \end{document}

  • Booktabs cmidrule creates unwanted vertical space
    by profj on December 22, 2025 at 7:30 pm

    I am making the following table using LaTeX. One way to do it is to make a separate row for the "Top Header" header. However, this results in space below that header and the "sub headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule & & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Main & Main & \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} An alternative way is to include "Top Header" on the same line as the top line of the "Main Headers", but the use of \cmidrule creates awkward space for the two "Main Headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} A third way, with no \cmidrule gets the vertical spacing right, but I do want a to use \cmidrule to get a line under "Top Header": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} How can I get columns 1 and 2 to behave as in the first table, but columns 3 and 4 to behave as in the second table? In other words, I'd like the headers to take up two lines, as in the second table, and I'd like to use the \cmidrule command for columns 3 and 4, but I don't want the the extra space in between "Main" and "Header 1" and "Main" and "Header 2" that we see in the second table.

  • \prime \dprime \tprime (not so much) \qprime (looks good) STIX TWO
    by Steven Thomas Hatton on December 21, 2025 at 6:20 am

    The motivation Pfaff, Johann Friedrich: Methodus generalis, aequationes differentiarum partialium, nec non aequationes differentiales vulgares, utrasque primi ordinis inter quotcunque variabiles, complete integrandi The Problem \documentclass[a4paper,10pt]{article} \usepackage{amsmath} \usepackage{mathtools} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \newcommand{\tprime}{\char"2034} % ‴ \newcommand{\qprime}{\char"2057} % ⁗ \begin{document} Prime notation: $x^{\prime},x^{\dprime},x^{\tprime},x^{\qprime}$ \end{document} Obviously, the desired result would be for the triple prime to look like the double prime with one more prime, and to look like the quadruple prime with one less prime. This appears to be a feature of unicode since it appears in browsers, in Kate, in Emacs, (differently un-uniform) in xterm. Is there a way to produce a uniform set of prime, double prime, triple prime, quadruple prime using LuaLaTeX? Preferably with STIX Two. Post Script. I was unaware that $x'''$ would work. I learned to author LaTeX using LyX which is WYSIWYM not WYSIWYG. I rarely compiled what I was writing. My reality was what I saw in LyX.

  • Why cannot \par be printed here?
    by User23456234 on December 21, 2025 at 3:15 am

    I ask this question only out of curiousity's sake. I am not actually planning on defining a new command called \cmd because the usual \cs macro has superior syntax. (\cmd<command name, including backslash> and \cs{<command name, omitting backslash>} would print the name of a command.) When defining and testing \cmd, I found a strange error where \cmd\par would issue an error even if \cmd is \long (+m in \NewDocumentCommand). So I think that the argument should accept \par tokens. After some trial and error, I randomly changed \texttt to \ttfamily and the error went away. My question is: Why did this fix the error? I don't understand why \texttt wouldn't work correctly in this case. I provide a MWE below to demonstrate the issue: \documentclass{article} \ExplSyntaxOn \NewDocumentCommand \cmdtesti { +m } { \__module_cmd_test_i:N #1 } \cs_new_protected:Npn \__module_cmd_test_i:N #1 { \group_begin: \ttfamily \token_to_str:N #1 \@ % works correctly when #1 is \par \group_end: } \NewDocumentCommand \cmdtestii { +m } { \__module_cmd_test_ii:N #1 } \cs_new_protected:Npn \__module_cmd_test_ii:N #1 { \texttt { \token_to_str:N #1 \@ } % This gives an error if #1 is \par. } \ExplSyntaxOff \begin{document} \cmdtesti\command % no error \cmdtestii\command % no error \cmdtesti\par % no error % \cmdtestii\par % gives an error % \cmdtestii{\par} % gives an error \end{document}

  • How to create Tikz figure with surface and its shadow, as shown in image
    by Latexfan on December 19, 2025 at 7:17 pm

    I wish to make this figure with Tikz. I have tried but I can't make as in figure. Can you please assist me? \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta,3d,calc} \begin{document} \begin{tikzpicture}[ x={(1cm,0cm)}, y={(0.6cm,0.4cm)}, z={(0cm,1cm)}, >=Stealth ] % Axes \draw[->] (0,0,0) -- (4,0,0) node[below left] {$x$}; \draw[->] (0,0,0) -- (0,4,0) node[below right] {$y$}; \draw[->] (0,0,0) -- (0,0,4) node[left] {$z$}; % Origin \node at (0,0,0) [below left] {$O$}; % Bottom region D \fill[blue!15,opacity=0.6] plot[smooth cycle,variable=\t,domain=0:360] ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, 0); \node at (2,2,0) [below] {$D$}; % Boundary C' \draw[blue!70,thick,->] plot[smooth cycle,variable=\t,domain=0:360] ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, 0); \node at (3.8,2,0) {$C'$}; % Vertical dashed lines \foreach \t in {30,110,200,290} { \draw[dashed] ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, 0) -- ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, 2.3); } % Surface S : z = f(x,y) \fill[blue!40,opacity=0.7] plot[smooth cycle,variable=\t,domain=0:360] ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, {2+0.3*sin(\t)}); \node at (1.3,3.2,2.4) {$S$}; \node at (3.2,3.4,2.6) {$z=f(x,y)$}; % Boundary C \draw[blue!80,thick,->] plot[smooth cycle,variable=\t,domain=0:360] ({2+1.6*cos(\t)}, {2+1.1*sin(\t)}, {2+0.3*sin(\t)}); \node at (3.7,2.3,2.2) {$C$}; % Normal vector N \draw[red,very thick,->] (2,2,2.2) -- (2,2,3.6) node[above] {$\mathbf{N}$}; \end{tikzpicture} \end{document} ```

  • Custom 3D line plot in plain tikz and/or luadraw
    by Dr. Manuel Kuehner on December 19, 2025 at 12:30 pm

    Disclaimer This question is a bit of "do it for me" but there is a histrory behind it, see this question. User Jasper offered me a solution without using pgfplots. I plan to add a bounty as soon as it is possible. Question I want to create diagram with a 3D line plots. The main feature is to have several x axes that share the same y axis. Each x axis has its own F (or z) axis. There are only data points on specific y values (in the example below at +30, +15, 0, -15). In addition, the y axis is reversed (+ and - direction reversed). I need a grid in each F-x plane. Important ist also, that all F axes share the same min and max. Each axis should have a label and the diagram should have a title. The data is given in separate csv files, see example below. The MWE contains the data and plots the data (for testing) using pgfplots. Goal: The goal is to have a plain tikz solution and maybe in addition, a solution based on luadraw or lua-tikz3dtools respectively. I am looking for a easy-to-use custom interface for my plot task. If the result looks as it is created with pgfplots, then I am happy. S!#i, I forgot a key feature (not shown in the hand drawing) In addition to the x-F plots described above, there is ONE plot in the y-F plane (= from left to right). This works, because all F axes share the same min and max. \begin{filecontents*}{y_F_data.csv} y,F -15,20 -14,8 30,-4 \end{filecontents*} \documentclass{article} \usepackage{pgfplots} % ------------------------------- \begin{filecontents*}{x_zero.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_neg_one.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_pos_one.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_pos_two.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} % ------------------------------- \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_0$}, xlabel = {$x_0$}, ylabel = {$F_0$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_zero.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{-1}$}, xlabel = {$x_{-1}$}, ylabel = {$F_{-1}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_neg_one.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{1}$}, xlabel = {$x_{1}$}, ylabel = {$F_{1}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_pos_one.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{2}$}, xlabel = {$x_{2}$}, ylabel = {$F_{2}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_pos_two.csv}; \end{axis} \end{tikzpicture} \end{document}

  • Combine numbers from custom commands into a range
    by taiwan12 on December 18, 2025 at 11:40 pm

    I’m defining datas in LaTeX with a custom command that stores both a label and a number: \documentclass{article} \usepackage{parskip} \newcommand{\data}[3]{% \expandafter\newcommand\csname #1\endcsname[1][]{#2##1}% \expandafter\newcommand\csname #1Number\endcsname{#3}% } \newcommand{\getnumber}[1]{% \mbox{\textbf{(\csname #1Number\endcsname)}}% } \begin{document} \data{tempA}{aaa}{1} \data{tempB}{bbb}{2} \data{tempC}{ccc}{3} \data{tempD}{ddd}{4} \data{tempE}{eee}{5} \data{tempF}{fff}{6} Data: \tempA \newline Number: \getnumber{tempA} \end{document} For a single compound, \getnumber{tempA} outputs (1). Now I want to create a command that takes a list of compound names and outputs a range summary of their numbers. For example: \getnumberrange{tempA,tempB,tempC,tempF} % should produce (1-3,6) I’m not sure how to iterate over a list of command names, retrieve their numbers, and compress consecutive numbers into ranges. How can I implement this in LaTeX?

  • How to use \setcapwidth with \maxof from calc in TeXLive 2025?
    by mforbes on December 18, 2025 at 7:51 am

    As of TexLive 2025, I started running into an error with the following MnWE: \documentclass{scrartcl} \usepackage{calc} \setcapwidth{\maxof{\textwidth}{0.8\textwidth}} \begin{document} This fails with texlive 2025. \end{document} /Volumes/Data/apps/texlive/2025/texmf-dist/tex/latex/koma-script/typearea.sty) ) (/Volumes/Data/apps/texlive/2025/texmf-dist/tex/latex/tools/calc.sty) ! Missing number, treated as zero. <to be read again> \maxof l.5 ...capwidth{\maxof{\textwidth}{0.8\textwidth}} This seems to be related to a switch to LaTeX3-style command definitions. A workaround is to precompute the value before passing it to \setcapwidth. Is there a better solutions? \documentclass{scrartcl} \usepackage{calc} \setlength{\dimen255}{\maxof{\textwidth}{0.8\textwidth}} \setcapwidth{\dimen255} \begin{document} This works. \end{document}

  • Circuitikz full list of `\ctikzset` options
    by aulven on December 17, 2025 at 3:56 pm

    Where can I find the full list of options for \ctikzset? I couldn't find something like this in the documentation from CTAN, or in the Github repository, and for the life of me I cannot figure a consistent pattern between examples that are in the documentation. For instance if I pick up a line from examples and change it from bipoles to tripoles it sometimes works, sometimes throws and error and sometimes does nothing whatsoever. Or, otherwise, how do people figure out what the syntax for what they want to do is? As an example, the last problem I encountered that lead me to write this is adjusting the font size of transistors. Conveniently the document has the section titled Labels and Annotations under Labels, Voltages and Currents. Here it gives the example for bipoles, \ctikzset{bipole label style/.style={font=\tiny}} Which works as it should, however, it concerns bipoles only. My attempt of modifying it to: \ctikzset{tripole label style/.style={font=\tiny}} does nothing. neither does my other extrapolation attemps like quadpole, multipole, tripole/transistors, multipole/transistors, tripoles/.style, tripoles/transistors/nigfete/.style and so on. None of these do nothing and doesn't give an error either, unlike some other attemps which did give errors at least. At this point, I don't know if I'm missing the correct syntax or whether this feature exists in the first place. This happens to be my last frustration (that I'm yet to solve). However countless times in the past I have searched for similar modifications, it always boils down to finding the magic words for ctikzset and I don't know where to look. MRE \documentclass[8pt, a4paper]{article} \usepackage[american]{circuitikz} \begin{document} \begin{figure*} \begin{circuitikz} \ctikzset{bipole label style/.style={font=\tiny}} %<- From the doc. \ctikzset{tripole label style/.style={font=\tiny}} %<- My guess \draw (0,0) to[R, l=$R$] (2,0); \draw (0,2) node[nigfete]{$Q$}; \end{circuitikz} \end{figure*} \end{document}

  • unicode-math or lua-unicode-math?
    by Svend Tveskæg on December 16, 2025 at 5:02 pm

    I just noticed the lua-unicode-math package. Question I compile all my .tex documents using lualatex and therefore my question is as follows: What are the main differences between lua-unicode-math and unicode-math and when should I use which package?

  • Defining an option key for TColorbox
    by Jesco on December 16, 2025 at 10:41 am

    I would like to add an option key "points" to my custom tcolorbox aufgabe (so you use points=n, where n is a number, that acts as if I had added the option after title app={\hfill n Punkt(e}, where Punkt(e) depends on n (so without an e for 1). Concretely: My current aufgabe definition \renewcommand{\theaufgabe}{\arabic{aufgabe}} \refstepcounter{aufgabe} \newtcolorbox{aufgabe}[1][]{% before title={Aufgabe \theaufgabe \ (}, after title={)}, coltitle=black, colback=\typecolor!10, colframe=\typecolor, fonttitle=\bfseries, before upper={\refstepcounter{aufgabe}}, segmentation style={draw=\typecolor, line width=2pt}, #1 } Intended usage \begin{aufgabe}[title=some title, points=6] some task \end{aufgabe} should act like \begin{aufgabe}[title=some title, after title app={\hfill 6 Punkte}] some task \end{aufgabe} Edit: Fair point by @samcarter. This is a minimum example of what I would like: \documentclass[a4paper, 12pt]{article} \usepackage[many]{tcolorbox} \newcounter{aufgabe}[section] \renewcommand{\theaufgabe}{\arabic{aufgabe}} \refstepcounter{aufgabe} \newtcolorbox{aufgabe}[1][]{% before title={Aufgabe \theaufgabe \ (}, after title={)}, coltitle=black, fonttitle=\bfseries, before upper={\refstepcounter{aufgabe}}, #1 } \begin{document} \begin{aufgabe}[title=title, after title app={\hfill 6 Punkte}] some task \end{aufgabe} \end{document}