• Extending width for a slightly wider chapter title?
    by Gary on January 2, 2026 at 3:18 am

    When a chapter title is a just a little wider than the allotted space, what is the correct way to widen just that area of the page? I tried starting from this example entitled Numbering and text on separate lines at https://wiki.contextgarden.net/Document_structure_and_headlines/Headlines_formatting and, although the width was increased to fit the title to a single line, all of the increase was on the outer-margin side rather than centered. I turned the frame on to confirm this. It appears that setting loffset to the negative of the increase in width results in a centered title. It produced the desired result in my document; but is this the correct approach? Is there a way to adjust the page width just in the title area? Also, if you don't mind (or should I ask a separate question?), in this same example, the chapter number is converted to roman numeral using the conversion option in \setuphead. I first tried to use \convertnumber{I}{#1}.\\#2}} in the definition of framed, which didn't work. Is there a way to pass a # parameter to \convertnumber as it's value rather than a literal? 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{% % \adaptlayout[main][width=+1in,backspace=-1in] \framed [frame=on, % Will be off. width={\textwidth + 2cm}, offset=none, loffset=-2cm, align=center] {#1.\\#2}} % {\convertnumber{I}{#1}.\\#2}} \definepagebreak [ChapterPageBreak] [yes] \setuphead [chapter] \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

  • reledmac/reledpar: Aligning parallel translations of a text, with different lengths, without blank spaces between lines in the shorter text
    by Somatic on January 2, 2026 at 2:03 am

    I am typesetting a parallel translation of Genesis, with Wycliffe (Middle English) on the left pages and Vulgate (Latin) on the right. My goal is to have each page have the same verses as the facing page, so for example: Pages Left (Wycliffe) Right (Vulgate) First 2 pgs Gen 1:1-10 Gen 1:1-10 Second 2 pgs Gen 1:11-20 Gen 1:11-20 And so on. But I do not want the starting points of the verses to be exactly aligned on the pages. I want each facing page to have the same verses, but within each page I want normal typesetting. This is an example of what I don't want. The Vulgate (right) versions of the verses are often shorter than the Wycliffe (left), so there are blank lines added between verses. This is what I want (formatted manually). The left is filled up with as many verses as will fit following normal typesetting, up to the end of verse 13 ("And God seid that it was good."). Then, the right has text up to verse 13 in the Vulgate. Instead of adding space between the shorter right-side verses, there's space at the end of the right page. Note that the verses don't start on the same lines across pages (left side verse 2 starts on left line 2, right side verse 2 starts on line 1) In a truly ideal situation, I'd like to have verse 14 start from there, so the page has verses 1-13 and the start of 14, with the next set of pages having the rest of 14 up to however many can fit on the left side. I've been trying reledmac/reledpar, but they don't have quite what I need. The first example (what I don't want) was made with each verse wrapped in a \pstart \pend, but that causes the blank spaces between verses on the right side (perfectly reasonable default behavior, but not the aesthetic I want). I'm not sure how to get the alignment. Ideally, I want some process to figure out: Find the number of verses that can fit on the left page Put the same number of verses on the right page But there doesn't seem to be a way to do that that isn't making each verse a \pstart \pend block, and thus running into the issue with blanks between verses in the right side. I've considered a few less good ideas: Figuring out the average number of characters that will fit on the left side, then writing a script to insert \pstart \pend breaks at the first verse before hitting that limit Messy and complicated, would need to account for variable width characters and repeat the work a lot if I decide to change other formatting like text size Arbitrarily deciding to put X number of verses per page and inserting \pstart \pends there Ugly if there happen to be several short verses on one page (lot of blank space). Can reledmac/reledpar handle this kind of alignment, where it gets the same "chunks" (verses/paragraphs) to be the same across pages, but without forcing blank lines between two corresponding chunks of different lengths? MWE, with the alignment style I don't want (verse by verse) % I used XeLaTeX \documentclass[twoside]{memoir} \usepackage{reledmac} \usepackage{reledpar} % not relevant to question, just removes the line numbers so the doc is clearer \makeatletter \renewcommand{\linenumrep}[1]{} % hide left-side line numbers \renewcommand{\linenumrepR}[1]{} % hide right-side line numbers \makeatother \setRlineflag{} % Remove the R from the right side margin % paper size (US letter 8.5x11in, folded into quartos) \usepackage{geometry} \geometry{ paperheight=5.5in, paperwidth=4.25in, bottom=0.5in, heightrounded } % For each verse \newcommand{\vs}[1]{% \pstart % I \pend manually, could probably have improved this {\textbf{#1}} } \begin{document} \begin{pages} \begin{Leftside} \beginnumbering \vs{1}In the bigynnyng God made of nouyt heuene and erthe. \pend \vs{2}Forsothe the erthe was idel and voide, and derknessis weren on the face of depthe; and the Spiryt of the Lord was borun on the watris. \pend \vs{3}And God seide, Liyt be maad, and liyt was maad. \pend \vs{4} And God seiy the liyt, that it was good, and he departide the liyt fro derknessis, \pend \vs{5} and he clepide the liyt, dai, and the derknessis, nyyt. And the euentid and morwetid was maad, o daie. \pend \vs{6} And God seide, The firmament be maad in the myddis of watris, and departe watris fro watris. \pend \vs{7} And God made the firmament, and departide the watris that weren vndur the firmament fro these watris that weren on the firmament; and it was don so. \pend \vs{8} And God clepide the firmament, heuene. And the euentid and morwetid was maad, the secounde dai. \pend \vs{9} Forsothe God seide, The watris, that ben vndur heuene, be gaderid in to o place, and a drie place appere; and it was doon so. \pend \vs{10} And God clepide the drie place, erthe; and he clepide the gadryngis togidere of watris, the sees. And God seiy that it was good; \pend \vs{11} and seide, The erthe brynge forth greene eerbe and makynge seed, and appil tre makynge fruyt bi his kynde, whos seed be in it silf on erthe; and it was doon so. \pend \vs{12} And the erthe brouyte forth greene erbe and makynge seed bi his kynde, and a tre makynge fruyt, and ech hauynge seed by his kynde. And God seiy that it was good. \pend \vs{13} And the euentid and morwetid was maad, the thridde dai. \pend \vs{14} Forsothe God seide, Liytis be maad in the firmament of heuene, and departe tho the dai and niyt; and be tho in to signes, and tymes, and daies, and yeeris; \pend \vs{15} and shyne tho in the firmament of heuene, and liytne tho the erthe; and it was doon so. \pend \vs{16} And God made twei grete liytis, the gretter liyt that it schulde be bifore to the dai, and the lesse liyt that it schulde be bifore to the niyt; \pend \endnumbering \end{Leftside} \begin{Rightside} \beginnumbering \vs{1} In principio creavit Deus cælum et terram. \pend \vs{2} Terra autem erat inanis et vacua, et tenebræ erant super faciem abyssi: et spiritus Dei ferebatur super aquas. \pend \vs{3} Dixitque Deus: Fiat lux. Et facta est lux. \pend \vs{4} Et vidit Deus lucem quod esset bona: et divisit lucem a tenebris. \pend \vs{5} Appellavitque lucem Diem, et tenebras Noctem: factumque est vespere et mane, dies unus. \pend \vs{6} Dixit quoque Deus: Fiat firmamentum in medio aquarum: et dividat aquas ab aquis. \pend \vs{7} Et fecit Deus firmamentum, divisitque aquas, quæ erant sub firmamento, ab his, quæ erant super firmamentum. Et factum est ita. \pend \vs{8} Vocavitque Deus firmamentum, Cælum: et factum est vespere et mane, dies secundus. \pend \vs{9} Dixit vero Deus: Congregentur aquæ, quæ sub cælo sunt, in locum unum: et appareat arida. Et factum est ita. \pend \vs{10} Et vocavit Deus aridam Terram, congregationesque aquarum appellavit Maria. Et vidit Deus quod esset bonum. \pend \vs{11} Et ait: Germinet terra herbam virentem, et facientem semen, et lignum pomiferum faciens fructum juxta genus suum, cujus semen in semetipso sit super terram. Et factum est ita. \pend \vs{12} Et protulit terra herbam virentem, et facientem semen juxta genus suum, lignumque faciens fructum, et habens unumquodque sementem secundum speciem suam. Et vidit Deus quod esset bonum. \pend \vs{13} Et factum est vespere et mane, dies tertius. \pend \vs{14} Dixit autem Deus: Fiant luminaria in firmamento cæli, et dividant diem ac noctem, et sint in signa et tempora, et dies et annos: \pend \vs{15} ut luceant in firmamento cæli, et illuminent terram. Et factum est ita. \pend \vs{16} Fecitque Deus duo luminaria magna: luminare majus, ut præesset diei: et luminare minus, ut præesset nocti: et stellas. \pend \endnumbering \end{Rightside} \end{pages} \Pages \end{document} Similar questions: improving different textwidths of facing sides with reledpar ** Here, they tried to solve the same issue (longer translation on left, shorter Latin on right) to avoid white space between chunks, but they approached it by narrowing the width of the textblock for the right. Side notes: The source texts do have chapter breaks, but the first chapter ends at verse 31, so each chapter is often more than a page. I'm using a small 5.5x4.25 page size because I'm going to physically print and bind this by hand, and that's the most convenient for my printer and materials (it's standard US long grain letter paper, folded into quartos and turned so it's short grain). If not for the small page size, I could probably use the chapter breaks as natural breakpoints. Another example showing the kind of alignment I want, though in this case it's from a two-column layout, instead of a two-page layout (from a 19th century Bible). In this case, the two translations are much closer in length than my Middle English vs. Latin.

  • 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

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

  • Can I position images in book-view
    by Jack on January 1, 2026 at 9:04 pm

    I have some large (0.95x width) figures that I would like to set on facing pages so they can be compared. In my document some will come out like that but some will be overleaf from each other. Is there a simple way to insert a \newpage to align the pages? I'm using this handy template- not sure if that is relevant. \documentclass[a4paper,twoside]{ociamthesis}

  • XeLaTeX treating \XeTeXcharclass unicode argument as extended ascii?
    by Mike 'Pomax' Kamermans on January 1, 2026 at 8:11 pm

    I'm running XeLaTeX on Windows, with the terminal set to utf-8 (via chcp 65001) and my files flagged as utf-8 encoded, and yet somehow the following line: \XeTeXcharclass `\𠃍 5 % L shape with the corner in the upper right causes the following parsing error: (includes/xelatex/interchar.preamble ! Improper alphabetic constant. <to be read again> \Í l.93 ^^I\XeTeXcharclass `\Í 5^^I% L shape with the corner in the upper right No pages of output. Transcript written on texated.log. And that's... not Unicode? What might be the reason for XeLaTeX getting this wrong? Simple MRE that consistently produces this result on my windows 10 machine: \XeTeXinputencoding"UTF-8" \documentclass{book} \XeTeXinterchartokenstate = 1 \XeTeXcharclass `\𠃍 5 \begin{document}\end{document} And full xelatex test.tex parse log: This is XeTeX, Version 3.141592653-2.6-0.999996 (MiKTeX 24.4) (preloaded format=xelatex.fmt) restricted \write18 enabled. entering extended mode (test.tex LaTeX2e <2024-06-01> patch level 2 L3 programming layer <2024-05-27> (C:\Program Files\MiKTeX\tex/latex/base\book.cls Document Class: book 2024/02/08 v1.4n Standard LaTeX document class (C:\Program Files\MiKTeX\tex/latex/base\bk10.clo)) ! Improper alphabetic constant. <to be read again> \Í l.4 \XeTeXcharclass `\Í 5 ? x No pages of output. Transcript written on test.log.

  • LaTeX beamer: Customize miniframes headline to be more compact and only represent subsections not frames [duplicate]
    by bantix on January 1, 2026 at 7:42 pm

    This is my current headline: This is my main.tex: \documentclass[lualatex,handout,compress]{beamer} % Theme \usepackage{etoolbox} \useoutertheme[subsection=false]{miniframes} \usetheme{HSK-LTX} \begin{document} \section{Test} \begin{frame} \frametitle{Test} \end{frame} \end{document} And my beamerouterthemeHSK-LTX.sty: \ProvidesPackage{beamerouterthemeHSK-LTX}[2025/12/17 v0.1] \makeatletter \patchcmd{\slideentry} {\advance\beamer@tempdim by -.05cm} {\advance\beamer@tempdim by\beamer@vboxoffset\advance\beamer@tempdim by\beamer@boxsize\advance\beamer@tempdim by 1.2\pgflinewidth} {} {} \patchcmd{\slideentry} {\kern\beamer@tempdim} {\advance\beamer@tempdim by 2pt\advance\beamer@tempdim by\wd\beamer@sectionbox\kern\beamer@tempdim} {} {} \setbeamertemplate{footline}{ \ifnum\thepage>1\relax \hbox{% \begin{beamercolorbox}[wd=.8\paperwidth, ht=5mm, leftskip=4mm]{footline} \usebeamerfont{footlinie}% \inserttitle, \insertauthor, \today \end{beamercolorbox}% \begin{beamercolorbox}[wd=.2\paperwidth, ht=5mm, leftskip=1mm plus1fill, rightskip=4mm]{footline} \usebeamerfont{footline}% \insertframenumber\,/\,\inserttotalframenumber \end{beamercolorbox}% } \vskip2.5mm \fi } \makeatother Problem The dots represent frames, but I want them to represent subsections, so clicking them just redirects to the first frame of the subsection and theres less clutter if i have a lot of frames. The headline should be more compact in the horizontal direction so that space between the last dot and the next section title is removed.

  • Is there a way to use more than 1 type of Blackboard font in a single document?
    by userא0 on January 1, 2026 at 2:32 pm

    I am writing a Latex document using Lyx and am interested in using two different Blackboard fonts in my document. Ideally I would like to "borrow" an extra blackboard font from one of these (page 49) . To be clear, Latex has never been my strongest suit, and my rule of thumb is "If it ain't broke don't fix it". What I am trying to say is that I don't really understand how and why Latex operates the way it does. So I would like to apologize in advanced for the (probably) bad and unnecessary code in the question (I really tried to narrow things down to the minimum). Please if you are considering on writing an answer/comment, please try to keep it as basic (and as detailed as possible). A few things to note, that might be relevant; My document is written in two languages (English and Hebrew). I am using the Palatino font via the following code in my preamble: \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}[math-style=french, Scale=1] \setmathfont{STIXTwoMath-Regular.otf}[range={cal, bfcal}, StylisticSet=0] \usepackage[scr=rsfs]{mathalfa} Here is some of the preamble code in have in my document (I think the rest is irrelevant); \makeatletter \@addtoreset{section}{part} \makeatother \renewcommand{\thesection}{\arabic{section}} \usepackage{fancyhdr} \pagestyle{fancy} \fancyfoot[C]{$\mathbf{\color{violet}{\thepage}}$} \usepackage[dvipsnames]{xcolor} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}[math-style=french, Scale=1] \setmathfont{STIXTwoMath-Regular.otf}[range={cal, bfcal}, StylisticSet=0] \usepackage[scr=rsfs]{mathalfa} \usepackage{tcolorbox} \tcbuselibrary{breakable} \tcbuselibrary{skins} \tcbuselibrary{external} \usepackage{caption}[tableposition=top] \usepackage{float} \usepackage{multicol} \setlength{\columnsep}{12pt} % Space between columns \setlength{\columnseprule}{0.8pt} % Line thickness between columns

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

  • Customize multiple choice question
    by Hưng Trần on January 1, 2026 at 10:27 am

    I am using ex_test package and I want to customize the true/false and short answer question as follows 4 statements should be in a table, and there are check boxes for student like in Picture 1. For short answer (command is \par\shortans[oly]{1234}, I want four boxes is rounded like in Picture 2. When I change the command kindTF to kindTF=1t (in the main), the header of the table is repeated in two pages like in Picture 3, which I do not want it to. Please help me to solve it. Since the main is quite large, I will post the link here, including ex_test package. https://drive.google.com/file/d/10nrnleVUB-6pzix4u7umQZmwUwZlN5Yu/view?usp=sharing Thank you guys very much!

  • How to control vertical alignment of the hyperref box around printed citation label in tex with natbib
    by Mochib on January 1, 2026 at 10:23 am

    The hyperref link boxes around my citation labels appear vertically too small (“smashed”). I would like to add a \vphantom{Xg} (or something similar) so that all citation link boxes have a consistent vertical size throughout the document. With natbib, the link box size stays independent of the line contents, unlike cite, amsrefs or biblatex, where tall material (e.g., fractions) can enlarge the hyperlink box. I would therefore like to keep natbib and only increase the vertical size of the hyperref boxes. Or possibly make cite or amsrefs consistently the same size regardless of the line content. I am not very experienced with LaTeX macro customization and have not succeeded so far. \documentclass{article} \usepackage{hyperref} \usepackage[numbers,square]{natbib} \usepackage{etoolbox} \makeatletter \AtBeginDocument{% \pretocmd{\NAT@citex}{\vphantom{Xg}}{}{}% } \makeatother % \newcommand{\citexbox}[1]{% % \hbox{\vphantom{Xg}#1}% % } % \let\oldcitep\citep % \renewcommand{\citep}[1]{% % \citexbox{\oldcitep{#1}}% % } \begin{document} This is a citation test. The box is smashed: \citep{test}. \begin{thebibliography}{1} \bibitem{test} Author. \newblock \emph{Title}. \end{thebibliography} \end{document} Thanks.

  • How do supress chapter title dispalying without affecting TOC
    by Will Kim on January 1, 2026 at 5:45 am

    I have a book that consists of six chapters (five chapters plus an Answers section). I am using titlesec to display chapter headings such as “Chapter 1: NATURAL NUMBERS”, “Chapter 2: EQUATIONS”, and so on. \titleformat {\chapter} % command to format [block] % shape: hang, display, block, frame, etc. {\bfseries\Large} % format of label + chapter title {\chaptertitlename\ \thechapter:} % label "Chapter 1:" {1.5ex} % separation between label and chapter title {} % code before \titlespacing*{\chapter}{0pt}{0pt}{-10pt} How can I modify the titlesec settings so that the chapter title for the Answers section appears simply as “Answers”, without the prefix “Chapter 6:”, while still being included in the table of contents? I tried using \chapter*{Answers}, but this removes the entry from the table of contents, which is not what I want. Thank you!

  • Does ConTeXt compress space between paragraphs to better fit page?
    by Gary on January 1, 2026 at 5:26 am

    If the title of this post is true, what is this called and how can a minimum distance be set? I used \setupwhitespace[quarterline] globally and have a few definitions that add a bit more space before a heading using \blank[...]; but I see paragraphs that appear to ignore this to fit another line of text on the page. I didn't see anything in \setupalign except bottom and line and they didn't appear to make any difference. Thank you. I see that p.211 of A not so short introduction to ConTeXt mentions an elasticity when using a symbolic name rather than an defined dimension; but then gives reasons why symbols are better. And there is an option of fixed in \setupwhitespace but that doesn't appear to make a difference either. EDIT: ADDED LATER This isn't a very good example because the spacing difference occurs only at a location of a section title moved to the margin; and, in my "real" document, it occurs at the location of normal paragraphs within a section. And I had to add a lot of sample text to get it to occur. Nonetheless, this illustrates a similar change. In moving the section title to the outer margin, vertical space appears to be left for where the title would've been within the body text, even though the title is in the margin. Thus, I used the beforesection option and \vskip -1.25\lineheight to remove that space. Whether or not -1.25\linehight is the correct adjustment isn't the primary issue. The issue (what I'm doing wrong) is that, on page 3, the paragraph beginning with "Thus, I came to the conclusion..." is much closer to the paragraph above it than the other paragraphs and than the paragraph on page 5 beginning with "The Earth, as a habitat...". Both of these are the first paragraph following a section title and they should both have a vertical spacing adjustment of -1.25\lineheight; but the spacing is different. It appears that, if the space on page 3 was not compressed, the last line of the page would be moved to the next page, starting page 4 with a single line ending a paragraph (I forget whether that is an orphan or a widow). In my document, all the pages thus far have the same number of lines per page and has this reduced spacing in some locations where it is no an orphan/widow scenario; but I haven't been able to make an example that reproduces that yet. Perhaps, this example is enough to point me to what I'm failing to configure properly in ConTeXt. 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] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \definecolor[MargGray][r=0.425,g=0.535,b=.688] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \definecommand MyPar {I'm trying to re-typeset on 8.5 by 11 paper an old book that was printed on smaller paper, such that the author did not need to have section titles within the text body but used the right-hand header. An issue that arises is that, on the larger paper, instances occur in which more than one of these sections lands on facing pages, meaning only one can be in the right-hand header which would leave the other without any indication at all. In trying to stay as true to the original as possible without interrupting the body, I placed these section titles in the outer margin, added them also as sections in the right-hand header but suppressed them within the text body; such the last section on the page appeared in the right-hand header and all appeared in the outer margin.} \starttext \startbodymatter \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, beforesection=\vskip -1.25\lineheight, indentnext=yes, command=\MyHead, ] \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \startchapter [ title={Chapter Title}, ] \dorecurse {3}{\MyPar \par \samplefile{ward} \par \samplefile{knuth} \par} \startsection [ title={A Knuth\\section title}, marking={A Knuth section title 1}, list={} ] \samplefile {knuth} \stopsection \dorecurse {3}{\MyPar \par \samplefile{ward} \par \samplefile{knuth} \par} \startsection [ title={A Ward\\section title}, marking={A Ward section title 2}, list={} ] \samplefile {ward} \stopsection \dorecurse {2}{\MyPar \par \samplefile{ward} \par \samplefile{knuth} \par} \stopchapter \stopbodymatter \stoptext

  • How can I see all \input contents as a single LaTeX file? [duplicate]
    by m__mdy__m on December 31, 2025 at 7:40 pm

    I have a main LaTeX file that uses many \input{...} commands to include content from other files, like this: \input{frontmatter/preface} \input{parts/part01/part01} \input{backmatter/note} I want to see the final content as if all \input files were combined into one big .tex file, so I can check everything in one place. Is there a simple way or tool to do this?

  • What is the correct way to doc-string a Lua function?
    by Jasper on December 31, 2025 at 6:27 pm

    What is the correct way to doc-string a Lua function? I just picked this up from reading the code of others: --- the dot product --- @param u table<table<number>> a vector --- @param v table<table<number>> another vector --- @return number the dot product local function dot_product(u, v) local a, b = u[1], v[1] return a[1]*b[1] + a[2]*b[2] + a[3]*b[3] end e.g., dot_product({{1,1,1,2}},{{1,2,3,2}}) would return 6. But I want to know if this is actually correct, or if there is a better way. I can't seem to find a documentation anywhere.

  • lua-typo not detecting underfull in minipage
    by rallg on December 31, 2025 at 5:25 pm

    It appears that lua-typo does not report underfull lines as a typo flaw, when the flawed text is within a minipage. MWE, linux, TeXlive2025, up-to-date: \documentclass{article} % Compile only with lualatex. \RequirePackage{fontspec} \setmainfont{Latin Modern Roman} % Next line is quick alternative to microtype: \adjustspacing=2\relax\expandglyphsinfont\the\font 20 20 5\relax \RequirePackage[All]{lua-typo} % current 2024-04-18 v.0.87 \begin{document} \setlength\parindent{0pt} Hello, World.\\What's up?\\Anything new?\\Say what?\\Goodbye.\par % Uncomment next line, for case A: % | |\linebreak Hello, World.\par % Uncomment next line, for case B: %\begin{minipage}{.4\textwidth}| |\linebreak Hello, World.\par\end{minipage} \end{document} In either case A or case B, the compiler correctly detects the underfull line. Case A also reports the underfull typo flaw. But case B does not. Does not depend on choice of font. Does not depend on the \adjustspacing... line. Can anything be done about that? Or is is something that is better ignored? Note: As with many MWE, this one is contrived for the purpose. I do not ordinarily use \linebreak. The same behavior is seen with a narrow column and a block of text.

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

  • Pic or Shape for collection of ready to use objects?
    by Sammy on December 31, 2025 at 2:25 pm

    For the graphics I use on my physics exercise sheets made with TikZ I often use the same objects (hooks, masses, carts, pulleys, force gauges,...). So instead of copy-pasting and modifying the code of these objects I think it makes sense to make them into a ready to use object. There are three ways I know of to make that happen: TeX macros, pics and shapes. There are some features I wish the implementation of these objects to have and need some advice on how to implement it in order to have those features: An object should have multiple anchors so I can easily use certain points for further construction and choose which anchor to use for the placement (so there is no need to calculate that stuff manually). The hook for example could be placed at it's base or the actual hook and either one should be available afterwards for further placement of objects or paths. A default style should be set, i.e. the fill color or shading of the mass body, that can be overwritten. If placed inside a scope that changes shift, rotation, scale, line width,... these changes should automatically also apply to the object as a whole. I want to be able to construct new objects from already existing objects, i.e. I want to be able to use the hook as part of the mass, force gauge and cart. Right now I'm leaning towards defining new shapes, even tho I haven't used low level pgf before. As far as I can see 1 and 3 are no problem with shapes. I feel like 2 could also be achieved (any hints are appreciated - maybe defining a new style that uses that shape?). I however have no Idea if or how to make 4 work in defining a new shape. Pics on the other hand would make 2 and 4 easy as far as I can imagine. But they don't respond to the settings of a scope (3). Also anchors (1) are not natively supported but using tikzmark one answer to this question Anchoring TiKZ pics suggests this could be achieved as well (although I imagine it to be not quite as powerful as a new shape and takes two compilation runs if I understood correctly). Any thoughts, hints or pieces of advice are very welcome. I hope I described the setting clear enough. Edit The following Example is not meant to be beautiful but hopefully helps to illustrate the issue: \documentclass[tikz]{standalone} \usetikzlibrary{calc} \usetikzlibrary{tikzmark} \begin{document} \tikzset{ hook/.pic={ \draw[double=gray!80, double distance=1.4pt] (0,0) .. controls (0,-1.5) and (0,{1/sin(45)-2.5}) .. ($(45:1)+(0,-2.5)$) arc(405:140:1); \node[inner sep=2mm] (-hole) at (0,-2.5) {}; } } \tikzset{ cart/.pic={ \shadedraw[left color=blue, right color=blue!50] (-3,0) rectangle (3,2); \shadedraw[left color=black, right color=gray] (2,-.8) circle (.8); \shadedraw[left color=black, right color=gray] (-2,-.8) circle (.8); \pic[transform shape,rotate=90,scale=.5] (h) at (3,1) {hook}; \coordinate (-front-wheel) at (2,-1.6); \coordinate (-back-wheel) at (-2,-1.6); \node[inner sep=2mm] (-hook) at (h-hole) {}; } } \begin{tikzpicture} \draw (0,0) -- (8,0) -- (8,2); \pic[pic anchor=(-back-wheel),scale=.5] (cart) at (.5,0) {cart}; \pic[rotate=270,xscale=-1,scale=.25] (hook) at (8,0|-cart-hook) {hook}; \draw[ultra thick, line cap=round] (cart-hook) -- (hook-hole); \end{tikzpicture} \end{document} So using a pic with tikzmark (and transform shape as I've discovered) seems to check all the requirements. Can this also be achieved with a custom shape? As in this solution I dislike a few things: tikzmark needs two compilation runs no border anchors can be defined (at least I don't know how) It seems to me all anchors are defined every time a pic is inserted and not calculated when needed as with shapes. I'm not sure about the impacts on compilation time.

  • How to make margin notes appear correctly in two column format when using \newgeometry
    by stefaniecg on December 31, 2025 at 1:36 pm

    I need to redefine the geometry with the \newgeometry command as I've placed in this example. My problem is I'm missing a parameter in the \newgeometry{top=20mm, bottom=20mm, etc..} configuration such that the marginnotes are placed incorrectly in the middle of the text. But, when I only use two column format \newgeometry{twocolumn=true} it works. How to make margin notes appear correctly in two column format of scrbook? even when re-defining the margins \documentclass{scrbook} \usepackage{lipsum} \usepackage{geometry} \usepackage{marginnote} \begin{document} \newgeometry{left=20mm,right=20mm,top=20mm,bottom=20mm,twocolumn=true} % this does not work % \newgeometry{twocolumn=true} % this works \chapter{A short story} Lorem ipsum dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, placerat ac, adip-iscing vitae, felis. Curabitur dictum gravida mau-ris. Nam arcu \marginnote{hola} holahola libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. 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. Aenean faucibus. \marginnote{note} notenote Morbi dolor nulla, malesuada eu, pulvinar at, mollisac, nulla. Curabitur auctor semper nulla. Donec var-ius orci eget risus. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \lipsum[1-2] Lorem ipsum dolor sit amet, consectetuer adipiscingelit. Ut purus elit, vestibulum ut, placerat ac, adip-iscing vitae, felis. Curabitur dictum gravida mau-ris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \marginnote{bye} byebye Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et ne-tus et \marginnote{hola} holahola malesuada fames ac turpis egestas. 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. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar \marginnote{other} othertest at, mollisac, nulla. Curabitur auctor semper nulla. Donec var-ius orci eget risus. Duis nibh mi, congue eu, accumsaneleifend, sagittis quis, diam. Duis eget orci sit ametorci dignissim rutrum. \end{document}

  • coffins scope/groups
    by Frigeri on December 31, 2025 at 1:10 pm

    The current implementation of coffins seems to create two groups. (1) That's something I can rely on? In the example below, the double \aftergroup did the trick, but, of course, it will work as long as the coffins implementation remains the same. (2) besides \tracinggroups, there is another way to find out that? (grouping level) \documentclass{article} \begin{document} \ExplSyntaxOn \bool_new:N \l__pack_tmpa_bool \bool_new:N \l__pack_tmpb_bool \bool_new:N \l__pack_tmpc_bool \coffin_new:N \l__pack_tmp_coffin \group_begin: \hcoffin_set:Nn \l__pack_tmp_coffin { \bool_set_true:N \l__pack_tmpa_bool \bool_set_true:N \l__pack_tmpb_bool \bool_set_true:N \l__pack_tmpc_bool \group_insert_after:N \bool_set_true:N \group_insert_after:N \l__pack_tmpb_bool \group_insert_after:N \group_insert_after:N \group_insert_after:N \bool_set_true:N \group_insert_after:N \group_insert_after:N \group_insert_after:N \l__pack_tmpc_bool } \bool_if:NTF \l__pack_tmpa_bool {a~true} {a~false} \par \bool_if:NTF \l__pack_tmpb_bool {b~true} {b~false} \par \bool_if:NTF \l__pack_tmpc_bool {c~true} {c~false} \group_end: \ExplSyntaxOff \end{document}

  • The table is not centering in the item
    by M. Logic on December 31, 2025 at 12:18 pm

    A MWS is as following. \documentclass{article} \renewcommand{\labelenumi}{(\theenumi)} \usepackage{enumitem} \setenumerate[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt} \setitemize[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt,align=left} \setdescription[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt,align=left} \setlist[enumerate]{leftmargin=2em,align=left,labelwidth=2em,labelsep=0em}%\parindent=2em \setlist[itemize]{leftmargin=1em,align=left,labelwidth=1em,labelsep=0em} \setlist[description]{leftmargin=2em,align=left,labelwidth=1em,labelsep=1em} \usepackage{amsthm} \theoremstyle{theorem} \newtheorem{theorem}{Theorem}[section] \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{remark}[theorem]{Remark} \usepackage{longtable, makecell, booktabs, multicol, multirow} \usepackage{lipsum} \begin{document} \section{Test} \begin{remark} \begin{enumerate} \item \lipsum[1] \begingroup %\setlength{\LTleft}{0pt}\setlength{\LTright}{0pt} \begin{longtable}{p{1cm}<{\centering}p{1cm}<{\centering}p{1.5cm}<{\centering}p{1.5cm}<{\centering}p{2.5cm}<{\centering}} \caption{On Implications} \\\toprule $\phi$&$\psi$&$\phi\to\psi$&$\phi\wedge\psi$&$\phi\wedge\psi\to\phi$\\ \midrule\endfirsthead% \midrule $\phi$&$\psi$&$\phi\to\psi$&$\phi\wedge\psi$&$\phi\wedge\psi\to\phi$\\ \midrule\endhead \midrule\endfoot \bottomrule\endlastfoot 1&1&1&1&1\\ 1&0&0&0&1\\ 0&1&$x$&0&1\\ 0&0&$y$&0&1\\ \end{longtable} \endgroup \lipsum[2] \item \lipsum[3] \end{enumerate} \end{remark} \end{document} As you see, the table is centering on the page in in horizontal direction but not centering in the item of the enumerate environment. Is there any way to make the table be centering in the item of the enumerate environment?

  • How to properly generate nested pgfkeys procedurally?
    by dsacre on December 31, 2025 at 10:57 am

    Task Consider the following: One needs to store a over time varying amount of pgfkeys entries with a nested data structure. All the entries have the same structure, but the content may vary. So one defines a macro to handle the pgfkeys structure initialization automatically when the user sets the data. Artificial Example: Inventory (MWE) \documentclass[parskip=full]{scrreprt} \usepackage{pgffor} \usepackage{pgfkeys} % DESCRIPTION: Set up inventory entries manually \pgfkeys{ /handlers/.is setter/.code=\pgfkeysedef{\pgfkeyscurrentpath}{% \noexpand\pgfqkeys{\pgfkeyscurrentpath}{##1}% },% /inventory/.cd, Manual 5 Speed/.is setter, Manual 5 Speed/inventory id/.initial = XXXXXXXXXX, Manual 5 Speed/product/.is setter,% Manual 5 Speed/product/manufacturer/.initial = EMPTY, Manual 5 Speed/product/product id/.initial = EMPTY, Manual 6 Speed/.is setter, Manual 6 Speed/inventory id/.initial = YYYYYYYYYY, Manual 6 Speed/product/.is setter,% Manual 6 Speed/product/manufacturer/.initial = EMPTY, Manual 6 Speed/product/product id/.initial = EMPTY } % DESCRIPTION: Logic for creating pgfkey "database" entry automatically and setting them to user specified data % ARGUMENTS: #1 = entry product, #2 = entry data \newcommand{\generateEntry}[2]{ % DESCRIPTION: Creating the pgfkeys "family" and intialize with default values \pgfkeys{ /handlers/.is setter/.code=\pgfkeysedef{\pgfkeyscurrentpath}{% \noexpand\pgfqkeys{\pgfkeyscurrentpath}{##1}% },% /inventory/#1/.cd, inventory id/.initial = ZZZZZZZZZZ, product/.is setter,% product/manufacturer/.initial = EMPTY, product/product id/.initial = EMPTY } % DESCRIPTION: Setting the data to the one specified by the user \pgfqkeys{/inventory/#1}{#2} } % DESCRIPTION: Macro for testing whether it is a problem with wrapping \pgfqkeys in an additional macro \newcommand{\setEntryData}[2]{ \pgfqkeys{/inventory/#1}{#2} } \begin{document} % DESCRIPTION: Setting the data of the manually added entry % with \pgfqkeys and "{}" notation % STATUS: WORKS AS EXPECTED \pgfqkeys{/inventory/Manual 5 Speed}{ inventory id = 6, product = { manufacturer = Herbert Motors, product id = 433M5 } } % DESCRIPTION: Setting the data of the manually added entry % with \pgfqkeys wrapped in macro and "{}" notation % STATUS: WORKS AS EXPECTED \setEntryData{Manual 6 Speed}{ inventory id = 11, product = { manufacturer = Herbert Motors, product id = 433M6 } } % DESCRIPTION: Generate and set data for automatic entry % with "/" notation % STATUS: WORKS AS EXPECTED \generateEntry{Automatic 4 Speed}{ inventory id = 21, product/manufacturer = Jane's Speedshop, product/product id = JS4A } % DESCRIPTION: Generate and set data for automatic entry % with "{}" notation % STATUS: FAILS FOR NESTED KEYS \generateEntry{Automatic 5 Speed}{ inventory id = 42, product = { manufacturer = Jane's Speedshop, product id = JS5A } } % DESCRIPTION: Visualize the data stored in the pgfkeys \section*{Inventory} \foreach \entry in {Manual 5 Speed, Manual 6 Speed, Automatic 4 Speed, Automatic 5 Speed}{ \textbf{\entry}:\\ inventory id: \pgfkeysvalueof{/inventory/\entry/inventory id}\\ manufacturer: \pgfkeysvalueof{/inventory/\entry/product/manufacturer}\\ product id: \pgfkeysvalueof{/inventory/\entry/product/product id} \\[0.25cm] } \end{document} This produces the following output: Issue When using the {...} notation to set the data of automatically generated entries, the data is not stored (see Automatic 5 Speed in MWE). The / notation seems to work. What was tried so far The problem seems to be related to the .is setter pgfkeys handler. It seems like the nested structure is not created, but a single key with e. g. product/manufacturer as id (with the / being interpreted as a letter, not a separator). So far, the following has been tried: Changing .code to .ecode Modifying the expansion from \noexpand to other possibilities Those experiments always resulted in errors and the compilation failing. Question Is there a simple way to achieve the desired behavior with pgfkeys (e.g. via .is family)? Suggestions of other methods are also welcome. However, solutions with pgfkeys would be preferred, since the rest of the data handling in the real project is already based upon pgfkeys.

  • Cleveref and theorem-style environments in SIAM document class [duplicate]
    by Daniele Avitabile on December 31, 2025 at 7:50 am

    This question differs from \cref refers to lemmas as theorems in that it is specific to the SIAM document class, and it pertains setting of that class, specifically. This minimal example of SIAM document class shows that Cleveref has issues with theorem-style environments \documentclass{siamart251216} %% Used for creating new theorem and remark environments \newsiamremark{hypothesis}{Hypothesis} \crefname{hypothesis}{Hypothesis}{Hypotheses} \begin{document} \section{Test section}\label{sec:test} Here are one theorem and one hypothesis. \begin{theorem}\label{thm:test} Test theorem \end{theorem} \begin{hypothesis}\label{hyp:test} $x$ is a real number \end{hypothesis} And now we use cleveref to cite \cref{sec:test} \cref{thm:test} and \cref{hyp:test} \end{document} as it produces the following output: As you can see the Hypothesis is cited as a Theorem. Things to note: In the past, this used to be an issue, as seen in this post. The workaround(s) proposed there don't work for me The problem was not present with previous versions of the siamart document, and TeX distributions, in which the 2 commands in the preamble were working well. SIAM seems to be aware of the problem, because in their documentation states It is puzzling that the latex source of the documentation given at point 3 produces the correct reference. This document is far from being minimal, and I'm not including it here. However, I have tried to progressively comment out sections from the main body of the document (not the preamble), and I bump again into the Cleveref issue. Does anyone have an idea of how this can be fixed? It's way out of my LaTeX skills I must say.

  • Can the section title be moved to the outer margin on all pages, or suppressed from the body but still linked to the headers?
    by Gary on December 31, 2025 at 5:36 am

    I'm trying to re-typeset on 8.5 by 11 paper an old book that was printed on smaller paper, such that the author did not need to have section titles within the text body but used the right-hand header. An issue that arises is that, on the larger paper, instances occur in which more than one of these sections lands on facing pages, meaning only one can be in the right-hand header which would leave the other without any indication at all. In trying to stay as true to the original as possible without interrupting the body, I placed these section titles in the outer margin, added them also as sections in the right-hand header but suppressed them within the text body; such the last section on the page appeared in the right-hand header and all appeared in the outer margin. I'm struggling to achieve the same in ConTeXt. I can get the section-title text in the outer margin but can't add that also as a section that won't appear within the text body. Or I can get the sections added normally and set as margin text; however, I can't get them in the outer margin on right-hand pages. Thus, in the example below, I'd like to either: Get the "Section title" currently in the inner margin moved to the outer; or Leave the "A pseudo-margin title" as a margin item and add a section with the marking such that it will appear in the header but not in the body (or the TOC but that is likely a separate question). However setting title and list to {} doesn't appear to work. (In LaTeX the fancyhdr package permitted suppression of the section title in the body just by leaving the title blank.) It may be a bit odd; but is there a way to accomplish this? 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] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \definecolor[MargGray][r=0.425,g=0.535,b=.688] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \define[1]\MarginOuter { \margintext[ location=outer, margin=margin, color=MargGray, align=middle, line=1, style=\MarginOuterFont ]{#1} } \startbodymatter \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \setuphead[section][number=no,alternative=margintext] \startchapter [ title={Chapter Title}, ] \samplefile {ward} \startsection [ title={Section\\Title}, ] \samplefile {ward} \stopsection \MarginOuter{A pseudo-\\margin title} \samplefile {ward} \stopchapter \stopbodymatter EDIT: In attempt at employing the guidance of @Max Chernoff this appears to work. \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] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \definecolor[MargGray][r=0.425,g=0.535,b=.688] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \startbodymatter \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, beforesection=\vskip -1.25\lineheight, indentnext=yes, command=\MyHead, ] \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \startchapter [ title={Chapter Title}, ] \samplefile {ward} \startsection [ title={A real\\section\\title 1}, marking={A real section title 1}, list={} ] \samplefile {ward} \stopsection \startsection [ title={A real\\section\\title 2}, marking={A real section title 2}, list={} ] \samplefile {ward} \stopsection \samplefile {ward} \stopchapter \stopbodymatter

  • Could you add "Happy New Year" in your language? Have a wonderful 2026!
    by Ñupi on December 31, 2025 at 3:11 am

    \documentclass[aspectratio=169]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, shadings, shadows} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame}[plain] \begin{tikzpicture}[remember picture, overlay] \fill[top color=blue!20!black, bottom color=black] (current page.south west) rectangle (current page.north east); \foreach \i in {1,...,60} { \fill[white, opacity=0.4] (current page.center) ++({rand*8}, {rand*4.5}) circle (0.03); } \node[white, opacity=0.75, font=\small\itshape] at (-5, 2.5) {Happy New Year}; % \node[white, opacity=0.75, font=\small\itshape] at (5, -2.5) {Bonne Année}; \node[align=center, text=white] at (current page.center) { {\fontsize{35}{40}\selectfont \textbf{\textcolor{yellow!70!white}{¡Happy New Year!}}} \\[0.3cm] {\fontsize{20}{24}\selectfont \textit{and prosperous}} \\[0.5cm] {\fontsize{75}{75}\selectfont \textbf{\textcolor{white}{2026}}} \\[0.8cm] {\fontsize{18}{22}\selectfont \textsf{\textbf{Friends of \LaTeX}}} }; \draw[very thick, orange!60!yellow, opacity=0.6] (-4,-1.8) -- (4,-1.8); \shade[ball color=yellow, opacity=0.3] (-7, 3) circle (0.5); \shade[ball color=orange, opacity=0.2] (7, -3) circle (0.8); \end{tikzpicture} \end{frame} \end{document}

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

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

  • Increase vertical spacing for the boxed choice in enumext
    by Sebastiano on December 30, 2025 at 9:24 pm

    I'm using the enumext package to create multiple-choice questions. In my case, the answer labels are boxed letters, produced using the wrap-label key. The issue is that the boxed letters appear too close to each other vertically. I would like to know the correct way to increase the vertical spacing between the boxed labels, without unnecessarily changing the text spacing or breaking the column alignment. Here a MWE: \documentclass[a4paper,12pt]{article} \usepackage{amsmath, amssymb} \usepackage{graphicx} \usepackage{enumext} \begin{document} \begin{enumext}[label=\textbf{Domanda} \arabic*.,wrap-label=\textbf{#1},list-indent=0pt, save-ans=test] \item Lion \setenumext[keyans]{label=\Alph*,font=\small,nosep,wrap-label={\fbox{\makebox[\height]{##1}}}} \begin{keyans}[columns=2,nosep,mini-env={0.4\linewidth}] \item \item \item \item \miniright \includegraphics[scale=.4]{example-image.png} \end{keyans} \end{enumext} \end{document}

  • Undesired bold text in Bibliography with BibLatex
    by DaVarPhi on December 30, 2025 at 1:44 pm

    I'm using a template in Overleaf to make a mock article for practice, but it used natbib instead of biblatex so I attempted to replace the package and did all of the suitable replacements (like \citep to \parencite) But, it produced this "ugly" bibliography like below. Notice the bold texts Here is my bib file @book{sutton1998, title = {Reinforcement Learning: An Introduction}, author = {Sutton, Richard S. and Barto, Andrew G.}, year = {1998}, publisher = {MIT Press}, } @inproceedings{togelius2015, title = {AI Researchers, Video Games Are Your Friends!}, author = {Togelius, Julian}, booktitle = {Proceedings of the International Joint Conference on Computational Intelligence}, pages = {3--18}, year = {2015}, publisher = {Springer} } @incollection{johnson2016, author = {Johnson, Mark}, title = {Bullet Hell: The Globalized Growth of Danmaku Games and the Digital Culture of High Scores and World Records}, booktitle = {Transnational Contexts of Culture, Gender, Class, and Colonialism in Play: Video Games in East Asia}, pages = {17--42}, publisher = {Springer}, year = {2016} } @book{koziel2019, title = {Speedrun Science: A Long Guide to Short Playthroughs}, author = {Koziel, Eric}, year = {2019}, publisher = {Fangamer} } @inproceedings{li2019, author = {Li, Raymond C. and Ahn, Jun Min and Esteron, Zachary Tyler and Hong, Qiyin}, title = {Collision Avoidance with Deep Reinforcement Learning}, booktitle = {Proceedings of the 2019 Purdue Undergraduate Research Conference}, year = {2019} } @online{chen2025, author = {Chen, Jackson}, title = {Summer Games Done Quick 2025 Raises \$2.4 Million for Doctors Without Borders}, year = {2025}, organization = {Engadget}, url = {https://www.engadget.com/gaming/summer-games-done-quick-2025-raises-24-million-for-doctors-without-borders-182314037.html}, urldate = {2025-12-31} } And some MWE \input{preamble} \begin{document} LOREM IPSUM DOLOT SIT AMET \parencite{chen2025} LOREM IPSUM DOLOT SIT AMET \parencite{johnson2016} LOREM IPSUM DOLOT SIT AMET \parencite{koziel2019} LOREM IPSUM DOLOT SIT AMET \parencite{li2019} LOREM IPSUM DOLOT SIT AMET \parencite{sutton1998} LOREM IPSUM DOLOT SIT AMET \parencite{togelius2015} \newpage \input{bibliography} \end{document} that produces also an ugly citation Here are the content of preamble.tex that I think directly contributed to the bibliography and also the template for bibliography.tex %preamble.tex \documentclass[12pt,a4,american]{extreport} \usepackage[utf8]{inputenc} \usepackage[indonesian]{babel} \usepackage[T1]{fontenc} \usepackage{relsize} \usepackage{times} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage{actuarialsymbol} \usepackage{lipsum} \usepackage{geometry} \usepackage[onehalfspacing]{setspace} \usepackage{parskip} \usepackage{microtype} \usepackage{fancyhdr} \usepackage[ pdftex, bookmarks=true, unicode=true, pdfusetitle, bookmarksnumbered=true, bookmarksopen=true, breaklinks=true, pdfborder={0 0 1}, backref=page, colorlinks=false ]{hyperref} \usepackage[noabbrev, capitalise]{cleveref} \usepackage{xcolor} \usepackage[style=authoryear, backend=biber]{biblatex} \DeclareDelimFormat{nameyeardelim}{\addcomma\space} \addbibresource{citation.bib} \usepackage{xurl} \usepackage[nottoc,numbib]{tocbibind} % bibliography.tex \clearpage \phantomsection \addcontentsline{toc}{chapter}{BIBLIOGRAPHY} \nocite{*} \printbibliography[heading=bibintoc, title={BIBLIOGRAPHY}] I don't know what I did wrong here. I have checked the custom settings file of the template and there are no other command that modify the bibliography and I've done the suitable replacements. Any help? EDIT : Added MWE and all the relevant files content.

  • circuitikz: How to use circuitikz inside a TikZ-matrix
    by cis on December 30, 2025 at 11:27 am

    Is it possible to use circuitikz-shapes as cells inside a TikZ-matrix? (I mean, as cells <*> & <*> & <*> ... \\, how to place nodes afterwards is already clear.) If I put in |[tgenericshape]|{} I get an error ! Package PGF Math Error: Unknown function base (in 'base'). \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \usetikzlibrary{matrix} \begin{document} \begin{circuitikz}[] \node[tgenericshape, label=center:GS0](G0){}; \matrix[matrix of nodes, nodes in empty cells, draw, column sep=11mm, ] at (0,-2) (m){ 1 & 2 & 3 \\ %|[tgenericshape, label=center:GS1]|{} & |[fill=pink]|{Test} & \\ does not work }; \end{circuitikz} \end{document}

  • How to reproduce `listings` style features (right-side numbers, stepnumber) in `piton`?
    by d7ek on December 30, 2025 at 5:21 am

    In the listings package, \lstset{numbers=right,stepnumber=3,numberfirstline} gives right-aligned line numbers and numbering every third line. I would like to achieve the same behavior using the piton package instead of listings, but I can’t find equivalent options in the documentation. \documentclass{article} \usepackage{piton,xcolor} \PitonOptions{line-numbers,} %\usepackage{listings} %\lstset{ % numbers=right, % stepnumber=3, % numberfirstline %} \begin{document} %\begin{lstlisting}%[firstnumber=2] \begin{Piton} print("Hello world") x = 1 + 1 print(x) x = 1 + 2 print(x) x = 2 + 2 print(x) \end{Piton} %\end{lstlisting} \end{document}