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

  • 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

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

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

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

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

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

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

  • Drawing Only a Portion of an Oval Frame
    by DDS on December 30, 2025 at 10:39 pm

    Consider the following code which I compile with xelatex: \documentclass{book} \usepackage{graphicx} \usepackage[abs]{overpic} \usepackage{tikz} \definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.235} % 0, 107, 60 \definecolor{Gold}{RGB}{228,168,73} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \clip (0,0) ellipse (4.25cm and 5.5cm); \draw[line width=5pt,Gold,fill=cadmiumgreen] ellipse (4.25cm and 5.5cm); \node at (0,0) {\includegraphics[scale=.37,clip, trim = 0 0 0 0]{example-image-a}}; \draw[line width=12pt,Gold!70!black] ellipse (4.25cm and 5.5cm); \end{tikzpicture} \end{center} \end{document} with the output: QUESTION: How may I draw only a part of the 12pt-thick oval frame; in particular, relative to the node (0,0), draw the frame from only -45 degrees to 225 degrees in a clockwise fashion (instead of from -90 degrees to 270 degrees which gives the entire oval)? Thank you.

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

  • circuitikz: How to read out the value of bipoles/length
    by cis on December 30, 2025 at 8:55 am

    According to the manual, section 3.1.4.1 "Components size", bipoles/length (default 1.4cm) is the central parameter; "which can be interpreted as the length of a resistor (including reasonable connections): all other lengths are relative to this value." How can I read out bipoles/length? I tried \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } without success. What do I have to do? \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \end{circuitikz} \ctikzset{bipoles/length=22.5mm,}% test for value change \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \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}

  • Is it possible to create a circular document?
    by Brendan Langfield on December 30, 2025 at 3:11 am

    I recently learned that it's possible to set fully custom page dimensions using geometry. However as far as I can tell, you can only do rectangular document shapes. Is it possible to use the geometry package or some other method to make the document itself circular?

  • List with one item in an enviroment issue
    by murray on December 30, 2025 at 2:40 am

    The following code produces the output shown. It uses an enviroment inside which there is a description list with just one item. Note the blank line before \item. With that, or with instead, {} or \mbox{}, the code compiles as expected. However, removing that blank line before \item causes error "Something's wrong--perhaps a missing \item when compilation reaches the line \end{oneproperty}. Why does this happen, and how can the definition of oneproplis or oneproperty be modfied so as to avoid the error? \documentclass{article} \usepackage{enumitem} \newlength{\oneproplabelwd} % NB: default is parentheized 2-char sf \settowidth{\oneproplabelwd}{\textsf{(SN)}} % NB: Enclose actual item name in parens, \label[...] in optional arg! \newlist{oneproplis}{description}{1} \newenvironment{oneproperty}[1]{% \setlist[oneproplis,1]{% font=\normalfont\textsf, wide, leftmargin=\dimexpr\parindent+\oneproplabelwd+\labelsep, itemsep=0pt, topsep=2pt, format={\normalfont\textsf}, }\begin{oneproplis}% \upshape} {\end{oneproplis}} \begin{document} \noindent A relation $\leq$ in a set $X$ is said to \emph{well-order} $X$ if it partially orders $X$ and: % \settowidth{\oneproplabelwd}{\textsf{(WO)}} \begin{oneproperty} \item[(WO)\label{property:wo}] Each nonempty subset of $X$ has a least element. \end{oneproperty} \end{document}

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

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

  • circuitikz: European Amplifier (en amp) without pins or with absolut valued pin length
    by cis on December 29, 2025 at 12:10 pm

    I want to create an en amp with a pin length of 0 - alternatively: a pin length with a clearly defined value, for example 5mm. I tried to transfer the "trick" \ctikzset{tripoles/en amp/port width=1, tripoles/en amp/width=1.19, % = 1.7*0.7 } from 4.20.2.2 "Input and output pins symbols"; but this only works with op amp. What do I have to do? \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \ctikzset{tripoles/en amp/port width=1, tripoles/en amp/width=1.19, % = 1.7*0.7 } \node[en amp, en amp text={No pins}, label={[yshift=-12mm]below:works not} ] (A){please!}; %% --> Trick from 4.20.2.2 "Input and output pins symbols" \ctikzset{tripoles/op amp/port width=1, tripoles/op amp/width=1.19, % 1.7*0.7 } \draw (3,0) node[op amp, color=blue, label={[yshift=-12mm]below:works} ]{}; \end{circuitikz} \end{document}

  • Three fonts supports for polyglossia package?
    by Explorer on December 28, 2025 at 5:32 pm

    The code is partially taken from egreg's this answer. I want to typeset the following three languages with three fonts: English: EB Garamond Chinese: FandolSong Greek: Old Standard Noted that I want to write an "English and Chinese" mixed article(which means that it need to switch frequently) to introduced the third language——Greek. As below: \documentclass{book} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage{english} \setmainfont{EB Garamond}% English \newfontfamily{\chinesefont}{FandolSong}% Chinese \setotherlanguage{greek} \newfontfamily{\greekfont}{Old Standard}% Greek \begin{document} I want to typeset an article, whose main text is the combination of English, Chinese, which is used to introduced the Greek letters. I want three fonts for them. So, I want to use English and Chinese, switching frequently. And use Greek fonts in whole paragraph. \bigskip English: English Saṃskṛtāvāk Chinese: {\chinesefont 英语、中文 01234 这是一个测试} Greek: {\greekfont τὸν πόλεμον τῶν Ἀθηναῖος} It works well. However, what I want in the real case, is as follows: \bigskip An paragraph of English and Chinese, which shifts frequently. 我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。 {\chinesefont 我是英语} English {\chinesefont 和中文} Chinese {\chinesefont 混排。} is okay, but extremely difficult to switch... Then a paragraph of Greek letters. \textgreek{Θουκυδίδης Ἀθηναῖος ξυνέγραψε τὸν πόλεμον τῶν Πελοποννησίων καὶ Ἀθηναίων, ὡς ἐπολέμησαν πρὸς ἀλλήλους, ἀρξάμενος εὐθὺς καθισταμένου καὶ ἐλπίσας μέγαν τε ἔσεσθαι καὶ ἀξιολογώτατον τῶν προγεγενημένων, τεκμαιρόμενος ὅτι ἀκμάζοντές τε ᾖσαν ἐς αὐτὸν ἀμφότεροι παρασκευῇ τῇ πάσῃ καὶ τὸ ἄλλο Ἑλληνικὸν ὁρῶν ξυνιστάμενον πρὸς ἑκατέρους, τὸ μὲν εὐθύς, τὸ δὲ καὶ διανοούμενον.} It's hard for \texttt{polyglossia} to support an English font together another Chinese font. Is that any ideas? \end{document} I can't set Chinese and English fonts seperately, so frequently switch is quite difficult. I have also tried Fallback, but it doesn't work: \setmainfont[Fallback=FandolSong]{EB Garamond} If somebody get familiar with ctex-bundle, to set Chinese fonts and English fonts seperately, we could use: \usepackage{ctex} \setmainfont{EB Garamond} \setCJKmainfont{FandolSong} However, polyglossia is a little bit conflict with ctex(That maybe my another question or issues). So, this post, I was only after for a ployglossia(or babel) solution.

  • With mini frames, beamer content too far down
    by scottkosty on December 28, 2025 at 5:11 pm

    The content in some of my frames extends too far down, even when there is vertical space above that could be used. Here is an example. I would prefer for it to use the vertical space at the top before extending off the page. Is there a clean way to accomplish (at least part) this without doing a manual negative vspace? \documentclass{beamer} \useoutertheme{smoothbars} \begin{document} \section{Summation operator and the mean} \begin{frame} \begin{theorem} Is the following equality necessarily true? \[ \sum^{n}_{i=1}\left(ax_{i}+by_{i}\right)=a\sum^{n}_{i=1}x_{i}+b\sum^{n}_{i=1}y_{i} \] \end{theorem} % \begin{theorem} Yes, it is true. But what's the intuition for it? \end{theorem} \begin{itemize} \item Whenever you're stuck proving a general statement, it's often useful to try a special case. For example, what if $n$ equals 2? \begin{block}{} Then the question reduces to the following: \begin{align} \left(ax_{1}+by_{1}\right)+\left(ax_{2}+by_{2}\right) & \,\,\,=\,\,\,a(x_{1}+x_{2})+b(y_{1}+y_{2})\\ & \Longleftrightarrow\\ \left(ax_{1}+ax_{2}\right)+\left(by_{1}+by_{2}\right) & \,\,\,=\,\,\,a(x_{1}+x_{2})+b(y_{1}+y_{2}) \end{align} \end{block} \item We're summing the same numbers, just in a different order! \end{itemize} \end{frame} \end{document} Here is the result that I get: I understand there is no so much vertical space at the top, but I would still rather have the "Theorem" text start just after the mini frames, rather than content go off the page. Maybe what I'm asking for is "vfill" behavior, where it stretches or squeezes depending on the situation?

  • How to make a command "eat" a space? [duplicate]
    by user424920 on December 28, 2025 at 11:03 am

    I searched for something similar, but I didn't find anything. \documentclass{report} \usepackage{amsmath} \usepackage{mathtools} \DeclareMathOperator{\diff}{d} \begin{document} \[\int x\diff x\] \end{document} I want to get "dx" and not "d x". I was looking at ways to eat spaces after the command, but nothing, I would like to avoid adding the "x" as a parameter to the \diff operator. I would like you know if there is a way.

  • Why does \textstyle not work in \smashoperator?
    by John Lee on December 28, 2025 at 3:23 am

    In the following code, the \sum in \smashoperator appears too big. But if I put \textstyle\sum in \smashoperator, then it gives the error "*.tex: error: 290: Limit controls must follow a math operator. ...extstyle\sum_{\alpha\in D_{1}\cup D_{2}}}". I don't know what to do and need help. The MWE LaTeX code is as below: \documentclass[11pt,twoside]{article}% \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathtools} \usepackage[title,titletoc,header]{appendix} \usepackage{geometry} \usepackage{graphicx} \usepackage{indentfirst} \usepackage{mathrsfs} \usepackage{nopageno} \usepackage{setspace} \usepackage{remreset} \newtheorem{theorem}{Theorem}[section] \newtheorem{definition}[theorem]{Definition} \begin{document} \begin{enumerate} \item $\smashoperator{\sum_{\alpha\in D_{1}\cup D_{2}}}\,x_{\alpha}\,=\underset{\alpha\in D_{1}}{\textstyle\sum}x_{\alpha} \,+\underset{\alpha\in D_{2}}{\textstyle\sum}x_{\alpha}$ \end{enumerate} \end{document}

  • Weird Overleaf error
    by DavidIsDumb on December 28, 2025 at 2:31 am

    I'm writing some math stuff using overleaf but it broke mysteriously. I wrote: \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[shortlabels]{enumitem} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{epigraph} \usepackage[colorlinks]{hyperref} \usepackage{microtype} \usepackage{mathtools} \usepackage[headsepline]{scrlayer-scrpage} \usepackage{thmtools} \usepackage{listings} \usepackage{derivative} \renewcommand{\epigraphsize}{\scriptsize} \renewcommand{\epigraphwidth}{60ex} \ihead{\footnotesize\textbf{Some text here}} \ohead{\footnotesize Some text here} \providecommand{\re}{\text{Re}} \providecommand{\im}{\text{Im}} \providecommand{\ol}{\overline} \providecommand{\eps}{\varepsilon} \providecommand{\half}{\frac{1}{2}} \providecommand{\dang}{\measuredangle} \providecommand{\CC}{\mathbb C} \providecommand{\FF}{\mathbb F} \providecommand{\NN}{\mathbb N} \providecommand{\QQ}{\mathbb Q} \providecommand{\RR}{\mathbb R} \providecommand{\ZZ}{\mathbb Z} \providecommand{\dg}{^\circ} \providecommand{\ii}{\item} \providecommand{\alert}{\textbf} \providecommand{\opname}{\operatorname} \providecommand{\ts}{\textsuperscript} \DeclareMathOperator{\sign}{sign} \providecommand{\tarc}{\mbox{\large$\frown$}} \providecommand{\arc}[1]{\stackrel{\tarc}{#1}} \reversemarginpar \providecommand{\printpuid}[1]{\marginpar{\href{https://otis.evanchen.cc/arch/#1}{\ttfamily\footnotesize\color{green!40!black}#1}}} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdredbox}{frametitlefont=\bfseries,innerbottommargin=8pt, nobreak=true,backgroundcolor=Salmon!5,linecolor=RawSienna,} \declaretheoremstyle[headfont=\bfseries\color{RawSienna}, mdframed={style=mdredbox},headpunct={\\[3pt]},postheadspace=0pt,]{thmredbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,nobreak=true,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmredbox,name=Problem]{problem} \declaretheorem[style=thmblackbox,name=Outline,numbered=no]{sol} \declaretheorem[style=thmgreenbox,name=Claim,numbered=no]{claim*} \usepackage{asymptote} \begin{asydef} size(8cm); // set a reasonable default usepackage("amsmath"); usepackage("amssymb"); settings.tex="pdflatex"; settings.outformat="pdf"; import geometry; void filldraw(picture pic = currentpicture, conic g, pen fillpen=defaultpen, pen drawpen=defaultpen) { filldraw(pic, (path) g, fillpen, drawpen); } void fill(picture pic = currentpicture, conic g, pen p=defaultpen) { filldraw(pic, (path) g, p); } pair foot(pair P, pair A, pair B) { return foot(triangle(A,B,P).VC); } pair centroid(pair A, pair B, pair C) { return (A+B+C)/3; } \end{asydef} \begin{document} \title{Some text here} \subtitle{Some text here} \author{Some text here} \date{\today} \maketitle \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} \end{document} When I compile there is no error message, but the last line has a red circle saying "unexpected \end{problem} after $" and the line before that says "unclosed $ found at \end{problem}". All the other probs with this format didn't break, so there's probably no problem with the \end. However, I found that if I type \begin{problem}[some text here] Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} instead for the problem part nothing happens! No error if I delete like half a paragraph. Can somebody explain what is happening? Edit: Also in the first case autocompile doesn't work, saying that my code has errors that must be fixed first before that can run, but for the second case autocompile works. I also found out that autocompile works when I type: \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0.) \end{problem} for the problem, but the last line has the following error message: LaTeX Error: Command \end{mdframed} invalid in math mode. \ (button saying suggest fix using AI) \ Missing $ inserted. \ Missing } inserted. \ Extra }, or forgotten \endgroup.

  • Using \ProcessList and \SplitArgument with \IfBoolean
    by sgmoye on December 27, 2025 at 7:30 pm

    I need to use \ProcessList and \SplitArgument with \IfBoolean. Using only \ProcessList does work, but I need to get at the arguments before and after the / -- thus the need for \SplitArgument. The asterisk seems inextricably attached to the second argument in \fooauxai and I cannot seem to pry it loose. As indicated, I've tried some \expandafter experiments. Suggestions? \documentclass{article} \usepackage[papersize={5.5in,8.5in},margin=0.6in]{geometry} \usepackage{xparse}%% for <u> %% |=====8><-----| %% %% This works \NewDocumentCommand{\test}{ >{\SplitList{;}}m }{\ProcessList{#1}{\fooaux}} \NewDocumentCommand{\fooaux}{ m }{\fooauxa#1|} \NewDocumentCommand{\fooauxa}{ s u{|} }{% \def not possible due to need for boolean \IfBooleanTF{#1}{\textcolor{red}{#2}}{#2} } %% |=====8><-----| %% %% This does not work \NewDocumentCommand{\testi}{>{ \SplitList{;}}m } {\ProcessList{#1}{\fooauxi}} %% Tried this but to no avail: %% \NewDocumentCommand{\fooauxi}{ >{\SplitArgument{1}{/}}m } {\expandafter\fooauxai#1|} \NewDocumentCommand{\fooauxi}{ >{\SplitArgument{1}{/}}m } {\fooauxai#1} \NewDocumentCommand{\fooauxai}{ s m m }{% \IfBooleanTF{#1}{\textcolor{red}{(#2)}}{(#2)}-(#3) } %% |=====8><-----| %% \begin{document} \thispagestyle{empty} \begin{tabular}{lll} 1& From \verb+\test+& \test{a/1;*b/2;c/3}\\ 2& From \verb+\testi+& \testi{a/1;*b/2;c/3}\\ 3& Desired& (a)-(1) \textcolor{red}{(b)}-(2) (c)-(3) \end{tabular} \end{document}

  • How to call an expl3 function within Lua code
    by wehro on December 27, 2025 at 6:55 pm

    In an expl3 package a Lua module shall be used because Lua simplifies programming some functions. The Lua module shall call some expl3 functions from the package. But this does not work in all cases. In the following example only \MyDocumentCommandA works, not \MyDocumendCommandB. \begin{filecontents*}{mypackage.sty} \ProvidesExplPackage{mypackage}{2025-12-27}{1.0}{My package} \directlua { myluamodule = require ('myluamodule') } \cs_new:Npn \mypackage_command:n #1 { \int_to_Roman:n {#1} } \NewDocumentCommand \MyDocumentCommandA {m} { \directlua { myluamodule.functionA ( #1 ) } } \NewDocumentCommand \MyDocumentCommandB {m} { \directlua { myluamodule.functionB ( #1 ) } } \end{filecontents*} \begin{filecontents*}{myluamodule.lua} local myluamodule = {} myluamodule.functionA = function (nr) tex.sprint("bla blub ") tex.sprint("\\ExplSyntaxOn") tex.sprint("\\mypackage_command:n{"..nr.."}") tex.sprint("\\ExplSyntaxOff") end myluamodule.functionB = function (nr) tex.sprint("\\section{") myluamodule.functionA(nr) tex.sprint("}") end return myluamodule \end{filecontents*} \documentclass{article} \usepackage{mypackage} \begin{document} \MyDocumentCommandA{75} \MyDocumentCommandB{85} \end{document} The error message is: ! Undefined control sequence. <argument> bla blub \ExplSyntaxOn \mypackage _command:n{85}\ExplSyntaxOff l.43 \MyDocumentCommandB{85}