• Official documentation of \pgfmathparse's behavior when processing a comma-separated list of ⟨expressions⟩?
    by Ulrich Diez on December 11, 2025 at 11:19 pm

    \pgfmathparse{(1*2),(2+2),(sqrt(36))} yields defining \pgfmathresult as macro:->{2.0}{4.0}{6.00000} : \documentclass{article} \usepackage{tikz} \begin{document} \pgfmathparse{(1*2),(2+2),(sqrt(36))} \ttfamily \meaning\pgfmathresult \end{document} But this feature of processing a comma-separated list of ⟨expressions⟩ via \pgfmathparse in one go for obtaining a list of undelimited macro arguments seems not documented clearly/explicitly in pgfmanual.pdf. Precise syntax-rules for the quantity "⟨expression⟩", which is introduced and referred to in in pgfmanual.pdf, seem to be missing, too. So the question is: Can you rely on \pgfmathparse calculating all components of a comma-separated tuple of independent ⟨expressions⟩ in one go and via \pgfmathresult delivering the results as a tuple of undelimited macro arguments? (In section "96 Customizing the Mathematical Engine" of the TikZ & PGF Manual for Version 3.1.11a you find: For functions with more than nine arguments, or functions with a variable number of arguments, these macros are only defined as taking one argument. The public macro expects its arguments to be comma separated, for example, \pgfmathVariableArgs{1.1,3.5,-1.5,2.6}. Each argument is parsed and passed on to the private macro as follows: \pgfmathVariableArgs@{{1.1}{3.5}{-1.5}{2.6}}. However, this does not exactly refer to \pgfmathparse/\pgfmathresult...)

  • Handwritten format [duplicate]
    by Latexfan on December 11, 2025 at 8:47 pm

    how can I creat the text format like this picture. It is not "kalam" format. Can you please help me that it can be compiled with pdftex? This is french. I wish to write in norwegian Thank you

  • Multipart rectangle error
    by ozsu on December 11, 2025 at 8:28 pm

    I am having a problem with a multipart rectangle. I give a MWE below. At \nodepart{twentyone} {\scriptsize 00000000010}% and \nodepart{twentytwo} {\scriptsize 00000000001}% it complains error: 45: Missing number, treated as zero. \nodepart{twentyone} { Any reason? Is there a max limit on the boxes? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart} \begin{document} \begin{tikzpicture} \node[ rectangle split, rectangle split horizontal, rectangle split parts=22, draw, minimum height=1cm, align=center, rectangle split part fill={ % --- FIX: Added commas before the % comments --- green!50,green!50,green!50,green!50,green!50,green!50, % dict dates green!50,green!50,green!50,green!50,green!50, % (11 parts) yellow,yellow,yellow,yellow,yellow,yellow, % bitmaps yellow,yellow,yellow,yellow,yellow,yellow % (11 parts) } ] (recSt) {% % Dictionary (dates) \nodepart{one} {\scriptsize 2005-11-01}% \nodepart{two} {\scriptsize 1998-05-01}% \nodepart{three} {\scriptsize 2009-04-22}% \nodepart{four} {\scriptsize 1998-11-01}% \nodepart{five} {\scriptsize 2010-05-01}% \nodepart{six} {\scriptsize 2022-09-01}% \nodepart{seven} {\scriptsize 2021-03-18}% \nodepart{eight} {\scriptsize 2011-01-01}% \nodepart{nine} {\scriptsize 0216-07-01}% \nodepart{ten} {\scriptsize 2013-01-08}% \nodepart{eleven} {\scriptsize 2017-10-10}% % Bitmaps (one-hot) \nodepart{twelve} {\scriptsize 10000000000}% \nodepart{thirteen} {\scriptsize 01000000000}% \nodepart{fourteen} {\scriptsize 00100000000}% \nodepart{fifteen} {\scriptsize 00010000000}% \nodepart{sixteen} {\scriptsize 00001000000}% \nodepart{seventeen} {\scriptsize 00000100000}% \nodepart{eighteen} {\scriptsize 00000010000}% \nodepart{nineteen} {\scriptsize 00000001000}% \nodepart{twenty} {\scriptsize 00000000100}% \nodepart{twentyone} {\scriptsize 00000000010}% \nodepart{twentytwo} {\scriptsize 00000000001}% }; \end{tikzpicture} \end{document}

  • Cannot get rid of "Label(s) may have changed" warning in a TikZ picture
    by pdini on December 11, 2025 at 7:04 pm

    I made partial progress on this question thanks to two answers to this question. The first answer, by David Carlisle, provides some very useful diagnostic code, which I used. The second answer, by Matthew Leingang, talks about a similar error to what I got involving TikZ and in particular pgfid*. The solution that worked for Leingang is not relevant to my code because I do not use \tkzstyle. Since I know next to nothing about TikZ and use it only occasionally, I am hoping someone can help me find the cause of the warning. It took me a while to isolate the problem in this code for a (rather odd-looking) table. The table is just showing two balance sheets, with nonsensical filler text. In this code example the arrows are not properly placed, but this is just because I am using a different class file. When using the class file of the journal this is supposed to go into the arrows come out fine (and, importantly, I get the same error). \documentclass[pdftex]{article} \usepackage{tikz} \usetikzlibrary{arrows,through} \usepackage{nicematrix} \usepackage{multirow,array} \usepackage{ragged2e,booktabs} \makeatletter \def\Cline#1#2{\@Cline#1#2\@nil} \def\@Cline#1-#2#3\@nil{% \omit \@multicnt#1% \advance\@multispan\m@ne \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi \@multicnt#2% \advance\@multicnt-#1% \advance\@multispan\@ne \leaders\hrule\@height#3\hfill \cr} \makeatother \newcolumntype{M}[1]{>{\Centering\arraybackslash}m{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% This code by David Carlisle addresses the warning %%% 'Label(s) may have changed...' %%% It causes the specific labels causing the problem %%% to be output in the log file: \makeatletter \def\@testdef #1#2#3{ \def\reserved@a{#3}\expandafter \ifx \csname #1@#2\endcsname \reserved@a \else \typeout{^^Jlabel #2 changed:^^J% \meaning\reserved@a^^J% \expandafter\meaning\csname #1@#2\endcsname^^J}% \@tempswatrue \fi} \makeatother %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \renewcommand{\arraystretch}{1.2} \begin{table} \small \centering \begin{tabular}{wc{2.3cm} !{\vrule width 1pt} wc{2.3cm} M{2.5cm} wc{2.3cm} !{\vrule width 1pt} wc{2.3cm} } \multicolumn{2}{c}{}&&\multicolumn{2}{c}{}\\ \small{A} & \small{B} & & \small{C} & \small{D} \\ \Cline{1-2}{1pt}\Cline{4-5}{1pt} \tikz[remember picture]\node (AD) {\small{11111}}; \tikz[remember picture]\node (X) {\small{22222}}; & \tikz[remember picture]\node (LD) {\small{33333}}; \tikz[remember picture]\node (X) {\small{44444}}; & & \tikz[remember picture]\node (X) {\small{11111}}; \tikz[remember picture]\node (AC) {\small{22222}}; & \tikz[remember picture]\node (X) {\small{33333}}; \tikz[remember picture]\node (LC) {\small{44444}}; \\ \tikz[remember picture]\node (AD) {$+\qquad$ }; \tikz[remember picture]\node (X) {$-$}; & \tikz[remember picture]\node (LD) {$-\qquad$}; \tikz[remember picture]\node (X) {$+$}; & & \tikz[remember picture]\node (X) {$+\qquad$}; \tikz[remember picture]\node (AC) {$-$}; & \tikz[remember picture]\node (X) {$-\qquad$}; \tikz[remember picture]\node (LC) {$+$}; \end{tabular} \begin{tikzpicture}[remember picture, ->, >=stealth', shorten >= -0.3cm, shorten <= -0.3cm, line width=1pt, auto] \draw[thick, draw=black, bend right=15] (LD) to (AC); \draw[dotted, draw=black, bend right=20] (AD) to (LC); \end{tikzpicture} \caption{This is the table caption} \label{tab:table1} \end{table} \end{document} Any help debugging this code is much appreciated.

  • Theorem numbers in smallcaps
    by xryophile on December 11, 2025 at 6:04 pm

    I have sectioning elements in my documents in bold smallcaps of various sizes. I was hoping to be able to achieve this with my theorems, remarks, etc. as well. However, while this works for the labels (i.e. "Theorem", "Definition", etc.) for some reason the numbers remain in upshape (although they are bolded). Is there some way to "smallcap" the number too? Here is a minimal (not) working example: \documentclass{article} \usepackage{tgpagella} % Need a font with scshape \usepackage{amsthm,thmtools} \declaretheoremstyle[ headfont=\scshape\normalsize\bfseries, ]{definition} \declaretheorem[style=definition] {definition} \begin{document} \setcounter{definition}{2} % Difference is clear with 3 \begin{definition} Number is bold, but not \\smallcaps. Bold \emph{and} small caps: \textbf{\textsc{3}}. \end{definition} \end{document} The result is N.B. I've tried using the headformat key of declaretheoremstyle too, passing things like \textsc{\NUMBER}, but this doesn't seem to help. [Although it does work with \NAME.] N.B.B. I'm using thmtools for reasons I've omitted from this MWE, so if an answer is possible within the framework of this package that would be excellent. Of course, if it can be done internally in amsthm or ntheorem that would be fine too. On the other hand, even though it may be possible to simply write a whole theorem environment from scratch, I'm not at this point inclined to fix this (minor) issue in this way.

  • Fit brackets around a fraction expression
    by category on December 11, 2025 at 5:55 pm

    The following code: \{ \frac{m}{n} \} creates a fraction that is larger than the brackets: how do I fit the fraction inside the brackets?

  • Maximum, minimum, saddle and inflection points
    by Dimitrios ANAGNOSTOU on December 11, 2025 at 5:27 pm

    I want to illustrate the different cases that can arise in a typical calculus course of functions of one variable. After searching a lot, I found a relevant question here. So, I am using the following code to plot a function for illustrating the various cases (local extremums, inflection and saddle points) along with the respective tangents. \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} \usetikzlibrary {intersections} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=12cm, height=7cm, axis x line=middle, axis y line=middle, xlabel={$x$}, ylabel={$f(x)$}, xmin=-0.08, xmax=1.3, ymin=-0.008, ymax=0.01, samples=300, domain=-0.08:1.3, clip=false, xtick=\empty, ytick=\empty, xlabel style={at={(ticklabel cs:1)}, anchor=west}, ylabel style={at={(ticklabel cs:1)}, anchor=south} ] % === Polynomial (The function) === \addplot[very thick, blue, name path=poly] {(1/16)*x - (3/8)*x^2 + (37/48)*x^3 - (21/32)*x^4 + (1/5)*x^5}; % ======================================================= % === Critical points (f'(x)=0) and Horizontal Tangents === % Points: (0.125, 0.0033045), (0.5, -0.0009115), (1, 0.0020833) \addplot[only marks, mark=*, blue] coordinates { (0.125,0.0033045) (0.5,-0.0009115) (1,0.0020833) }; % Tangent segment 1 (Horizontal) \addplot[red, very thick, domain=-0.075:0.325, samples=2] {0.0033045}; % Tangent segment 2 (Horizontal) \addplot[red, very thick, domain=0.3:0.7, samples=2] { -0.0009115}; % Tangent segment 3 (Horizontal) \addplot[red, very thick, domain=0.8:1.2, samples=2] {0.0020833}; % ======================================================= % === Inflection points (f''(x)=0) and General Tangents === % Points: (0.2673, 0.0015571), (0.7014, 0.0004592) % Slopes: m1 ~ -0.019, m2 ~ 0.0104 \addplot[only marks, mark=*, orange] coordinates { (0.2673056,0.0015571) (0.7014444,0.0004592) }; % Tangent segment 4 (Inflection 1) \addplot[green, very thick, domain=0.0673:0.4673, samples=2] {-0.019*(x-0.2673056)+0.0015571}; % Tangent segment 5 (Inflection 2) \addplot[green, very thick, domain=0.5014:0.9014, samples=2] {0.0104*(x-0.7014444)+0.0004592}; % Origin label \node[anchor=north west] at (axis cs:0,0) {\small $O$}; \end{axis} \end{tikzpicture} \end{document} But this require a lot of manual calculations on my own. Is there a way or package to accelerate such calculus visualisations? A big thank you!

  • 2D-image of a coil winding around a cylinder with 'dash pattern'
    by cis on December 11, 2025 at 4:35 pm

    (2nd picture from here) I was wondering if it's possible to create a 2D-image of a coil winding around a cylinder, similar to the example shown above, using a dash pattern. If so, how do I configure it? \documentclass[margin=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture}[] \draw[] (0,-0.4) rectangle (5,0.4); \draw [decorate, decoration={coil, aspect=0.4, amplitude=5 mm, segment length=4mm, }, dash pattern=on 11mm off 8mm, dash phase=0mm ] (0,0) -- (5,0); \end{tikzpicture} \end{document}

  • Sidecaption and capion text bidi
    by الطريق طالب العلم on December 11, 2025 at 3:34 pm

    I'm having trouble creating Arabic sidebar text; it's not working properly. \documentclass[twoside]{book} \usepackage[]{geometry} \geometry{ paperwidth=8.49in,%210mm, paperheight=297mm, right=.8in,%42pt, top=72pt, textwidth=320pt, marginparsep=20pt, marginparwidth=180pt, reversemarginpar, textheight=650pt, footskip=40pt, } %\evensidemargin 1.5in %\oddsidemargin -0.1in \usepackage{graphicx} \usepackage{sidenotes} \NewDocumentCommand{\SideCaption}{sO{#3}mo}{% \IfBooleanTF{#1} {% \sidecaption* \IfNoValueTF{#4}{\sidecaption*{#3}}{\sidecaption*[#4]{#3}}% } {% \sidecaption \IfNoValueTF{#4}{\sidecaption[#2]{#3}}{\sidecaption[#2][#4]{#3}}% }% } \makeatletter \newcommand*{\centerfloat}{% \parindent \z@ \leftskip \z@ \@plus 0fil \@minus \textwidth \rightskip\leftskip \parfillskip \z@skip} \makeatother \usepackage{polyglossia} \setmainlanguage[numerals=maghrib,abjadjimnotail]{arabic} \setotherlanguage{english} \newfontfamily\englishfont[]{Times New Roman} \newfontfamily\englishfontsf[AutoFakeBold=4.1,AutoFakeSlant=0.28,AutoFakeBold=4.1]{HacenTunisia}% \newfontfamily\arabicfont[Script=Arabic,Scale=.92,ItalicFont=Amiri-Italic,BoldItalicFont=Amiri-BoldItalic,AutoFakeBold=4.5 ]{Calibri} \newfontfamily\arabicfontsf[Script=Arabic,AutoFakeSlant=-0.28,AutoFakeBold=4.1]{HacenTunisia} \begin{document} \listoffigures \begin{figure}[htb] \SideCaption{Text next to image 1}[-2\baselineskip] \includegraphics[width=\textwidth]{example-image-a} \end{figure} \begin{figure}[htb] \SideCaption[Lof text]{Text next to image 2}[-2\baselineskip] \includegraphics[width=\textwidth]{example-image-a} \end{figure} \begin{figure}[htb] \caption[Text in listoffigures]{Text next to image 3} \includegraphics[width=\textwidth]{example-image-a} \end{figure} \end{document}

  • METAFONT character sizes are unpredictable
    by Grzegorz Brzczyszczykiewicz on December 11, 2025 at 2:22 pm

    I thought I finally fixed a size issue, but when I wanted to fix a character and re-ran METAFONT, the dimensions are too big, and there is too much empty space. The results are similar to what I see here. I tried everything: define_pixels, removing hash marks, changing mode - NOTHING works. here is what I have: % strokeff.mf mode_setup; xoo#:=10pt; yoo#:=10pt; thick#:=8pt; define_pixels(xoo, yoo, thick); beginchar(0, 7*xoo#, 7*yoo#, 0); %H pickup pencircle scaled thick; draw (0*xoo#, 3*yoo#)--(6*xoo#, 3*yoo#); endchar; % more characters here, omitted beginchar(66, 0*xoo#, 0*yoo#, 0); %meant to be unused, just to test font pickup pencircle scaled thick; draw (0*xoo#, 0*yoo#)--(0*xoo#, 7*yoo#)--(7*xoo#, 7*yoo#)--(7*xoo#, 0*yoo#)..cycle; endchar; font_quad:=7*yoo#; font_normal_space:=7*xoo#; font_normal_stretch:=1*xoo#; font_normal_shrink:=1*xoo#; font_identifier:="strokeff"; font_coding_scheme:="FONT SPECIFIC" end and the .fd file: \DeclareFontFamily{U}{strokeff}{} \DeclareFontShape{U}{strokeff}{m}{n}{<-> strokeff}{}

  • Expansion of ~ in \index entries
    by richard on December 11, 2025 at 1:36 pm

    I have defined a command called \defn which formats its argument in bold and creates an index entry for it. I use it when defining a term in the text of the document. Here's a MWE showing a simplified version of it: \documentclass{book} \makeindex \newcommand\defn[1]{\textbf{#1}\index{#1}} \begin{document} I can write \defn{Q~set} instead of \textbf{Q~set}\index{Q~set}. \end{document} The problem arises in examples like the one above where I have a ~ in the index entry. (My publisher's house style is not to hyphenate this particular term and use a non-breaking space: it's not my choice.) My document, like the MWE above, has a mixture of instances of \defn and direct uses of \index where I don't want the bold formatting. However, they come out differently in the .idx file, meaning I get two identical looking index entries instead of one. This is what the MWE's .idx file looks like: \indexentry{Q\nobreakspace {}set}{1} \indexentry{Q~set}{1} I still want to be able to use \index directly as well as my \defn command. How do I fix the command or otherwise fix the code so that the two commands produce the same index entry? I've also tried changing the definition of \defn to use the TeX's \def built-in, in case this was a weirdness of how \newcommand works, but to no effect. I'm using XeLaTeX, but I've tested it in LaTeX which does the same.

  • odd left side space in tikz path`\draw`? [duplicate]
    by Explorer on December 11, 2025 at 11:55 am

    It's not very easy to describe the case in the title, I could only show the example: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}% % \draw[blue] (0.0,.5cm) -- +(1,0);% \node[anchor=south west,inner sep=0pt,outer sep=0pt,fill=red,text=white] at (0,0){test test};% \end{tikzpicture}% \end{document} However, if the extra line is \drawed: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}% \draw[blue] (0.0,.5cm) -- +(1,0);% \node[anchor=south west,inner sep=0pt,outer sep=0pt,fill=red,text=white] at (0,0){test test};% \end{tikzpicture}% \end{document} It gives: Noted the left blank area, appeared from the \draw[blue] (0.0,.5cm) -- +(1,0); . That looks like that \draw would extend the bounding box. Learning from here: Adding overlay is okay, but it would make the bounding box smaller, and is not elegant to eliminate the left blank area. My Question is as below: Is that elegant method to make \draw not extend bounding box around? How is this behavior documented? Is this the expected behavior that TikZ regards?

  • Read and plot dates from .csv using pgfplots
    by Daniel Minutillo on December 11, 2025 at 11:48 am

    I have been trying for hours (with the help of ChatGPT) to read and plot a basic data series from a .csv using pgf plots. My csv file looks like this: Date,Total 1978-02,61.24904688 1978-03,60.9695051 1978-04,61.16856681 1978-05,61.08504061 1978-06,61.08034637 1978-07,60.92327154 The best I've managed so far is as follows: \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ title={\textbf{Participation Rates}}, height=9cm, width=12cm, ylabel={Percent}, ymin=40, ymax=80, xmin=0, xmax=664, xtick={23, 143,263,383,503, 623}, xticklabels={1980,1990,2000,2010,2020}, tick align=inside, axis lines=box ] \addplot+[no marks, very thick, color=yellow] table[x expr=\coordindex, y=Total, col sep=comma]{participation.csv}; \end{axis} \end{tikzpicture} \end{document} This is not ideal because I have to hardcode the intervals in the axis tickmarks, making it too inflexible to update with new / alternative data. I've tried to include a plot like: table[x=Date, y=Total, col sep=comma]{participationALT.csv}; But I get an error message: ! Package PGF Math Error: Could not parse input '1978-02' as a floating point number, sorry. The unreadable part was near '-02'.. I've tried messing around with different date formats in my .csv but nothing is working for me so far. Please help!

  • Count words/characters and print the result on the latex page
    by Jack on December 11, 2025 at 10:23 am

    I'd like some way of counting characters and words in a LaTeX document that then places these values into the text. Posts like Counting characters in a section of a document can count lots of things, but they go to an external file. I'm looking for something like this: \begin{wordcount} Blue is a primary color. \end{wordcount} Returns: Blue is a primary color. Word count: 5 Or for character counting: \begin{charactercount} Blue is a primary color. \end{charactercount} Returns: Blue is a primary color. Character count: 24 My use case is for writing job/PhD applications with a fixed word count, so I don't need the function to be able to handle equations or figures or anything like that; just raw verbatim text. I'd just like some way of writing my document in LaTeX in a nice way that lets me easily see the word count, before I copy and paste the text over into the application portal. Note, I use VS Code to edit my LaTeX as opposed to Overleaf, but solutions that use Overleaf specifically are probably still useful to the world.

  • What does Latex really do if PDF/A, PDF/UA, PDF/X is declared in \DocumentMetadata?
    by user2609605 on December 11, 2025 at 7:59 am

    Form other communication, I know that for PDF/X at time of this writing, declaring the standard only writes the according claim into xmp data. But what about the other standards? For example tagging? does declaring PDF/UA include tagging? or shall I declare separately? Are there any further entries written into XMP data apart from claiming a standard?

  • When is CreationDate of a PDF in the info directory and when in the xmp data?
    by user2609605 on December 11, 2025 at 7:32 am

    I offer a way to check whether I can reproduce certain old documents. To than end, I store as is and when recompiling I use the old timestamp. To find out I use pdfinfo. The problem is, that sometimes CreationDate is in the info directory, sometimes in xmp data so I need pdfinfo -meta. I read somewhere that from PDF 2.0 on it must be in xmp data, but I found counterexamples. Is before 2.0 the creation date in the info dictionary?? In XMP data it seems to be in <xmp:CreateDate>. Is the CreateDate always in the xmp data if the xmp data is switched on, i.e. if DocumentMetadata{...} is used withouth xmp=false?

  • How to globally turn OFF a macro from the preamble?
    by Cham on December 11, 2025 at 5:08 am

    Consider the epigraph macro in the following MWE: \documentclass[11pt,twoside]{report} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt]{geometry} \usepackage{epigraph} \renewcommand{\textflush}{flushleft} \setlength{\epigraphrule}{0pt} \newcommand{\epig}[2]{\epigraphhead[1in]{\epigraph{\itshape\centering{#1}}{\itshape{#2}}}} \renewcommand{\epigraphflush}{center} \setlength{\epigraphwidth}{\textwidth} \begin{document} \chapter{Some title} \epig{ An epigraph. } Some text \end{document} My main text have many chapters, each one with an epigraph from that epig macro. For testings and various other reasons, I need to compile with and without the epigraphs. I can turn them off by adding % in the code, but it's tedious to do and to remove. So is there a way to turn the macro off by adding a simple piece of code to the macro definition, while leaving all the \epig{...} in the whole code (without having to add/remove %), and without getting compilation issues (warnings and errors)?

  • Conspicuous deficiency of the longdivision package
    by Michael Hardy on December 11, 2025 at 3:11 am

    This manual seems to say that this package does the arithmetic for you and only gives results that are correct and complete. I don't know how anyone who teaches mathematics fails to see what's wrong with that before they notice anything else. What if you want to write something like this: \begin{array}{rccccccccccccc} \bullet\bullet & ) & \bullet & \bullet & . & 0 & 0 & 0 & 0 \\ & & \bullet & \bullet \\ {} \\ & & & 3 & 0 \end{array} etc., and fill in some, but far from all, of the digits that follow, and then ask a question of students on an exam? You are concealing some of the digits from them and expecting them to answer the question with only the partial information given. Everybody does that every day, except those who don't teach things like this. Or what if you want to insert a digit that's wrong, and either ask examinees to identify the error or ask them why it's wrong? Apparently you can't do that with this package. How is it to be done?

  • Apply specific font and stroke to title text
    by Will Kim on December 11, 2025 at 2:05 am

    ar LaTeX users, I am trying to apply the font Alfa Slab One to the title text on my cover page and add a black stroke to it. Could you please help me with this?Thank you \documentclass[12pt]{book} \usepackage[margin=0.5in]{geometry} % % Packages \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsfonts} % math symbols \usepackage{geometry} \usepackage{graphicx} % figures \usepackage{tikz} % drawings \usepackage{hyperref} % clickable links \usepackage{fancyhdr} % headers/footers \usepackage{titlesec} % formatting chapter titles % Page layout % \usepackage{pgfplots} \usepackage{mathtools} \usepackage{cancel} \usepackage{pgfplots} \usepackage{array} \usepackage{amsmath} \newtheorem{theorem}{THEOREM} \newtheorem{proof}{PROOF} \usepackage{tikz} \usepackage{amssymb} \usetikzlibrary{patterns} \usepackage{bigints} \usepackage{color} \usepackage{tcolorbox} \usepackage{cancel} \usepackage{soul} \usepackage{multirow} \usepackage{booktabs} \usepackage{dcolumn} \usepackage{graphicx} % Required for \includegraphics \usepackage{contour} %\usepackage{alfaslabone} \usepgfplotslibrary{fillbetween} %\usepackage{background} %\usepackage{fullpage, lipsum, tikz} %\usepackage{eso-pic} \usepackage{alfaslabone} } \begin{document} % % % Title \begin{titlepage} \centering \vspace*{3cm} {\Huge\bf \color{black} TITLE}\\[1cm] {\Huge\bfseries\color{black} TITLE2}\\[1cm] {\Large\it\color{black} AUTHOR}\\[1cm] \vfill % % %{\Large ME}\\ %{\Large \today} \end{titlepage} \end{document}

  • which combinations of standards PDF/A, X, UA are valid
    by user2609605 on December 10, 2025 at 11:24 pm

    This question comes from the fact, that norms are quite expensive, except PDF/UA-1/2 normed as ISO 14289-1/2 which i read. Extrapolating a bit, what I read in Section 5 and 6 to the other norms, it seems as if the entries in xmp data setting up the claim, i.e. for example that it is UA-2 or A-2b is a prerequisite for satisfying UA-2 or A-2b or whatsoever, although not a sufficient condition of course. But this means that at most one of the PDA/A norms can be satisfied. Likewise for PDF/X and for PDF/UA. But on the other hand, a single document may well be conform to one two or all three norms out of the families PDF/A,X,UA. Is this correct? I tried to specify two norms out of one family in \DocumentMetadata, e.g. \DocumentMetadata{pdfstandard=a-2a,pdfstandard=a-2b} then seemingly the later overwrites the former. Is this correct?

  • Difference between \begin{align*}...\end{align*} and \align* ...\endalign*
    by user2026844 on December 10, 2025 at 10:46 pm

    I thought that \begin{env}...\end{env} is essentially equivalent to \env ...\endenv. However, in the case of align*, the first example below compiles without issue, while the second gives a runaway argument. (It does work with equation* though...) Why? \documentclass{article} \usepackage{amsmath} \begin{document} % no issue %\begin{align*} %x & = 1 \\ %y & = 2 \\ %\end{align*} % runaway arg \csname align*\endcsname x & = 1 \\ y & = 2 \\ \csname endalign*\endcsname \end{document}

  • Compatibility issues between ibrackets and \underset/\overset/\substack
    by Sebastiano on December 10, 2025 at 10:22 pm

    The ibrackets package doesn't seem to work when I use \underset or \overset. \[ ]-\infty\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} a] \text { oppure } [a\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} \!+\infty[ \] I would like your opinion on how to adjust the spacing in this case as well, when I have a long text that should remain in normal style. \[ -\infty<\underset{\substack{\uparrow \\ punto \\di \\massimo}}{\frac{\pi}{2n}}<a \] I would prefer not to write the \text command three times. Here a MWE \documentclass[12pt,a4paper]{article} \usepackage{amsmath,amssymb,ibrackets} \begin{document} \[ ]-\infty\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} a] \text { oppure } [a\underset{\substack{\uparrow \\ \frac{\pi}{2n}}}{,} \!+\infty[ \] Ora in $x\in]-\infty,a]$, la funzione $f_n(x)$ è crescente ($k=0$) in $]-\pi/2n,\pi/2n[$, decrescente altrove, se \[ -\infty<\underset{\substack{\uparrow \\ punto \\di \\massimo}}{\frac{\pi}{2n}}<a \] allora \[ \sup_{\substack{]-\infty,a]\\ \frac {\pi}{2n}<a}} f_n(x)=f_n(c_n)=1/n^2 \] e qui si ha uniforme convergenza \end{document}

  • why tex4ht gives this invalid math conversion only in the table of content and not in the actual chapter header?
    by Nasser on December 10, 2025 at 10:06 pm

    Using TL 2025, this mwe \documentclass[12pt]{book} \usepackage{amsmath} \begin{document} \ifdefined\HCode \Configure{tableofcontents*}{chapter} \else \tableofcontents \fi \chapter{reflections $\prod_{v} I - v v^T$} text \end{document} Compiled with lualatex gives expected output for the toc But compiled using make4ht -ulm default -a debug A.tex 'mathjax,htm' Gives The problem only shows in the TOC, not in the actual chapter header. The HTML generated is <!DOCTYPE html> <html lang='en-US' xml:lang='en-US'> <head><title></title> <meta charset='utf-8' /> <meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> <meta content='width=device-width,initial-scale=1' name='viewport' /> <link href='A.css' rel='stylesheet' type='text/css' /> <meta content='A.tex' name='src' /> <script>window.MathJax = { tex: { tags: "ams", }, }; </script> <script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script> </head><body> <!-- l. 12 --><p class='indent'> </p> <div class='tableofcontents'> <span class='chapterToc'>1 <a href='#reflections-v-i-v-vt' id='QQ2-1-1'>reflections <span class='mathjax-inline'>\(\DOTSB \prod@ \slimits@ _{v} I - v v^T\)</span></a></span> </div> <h2 class='chapterHead' id='reflections-v-i-v-vt'><span class='titlemark'>Chapter 1</span><br /><a id='x1-10001'></a>reflections <span class='mathjax-inline'>\(\prod _{v} I - v v^T\)</span></h2> <!-- l. 13 --><p class='noindent'>text </p> </body> </html> Is this a problem in tex4ht or mathjax? >which make4ht /usr/local/texlive/2025/bin/x86_64-linux/make4ht >make4ht --version make4ht version v0.4d >

  • How to wrap an image in enumerate environment
    by Chathura on December 10, 2025 at 4:58 pm

    \documentclass[11pt,a4paper]{article} % Use XeLaTeX to compile % Go to Menu > Compiler and set it to XeLaTeX \usepackage{wrapfig} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{siunitx} \usepackage{comment} \usepackage{tikz} \usepackage[export]{adjustbox} \usepackage{ragged2e} \usepackage{blindtext} \usepackage{multicol} \setlength{\columnsep}{0.2cm} \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} %Paper margin>> \usepackage{geometry} \geometry{a4paper, hmargin={1.6cm,1.6cm}, top=1.6cm, bottom=1.7cm } %Paper margin<< %Border Of the document>> \usepackage{background} \usetikzlibrary{calc} \SetBgScale{1} \SetBgAngle{0} \SetBgColor{black} \SetBgContents{ \begin{tikzpicture}[overlay,remember picture] \draw [line width=1pt,rounded corners=10pt,] ($ (current page.north west) + (1.5cm,-1.5cm) $) rectangle ($ (current page.south east) + (-1.5cm,1.5cm) $); \end{tikzpicture}} %Border Of the document<< \begin{document} \begin{multicols*}{2} \begin{enumerate} \item \includegraphics[]{sample_image1} Newton's laws of motion are three fundamental principles that describe the relationship between the motion of an object and the forces acting upon it: \begin{enumerate} \item \includegraphics[]{sample_image2}First Law (Law of Inertia): An object at rest stays at rest, and an object in motion continues in motion with the same speed and in the same direction unless acted upon by a net external force. \item Second Law (F=ma): The acceleration of an object is directly proportional to the net force acting on it and inversely proportional to its mass. This is expressed by the formula F = m*a. \item Third Law (Action and Reaction): For every action, there is an equal and opposite reaction. This means that forces always occur in pairs. \item These laws form the foundation of classical mechanics and are essential for understanding how objects move and interact in our physical world. \end{enumerate} \item \includegraphics[]{sample_image3} Newton's laws of motion are three fundamental principles that describe the relationship between the motion of an object and the forces acting upon it: \begin{enumerate} \item First Law (Law of Inertia): An object at rest stays at rest, and an object in motion continues in motion with the same speed and in the same direction unless acted upon by a net external force. \item Second Law (F=ma): The acceleration of an object is directly proportional to the net force acting on it and inversely proportional to its mass. This is expressed by the formula F = m*a. \item Third Law (Action and Reaction): For every action, there is an equal and opposite reaction. This means that forces always occur in pairs. \item These laws form the foundation of classical mechanics and are essential for understanding how objects move and interact in our physical world. \end{enumerate} \end{enumerate} \end{multicols*} \end{document}

  • pin to some point on an arrow
    by Zarko on December 10, 2025 at 1:52 pm

    Please consider the following MWE: \documentclass[tikz,border=3mm]{standalone} %---------------------------------------------------------------% \begin{document} %---------------------------------------------------------------% \begin{tikzpicture}[every pin edge/.style={<-, red}] \draw[->] (0, 1) -- (3,1); \draw[->] (0,0) -- (3,0) coordinate [pos=0.25, pin=210:X] (aux); \end{tikzpicture} %---------------------------------------------------------------% \end{document} Why the arrow head at the second line is moved to the point of pin position?

  • Horizontal stroke character "-" overlaps [closed]
    by Grzegorz Brzczyszczykiewicz on December 10, 2025 at 12:40 pm

    I defined a custom character: % strokeff.mf mode_setup; xoo#:=10pt#; yoo#:=10pt#; thick#:=5pt#; define_pixels(xoo, yoo, thick); beginchar(0, 7*xoo#, 7*yoo#, 0); %H pickup pencircle scaled thick; draw (0*xoo#, 3*yoo#)--(6*xoo#, 3*yoo#); endchar; end but when I wanted to type a sequence of three characters: \strokeff{\char0\char0\char0}, the result is this: and it looks really bad, the three lines should have a tiny space in between, but they don't. Here is what it looks like in text: And the underlying code: \documentclass{article} % Load fontenc for arbitrary font families \usepackage{fontenc} % Define a command that switches to the U/strokeff font family \newcommand{\strokeff}[1]{{\fontencoding{U}\fontfamily{strokeff}\selectfont #1}} \begin{document} \section*{StrokeFF Font Test} This is normal text. Here is a test using the \texttt{strokeff.mf} font: \bigskip \strokeff{0 1 2 3 4 5 6 7 8 9} \bigskip You can also include it inline, like \strokeff{\char0\char0\char0}, or at a larger size: {\Large \strokeff{\char0}} \end{document} The bounding box is a bit too small. Here are all the files I have in my folder https://drive.google.com/drive/folders/1lft8-6AbQIkV8psQN5ixUSZAwnei5dgN?usp=sharing and my characters' size should change but instead: only the spacing and the pen thickness changes. This is bad.

  • Gradients in TikZ
    by karlh on December 10, 2025 at 3:53 am

    Based on the documentation, I would expect the two rectangles generated by this code to look identical: \documentclass{article} \usepackage{tikz} \begin{document} \pgfdeclarehorizontalshading{myshadingA} {1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)} \begin{tikzpicture} \pgfuseshading{myshadingA} \shade [shading=myshadingA] (-2,-1) rectangle (2,-3); \end{tikzpicture} \end{document} However, this is clearly not the case. What am I doing wrong and/or misinterpreting in the documentation?

  • How many expl3 code lines are in the LaTeX kernel?
    by TeXtnik on December 9, 2025 at 11:27 pm

    I was courious to know how many line of expl3 code is in the LaTeX kernel. I run a python script (code below) to count the number of lines in each dtx file in the base directory of the LaTeX2e repository. The result I got is taht around 17% of the code is written in expl3. The breaking of this number for each file is below. I guess there are some improvements to be done: Don't count documentation lines. Include files in other directories (requires, tools ...) Use the striped tex files instead the dtx files? Some other? Can someone improve this estimate? (Apologize the use of python for these; I am force today to use a Windows machine, and I can't use some awk and shell tools to this work easier. I did it in a dirty way 🙁 ) total_lines expl3lines % alltt.dtx 224 0 0 classes.dtx 4505 0 0 doc.dtx 6293 517 8.2 docstrip.dtx 4603 0 0 exscale.dtx 202 0 0 fix-cm.dtx 829 0 0 fontdef.dtx 1623 0 0 graphpap.dtx 195 0 0 ifthen.dtx 558 0 0 inputenc.dtx 3053 0 0 latex209.dtx 1152 4 0.3 latexrelease.dtx 1355 237 17.5 latexsym.dtx 203 0 0 letter.dtx 1950 0 0 ltalloc.dtx 176 0 0 ltbibl.dtx 481 0 0 ltboxes.dtx 1622 0 0 ltclass.dtx 4171 2 0 ltcmd.dtx 5867 5753 98.1 ltcmdhooks.dtx 1865 1672 89.7 ltcntrl.dtx 326 0 0 ltcounts.dtx 881 0 0 ltdefns.dtx 2837 0 0 ltdirchk.dtx 1031 0 0 lterror.dtx 915 0 0 ltexpl.dtx 602 81 13.5 ltfilehook.dtx 1840 408 22.2 ltfiles.dtx 1842 20 1.1 ltfinal.dtx 1554 143 9.2 ltfloat.dtx 1690 0 0 ltfntcmd.dtx 806 0 0 ltfssaxes.dtx 4544 0 0 ltfssbas.dtx 2550 5 0.2 ltfsscmp.dtx 378 0 0 ltfssdcl.dtx 2234 131 5.9 ltfssini.dtx 2459 0 0 ltfsstrc.dtx 2053 25 1.2 lthooks.dtx 8160 5775 70.8 lthyphen.dtx 143 0 0 ltidxglo.dtx 218 0 0 ltkeys.dtx 740 573 77.4 ltlength.dtx 184 0 0 ltlists.dtx 1227 0 0 ltlogos.dtx 124 0 0 ltluatex.dtx 2201 0 0 ltmarks.dtx 2406 1519 63.1 ltmath.dtx 1483 0 0 ltmeta.dtx 251 81 32.3 ltmiscen.dtx 1899 0 0 ltoutenc.dtx 3861 0 0 ltoutput.dtx 6682 0 0 ltpage.dtx 438 41 9.4 ltpageno.dtx 101 0 0 ltpar.dtx 189 0 0 ltpara.dtx 1353 670 49.5 ltpictur.dtx 2046 0 0 ltplain.dtx 1745 0 0 ltproperties.dtx 1018 531 52.2 ltsect.dtx 1101 0 0 ltshipout.dtx 2270 1305 57.5 ltsockets.dtx 1218 459 37.7 ltspace.dtx 1500 0 0 lttab.dtx 1675 0 0 lttagging.dtx 1661 954 57.4 lttemplates.dtx 2830 2066 73 lttextcomp.dtx 2778 0 0 ltthm.dtx 319 0 0 ltvers.dtx 448 0 0 ltxdoc.dtx 728 0 0 ltxref.dtx 668 0 0 makeindx.dtx 313 0 0 newlfont.dtx 204 0 0 nfssfont.dtx 499 0 0 oldlfont.dtx 252 0 0 preload.dtx 269 0 0 proc.dtx 449 0 0 slides.dtx 2740 0 0 syntonly.dtx 282 0 0 utf8ienc.dtx 2327 0 0 Total 130469 22972 17.6 We can see that new features like ltcmd or the hook mechanism (ltchooks.dtx) are close to pure expl3. Despite the great work of the LaTeX project tema (small bang is getting bigger with the tagging), most parts of the kernel are not use expl3 at this moemnt. Are we going to see a 100% expl3 usage? Does this question make any sense? 😀 The code: import re import glob import pandas as pd def count_lines(filename): num_lines = sum(1 for _ in open(filename, encoding="utf8")) return num_lines starttag = "ExplSyntaxOn" endtag = "ExplSyntaxOff" pattern = rf"{starttag}(.*?){endtag}" # make pattern def count_expl3(filename): # get input with open(filename, "r", encoding="utf8") as fp: data = fp.read() # read in all the data to a string results = re.findall(pattern, data, flags=re.DOTALL) # DOTALL finds over multiple lines # print out results (you could write it to a file instead) find_lines = [] for res in results: for item in res.strip().split("\n"): find_lines.append(item) return len(find_lines) line_data = {} for latexfile in glob.glob("*.dtx"): total_lines = count_lines(latexfile) expl3_lines = count_expl3(latexfile) line_data[latexfile] = {"total_lines": total_lines, "expl3lines": expl3_lines} df = pd.DataFrame(line_data) df = df.head().transpose() df.loc['Total'] = df.sum(numeric_only=True) df['%'] = ((df["expl3lines"] / df["total_lines"]) * 100).round(1) print(df.to_markdown())

  • How to layout the two-side notes using Latex
    by xuehao on December 8, 2025 at 4:49 am

    The following is an example from an English book. I'm planning to rewrite it in latex. The layout is with an itemize of points in the middle, and with "CONNECTIONS" notes along the two sides. I tried to solve it using TikZ, but the vertical align is hard to control. \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \node[draw,text width=3.1cm] at (0cm,0) {CONNECTIONS Because \\ \vspace{\baselineskip} It \\ and \\ Though \\ Since ... not \\ only \\ but also \vspace{\baselineskip} }; \node[draw,text width=6.3cm] at (5.1cm,0) {\begin{center} POINTS \end{center} 1. Brazil needs to be developed. \\ 2. New city, Brasilia, built 600 miles, Rio. \\ 3. Designed Lucio Costa. \\ 4. Became capital 1960. \\ 5. Planned for modern living. \\ 6. People at first reluctant to go. \\ 7. 1960 - population increasing. \\ 8. Established as capital. }; \node[draw,text width=3.1cm] at (10.2cm,0) {CONNECTIONS \vspace{\baselineskip} which was built \\ and which \\ \vspace{\baselineskip} It \\ but \\ However, with the increase }; \end{tikzpicture} \end{center} \end{document} Anyone could give me any clever solution for this task?

  • Drawing a sphere and ellipsoid together
    by Knudsen on December 8, 2025 at 4:00 am

    I would like to draw a sphere, of radius 3, and an ellipsoid of semi-axis 2, 3 and 4 together. They intersect at two great circles on the sphere (marked in red). I started out with the sphere and the great circles: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools \begin{document} \begin{tikzpicture}[3d/install view={phi=120,theta=70},line cap=butt, line join=round,declare function={R=3;},c/.style={circle,fill,inner sep=1pt}] \path (0,0,0) coordinate (O) ; \draw[blue,3d/screen coords] (O) circle[radius=R]; \shade[ball color=white,3d/screen coords,opacity=0.7] (O) circle[radius=R]; % \shade[ball color=blue!30,3d/screen coords,opacity=0.7,xscale=2,yscale=3,zscale=4] (O) circle[radius=1]; \path pic[blue]{3d/circle on sphere={R=R,C={(O)}}}; \path pic[red]{3d/circle on sphere={R=R, n={(0.592,0,-1)}}}; % plane x = sqrt{7/10) z \path pic[red]{3d/circle on sphere={R=R, n={(0.592,0,1)}}}; % plane x = sqrt{7/10) z \draw[3d/hidden] (0,0,0) -- (0,0,R) (O)--(R,0,0) (O)--(0,R,0) (O)--(0,-R,0); \draw[3d/visible, -stealth] (R,0,0) -- (R + 4,0,0) node[below]{$x$}; \draw[3d/visible, -stealth] (0,R,0) -- (0,R + 1,0) node[right]{$y$}; \draw[3d/visible, -stealth] (0,0,R) -- (0,0,R + 1.5) node[above]{$z$}; \end{tikzpicture} \end{document} and everything is right so far: but when I remove the comment on the line that I would expect to draw the ellipsoid \shade[ball color=blue!30,3d/screen coords,opacity=0.7,xscale=2,yscale=3,zscale=4] (O) circle[radius=1]; I get something that is far from what I expected, including the fact that the zscale is not understood. How can one add the intersecting elipsoide to this image?