Hot
- 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.
- 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.
- 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}
- Controlling Subsection Visibility in LaTeX Table of Contentsby Aimar on February 23, 2026 at 10:43 am
I am using the amsart document class in LaTeX. I would like the table of contents to display all sections while including only a single, specific subsection. All other subsections should remain numbered and visible in the document, but should not appear in the table of contents. \documentclass{amsart} \usepackage{hyperref} \begin{document} \title{title} \author{Author Name} \maketitle \tableofcontents \section{First Section} \subsection*{This subsection should NOT appear in the TOC} \subsection{This subsection SHOULD appear in the TOC} \section{Second Section} \subsection*{Another subsection NOT in the TOC} \end{document}
- wrong citation formatby Faith on February 23, 2026 at 9:48 am
My problem ist that when I try to cite e.g. \textcite{zotero-item-155} it appears as "AG Boden, (2024)" in the text instead of "AG Boden (2024)". And When I do (\cite{BlumeLehrbuchBodenkunde10}) it appears as "(Blume et al. 2010)" instead of "(Blume et al., 2010)". When I do \parencite{liuLandUseDependent2018} it also appears as "(Liu et al. 2018)" in the text. My preamble looks like this: \documentclass[a4paper,12pt]{article} \usepackage[backend=biber, style=apa]{biblatex} %\addbibresource{Literatur.bib} % not available \addbibresource{biblatex-examples.bib} % \usepackage{anyfontsize} % \usepackage{makecell} % \usepackage{setspace} % \fontsize{13pt}{19.5pt}\selectfont % \onehalfspacing % \usepackage{booktabs} % \usepackage{xcolor} % \usepackage{csquotes} % \usepackage{circuitikz} % \usepackage{ragged2e} % \usepackage[most]{tcolorbox} \usepackage[ngerman]{babel} % \usepackage{mathptmx} \usepackage[T1]{fontenc} % \usepackage{graphicx} %\usepackage{amsfonts} %\usepackage{amssymb} % \usepackage{caption} % \usepackage{placeins} % \usepackage{subcaption} % \usepackage{float} % \usepackage{amsmath} % \captionsetup[table]{justification=raggedright, singlelinecheck=false} % \captionsetup[figure]{labelformat=mylabel, format=plain, singlelinecheck=false, justification=raggedright} % \usepackage{tocloft} % \setlength{\bibitemsep}{1.5\baselineskip} % \usepackage{hyperref} % \hypersetup{ % colorlinks=false, % pdfborder={0 0 0} % } % \usepackage[a4paper, left=3cm, right=3cm, top=2cm, bottom=2cm]{geometry} \DefineBibliographyStrings{ngerman}{% andothers = {et al.}, } % \renewcommand\thefigure{\arabic{figure}} % \DeclareCaptionLabelFormat{mylabel}{Abbildung #2} \DeclareDelimFormat*{nameyeardelim}{\addcomma\space} \DeclareDelimFormat[bib]{andothersdelim}{\addcomma\space} \DeclareLanguageMapping{ngerman}{ngerman-apa} \begin{document} Textcite one author: \textcite{glashow} Regular cite more authors: \cite{yoon} Parencite more authors: \parencite{herrmann} \printbibliography \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?
- Setting pages of an index entry with an specific fontby Knudsen on February 23, 2026 at 6:24 am
I have always used \documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman} \newfontfamily\semibold[Ligatures={TeX, Common}]{Times LT Std Semibold} \usepackage{imakeidx} \makeindex[program=texindy, options=-L english -C utf8, title=Index] \begin{document} Some text\index{Important Topic|textbf}. Some text\index{Not Important Topic}. \printindex \end{document} to be processed with xelatex -shell-escape main.tex, which sets the page of the entry in boldface using the standard font used by \textbf{}. How can I set the page in a particular (semibold) font? Or, for that matter, any other font?
- Text above horizontal arrow in longtblr / tblr with minimal vertical spacingby GJW on February 23, 2026 at 12:40 am
I would like text to be above a horizontal arrow in longtblr, with the following constraints longtblr package Define start and stop points of arrow relative to column borders - i.e. enable the table is dynamic if width of columns change Minimal space between arrow bar and the text Text in column A centred between rows 2 and 3 A screen grab of the desired outcome is attached. Here is a minimal example illustrating what I currently have: \documentclass{article} \usepackage{tabularray} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{longtblr}{ colspec={|c|c|c|}, vlines, hlines, row{3} = {ht=0pt}, % arrow row height } % --- First row --- A & B & C \\ % --- SECOND row: merge columns 2 and 3 --- 1 & \SetCell{c=2} 2 & \\ % --- Arrow row (thin) --- & \SetCell{cmd=\tikz[remember picture]\node (Bstart) {};} & \SetCell{cmd=\tikz[remember picture]\node (Cend) {};} \\ \end{longtblr} % --- Draw the arrow --- \begin{tikzpicture}[overlay, remember picture] \draw[red, thick, <->] ($(Bstart.west)+(-\pgflinewidth/2,0)$) -- ($(Cend.east)+(\pgflinewidth/2,0)$); \end{tikzpicture} \end{document}
- Vsplit : Why loses vsplit the eveness of columns? And what can Ido about it? New attempt [closed]by MBE on February 23, 2026 at 12:06 am
If you can get your eyes of it... Here, the problem is forced... please do not offer, not to force it:-) %\raggedright \parindent=0pt \font\normalfont=cmr9 \font\sectionfont=cmr18 \font\boldfont=cmb10 \normalfont \def\section#1{\sectionfont #1\normalfont} \setbox20=\vtop{ \hbox{}\parskip=0pt \hsize=0.5\hsize Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, mag na. Do nec vehicula augue eu neque. Pellentesque habitant Lorem ipsum dolor sit amet, consectetuer adipiscing el it. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant. morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing e lit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Don ec vehicula augue eu neque. Pellentesque habitant Lorem ipsum dolor sit amet, consectetuer adipiscing eli t. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \section{Curabitur dictum} gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant Lorem \section{Curabitur dictum} ipsum dolor sit amet, consectetue. \section{Curabitur dictum}r adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, {\boldfont nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant} {\section{HEADLINE}} morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, {\boldfont adipiscing vitae, felis adipiscing vitae, felis. Curabitur dictum} gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant {\boldfont adipiscing vitae, felis. Curabitur dictum} Lorem ipsum dolor sit amet, consectetuer adipiscing{\boldfont adipiscing vitae, felis. Curabitur dictum} elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.} \setbox21=\vsplit20 to 20\baselineskip{}\vskip\baselineskip % \setbox22=\vsplit20 to 20\baselineskip{}\vskip\baselineskip % morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, {\boldfont adipiscing vitae, felis adipiscing vitae, felis. Curabitur dictum} \vskip3\baselineskip \hbox{\copy21\hskip20pt \copy22} \vskip3\baselineskip morbi tristique senectus et netus et malesuada fames ac turpis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, {\boldfont adipiscing vitae, felis adipiscing vitae, felis. Curabitur dictum} \vskip3\baselineskip \newdimen\testA \testA=\ht21 \advance\testA by \dp21 \newdimen\testB \testB=\ht22 \advance\testB by \dp22 \the\testA - \the\testB = \advance\testB by - \testA \the\testB \bye
- Wrong links in \hyperrefby Alex Degtyarev on February 22, 2026 at 9:01 pm
Sorry everyone. I just did an update, which was probably a mistake, and encountered another problem with hyperref. For years I've been using a workaround which I borrowed from a journal, and it worked. Well, I understand that this is an undocumented feature, but there seems (seemed?) to be no other way to have everything numbered consecutively. Here's a minimal example: \documentclass{amsart} \usepackage{hyperref} \newtheorem{theorem}{Theorem}[section] \makeatletter \let\c@equation\c@theorem \let\theequation\thetheorem \makeatother \begin{document} \section{1} \begin{equation} a=b\label{1} \end{equation} \newpage \section{2} \begin{equation} c=d\label{2} \end{equation} \newpage \eqref1 \eqref2 \end{document} Both links lead to eqn. 1.1, and the log reports multiple anchors with the same name. What would the new hack be? Or is there a documented way now to have all theorems, lemmas, ... and equations numbered consecutively within sections and, at the same time, have \autoref work correctly?
- Multiple images stacked with a single caption, no extra vertical spaceby palloc on February 22, 2026 at 7:53 pm
I'm trying to create a LaTeX document where I have several images stacked vertically, with no extra vertical space between them, and only one caption for all images (appearing under the last image). The problem is that each \IMG creates a separate figure, so each image gets its own caption and there’s extra vertical space between images. What I want: Multiple images stacked vertically with no extra vertical space. Only one caption for all images (appearing under the last one). Allow overlays on the images (x, y, text). This is how it should look like: The code what I got from taiwan12 with little modification (link: https://tex.stackexchange.com/a/760076/287423) : \documentclass{report} \usepackage{graphicx} \usepackage{float} \usepackage{xcolor} \usepackage{xparse} \ExplSyntaxOn % variables \tl_new:N \l_taiwanxii_image_tl \tl_new:N \l_taiwanxii_caption_tl \tl_new:N \l_taiwanxii_shortcaption_tl \tl_new:N \l_taiwanxii_label_tl \tl_new:N \l_taiwanxii_pos_tl \fp_new:N \l_taiwanxii_scale_fp \fp_new:N \l_taiwanxii_overlayscale_fp \clist_new:N \l_taiwanxii_x_clist \clist_new:N \l_taiwanxii_y_clist \clist_new:N \l_taiwanxii_text_clist % keys \keys_define:nn { taiwanxii } { image .tl_set:N = \l_taiwanxii_image_tl, caption .tl_set:N = \l_taiwanxii_caption_tl, shortcaption .tl_set:N = \l_taiwanxii_shortcaption_tl, label .tl_set:N = \l_taiwanxii_label_tl, pos .tl_set:N = \l_taiwanxii_pos_tl, scale .fp_set:N = \l_taiwanxii_scale_fp, overlayscale .fp_set:N = \l_taiwanxii_overlayscale_fp, x .clist_set:N = \l_taiwanxii_x_clist, y .clist_set:N = \l_taiwanxii_y_clist, text .clist_set:N = \l_taiwanxii_text_clist, } \NewDocumentCommand{\IMG}{m} { % reset \tl_clear:N \l_taiwanxii_image_tl \tl_clear:N \l_taiwanxii_caption_tl \tl_clear:N \l_taiwanxii_shortcaption_tl \tl_clear:N \l_taiwanxii_label_tl \tl_clear:N \l_taiwanxii_pos_tl \tl_clear:N \l_taiwanxii_pos_tl \clist_clear:N \l_taiwanxii_x_clist \clist_clear:N \l_taiwanxii_y_clist \clist_clear:N \l_taiwanxii_text_clist \tl_set:Nn \l_taiwanxii_pos_tl {H} \fp_set:Nn \l_taiwanxii_scale_fp {1} \fp_set:Nn \l_taiwanxii_overlayscale_fp {1} \keys_set:nn { taiwanxii } { #1 } % shortcaption \tl_if_empty:NT \l_taiwanxii_shortcaption_tl { \tl_set_eq:NN \l_taiwanxii_shortcaption_tl \l_taiwanxii_caption_tl } \use:e { \exp_not:N \begin{figure}[\l_taiwanxii_pos_tl] } \centering \sbox0{\includegraphics[scale=\fp_use:N \l_taiwanxii_scale_fp]{\l_taiwanxii_image_tl}} \usebox0 \int_zero:N \l_tmpa_int \clist_map_inline:Nn \l_taiwanxii_x_clist { \int_incr:N \l_tmpa_int \tl_set:Nn \l_tmpa_tl {##1} \tl_set:Nx \l_tmpb_tl { \clist_item:Nn \l_taiwanxii_y_clist { \int_use:N \l_tmpa_int } } \tl_set:Nx \l_tmpc_tl { \clist_item:Nn \l_taiwanxii_text_clist { \int_use:N \l_tmpa_int } } \rlap{ \hspace{\dimexpr \l_tmpa_tl\wd0-\wd0\relax} \raisebox{\dimexpr \ht0-\l_tmpb_tl\ht0\relax}{ \makebox[0pt][l]{ \raisebox{-\height}{ \scalebox{\fp_use:N \l_taiwanxii_overlayscale_fp}{ \fcolorbox{black}{white}{ \shortstack[c]{\l_tmpc_tl} } } } } } } } \caption[\l_taiwanxii_shortcaption_tl]{\l_taiwanxii_caption_tl} \label{fig:\l_taiwanxii_label_tl} \end{figure} } \ExplSyntaxOff \begin{document} \listoffigures \IMG{ image = example-image, caption = Caption I, shortcaption = Caption, label = figA, pos = H, scale = 0.6, x = {0.0,0.5,0.2,0.7,0.8}, y = {0.0,0.2,0.3,0.65,0.9}, text = {AA\\BB,AABB,A,B,C}, overlayscale = 0.75, } \IMG{ image = example-image, caption = Caption II, shortcaption = Caption, label = figB, pos = H, scale = 0.6, x = {0.2,0.5}, y = {0.2,0.3}, text = {AABB,A}, overlayscale = 1, } \end{document}
- 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.
- Restricting the area in which text is typeset, for lettersby Stefan Müller on February 21, 2026 at 4:07 pm
I want to write a letter template. The code below works but has the disadvantage that one has to state how many lines a paragraph has, so that it does not spill over into the margin where the details about the university are. This is done by \pshape. The second page is supposed to use all the available space. So no \pshape is necessary here. I think there is a conceptual mistake in this code. LaTeX should know about the region it can use. Is there a way to do this with paper size or something so that \pshapeis not necessary any longer? \documentclass[% a4paper, foldmarks=true, foldmarks=blmTP, fromlogo=true, locfield=wide, refline=nodate, firstfoot=false, pagenumber=headright ]{scrlttr2} \setlength{\textwidth}{160mm}% \addtolength{\textheight}{5\baselineskip} \addtoplength{toaddrvpos}{-16mm} \setplength{refvpos}{9,5cm} %\addtoplength{refhpos}{15mm} \setplength{locvpos}{50mm} \setplength{locwidth}{50mm} %\setplength{refhpos}{6mm} % it doesn't work for left margin \setplength{lochpos}{4mm} % right margin \setplength{locheight}{22,2cm} \usepackage{libertine} % XeLaTeX + libertine + MnSymbol (math symbols) create problems \renewcommand\ttdefault{lmtt} % change typewriter font to lmodern (smaller than tt in libertine)mtt} \usepackage{lipsum} %%%%%%%%%%%%%%%%%%%%%%% %%% Author's Metadata \newcommand*\sender{Stefan Müller} % sender's name \newcommand*\degree{Prof. Dr.} % sender's degree \newcommand*\authortitle{\degree\ \sender } % sender: degree + name \newcommand*\mail{St.Mueller@hu-berlin.de} % sender's e-mail \newcommand*\website{https://hpsg.hu-berlin.de/\~{}stefan/} % sender's website \newcommand*\officehour{Montag, 14:00–15:00} % office hours \newcommand*\telf{$+$49\,30\,2093-9631} \newcommand*\addressee{Prüfungsbüro\\ -- im Hause --} \def\pshape#1{% \parshape #1 \pshapexiicm{#1} 0pt 16cm } \def\pshapexiicm#1{% \ifnum#1>1 0pt 12,5cm \expandafter \pshapexiicm\expandafter{\the\numexpr#1-1\expandafter\relax\expandafter}\fi} \setkomavar{location}{\begin{tabular}[t]{l@{}} % Faculty {\footnotesize \textbf{Sprach- und}}\\[-1mm] {\footnotesize \textbf{literaturwissenschaftliche}}\\[-1mm] {\footnotesize \textbf{Fakultät}}\\[3mm] % Institute {\footnotesize Institut für deutsche Sprache}\\[-1mm] {\footnotesize und Linguistik}\\[3mm] {\scriptsize Sprachwissenschaft des Deutschen,}\\[-1mm] % Area {\scriptsize Syntax}\\[3mm] % Author {\scriptsize \textbf{\authortitle}}\\[-1mm] {\scriptsize \mail }\\[-1mm] {\scriptsize \website }\\[8mm] % Date {\scriptsize \textbf{Datum:}}\\[-1mm] {\scriptsize \usekomavar{date}}\\[37mm] % Address post {\scriptsize \textbf{Postanschrift:}}\\[-1mm] {\scriptsize Humboldt-Universität zu Berlin }\\[-1mm] {\scriptsize Unter den Linden 6 }\\[-1mm] {\scriptsize 10099 Berlin }\\[-1mm] {\scriptsize Telefon 030 54321 }\\[20mm] % Address office {\scriptsize \textbf{Sitz:}}\\[-1mm] {\scriptsize Seminargebäude am Hegelplatz }\\[-1mm] {\scriptsize hegelplatz 1 }\\[-1mm] {\scriptsize 1115 Berlin }\\[-1mm] {\scriptsize Raum R1411}\\[44,5mm] % Consultation hours {\scriptsize \textbf{Sprechzeiten:}}\\[-1mm] {\scriptsize Mo: 23:00--23:15}\\[-1mm] %% Bank account % {\scriptsize \textbf{Bankverbindung:}}\\[-1mm] % {\scriptsize Deutsche Bank PGK AG}\\[-1mm] % {\scriptsize BIC/SWIFT: DEUTDED110}\\[-1mm] % {\scriptsize IBAN: DE 95 1007 0848 0512 620601} \end{tabular} } \begin{document} \begin{letter}{ %% ADDRESS (see texfiles/localmetadata for the commands) \tiny{ HU | Sprach- und literaturwissenschaftliche Fakultät,\\ Institut für deutsche Sprache und Linguistik | 10099 Berlin}% % \\ \vspace{1cm} % %%ADDRESSEE (specify above) \footnotesize{ \addressee} } \setkomavar{subject}{Some subject/Betreff} %% OPENING \opening{Sehr geehrte Damen und Herren,} %\opening{To whom it may concern,} %% CONTENT OF LETTER \pshape{24} \lipsum[1] \pshape{18} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. \closing{Best wishes} \end{letter} \end{document}