Hot
- how to trim inside TikZ?by user516076 on March 12, 2026 at 1:13 am
MWE: \documentclass[tikz,border=1pt]{standalone} \usepackage{tikz} \usepackage{calligra} \usepackage[T1]{fontenc} \begin{document} \begin{tikzpicture}[line width=1pt] % \path[use as bounding box] (1,0) rectangle (12,7); % Outer rectangle \draw (0,0) rectangle (12,7); % Curvy E outside the box \node[anchor=center, font=\calligra\fontsize{38}{38}\selectfont] at (-1.5,6.75) {E}; % Left circle \draw (4.0,3.4) circle (2.75); % Right circle \draw (8.25,3.45) circle (2.2); % Labels \node[font=\fontsize{28}{28}\selectfont] at (1.8,5.8) {$P$}; \node[font=\fontsize{28}{28}\selectfont] at (9.4,5.9) {$Q$}; \end{tikzpicture} \end{document} This gives me this picture: There, you see a white space on the left that needs to be trimmed. My best knowledge is using: \path[use as bounding box] (1,0) rectangle (12,7); but it gives me: I want to control it like 1pt or 2pt or 1cm, 2cm to mean that I trim that much. How to do that? I tried to control (1,0), but it doesn't work as I expected. Also, if possible, I don't want to crop it outside, like using \includegraphs and trim it. It is saving time to trim it inside the TikZ, IMHO.
- How to count numbers inside [ ]?by user516076 on March 12, 2026 at 12:31 am
As a teacher, you might find this question relatable should you be bothered by making sure that the sum of marks is a certain number when you make an exam. Since I believe LaTeX has control flow, I think it would be great to have a feature to count how many marks I have made so far. So, in this particular document, if it is possible, could I have a mini program that would print a number of sum of the marks? If I exceed the number of max marks, it will give a warning that been printed out below the instruction. just like if else condition. To ilustrate it, Suppose my first problem gives [3] marks, second problem has [4] marks, third problem has [1] mark and the last problem has [6] marks. I want a command to print the sum of them in a sentence like this: The total mark for this paper is \mark. Is this doable? How to? I'll just provide this MWE and let you geniuses take care of it please. T.I.A. \documentclass[12pt]{article} \usepackage[a4paper,margin=1in]{geometry} \usepackage{enumitem} \usepackage{amsmath} \begin{document} %======================== % First page %======================== \begin{center} {\Large \textbf{Sample Examination Paper}}\\[1em] {\large Mathematics}\\[2em] \end{center} \noindent \textbf{Candidate Name:} \rule{10cm}{0.4pt} \vspace{2em} \noindent \textbf{Instructions} \begin{enumerate}[leftmargin=2em] \item Write your name clearly in the space provided above. \item Answer \textbf{all five questions}. \item Write your answers in the spaces provided in this question paper. \item If you need additional space, use lined paper and attach it securely to this paper. \item You may use an HB pencil for graphs and diagrams. \item You should show all necessary working clearly. \item The total mark for this paper is \textbf{19}. \end{enumerate} \vfill \begin{center} \textit{Turn over for the first question} \end{center} \newpage %======================== % Questions %======================== \noindent \textbf{1.} Solve the equation \[ 3x - 7 = 11. \] \begin{flushright} [3] \end{flushright} \vspace{5cm} \noindent \textbf{2.} Expand and simplify \[ (x+2)(x-5). \] \begin{flushright} [4] \end{flushright} \vspace{5cm} \noindent \textbf{3.} A triangle has base $8$ cm and height $5$ cm. Calculate its area. \begin{flushright} [1] \end{flushright} \vspace{5cm} \noindent \textbf{4.} Differentiate \[ y = 4x^3 - 2x + 6. \] \begin{flushright} [5] \end{flushright} \vspace{5cm} \noindent \textbf{5.} The first three terms of a sequence are \[ 2,\ 5,\ 8,\ \dots \] Find the 10th term of the sequence. \begin{flushright} [6] \end{flushright} \vspace{5cm} \end{document} As you can see there. It is still a manual writing "19". so there, perhaps how to create command such as \mark. so it would print 19 by itself, because the LaTeX does the maths automatically. And if it exceeds 19, then print WARNING: TOTAL MARKS EXCEED 19.
- Why do I get different results of \ifx comparing boxes and macros by having the same content?by MBE on March 11, 2026 at 11:43 pm
\setbox11=\vtop{\hsize=80pt X \hskip1pt eagle \hskip2pt X} \setbox12=\copy11 box 11 and 12 have the same content: \copy11 \copy12 \def\strZ{ \vtop{\hsize=80pt \unvcopy11}} \def\strX{\vtop{\hsize=80pt \unvcopy12}} \vskip\baselineskip strZ and strX have the same content: \strZ \strX \vskip\baselineskip yet, ifx strX strZ YES else NO fi give \hskip110pt\ifx\strX\strZ YES \else NO \fi \vskip\baselineskip \def\strA{\vtop{\hsize=80pt X \hskip1pt eagle \hskip2pt X}} \def\strB{\vtop{\hsize=80pt X \hskip1pt eagle \hskip2pt X}} but strA and strB, both defined with the \vskip\baselineskip same content give \hskip90pt\strA \strB \vskip\baselineskip \hskip280pt\ifx\strA\strB YES \else NO \fi \bye
- How do you install getnonfreefonts onto Texlive 2022 (Win 7 Pro 32bit) and all non free fonts?by Barnabas on March 11, 2026 at 9:28 pm
Recently, I installed Texlive 2022 on my system. Follow the instructions to me by Google and then got : 'getnonfreefonts-sys' is not recognized as an internal or external command, operable program or batch file. I thought the script installed okay. I'm missing something? See below, C:\texlive>texlua install-getnonfreefonts Detected System: win32 Detected Installation: C:/texlive/2022 Installing texmf-dist/scripts/getnonfreefonts/getnonfreefonts.pl ... [done] Installing texmf-dist/doc/man/man1/getnonfreefonts.1 ... [done] Installing texmf-dist/doc/man/man1/getnonfreefonts.man1.pdf ... [done] md5sum: fcc12b475cb7b1e11125e0deeadd2bca getnonfreefonts.pl ... [ok] md5sum: 7eedbc34762d571db90637c4c29c6d7a getnonfreefonts.1 ... [ok] md5sum: 0e4bbb9a732fb9e7b9e1d80e993ffb47 getnonfreefonts.man1.pdf ... [ok] You have binaries for Unix installed. Please run this script on Unix again in order to create the symlinks. mktexlsr: Updating C:/texlive/texmf-local/ls-R... mktexlsr: Updated C:/texlive/texmf-local/ls-R. mktexlsr: Done. C:\texlive>cd C:\texlive\2022\texmf-dist\scripts\getnonfreefonts C:\texlive\2022\texmf-dist\scripts\getnonfreefonts>getnonfreefonts-sys -a 'getnonfreefonts-sys' is not recognized as an internal or external command, operable program or batch file.
- Setting vertical spacing between sections of a nested list?by Gary on March 11, 2026 at 8:31 pm
In the image below, the vertical spacing between all list items within the same level and between changes in levels looks correct, except that between (2.) and a. How can I correct it, such that the start of the italic a,b,c level has the same vertical spacing as the rest? In the image, that is the space between (2.) Paren 2 and a. Italic a. It's confusing because the spacing between the b. Italic b and 1. Italic 1 is correct. I tried using the before=\blank[1ex] and it appears to make no change. Thank you. \defineitemgroup[ItemsParen] \setupitemgroup [ItemsParen] [each] [unpacked] [ left=(, right=), stopper=., distance=1em, indenting=no, align=yes, inbetween={\blank[halfline]}, ] \defineitemgroup[ItemsItalic] \setupitemgroup [ItemsItalic] [each] [unpacked] [ stopper=., distance=0em, indenting=no, align=yes, inbetween={\blank[halfline]}, style=\italic, ] \startTEXpage \startItemsParen[n] \startitem Paren 1 \stopitem \startitem Paren 2 \startItemsItalic[a] \startitem Italic a \stopitem \startitem Italic b \startItemsItalic[n] \startitem Italic 1 \stopitem \startitem Italic 2 \stopitem \stopItemsItalic % [n] \stopitem % Italic b \startitem Italic c \stopitem \stopItemsItalic % [a] \stopitem % Paran 2 \startitem Paren 3 \stopitem \stopItemsParen \stopTEXpage For a comparison without defining an item group(s), it can be seen that the spacing is the same throughout the lists. \startTEXpage \setupitemize[1][unpacked][left=(,right=),stopper=.,distance=1em] \setupitemize[2][unpacked][stopper=.,style={\it},] \setupitemize[3][unpacked][stopper=.,style={\it},] \startitemize[n] \startitem Paren 1 \stopitem \startitem Paren 2 %\stopitem \startitemize[a] \startitem Italic a \stopitem \startitem Italic b %\stopitem \startitemize[n] \startitem Italic a.1 \stopitem \startitem Italic b.2 \stopitem \stopitemize \stopitem % Italic b \startitem Item c \stopitem \stopitemize \stopitem % Paren 2 \startitem Paren 3 \stopitem \stopitemize \stopTEXpage After adding the above, I think it points to my error, which is thinking that a new define group name is needed for each level of a list. It appears that one definition subsequently setup for each level defines the entire list at all levels; and a new definition group name is a completely new list with all its levels. Thus, if the first example is changed to: \defineitemgroup[Items] \setupitemgroup [Items] [1] [unpacked] [ left=(, right=), stopper=., distance=1em, indenting=no, align=yes, inbetween={\blank[halfline]}, ] \setupitemgroup [Items] [2,3] [unpacked] [ stopper=., distance=0em, indenting=no, align=yes, inbetween={\blank[halfline]}, style=\italic, ] then the spacing is as expected. Thus, this might just be another stupid question of mine that should just be deleted. Thank you.
- Typesetting column headings so that they all end at the bottom of their row and other slight modificationsby user143462 on March 11, 2026 at 6:31 pm
I am close to having the table that I want. There are five desired modifications. I would like to have "Species" and "host" at the bottom of the row containing the column headings. Here are the remaining modifications. I would like a double bar, "||", in bold along the left and right edges of the table. I only have it along the last three rows of the left edge - and not in bold. The vertical line separating the first and second columns is not drawn in bold. The vertical line separating the second and third columns and the vertical line separating the third and fourth columns is only drawn through the first row. Lastly, the numbers in the third and fourth columns should be centered. \documentclass[10pt]{amsart} \usepackage[utf8]{inputenc} \usepackage{soul} \usepackage{ragged2e} \usepackage{mathtools,array} \usepackage{adjustbox} \usepackage{makecell} \begin{document} \begin{tabular}{|| c | c p{2cm} p{3cm}| c p{3cm} ||} \hline \multicolumn{1}{| p{2cm} |}{\centering \textbf{Plant} \\ \textbf{Species}} &\multicolumn{1}{| p{2.5cm} |}{\centering \textbf{Mycorrhizal} \\ \textbf{host}} & \multicolumn{1}{| p {4.5cm} |}{\centering \textbf{Average Mass (in grams)} \\ \textbf{of plants grown in soil} \\ \textbf{containing} \\ \textbf{Mycorrhizal fungi}} & \multicolumn{1}{| p {4.5cm} |}{\centering \textbf{Average Mass (in grams)} \\ \textbf{of plants grown in soil} \\ \textbf{treated to kill} \\ \textbf{Mycorrhizal fungi}} \\ % Use multicolumn and centering for the header \hline Corn&Yes&15.1&3.8 \\ \hline Marigold&Yes&10.2&2.4 \\ \hline Broccoli&No&7.5&7 \\ \hline \end{tabular} \end{document}
- unicode-math font selection conflict with luatexja-fontspec only with ltx-talk?by Explorer on March 11, 2026 at 4:40 pm
The question arised from my answer here.Noted that has not yet mentioned explictly in the manual, ltx-talk use built-in math font support via lua-unicode-math as Joseph commented here. Let's consider the following cases: Original MWE: with ltx-talk(fontspec+lua-unicode-math)+luatexja-fontspec: \DocumentMetadata{} \documentclass{ltx-talk} % \usepackage{fontspec,lua-unicode-math} \setmathfont{STIX Two Math} \usepackage{luatexja-fontspec} \setmainjfont{FandolSong} \begin{document} 你好你好你好 $\nabla_{\mathcal{M}} f(x) + \int x^2 \mathrm{d}x+ \ell^1$. \end{document} Equivalent Case: The caseA is equivalent to use lua-unicode-math directly: \documentclass{article} \usepackage{fontspec,lua-unicode-math} \setmathfont{STIX Two Math} \usepackage{luatexja-fontspec} \setmainjfont{FandolSong} \begin{document} 你好你好你好 $\nabla_{\mathcal{M}} f(x) + \int x^2 \mathrm{d}x+ \ell^1$. \end{document} both gives: with the complaint: Missing character: There is no ∇ (U+2207) in font name:FandolSong:mode=node;s cript=hani;language=dflt;-kern;jfm=ujis! Missing character: There is no ℓ (U+2113) in font name:FandolSong:mode=node;s cript=hani;language=dflt;-kern;jfm=ujis! ... Missing character: There is no ? (U+2207) in font name:FandolSong:mode=node;sc Missing character: There is no ? (U+2207) in font name:FandolSong:mode=node;script=hani;language=dflt;-kern;jfm=ujis! Missing character: There is no ? (U+2113) in font name:FandolSong:mode=node;sc Missing character: There is no ? (U+2113) in font name:FandolSong:mode=node;script=hani;language=dflt;-kern;jfm=ujis! I try to pass no-math to luatexja-fontspec as manual(page.11) shows: \documentclass{article} \usepackage{fontspec,lua-unicode-math} \setmathfont{STIX Two Math} \usepackage[no-math]{luatexja-fontspec} \setmainjfont{FandolSong} \begin{document} 你好你好你好 $\nabla_{\mathcal{M}} f(x) + \int x^2 \mathrm{d}x+ \ell^1$. \end{document} But it doesn't work: There are two workaround/compared cases below: Case: A workaound with ltx-talk + ctex with ctex instead of luatexja-fontspec as I used in my previous answer: \DocumentMetadata{} \documentclass{ltx-talk} % \usepackage{fontspec,lua-unicode-math} \setmathfont{STIX Two Math} \usepackage[fontset=fandol]{ctex} \begin{document} 你好你好你好 $\nabla_{\mathcal{M}} f(x) + \int x^2 \mathrm{d}x+ \ell^1$. \end{document} behaves good: Case: article+unicode-math+luatexja-fontspec compared with the "Equivalent Case" luatexja-fontspec works with unicode-math but not lua-unicode-math: \documentclass{article} \usepackage{unicode-math} \setmathfont{STIX Two Math} \usepackage{luatexja-fontspec} \setmainjfont{FandolSong} \begin{document} 你好你好你好 $\nabla_{\mathcal{M}} f(x) + \int x^2 \mathrm{d}x+ \ell^1$. \end{document} The comparsion shows that luatexja-fontspec, without any math configuration, compatible with unicode-math but not lua-unicode-math, which is loaded by ltx-talk. I wonder why cause that, and any solution?
- Change line spacing and indendation for section headingby Dieter on March 11, 2026 at 1:35 pm
This question is based on an older question from me. My actual MWE is based on the answer from @cabohah: \nopagebreak has no effect in \newcommand environment I would like to have hanging indentation and also increase the line spacing. Any help is highly appreciated. \documentclass{scrbook} \usepackage{scrlayer-scrpage} \usepackage{babel} \babeltags{dutch=dutch} \babeltags{dan=danish} \babeltags{swed=swedish} \babeltags{brit=british} \babeltags{fren=french} \babeltags{ital=italian} \babeltags{espan=spanish} \babeltags{port=portuguese} \babeltags{german=german} \usepackage[no-math]{fontspec} \usepackage[babel=true,nopatch=footnote,letterspace=150,]{microtype} \usepackage[colaction]{multicol} \usepackage{ragged2e} \usepackage{rotating} \usepackage{enumitem} \newlist{LanguageEntry}{itemize}{1} \setlist[LanguageEntry]{ noitemsep,% partopsep=0pt,% topsep=0pt,% parsep=0.3\baselineskip,% labelindent=2em,% labelwidth=2.8em,% align=parleft,% leftmargin=!,% } \DeclareNewSectionCommand[% style=section,% level=10,% beforeskip=4pt,% afterskip=0pt,% runin=true,% font=\normalfont\large,% tocindent=0pt,% tocnumwidth=0pt,% ]{dictionaryentry} \newcommand{\entry}[2]{\dictionaryentry{\RaggedRight\normalfont\Large #1}} \newcommand{\entrygeneric}[3][]{% \begin{LanguageEntry}[#1] \item[\textit{#2}]{\RaggedRight #3} \end{LanguageEntry} }% \newcommand{\entrynl}[3][]{\entrygeneric{Holl.} {\begin{dutch} #2 \end{dutch}}} \newcommand{\entryda}[3][]{\entrygeneric{Dän.} {\begin{dan} #2 \end{dan}}} \newcommand{\entrysw}[3][]{\entrygeneric{Schw.} {\begin{swed} #2 \end{swed}}} \newcommand{\entryen}[3][]{\entrygeneric{Engl.} {\begin{brit} #2 \end{brit}}} \newcommand{\entryfr}[3][]{\entrygeneric{Franz.} {\begin{fren} #2 \end{fren}}} \newcommand{\entryit}[3][]{\entrygeneric{Ital.} {\begin{ital} #2 \end{ital}}} \newcommand{\entryes}[3][]{\entrygeneric{Span.} {\begin{espan} #2 \end{espan}}} \newcommand{\entrypt}[3][]{\entrygeneric{Port.} {\begin{port} #2 \end{port}}} \begin{document} \begin{multicols}{2} % AAK \entry{AKK . Der Name eines Fahrzeugs, womit der Rheinwein nach Holland gebracht wird.} \entrynl{Aak.} \entryda{Et Fartöj paa Rhinſtrömmen.} \entrysw{Et Farto̊g ſom nyttias på Rhinſtrömen.} \entryen{A ſort of flat bottomed lighter employed on the Rhine.} \entryfr{Aque, Acque.} \entryit{Un battello con fondo piano, di cui ſi ſervono ſopra il Reno.} \entryes{Una barca con fondo llano. ſobre el Reno.} \entrypt{Eſpecie de barca chata ſobre o Rheno.} % AAP. (Hochdeutſch Affe.) \entry{AAP. (Hochdeutſch Affe.)} \entrynl{Aap.} \entryda{Aben.} \entrysw{Apan.} \entryen{The mizen ſtay-ſail.} \entryfr{Voile d’etay d’artimon, Foc de derriere.} \entryit{La carbonera, o ſia la vela di ſtraglio di Mezzana.} \entryes{Vela del humo, o vela del eſtay de meſana.} \entrypt{Rabeca, ou vela do eſtay da mezena.} % AAPENFALL \entry{AAPENFALL.} \entrynl[beginpenalty=100000]{Aapenval.} \entryda{Abe-Fald.} \entrysw{Apan-eller Aben-Fall.} \entryen{The haliard of the mizen-ſtay-ſail.} \entryfr{La driſſe de la voile d’etay d’artimon.} \entryit{La drizza della carbonera.} \entryes{La driza de la vela del humo.} \entrypt{A driça da rabeca.} % ABAB \entry{ABAB.} \entrynl[beginpenalty=100000]{Een turkſch Matroos.} \entryda{En tyrkiſk Matros.} \entrysw{En tyrkiſk Matros.} \entryen{A turkiſh ſailor.} \entryfr{Un matelot turc.} \entryit{Un marinaro turco.} \entryes{Un marinero turco.} \entrypt{Hum marinheiro turco.} % ABAKA \entry{ABAKA.} \entrynl[beginpenalty=100000]{Een gading hennip van de Manillas Eilanden.} \entryda{Et ſlags Hamp ſom voxer paa de manilleſke öer.} \entrysw{Et ſlags Hampa ſom växer på de manillſka öar.} \entryen{A kind of hemp brought from the Manillas Islands.} \entryfr{Une eſpece de chanvre, qu’on tire des Isles Philippines.} \entryit{Una ſpezie di canapa, che ſi trova nelle Manille.} \entryes{Una eſpecie de cañamo que ſe halla en las Manillas.} \entrypt{Huma eſpecie de canhamo que creſce nas Manilhas.} % ABANDONNEMENT \entry{ABANDONNEMENT.} \entrynl[beginpenalty=100000]{Het Abandoneeren van een Schip \&c. aan den Verzekeraar.} \entryda{En Afſtaaelſe og Overladelſe af Gods eller Skib til Aſſuradeuren.} \entrysw{Abandonera förſäkrade Skepp eller Gods til Aſſecuradeuren.} \entryen{The abandoning of a veſſel or goods to the inſurer for getting paid the inſured ſum.} \entryfr{Abandonnement.} \entryit{Abandonamento, ceſſione.} \entryes{Abandono.} \entrypt{Deixaçaõ, inteira ceſſaõ.} \end{multicols} \end{document}
- Drawing 3D arcs and shifting paths the easy way with asymptoteby designer0588 on March 11, 2026 at 1:18 pm
I have tried to reproduce a graph from Classical Mechanics using asymptote. My code is import three; import solids; size(7cm); currentprojection=orthographic(2,-3,1); draw(Label("$x$",position=1.05),O--10X); draw(Label("$y$",position=1.05),O--10Y); draw(Label("$z$",position=1.05),O--7Z); path3 pp = (1,5.75,0)..(3,8.75,0)..(6,7.75,0)..(9,6.75,0) ; draw(pp,dashed); draw(shift(.5*dir(1.75*X-3Y))*pp,dashed); draw(4X--(6,8,0)); draw(arc(4X,4X+2X,4X+2*dir((6,8,0)-4X))); revolution cyl = cylinder((6,8,2),2,.5,-X-3Y); draw(surface(cyl),lightgreen); label("$\theta$",rotate(40,4X,4X+Z)*shift(.05*Z)*(4X+2.3X)); path3 cc = circle((6,8,2), 2,normal=-X-3Y); draw(surface(cc),lightgreen,light=nolight); draw(shift(.5*dir(-X-3Y))*surface(cc),lightgreen,light=nolight); draw(rotate(0,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)--(6,8,0))); draw(rotate(-40,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)--(6,8,0))); draw(arc((6,8,2),rotate(0,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)-Z),rotate(-40,(6,8,2),(6,8,2)-X-3Y)*shift(.5*dir(-X-3Y))*((6,8,2)-Z))); label("$\phi$",rotate(-10,(6,8,2),(6,8,2)-X-3Y)*shift(.75*dir(-X-3Y))*((6,8,2)-1.2*Z)); and it generates the following My code has the following weaknesses: When I shift path pp I have to fiddle the X factor for dir(1.75*X-3Y) to make the shifted path look parallel to the original path. I have not been able to use arc(triple c, real r, real theta1, real phi1, real theta2, real phi2,triple normal=O); instead I use the version arc(triple c, triple v1, triple v2, triple normal=O,bool direction=CCW) which means I have to keep using transforms to get each arc to compute. Instead of attaching a Label to the draw function of each arc I use label to do this separately by guessing the correct coordinate for the label. There should be an easier way to do this for someone who knows how to properly use the arc function. I would be grateful if someone could show me a more efficient way of generating this graph.
- how to compile Chinese in ltx-talk by Luatex?the Chinese characters can not be shown in Slideby WPP on March 11, 2026 at 12:54 pm
how to compile Chinese in ltx-talk by Luatex? \DocumentMetadata{} \documentclass{ltx-talk} % --- FONT SETTINGS --- % No need to load fontspec or unicode-math; ltx-talk already did. \setmainfont{Times New Roman} % Use STIX Two Math to match the "Times" look for your equations \setmathfont{STIX Two Math} \usepackage{luatexja-fontspec} \setmainjfont{times new roman} \begin{document} \begin{frame}{Sparse Recovery} 李白李白李白李白李白李白 \begin{itemize} \item \textbf{Riemannian Gradient:} $\nabla_{\mathcal{M}} f(x)$. \item \textbf{Sparsity:} Utilizing the $\ell^1$ norm for signal recovery. \end{itemize} \end{frame} \end{document}
- How to label an equation when using $$ ... $$by John Doe on March 11, 2026 at 12:41 pm
I am carrying out some work that insists on using $$ ... $$ instead of \[ ... \] for maths (not my choice, I am forced into using it). Trouble is I also need to add a tag to an equation. Normally I would do this as \[ a = b \tag{1} \] But this does not work if I change it to $$ a = b \tag{1} $$ Want to ask how I can add tags with dollar signs? Every post I have looked at so far suggests using \[ ... \], which is just not allowed in this case (I do agree in general that \[ ... \] should be used though).
- indentation in gb4e examples in footnotesby Stefan Müller on March 11, 2026 at 10:02 am
The following code puts a numbered example in a footnote. One footnote is in an itemize environment, the other outside. The indentation should be the one that is seen outside the itemize environment. The problem is there with both langsci-gb4e and gb4e. \documentclass{scrartcl} \usepackage{langsci-gb4e} % \usepackage{gb4e} \begin{document} This is some text with a footnote.\footnote{ Text text text. \ea This is an example. \z Some further text. } \begin{itemize} \item This is some text with a footnote.\footnote{ Text text text. \ea This is an example. \z Some further text. } \end{itemize} \end{document}
- make4ht: mwe with align fails in texlive 2026by cmhughes on March 11, 2026 at 8:24 am
The following mwe does not compile using make4ht in texlive 2026 mwe \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} 1 & 2\\ 3 & 4 \end{align*} \end{document} call make4ht mwe question What configuration options do I need to adjust to make this compile?
- Need help writing this linear program! [closed]by Andrés Ingram on March 11, 2026 at 8:13 am
I need help writing the previous linear program on Overleaf, I'm struggling to align the constraints and the objective function as well. Claude and ChatGPT are not good help.
- How do I make all my tabular cells be vertically centered?by Draconis on March 11, 2026 at 4:08 am
I'm working on a document that contains quite a lot of tables. In many of these tables, some columns have normal text, while other columns have other things (e.g. inline images, math formulae, etc) that are taller than a normal line of text. With a normal tabular environment, the text ends up on the same baseline as the larger things, which doesn't look good. I would prefer it be vertically centered, so that the midline of the text lines up with the midline of the larger things. I've seen the tabularray package suggested, but it looks like that uses a very different syntax from a normal tabular, and I have many tables to update and a deadline in two days. I'm open to switching if there's a straightforward way to convert tabulars into tabularrays without changing anything about the default appearance or behavior, but otherwise, I'm worried about the dimensions changing. So: is there some way to change the behavior of a tabular (a certain table, a certain column, even a certain cell if necessary) so that text in cells is vertically centered, without changing anything else about its dimensions and layout? MWE: \documentclass[12pt,letterpaper]{book} \usepackage{booktabs} \begin{document} \begin{table}[h] \centering \begin{tabular}{ccc} \toprule Normal & Bigger & Normal \\ \midrule Lorem & {\Huge XYZ} & Ipsum \\ \midrule Dolor & {\Huge ABC} & Sit \\ \midrule Consec & {\Huge JKL} & Tetur \\ \bottomrule \end{tabular} \end{table} \end{document} I would like the midline of the smaller text to line up with the midline of the huge text, while keeping everything else about the table the same. I've seen many questions about vertically centering text in table columns, but none of the answers I've seen allow keeping the rest of the table the same (they tend to involve switching to a different environment with different behavior). I've seen that a single-cell multicolumn will center things vertically, but adding those to every single cell in many separate tables is going to be a nightmare, so I'd prefer something I can use once per table instead of once per cell if possible.
- Inline formula baseline issues of `a` with TeX Gyre Pagella Math?by Explorer on March 11, 2026 at 3:33 am
Here below is the example code: \documentclass{article} \usepackage{unicode-math} \setmathfont{TeX Gyre Pagella Math} \begin{document} Inline $(\frac{1}{b} , \frac{1}{a})$ \[ (\frac{1}{b} , \frac{1}{a})\] \end{document} Noted that the baseline of a is abnormal when inline, but normal in display. Is that a bug or feature of TeX Gyre Pagella Math? That is also quite confusing for me that why inline and display behave quite different, is not the same a glyph was used? Any hot-fix to change the baseline in inline math for a here? Any tricks(maybe luatex?) are all welcome!
- lfoot positioning with tikzpictureby Matteo on March 11, 2026 at 12:31 am
I was following a thread on how to add images to header/footer of a document class article. I found a pretty neat solution for the header which spans the entire paperwidth as I need to do. However, I upon trying and replicate the same for the footer I don't quite get the same result...; I attempted to change what I believe was relevant but I must have missed something. Below the code used MWE \documentclass[11pt]{article} \usepackage[inkscapearea=page]{svg} \usepackage{graphicx} \usepackage[letterpaper,margin=1in,headheight=14pt,footskip=59pt]{geometry} \usepackage[inline]{enumitem} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{titlesec} \usepackage{lastpage} \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{titling} \usepackage{xcolor,hyperref} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{tikzpagenodes} \titleformat{\section}[hang]{\large\bfseries\color{coolblack}}{\thesection\;|}{1em}{} \titleformat{\subsection}[hang]{\normalsize\bfseries}{\hspace{.15in}\thesubsection\;|}{1em}{} \hypersetup{ colorlinks, citecolor=electricultramarine, filecolor=., linkcolor=white, urlcolor=mediumtealblue, linktoc=all } \definecolor{coolblack}{rgb}{0.0, 0.18, 0.39} \definecolor{mediumtealblue}{rgb}{0.0, 0.33, 0.71} \definecolor{electricultramarine}{rgb}{0.25, 0.0, 1.0} \setenumerate[1]{label={\emph{\roman*)}}} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancypagestyle{firststyle} { \lhead{\begin{tikzpicture}[remember picture,overlay] \draw let \p1=($(current page.north)-(current page header area.south)$), \n1={veclen(\x1,\y1)} in node [inner sep=0.5,outer sep=0.5,below right] at (current page.north west){\includegraphics[width=.996\paperwidth,height=.75in]{example-image-a}}; \end{tikzpicture}} \fancyfoot[R]{\textbf{\textcolor{white}{\footnotesize Page \thepage\ of \pageref{LastPage}}}} \lfoot{\begin{tikzpicture}[remember picture] \draw let \p1=($(current page.north)-(current page footer area.south)$), \n1={veclen(\x1,\y1)} in node [inner sep=0,outer sep=0,below right] at (current page.south west){\includegraphics[width=.996\paperwidth,height=.75in]{example-image-b}}; \end{tikzpicture}} } \author{Name Surname} \title{project: activity summary} \date{\today} \begin{document} \maketitle \thispagestyle{firststyle} \section{Test} \end{document} Also, I'm unsure whether it is related but I get prompted a: Label(s) may have changed. Rerun to get cross-references right. What I would require is for the footer image to align to the bottom-left corner as the header aligns to the top-left one. See picture
- Biblatex/Biber does not use ngerman on page for an article despite being set in langid (it does use ngerman on number, though)by cryingshadow on March 10, 2026 at 5:34 pm
I encountered a strange behavior of biblatex/biber on an article. I have a document both containing German and English parts, hence I load babel with both ngerman and english as options. In my bibliography, I use the langid field to determine the language to be used for each entry. In most cases, this works fine, but the following MNWE yields a strange result: TeX-File: \documentclass{book} \usepackage[ngerman,english]{babel} \usepackage[T1]{fontenc} \usepackage[bibencoding=auto,backend=biber,autolang=other,giveninits=true,style=iso-authoryear,maxcitenames=3]{biblatex} \addbibresource{references.bib} \begin{document} \selectlanguage{ngerman} \fullcite{Held_2019} \end{document} Bib-File: @article{Held_2019, langid = {ngerman}, author = {Held, Andrea}, title = {Gut gelagert - Aktuelle Datenbanktechnologien}, subtitle = {ein Rundumschlag}, journal = {iX}, publisher = {heise}, number = {7/2019}, pages = {94}, year = {2019} } This yields (with pdflatex and biber): Note that it does print the number part (Nr.) correctly in German, but the page part (p.) in English. If I do not pass the english option to babel, everything works fine with this entry, but I cannot print English entries correctly. Somehow the English language is used only for the page part, but I have no clue why that happens or how I can fix it. Any ideas?
- luadraw in footerby PHL on March 10, 2026 at 12:01 pm
When trying to put a luadraw environment in a footer I obtain the following error Argument of \luacode@grab@lines has an extra }. Is there any workaround? If needed, I can consider using \AddToHookNext{shipout/background} (but this is not working either). This is really related to luadraw, as replacing the luadraw code by the TikZ code compiles without problems. %!TEX TS-program = lualatex \documentclass{article} \usepackage{luadraw} \usepackage{fancyhdr} \pagestyle{fancy} % This does not work %\cfoot{% % \begin{luadraw}{} % local g = graph:new{window={0,1,0,1},margin={0,0,0,0}, bbox = false} % local L = { Z(0,0), Z(1,1) } % g:Dpolyline(L,true) % g:Show() % \end{luadraw} %} % But this works % This is the TikZ code produced by the above luadraw picture \cfoot{% \begin{tikzpicture}[line join=round]% \begin{scope}% \draw[] (0,0) -- (1,1)--cycle;% \end{scope}% \end{tikzpicture}% } \begin{document} bla blo bli \end{document} Edit. If possible I would like a solution where the luadraw environment is really executed at each page and can use \thepage as a parameter.
- Access TeX counter inside luadrawby PHL on March 10, 2026 at 11:39 am
I am toying with luadraw and would like to have my graphic depending on \thepage for the number of iterations. I tried \\thepage, "\\thepage" or to use g:Writeln or tex.sprint but none of them worked. Minimal non-working example (inspired by the luadraw manual): %!TEX TS-program = lualatex \documentclass{article} \usepackage{luadraw} \begin{document} bla blo bli \begin{luadraw}{name=Sierpinski} local iteration = g:Writeln("\\thepage") %num? tex.sprint? local g = graph:new{window={-5,5,-5,5},margin={0,0,0,0},size={1,1}} local i = cpx.I local rand = math.random local A, B, C = 5*i, -5-5*i, 5-5*i -- triangle initial local T, niv = {{A,B,C}}, iteration for k = 1, niv do T = concat( hom(T,0.5,A), hom(T,0.5,B), hom(T,0.5,C) ) end for _,cp in ipairs(T) do g:Filloptions("full", rgb(rand(),rand(),rand())) g:Dpolyline(cp,true, "line width=0pt") end g:Show() \end{luadraw} \end{document}
- Fail to replicate a sloped node with label nodeby D G on March 10, 2026 at 8:13 am
I want to replicate the black label with the red label created with label node. \documentclass[tikz,border=1cm,12pt]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw (0,0) -- ++ ({sqrt(3)},{sqrt(11)}) node[pos=1/3,circle,fill,inner sep=1pt]{} % dot node[pos=1/3,label={[red,rotate={atan(sqrt(11/3))}]above:above}]{} % how can we make this label node[pos=1/3,above,sloped]{above}; % coincide with this label? \end{tikzpicture} \end{document} What am I missing here?
- How to indent the list item number/symbol along with the text in an itemize environment?by Gary on March 10, 2026 at 4:37 am
The text is indented but the number remains at the left. How can the list numbers be moved to the point of indentation, such that the itemize looks like the paragaphs that follow it in the example? When the numbers are arabic and under 10, a negative distance equal to the indentation appears to work, but when Roman numerals, such that the width varies, it no longer works. It is as if the distance is calculated from the left of the number rather than where it ends on the right. Thank you. \setupindenting[yes,3em,first] \setupitemize [1] [intext] %[intro] [ %distance=-3em, itemalign=, stopper=., right={---}, indenting={yes,3em}, ] \starttext \startitemize[R] \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \startitem \input{ward} \stopitem \stopitemize I.\ --- \input{ward} \par II.\ --- \input{ward} \par III.\ --- \input{ward} \par IV.\ --- \input{ward} \par \stoptext
- Why do none of these do anything? end document hooks and table of contentsby Bob on March 10, 2026 at 4:13 am
I cannot seem to figure out why the \clearpage (or anything for that matter) causes the \AtEndDocument hooks to not work. The other two dont seem to ever do anything which likely means I am using them wrong. \documentclass{article} \usepackage{atveryend} \AtEndDocument{\addtocontents{toc}{\protect bla?}} \AfterLastShipout{\addtocontents{toc}{\protect bla??}} \AtVeryEndDocument{\addtocontents{toc}{\protect bla???}} \begin{document} \tableofcontents \section{blub} \clearpage \LogHook{enddocument} \end{document} The output from the log is the same regardless of the \clearpage > Document-level (top-level) code (executed last): > -> \addtocontents {toc}{\protect bla?} Edit: Added photo demonstrating how none of the hooks function as expected.
- Error creating a graph using pgfplotsby user516076 on March 10, 2026 at 3:37 am
Here is the code: \documentclass[tikz,border=8pt]{standalone} \usepackage{pgfplots} \usetikzlibrary{arrows.meta} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=13.8cm, height=9.6cm, xmin=0, xmax=35, ymin=0, ymax=25, axis lines=left, axis line style={ -{Latex[length=4mm,width=3mm]}, line width=1pt, draw=black!65 }, xlabel={Time (s)}, ylabel={Speed (m/s)}, xlabel style={font=\Large, yshift=10pt}, ylabel style={font=\Large, yshift=-8pt}, xtick={0,10,20,30}, ytick={10,20}, tick style={black!65, line width=0.9pt}, tick label style={font=\Large, text=black!55}, major tick length=6pt, xmajorgrids=true, ymajorgrids=true, xminorgrids=true, yminorgrids=true, minor x tick num=4, minor y tick num=4, grid style={draw=cyan!28, line width=0.35pt}, major grid style={draw=cyan!65!blue, line width=0.8pt}, clip=false, enlargelimits=false ] \addplot[ color=red!75!black, line width=1.2pt ] coordinates { (0,0) (5,10) (15,10) (25,15) }; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:2,5.8) {I}; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:10.2,10.8) {II}; \node[font=\fontsize{22}{22}\selectfont, text=black] at (axis cs:19,13.4) {III}; \end{axis} \node[ anchor=west, font=\fontsize{26}{26}\selectfont, text=black!65 ] at ([xshift=-1cm,yshift=0.75cm]current bounding box.north west) {Graph A}; \end{tikzpicture} \end{document} and I expect it to be run using lualatex and will give me this image: What mistake did I make?
- How to include standalone Tikz figure ready to move around in the main document without moving macros to the Main Document?by user516076 on March 10, 2026 at 12:27 am
What I meant to ask is currently I have this Tikz: \documentclass[tikz,border=6pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[line join=round, line cap=round] \newcommand{\singletick}[4]{% \path (#1) -- (#2) coordinate[pos=#3] (tickpos); \pgfmathanglebetweenpoints {\pgfpointanchor{#1}{center}} {\pgfpointanchor{#2}{center}} \let\ang\pgfmathresult \begin{scope}[shift={(tickpos)}, rotate=\ang+90] \draw[line width=0.8pt] (-#4,0) -- (#4,0); \end{scope} } \newcommand{\doubletick}[5]{% \path (#1) -- (#2) coordinate[pos=#3] (tickpos); \pgfmathanglebetweenpoints {\pgfpointanchor{#1}{center}} {\pgfpointanchor{#2}{center}} \let\ang\pgfmathresult \begin{scope}[shift={(tickpos)}, rotate=\ang+90] \draw[line width=0.8pt] (-#5,-#4) -- (#5,-#4); \draw[line width=0.8pt] (-#5, #4) -- (#5, #4); \end{scope} } \coordinate (A1) at (0,2.2); \coordinate (B1) at (3.2,5.7); \coordinate (C1) at (6.2,2.2); \coordinate (D1) at (3.2,-2.8); \fill[cyan!60] (A1)--(B1)--(C1)--(D1)--cycle; \draw[line width=1pt] (A1)--(B1)--(C1)--(D1)--cycle; \draw[line width=1pt] (B1)--(D1); \doubletick{A1}{B1}{0.47}{0.08}{0.12} \doubletick{B1}{C1}{0.47}{0.08}{0.12} \singletick{A1}{D1}{0.52}{0.12} \singletick{D1}{C1}{0.52}{0.12} \node[left,font=\LARGE] at (A1) {$A$}; \node[above,font=\LARGE] at (B1) {$B$}; \node[right,font=\LARGE] at (C1) {$C$}; \node[below,font=\LARGE] at (D1) {$D$}; \node[left,font=\LARGE] at (1.2,4.1) {$4\ \mathrm{cm}$}; \node[left,font=\LARGE] at (1,0.2) {$6\ \mathrm{cm}$}; \node[right,font=\LARGE] at (3.2,1.5) {$10\ \mathrm{cm}$}; \begin{scope}[shift={(-1.2cm,0)}] \coordinate (A2) at (8.8,1.4); \coordinate (B2) at (10.7,3.7); \coordinate (C2) at (12.5,1.4); \coordinate (D2) at (10.7,-1.8); \fill[cyan!60] (A2)--(B2)--(C2)--(D2)--cycle; \draw[line width=1pt] (A2)--(B2)--(C2)--(D2)--cycle; \draw[line width=1pt] (B2)--(D2); \doubletick{A2}{B2}{0.50}{0.07}{0.10} \doubletick{B2}{C2}{0.50}{0.07}{0.10} \singletick{A2}{D2}{0.53}{0.10} \singletick{D2}{C2}{0.53}{0.10} \node[left,font=\LARGE] at (A2) {$A$}; \node[above,font=\LARGE] at (B2) {$B$}; \node[right,font=\LARGE] at (C2) {$C$}; \node[below,font=\LARGE] at (D2) {$D$}; \node[font=\LARGE] at (10.9,1.0) {$b\ \mathrm{cm}$}; \node[right,font=\LARGE] at (12.0,2.8) {$2\ \mathrm{cm}$}; \node[right,font=\LARGE] at (11.5,-0.7) {$a\ \mathrm{cm}$}; \end{scope} \end{tikzpicture} \end{document} Suppose this is the main document: \documentclass[twoside]{article} \begin{document} \section{Introduction} Hello LaTeX %I want to add the figure here \end{document} I wish the figure within the article would be moveable by coordinate and any built-ins like h, t, b, p (Please teach me both, as to how to use them). By coordinate, if it's possible, I want something like (a, b). Or perhaps you have a better way to move the figure freely, please add it to your answer. I don't know where to start and what package I would need, if I need one. Also to make the main document to be cleaner, I don't want any macros from the Tikz. So just leave it there, but include them all. How to do that? T.I.A.
- Drawing pie-charts side by sideby giofrida on March 9, 2026 at 5:19 pm
I need to draw three pie-charts side by side e.g. using the pgf-pie package so that the centers of the charts lie on the same imaginary line and are the same distance from each other. Each chart should occupy roughly one third of the \textwidth, but slice labels may overflow the margins. I should also be able to caption each chart individually. So far I only managed to align the three charts but I don't know how to draw them relative to \textwidth and how to caption them: \begin{figure} \centering \begin{tikzpicture} \pie[pos={0,0},radius=2]{30/Label A, 40/Label B, 30/Label C} \pie[pos={5,0},radius=2]{20/Label A, 50/Label B, 30/Label C} \pie[pos={10,0},radius=2]{25/Label A, 25/Label B, 50/Label C} \end{tikzpicture} \caption{Whole figure caption} \end{figure} If I make three distinct tikzpictures, the charts end up misaligned probably due to the slice labels. Any help is appreciated.
- Equations get incorrectly numbered when labels are not usedby Arya1050 on March 9, 2026 at 2:45 pm
\documentclass{amsart} \usepackage{autonum} \begin{document} \begin{align} A_1 = B_1 \label{EQ1} \end{align} \begin{align} A_2 = B_2 \label{EQ2} \end{align} \begin{align} A_3 = B_3 \label{EQ3} \end{align} Using \eqref{EQ1}--\eqref{EQ3} \end{document} I want the last line to run as "Using (1)-(3)". Instead, I get "Using (1)-(2)", since the label for the second equation isn't referenced. Is there a way to fix this without writing tags separately for each equation? This would help since the solution would be flexible to adjust to more equations. (In this example, every equation is numbered. But for the document I am working on, some equations are not numbered as I don't want them to be. That's why I am using autonum.)
- Porting aligncolsatbottom.sty to TeX Live 2022+by ke. on March 9, 2026 at 1:22 pm
I'm using this template to produce posters with columns that are aligned at the bottom. It seems to be based on this solution by Chris Le Sueur. My problem is that it works with Tex Live 2021, but not with 2022 and up. Here is a minimal example: simple-poster.tex \documentclass[a0paper,portrait,margin=0pt, colspace=24pt,subcolspace=0pt,blockverticalspace=36pt,innermargin=50pt]{tikzposter} \usepackage{lipsum} % Random Text \usepackage[colalign]{aligncolsatbottom} %To align columns at bottom (!! please run 2 times) \title{The Best Title Ever} \author{First Author\textsuperscript{1}, \underline{Presenting Author}\textsuperscript{1,2}, Second Author\textsuperscript{2}} \institute{ \textsuperscript{1}Your primary affiliation, City, Country.\\ \textsuperscript{2}Another affiliation, City, Country.} %.............................................................................................................................................................................................. \begin{document} % % % HEAD % %.................................................................................... % % Title % \maketitle[width=0.96\linewidth,titletoblockverticalspace=36pt,linewidth=0,roundedcorners=10] %.............................................................................................................................................................................................. % % LEFT COLUMN % \begin{columns} \column{0.5} %.................................................................................... % % Block % \block[titleleft,roundedcorners=16]{Introduction}{ \raggedright \lipsum[4] } %.............................................................................................................................................................................................. % % RIGHT COLUMN % \column{0.5} %.................................................................................... % % Block % \block[titleleft,roundedcorners=16]{Another Block}{ \raggedright \lipsum[13] } \end{columns} \end{document} aligncolsatbottom.sty \usepackage{letltxmacro} \usepackage{ifthen} \newif\ifmy@colalign \my@colalignfalse \DeclareOption{colalign}{ \my@colaligntrue } \ProcessOptions\relax \ifmy@colalign % Align the bottoms of columns % Declarations \newcounter{my@column} \newcounter{my@column@loop} \newcounter{my@block} \newdimen\my@columnextraspace \newdimen\my@maxcolheight \newdimen\my@colheight \newdimen\my@blocktopstart \newdimen\my@rounded % Store the natural height and number of blocks of the current column in the aux file \gdef\my@storecolheight{ \ifnum\value{my@column} > 0 % \expandafter\newdimen\csname my@colheight\alph{my@column}\endcsname \expandafter\setlength\csname my@colheight\alph{my@column}\endcsname{\my@colheight} \immediate\write\@auxout{\noexpand\newlabel{my@colheight\alph{my@column}}{{\the\my@colheight}{}}} \immediate\write\@auxout{\noexpand\newlabel{my@numblocks\alph{my@column}}{{\the\c@my@block}}} \fi } \LetLtxMacro{\orig@block}{\block} % Replace the \block command with a version that pads each block by \my@columnextraspace \renewcommand{\block}[3][]{% \ifTP@columnEnvironment \my@blocktopstart=0pt\relax \advance\my@blocktopstart-\TP@blocktop \fi \orig@block[{#1}]{#2}{\vspace*{-0.5\my@columnextraspace}#3\vspace*{-0.5\my@columnextraspace}} \ifTP@columnEnvironment % count number of blocks \stepcounter{my@block} % keep track of the height of the current column \advance\my@blocktopstart\TP@blocktop \advance\my@colheight\my@blocktopstart % don't add the padding to the height \advance\my@colheight-\my@columnextraspace \fi } % Store the maximum natural height of any column in the aux file \gdef\my@storemaxcolheight{ \ifnum\value{my@column} > 0 % \newdimen\my@maxcolheight \newdimen\my@colheight@loop \setcounter{my@column@loop}{0} \loop\ifnum\value{my@column@loop}<\value{my@column} \stepcounter{my@column@loop} \my@colheight@loop\csname my@colheight\alph{my@column@loop}\endcsname \ifnum\my@colheight@loop<\my@maxcolheight \my@maxcolheight\my@colheight@loop \fi \repeat \immediate\write\@auxout{\noexpand\newlabel{my@maxcolheight}{{\the\my@maxcolheight}{}}} \fi } % Read the column height information and calculate how much extra space the current column needs per block \gdef\my@calcextraspace{ \@ifundefined{r@my@maxcolheight}{% \my@columnextraspace=0pt\relax }{% \expandafter\my@maxcolheight\ref{my@maxcolheight} \expandafter\my@colheight\ref{my@colheight\alph{my@column}} \setcounter{my@block}{\ref{my@numblocks\alph{my@column}}} \my@columnextraspace\my@maxcolheight \advance\my@columnextraspace-\my@colheight \divide\my@columnextraspace by \value{my@block} } } % Replace \column command by a version which stores the height (of the previous column) and calls \my@calcextraspace \gdef\column#1{ % #1: relative width \ifTP@columnEnvironment \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt % Now the normal \column command \normalsize \setlength{\TP@blocktop}{\TP@coltop} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\TP@colspace} \setlength{\colwidth}{#1\TP@visibletextwidth+#1\TP@colspace-\TP@colspace-\blocklinewidth} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\blocklinewidth} \fi } % Replace the columns environment with a version which stores the height of the final column and the max column \renewenvironment{columns}{ \TP@columnEnvironmenttrue \setlength{\TP@colcenter}{-0.5\TP@visibletextwidth-\TP@colspace-0.5\blocklinewidth} \global\TP@colcenter=\TP@colcenter \global\TP@coltop=\TP@blocktop \global\TP@colbottom=\TP@blocktop \colwidth=0pt }{ \my@storecolheight \my@storemaxcolheight \TP@columnEnvironmentfalse \global\TP@blocktop=\TP@colbottom } \fi With TeX Live 2021, this works and aligns the columns. With TeX Live 2022 and up, on the second run of pdflatex, I get this error: ! Missing number, treated as zero. <to be read again> \xparse function is not expandable l.29 \column{0.5} I don't understand what this means, but maybe something in the redefinition of \column in aligncolsatbottom.sty needs to be adjusted? I quote it here: % Replace \column command by a version which stores the height (of the previous column) and calls \my@calcextraspace \gdef\column#1{ % #1: relative width \ifTP@columnEnvironment \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt % Now the normal \column command \normalsize \setlength{\TP@blocktop}{\TP@coltop} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\TP@colspace} \setlength{\colwidth}{#1\TP@visibletextwidth+#1\TP@colspace-\TP@colspace-\blocklinewidth} \setlength{\TP@colcenter}{\TP@colcenter+0.5\colwidth+\blocklinewidth} \fi } If I comment out this part: \my@storecolheight \stepcounter{my@column} \my@calcextraspace \setcounter{my@block}{0} \my@blocktopstart0pt \my@colheight0pt then it compiles - but doesn't align the columns, obviously.
- Producing an Elliptical Ring of Imagesby DDS on March 8, 2026 at 8:34 pm
Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \fill[red] rectangle (8,6); \foreach \k in {0,30,...,360} \node at ($(4,3)+(\k:2)$) {\includegraphics[width=1.7em]{example-image-a}}; \end{tikzpicture} \end{center} \end{document} which produces: QUESTION: How may I modify this code in order produce an ellipse (instead of circle) of images? Thank you.
- Drawing a topological surface of genus threeby InsideOut on March 8, 2026 at 12:56 pm
I would need your help to draw a surface of genus three like in the picture I attached. More specifically, I aim to draw a torus (surface of genus one) and below the surface of genus three realised by mean of some surgeries on the surface. I already drawn the torus by myself and I need help with the genus 3 surface. As you can see, the torus I drew is not exactly as on paper. Could help me? I also added some notes about colours of curves. Moreover, I'd like the surface is filled with the pattern [pattern=north west lines, pattern color=pallido], where pallido is just a colour I defined in RGB (it's already in the code). In the picture I do not need the names of colours, that's only for you. Thank you in advance! \documentclass[11pt,a4wide]{article} \usepackage[latin1]{inputenc} \usepackage{fancyhdr} \usepackage{indentfirst} \usepackage{graphicx} \usepackage{newlfont} \usepackage{amssymb} \usepackage{amsmath} \usepackage{latexsym} \usepackage{lscape} \usepackage{booktabs} \usepackage{amsthm} \usepackage{lscape} \usepackage{tikz} \usetikzlibrary{patterns,hobby} \usepackage{pgfplots} \pgfplotsset{compat=1.6} \usepackage{faktor} %\faktor{A}{B} %\usepackage{pictexwd,dcpic} \usepackage{pgf,tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations.markings} \usetikzlibrary{bending} \usetikzlibrary{patterns} \usetikzlibrary{intersections, calc} \usetikzlibrary{decorations.pathmorphing} \usepackage{soul} \usepackage{rotating} \usepackage[margin=3cm]{geometry} \usepackage{enumitem} \usepackage{color} \usepackage{hyperref} \definecolor{smoked}{RGB}{216, 212, 204} \definecolor{mauve}{RGB}{200, 55, 171} \definecolor{apricot}{RGB}{250, 144, 4} \definecolor{sky}{RGB}{66, 169, 244} \definecolor{plum}{RGB}{76, 0, 102} \definecolor{forest}{RGB}{90,145,120} \definecolor{sand}{RGB}{180,160,120} \begin{document} \begin{figure}[h!] \centering \begin{tikzpicture}[scale=2, every node/.style={scale=0.875}] \definecolor{pallido}{RGB}{221,227,227} \pattern [pattern=north west lines, pattern color=pallido] (0,0) ellipse (3cm and 2cm); \fill [white] (0,0) ellipse (1cm and 0.66cm); \draw[thin, black] (0,0) ellipse (3cm and 2cm) (0,0) ellipse (1cm and 0.66cm); \draw[orange] (0,0) ellipse (2cm and 1.25cm); %\draw[blue] (0,0) arc (030:060:2.5cm and 1.5cm); \draw[blue] (0,0) +(30:2.4 and 1.6) arc [start angle=30, end angle=60, x radius=2.4, y radius=1.6]; \draw[blue] (0,0) +(210:2.4 and 1.6) arc [start angle=210, end angle=240, x radius=2.4, y radius=1.6]; \draw[violet] (0,0) +(120:1.2 and 0.8) arc [start angle=120, end angle=150, x radius=1.2, y radius=0.8]; \draw[violet] (0,0) +(300:1.2 and 0.8) arc [start angle=300, end angle=330, x radius=1.2, y radius=0.8]; \draw[red ] (0 ,-0.66) to[bend left ] (0,-2); \draw[sky ] (0 , 0.66) to[bend left ] (0, 2); \draw[thin, red, dashed] (0 ,-0.66) to[bend right] (0,-2); \draw[thin, sky, dashed] (0 , 0.66) to[bend right] (0, 2); \fill ( 0.2,-1.25) circle (1pt); \fill (-0.2, 1.25) circle (1pt); \fill[violet] (0,0) +(120:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(150:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(300:1.2 and 0.8) circle (0.5pt); \fill[violet] (0,0) +(330:1.2 and 0.8) circle (0.5pt); \fill[blue] (0,0) +(030:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(060:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(210:2.4 and 1.6) circle (0.5pt); \fill[blue] (0,0) +(240:2.4 and 1.6) circle (0.5pt); \draw[black, thin] (0,0) +(030:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(060:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(210:2.4 and 1.6) circle (1pt); \draw[black, thin] (0,0) +(240:2.4 and 1.6) circle (1pt); \draw[violet] (0,0) +(120:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(150:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(300:1.2 and 0.8) circle (1pt); \draw[violet] (0,0) +(330:1.2 and 0.8) circle (1pt); \node at ( 1.75 , 1.25 ) {\(e_{1,1}\)}; \node at (-1.75 ,-1.25 ) {\(e_{1,2}\)}; \node at (-1.0625, 0.625) {\(e_{2,1}\)}; \node at ( 1.0625,-0.625) {\(e_{2,2}\)}; \end{tikzpicture} \caption{} \label{fig:hypermin} \end{figure} \end{document} My current result The picture I wish to draw: