Week
- PDF/A and PDF/X compatibility: Color questionsby 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.
- Mixing LTR and RTL languages with lualatex, babel and \lettrineby Daniel Flipo on January 8, 2026 at 2:31 pm
The \lettrine command works as expected in documents written in monolingual LTR or RTL languages, but fails in multilingual documents in English and Hebrew as shown by the following example: \documentclass{article} \usepackage[bidi=basic, hebrew, english]{babel} \babelfont{rm}{Times New Roman} \babeltags{he = hebrew} \usepackage{lettrine} \renewcommand{\LettrineTextFont}{\upshape} % No small caps \begin{document} \lettrine{H}{ello} world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world. \begin{he} \lettrine[lines=3, refstring]{ב} שנות הששים הושפעתי מקליגרפיה עתיקה כמו זו של מגילות ים המלח והעתקתי ידנית פסקאות מן התנ"ך בסגנון הקליגרפיה של מגילות ים המלח. כשגרתי בישראל התחלתי לפתח סגנון משלי בקליגרפיה עברית. לפני כעשר שנים, לאחר שפרשתי, גליתי שיש תוכנות מחשב נגישות לעצוב פונטים. בערבי החורף הארוכים של צפון-מזרח ארה"ב, שפרתי בהדרגה את הגופן על המחשב. אחרי מספר שנים הצגתי על האינטרנט גופן True Type שקראתי לו "Mike Hebrew". דף הגופן הזה זכה ל- 58,000 בקורים ו- 25,250 הורדות של הגופן. הצעד הבא היה לעצב את הגופן על רמה מקצועית בטכנולוגיה עדכנית של Open Type. לגופן הזה קראתי "שונית," על שם רעייתי. \end{he} \lettrine[lines=3,lhang=.5]{H}{ello} world Hello world Hello world Hello Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world Hello world. \end{document} and its output: The Hebrew dropped cap is pushed into the right margin (as if option lhang=1 was passed to \lettrine)… Replacing the \begin{he} ... \end{he} environment by {\selectlanguage{hebrew} ... } doesn't fix the dropped cap placement.
- 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}
- TikZ overlay alignment issues in nested tcolorboxes using absolute page coordinatesby Med Elhadi Kh on January 7, 2026 at 5:37 pm
I am designing a complex document layout using tcolorbox. The main container (BoxDars) has specific vertical strips (margins) defined in its overlay. I have created custom commands (\mrhala, \Time, \rems) to place content into these specific strips using TikZ overlays. The Problem: These commands work fine in the main box. However, when I use them inside nested boxes (e.g., inside box2 or box3), the horizontal positioning shifts incorrectly. I tried to compensate for the nesting depth using \value{tcblayer}, but the alignment is still inconsistent. Goal: I want the content of \mrhala, \Time, and \rems to strictly stick to their respective vertical columns defined in the parent BoxDars, regardless of how deep the nesting is. Here is my MWE: \documentclass[a4paper]{article} \usepackage[margin=1cm]{geometry} \usepackage[most]{tcolorbox} \usepackage{amsmath,amssymb,mathtools,,tikz,pifont,fontawesome,array,colortbl,varwidth,yagusylo,lipsum} \usetikzlibrary{calc,shapes.geometric,backgrounds} \renewcommand{\baselinestretch}{1.2} \pagestyle{empty} \parindent=0mm \def\marahil{1.25cm} \def\modat{1cm} \def\REMS{2.5cm} \newtcolorbox{BoxDars}{ enhanced,breakable, blanker,top=10mm, leftupper=\marahil+1mm, rightupper=\modat+\REMS+1mm, colback=white, bottom=3mm, before skip=3pt, after skip=10pt, parbox=false, overlay={ \draw[very thick,fill=orange!45] (interior.north west) rectangle ([yshift=-8mm]interior.north east); \draw[very thick,red!50!black] (interior.south west) rectangle (interior.north east); % Vertical lines (from RIGHT to LEFT for RTL labeling) % Rightmost divider: stages | rest \draw[very thick,red!50!black] ([xshift=\marahil]interior.north west) -- ([xshift=\marahil]interior.south west); % Next: stages | elemes cours | rest \draw[very thick,red!50!black] ([xshift={-\REMS}]interior.north east) -- ([xshift={-\REMS}]interior.south east); % Next: stages | elemes cours | times | rems \draw[very thick,red!50!black] ([xshift={-\modat - \REMS}]interior.north east) -- ([xshift={-\modat - \REMS}]interior.south east); \node[yshift=-4mm] at ([xshift=0.5*\marahil]interior.north west |- interior.north east) {stages}; \node[yshift=-4mm] at ([xshift={0.5*\linewidth +\marahil - \modat-\REMS}]interior.north west |- interior.north east) {elemes cours}; \node[yshift=-4mm] at ([xshift={ -(0.5*\modat+\REMS)}]interior.north east |- interior.north west) {times}; \node[yshift=-4mm] at ([xshift={-0.5*\REMS}]interior.north east |- interior.north west) {rems}; }} \newcommand{\whichbox}{% \ifnum\value{tcblayer}=0 Outside any box% \else Box \Roman{tcblayer}% \fi } \newcommand{\Time}[2][0]{\leavevmode% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{-5.3} \pgfmathsetmacro{\timeShift}{\baseDist - 0.65 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north east |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { \begin{minipage}{1cm}\centering {\large\yagding[ifsymclock]{148}}\\ \normalsize {#2} \end{minipage} }; \end{tikzpicture}% } \newcommand{\rems}[2][0]{\leavevmode% \begin{tikzpicture}[remember picture,overlay] \def\baseDist{-3.6} \pgfmathsetmacro{\timeShift}{\baseDist - 0.55 * (\value{tcblayer} - 1)} \coordinate (A) at (0,0); \coordinate (Edge) at (current page.north east |- A); \node at ([xshift=\timeShift cm, yshift=#1]Edge) { {\begin{minipage}{2cm}\small\centering #2 \end{minipage}} }; \end{tikzpicture}% } \newcommand{\mrhala}[2][0]{\leavevmode% \tikz[overlay,remember picture,baseline=0pt]{% \def\baseDist{0.3} \pgfmathsetmacro{\newX}{\baseDist - (\value{tcblayer}-1)*0.3} \coordinate (A) at (0,0); \ifnum\value{tcblayer}>0 \coordinate (Edge) at (current page.north west |- A); \node[inner sep=0] at ([xshift=\newX cm, yshift=#1 mm]Edge) {\rotatebox{90}{#2}}; \fi }% } \newtcolorbox{box1}{ title=Title: \whichbox, colframe=blue!50!black, colback=blue!5 } \newtcolorbox{box2}{ title=Title: \whichbox, colframe=red!50!black, colback=red!5 } \newtcolorbox{box3}{ title=Title: \whichbox, colframe=green!50!black, colback=green!5 } \begin{document} helow \begin{BoxDars} Inside box1: \whichbox \mrhala{arg2} \Time{20} \begin{box2} Inside box2: \whichbox \mrhala{arg2} Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox Inside box2: \whichbox \begin{box3} Inside box3: \whichbox \Time{20} \end{box3} \end{box2} \rems{text text text} \begin{box3} Inside box3: \whichbox \rems{text text text} \end{box3} \end{BoxDars} \end{document} Question: How can I define the coordinates in my custom commands so that they ignore the indentation of nested boxes and align perfectly with the BoxDars vertical strips?
- Horizontal space between absolute value symbolsby J.-E. Pin on January 7, 2026 at 2:53 pm
Possibly related questions include Absolute values and height scaling on some symbols and Absolute Value Symbols but they do not seem to address my specific question. The code \documentclass[]{amsart} \begin{document} \LARGE $\lvert m_1 \rvert$ $\lvert m \rvert$ $|m_1|$ $|m|$ \end{document} produces the output in which $m$ is horizontally centred between the vertical bars, but $m_1$ is not. Wouldn't it be preferable for everything between the two bars to be automatically centred? In the meantime, is there any way to make my wish come true without too much work?
- Define commands inside foreach loopby kaba on January 6, 2026 at 8:29 pm
I'm trying to define commands inside a pgffor \foreach loop, where the command-names depend both on the a macroparameter and the loop parameters. However, I get "First argument of '\NewDocumentCommand' must be a command.". What is wrong, and how can it be fixed? \documentclass[a4paper,12pt]{article} \usepackage{pgffor} \NewDocumentCommand{\CreateMyCommands}{m}{ \foreach \x/\a in {x/a,y/b} { \global\NewDocumentCommand{\csname #1\x\endcsname}{}{#1\a} } } \CreateMyCommands{f} \begin{document} \fx \fy \end{document} A smaller example which seems to demonstrate the problem is: \documentclass[a4paper,12pt]{article} \usepackage{pgffor} \foreach \x in {x} { \global\NewDocumentCommand{\csname f\endcsname}{}{a} } \begin{document} \f \end{document}
- Drawing behind gridlines in Rotated pgfplot - "set layers" seems to have side-effectsby user1476176 on January 6, 2026 at 7:36 pm
I'm trying to create a figure with a filled area behind the gridlines for use on a rotated page. I don't want to use axis on top because I have nodes which need to be drawn on top of the gridlines. I've tried following the instructions at PGFPlots: Understanding how to draw plots on different layers and arrange them, which uses set layers, but I've found that it messes up the spacing when combined with rotate=90,transform shape. MWE: \documentclass{standalone} \usepackage{pgfplots} \begin{document} % Rotate entire page \global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90} % Correct label placement but incorrect layering \begin{tikzpicture}[rotate=90,transform shape] \begin{axis}[grid=both,title={Correct Spacing but Incorrect Layering}] \addplot {\x}; \addplot[fill=green,draw=none,on layer=background] coordinates { (-5,-5) (-5,-3) (-3,-3) (-3,-5) (-5,-5) }; \node[fill=white,align=center] at (axis cs:-3,2) {Node above\\gridlines}; \end{axis} \end{tikzpicture} % Fix from Stack Exchange \pgfplotsset{% layers/my layer set/.define layer set={background,main,foreground}{},% set layers=my layer set,% }% % Correct layering but incorrect label placement \begin{tikzpicture}[rotate=90,transform shape] \begin{axis}[grid=both,,title={Correct Layering but Incorrect Spacing}] \addplot {\x}; \addplot[fill=green,draw=none,on layer=background] coordinates { (-5,-5) (-5,-3) (-3,-3) (-3,-5) (-5,-5) }; \node[fill=white,align=center] at (axis cs:-3,2) {Node above\\gridlines}; \end{axis} \end{tikzpicture} \end{document} Output: I also tried setting the layers as follows: \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} but it seems to also give correct spacing but incorrect layering.
- How can I create a simple sankey diagram?by Martin Thoma on January 6, 2026 at 1:20 pm
I've used the following data to generate this sankey diagram of my energy usage in December 2025: PV Dach [216] House PV Garten [9] House Grid [1283] House House [1223] Heat House [20.98] Dishwasher House [15.25] Refrigerator House [8] TV House [1.98] Washing Machine House [0.45] Microwave Heat [1110] Heating (HP) Heat [63] Hot Water (HP) Heat [49.8] AC Heat [22] Heater (Bathroom) :PV Dach #f5f542 :PV Garten #f5f542 :Grid #000 :House #cdcdcd :Heat #ff0000 :AC #cc0000 :Heating (HP) #cc0000 :Hot Water (HP) #cc0000 :Heater (Bathroom) #cc0000 :Refrigerator #0000ff with https://sankeymatic.com/ I've seen https://ctan.mirror.garr.it/mirrors/ctan/graphics/pgf/contrib/sankey/sankey.pdf, and sankey but the graphs there seem to be rather complex. Is there any way that lets me produce something like the image above without writing a lot of TeX?
- 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:
- PDF/X-4 and A-2B compliant PDF with lualatex and pdf managementby schade96 on January 5, 2026 at 10:37 pm
I am trying to create a PDF/X-4 PDF/A-2B multistandard compliant PDF using lualatex and the pdf management methods. There are a few challenges I faced. I have tried to create a very simplified minimal version of my actual document: \DocumentMetadata{ pdfstandard = {A-2b,X-4}, lang = en-US, pdfversion = 1.7, colorprofiles = { A = sRGB.icc, X = FOGRA39L_coated.icc } } \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage[urlcolor=blue]{hyperref} \hypersetup{ colorlinks=true,% urlcolor={blue},% linkcolor={red},% citecolor={green},% pdfauthor={me},% pdftitle={pdfxtest},% pdfsubject={subject},% pdfversionid={someversion},% pdfkeywords={a,b,c}% } \ExplSyntaxOn % This did not fix it: %\pdfmeta_xmp_add:n{<xmpMM:Keywords>a,b,c</xmpMM:Keywords>} \pdfmeta_xmp_add:n{ <xmpMM:RenditionClass>default</xmpMM:RenditionClass>} % Not sure if I should use True or False here. \pdfmeta_xmp_add:n{ <pdf:Trapped>True</pdf:Trapped>} \pdfmanagement_add:nnn{Info}{Trapped}{/True} \ExplSyntaxOff % Set these all to A4 \pdfmanagement_add:nnx{Page}{TrimBox}{[0~0~595.276~841.89]} \pdfmanagement_add:nnx{Page}{BleedBox}{[0~0~595.276~841.89]} % See comments %\pdfmanagement_add:nnx{Page}{MediaBox}{[0~0~595.276~841.89]} \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 you can see the PDF: contains an embedded .png image generated from matplotlib (and many more in my actual document); here I have already disabled interpolation for contains a hyperlink (my actual document contains many more, both internal and external) As is, the above example is already A-2B compliant. But X-4 seems to be a bit more complicated and there are a few issues I cannot seem to fix. Preflight in Adobe Acrobat notes the following issues with the generated PDF: DeviceGray used but OutputIntent not Gray or CMYK (2 matches on 1 page) and OutputIntent profile not 'prtr' - This is probably related to how I set the color profiles. Is it even possible to use them as I do in my example? I remember reading that one will get overwritten for the output intent. Keyword mismatch between Document and XMP Metadata - Here, I really do not know what to do or where exactly this comes from. Linearizing the PDF with qpdf --linearize --object-streams=disable --compress-streams=n pdfx_test.pdf lin.pdf, I find that it contains (if I add it as shown in the code sample) <xmpMM:Keywords> <rdf:Bag> <rdf:li>a</rdf:li> <rdf:li>b</rdf:li> <rdf:li>c</rdf:li> </rdf:Bag< </xmpMM:Keywords> or <xmpMM:Keywords>a,b,c</xmpMM:Keywords> depending on what I add there, but neither of which resolve this. Also, I find << /Author [...] /Keywords <feff0061002c0062002c0063> [...] >> where $ python3 -c 'print(bytes.fromhex("feff0061002c00200062002c00200063").decode("UTF-16"))' a, b, c Document contains actions and Annotation other than TrapNet or PrinterMark inside print area (1 match on 1 page) - These seem to be related to the hyperlink and I am not sure how to resolve this. This leads me to the question whether such a document can even be X-4 compliant. How can I fix these points, if possible? For reference, this is the content of "testimage.pgf": %% Creator: Matplotlib, PGF backend %% %% To include the figure in your LaTeX document, write %% \input{<filename>.pgf} %% %% Make sure the required packages are loaded in your preamble %% \usepackage{pgf} %% %% Also ensure that all the required font packages are loaded; for instance, %% the lmodern package is sometimes necessary when using math font. %% \usepackage{lmodern} %% %% Figures using additional raster images can only be included by \input if %% they are in the same directory as the main LaTeX file. For loading figures %% from other directories you can use the `import` package %% \usepackage{import} %% %% and then include the figures with %% \import{<path to file>}{<filename>.pgf} %% %% Matplotlib used the following preamble %% \def\mathdefault#1{#1} %% \everymath=\expandafter{\the\everymath\displaystyle} %% \IfFileExists{scrextend.sty}{ %% \usepackage[fontsize=10.000000pt]{scrextend} %% }{ %% \renewcommand{\normalsize}{\fontsize{10.000000}{12.000000}\selectfont} %% \normalsize %% } %% %% \ifdefined\pdftexversion\else % non-pdftex case. %% \usepackage{fontspec} %% \setmainfont{DejaVuSerif.ttf}[Path=\detokenize{/Users/dennis/Desktop/pdfxtest/v/lib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/}] %% \setsansfont{DejaVuSans.ttf}[Path=\detokenize{/Users/dennis/Desktop/pdfxtest/v/lib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/}] %% \setmonofont{DejaVuSansMono.ttf}[Path=\detokenize{/Users/dennis/Desktop/pdfxtest/v/lib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/}] %% \fi %% \makeatletter\@ifpackageloaded{underscore}{}{\usepackage[strings]{underscore}}\makeatother %% \begingroup% \makeatletter% \begin{pgfpicture}% \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{6.400000in}{4.800000in}}% \pgfusepath{use as bounding box, clip}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetmiterjoin% \definecolor{currentfill}{rgb}{1.000000,1.000000,1.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.000000pt}% \definecolor{currentstroke}{rgb}{1.000000,1.000000,1.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{6.400000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{6.400000in}{4.800000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{4.800000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathclose% \pgfusepath{fill}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetmiterjoin% \definecolor{currentfill}{rgb}{1.000000,1.000000,1.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.000000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetstrokeopacity{0.000000}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}% \pgfpathlineto{\pgfqpoint{5.760000in}{0.528000in}}% \pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}% \pgfpathlineto{\pgfqpoint{0.800000in}{4.224000in}}% \pgfpathlineto{\pgfqpoint{0.800000in}{0.528000in}}% \pgfpathclose% \pgfusepath{fill}% \end{pgfscope}% \begin{pgfscope}% \pgfsys@transformshift{1.020000in}{0.680000in}% \pgftext[left,bottom]{\includegraphics[interpolate=false,width=4.530000in,height=3.390000in]{testimage-img0.png}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{1.025455in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=1.025455in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.0}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{1.927273in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=1.927273in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.2}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{2.829091in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=2.829091in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.4}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{3.730909in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=3.730909in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.6}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{4.632727in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=4.632727in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.8}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{5.534545in}{0.528000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=5.534545in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}1.0}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{0.696000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=0.643238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.0}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{1.368000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=1.315238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.2}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{2.040000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=1.987238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.4}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{2.712000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=2.659238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.6}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{3.384000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=3.331238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0.8}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetbuttcap% \pgfsetroundjoin% \definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}% \pgfsetfillcolor{currentfill}% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{% \pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}% \pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}% \pgfusepath{stroke,fill}% }% \begin{pgfscope}% \pgfsys@transformshift{0.800000in}{4.056000in}% \pgfsys@useobject{currentmarker}{}% \end{pgfscope}% \end{pgfscope}% \begin{pgfscope}% \definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{textcolor}% \pgfsetfillcolor{textcolor}% \pgftext[x=0.481898in, y=4.003238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}1.0}}% \end{pgfscope}% \begin{pgfscope}% \pgfsetrectcap% \pgfsetmiterjoin% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}% \pgfpathlineto{\pgfqpoint{0.800000in}{4.224000in}}% \pgfusepath{stroke}% \end{pgfscope}% \begin{pgfscope}% \pgfsetrectcap% \pgfsetmiterjoin% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{5.760000in}{0.528000in}}% \pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}% \pgfusepath{stroke}% \end{pgfscope}% \begin{pgfscope}% \pgfsetrectcap% \pgfsetmiterjoin% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}% \pgfpathlineto{\pgfqpoint{5.760000in}{0.528000in}}% \pgfusepath{stroke}% \end{pgfscope}% \begin{pgfscope}% \pgfsetrectcap% \pgfsetmiterjoin% \pgfsetlinewidth{0.803000pt}% \definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}% \pgfsetstrokecolor{currentstroke}% \pgfsetdash{}{0pt}% \pgfpathmoveto{\pgfqpoint{0.800000in}{4.224000in}}% \pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}% \pgfusepath{stroke}% \end{pgfscope}% \end{pgfpicture}% \makeatother% \endgroup%
- latex-lab-math alt text and \displaystyle?by Richard Wong on January 5, 2026 at 6:26 pm
I am experimenting with the tagging project's mathematics tagging to create tagged pdf, and I'm wondering if there's any way for the generated alt text to automatically omit purely visual commands like \displaystyle? It seems to me that the alt text generator grabs and repeats exactly the latex commands verbatim. For example, below is a minimal working example: \DocumentMetadata{ tagging=on, tagging-setup={math/setup=mathml-SE} } \documentclass[11pt]{article} \usepackage{hyperref} \begin{document} %%%%%%%%%%%%%%%%%%%% %accessibility/tagging \tagpdfsetup{math/alt/use} \hypersetup{ pdftitle={Test}, pdfauthor={Richard Wong},pdfdisplaydoctitle% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $\displaystyle \int_0^1 xe^{-x^2} \ dx$ \end{document} The alt text that I get (when viewed with Apple's VoiceOver screen reader) is Latex formula starts \begin{math} \displaystyle \int_0^1 xe^{-x^2} \ dx \end{math} Latex formula ends A second, related question is how the alt text generator handles macros. For example, if I define \newcommand{\ds}{\displaystyle}, and then write $\ds \int_0^1 xe^{-x^2} \ dx$, would there be a way for the alt text to recognize and omit \ds?
- Can I customise the footer in ltx-talk?by Elena on January 5, 2026 at 1:52 pm
Yay, now there are accessible Latex slides! I just started porting my slides to ltx-talk from beamer. The first thing that I cannot easily replicate from my beamer template is the footer, which is as follows: \setbeamercolor{foot1}{fg=black, bg=skyblue!20} \setbeamercolor{foot2}{fg=black, bg=skyblue!60} \setbeamercolor{foot3}{fg=black, bg=skyblue} \setbeamertemplate{footline}{% \leavevmode% \hbox{% \begin{beamercolorbox}[wd=.3\paperwidth,ht=2.75ex,dp=1ex,left]{foot1}% \hspace*{2ex} \insertshorttitle \end{beamercolorbox}% \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.75ex,dp=1ex,center]{foot2}% \insertsubtitle % \end{beamercolorbox}% \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.75ex,dp=1ex,right]{foot3}% \insertframenumber{}/\inserttotalframenumber \hspace*{2ex} \end{beamercolorbox}}% \vskip0pt% } I have two main issues. First, I cannot change the height of the footer. See the original beamer slide and its version in ltx-talk. While I can ignore the other differences, this height does bother me. Second, I really like to show the number of the current slide out of the total number of slides. Is there a way to do something similar like 3/10? By the way, this is my current ltx-talk settings: \EditInstance{footer}{std}{ background-color = skyblue!20, color = black, element-order = {title, subtitle, framenumber}, right-hspace = 3mm, left-hspace = 3mm, } I did try using totalframes comma separated inside element-order, but it gave me this error <argument> \??? ! LaTeX Error: Erroneous variable \@shorttotalframes used! But even if it did work, I still don't like the two numbers to be separated. Here is my minimal working example: \DocumentMetadata{tagging = on} \documentclass[10pt]{ltx-talk} \title{Fundamentals of Web Development} \subtitle{Week 1: Basics of HTML} \usepackage[T1]{fontenc} \renewcommand*\familydefault{\sfdefault} \usepackage[sfdefault,condensed]{roboto} \definecolor{kentblue}{HTML}{003882} \definecolor{skyblue}{HTML}{2ABED9} \EditInstance{footer}{std}{ background-color = skyblue!20, color = black, element-order = {title, subtitle, framenumber}, right-hspace = 3mm, left-hspace = 3mm, } \begin{document} \begin{frame} \begin{center} \Huge \textcolor{kentblue}{\textbf{Lecture 1} ltx-talk} \end{center} \begin{itemize} \item Introduction to HTML and CSS \item Basic syntax of HTML \item Some simple formatting \item Images and links \end{itemize} \end{frame} \end{document}
- microtype + newcomputermodern produce unknown slot number warnings, even without textby PHL on January 5, 2026 at 12:29 pm
microtype used together with fontspec is producing many unknown slot number warnings. This is apparently related to protrusion, see microtype producing dozens of Unknown slot number warnings for Lete Sans Math . These warnings happens even with an empty document (so without any pdf output) and are not stopped by disabling protrusion at the beginning of document as demonstrated by the following MWE. % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontsetup} \usepackage{microtype} \AtBeginDocument{\microtypesetup{protrusion=false}} \begin{document} \end{document} (fontsetup without option load the new computer modern font). Using protrusion=false as an option of the package does however solve the problem. [concrete]{fontsetup} does also solve the problem, so this is really font dependent.
- 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?
- subfloat + includegraphics: alignement and box sizes?by Achille on January 5, 2026 at 9:44 am
I have the following latex code but I cannot fix it. The first row is made of 6 boxes. The second row is made of 3 boxes, the first should be large as the first 3 boxes of the first row, the other two boxes should have the same height of the first box in the same row. All boxes should be aligned. So here are my questions: How can I adjust the space between boxes in the same row? How can I adjust the size of the first box in the second row and adjust the other sizes accordingly? ...Ideally I'd also like to add arrows between, e.g. the 4th box in the first row and the 3rd box in the the second row. Maybe subfloat is not the best choice... Thanks for helping \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{subfig} % Changed from subcaption to subfig \usepackage{array} \setlength{\voffset}{-0.75in} \setlength{\headsep}{5pt} \begin{document} \begin{figure}[ht] \centering % Image rows \subfloat{\includegraphics[width=0.14\textwidth]{example-image-a}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-a}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-a}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-a}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-a}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-b}} \vspace{0.5cm} \subfloat{\includegraphics[width=0.42\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image}} \vspace{0.5cm} \subfloat{\includegraphics[width=0.42\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image-c}}\hfill \subfloat{\includegraphics[width=0.14\textwidth]{example-image}} \end{figure} \end{document}
- circuitikz: potentiometer without pin on the right sideby Explorer on January 5, 2026 at 7:45 am
What I want to achieved is as below: I have the following code: \documentclass[border=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \draw(0,0) to [rmeter,t=A] (0,2) to [R,l_=$R$](3,2) to [pR,l_=$R'$,n=pr] (4.1,2); \draw(0,0) to [normal open switch,l_=$S$] (6,0) |-(pr.wiper); \end{circuitikz} \end{document} it gives the similar result: However, the righthand of sliding rheostat's length is control in manual, but guess the coordinate (4.1,2), which is not elegant. I have consulted the manual, but found no similar components. Is that better method to achieve the desird result?
- circuitikz: set 'rounded corners' of a 'oscopeshape' to a smaler valueby 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: width (height) and pin-distance of a 'muxdemux'by cis on January 4, 2026 at 4:48 pm
How do I get these two lengths? By the way: a) I don't need the height right now, but I assume the extraction method would be the same; so it wouldn't hurt to have it... b) I know how to do it with the calc library. However, it would be better if I could get the dimensions directly from the circuitikz package, without having to measure them after drawing. \documentclass[margin=15pt]{standalone} \usepackage{circuitikz} \begin{document} \tikzset{ circuitikz/muxdemux/outer label font={\tiny\ttfamily\color{blue}}, mychip/.style={muxdemux,% ===================== muxdemux def={ Lh=4, Rh=4, w=6,% sizes NR=0, NL=5, 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,% LU1=lu1, LD1=ld1, LU2=lu2, LD2=ld2, LU3=lu3, LD3=ld3, LU4=lu4, LD4=ld4, LU5=lu5, LD5=ld5, }, draw only top pins={}, append after command={ \pgfextra \def\fg{\tikzlastnode} % Contacts annotations ============== \foreach \x in {1,2,3}{%% \node[bnc, anchor=zero, rotate=-90](Contact\x) at (\fg.blpin 5 -| \fg.btpin \x) {}; \draw[] (Contact\x) -- (\fg.bbpin \x); }%% \endpgfextra }, },% ===================== } \begin{circuitikz}[>=latex] \node[mychip](FG){chip}; \draw[purple, <->] (FG.north west) -- (FG.north east) node[midway, fill=white, inner sep=0pt]{w=? pt}; \draw[orange, <->] (FG.bpin 1) -- (FG.bpin 2) node[midway, below]{p=? pt}; \end{circuitikz} \end{document}
- ConTeXt: Inset Bible Chapter Numbers Mid-Paragraphby Jeff Dodson on January 4, 2026 at 3:22 pm
I'm new to ConTeXt, and am wondering how I might typeset Bible chapter numbers for cases where a chapter break occurs in the middle of a paragraph (i.e., verse 1 of the chapter doesn't begin a new paragraph). Here's an example of what I'd like to achieve in ConTeXt: As you can see here, in Mark, Chapter 9 begins mid-paragraph. As a result, there's no paragraph break at Mark 9:1, and I do need to explicitly show the verse number for Mark 9:1 in the text. The chapter number "9" does appear against the left margin, but the text of the paragraph flows nicely around it, until there's eventually a paragraph break starting at Mark 9:2. The above was achieved in XeLaTeX using a code snippet that David Carlisle (I believe it was) was kind enough to provide a couple of years ago. Perhaps the answer to my question is to use the same snippet with ConTeXt. However, I guess what I'm wondering is if there's a different way I should be doing it in ConTeXt, as opposed to (XeLaTeX). Incidentally, this is the snippet in LaTeX that produced the above desired results: \newlength{\parskipval} \makeatletter \def\newparshape{\parshape\@npshape0{}} \def\@npshape#1#2#3{\ifx\\#3\expandafter\@@@npshape\else\expandafter\@@npshape\fi {#1}{#2}{#3}} \def\@@npshape#1#2#3#4#5{% \ifnum#3>\z@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi {\expandafter\@@npshape\expandafter{\the\numexpr#1+1\relax}{#2 #4 #5}{\numexpr#3-1\relax}{#4}{#5}}% {\@npshape{#1}{#2}}} \def\@@@npshape#1#2#3{#1 #2} \makeatother \newcommand{\parnopar}[1][]{\parfillskip=0pt\par% #1% \parskip=0pt\noindent\parfillskip=0pt plus1fil} \newfontfamily\dropnum[Scale=3.2]{Times New Roman} \newsavebox{\dropcapbox} \newcommand{\nbchapbeg}[1]{% \setlength{\parskipval}{\parskip}% \parnopar% \savebox{\dropcapbox}{\dropnum{#1}}% \newparshape {2}{\dimexpr\wd\dropcapbox+1ex}{\dimexpr\linewidth-\wd\dropcapbox-1ex} {1}{0pt}{\linewidth}\\% \noindent \llap{\raisebox{\dimexpr-\height+.44\baselineskip}[0pt][0pt]{% \usebox{\dropcapbox}% \hspace{1ex}% }}% \ignorespaces% \setlength{\parskip}{\parskipval}% } With the \nbchapbeg macro above (which I believe stands for "non-breaking chapter beginning), I place a call to the macro anywhere within the verse prior to the first verse of the chapter that doesn't begin a new paragraph (Mark 9 here), and it causes the chapter number to be inset into the text in the proper place. So I guess my real question is: Is there a "ConTeXty" way to do this, or should I use the same technique? Here's the ConTeXt code snippet I'm working with, where I'd like to make the chapter number have the paragraph flow around it. The text below is in English rather than Greek, but the solution applies regardless of the language used. \starttext 35 For whosoever will save his life shall lose it; but whosoever shall lose his life for my sake and the gospel's, the same shall save it. 36 For what shall it profit a man, if he shall gain the whole world, and lose his own soul? 37 Or what shall a man give in exchange for his soul? 38 Whosoever therefore shall be ashamed of me and of my words in this adulterous and sinful generation; of him also shall the Son of man be ashamed, when he cometh in the glory of his Father with the holy angels. (Chapter 9 drop num goes here) 1 And he said unto them, Verily I say unto you, That there be some of them that stand here, which shall not taste of death, till they have seen the kingdom of God come with power. 2 And after six days Jesus taketh with him Peter, and James, and John, and leadeth them up into an high mountain apart by themselves: and he was transfigured before them. \stoptext UPDATE: I realized today that I left the \def for \newparshape out of my original post, so I added that above. At this point, I'd be happy to just have a conversion of the original code into pure TeX in such a way that I could use it in ConTeXt. I've tried that conversion myself, but have not been able to get it right. The following is what I did so far, but again, it doesn't work. The sticking point, I think, is the \newparshape part. \newskip\parskipval \newbox\dropcapbox \def\dropnumfont{\definedfont[Serif*default at 38.4pt]} \def\newparshape{\parshape\npshape0{}} \def\npshape#1#2#3{% \ifx\\#3% \expandafter\npshapeend \else \expandafter\npshapeloop \fi {#1}{#2}{#3}% } \def\npshapeloop#1#2#3#4#5{% \ifnum#3>0 \expandafter\npshapeloop \expandafter{\the\numexpr#1+1\relax}% {#2 #4 #5}% {\numexpr#3-1\relax}% {#4}{#5}% \else \npshape{#1}{#2}% \fi } \def\npshapeend#1#2#3{#1 #2} \def\nbchapbeg#1{% \parskipval=\parskip \parfillskip=0pt\par\parskip=0pt\noindent\parfillskip=0pt plus 1fil \setbox\dropcapbox=\hbox{\dropnumfont #1}% \dimen0=\wd\dropcapbox \advance\dimen0 by 1ex \dimen1=\wd\dropcapbox \advance\dimen1 by -1ex \dimen2=\linewidth \advance\dimen2 by -\dimen1 \newparshape 2 \dimen0 \dimen2 1 0pt \linewidth \\% \noindent \rlap{% \smash{% \raise -0.56\baselineskip \hbox{% \unhbox\dropcapbox \hskip 1ex }% }% }% \ignorespaces \parskip=\parskipval }
- Change Text Color of Certain Lines in Algorithmic Environmentby M. McIlree on January 4, 2026 at 9:58 am
What I'm trying to do: I'm trying to change the text color of specific lines to highlight them in an algorithmic environment (using algpseudocodex package). \documentclass[12pt]{article} \usepackage{algpseudocodex} \usepackage{algorithm} \usepackage{xcolor} \begin{document} \begin{algorithm} \begin{algorithmic} \State This should not be colored \leavevmode {\color{red} \State This should be colored} \For{$a \in A$} \If{$a = 1$ (this should also be colored)} \State This should be colored \Else \State This should not be colored \EndIf \EndFor \end{algorithmic} \end{algorithm} \end{document} What I tried: Add \color{red} and \color{black} before and after the lines I want to color. This gives me Package varwidth: Failed to reprocess entire contents. Create a group as per this answer (i.e. \leavevmode {\color{red} \State This should be colored} Gives me Missing } inserted. Wrap text in \textcolor{} Does work for the statements but not if I want to color the if-then keywords as well Does anyone have any suggestions?
- How to use specific height in tikz tcolorboxby user386618 on January 4, 2026 at 9:53 am
I wanted to set the coordinate that it's height is one third of a box that consists of 1 line, but tikz don't understand. What to do? \documentclass[10pt]{book} \usepackage[english]{babel} \usepackage[most]{tcolorbox} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tcolorbox}[enhanced, width=\linewidth, frame hidden, interior hidden, overlay={\draw[x=\dimexpr\ht\strutbox+\dp\strutbox\relax, y=\dimexpr\ht\strutbox+\dp\strutbox\relax] (1/3,0)--(0,1/3)--($(frame.north west)-(0,1/3)$)--($(frame.north west)+(1/3,0)$)--($(frame.north east)-(1/3,0)$)--($(frame.north east)-(0,1/3)$)--($(frame.south east)+(0,1/3)$)--($(frame.south east)-(1/3,0)$)--cycle;}] Smth \end{tcolorbox} \end{document} I want the shape to be like a part of regular octagon like below so for one line is more like a stretched regular octagon, i can approximate but want to be more precise
- old-style numerals everywhere, including math modeby Phillip Helbig on January 3, 2026 at 6:30 pm
pdflatex Problem: need old-style numerals in main text Solution: \RequirePackage[osf]{newtxtext} Works fine in main text, but not in math mode. Problem: need old-style numerals also in math mode Solution: \DeclareMathSymbol{0}{\mathord}{letters}{0}` Works fine. Problem: need raised decimal point Solution: RequirePackage{decimal} Works fine as long as all numerals with a decimal point are in math mode, which is clear must be the case. That is not really relevant for the next problem, but it means that more numerals must be in math mode (unless I want 123$.$456 and so on). Problem: In text smaller or larger than normalsize, numerals are somewhat larger and bolder. Solution: Put all numerals in math mode if text is not normalsize. Remark: I noticed the problem since my tables are footnotesize. There, it's easy to get all numbers in math mode automatically, and it's only a minor problem that the numerals look a bit larger and bolder than they should. Problem: The user should not have to worry about whether the text is normalsize. Numbers in tables can be handled automatically. However, in an actual footnote numerals will differ in appearance whether or not they are in math mode. Ditto for text in any other size larger or smaller than normalsize. Note that the problem is NOT that the numerals are not scaling in math mode with the text. They are, whether the text is larger or smaller than normalsize. But they are always slightly larger and bolder than they should be (but not as large as the next larger size, nor as bold as boldfaceseries). Remark: I would be willing to switch to LuaLaTeX if I have to change little or nothing else. (I'll presumably have to use another font-selection mechanism and another font, but presumably there is a font similar to newtxtext and newtxmath.) In particular, the raised decimal point via the decimal package should still work (or there must be an easy alternative), and of course I still want old-style numerals not just in the main text but also in math mode. %class file \ProvidesClass{test}[2026/01/03] \LoadClass[8pt,twoside]{extarticle} \RequirePackage[T1]{fontenc} \RequirePackage[osf]{newtxtext} \RequirePackage{newtxmath} \RequirePackage{extsizes} \RequirePackage{fontsize} \changefontsize[10.2pt]{8.6pt} \DeclareMathSymbol{0}{\mathord}{letters}{`0} \DeclareMathSymbol{1}{\mathord}{letters}{`1} \DeclareMathSymbol{2}{\mathord}{letters}{`2} \DeclareMathSymbol{3}{\mathord}{letters}{`3} \DeclareMathSymbol{4}{\mathord}{letters}{`4} \DeclareMathSymbol{5}{\mathord}{letters}{`5} \DeclareMathSymbol{6}{\mathord}{letters}{`6} \DeclareMathSymbol{7}{\mathord}{letters}{`7} \DeclareMathSymbol{8}{\mathord}{letters}{`8} \DeclareMathSymbol{9}{\mathord}{letters}{`9} %user file \documentclass{test} \begin{document} \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \noindent \tiny Now is the time. 0123.456\\ Now is the time. $0123.456$ \scriptsize \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \footnotesize \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \small \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \normalsize \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \large \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \Large \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \LARGE \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \huge \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \Huge \noindent Now is the time. 0123.456\\ Now is the time. $0123.456$ \end{document} \ProvidesFile{decimal.sty}[2011/06/03 v1.1 Package`decimal.sty'] \let\peri@d\. \def\.{\ifmmode\mbox{.}\else\expandafter\peri@d\fi} \DeclareMathSymbol{\cd@t}{\mathord}{symbols}{"01} \mathcode`\.="8000 {\catcode`\.=\active% \gdef.{\cd@t} } \endinput %% %% End of file `decimal.sty'.
- 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}
- TikZ: grid at certain x- and y-positionsby cis on January 3, 2026 at 9:45 am
I want to create a 6x5 dotted grid over an area with clearly defined width and height (\w and \h). Can I configure the grid to only display points at the intersections of the horizontal and vertical lines? I only get that with dash pattern=on 0pt off \w/6, for the x-positions. What do I have to do? By the way: I'm wondering, as a task out of pure interest, how one can adjust the grid. It's clear how to manually create the image using foreach-loops. \documentclass[margin=5pt]{standalone} \usepackage{tikz} \pgfmathsetlengthmacro\w{2cm} \pgfmathsetlengthmacro\h{3.2cm} \begin{document} \begin{tikzpicture}[] \draw[] (0,0) rectangle (\w,\h) node[anchor=south east, align=center]{ Dots only at \\ all intersections \\ of the horizontals \\ and the verticals}; \draw[orange, xstep=\w/6, ystep=\h/5] (0,0) grid (\w,\h); \end{tikzpicture} \begin{tikzpicture}[] \draw[] (0,0) rectangle (\w,\h); \draw[orange, xstep=\w/6, ystep=0*\h/5, % Dotted Style: line width=1.0pt, dash pattern=on 0pt off \w/6, line cap=round, ] (0,0) grid (\w,\h); \end{tikzpicture} \end{document}
- How to make latexmk run only onceby Clara on January 3, 2026 at 7:16 am
I now have a file with the following contents. Normally, I can run pdflatex main to compile. When compiling for the second time, the previous auxiliary file will be loaded, and everything is normal. I have a clear demand now, that is, by configuring latexmkrc file, when running latexmk command, it is the same as running pdflatex main directly. At present, when running latexmk, the default rule will be triggered, resulting in that even if running latexmk for the second time, the directory will not be generated. % main.tex \documentclass{article} \begin{document} \tableofcontents \section{111} \subsection{222} \section{333} \end{document} $pdf_mode = 1; $max_repeat = 1; @default_files = ('main'); >latexmk Initial Win CP for (console input, console output, system): (CP936, CP936, CP936) I changed them all to CP936 Rc files read: latexmkrc Latexmk: This is Latexmk, John Collins, 15 June 2025. Version 4.87. No existing .aux file, so I'll make a simple one, and require run of *latex. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Category 'other': Rerun of 'pdflatex' forced or previously required: Reason or flag: 'Initial setup' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -recorder "main.tex"' ------------ This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./main.tex LaTeX2e <2025-11-01> L3 programming layer <2025-11-14> (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)) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./main.aux) No file main.toc. [1{c:/texlive/2025/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux) )<c:/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb><c:/texl ive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on main.pdf (1 page, 18866 bytes). Transcript written on main.log. Latexmk: Getting log file 'main.log' Latexmk: Examining 'main.fls' Latexmk: Examining 'main.log' Latexmk: Missing input file 'main.toc' message in .log file: No file main.toc. Latexmk: Log file says output to 'main.pdf' Latexmk: Using bibtex to make bibliography file(s). Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Reasons for rerun Changed files or newly in use/created: main.aux main.toc Latexmk: Maximum runs of pdflatex reached without getting stable files Latexmk: Errors, so I did not complete making targets ---------------------- This message may duplicate earlier message. Latexmk: Failure in processing file 'main': 'pdflatex' needed too many passes ---------------------- Latexmk: Sometimes, the -f option can be used to get latexmk to try to force complete processing. But normally, you will need to correct the file(s) that caused the error, and then rerun latexmk. In some cases, it is best to clean out generated files before rerunning latexmk after you've corrected the files. C:\texlive\2025\bin\windows\runscript.tlu:933: command failed with exit code 12: perl.exe c:\texlive\2025\texmf-dist\scripts\latexmk\latexmk.pl I know some people may say, since you only run it once, there is no need to use latexmk, just use the pdflatex command. However, the scene I have encountered at present is that I can only execute latexmk command, so I need to configure latexmkrc file to achieve the same effect.
- Smartly break text into cells in naked longtblr environment?by Explorer on January 2, 2026 at 12:25 pm
I want a smartly breakable longtblr, but I have to manually assign a breaking point now. What I want is as follows: \documentclass{article} \usepackage[showframe,paperheight=10cm]{geometry} \usepackage{lipsum} \usepackage{tabularray} \usepackage{xcolor} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked,presep=2pt} \begin{document} \lipsum[2]\lipsum[2] \begin{mytblr}{ hlines={red},vlines={red}, colspec={X[l,m]},width=\linewidth } I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't\\ hurt me.%<--- I want smart break at here I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me. I can eat the glass and it doesn't hurt me.\\ \lipsum[2] \end{mytblr} \lipsum[2] \end{document} I hope that only with \lipsum, the longtblr could automatically break into two or three "cell"s. \documentclass{article} \usepackage[showframe,paperheight=10cm]{geometry} \usepackage{lipsum} \usepackage{tabularray} \usepackage{xcolor} \NewTblrTheme{naked}{ \DefTblrTemplate{foot}{empty}{} \SetTblrTemplate{foot}{empty} \DefTblrTemplate{head}{empty}{} \SetTblrTemplate{head}{empty} } \NewTblrEnviron{mytblr} \SetTblrOuter[mytblr]{long,theme=naked,presep=2pt} \begin{document} \lipsum[2]\lipsum[2] \begin{mytblr}{ hlines={red},vlines={red}, colspec={X[l,m]},width=\linewidth } \lipsum[2]\\ \lipsum[2] \end{mytblr} \lipsum[2] \end{document} It's NOT okay when I just use a bunch of text: \lipsum[2], I still need to manually decide the breaking point. Edited Since cfr wonder what is that actually for, I have the following example: I want to mimic some applicant table's template, it organize contents into breakable cells...
- 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}
- Tikz calendar customisationby Louis on January 2, 2026 at 8:45 am
I copied the code from Calendar with tikz and modified it to my requirements: Day abbreviations (successful). Bold for weekends (Successful). Translate month names (Unsucessful) [I also translated it in ./translator-months-dictionary-Afrikaans.dict] Highlight holidays with underline (Unsucessful) [I actually would like to circle them or shade them with light-grey (my colour printer is out of ink). The code is: \documentclass[border=5]{standalone} %\usepackage[afrikaans]{babel} \usepackage{polyglossia} \setdefaultlanguage[]{afrikaans} \usepackage[afrikaans]{translator} \usepackage{tikz} \setmainfont{FreeSerif} \usetikzlibrary{positioning,calendar} \usepackage{ulem} \ProvidesDictionary{translator-months-dictionary}{afrikaans} \providetranslation{January}{Januarie} \providetranslation{February}{Februarie} \providetranslation{March}{Maart} \providetranslation{April}{April} \providetranslation{May}{Mei} \providetranslation{June}{Junie} \providetranslation{July}{Julie} \providetranslation{August}{Augustus} \providetranslation{September}{September} \providetranslation{October}{Oktober} \providetranslation{November}{November} \providetranslation{December}{Desember} \providetranslation{Jan}{Jan} \providetranslation{Feb}{Feb} \providetranslation{Mar}{Mar} \providetranslation{Apr}{Ebr} \providetranslation{May}{Mei} \providetranslation{Jun}{Jun} \providetranslation{Jul}{Jul} \providetranslation{Aug}{Aug} \providetranslation{Sep}{Sep} \providetranslation{Oct}{Okt} \providetranslation{Nov}{Nov} \providetranslation{Dec}{Des} \pgfkeys{/tikz/bold/.code = {\bfseries{#1}}} \pgfkeys{/tikz/highlight/.code = {\uline{#1}}} \colorlet{darkgreen}{green!50!black} %\colorlet{holiday}{black!50} \newcommand{\calrow}[1]{\node[anchor=base east](Mon){M}; \node[base right=of Mon](Tue){D}; \node[base right=of Tue](Wed){W}; \node[base right=of Wed](Thu){D}; \node[base right=of Thu](Fri){V}; \node[base right=of Fri](Sat){S}; \node[base right=of Sat](Sun){S}; \node[darkgreen, above=of Thu]{\textbf{#1}};} \newcommand{\calperiod}[2][\currentyear]{% \calendar[dates=\currentyear-#2-01 to \currentyear-#2-last] if (weekend) [bold] \holidays;} \edef\currentyear{\the\year} \newcommand{\holidays}{% if (equals=01-01) [highlight]% if (equals=04-03) [bold]% if (equals=04-06) [bold]% if (equals=04-27) [bold]% if (equals=05-01) [bold]% if (equals=06-16) [bold]% if (equals=08-09) [bold]% if (equals=08-10) [bold]% if (equals=09-24) [bold]% if (equals=12-16) [bold]% if (equals=12-25) [bold]% if (equals=12-26) [highlight]% } \begin{document} \begin{tikzpicture}[scale=2, every calendar/.style={week list}, every holiday/.style={font=\bfseries}, year label/.style={ fill=white,text=darkgreen,font=\bfseries\Large }, current year/.store in=\currentyear, current year=2026 ] \matrix[% row 1/.style={darkgreen,node distance=.3ex},% row 3/.style={darkgreen,node distance=.3ex}, row 5/.style={darkgreen,node distance=.3ex}, row 7/.style={darkgreen,node distance=.3ex}, column sep=1ex,% draw=darkgreen,thick,rounded corners=5pt,% append after command={ \pgfextra{\edef\matrixname{\tikzlastnode}} node [year label/.try, right=1ex of \matrixname.south west] {\currentyear} node [year label/.try, right=1ex of \matrixname.north west] {\currentyear} node [year label/.try, left=1ex of \matrixname.south east] {\currentyear} node [year label/.try, left=1ex of \matrixname.north east] {\currentyear} } ]{% % first row: week day and month \calrow{January} & \calrow{February} & \calrow{March} \\ \calperiod{01} & \calperiod{02} & \calperiod{03} \\[1ex] % second row: calendar \calrow{April} & \calrow{May} & \calrow{June} \\ \calperiod{04} & \calperiod{05} & \calperiod{06} \\[1ex] % third row: week day and month \calrow{July} & \calrow{August} & \calrow{September} \\ \calperiod{07} & \calperiod{08} & \calperiod{09} \\[1ex] % forth row: calendar \calrow{October} & \calrow{November} & \calrow{December} \\ \calperiod{10} & \calperiod{11} & \calperiod{12} \\[1ex]\\ }; \end{tikzpicture} \end{document} This gives:
- which is better to use \pgfmathsetmacro or \tikzmath to do some calculations in Tikz?by Nasser on January 1, 2026 at 10:28 pm
My goal for the new year is to learn how to add and multiply numbers in tikz. Found one can use something like this \pgfmathsetmacro{\result}{int(2000-\i*50)}; \node[labelstyle] at (dot-\i.west) {year \result}; vs \tikzmath { \result= int((2000-\i*50)); {\node[labelstyle] at (dot-\i.west) {year \result};}; } Both produce same output Since I will be doing lots of calculations, which method is the better method to use? Is there a third method to look at which can be better/easier to use? complete MWE for first method \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ dot/.style={circle, fill=black, inner sep=1.5pt}, % Style for the black dots labelstyle/.style={left, font=\small} % Style for the labels (positioned to the left) ] % Define start and end points for the vertical line \coordinate (Start) at (0, 0); \coordinate (End) at (0, 11); % Draw the vertical line \draw (Start) -- (End); % Use a foreach loop to place equally spaced dots and labels \foreach \i in {0, 1, ..., 11} { % Place the dot as a node on the line \node[dot] (dot-\i) at (0, \i) {}; % Place the label to the left of the dot % The "left" anchor ensures the label sits to the left of the dot node \pgfmathsetmacro{\result}{int(2000-\i*50)}; \node[labelstyle] at (dot-\i.west) {year \result}; } \end{tikzpicture} \end{document} Complete MWE for the second method \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{math} \begin{document} \begin{tikzpicture}[ dot/.style={circle, fill=black, inner sep=1.5pt}, % Style for the black dots labelstyle/.style={left, font=\small} % Style for the labels (positioned to the left) ] % Define start and end points for the vertical line \coordinate (Start) at (0, 0); \coordinate (End) at (0, 11); % Draw the vertical line \draw (Start) -- (End); % Use a foreach loop to place equally spaced dots and labels \foreach \i in {0, 1, ..., 11} { % Place the dot as a node on the line \node[dot] (dot-\i) at (0, \i) {}; % Place the label to the left of the dot % The "left" anchor ensures the label sits to the left of the dot node \tikzmath { \result= int((2000-\i*50)); {\node[labelstyle] at (dot-\i.west) {year \result};}; } } \end{tikzpicture} \end{document} TL 2025