Hot
- How to compile LaTeX bibliography with journal abbreviations without using .ldf files?by David Russell on February 25, 2026 at 9:08 pm
I am submitting an article written in LaTeX (document class elsarticle) to an Elsevier journal. For journal abbreviations in the bibliography, I have been using jabbrv.sty, together with the lists of abbreviations in jabbrv-ltwa-en.ldf and jabbrv-ltwa-all.ldf. However, Elsevier’s online system for building a PDF from LaTeX source files only allows for certain file types, not including .ldf files. What is the simplest workaround for this problem?
- I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confusedby Jasper on February 25, 2026 at 7:14 pm
I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confused. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\SIGMALstart}{-3} \pgfmathsetmacro{\SIGMALstop}{3} \pgfmathsetmacro{\SIGMALsamples}{50} \pgfmathsetmacro{\SIGMALstep}{(\SIGMALstop-\SIGMALstart)/(\SIGMALsamples-1)} \foreach \SIGMAL[parse=true] in {\SIGMALstart,\SIGMALstart+\SIGMALstep,...,\SIGMALstop} { \draw[ variable=\TAUL, domain=-3:3 ] plot ( {\SIGMAL*\TAUL}, {((\TAUL)^2-(\SIGMAL)^2)/2} ); } \end{tikzpicture} \end{document}
- enumerate with right-aligned labels, the widest is flush-left to left edge of text area without setting widest=by tsj on February 25, 2026 at 6:40 pm
I want the following simple layout with enumitem: Blah blah noindent I. Foo II. Bar blah blah long line paragraph wrapping continues here III. Baz Blah blah noindent non-enumerate text Labels are right aligned, \labelsep can be fixed (e.g. 0.5em), and text continues from the same horizonal position on the next line in the case of a longer paragraph (I think this means \itemsep should be zero). enumitem apparently has the capacity to calculate the width of the widest label and set \labelwidth accordingly, though I can't determine under what circumstances that happens after reading the documentation. I can set widest=<whatever> to achieve the output I want, but I'd like to know if I can achieve the same by setting one or more parameters to ! or *, i.e. computing the parameters automatically. MWE and output are below, basically I just want the widest label (maybe VI or III or IV) label to be left-aligned with the left edge of the VVVVV (the left edge of the text area), everything else the same. \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=\Roman*.,nosep,align=right, leftmargin=*, labelindent=0pt, labelsep=0.5em, itemsep=0pt, % widest=VI, % I don't want to use this! ] \item Alpha. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. \item Gamma \item Delta \item Epsilon \item Zeta \end{enumerate} VVVVV \end{document}
- Retrieve the value of a variable earlier in the documentby Subhajit Paul on February 25, 2026 at 5:54 pm
I am preparing the schedule for a conference and using a time counter controlled by the macro \Next. By default, \Next advances the time by 15 minutes, but it can also accept an optional argument to specify a different increment. The definition of \Next is not perfect; a full discussion appears in this question. However, for convenience, I am using the version shown below. My preamble is: \documentclass{article} \usepackage{calc} \def\kntime{45} \def\pttime{35} \def\qatime{5} \def\kntottime{\kntime+\qatime} \def\pttottime{\pttime+\qatime} % % \newcounter{hour} \newcounter{minute} \newcounter{flag} \newcommand{\Time}[2]{% \setcounter{flag}{0}% \setcounter{hour}{#1}% \setcounter{minute}{#2}% } \newcommand*{\Next}[1][15]{% \addtocounter{minute}{#1}% \ifnum\value{minute}>59% \stepcounter{hour}% \addtocounter{minute}{-60}% \fi% \ifnum\value{hour}>11% \stepcounter{flag}% \ifnum\value{hour}>12 \addtocounter{hour}{-12}% \fi \fi% % \ifnum\value{hour}<10 0\fi% \thehour% :% \ifnum\value{minute}<10 0\fi\theminute% \ifnum\value{flag}<1\ am\fi% \ifnum\value{flag}>0\ pm\fi% } % \newcounter{tsession} \renewcommand{\thetsession}{\Roman{tsession}} \newcommand{\tsession}{% \stepcounter{tsession}% Technical Session -- \thetsession% } I would like to display the total runtime of each session in the table header (masthead). Specifically, I want a macro \endtsession{\thetsession} that can be used as follows: \begin{document} \Time{8}{10} \begin{tabular}{ll} \multicolumn{2}{c}{\tsession: \Next[0] -- \value{\endsession{\thetsession}}}\\\hline \Next[\kntime] & Keynote Speaker\\ \Next[\qatime] & Q\&A\\ \Next[\pttime] & Plenary Speaker\\ \Next[\qatime] & Q\&A\\ \Next[0] & Speaker 1\\ \Next\endsession{\thetsession} & Speaker 2 \end{tabular} \end{document} The macro \endtsession should return the final time of the session in the same format produced by \Next. Any assistance would be appreciated.
- Two 'Missing character: There is no ; (U+003B) in font nullfont!' warnings with pgfplotsby Apoorv Potnis on February 25, 2026 at 5:13 pm
I get two Missing character: There is no ; (U+003B) in font nullfont! warnings when I compile the below code with LuaLaTeX. I don't see any line numbers for the warnings in the .log file. I don't see any visual problem with the output though. \documentclass{article} \usepackage[newcmbb]{fontsetup} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{decorations.markings} \usetikzlibrary {arrows.meta,bending} \newcommand{\e}{\symrm{e}} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[line cap=round] \begin{axis}[ samples=200, domain=0.24:4.5, xmin=0, xmax=5, ymin=-4.4, ymax=0.5, axis lines=middle, ticks=none, width=0.5\textwidth, xlabel={$r$}, ylabel={$V(r)$}, x axis line style={thick, -{>[bend]}}, y axis line style={thick, {<[bend]}-{>[bend]}}, y label style={anchor=south}, x label style={anchor=west}, legend style={ draw=none, at={(axis cs:2,-1.8)}, anchor=north west, row sep=10pt } ] \addplot[thick, red] {-exp(-x)/(x)}; \addplot[thick, blue, dashed] {-1/(x)}; \addlegendentry{$\displaystyle\frac{-\e^{-r}}{r}$}; \addlegendentry{$\displaystyle\frac{-1}{r}$}; \end{axis} \end{tikzpicture} \end{figure} \end{document} I saw another question with the same warning but there was a \tikz command in it which was causing issues. There is not \tikz command in my code. And I can't seem to find any stray semi-colons in the TikZ code either.
- Square brackets in citations when in parentheses [duplicate]by test on February 25, 2026 at 2:56 pm
This is probably a long shot, but I have the following problem: when a bibliographical reference appears within parentheses, my supervisor would like the inner parentheses to be changed to square brackets, like this: Der Titel lautet Geschichte des Abramo (cf. R. Penna, ”Abramo“, RS 3 [1997]: 15–31 [hier 10]). Here is my example file: \documentclass{scrbook} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[autostyle=true,german=quotes]{csquotes} \usepackage[style=sbl,citepages=separate,backend=biber,sblfootnotes=false,ibidpage=true,ibidtracker=true,idemtracker=true,pagetracker=spread,sorting=nyvt,url=false,isbn=false,doi=false,clearlang=false,uniquename=false]{biblatex} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @article{Penna.R, author = {Penna, R.}, gender = {sm}, date = {1997}, title = {Abramo}, pages = {15–31}, volume = {3}, keywords = {sekundaer}, journaltitle = {RS}, } \end{filecontents*} \addbibresource{\jobname.bib} \begin{document} Abramo schrieb ein Buch.\footnote{Der Titel lautet Geschichte des Abramo (cf. \cite[10]{Penna.R}).} \printbibliography \end{document}
- Two synchronised but different documents on even and odd pagesby Christophe on February 25, 2026 at 11:59 am
I would like to generate a document that merges two documents: the first one states the theory, and the second one presents examples. Both documents have exactly the same structure: the chapters, sections, and subsections are identical. However, the lengths of these structural elements differ. The merged document should show the theoretical part on the even pages and the examples on the odd pages. And of course, despite the difference in length between the chapters, sections, etc., their titles must appear at the same height on the page. I have no MWE to show (and I tried to follow question 354456, but unsuccesfully). What I want to achieve is completely beyond my skills. Note that the “two documents” do not exist yet, so nothing needs to be imported from an existing source. In addition, I am using the following template (class memoir): https://www.overleaf.com/latex/templates/matnat-compendium/xbfgbfgzpcxz
- How to read correct \lastskip just after a figure?by forrest on February 25, 2026 at 9:07 am
This is somehow a continuation of Usage of the `\lastskip` as a flag and \intextsep gives doubled space The code snippet below produces the following fragment of the vertical list: ...\glue 12.0 plus 2.0 minus 2.0 <-- \intextsep added by the figure environment ...\glue 0.0 plus -1.0 ...\glue -16371.99998 plus 2.0 minus 2.0 ...\glue 16383.99998 <-- \maxdimen added by \myfancybreak ...\penalty 10000 I want to move \glue 16383.99998 AFTER \penalty 10000 so that it will be accessible in \lastskip after the figure environment and thus accessible by \addvspace in \myfancybreak. How to do this? \documentclass{memoir} \newlength\fancybreakskip \setlength\fancybreakskip{.5\intextsep} \newcommand*{\myfancybreak}[1]{% \par \addvspace\fancybreakskip \centerline{#1}% \vskip\glueexpr\fancybreakskip-\maxdimen\relax \nobreak \vskip\maxdimen} \newlength{\auxiliarylength} \setlength{\auxiliarylength}{\glueexpr\intextsep-\maxdimen\relax} \usepackage{etoolbox} \makeatletter% \patchcmd{\@addtocurcol}% {\vskip\intextsep}{\aftergroup\vskip\aftergroup\auxiliarylength\aftergroup\vskip\aftergroup\maxdimen}% this trick doesn't work as there is \nobreak added at the end of float that resets \lastskip to 0pt {\typeout{*** SUCCESS ***}}% {\typeout{*** FAIL ***}} \makeatother% \begin{document} \section{Distance between float and fancy break} \begin{figure}[h] \centering% AAA% \caption{Caption to figure.}% \end{figure}% \myfancybreak{$\ast$} \end{document}
- \nopagebreak in \paragraph don’t have effectby fauve on February 25, 2026 at 4:44 am
General overview I redefine \paragraph{} in order to get a wrap paragraph title like this : The problem But sometimes, when I reach the bottom page, a \section or \subsection comming just before the \paragraph stay at widow, like this: The MWE \documentclass{article} \usepackage{fontspec} \usepackage{xunicode} \usepackage{fontenc} \usepackage{wrapfig} \usepackage{needspace} \setlength\intextsep{0pt} \newlength{\wrapparwidth} \renewcommand{\paragraph}[1]{% %\needspace{3\baselineskip}% \nopagebreak[4]% \settowidth{\wrapparwidth}{\centering\bfseries\normalsize\small #1}% \ifdim\wrapparwidth>3cm% \setlength{\wrapparwidth}{3cm}% \fi% \begin{wrapfigure}{l}{\wrapparwidth} % l = left, 3cm largeur max \vspace{-0.04em} \centering\bfseries\normalsize\small #1 \end{wrapfigure}% \nopagebreak[4]% } \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \subsection{A random section} \paragraph{A random paragraph} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{document} The question As you see, I used many \nopagebreak and also needspace to avoid this behaviour, but LaTeX wan’t hear my \nopagebreaks. So how do I avoid pagebreak between sectioning commands and the new defined \paragraph ?
- “Wrap” mode paragraph in titllesec occure a new line in some casesby fauve on February 25, 2026 at 2:48 am
General overview The titlesec package provide commandes to tweek the rendering of paragraphs and subparagraph. I use it to get a rendering like this one: As you see, the \paragraphs should be in bold and in wrap mode, when \subparagraphs should be in inline mode, emphasis, and ended by a point. What I did This is my MWE: \documentclass[a4paper,12pt,twoside,french]{article} \RequirePackage{fontspec} \RequirePackage{xunicode} \RequirePackage{fontenc} \usepackage{titlesec} % Tweek of \paragraph \titleformat{\paragraph}[wrap]{\centering\bfseries\normalsize\small}{}{0em}{} \titlespacing*{\paragraph}{0.3\textwidth}{3.25ex plus1ex minus.2ex}{0.75em}%} % Tweek of \subparagraph \titleformat{\subparagraph}[runin]{\em\normalsize}{}{1em}{}[.] \begin{document} \paragraph{An undesired gap appear…} \subparagraph{…When a \texttt{\textbackslash{}subparagraph} immediatly followed the \texttt{\textbackslash{}paragraph}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \paragraph{But the gap dosen’t appear…} …if the \texttt{\textbackslash{}paragraph} is followed by regular text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \subparagraph{This is a regular \texttt{\textbackslash{}subparagrah}…} …Not immediatly preceeded by a \texttt{\textbackslash{}paragraph}. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.y \paragraph{However this is…} {\em …the desired rendering.\hspace{1em}} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \end{document} And this is the related rendering: The problem As you see in the red frame in the rendering, when a \paragraph is immediatly followed by a \subparagraph then the wrap mode is broken. A line break appear after the paragraph and the subparagraph start in a new line. The \subparagraph doesn’t behave just like other regular text. The question How to make \paragraphs just get the desired wrap rendering even if they are followed by a \subparagrah?
- PDF/UA and stretchable math delimitersby Vincent Beffara on February 25, 2026 at 12:12 am
I am trying to generate PDF/UA-2 compliant PDFs, and so far most of what I tried works with the last updates to the tagging support (thanks!). But with this file: \DocumentMetadata{lang=en,tagging=on,pdfstandard={UA-2}} \documentclass{article} \usepackage{newtxmath} \title{.} \begin{document} \maketitle \[\Bigg|\] \end{document} compiled with LuaLaTeX, verapdf tells me that the produced PDF is not valid because of a font issue, namely: The glyph can not be mapped to Unicode The Font dictionary of all fonts shall define the map of all used character codes to Unicode values, either via a ToUnicode entry, or other mechanisms as defined in ISO 14289-2, 8.4.5.8 I am assuming "the glyph" is the stretched vertical bar, and that the issue is with missing info from the math font loaded by newtxmath. What can I do, given that I would really like to keep newtxmath? Teach LuaLaTeX about the Unicode equivalent to that glyph (and others)? Use stretchable characters from another font? (but how?) Put the info in the font? (but how?)
- How to write at an angle along a straight lineby rpapa on February 24, 2026 at 8:33 pm
Using "sloped" I know how to write text parallel to a line, but how do I make the text also at an angle in the second case? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,matrix,calc} \begin{document} \begin{tikzpicture} \draw [red,ultra thick] (0,0)coordinate(A1)-- (3,5)coordinate(A2); \path (A1) -- (A2) node[sloped,pos=0.3,draw,fill=white]{aa}; \draw [blue,ultra thick] (1,0)coordinate(A3)-- (4,5)coordinate(A4); \foreach \i in {1,...,5} \node [sloped,draw,fill=white] at ($(A3)!{\i*10mm}!(A4)$) {\i}; \end{tikzpicture} \end{document} To be clear, the nodes must have a set distance between them.
- why the \underline{} does not made CR [duplicate]by RenatoP on February 24, 2026 at 6:36 pm
I have this code \underline{lkjhsdf ldshliuhs uidsh dsuhsd udsh psuhds puisdh duih doiuhsd odiuhd oiudsh soiuhd soiuh dslfjhsd flsdjhf ldsh sdlkjfh sdlfhs dljhsd ldh ljdk lsjkc } but it does not made the CR when it arrive at the limit of line. It seems doesn't recognize the margin. this is the preamble: %% The openany option is here just to remove the blank pages before a new chapter \documentclass[11pt,openany]{book} \title{Moneta positiva} %-----rinomina "chapter" in "passo" ---------- \usepackage[italian]{babel} \usepackage{titlesec} % Make “Chapter” become “Sezione” everywhere (heading, marks, refs using \chaptername) \addto\captionsitalian{% \renewcommand{\chaptername}{Passo}% } % Print chapter as: "Sezione <number> <title>" on one line \titleformat{\chapter}[hang] {\normalfont\huge\bfseries} {\chaptername~\thechapter} {1em} {} % Optional spacing tweak \titlespacing*{\chapter}{0pt}{-10pt}{20pt} \usepackage{pagenote} \usepackage{makeidx} \usepackage[]{mdframed} %per produrre frame (cornici) \usepackage{amsmath} %per espressioni matematiche (la frazione) \usepackage{graphicx} % per l'inserimento di immagini \usepackage{gensymb} %per simbolo del grado (primo, secondo...) \usepackage{tabularx} %-- per la costruzione di tabelle --- \usepackage{ragged2e} %-- per allineamento a sx, centro e destra-- \usepackage{float} %--pkg per immagini non flottanti --------- %%%%%%%%%%%%% For customising the endnote markers. Comment these out if you don't want them. % To prefix each note number with the chapter number \renewcommand{\thepagenote}{\thechapter-\arabic{pagenote}} % To have a slightly different formatting for the endnote numbers in the text -- smaller text, sans-serif, square brackets \renewcommand\notenumintext[1]{\space{\footnotesize\sffamily[FN-#1]}} % To have a slightly different formatting for the endnote numbers in the notes section. Just the square brackets and sans-serif; normal size. \renewcommand\notenuminnotes[1]{{\sffamily[FN-#1] }} % If you want a different name/heading for the end notes \renewcommand{\notesname}{End Notes} %%%%%%%%%%%%% End customisation %%\usepackage{acronym} %per usare gli acronimi %%\acrodef{EX}[EX]{\emph{Example}} %% THIS LINE IS MANDATORY \makeindex %%crea indice \makepagenote %% crea le note di pagina \usepackage{hyperref} \begin{document} \maketitle \tableofcontents \chapter{percezione, realtà e cambiamento} \section{La matrix della moneta} bla bla abla bla bla \end{document}
- Dynamic class/id name in tabularrayby Mariuslp on February 24, 2026 at 5:50 pm
I am trying, for the purposes of a reusable library, to create dynamic class names in tabularray. Here is my minimal code: \documentclass{article} \usepackage{tabularray} \usepackage{xcolor} \date{} \newcounter{stylectr} \setcounter{stylectr}{1} % compiles, but non-dynamic \newcommand{\style}{\SetChild{id=Idstylei}\stepcounter{stylectr}} %% does not work %% command to expand the argument before the \SetChild (see https://tex.stackexchange.com/a/133768/430417) %\def\expandArg #1#2{\expandafter\expandArgaux\expandafter{#2}{#1}} %\def\expandArgaux #1#2{#2{#1}} %\newcommand{\style}{\expandArg{\SetChild}{id=Idstyle\roman{stylectr}}\stepcounter{stylectr}} \begin{document} \begin{table} \SetTblrOuter{expand=\style} \begin{tblr} { colspec=lll, cell{Idstylei} = {red9} } \style 1 & \style 2 & 3\\ \end{tblr} \end{table} \end{document} My goal is that, every time I call \style, the cell is given the id Idstyle{ctr} where {ctr} is a roman number (or anything that will yield a valid tblr id name). For instance, in the above code, only the first cell should have red background. I have tried several related solutions (1 2) but none seems to be working, or at least none that I can make to work. Edit: weird behaviour from tabularray, if I try to use the line \newcommand{\style}{\SetChild{id=Idstyle\roman{stylectr}}\stepcounter{stylectr}}, the code compiles but does not work (no cell has id Idstylei or even Idstyle), and an extra comma , appears left of the table. Does anyone knows where this comma is coming from?
- Spacing and dot weight in bsmallmatrix (from mathtools)by Dimitrios ANAGNOSTOU on February 24, 2026 at 4:45 pm
MWE \documentclass{article} \usepackage{mathtools} \begin{document} Le signe $(-1)^{i+j}$ suit un motif en damier : \( \begin{bsmallmatrix} + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ \vdots & \vdots & \vdots & \vdots & \ddots \end{bsmallmatrix} \) \end{document} Questions There appears to be some horizontal empty space around the matrix. How can I remove or reduce it? It seems that \cdots is not as bold as \vdots and \ddots. Is this actually the case? If so, is there a way to make the various dots visually consistent? THANKS A LOT!
- How can I make the affiliation list break across pages in the wiley-article class?by Singh on February 24, 2026 at 2:40 pm
The author list is long and also the affiliation. All affiliations do not fit on one page. However, the wiley-article class seems to typeset the entire title block (authors + affiliations) inside a single unbreakable box, so the affiliations cannot continue onto the next page. Is there a way to break the affiliation list across pages. \ or \clearpage or loading authblk doesn't solve the problem.
- align text in tikz node with minimum widthby Hyperplane on February 24, 2026 at 1:01 pm
\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[fill=yellow!80!black,align=right, minimum width=10cm] {This is a\\ demonstration text for\\ alignments.}; \end{tikzpicture} \begin{tikzpicture} \node[fill=yellow!80!black,align=left, minimum width=10cm] {This is a\\ demonstration text for\\ alignments.}; \end{tikzpicture} \end{document} When using align=right and align=left, the text is usually flushed to the right. But when I set a minimum width for the box it appears in the center instead: This feels like a bug in tikz. In Left alignment in TikZ, people suggested setting text width or wrapping the content in a parbox. However, these require knowing the width of the text beforehand, otherwise one gets overfull/underfull box warnings, so I do not consider them real solutions. I would expect the text width to be chosen automatically.
- How does \NewCommandCopy work?by M0M0 on February 24, 2026 at 12:16 pm
usrguide motivates \NewCommandCopy with ... If the existing command is robust, then the old trick of using the low-level \let for this doesn’t work, because it only copies the top-level definition, but not the part that actually does the work. this suggests that \NewCommandCopy can somehow copy the full definition of a robust command. The only way I can image it can do this, is by expanding the command. However, the whole point of a robust command is that it might not be expandable and might break in an expansion only context. Does \NewCommandCopy just accept the risk and hence is basically quite similar to \edef\oldcommand{\command} or am I missing something here?
- parskip: Avoid extra spacing before equations [duplicate]by elst on February 24, 2026 at 11:45 am
I am using the parskip package and wonder if there is a way to always avoid the extra spacing before equations regardless if having a space in the .tex file or not? That is, when doing something like text blablablablabla \begin{equation} ... \end{equation} there is an extra (unwanted) space which doesn't show when doing text blablablablabla \begin{equation} ... \end{equation} So I wonder if there is a way to achieve the compiled output as in the latter case, for both alternatives. (For equations, align, etc.) I found a tip about using \abovedisplayskip in another post, but didn't get this to work.
- how to zoom in on tikz clipped imageby Matteo on February 24, 2026 at 10:38 am
I have the following situation: where the first \clip in the second frame is very small and I wish to present it a bit bigger for visibility reasons. I'm unsure how to tweak the code I'm using and if it is possible by simply using tikz + clip. Thanks in advance! MWE \documentclass[aspectratio=149]{beamer} \usepackage[T1]{fontenc} \usetheme{Singapore} \usecolortheme{dolphin} \usepackage{tikz} \usepackage[export]{adjustbox} \begin{document} \begin{frame} \frametitle<2>{Inset 1} \frametitle<3>{Inset 2} \only<1-3>{ \centering\includegraphics<1>[width=.75\textwidth]{example-image-a} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \begin{tikzpicture} \clip<2> (-6,4) rectangle (6,5); \clip<3> (-6,-3.25) rectangle (6,-7.5); \node<2-> at (0,0) {\includegraphics[width=\textwidth]{example-image-a}}; \end{tikzpicture} \end{adjustbox} } \end{frame} \end{document} EDIT: sketch attempt Cropped from the original, the image can be stretch vertically, primarily, and horizontally up to the size of the frame while preventing Overfull hbox warnings. Proportion should be preserved but if not possible a vertical stretch has the priority.
- Ordering of yhmath and accents packages (\wideparen command)by ivankokan on February 24, 2026 at 9:59 am
MWE \documentclass[12pt,a4paper,oneside]{article} \usepackage{lmodern} \usepackage[centertags,intlimits,namelimits,sumlimits]{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{yhmath} % (*) \usepackage{accents} % (**) \listfiles \begin{document} $\wideparen{AB}$, $\wideparen{BC}$, $\wideparen{CA}$, $\wideparen{AC}$, $\wideparen{AF}$, $\wideparen{EF}$, $\wideparen{A_1C}$, $\wideparen{XY}$, $\wideparen{ZW}$, $\wideparen{CD}$ \end{document} Compiled on Overleaf LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2025-05-26> *********** *File List* article.cls 2025/01/22 v1.4n Standard LaTeX document class size12.clo 2025/01/22 v1.4n Standard LaTeX file (size option) lmodern.sty 2015/05/01 v1.6.1 Latin Modern Fonts amsmath.sty 2025/05/18 v2.17x AMS math features amstext.sty 2024/11/17 v2.01 AMS text amsgen.sty 1999/11/30 v2.0 generic functions amsbsy.sty 1999/11/29 v1.2d Bold Symbols amsopn.sty 2022/04/08 v2.04 operator names amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support amssymb.sty 2013/01/14 v3.01 AMS font symbols yhmath.sty 2020/03/17 v1.6 accents.sty 2006/05/12 v1.4 Math Accent Tools ot1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern l3backend-pdftex.def 2025-04-14 L3 backend support: PDF output (pdfTeX) omllmm.fd 2015/05/01 v1.6.1 Font defs for Latin Modern omslmsy.fd 2015/05/01 v1.6.1 Font defs for Latin Modern omxlmex.fd 2015/05/01 v1.6.1 Font defs for Latin Modern umsa.fd 2013/01/14 v3.01 AMS symbols A umsb.fd 2013/01/14 v3.01 AMS symbols B OMXyhex.fd 2013/07/03 v1.1 YH's humble contribution to TeX maths (NP) *********** Output If I reorder (*) and (**) to (**) and (*), I get the following output: What is the root cause of the difference? What is the recommended order between these two packages (the original output looks better: it does not span horizontally more than needed, neither it lacks of spanning)? Is the \wideparen the only command that is affected in this context? EDIT: https://github.com/norbusan/yhmath/issues/8
- pgfplotstable commands do not work in a foreach loopby CarLaTeX on February 24, 2026 at 8:33 am
I'm trying to put together n files into one with pgfplotstable. This example works: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \pgfplotstableread[header=false]{data2.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \pgfplotstableread[header=false]{data3.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} It gives what I want: But if I put the \pgfplotstableread and \pgfplotstablevertcat in a \foreach loop, they don't work: \begin{filecontents}{data1.csv} aaa bbb ccc \end{filecontents} \begin{filecontents}{data2.csv} 111 222 333 \end{filecontents} \begin{filecontents}{data3.csv} aaa111 bbb222 ccc333 \end{filecontents} \documentclass{book} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \pgfplotstableread[header=false]{data1.csv}\overallTable \foreach \ind in {2,3} {the loop is executed: \ind\newline \pgfplotstableread[header=false]{data\ind.csv}\tableTwo \pgfplotstablevertcat{\overallTable}{\tableTwo} } \begin{table} \pgfplotstabletypeset[ string type, ]{\overallTable} \end{table} \end{document} Even if the loop is executed, I got no errors, and in the log I have: PGFPlots: reading {data1.csv} PGFPlots: reading {data2.csv} PGFPlots: reading {data3.csv}
- lualatex writing strange things into ~/.texliveby user2609605 on February 23, 2026 at 10:30 pm
I installed texlive with the following profile TEXDIR /usr/local/texlive/2025 TEXMFCONFIG ~/.texlive2025/texmf-config TEXMFHOME ~/texmf TEXMFLOCAL /usr/local/texlive/2025/texmf-local TEXMFSYSCONFIG /usr/local/texlive/2025/texmf-config TEXMFSYSVAR /usr/local/texlive/2025/texmf-var TEXMFVAR ~/.texlive2025/texmf-var # platforms TBD: configure with new setting based on instTexliverc and local plattform binary_aarch64-linux 0 binary_amd64-freebsd 0 binary_amd64-netbsd 0 binary_armhf-linux 0 binary_i386-freebsd 0 binary_i386-linux 0 binary_i386-netbsd 0 binary_i386-solaris 0 binary_universal-darwin 0 binary_windows 1 binary_x86_64-cygwin 0 binary_x86_64-darwinlegacy 0 binary_x86_64-linux 1 binary_x86_64-linuxmusl 0 binary_x86_64-solaris 0 # OPTIONs: Maximal Performance & Stability # installation option s instopt_adjustpath 0 instopt_adjustrepo 1 # default instopt_letter 0 # TBD: must be tied to $PAPER instopt_portable 1 instopt_write18_restricted 1 # TBD: must be tied to new setting # turned options into tlpdbopt tlpdbopt_autobackup 0 #tlpdbopt_backupdir tlpkg/backups # not needed because tlpdbopt_autobackup 0 tlpdbopt_create_formats 1 tlpdbopt_desktop_integration 0 tlpdbopt_file_assocs 0 tlpdbopt_generate_updmap 0 # doubt tlpdbopt_install_docfiles 1 # TBD: make configurable tlpdbopt_install_srcfiles 1 # TBD: make configurable #tlpdbopt_location https://ftp.math.utah.edu/pub/tex/historic/systems/texlive # TBD: configure tlpdbopt_post_code 1 tlpdbopt_sys_bin /usr/local/bin # unused because of instopt_adjustpath 0? tlpdbopt_sys_info /usr/local/share/info # unused because of instopt_adjustpath 0? tlpdbopt_sys_man /usr/local/share/man # unused because of instopt_adjustpath 0? tlpdbopt_w32_multi_user 0 This profile is just based on the one written back on some older installation and adapted. I want to focus on the variables in particular TEXMFVAR ~/.texlive2025/texmf-var The first observation is, that ~/.texlive2025 seems unused, i.e. does not show up but lualatex writes ~/.texlive. If I erase it reappears. I wonder whether my setting is ignored. Since I have in parallel release 2024 and 2025 I would like to keep separated. If I understand the settings in the profile right, this is done, but reality differs: all is written into one folder, namely ~/.texlive. If I have a look inside, some strange files show up: ~/.texlive/texmf-var/luatex-cache/generic/names/luaotfload-names.lua.gz gunzipping unveils: ... ["/usr/share/fonts/truetype/luxisri.ttf"]={ ["index"]={ [false]=458, }, ["timestamp"]=1770577183, }, ["/usr/share/fonts/xscreensaver/OCRA.ttf"]={ ["index"]={ [false]=180, }, ["timestamp"]=1763843231, }, ... which means that lualatex scans my system fonts. This is not a nice observation because I want to make my texlive reproducible. How can I prevent this problem??? Next bad ovservation: ~/.texlive/texmf-var/luamplib_cache/luamplib_input_F4_05someMetapost_mp I am sure this is from luamplib and the name is that of a specific figure in some (Chapter 4, Figure 5) so part of my document leaks into my home folder. Also very bad but not as bad as the above problem, because I can just avoid luamplib. Last problem: TEXMFHOME ~/texmf does not show up, but I am worried what this is for and what kind of information is stored there and I fear also mixing up several releases of texlive. Updates: I found some rest of my old linux distributions installation of texlive. That explains the presence of ~/.texlive/ without year.
- Formatting a sequence of items with comma and ending with 'and' or 'respectively'by mf67 on February 23, 2026 at 10:02 pm
Can someone help me create a macro like \MyList{A;B;C;D;E;F} which returns “A, B, C, D, E[,] respectively F" independently on how many ”arguments” (2+) that are specified and also support math, e.g. \MyList{\(A\);\(B\);\(C\);\(D\);\(E\);\(F\)} ? (I used the [,] notation since I’m not sure if the Oxford comma is used today.) If the number of arguments is two; \MyList{A;B} I would like it to return “A respectively B”. Edit: I tried using sinuitx but it might not be suitable for this task as it mainly(?) handles numbers. Here is a test \documentclass{article} \usepackage{siunitx} \begin{document} \numlist[parse-numbers=false]{A;2;3} \numlist[parse-numbers=false]{\text{A};2;3} \numlist[parse-numbers=false]{\(A+B\);2;3} \end{document} but it gives an error on the last line and I would like to have ”roman letters” if no ”math mode” is used, and avoid using \text{}.
- Is there a resource that goes through (La)TeX fonts, gives them a pairing, and a description?by Barnabas on February 23, 2026 at 8:52 pm
Is there a resource that goes through (La)TeX fonts, gives them a pairing, and a description? I asking, which fonts like serif for body text, and sans serif for headers and stuff complement each other; and fonts good for long reading like a book? To be clear: it would pair Serif fonts with Sans Serif fonts, specifically ones that are shipped with TeX Live and MiKTeX. I think this would be very handy for everybody, especially people who do not know which fonts to use for the headings and which ones for their body text. With type families that have matching faces (Serif, Sans Serif, Monospaced,etc) is easy, e.g., Latin Modern, Kp-Fonts, etc. The amount of pairings is just baffling, and you searched the web for TeX font pairings and came up with nothing. 🙂 Hopefully, this question doesn't violate any rules, and I don't think I need a MWE?
- tabular: add lines until the end of the text body is reachedby cis on February 23, 2026 at 12:56 pm
Can I configure this loop, or a similar loop, to add rows until the end of the text body is reached? A small gap at the end will probably be unavoidable. Could this be achieved with \pdfpos? \documentclass[a5paper]{article} \usepackage[margin=14mm, showframe=true, paperheight=126mm, ]{geometry} \newcounter{mycount} \setcounter{mycount}{0} \def\mylines{}% \loop\ifnum\themycount<7% \addtocounter{mycount}{1} \expandafter\def\expandafter\mylines\expandafter{% \mylines & & \themycount \\ }% \repeat% \begin{document} \section{Table} \begin{tabular}{| c c | c|} \hline \multicolumn{3}{|c|}{Something} \\ \hline A & B & (My Head) \\ \hline a & b & n\\ a & b & n\\ a & b & n\\ \mylines \hline A & B & (My Foot)\\ \hline \end{tabular} \end{document}
- How to draw arc segments of circular quiver diagram elegant with tikz?by Explorer on February 23, 2026 at 9:23 am
Claim This post is more likely asking for better approach, focused on the arc's plot. And that is similar to, but I don't find the same one: Drawing cyclic quiver Drawing a circular graph using xypic https://tex.stackexchange.com/a/759710/322482 Descrption I found that just with: \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; The arc is not exactly centered at (0,0)(the violet part), thus I learnt from here and calculate the \deltaangg with cosline rule manually. Code \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \def\NN{5} \def\RR{5} \def\rr{0.5} \def\deltaang{\fpeval{360/\NN}} \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}} % cosine rule \begin{tikzpicture}[ thick,>=Stealth,shortstyle/.style={shorten >=\rr cm,shorten <=\rr cm}] \foreach \i in {1,...,\NN}{ \def\ang{\fpeval{\deltaang*(\i-1)}} \path[draw,fill=gray!75] (\ang:\RR cm) circle[radius=\rr cm]; \def\startang{\fpeval{\ang+\deltaangg}} \def\endang{\fpeval{\ang+\deltaang-\deltaangg}} %%%%%%%%%%%%%% \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; %%%%%%%%%%%%%% % https://tex.stackexchange.com/a/66265/322482 \draw[<->,magenta] ([{shift=(\startang:\RR cm)}]0,0) arc[radius=\RR cm,start angle=\startang,end angle=\endang]; \foreach[parse=true] \j in {2,...,{\NN-2}}{ \def\nextang{\fpeval{\ang+\deltaang*\j}} \draw[shortstyle,<->] (\ang:\RR cm) -- (\nextang:\RR cm); } } \end{tikzpicture} \end{document} Question The magenta arcs is what I want, but I found it too hard to calculate \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}}. Any suggestions on the code?
- verse environment that checks if the verse is numbered and has a titleby user1850133 on February 22, 2026 at 5:11 pm
I need a verse environment that for each verse, checks if there is a heading line and a number at the end and puts them with a special formatting if it finds. Of course not forgetting to dump that verse too. And if the verse does not have either the header or the number or both, skip this task. In the past I once asked for a verse environment that automatically numbers the verses. (Environment honouring newlines and add stuff before empty lines). I want that your solution is based on that one there that i validated. Don't use fontsize as it is creating a problem (though subtle). Here a header is starting with > and takes the entire line as the header. This header must be put bold in the document. The number at the end of the verse is always the last character in its line and preceded by "||" and any white-spaces. Latex must dump the verse up to the "||" and" puts the number this way 1 || 2 || 3 || after the verse's "||". \documentclass[a4paper]{article} \usepackage{fancyhdr} \setlength{\parindent}{0pt} \fancyhead[C]{lipsum text (dummy text)} \begin{document} lipsum text \\ (dummy text) \begin{myenv} Laborum molestias nam possimus omnis. Libero sit maiores quas asperiores nobis est nulla. Culpa sequi iste deserunt. ||1 Adipisci fuga et quis dicta est et odit. Illo aut nulla qui incidunt necessitatibus nulla qui. Sunt cumque voluptatem quasi quam ||2 >the peacock says ... % this is the "heading line" commodi culpa quaerat sunt. Debitis accusantium et porro et libero nulla ut est. Asperiores sed exercitationem aut. Ex sapiente ||3 >the elephant says Debitis nobis fugiat doloremque voluptates enim ratione. Unde || % not numbered, this one magni beatae magni. Unde voluptatum qui odio corporis quia. ||4 \end{myenv} \end{document} EDIT: I need one more layer of subdivision. This time the whole input text is made of a number of parts. Each part is starting with character > and the first line of the part must be underlined and centered. Then what was started with a > is now >>. The input text is this one, now: lipsum text \\ (dummy text) \begin{myenv} >part one Laborum molestias nam possimus omnis. Libero sit maiores quas asperiores nobis est nulla. Culpa sequi iste deserunt. ||1 Adipisci fuga et quis dicta est et odit. Illo aut nulla qui incidunt necessitatibus nulla qui. Sunt cumque voluptatem quasi quam ||2 >part two >>the peacock says ... % this is the "heading line" commodi culpa quaerat sunt. Debitis accusantium et porro et libero nulla ut est. Asperiores sed exercitationem aut. Ex sapiente ||3 >>the elephant says Debitis nobis fugiat doloremque voluptates enim ratione. Unde || % not numbered, this one magni beatae magni. Unde voluptatum qui odio corporis quia. ||4
- Image with multiple white boxes and text/lettersby palloc on February 22, 2026 at 4:56 pm
I have found the following question: Extend custom \IMG macro: add percentage-based overlay label (white box + letter) at (x%, y%) with separate scale I want exactly the same, but with more options: Multiple text boxes, so having two different text boxes should be feasible Multi-line support, so not just single-line, e.g., A\\B should work I also want to use \keys_define Previous question: I have a basic macro that inserts a figure with \includegraphics, caption, and label: \documentclass{report} \usepackage{graphicx} \usepackage{float} \newcommand{\IMG}[4]{ \begin{figure}[H] \centering \includegraphics[scale=#1]{#2} \caption{#3} \label{fig:#4} \end{figure} } \begin{document} \IMG{0.5}{example-image}{Caption}{figA} \IMG{0.6}{example-image}{Caption}{figB} \end{document} I want to extend it so I can overlay a letter inside a white square with a black border on top of the image, with the position given in percentages of the image size, and with a separate scale that affects only the overlay (box + letter), not the image. Desired call syntax: \IMG{imgscale}{filename}{caption}{label}{y}{x}{letter}{overlayscale} Where: imgscale is passed to \includegraphics[scale=...] (scales the image) y and x are relative coordinates inside the image (fractions / percentages of the image size): (y=0, x=0) corresponds to the top-left corner of the image y increases downward (south) x increases to the right (east) e.g. y=0.10 means 10% from the top, x=0.05 means 5% from the left letter is something like A, B, etc. (only one letter) overlayscale scales only the overlay (white square + letter), not the image the letter should be centered inside the square Example usage I want: \IMG{0.5}{example-image}{Caption}{figA}{0.10}{0.05}{A}{1.2} This should place a small white square (black border) near the top-left, at 5% from the left and 10% from the top, and put the letter A inside it. I’m open to tikz, overpic, etc., as long as the coordinates are relative to the image (not the page). Ideally the overlay moves correctly when the image scale changes. It should look like this: Maybe the best answer: \documentclass{report} \usepackage{graphicx} \usepackage{float} \usepackage{color} \newcommand{\IMG}[7]{% don't forget % at EOL \begin{figure}[H] \centering \sbox0{\includegraphics[scale=#1]{#2}}% \usebox{0}% \rlap{\hspace{-#5\wd0}{\raisebox{#6\ht0}{\llap{\fcolorbox{black}{white}{#7}}}}}% \caption{#3} \label{fig:#4} \end{figure}% } \begin{document} \IMG{0.5}{example-image}{Caption}{figA}{.1}{.2}{A} \IMG{0.6}{example-image}{Caption}{figB}{.3}{.3}{B} \end{document} just measures the scaled image, then uses \hspace and \raisebox to move the box.
- What is the best way to draw a potato (like found in vector analysis/continuum mechanics courses)by Dimitrios ANAGNOSTOU on February 21, 2026 at 11:34 pm
I apologized if this is a duplicate. What is the best way to draw such figures with tikz (or other packages)? For the time being just the potato like figure. I do not care for the vectors and the infinitesimal mass element. I do not want someone to do the work for me. Just some advice or suggestions.