• `\tl_replace_all` doesn’t work with counters
    by fauve on August 31, 2026 at 2:55 pm

    The goal I try to make a macro witch transform arabic digits (0123456789) into farsi ones (). The final goal is to transform counters, espaceilaly page counters intor farsi form. The current situation I made the command, it work when I just use normal input numbers, but it fail when I give it a counter. MWE \documentclass{article} \usepackage{fontspec} \newfontfamily\arabicfont[ Ligatures=TeX, Script=Arabic, Language=Persian, ]{IranNastaliq} % Conversion des chiffres occidentaux en chiffres persans \ExplSyntaxOn \NewDocumentCommand{\persiandigits}{m} { \tl_set:Nn \l_tmpa_tl {#1} \tl_replace_all:Nnn \l_tmpa_tl {0} {۰} \tl_replace_all:Nnn \l_tmpa_tl {1} {۱} \tl_replace_all:Nnn \l_tmpa_tl {2} {۲} \tl_replace_all:Nnn \l_tmpa_tl {3} {۳} \tl_replace_all:Nnn \l_tmpa_tl {4} {۴} \tl_replace_all:Nnn \l_tmpa_tl {5} {۵} \tl_replace_all:Nnn \l_tmpa_tl {6} {۶} \tl_replace_all:Nnn \l_tmpa_tl {7} {۷} \tl_replace_all:Nnn \l_tmpa_tl {8} {۸} \tl_replace_all:Nnn \l_tmpa_tl {9} {۹} \tl_use:N \l_tmpa_tl } \ExplSyntaxOff \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyfoot[C]{% \thepage\quad \arabicfont\persiandigits{\thepage} } \begin{document} Chiffres normaux : 12345 Chiffres persans : {\arabicfont\persiandigits{12345}} Numéro de page : {\arabicfont\persiandigits{\the\value{page}}} \end{document} Rendernig Chiffres normaux : 12345 Chiffres persans : ۱۲۳۴۵ Numéro de page : 1 <- here the problem happend The question How to make \persiandigits even work with \thepage ?

  • How to draw realistic chemistry lab procedures (dilution and solution preparation) in pure TikZ?
    by user446526 on August 31, 2026 at 12:42 pm

    I am trying to recreate two educational chemistry diagrams using TikZ. The diagrams illustrate the steps for diluting a solution and preparing a solution from a solid solute, including Arabic labels. Here is the first target image (dilution): Here is the second target image (solution preparation): I have made an initial attempt at the first image. However, my shapes (flasks, volumetric pipette, wash bottle) look very flat and basic compared to the realistic, semi-3D illustrations in the target images. I haven't started on the second image yet because I am unsure how to approach drawing complex elements like the digital scale, the funnel, and the hands holding the glassware. Here is my current Minimum Working Example (MWE) for the first image, compiled with XeLaTeX/LuaLaTeX for the Arabic text: \documentclass[11pt, a4paper, landscape]{article} \usepackage{geometry} \geometry{margin=1in} \usepackage{tikz} \usetikzlibrary{calc, arrows.meta, positioning} \usepackage{polyglossia} \setmainlanguage{arabic} \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \tikzset{ pics/flask/.style args={#1/#2}{ code={ \pgfmathsetmacro{\liqh}{#1} \begin{scope} \clip (-0.5, 0) .. controls (-1.2, 0) and (-1.0, 1.2) .. (-0.15, 1.5) -- (-0.15, 3.2) -- (0.15, 3.2) -- (0.15, 1.5) .. controls (1.0, 1.2) and (1.2, 0) .. (0.5, 0) -- cycle; \fill[#2] (-1.5, 0) rectangle (1.5, \liqh); \ifdim \liqh pt > 0pt \fill[black, opacity=0.1] (-1.5, \liqh-0.05) rectangle (1.5, \liqh); \fi \end{scope} \draw[glassware] (-0.5, 0) .. controls (-1.2, 0) and (-1.0, 1.2) .. (-0.15, 1.5) -- (-0.15, 3.2) -- (0.15, 3.2) -- (0.15, 1.5) .. controls (1.0, 1.2) and (1.2, 0) .. (0.5, 0) -- cycle; \draw[thick, red!70!black] (-0.15, 2.5) -- (0.15, 2.5); \draw[thick, draw=black!70, fill=white, fill opacity=0.5] (-0.2, 3.2) rectangle (0.2, 3.35); } }, pics/pipette/.style args={#1/#2}{ code={ \pgfmathsetmacro{\bfill}{#1} \pgfmathsetmacro{\tfill}{#2} \begin{scope} \clip (-0.06, 0) -- (-0.06, 1.5) .. controls (-0.06, 1.7) and (-0.25, 1.8) .. (-0.25, 2.2) .. controls (-0.25, 2.6) and (-0.06, 2.7) .. (-0.06, 2.9) -- (-0.06, 4.5) -- (0.06, 4.5) -- (0.06, 2.9) .. controls (0.06, 2.7) and (0.25, 2.6) .. (0.25, 2.2) .. controls (0.25, 1.8) and (0.06, 1.7) .. (0.06, 1.5) -- (0.06, 0) -- cycle; \fill[blue!50!cyan, opacity=0.85] (-0.3, \bfill) rectangle (0.3, \tfill); \end{scope} \draw[glassware, fill opacity=0.3] (-0.06, 0) -- (-0.06, 1.5) .. controls (-0.06, 1.7) and (-0.25, 1.8) .. (-0.25, 2.2) .. controls (-0.25, 2.6) and (-0.06, 2.7) .. (-0.06, 2.9) -- (-0.06, 4.5) -- (0.06, 4.5) -- (0.06, 2.9) .. controls (0.06, 2.7) and (0.25, 2.6) .. (0.25, 2.2) .. controls (0.25, 1.8) and (0.06, 1.7) .. (0.06, 1.5) -- (0.06, 0) -- cycle; \foreach \y in {3.2, 3.4, 3.6, 3.8, 4.0} \draw[very thin, black!60] (-0.06, \y) -- (0, \y); \foreach \y in {0.5, 0.7, 0.9, 1.1} \draw[very thin, black!60] (-0.06, \y) -- (0, \y); } }, pics/washbottle/.style={ code={ \begin{scope} \clip (-0.8, 0) rectangle (0.8, 2.5); \fill[blue!10, opacity=0.5] (-0.9, 0) rectangle (0.9, 1.9); \end{scope} \draw[glassware, rounded corners=3pt] (-0.8, 0) -- (-0.8, 2.5) -- (-0.5, 2.8) -- (0.5, 2.8) -- (0.8, 2.5) -- (0.8, 0) -- cycle; \draw[thick, draw=black!70, fill=white] (-0.5, 2.8) rectangle (0.5, 3.1); \draw[thick, draw=black!70, fill=white] (-0.4, 3.1) rectangle (0.4, 3.3); \draw[thick, draw=black!40] (0, 0.2) -- (0, 3.3); \draw[thick, draw=black!70, double=white, double distance=2.5pt] (0, 3.2) -- (0, 3.8) .. controls (0, 4.0) and (-0.3, 4.1) .. (-0.6, 3.9) -- (-1.6, 3.1); } } } \begin{document} \begin{center} \begin{tikzpicture}[ x=1.2cm, y=1.2cm, stock liquid/.style={top color=blue!40!cyan, bottom color=blue!70!cyan}, dilute liquid/.style={top color=blue!20!cyan, bottom color=blue!40!cyan}, glassware/.style={thick, draw=black!70, fill=cyan!10, fill opacity=0.15, join=round}, text node/.style={align=center, font=\small} ] % --- Step 1 (Left) --- \begin{scope}[shift={(0,0)}] \pic at (0,0) {flask={1.1/stock liquid}}; \pic at (0,0.3) {pipette={0/3.9}}; \draw[-{Stealth[length=2.5mm]}, thick] (-0.4, 0.3) -- (-0.4, 1.1); \pic at (2.5,0) {flask={0/white}}; \node[text node] (lblStock) at (-2.0, 0.5) {\textbf{المحلول الأم}\\\textenglish{Stock}\\\textenglish{solution}}; \draw (lblStock) -- (-0.8, 0.4); \node[text node] (lblPipette) at (2.0, 4.0) {\textbf{ماصة عيارية}\\\textenglish{Volumetric}\\\textenglish{pipette}}; \draw (lblPipette) -- (0.1, 3.2); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نأخذ بواسطة ماصة عيارية حجم \textenglish{V0} من المحلول الأم.}}; \end{scope} % --- Step 2 (Middle) --- \begin{scope}[shift={(6.5,0)}] \pic at (0,0) {flask={0.6/stock liquid}}; \pic at (2.5,0) {flask={0.3/stock liquid}}; \pic at (2.5,0.6) {pipette={0/2.0}}; \draw[-{Stealth[length=2.5mm]}, thick] (2.1, 1.4) -- (2.1, 0.6); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نفرغ المحتوى في حوجلة عيارية بها القليل من الماء المقطر.}}; \end{scope} % --- Step 3 (Right) --- \begin{scope}[shift={(13,0)}] \pic at (0,0) {flask={0.6/stock liquid}}; \pic at (2.5,0) {flask={2.5/dilute liquid}}; \pic at (4.5, 1.2) {washbottle}; \node[text node] (lblDilute) at (4.5, 0.5) {\textbf{المحلول البنت}\\\textenglish{Dilute}\\\textenglish{solution}}; \draw (lblDilute) -- (3.5, 0.4); \node[text node] (lblWater) at (6.5, 2.5) {\textbf{ماء مقطر}}; \draw (lblWater) -- (5.0, 2.2); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نكمل بالماء المقطر حتى نحصل على الحجم المطلوب (العياري).}}; \end{scope} \end{tikzpicture} \end{center} \end{document} My questions: How can I improve the shading and gradients of the glassware (flasks, pipettes) to achieve the 3D, glossy look shown in the targets? Are there any existing pure TikZ libraries or packages designed specifically for modern, realistic laboratory equipment? (Please note I do not want to use pst-labo or any PSTricks-based packages). How can I approach drawing the digital scale, the funnel, and the human hands holding the glassware for the second image?

  • How do I type the “幾年幾班” classification format for birth years in the Republic of China era in Taiwan using LaTeX?
    by mathrm alpha on August 31, 2026 at 12:17 pm

    In Taiwan, there’s a humorous, interesting, and somewhat quirky way of categorizing people based on their birth year. For example, if you were born in a certain year of the Republic of China era, you’re referred to as “幾年幾班” I’d like to create a LaTeX script that automatically generates this “幾年幾班” format. For example, in the Republic of China, the classification system that maps birth years to grade levels is as follows: Born in the 35th year (1946 year) = 3 年 5 班 https://carsoncheng.wordpress.com/2006/05/18/%E4%BD%A0%E5%B9%BE%E5%B9%B4%E7%B4%9A%EF%BC%9F/

  • Two columns of items
    by Andy Fletcher on August 31, 2026 at 8:54 am

    I'm creating a list of items in two columns as the picture show, with the first half in the left and the second one in the right. In the process I used minipage, but the items are not horizontal aligned, line by line. For instance, in the example, item 1 and 3 are not under the same horinzontal line. There is a way to creating these two columns such that, in each line, the items are in the same horinzontal line? Thanks. \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \begin{document} \begin{enumerate} \begin{minipage}[l]{0.45\textwidth} \item a. \item b. \end{minipage} \begin{minipage}[l]{0.45\textwidth} \item c: $\dfrac{\dfrac{a}{b}}{2}$. \item d \end{minipage} \end{enumerate} \end{document}

  • Why box255 has non-zero depth when height is sufficient?
    by Igor Liferenko on August 31, 2026 at 5:50 am

    If we run TeX on this file \immediate\write16{vsize=\the\vsize} \def\pagebody{\immediate\write16{ht=\the\ht255 \space dp=\the\dp255 } \box255 } \hbox{A\vrule depth1pt B} \eject \end we get this output vsize=643.20255pt ht=643.20255pt dp=1.0pt Why height of box255 is equal to vsize while the height of hbox is less then vsize? Also, vsize is large enough to contain height+depth of hbox, but box255 has depth of hbox. Why? Where is this behavior documented in TeXbook?

  • Suppressing an expl3 warning [duplicate]
    by Andrew Stacey on August 30, 2026 at 10:58 pm

    I've installed TeXLive 2026, and for some reason there's a mismatch between expl3 versions: the package that got installed and the LaTeX format. I get a warning when a package loads expl3 explicitly: ! LaTeX Error: Mismatched LaTeX support files detected. (LaTeX) Loading 'expl3.sty' aborted! (LaTeX) (LaTeX) The L3 programming layer in the LaTeX format (LaTeX) is dated 2026-03-20, but in your TeX tree the files require (LaTeX) at least 2026-04-28. For immediate help type H <return>. ... l.78 \ExplLoaderFileDate{expl3.sty}} % While I can remove the explicit load of expl3 from my own packages, I find that there are still plenty in the TL tree that load it for themselves (the current culprit being unicode-math). What's the best way to get rid of this warning? Did a step fail to run when I last updated TeXLive (and if so, how do I force it?)? The reason why I can't just ignore it is that it's messing up some automatic scripts that rely on LaTeX's exit codes.

  • Texstudio won't let me edit files [closed]
    by msaul on August 30, 2026 at 4:36 pm

    I updated Texstudios and it all went to pieces. After I update (i.e. edit) a .tex file, Texstudio does not recognize the changes. Upon compilation, I see just what I didn't want from the old version; Texstudio refuses to automatically open a .pdf viewer--either Sumatra or Adobe. I have to open it 'by hand'. All this happened when I foolishly updated Texstudio to a new improved version. It simply doesn't work! WHy can't these people leave well enough alone? My fault for updating. ALl change is bad.

  • Some tcolorbox options not working after centering a section title
    by AO3 user without CSS knowledge on August 30, 2026 at 11:12 am

    The raster column skip option of tcolorbox doesn't work correctly when I try to use it after centering the title for that section. WME: \documentclass[12pt,a4paper]{article} \usepackage{tcolorbox} \tcbuselibrary{raster} \begin{document} \begin{center} \section*{Title} \end{center} \begin{tcbitemize}[raster columns=2, raster column skip=2cm] \tcbitem box 1 \tcbitem box 2 \end{tcbitemize} \end{document} There should be a space of 2cm between the two boxes, but it doesn't appear. Instead, the space happens after the second box. Expected behaviour: Removing the \begin{center} ... \end{center} makes the code work correctly, as does removing the \section*{Title} and writing normal text inside of the center environment. Only the two combined create this problem. raster left skip has the exact same issue. Do I have to use \centering instead, or can I make this work with \begin{center} ?

  • Including Octave source code and output in LaTeX document?
    by Kevin Zembower on August 29, 2026 at 7:56 pm

    all, I'm trying to create a LaTeX document that contains both source Octave code and output, like the way that Rmarkdown can be used to create a LaTeX document with both R source code and its output. Here's an example of what I'm trying to do, in a file named 'Ex.tex': \documentclass{article} \title{Exercise 1.1 T1} \author{Kevin Zembower} \date{} \begin{document} \maketitle \section{T1} This is an example from the documentation: ```{octave,engine.path='/usr/bin/octave',results='asis',echo=TRUE} x=-10:0.1:10; plot (x, sin (x)); print -djpg ./myfigure.jpg ``` Import the generated figure: ![My Plot of sin()]{./myfigure.jpg} \end{document} I don't know whether to put this code in a .Rnw, or .tex file. I'm not sure whether to use the << >> or ```{} delimiters. I'm producing the document in Emacs with LaTeX and Polymode enabled. I'm familiar with the latex interpreter in Octave, but I don't want to use it. I want more control over the document's appearance than the markdown in Octave allows. Can I use KnitR to combine Octave and LaTeX? I tried to use the ```{} delimters with the code in a .tex file, but when it's processed with pdflatex, it doesn't execute the Octave code. Am I missing a step to knit or sweave the code? Any help getting started? Any advice or guidance is appreciated. I think I'm confusing KnitR, Rmarkdown and LaTeX codes, with a lot of frustration. -Kevin

  • Designing consistent, good-looking inline TikZ nodes for keyboard keys and menu items
    by Marco Moldenhauer on August 29, 2026 at 6:38 pm

    I am creating my own inline TikZ commands for a Blender tutorial. So far, I have defined three commands: \KeyboardLetter{...} for keyboard letters, such as \KeyboardLetter{A} \KeyboardSymbol{...} for keyboard symbols, such as \KeyboardSymbol{\shift} \BlenderMenu{...} for Blender menu items, such as \BlenderMenu{Object Mode} My main requirement is that all three types of inline nodes should have the same height, regardless of their contents. I am not particularly happy with my current design (see the output below). How could I improve the design so that keyboard letters, keyboard symbols, and Blender menu items look like they belong to the same visual system? Maybe someone has a creative idea or a nice design suggestion? 🙂 my Code \documentclass{article} \usepackage{menukeys} \tikzset{ keystroke/.style={ draw=black!50, fill=yellow!20, %drop shadow={shadow xshift=0.15ex,shadow yshift=-0.15ex,fill=black,opacity=0.7}, rectangle, %rounded corners=0.8pt, inner xsep=1.5pt, inner ysep=1.5pt, line width=0.3pt, %minimum width=0.21cm, %minimum height=0.21cm, font=\sffamily\small, %text=blue!75!black, %anchor=south } } \newcommand*\KeyboardLetter[1]{% \tikz[baseline=(key.base)] % \node[keystroke](key) {#1} ;% } \newcommand*\KeyboardSymbol[1]{% \tikz[baseline=(key.base)]{% \node[keystroke,inner sep=1.5pt] (key) {\phantom{A}}; \node[ inner sep=0.8pt, transform shape, scale=0.75 ] at (key.center) {#1}; }% } \newcommand*\BlenderMenu[1]{% \tikz[baseline=(key.base)] % \node[% keystroke, %signal, fill=red!5 ](key) {#1} ;% } \begin{document} \KeyboardSymbol{\tab}\KeyboardLetter{A}\KeyboardLetter{P}\KeyboardLetter{=}\KeyboardSymbol{\shift}\KeyboardLetter{,}\BlenderMenu{Object Mode}\BlenderMenu{Edit Mode} \end{document} my Output

  • Again: too much whitespace between integral sign and integrand
    by Jürgen on August 29, 2026 at 3:40 pm

    This follow-up question refers to this question. I tried to use the proposal from MadyYuvi, but with this code \documentclass{scrartcl} \usepackage{kpfonts-otf} \removenolimits{\int} \removenolimits{\oint} \let\oldint\int \newcommand{\newint}{\oldint\hspace{-10cm}} \let\int\newint \begin{document} \begin{equation} I = \int_0^x S ds \end{equation} \begin{equation} I = \oint_0^x S ds \end{equation} \end{document} I can't see any effect. What am I doing wrong? -- EDIT: Implementing \AtBeginDocument With the hint from DavidCarlisle I use the code \documentclass{scrartcl} \usepackage{kpfonts-otf} \removenolimits{\int} \removenolimits{\oint} \AtBeginDocument{% \let\oldint\int \newcommand{\newint}{\oldint\!\!} \let\int\newint } \begin{document} \begin{equation} I = \int_0^x S ds \end{equation} \begin{equation} I = \oint_0^x S ds \end{equation} \end{document} and the result is

  • tcolorbox suboptimal connexion with dotted borderline
    by Denis Bitouzé on August 29, 2026 at 2:40 pm

    The example of a dotted borderline in the tcolorbox's documentation (currently page 207): \documentclass{article} \usepackage{tcolorbox} \usepackage{lipsum} \tcbuselibrary{skins} \begin{document} \begin{tcolorbox}[enhanced,arc=3mm,boxrule=1.5mm, frame hidden,colback=blue!10!white, borderline={1mm}{0mm}{blue,dotted} ] \lipsum[2] \end{tcolorbox} \end{document} is miraculously well-connected. But, in general, the connexion is only suboptimal, as shown in the following picture (look at its southwestern corner), obtained by replacing \lipsum[2] by \lipsum[1] in the previous example: Is there a way to get an optimal connexion, I mean automatically, by computing the height of the box and adapting the size of the dots and/or of the space between them?

  • How to achieve numbered zref-clever references in enumerated description list?
    by modallyFragile on August 29, 2026 at 1:15 pm

    I want a to write lists which include both a number (like enumerate) and a short description (like description). I can do that as described here. I also want to be able to refer to the numbers of these lists with zref-clever. How can I achieve this? I've got as far as making the list work, and getting zref to recognise references as items, but I can't work out how to get zref to print the relevant number. MWE: \documentclass{article} \usepackage{zref-clever} \usepackage{enumitem} \newcounter{enumdescription} \newlist{enumdescription}{description}{3} \zcsetup{countertype = {enumdescription = item}} \setlist[enumdescription]{% before={ \zcsetup{currentcounter=enumdescription} \setcounter{enumdescription}{0}% start each list at }, font={ \refstepcounter{enumdescription} \normalfont\arabic{enumdescription}.~% \bfseries% } } \begin{document} \begin{enumdescription} \item[Foo]\label{foo} text. \item[Bar]\label{bar} text. \item[Baz]\label{baz} text. \end{enumdescription} Should say `item 1': `\zcref{foo}'. \end{document} (Also nice to have, since it may be useful, would be a way of using zcref's ref option to capture the descriptive labels, so I could do \zcref[ref=desclabel]{foo} and get Foo. But this isn't really important.) TIA!

  • Include part number in page references
    by KeithB on August 29, 2026 at 11:38 am

    I've got a book with 4 \parts. It would be nice if \pageref would print something like "page ii.567" for page 567 in part 2, but only if the page is not in the current part. Is this possible?

  • How to put tikz node at top left in a picture fitting all the A4 document?
    by Manuel Selva on August 29, 2026 at 8:55 am

    I have the following document : \documentclass[a4paper]{article} \usepackage[a4paper,margin=0cm,landscape]{geometry} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[remember picture, overlay] \coordinate (nw) at (current page.north west); \coordinate (se) at (current page.south east); \node [fill=red!10, fit=(nw) (se), inner sep=0pt] {}; \node [rectangle,fill=green,draw=black, minimum width=3cm, minimum height=3cm,anchor=north west] at (0, 0) {Manu}; \end{tikzpicture} \end{document} The Manu green rectangle is not in the top left corner of the resulting document while the red background done using fit correctly fits all the page. Why is the green rectangle shifted ?

  • How make a tikzpicture filling an A4 page?
    by Manuel Selva on August 29, 2026 at 6:49 am

    I want to use tikz to draw a diagram and I want this diagram occupy all the A4 space of my document (so that I can print it then). How can I achieve this ? Here is what I have for now : \documentclass[a4paper]{article} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[remember picture, overlay] \node [fill=blue, fit=(current page.north west) (current page.south east), inner sep=0pt] {}; \end{tikzpicture} \end{document} But my problem is that I want to have a landscape A4 paper. Adding : \usepackage[a4paper,margin=0in,landscape]{geometry} results in a blue rectangle occupying only part of the document. It seems that current page.north west and current page.south east are no more valid with landscape ?

  • Sections taking chapter number, subsections not numbering
    by GrahamF on August 29, 2026 at 12:49 am

    This was working fine in June. Aftrer making edits, section numbering and toc not working properly. MWE: \documentclass[letterpaper, 9pt, oneside]{memoir} \usepackage{inconsolata} \usepackage[T1]{fontenc} % Font encoding \usepackage{lmodern, newpxmath} % Font family % Additional packages \usepackage{import} \usepackage{standalone} \usepackage{enumerate} % subsubsections and higher are numbered \setsecnumdepth{subsubsection} \maxsecnumdepth{subsection} \renewcommand\thesection{\arabic{chapter}} % Number format for sections \copypagestyle{chapter}{Ruled} \checkandfixthelayout % Required \sloppybottom \begin{document} \chapter{Business Requirement}\label{ch:requirement} \section{Background}\label{sec:background} Whilst the connectivity has been periodically upgraded, it is essentially the same functionality dating from 2006 when first implemented. The on-premise server is beyond end-of-life; the software version is out-of-date and represents a potential security vulnerability. Consequently, this project is to implement the next-generation connection. \section{Scope}\label{sec:scope} The following solution components are in scope for the project: \begin{itemize} \item A \item B \item C \item D \item E \item F \end{itemize} The user processes that trigger calculations are: \begin{itemize} \item 1 \item 2 \item 3 \end{itemize} \end{document} This produces the following pdf:

  • Alternative \oplus symbol when using newpx package
    by rla on August 28, 2026 at 7:35 pm

    When using newpx package I would like to change the \oplus and \bigoplus symbols to ones whose circles are slightly greater than the plus sign. I found a partial solution here How do I put a circle around an operator? \documentclass[a4paper, 10pt]{book} \usepackage{graphicx} \usepackage{mathtools} \usepackage{newpxtext} \usepackage[varg, smallerops]{newpxmath} \makeatletter \newcommand\incircbin {% \mathpalette\@incircbin } \newcommand\@incircbin[2] {% \mathbin% {% \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}% }% } \newcommand{\myoplus}{\incircbin{+}} \makeatother \begin{document} \[ \oplus \myoplus \] \[ \bigoplus \prod \sum \] \end{document} Similarly, I would like to define \mybigoplus operator which is basically a larger version of \myoplus. A first attempt would be to use \scalerel or \resizebox commands but that approach make the symbol look like a bold version. How to define a larger version of \myoplus with weight matching with others operator like the originals \prod and \sum from the newpx package? Furthermore, it will be good to have a solution that dynamically fits its size when \textstyle or \displaystyle are imposed.

  • Relative paths in pgfkeys vs. usage in TikZ
    by karlh on August 28, 2026 at 3:12 pm

    This is more a curiosity (or bug report?) than it is an actual problem. That is, I know how to fix it/work around it, and I'm really asking about the design principle(s). Using \pgfkeys to set a key /pgf/bar is fine, but setting one /pgf/foo/bar will cause an error if the \pgf part is left off inside a TikZ path/node/etc. command: \documentclass{article} \usepackage{tikz} \pgfkeys{% /pgf/bar/.initial=1cm, /pgf/foo/bar/.initial=1cm, } \begin{document} \begin{tikzpicture} \path [bar=2cm] (0,0); \end{tikzpicture} \end{document} compare to \documentclass{article} \usepackage{tikz} \pgfkeys{% /pgf/bar/.initial=1cm, /pgf/foo/bar/.initial=1cm, } \begin{document} \begin{tikzpicture} \path [foo/bar=2cm] (0,0); \end{tikzpicture} \end{document} The latter gives the following error: ! Package pgfkeys Error: I do not know the key '/tikz/foo/bar', to which you passed '2cm', and I am going to ignore it. Perhaps you misspelled it. See the pgfkeys package documentation for explanation. Type H <return> for immediate help. ... l.13 \path [foo/bar=2cm] ( 0,0); ? Making the root path /tikz solves the problem, as does providing the full path /pgf/foo/bar, but given the statement in the TikZ documentation, section 12.4.1, I expected it to work: Is this supposed to work, or is there a reason this list is not followed when a slash is present in the key name?

  • How to put test code into a self-designed macro package
    by lyl on August 28, 2026 at 2:21 am

    I want to put some test code into a macro package like this: %mypkg.sty \newif\iftest\testfalse \RequirePackage{...} some macros designed by myself \iftest\documentclass{article} preamble \begin{document} some test codes \end{document}\else\fi When \testtrue, the file mypkg.sty wish to be compiled and run, to get an output to test if the macros designed in this file work all right. If \testfalse, all the test code would be ignored, and the package mypkg.sty can be introduced by other files. It seems that this dose not work as expected. What's wrong with this method, and if there are better ways to put macros and its test code together into a .sty file?

  • `unicode-math`: prevent `\symbf` from switching font styles and just make things bold
    by moro11 on August 27, 2026 at 7:50 pm

    Consider the MWE \documentclass[varwidth]{standalone} \usepackage{unicode-math} \begin{document} $aB\beta\Xi$\\$\symbf{aB\beta\Xi}$ \end{document} I don't like how \symbf switches Latin letters from italic to upright, while i only intend to make them bold, there are other commands to make a letter bold and switch font such as \symbfit and \symbfup. I would like \symbf to just make things bold. I know i can switch the font style (italic/upright) of lower/upper case Latin/Greek letters with the option math-style and the style of bold face letters by bold-style. Although, with the available options, i was only able to achieve the desired behavior with math-style=ISO,bold-style=ISO which results in everything being italic . From pre-unicode-math days, i am used to math-style=TeX and \usepackage{bm} which gives (everything italic except for upper case Greek letters, which are upright in normal and bold font). I guess the ISO/ISO configuration is fine, but i am still wondering if it is possible to reproduce this configuration in unicode-math? or even better, completely turn off the font switch of \symbf, i.e. always use the exact same italic/upright configuration for bold math as used in standard non-bold math, where "standard math" is defined by math-style)?

  • Full list by default available OpenType fonts in `fontspec` and `unicode-math`
    by moro11 on August 27, 2026 at 6:54 pm

    Is there a (approximately) complete list of OpenType fonts available by default within fontspec and unicode-math? I was not able to find something similar. So maybe this post could also be used to collect some. Just to specify what i mean: it is clear that there can not be a complete list as any OpenType font file (.otf) is compatible, and what font files are available by default probably varies on your TeX installation and can be looked up in /texmf/fonts/opentype. But there are some preconfigured named fonts which are loaded by name instead of loading a specific font file. As a fontspec example, loading the named font STIX Two Text and the font file STIXTwoText-Regular.otf in the following MWE \documentclass{standalone} \usepackage{fontspec} \setmainfont{STIX Two Text} \begin{document} ABC \textbf{ABC} \end{document} \documentclass{standalone} \usepackage{fontspec} \setmainfont{STIXTwoText-Regular.otf} \begin{document} ABC \textbf{ABC} \end{document} lead to and , respectively. As a unicode-math example, loading the named font NewComputerModernMath and the font file NewCMMath-Regular.otf in the following MWE \documentclass{standalone} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \begin{document} $ABC$ $\symcal{ABC}$ \end{document} \documentclass{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \begin{document} $ABC$ $\symcal{ABC}$ \end{document} lead to and , respectively. It seems to me, that these named fonts are not just equivalent to loading a specific .otf file, but there is some configuration happening in the background. (I guess they combine several .otf files.) So my question: is there a (approximatly) complete list of preconfigured named fonts provided by fontspec and unicode-math, respectively? In case fontspec and unicode-math do not provide these named fonts themselves, such a list might not exist, nevertheless they have to look them up somewhere. So, in this case, is there a way to manually look up locally available named fonts instead of playing a guess-the-name game (just like i am able to look up available .otf files in /texmf/fonts/opentype)?

  • Specify version=bold for specific font using unicode-math
    by moro11 on August 27, 2026 at 5:38 pm

    I am switching to unicode-math and have some trouble with the bold fonts. I know the intended way in unicode-math is to use \symbf, \symbfcal etc. which boldens characters, but no symbols like + or accents like \tilde. This is fine when boldface is used for schematics (e.g. to denote vectors). But sometimes, i want to use mathematics just in an all-bold environment (e.g. in section titles) where just everything should be bold. I know i could set a bold version of a math alphabet and switch to that using \boldmath or \boldsymbol instead of \symbfXY. (of course setting up these fonts has to be done carefully, as one might end up with two different bold fonts otherwise.) Now, i further want to have access to two calligraphic fonts \symcal and \symscr ideally with full support for both, but i can not get that to work. Consider the following MWE (the fonts are available at CTAN): \documentclass[varwidth]{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \begin{document} $\symcal{A}$ (symcal) $\symbfcal{A}$ (symbfcal) {\boldmath$\symcal{A}$} (boldmath + symcal)\\ $\symscr{A}$ (symscr) $\symbfscr{A}$ (symbfscr) {\boldmath$\symscr{A}$} (boldmath + symscr) \end{document} producing What i want to have is I tried other configurations as well, such as: \setmathfont{NewCMMath-Regular.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold, range={scr,bfscr}, StylisticSet=1]{NewCMMath-Bold.otf} I have the bad feeling that i found some hard limits of the unicode-math package. Is there any way to achieve this? I would also be happy with some workarounds if this is not possible. Maybe some adjusted .otf files. Or redefining the mechanic behind \boldmath and \boldsymbol to additionally redefine \symscr and \mathscr with \symbfscr and \mathbfscr or something (i guess these are the only non-bold alphabets, so replacing them with bold version might not be ideal, but probably good enough?) I mean, we are talking about the second calligraphic font in combination with the lesser used bold mechanic, so the use-case is probably not the most relevant. Nevertheless it feels odd to not have support for that at all, especially, as this is no problem without unicode-math using the old 8-bit engine.

  • tikz pgfplot fill area between multiple graphs or paths
    by paul_schaefer on August 27, 2026 at 12:22 pm

    MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[scale=1] \begin{axis}[ axis equal, % axis line style=thick, axis x line=center, ylabel={$y$}, xlabel={$x$}, major tick style = {black}, axis y line=middle, every axis y label/.style={ at={(current axis.above origin)}, inner sep=3, anchor=north east, }, every axis x label/.style={ at={(current axis.right of origin)}, inner sep=3, anchor=north east, }, xtick={-1,1}, xticklabels={$-\frac{w}{2}$,$\frac{w}{2}$}, ytick={1}, yticklabels={$h$}, yticklabel style={anchor=south west}, xmin=-1.75, xmax=3.25, ymin=-0.1, ymax=1.5, height=4cm, samples=100] \addplot[domain=-1:1,thick, name path=A] {1 - x * x}; \addplot[domain=0.5:2.5,thick, name path=B] {1 - (x-1.5) * (x-1.5)}; \draw[name path=C, thin] (1/3,8/9) -- (1.5,1); \path [name path=D] (\pgfkeysvalueof{/pgfplots/xmin},0) -- (\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[black!15] fill between[of=C and A, soft clip={domain=0:0.75}]; \addplot[black!15] fill between[of=C and B, soft clip={domain=0.75:1.5}]; \addplot[black!40] fill between[of=B and D, soft clip={domain=0.5:0.75}]; \addplot[black!40] fill between[of=A and D, soft clip={domain=0.75:1}]; \end{axis} \end{tikzpicture} \end{document} results in a graph, where the areas between the both graphs are filled in gray. In this example I splitted the areas into four sections and colored them. Is there a possibility to fill the areas without splitting them into sections? A second problem is, that the separation of each area into two parts will sometimes result in in slight white vertical line between the colored areas. In my case it depends on the scaling of the pdf viewer I use. If there area could be described without separation this should not happen.

  • How to draw 3D animation of reflection of a triangle about the bisector?
    by Learner on August 26, 2026 at 6:50 pm

    I want to plot a 3D animation of an equilateral triangle about one bisector. I have plotted the steps by using tikz: \documentclass[a4paper,11pt]{article} \usepackage{tikz} \usepackage[margin=1.2cm]{geometry} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] % First triangle: \begin{scope}[shift={(0,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Median = axis of reflection \draw[dashed,very thick] (0,0) -- (0,2); % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below right] at (C) {$C$}; % Element \node at (0,-0.7) {I}; \end{scope} %Arrow from first triangle to second triangle \draw[->,thick] (2.2,1) -- (5.8,1); \node at (4,1.2) {s}; \node at (4,0.5) {$(\text{reflection})$}; %second triangle \begin{scope}[shift={(8,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Reflect in the vertical median \begin{scope}[xscale=-1] % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above left] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below] at (C) {$C$}; \end{scope} % Reflection axis \draw[dashed,very thick] (0,0) -- (0,2); \node at (0,-1) {II}; \end{scope} \end{tikzpicture} \end{document} which gives the following two triangles: I want to plot a 3D animation to display the reflection about the bisector.I would appreciate to do that. The vertices B and C will be changing every time but A will remain fixed. Note that the first triangle and the last triangle are same.

  • PDFs not displayed in a document with background image
    by Rodrigo Tavares on August 26, 2026 at 5:14 pm

    I used a background image on the main part of the document, which is an RPG book, with the command \AddToHook, here my preamble: \documentclass[a5paper,oneside]{book} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,latexsym} \usepackage{graphicx} \usepackage{amsthm} \usepackage{marvosym} \usepackage{lipsum} \usepackage{wrapfig} \usepackage{makeidx} \usepackage{siunitx} \usepackage{caption} \usepackage{pdfpages} \usepackage{lipsum} \makeindex \AddToHook{shipout/background} { \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{fundo.pdf}} } \usepackage{lipsum} \usepackage[Lenny]{fncychap} \begin{document} \chapter{one} \lipsum \chapter{Two] \lipsum \newpage \includepdf{ficha3dnd.pdf} \newpage \includepdf{fichastoryweller.pdf} \newpage \printindex \end{document} But in the end of the document I wanted to show the images of the character sheets. I used the package pdfpages and used the command \includepdf to display the two character sheets in a entire page each. But when I compile the images are not displayed, instead the background appear without any image in it. How can I solve it? There's a way to deactivate the background in these two pages?

  • Why does \pgfkeysvalueof give different results between nearly same codes
    by lyl on August 26, 2026 at 4:34 am

    \documentclass{article} \usepackage{tikz} \begin{document} \pgfkeys{my family/my key/.initial=hello} \pgfkeysvalueof{my family/my key} % Running the above two lines of code gets nothing \pgfkeys{/my family/my key/.initial=hello} \pgfkeysvalueof{/my family/my key} % Running the above two lines of code gets right output as expected. % What causes such different results between the two block of codes? \end{document}

  • Is it possible to have a different tocdepth in two table of contents?
    by KeithB on August 25, 2026 at 10:49 am

    I've not been able to find a way to achieve this behaviour, in which the local toc has full depth, but the main toc suppresses sections for part 2 only. Any suggestions? Document structure: \documentclass{book} \usepackage{etoc} % or is there something better? \begin{document} \part{Part 1} \tableofcontents \chapter{Chapter 1} \section{Section 1.1} \section{Section 1.2} \chapter{Chapter 2} \section{Section 2.1} \section{Section 2.2} \part{Part 2} \localtableofcontents \chapter{Chapter 3} \section{Section 3.1} \section{Section 3.2} \chapter{Chapter 4} \section{Section 4.1} \section{Section 4.2} \chapter{Chapter 5} \section{Section 5.1} \section{Section 5.2} \end{document} Desired toc: Table of contents of both parts % NB: sections of part 2 suppressed (tocdepth changes for part 2) Chapter 1 ..................................................... Section 1.1 ................................................. Section 1.2 ................................................. Chapter 2 ..................................................... Section 2.1 ................................................. Section 2.2 ................................................. Chapter 3 ..................................................... Chapter 4 ..................................................... Chapter 5 ..................................................... Table of contents of part 2 % NB: sections of part 2 shown Chapter 3 ..................................................... Section 3.1 ................................................. Section 3.2 ................................................. Chapter 4 ..................................................... Section 4.1 ................................................. Section 4.2 ................................................. Chapter 5 ..................................................... Section 5.1 ................................................. Section 5.2 .................................................

  • I cannot write any commands inside "\textArab{}"
    by الطريق طالب العلم on August 24, 2026 at 7:08 pm

    I have a problem: After creating my custom character map "MyRules.lua", I can type the characters perfectly, but I cannot type any commands inside \textArab{}. This file 'MyRules.lua' local TransTable = { -- 1. معالجة الحروف المشددة أولاً (لأنها تتكون من رمز مكرر) {a = "%^t", b = "ث"}, {a = "%^H", b = "خ"}, {a = "%^d", b = "ذ"}, {a = "%^r", b = "ز"}, {a = "%^s", b = "ش"}, {a = "%^S", b = "ض"}, {a = "%^T", b = "ظ"}, {a = "%^A", b = "غ"}, {a = "%:y", b = "ي"}, } singlefv = { {a="e", b="ء"}, {a="a", b="ا"}, {a="b", b="ب"}, {a="t", b="ت"}, {a="j", b="ج"}, {a="H", b="ح"}, {a="d", b="د"}, {a="r", b="ر"}, {a="s", b="س"}, {a="S", b="ص"}, {a="T", b="ط"}, {a="f", b="ف"}, {a="A", b="ع"}, {a="f", b="ف"}, {a="q", b="ق"}, {a="k", b="ك"}, {a="l", b="ل"}, {a="m", b="م"}, {a="n", b="ن"}, {a="h", b="ه"}, {a="w", b="و"}, {a="y", b="ى"}, {a="c", b="c"}, } LuaAr = {} function LuaAr.process(text) local inside = text -- حلقة تكرارية تمر على الجدول من أول سطر إلى آخره for i = 1, #TransTable do inside = string.gsub(inside, TransTable[i].a, TransTable[i].b) end for i = 1,#singlefv do inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) end -- إرجاع النص النهائي بعد تحويله بالكامل return inside end This is the code \documentclass{article} \usepackage{amsmath,amssymb,amsfonts} \usepackage{comment,luacode,xstring} \usepackage[no-math]{fontspec} \usepackage{polyglossia} \usepackage{xspace} \setdefaultlanguage[numerals=maghrib]{arabic} % from polyglossia \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic, Mapping=maghrib]{Times New Roman}%Amiri \newfontfamily\englishfont[Script=Arabic,Mapping=maghrib]{Times New Roman} \newfontfamily\fontmath[Script=Arabic,AutoFakeBold=.7,%FakeSlant=-0.2 WordSpace =.8,PunctuationSpace=2, SizeFeatures={ {Size={-8},FakeStretch=1.1,FakeBold=1.5}, {Size={8-14}}, {Size={14-}}, }]{MyFonttwo002-VF.ttf} \directlua{dofile(kpse.find_file("MyRules.lua"))} \newcommand{\trans}[1]{% \bgroup \fontmath % \textdir TRT % جعل اتجاه الكتابة من اليمين إلى اليسار \directlua{tex.sprint(LuaAr.process(\luastringN{#1}))}\egroup% } \makeatletter \def\arabtexcodes{\catcode`^=11\relax\catcode`_=11\relax} %\let\arabtex@codes\arabtexcodes \makeatother \newcommand{\textArab}[1]{% \bgroup% \arabtexcodes \fontmath \ifvmode\leavevmode\fi% \directlua{tex.sprint(LuaAr.process(\luastring{#1}))}% \egroup% } \newcommand{\ar}[1]{%->arb-math inline {\ignorespaces\textArab{#1}} } \newcommand{\afrac}[2]{ {\bfseries\boldmath\fontspec{MyFonttwo002-VF.ttf}[FakeStretch=1.1,FakeBold=1.5]\ensuremath{\!\frac{\text{\textArab{#1}}}{\text{\textArab{#2}}}}} } \begin{document} \textArab{0123456789\\1.2\\ e a b t ^t j H^H d ^d r ^r s ^s S ^S T ^T A ^A f q k l m n h w y c }% $\frac{num}{den}$ \\ \ar{a + \afrac{num}{den}} \end{document} I have a problem. ! Incomplete \iffalse; all text was ignored after line 57. <inserted text> \fi <*> document.tex The file ended while I was skipping conditional text. This kind of error happens when you say `\if...' and forget the matching `\fi'. I've inserted a `\fi'; this might work. ! Emergency stop. <*> document.tex *** (job aborted, no legal \end found) Here is how much of LuaTeX's memory you used: 6259 strings out of 475695 100000,794899 words of node,token memory allocated 1050 words of node memory still in use: 6 hlist, 1 vlist, 2 rule, 1 local_par, 1 dir, 32 glue, 4 kern, 6 penalty, 44 glyph, 12 attribute, 52 glue_spec, 12 attribute_list, 1 temp, 3 if_stack, 2 writ e nodes avail lists: 2:1,4:1,5:6,7:1 29001 multiletter control sequences out of 65536+600000 31 fonts using 14732263 bytes 73i,1n,93p,291b,265s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!

  • tikz how to stop lines at shape edge when using plotted coordinates
    by JKomp on August 23, 2026 at 10:49 pm

    I'm writing a translator from OmniGraffle (left diagram) to tikz and I've run into a bit of a problem for translating lines (right diagram). Lines in OmniGraffle are specified as a start point, middle vertices and an ending point. I can replicate the exact shape of the line from the OmniGraffle points by using tikz plot/coordinates in a draw but I'm unsure how to change the code to end at the shape boundary. Here's my MWE \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (36pt,-36pt) circle [radius=36pt ] node [] (S0) { S0}; \draw[red] plot [smooth, tension=1] coordinates { (S0) (-17.600000262260437pt, 3.89259546372341pt) (15.955999737740058pt, 28.233391483626292pt) (S0)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (87.40297565709261pt, 7.120001628994942pt) (57.999990582466125pt, 25.534386508502394pt) (36pt, -36pt)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (-15.128618137809553pt, -70.48571669739613pt) (10.699999623000622pt, -91.0802335745775pt) (36pt, -36pt)}; \end{tikzpicture} \end{document} Note, this is an early phase so things like line widths, arrowheads, text formatting, and converting out of pt coordinates are later tasks.