• How can text be added to the inner side header keyword?
    by Gary on January 4, 2026 at 3:53 am

    This example is a bit ugly and I tried to remove as much as possible from it. The line below \setuptexts [header][text] [chapternumber][pagenumber][pagenumber][chapternumber] sets the inner margin side of the header to show the chapternumber which is a lowercase romannumeral. Using \setupheader[text][leftstyle=\sc], its style can be changed; but how can text be added to it? Such as "Ch. " || chapternumber || ".". As soon as text is added to chapternumber in \setuptexts it becomes text also rather than a keyword. Thank you. For example, I'd like the II to be Ch. II or Ch. II.. \setuppagenumbering[alternative=doublesided,location=] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \starttext \startbodymatter[page=right] \definemargindata [inoutermargin] [outer][ margin=margin, width=\rightmarginwidth, line=1, location=outer, align=middle] \define[2]\MyHead{\inoutermargin{#1 #2}} \setuphead [section] [alternative=text, number=no, style=\MarginOuterFont, color=MargGray, before=, indentnext=yes, command=\MyHead, ] \settextcontent[header][text] [middletext][section][chapter] \setuptexts [header][text] [chapternumber][pagenumber][pagenumber][chapternumber] \define[2]\MyChapter{% \framed [frame=off, % Will be off. width={\textwidth + 0.5cm}, offset=none, toffset=1cm, loffset=-0.5cm, align=center]{% NOTE Testing with 'i' rather than 'I' because conversion (in \setuphead) is romannumerals, not Romannumerals. \doifelsevalue{structurenumber}{i}{% \smallcaps{Opening Title}\\ \blank[0.5cm] {\colored[r=1,g=1,b=1]{.}}#1.\\#2% }{% {\sc#1}.\\#2% } }} \definetext[chapter][footer][pagenumber] \definepagebreak [ChapterPageBreak] [yes] \setuphead [chapter][ page=ChapterPageBreak, header=empty, footer=chapter, numbercommand=\sc, command=\MyChapter, after=\blank[0.5ex], conversion=romannumerals] \setupheader[text][ leftstyle=\sc, after={\hrule height 0.8pt} ] \startchapter[title={Chapter One Title},marking={Chapter One Title}] A short paragraph in chapter one. \startsection[title={Section One Title},marking={Section One Title}] A short paragraph in chapter one section one. \stopsection \page \startsection[title={Section Two Title},marking={Section Two Title}] A short paragraph in chapter one section two. \stopsection \stopchapter \startchapter[title={Chapter Two Title},marking={Chapter Two Title}] A short paragraph in chapter two. \startsection[title={Section One Title},marking={Section One Title}] A short paragraph in chapter two section one. \stopsection \page \startsection[title={Section Two Title},marking={Section Two Title}] A short paragraph in chapter two section two. \stopsection \stopchapter \stopbodymatter \stoptext

  • Space before grid
    by Тимур Черняев on January 4, 2026 at 1:17 am

    I'm trying to create a worksheet-like template, and I run into some issues with the grid. Really big space pops up, and I don't know how to get rid of it. I'm using tikz. Here's the screenshot of the problem and fragments of code I believe will be useful. Thanks in advance! % ========================================================= % ==================== GRID SETTINGS ====================== % ========================================================= \newlength{\gridsize} \setlength{\gridsize}{5mm} \newcommand{\gridcolor}{black!40} \newcommand{\gridlinewidth}{0.3pt} ... % ========================================================= % =================== PAGE GRID FILL ====================== % ========================================================= \newcommand{\gridblock}[1]{% \noindent \begin{tikzpicture} \pgfmathsetlengthmacro{\gridheight}{#1\textheight} \pgfmathsetlengthmacro{\gridwidth}{\textwidth} \pgfmathsetlengthmacro{\cell}{\gridsize} \pgfmathsetmacro{\Nx}{ceil(\gridwidth/\cell)} \pgfmathsetmacro{\Ny}{ceil(\gridheight/\cell)} % Горизонтальные линии \foreach \i in {0,...,\Ny} { \draw[color=\gridcolor, line width=\gridlinewidth] (0, \i*\cell) -- (\gridwidth, \i*\cell); } % Вертикальные линии \foreach \i in {0,...,\Nx} { \draw[color=\gridcolor, line width=\gridlinewidth] (\i*\cell, 0) -- (\i*\cell, \gridheight); } \end{tikzpicture}% } % ========================================================= % ====================== PROBLEM+GRID ===================== % ========================================================= \newlength{\problemgridsep} \setlength{\problemgridsep}{2pt} \newenvironment{problemwithgrid}[1]{ \def\currentgridfraction{#1} \begin{problem} }{ \end{problem} \vspace{2pt} \gridblock{\currentgridfraction} }

  • tex4ebook: How to automatically adjust text size within tables?
    by Jack on January 3, 2026 at 10:41 pm

    Similar to the challenges with long tables described here, I also struggle with wide tables consisting of several columns, as they tend to run out of the screen. Is there a way to fix the width of a table to the screen size and automatically reduce the text size accordingly? While \adjustbox, for example, is working for fitting graphics to the screen size, it does not work for tables in my case. I also tried \resizebox, but was unable to find a working solution there either. Is there a solution to avoid the table running out of the screen other than statically (e.g. with \footnotesize) reducing the text size? Here is an MWE: \documentclass{article} \usepackage{tabularx} \usepackage{tex4ebook} \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \begin{tabularx}{\linewidth}{| l | l | l | l | X | l |} \hline \textbf{First column} & \textbf{Second column} & \textbf{Third column} & \textbf{Fourth column} & \textbf{Fifth column} & \textbf{Sixth column} \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline \end{tabularx} \resizebox{\linewidth}{!}{ \begin{tabularx}{\linewidth}{| l | l | l | l | X | l |} \hline \textbf{First column} & \textbf{Second column} & \textbf{Third column} & \textbf{Fourth column} & \textbf{Fifth column} & \textbf{Sixth column} \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline \end{tabularx} } \adjustbox{\linewidth}{ \begin{tabularx}{\linewidth}{| l | l | l | l | X | l |} \hline \textbf{First column} & \textbf{Second column} & \textbf{Third column} & \textbf{Fourth column} & \textbf{Fifth column} & \textbf{Sixth column} \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline Some text & More text & More text & More text & More text & More text \\ \hline \end{tabularx} } \end{document}

  • How to uplift old code that relies on \XeTeXinterchartoksfor CJK classes 1, 2, and 3
    by Mike 'Pomax' Kamermans on January 3, 2026 at 7:30 pm

    I have an old XeLaTeX document that relies on the XeTeX interchartoks with the predefined classes 0 for latin, and 1, 2, and 3 for CJK, and 255 as boundary. I updated that to the new(ish) boundary class 4096, but kept getting errors that my latin font didn't support any Japanese characters, suggesting that transitions from {0} to {1,2,3} didn't kick in. Writing a small test, it looks like classes 1, 2, and 3 are no longer prespecified, even though the XeTeX manual says they are, so... do I need to manually define a new class 1 through 3, or is there some command in addition to \XeTeXinterchartokenstate = 1 that I need to issue to make sure classes 1 through 3 are predefined? \documentclass{book} \usepackage{fontspec} \newfontfamily{\mainfont}{Palatino Linotype} \newfontfamily{\cjkfont}{Kozuka Mincho Pro} \XeTeXinterchartokenstate = 1 % explicitly mark a single Japanese kana as a custom class: \XeTeXcharclass `\ほ 999 % but assume classes 1, 2, and 3 are still predefined CJK: \XeTeXinterchartoks 1 0 = {\mainfont} \XeTeXinterchartoks 2 0 = {\mainfont} \XeTeXinterchartoks 3 0 = {\mainfont} \XeTeXinterchartoks 999 0 = {\mainfont} \XeTeXinterchartoks 4095 0 = {\mainfont} \XeTeXinterchartoks 0 1 = {\cjkfont} \XeTeXinterchartoks 0 2 = {\cjkfont} \XeTeXinterchartoks 0 3 = {\cjkfont} \XeTeXinterchartoks 0 999 = {\cjkfont} \XeTeXinterchartoks 4095 1 = {\cjkfont} \XeTeXinterchartoks 4095 2 = {\cjkfont} \XeTeXinterchartoks 4095 3 = {\cjkfont} \XeTeXinterchartoks 4095 999 = {\cjkfont} \begin{document} \mainfont Test 1: に Test 2: ほ \end{document} This results in: Which shows the first line seemingly ignoring the transition from class 0 to class 1, but the second line with the explicit class rule for ほ working just fine. The compile log seems to confirm this, where it complains that Palatino Linotype does not support に, suggesting we never switched classes: This is XeTeX, Version 3.141592653-2.6-0.999997 (MiKTeX 25.12) (preloaded format=xelatex.fmt) restricted \write18 enabled. entering extended mode (texated.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-24> (C:\Program Files\MiKTeX\tex/latex/base\book.cls Document Class: book 2025/01/22 v1.4n Standard LaTeX document class (C:\Program Files\MiKTeX\tex/latex/base\bk10.clo)) (C:\Program Files\MiKTeX\tex/latex/fontspec\fontspec.sty (C:\Program Files\MiKTeX\tex/latex/l3packages/xparse\xparse.sty (C:\Program Files\MiKTeX\tex/latex/l3kernel\expl3.sty (C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-xetex.def))) (C:\Program Files\MiKTeX\tex/latex/fontspec\fontspec-xetex.sty (C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty) (C:\Program Files\MiKTeX\tex/latex/fontspec\fontspec.cfg))) (texated.aux) Missing character: There is no に in font Palatino Linotype/OT:script=latn;langu age=dflt;! [1] (texated.aux) ) Output written on texated.pdf (1 page). Transcript written on texated.log.

  • Are there any tikz library or TeX package to create maps?, with items like rivers, trees, level curves, similar to RPG maps?
    by Mika Ike on January 3, 2026 at 6:45 pm

    From time to time I search if there is a practical/eficient way to create maps, similar to the next ones, even with a terrain texture or even contour level. Are there any tikz library appropiate for this purpose? Images from https://rpgmapsforge.com/

  • old-style numerals everywhere, including math mode
    by 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 newtxtxt 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: add '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 to pass relative coordinates to a \node via \pgfkeys
    by Guidone on January 3, 2026 at 3:20 pm

    What I am trying to achieve is to set a pgfkey (south of, for example), which would be a placeholder for the native option below=of <node> and to pass it to a custom command. Here is the working example: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{argumap}[2026/01/03 v.0.0 Argument Mapping] \LoadClass[11pt]{extarticle} \RequirePackage{fontspec} \defaultfontfeatures{Ligatures=TeX} \setmainfont{Brill} \RequirePackage{euler-math} \newfontfamily{\supscriptfont}{Euler Math}[Scale=0.55] \RequirePackage{polyglossia} \setdefaultlanguage{italian} \setotherlanguage[hyphenation=liturgical, usej=true, prosodicshorthands=true]{latin} %=================% % Document layout % %=================% % Page \RequirePackage{geometry} \geometry{a4paper,margin=20mm} \pagestyle{plain} \setlength{\parindent}{0pt} % Line spacing: 1.3 \RequirePackage{setspace} \setstretch{1.2} % Two-column engine \RequirePackage{paracol} %=================% % Utilities % %=================% %------------------ % Control Flow %------------------ \RequirePackage{xifthen} \RequirePackage{xstring}% used to operate on a string %------------------ % Graphics %------------------ \RequirePackage{graphics} \RequirePackage{tikz} \usetikzlibrary{% calc,arrows.meta,% positioning,% decorations.pathreplacing} % Styles \tikzset{ argStmnt/.style={ circle, draw, inner sep=0pt, minimum size=2.2em, font=\normalsize, }, arganDep/.style={ -{Latex[length=2.2mm,width=1.6mm]}, line width=0.4pt }, } \pgfkeys{% /argumap/.is family, /argumap/.cd, name/.store in=\elemName, position/.default={}, position/.store in=\elemPos, position,name } \NewDocumentCommand{\graphStmnt}{O{} m}{ \pgfkeys{/argumap/.cd, #1} \typeout{element name=[\elemName]} \ifthenelse{\isempty{\elemPos}} {\node[argStmnt] (\elemName) {$#2$};} { \typeout{element position=[\elemPos]} \node[argStmnt, \elemPos] (\elemName) {$#2$};} } \NewDocumentEnvironment{argugraph}{+b}{ \par\centering% \begin{tikzpicture}% #1 }{% \end{tikzpicture}\par} Here is the implementing example: \documentclass{argumap} \begin{document} \begin{argugraph} \graphStmnt[name=A]{A} \graphStmnt[name=B, position={below=of A}]{B} \end{argugraph} \end{document} When I compile it, I get the following error: element name=[A] element position=[] element name=[B] element position=[below=of A] ! Package pgfkeys Error: I do not know the key '/tikz/below=of A' and I am goin g to ignore it. Perhaps you misspelled it. See the pgfkeys package documentation for explanation. Type H <return> for immediate help. So, question is, how can I pass native /tikz options such as below=of to a custom document or environment with custom-defined options? Thanks for the help. Oh, and happy new year.

  • How to use .initial:n to initialize an `if`
    by dedded on January 3, 2026 at 3:00 pm

    I can't figure out how to use .initial:n to initialize an if key. I have tried \if_false, if_false, \c_false_bool, and c_false_bool; but those all return this error: ! LaTeX Error: Key 'foobar/foo' accepts boolean values only. Here is my `foobar.sty file: %\newif\iffoobar\foobarfalse % This works \DeclareKeys{ foo.if = foobar, foo.initial:n = \c_false_bool, % Does not work } \ProcessKeyOptions \endinput And here is a document which uses it: \documentclass{article} \usepackage[foo]{foobar} \begin{document} \iffoobar Howdy \else Hello \fi World \end{document}

  • TikZ: dot-syntax for coordinates / anchors (.) [e.g. (Box.A)]
    by cis on January 3, 2026 at 12:25 pm

    If I set some coordinates inside a node named (Box) (with path picture), say (A),(B),(C). How can I get the (from other codes known) (Box.A) syntax? \documentclass[margin=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ test/.style={minimum width=3cm, minimum height=2cm, fill=lightgray, draw, path picture={%% \draw[purple] (path picture bounding box.200) -- (path picture bounding box.-20) coordinate[pos=0.2, label=center:A](A) coordinate[pos=0.5, label=center:B](B) coordinate[pos=0.8, label=center:C](C); },%% }, ] \node[test](Box){}; \draw[red ,<-] (A) -- +(-135:1) node[right]{$\to$A}; % Needed: (Box.A), (Box.B), ... % \draw[red ,<-] (Box.A) -- +(-135:1) node[right]{$\to$A}; % \draw[red ,<-] (Box.B) -- +(-45:1) node[right]{$\to$B}; \end{tikzpicture} \end{document}

  • TikZ: overlay labels or nodes or unclip 'path picture'
    by cis on January 3, 2026 at 9:56 am

    Is there a way, to overlay labels or nodes inside a path picture, so that I can see the text? \documentclass[margin=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ test/.style={minimum width=6cm, minimum height=4cm, fill=lightgray, path picture={%% \draw[blue] (path picture bounding box.west) -- (path picture bounding box.east) coordinate[pos=0.3, label=center:B1](B1) coordinate[pos=0.6, label=center:B2(all good)](B2) coordinate[pos=0.9, label=center:B2](B3); % How to overlay labels here? ============= \draw[red] (path picture bounding box.north west) -- (path picture bounding box.north east) coordinate[pos=0.3, label={[overlay]center:A1}](A1)% no effect coordinate[pos=0.6, label=center:A2(not good)](A2) coordinate[pos=0.9, label=center:A2](A3); },%% }, ] \node[test]{}; \end{tikzpicture} \end{document}

  • TikZ: grid at certain x- and y-positions
    by 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 once
    by 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.

  • Getting PDF error when try \usemodule[tikz]
    by Gary on January 3, 2026 at 4:33 am

    I must being doing (or did) something very stupid; but would you please tell why this fails? \usemodule[tikz] % \usetikzlibrary{calc} \startTEXpage \starttext Hello % \starttikzpicture % \stoptikzpicture \stoptext \stopTEXpage If the \usemodule[tikz] line is commented, then it succeeds and the PDF prints "Hello". Otherwise, the PDF is ERROR and the CLI output is below. I can see it reads tikz loaded but do not see the error. Thank you. (If it helps, I'm using Manjaro Linux KDE; installed ConTeXt from the Pragma ADE download using the install.sh. I installed in my home directory and have texlive installed whereever the default closer to root. I set the PATH variable following the installation instructions; so, I don't think it's looking for tikz in a different directory.) resolvers | formats | executing runner 'run luametatex format': /home/gary/programs/context/context-linux-64/tex/texmf-linux-64/bin/luametatex --jobname="./se.tex" --socket --shell-escape --fmt=/home/gary/programs/context/context-linux-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/home/gary/programs/context/context-linux-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui --c:currentrun=1 --c:fulljobname="./se.tex" --c:input="./se.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/home/gary/programs/context/context-linux-64/tex/texmf-linux-64/bin" system > system > ConTeXt ver: 2025.12.20 23:15 LMTX fmt: 2025.12.23 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkxl close source > level 1, order 1, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname './se', input './se.tex', result './se' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './se.tex' modules > 'tikz' is loaded open source > level 2, order 3, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl' system | total runtime: 0.193 seconds of 0.228 seconds This is the log file it generated; but I think it's all already in the results from the CLI. system > system > ConTeXt ver: 2025.12.20 23:15 LMTX fmt: 2025.12.23 int: english/english system > system > 'cont-new.mkxl' loaded open source > level 1, order 1, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > beware: some patches loaded from cont-new.mkxl close source > level 1, order 1, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl' system > files > jobname './se', input './se.tex', result './se' fonts > latin modern fonts are not preloaded languages > language 'en' is active open source > level 1, order 2, name './se.tex' modules > 'tikz' is loaded open source > level 2, order 3, name '/home/gary/programs/context/context-linux-64/tex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'

  • Store the raw contents from python script into variable
    by Charlie on January 2, 2026 at 11:36 pm

    I'm trying to place a certain text inside a rectangle on several pages using TikZ (for more context, please see this question). The Text is obtained from a python script called from within a nested while loop. The script is called with a parameter given by the loop iteration number. The text is stored on a variable for later use once the nested loop is completed. Here is the code of the while loops: \newdimen\loremwidth \makeatletter \newcount\j \newcount\i \newcount\k \j=1 \i=1 \k=1 \newdimen\loremwidth \@whilenum \i<10\do{% \@whilenum \j<151 \do {% \lorem={\input{|python3 lorem/loremipsum.py --dolor Lorem --sit \the\j\space --amet 1}}% \setbox0=\hbox{\tiny \the\lorem}% \loremwidth=\wd0% \ifdim\loremwidth < 355 pt% \ifnum \c@loremcounter = 1\relax% \loremA={Lorem \the\j.1 - \the\lorem}% Here the \loremA is defined. \stepcounter{loremcounter}% \else% \ifnum\c@loremcounter=2\relax% \loremB={Lorem \the\j.1 - \the\lorem}% Here the \loremB is defined. \setcounter{loremcounter}{1}% \k=\j% \j=151% Breaks the nested loop \fi% \fi% \fi% \advance\j by 1\relax% }% \j=\k% next time the nested loop begins at the same value it was broken previously \the\loremA% Here \loremA is different from what it supposed to be, because of the value of \j \the\loremB% \loremB is exactly the same as \loremA because \j hasn't changed. \advance\j by 1\relax \advance\i by 1\relax% }% \makeatother The output of the python script is simply a text with no formatting chosen by a number between 1 and 150 and output simply by: print(lorem, flush=True) The problem is that the \loremA and \loremB are evaluated based on the value of \j at the point of use. The question is, how can I store the raw contents from this python script, in order to remove this dependency to \j? So far I have tried the following approaches: \newcommand \gdef\lorem{...} \edef \newtoks \immediate\write18 However, I haven't been able to get rid of the dependency of \j (I know there is a better name for this, but I don't know it. Sorry for my ignorance). Any suggestions? Here is the minimal code: \documentclass[a5paper,12pt, openany]{book} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tikzpagenodes} \usepackage{array} \usepackage{etoolbox} \usepackage{pgffor} \usepackage{fontspec} \usepackage[right=1cm, left=1.5cm, top=1cm,bottom=2cm]{geometry} \usetikzlibrary{arrows, positioning, calc, shapes} \pagestyle{empty} \newcounter{loremcounter} \setcounter{loremcounter}{1} \newtoks\loremA \newtoks\loremB \newtoks\lorem \begin{document} \newcounter{loremnumber} \newdimen\loremwidth \makeatletter \newcount\j \newcount\i \newcount\k \j=1 \i=1 \k=1 \newdimen\loremwidth \@whilenum \i<10\do{% \@whilenum \j<151 \do {% \lorem={\input{|python3 lorem/loremipsum.py --dolor Lorems --sit \the\j\space --amet 1}}% \setbox0=\hbox{\tiny \the\lorem}% \loremwidth=\wd0% \ifdim\loremwidth < 355 pt% \ifnum \c@loremcounter = 1\relax% \loremA={ Lorem \the\j.1 - \the\lorem}% \stepcounter{loremcounter}% \else% \ifnum\c@loremcounter=2\relax% \loremB={ Lorem \the\j.1 - \the\lorem}% \setcounter{loremcounter}{1}% \k=\j% \j=151% \fi% \fi% \fi% \advance\j by 1\relax% }% \j=\k% \the\loremA% \the\loremB% \advance\j by 1\relax \advance\i by 1\relax% }% \makeatother \end{document} Best regards, C.

  • How to make title visible, tcolorbox
    by user386618 on January 2, 2026 at 10:04 pm

    I'm trying to create a hexagon frame, here what i did. \documentclass[12pt]{article} \usepackage[english, russian]{babel} \usepackage[most]{tcolorbox} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tcolorbox}[enhanced, width=\linewidth, attach boxed title to top left={xshift=5mm, yshift=-3.5mm, yshifttext=-1mm}, frame hidden, colback=white, coltitle=green, fonttitle=\large\bfseries\color{green}, boxed title style={frame hidden, colback=white}, title=Идея, underlay={ \draw[draw=green, line width=2pt, fill=green!20] (0.4,0)--(frame.west)--($(frame.north)+(frame.west)-(frame.center)+(0.4,0)$)--($(frame.north)+(frame.east)-(frame.center)-(0.4,0)$)--(frame.east)--($(frame.south)+(frame.east)-(frame.center)-(0.4,0)$)--cycle; \draw[draw=green, line width=2pt, fill=white] ($(title.south)+(title.west)-(title.center)+(0.4,0)$)--(title.west)--($(title.north)+(title.west)-(title.center)+(0.4,0)$)--($(title.north)+(title.east)-(title.center)-(0.4,0)$)--(title.east)--($(title.south)+(title.east)-(title.center)-(0.4,0)$)--cycle;}] Hexagon box Hexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon boxHexagon box \end{tcolorbox} \end{document} I'm quite fine with that, unless the title is below the figure. How to make it visible? Also i want to receive any advice from comunity how to make code from this particullar frame better

  • Different vertical spacing for numbered and unnumbered chapters in the table of contents
    by ncant on January 2, 2026 at 9:57 pm

    I'm trying to create a table of contents for my book (that I'm making using the book class) like the one used in "Single Variable Calculus" by James Stewart, using the titletoc package. Below is a screenshot of the TOC in question: So far, I have successfully implemented the different font sizes and styles for each entry in the table of contents, as well as page number positioning. However, my book also includes a preface, which is implemented as an unnumbered chapter in the front matter. If you take a look at the image I posted above, you will notice that there is much less vertical space between the preface and the other two unnumbered chapters at the beginning of the book ("To the Students" and "Diagnostic Tests") than there is between the numbered chapters ("the unnumbered chapter entries are closer together"). Unfortunately, the code I am using does not allow me to set different horizontal spacing for unnumbered chapters — all chapters are spaced the same way vertically, globally. Here's a MWE with the code I'm using for setting up my TOC... \documentclass{book} \usepackage{titletoc} \titlecontents{chapter} [0em] {\bigskip}% global formatting {\sffamily\thecontentslabel\quad\enspace\MakeUppercase}% numbered chapters {\normalfont}% unnumbered chapters {\quad\contentspage}[\hrule\smallskip] \titlecontents{section} [1.8em] {\smallskip\normalsize}% global formatting {{\sffamily\bfseries\thecontentslabel}\quad\enspace}% numbered sections {}% unnumbered sections {\quad\contentspage} \begin{document} \frontmatter \tableofcontents \chapter{Preface} \chapter{To the student} \mainmatter \chapter{Test chapter} \section{A section} \section{Another section} \section{Yet another section} \end{document} ...and here's the result: Can you help me make the unnumbered chapter entries look like the ones in the TOC of Stewart's Book? EDIT: also, I wish the hrule not to be present under the unnumbered chapters.

  • LaTeX pgfornament package in ConTeXt?
    by Gary on January 2, 2026 at 8:06 pm

    Since the pgfornament package is PGF/TikZ (and it appears from the pgfornament site that there is a version that uses Lua), is it possible to use the package in ConTeXt somehow? I've used it by adding the images by number only and primarily the vectorian group. If one needs to draw something original and new, I suppose one should use MetaPost? Thank you. EDIT: What I mean is can the images (which I assume are instruction files not actual images; but I'm not sure) from this package be used directly in ConTeXt? With the package, all one has to do is \pgfornament[height=1.5cm]{70}, where 70 identifies the ornament, to get a Can the package be added with \usemodule in order to reference these by simple number, as opposed to learning how to create them (if that's even legal)? Thank you.

  • How to know the node of hpack_quality
    by rallg on January 2, 2026 at 5:52 pm

    This is related to another question that I recently asked, but it deserves a separate question. MWE: \documentclass[draft]{article} %% compile only with lualatex \directlua{ % Uncomment next line to see effect: % luatexbase.add_to_callback('hpack_quality', function() texio.write_nl('BOOHOO') end, 'boo_hoo') } \setlength\textwidth{50mm} \begin{document} zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz \end{document} Without the callback, the black overfull rule (black rectangle) appears. With the callback, the rectangle disappears. So it seems that instead of adding to the existing callback, add_to_callback replaces it! In the luatex manual 9.5.10, I see that hpack_quality allows the code to "return a node, for instance an overfull rule indicator." That sounds promising. But how can I do that? The manual does not say how I might describe that node. To put that another way, the node is un-knowed.

  • How can I make the arrow in the notomath font bold without getting rounded edges in LaTeX?
    by taiwan12 on January 2, 2026 at 4:43 pm

    I am trying to make the arrow symbol ($\rightarrow$) from the notomath font bold, but I run into an issue. When I use the \contour{black}{$\rightarrow$} command to apply boldness, it works, but the arrow becomes rounded around the edges, which I don't want. Is there a way to keep the arrow bold while avoiding the rounded edges? I'm currently using the following code: \documentclass{article} \usepackage[sfdefault]{notomath} \usepackage[outline]{contour} \contourlength{0.02em} \begin{document} $\rightarrow$ \contour{black}{$\rightarrow$} \end{document} With pdflatex:

  • Math spacing using an exponent
    by Jeff Strom on January 2, 2026 at 4:34 pm

    I use the notation $CX$ for the cone on $X$, and the notation $C^\circ X$ for the open cone (cone without its base). I'm finding that $CX$ always looks natural, but the spacing between $C^\circ$ and $X$ is often ugly -- sometimes there's too much space and sometimes there's not enough. The problem occurs the same way in display mode and in ordinary math mode. I tried making $C^\circ$ an operator, and putting it inside an \mbox, and various combinations of braces, with no effect. How can I make LaTeX solve the spacing problem for $C^\circ X$ the same way it solves the spacing problem for $CX$?

  • NMR data environment/formatting in latex
    by user30432971 on January 2, 2026 at 1:03 pm

    I tried using an environment for formatting my NMR data in LaTeX. Since the entries were old and didn't work properly, I tried updating them. See old references here: Chemmacros: Adjusting the properties of the coupling constant J Chemmacros: Font of coupling constant J How to reproduce typesetting of coupling constant in chemmacros Chemmacros: Font of coupling constant J Is there a better way to do this, since I am new to LaTeX? I still have the problem of an error appearing that says "must be inside math mode." I still didn't changed the fonts, since I also dont get if there is a reason for the scale of 0.83{beramono}. Edit: the distance between the coupling number #1 and the coupling constant J is somehow still too large. Edit 2: I forgot to ask how to change the sign of the position number from - to — (en dash) Thank you alot! If you want I would be also grateful if you show me your environments! 🙂 \documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{libertine} \usepackage[scaled=.83]{beramono} \usepackage{chemmacros} \chemsetup[spectroscopy]{ delta = (ppm) , pos-number = side , %use-equal, format = \bfseries, list=true } \usepackage{siunitx} \sisetup{ separate-uncertainty , per-mode = symbol , range-phrase = -- , detect-mode = false , detect-weight = true , mode = text , %text-rm = \libertineLF % use libertine with lining figures } \ExplSyntaxOn \cs_set_protected:Npn \__chemmacros_nmr_coupling:w (#1;#2) { % superscript coupling order \tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl {#1\!} % subscript nuclei \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl { \c_math_subscript_token { \ch{#2} } } \__chemmacros_nmr_coupling_aux_i:w } \ExplSyntaxOff \begin{document} \begin{experimental} \NMR(400)[C6D6] \val{2.01} (d, \J(2;)[Hz]{25.0}, \#{24}, \pos{5}) \end{experimental} \end{document}

  • 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?
    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 customisation
    by 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:

  • How to test # arguments in a \doifelse...?
    by Gary on January 2, 2026 at 5:10 am

    Would you please tell me how to get the \doifelse to recognize the #1 in order to compare it to a 1? It is always false; I assume because it is testing 1 == '#1' rather than the value #1 represents. The code works when I use doifelse{1}{1}{...}{...}. It's the \define[2]\MyChapter{% \framed [frame=on, % Will be off. width={\textwidth + 2cm}, offset=none, loffset=-2cm, align=center] { \doifelse{1}{#1} {Introduction Heading\\#1.\\#2} {#1.\\#2} }}% in the MWE below. Thank you. \definepapersize[book][width=8.16in,height=10.66in][letter] \setuppapersize[book] \setuppagenumbering[alternative=doublesided,location=] \definelayout[main][ location=duplex, backspace=1.33in, topspace=0.33in, top=0.33in, topdistance=0in, width=5.0in, height=fit, headerdistance=0.125in, footerdistance=0in, header=\lineheight, footer=0in, bottom=0.83in, bottomdistance=0in, leftedge=1.33in, rightmargin=1.375in, rightmargindistance=0.125in ] \setupbodyfont[libertinus,12pt] \definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[justified,hyphenated,hanging,hz] \starttext \startbodymatter \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \define[2]\MyChapter{% \framed [frame=on, % Will be off. width={\textwidth + 2cm}, offset=none, loffset=-2cm, align=center] { \doifelse{1}{#1} {Introduction Heading\\#1.\\#2} {#1.\\#2} }}% \definepagebreak [ChapterPageBreak] [yes] \setuphead [chapter][% page=ChapterPageBreak, header=empty, command=\MyChapter, conversion=Romannumerals] \startchapter [ title={An Over-Wide Chapter Title that Would Need to Wrap}, ] \samplefile{knuth} \stopchapter \stopbodymatter \stoptext

  • Aligning across multiple cases
    by BGreen on January 1, 2026 at 9:51 pm

    I would like to give two case-based equations and have them aligned. I've tried several different ways of doing it and always end up with something like this: \begin{equation}\begin{aligned} A & = \left\{\begin{matrix} bb \, , & q=0 \\ c \, , & q\ge1 \end{matrix}\right. \\ D & = \left\{\begin{matrix} ee \, , & q=0 \\ f \, , & q=1 \\ gggggg \, , & q\ge2 \end{matrix}\right. \end{aligned}\end{equation} The issue is that I want to have the bracket outside the matrix, so it can fit the size of the separate cases, and I also want to have the conditions aligned with one another, but I cannot do this unless they are not separated into two matrices for the brackets. I also need to have the expressions on the left side of the cases centered properly. Also, I would like to have the different cases to be left-aligned How can I have all three - the centered expressions on the left with properly-sized brackets, the aligned conditions, and the left-aligned cases?

  • Images bookleaf
    by Jack on January 1, 2026 at 9:04 pm

    I have some wide figures that I would like to set on facing pages so they can be compared. In this example the images fall on pages 3 and 4 which are overleaf. The images are a CFD profile and the equivalent bench-test results. \documentclass[a4paper,twoside]{ociamthesis} % Include necessary packages \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{float} \usepackage{lipsum} % ... any other packages you need \begin{document} \chapter{Introduction} The figures fall overleaf from each other, which makes comparison awkward \lipsum[] \begin{figure} \centering \includegraphics[width=1\linewidth]{example-image} \caption{bench} \label{fig:placeholder} \end{figure} \begin{figure} \centering \includegraphics[width=1\linewidth]{example-image} \caption{Enter Caption} \label{fig:placeholder} \end{figure} \end{document}

  • a square with watercolor-like fill and a hand-drawn appearance
    by Irreversible on January 1, 2026 at 12:53 pm

    I want to draw a square in LaTeX where the inside has a watercolor-like fill and a hand-drawn appearance. Is it possible to draw this with LaTeX?

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