Week
- How to recursively import .tex files in LaTeX with correct hierarchical ordering?by leonardo cesar on January 25, 2026 at 4:11 pm
I'm working on large LaTeX projects with structured directories containing numbered files: project/ ├── 01-introduction.tex ├── 02-background.tex ├── 03-methodology/ │ ├── 01-experimental.tex │ ├── 02-analysis.tex │ └── 03-validation.tex ├── 04-results/ │ ├── 01-figures.tex │ └── 02-tables.tex └── 05-conclusion.tex Currently, I manually write \import{} commands: \import{project/01-introduction} \import{project/02-background} \import{project/03-methodology/01-experimental} \import{project/03-methodology/02-analysis} \import{project/03-methodology/03-validation} \import{project/04-results/01-figures} \import{project/04-results/02-tables} \import{project/05-conclusion} This approach is: Verbose - requires li sting every file Error-prone - easy to miss files or get order wrong Hard to maintain - adding new files requires manual updates Question: What's the most robust way to automate .tex file imports while ensuring correct hierarchical and numerical ordering? Ideally, I'd like a solution that works with a simple command like: \importAll{path=./project/, recursive=true}
- Where does this 1pt extra space between paragraphs come from, and how to configure it?by H. Weirauch on January 25, 2026 at 2:09 pm
In the MWE \documentclass{article} \usepackage{lua-visual-debug} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \begin{document} \rule{6mm}{6mm} \rule{7mm}{6mm} \end{document} the code contains an empty line (= new paragraph) between the two \rules. This is what it looks like in the output: Between the paragraphs, some vertical spacing is inserted. As far as I can tell, it is exactly 1pt. Where does this come from, and how am I supposed to modify it? This space does not occur when using minimal document class; it apparently is limited to article (or other high-level classes like KOMA).
- How can I tag an l3pdftextfield?by cfr on January 25, 2026 at 6:53 am
I'm trying to create a text field in a tagged PDF. My real document uses ltx-talk, which complicates things slightly, but the MWE below uses article. I mention ltx-talk in case somebody has a solution which would work for article, but not for ltx-talk, so that I do not waste people's time. \DocumentMetadata{% lang=en-GB, tagging=on, pdfversion=2.0, pdfstandard=UA-2, } \documentclass{article} \usepackage{bookmark} \usepackage{l3pdffield} \title{Tools} \ExplSyntaxOn \cs_new_eq:NN \textfield \pdffield_textfield:n \ExplSyntaxOff \begin{document} \Form \textfield { name=fieldA, width=50mm, height=12pt, depth=50pt, setfieldflags=Multiline, altname=a, } \end{document} I'm having some difficulty understanding how much I'm supposed to do here and how much I'm supposed to let happen. tagpdf.pdf suggests that form fields created with l3pdffield should be automatically added to the structure. I think this indeed happens1: <PDF> <StructTreeRoot> <Document xmlns="http://iso.org/pdf2/ssn" id="ID.02" > <text-unit xmlns="https://www.latex-project.org/ns/dflt" id="ID.05" rolemaps-to="Part" > <text xmlns="https://www.latex-project.org/ns/dflt" id="ID.06" xmlns:Layout="http://iso.org/pdf/ssn/Layout" Layout:TextAlign="Justify" rolemaps-to="P" > <Form xmlns="http://iso.org/pdf2/ssn" id="ID.07" > <?ReferencedObject type="Annot" page="1" ?> </Form> </text> </text-unit> </Document> </StructTreeRoot> </PDF> What I'm not sure about is how to configure a Contents entry for the field - or maybe where I am supposed to put altname, which is presumably in the wrong place at the moment? The document compiles without errors with either LuaLaTeX or pdfLaTeX. However, the PDF fails to validate against UA-22,3. verapdf says <?xml version="1.0" encoding="utf-8"?> <report> <buildInformation> <releaseDetails id="core" version="1.28.2" buildDate="2025-07-15T16:07:00+01:00"></releaseD etails> <releaseDetails id="validation-model" version="1.28.2" buildDate="2025-07-15T16:12:00+01:00 "></releaseDetails> <releaseDetails id="gui" version="1.28.2" buildDate="2025-07-15T16:59:00+01:00"></releaseDe tails> </buildInformation> <jobs> <job> <item size="23750"> <name>/path/to/test-file.pdf</name> </item> <validationReport jobEndStatus="normal" profileName="PDF/UA-2 + Tagged PDF validation pro file" statement="PDF file is not compliant with Validation Profile requirements." isCompliant=" false"> <details passedRules="1722" failedRules="1" passedChecks="175" failedChecks="1"> <rule specification="ISO 14289-2:2024" clause="8.10.2.3" testNumber="1" status="faile d" failedChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Accessibility validation p rofile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant ="false"> <details passedRules="1718" failedRules="1" passedChecks="171" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <validationReport jobEndStatus="normal" profileName="WTPDF 1.0 Reuse validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false" > <details passedRules="1705" failedRules="1" passedChecks="169" failedChecks="1"> <rule specification="WTPDF1.0" clause="8.10.2.3" testNumber="1" status="failed" faile dChecks="1" tags="annotation,alt-text"> <description>If a label for a widget annotation is not present, a Contents entry sh all be provided to supply description and context for the widget</description> <object>PDWidgetAnnot</object> <test>containsLbl == true || Contents != null</test> <check status="failed"> <context>root/document[0]/pages[0](21 0 obj PDPage)/annots[0](37 0 obj PDWidgetAn not)</context> <errorMessage>Widget annotation contains neither label nor Contents entry</errorM essage> </check> </rule> </details> </validationReport> <duration start="1769321531153" finish="1769321531866">00:00:00.713</duration> </job> </jobs> <batchSummary totalJobs="1" failedToParse="0" encrypted="0" outOfMemory="0" veraExceptions="0 "> <validationReports compliant="0" nonCompliant="1" failedJobs="0">1</validationReports> <featureReports failedJobs="0">0</featureReports> <repairReports failedJobs="0">0</repairReports> <duration start="1769321531030" finish="1769321531917">00:00:00.887</duration> </batchSummary> </report> From what I gathered from the PDF spec, I want to add a Contents here, because a label would correspond to a visible label in the PDF, which does not exist. 1 However, some parts of the documentation for l3pdfmanagement suggest that perhaps only link annotations, as opposed to widget annotations, are currently handled fully automatically by the tagging code. So I'm not sure that I do not need to do something additional here, but the problem does not seem to be adding the widget to the structure? 2 In fact, the text field here is not supposed to make sense on its own. It is only meant to make sense when I am standing there talking. It's just a place for me to type. Its purpose will make sense by the end of class, because it will then have content. 3 So marking the field up for accessibility is actually a bit strange. It isn't 'accessible' to sighted readers either in advance of the relevant class.
- Vertical centering in table cellsby bubba on January 25, 2026 at 6:35 am
I'm trying to typeset the following table. I'm having trouble with the vertical centering of each cell's contents, plus the obvious horizontal alignments. ChatGPT's numerous attempts were all hopelessly wrong, and I eventually created the image below in Powerpoint, which (sadly) might have to be my solution, if all else fails.
- Rounding errors printing fractions with \pgfmathprintnumberby pwesterbaan on January 25, 2026 at 12:53 am
I'm trying to use pgfmath to help with randomizing exam questions that I give my students. One of the hurdles I've come across is printing fractions correctly. I've defined the following command: \newcommand{\printFrac}[2]{ \pgfmathprintnumber[frac, frac whole=false, frac shift=1, precision=8]{\fpeval{#1/#2}} } While debugging, I've found that this fails with fractions like "10/41" and "16/9": \[10/41: \printFrac{10}{41}\qquad 16/9: \printFrac{16}{9}\] I read about and tried the pgfmath-xfp package, but the error still persists: \pgfmxfpdeclarefunction{myfrac}{2}{#1/#2} \newcommand{\printFrac}[2]{ \pgfmathparse{myfrac(#1,#2)} \pgfmathprintnumber[frac, frac whole=false, frac shift=1, precision=8]{\pgfmathresult} } Is there something obvious I'm missing? Should I be using another method to print out randomly generated fractions? EDIT: As pointed out in the comments, I did not originally include a complete MWE. In this example, I generate two random non-zero integers, reduce them using the GCD, then try and print the resulting fractions. In this particular run (using a random seed), \printFrac{8}{15} prints correctly, but \printFrac{-15}{8} prints incorrectly. This does not happen everytime, but it happens fairly frequently: \documentclass{exam} \usepackage{tikz} \usetikzlibrary{math} \newcommand{\defVar}[2]{% \pgfmathparse{#2}% \pgfmathsetmacro{#1}{\pgfmathresult}% } \newcommand{\randIntLower}{2} %Lower bound on rand ints \newcommand{\randIntUpper}{10} %Upper bound on rand ints \newcommand{\randIntTemp}{} %Used for defining values in randInts \newcommand{\randInts}[2][]{% % #1 = option (default: []; Use nz for nonzero) % #2 = list of variables % Uses \randIntLower and \randIntUpper as bounds (change with renewcommand if needed) \foreach \var in {#2}{% \ifstrequal{#1}{nz}{% % nonzero method: produces +/- nonzero random integers on [-\randIntUpper,-\randIntLower]\cup[\randIntLower,\randIntUpper] \pgfmathparse{int(ifthenelse(rand > 0, 1, -1)*random(\randIntLower,\randIntUpper))}% \expandafter\xdef\var{\pgfmathresult}% }{% % random integer on [\randIntLower,\randIntUpper] \pgfmathrandominteger{\randIntTemp}{\randIntLower}{\randIntUpper}% \expandafter\xdef\var{\randIntTemp}% }% }% } \newcommand{\computeGcd}[3]{% % #1 = result macro % #2 = first number % #3 = second number % Uses Euclidean algorithm \pgfmathparse{int(abs(#2))}% \pgfmathsetmacro{\gcdA}{int(\pgfmathresult)}% \pgfmathparse{int(abs(#3))}% \pgfmathsetmacro{\gcdB}{int(\pgfmathresult)}% \loop\ifnum\gcdB>0\relax% \pgfmathparse{int(mod(\gcdA, \gcdB))}% \pgfmathsetmacro{\gcdTemp}{int(\pgfmathresult)}% \pgfmathsetmacro{\gcdA}{\gcdB}% \pgfmathsetmacro{\gcdB}{\gcdTemp}% \repeat% \pgfmathsetmacro{#1}{\gcdA}% } \newcommand{\makeFrac}[2]{% \randInts[nz]{#1}% \pgfmathsetmacro{\randIntLower}{\fpeval{#1+abs(#1)/#1}}% \pgfmathsetmacro{\randIntUpper}{\fpeval{2*#1-abs(#1)/#1}}% \randInts[nz]{#2}% \computeGcd{\gcdValue}{#1}{#2}% \defVar{#1}{int(#1/\gcdValue)}% \defVar{#2}{int(#2/\gcdValue)}% } \newcommand{\printFrac}[2]{% \pgfmathprintnumber[frac, frac whole=false, frac shift=1, precision=8]{\fpeval{#1/#2}}% } \pgfmathsetseed{\number\pdfrandomseed} %\pdfrandomseed \begin{document} \makeFrac{\delY}{\delX} \[\pgfmathprintnumber{\delY}/\pgfmathprintnumber{\delX}\qquad m=\printFrac{\delY}{\delX}\qquad -\frac{1}{m}=\printFrac{-\delX}{\delY}\] \[\textnormal{Correct: }\qquad-2/3: \printFrac{-2}{3}\qquad 4/3: \printFrac{4}{3}\] \[\textnormal{Incorrect: }\qquad10/41: \printFrac{10}{41}\qquad 16/9: \printFrac{16}{9}\] \end{document} My end goal is to make my own sort of "portable toolbox" that I can include in different files when writing exams. To address @egreg's comment, I'm using "\printFrac" so that a randomly generated fraction such as -2/-3 is displayed as \frac{2}{3} and 2/-3 as -\frac{2}{3}.
- circuitikz: position and adjust current and voltage arrowsby cis on January 24, 2026 at 7:17 pm
I'm trying to recreate this image on 5mm grid paper using the original dimensions. It's not a big problem; I'm just looking for some fine-tunings inside the circuitikz-package. I've tested a few keys, but I'm wondering: What is the correct method: to add a longer voltage arrow that's a bit further away from the source? to add a current arrow at the shown position in a package-like way (regular TikZ is clear)? PS: I would also like to reduce the (global setting!) size of the arrowheads and the control points ("poles", I haven't quite understood chapter 6.1 yet); but that might be too much for one thread. MWE: [I've only set a small excerpt here to address the problems. I can easily add the rest later by myself.] \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[font=\footnotesize\sffamily, european resistors, circuitikz/resistors/width=0.425,% default 0.8 circuitikz/bipoles/generic/height=0.165,% default 0.3 circuitikz/bipoles/thickness=1.0, % default 2 circuitikz/bipoles/vsource/width=0.35, circuitikz/bipoles/vsource/height=0.35, %circuitikz/bipole/is voltage=false, %circuitikz/voltage/distance from node=5.0875,% old: 0.8 %circuitikz/voltage shift sources adjust=4.525,% default: 0.5 %voltage shift=0.125,% optional ] \draw[gray!25, step=5mm] (-1.5,0.5) grid (4,-4); \draw[] (0,-2) to[vsource, v<=12V, mirror] (0,0) -- (1.5,0); \draw[] (0.5,0) to[R=15, *-*] (0.5,-1) to[R, a=25, -*] (0.5,-2); \end{circuitikz} \end{document}
- Package draftmark conflicts with siunitxby user172294 on January 24, 2026 at 3:55 pm
I would like to use both packages draftmark and siunitx in the same document. When I do this I get the error ! Undefined control sequence. \@BTswitch ->{\CT@arc@ \hrule \@height \@thisrulewidth }\futurenonspacelet \... As soon as I comment out either \usepackage{siunitx} or \midrule, it works. Here is what I tried \documentclass[11pt,a4paper]{article} \usepackage{siunitx} \usepackage{booktabs,tabularx} \usepackage[draft]{draftmark} \begin{document} \begin{tabularx}{\textwidth}{ll} head1 & head2 \\ \midrule 123 & 456\\ 123 & 456\\ \end{tabularx} \end{document} Obiviously, there is no problem when I comment out \usepackage[draft]{draftmark} Can anyone help? Thanks.
- Help trying to customise toc with tagging supportby David Purton on January 24, 2026 at 12:25 pm
I'm trying to customise the TOC using built in commands to allow for tagging support, but I'm running in to some behaviour I can't figure out. In the following MWE, the I set \contentsline@text@2@format to \emph and the the line is formatted as expected. But if I set it to \MakeUppercase the label structure breaks (in this case notice the missing space after the subsection number). Am I doing this wrong? I'm struggling to trace the code through to find out why this happens. %! TeX Program = lualatex \DocumentMetadata{ lang=en, pdfstandard = ua-2, pdfstandard = a-4f, tagging=on } \documentclass{article} \ExplSyntaxOn \cs_set_nopar:cpn { contentsline@text@2@format } { \emph % Fails with \MakeUppercase } \ExplSyntaxOff \begin{document} \tableofcontents \subsection{A section heading} \end{document}
- A new kind of ligature, connected d/pby ivo Welch on January 24, 2026 at 3:58 am
I have been trying to coerce Claude to help me, but it is hilariously bad. I am trying to create a new character that looks like d <space> p, where the <space> becomes a connector. The font is charter, math, which I can pull off from newtxmath or mathdesign, which means the input is modestly slanted. \documentclass[12pt]{standalone} \usepackage{XCharter} \usepackage[charter,vvarbb]{newtxmath} \usepackage{amsmath} \begin{document} \fontsize{200}{172}\selectfont \ensuremath{d \kern22pt p} \end{document} I have blown this up here, but I shall need it in my normal font lateron. The result is supposed to look somewhat like: Obviously, one can do quite a bit better than me and my pen, especially, but not only at the lower left corner of my new connector. I will use this, in standard font size, a few hundred times in my document. Is it easy to create such a character? What program should I use? A low learning curve is a lot more important than versatility for further designs in the future. Once I have the character, how do I best use it in my document? Should I try to create its own one-character font, or just create a few PNG files at the right sizes that a \dp\ macro then inserts?
- Can I add a symbol to indicate that a footnote has been split across pages?by Draconis on January 23, 2026 at 9:05 pm
My university's thesis formatting guidelines are extremely stringent about margins, which means when a footnote gets split across pages (because the \footnotemark is on the bottom line of the page, so including the entire footnote would push the mark onto the next page), there's not much I can do to fix it. I can't, for example, expand the text box slightly, or insert some additional whitespace at the bottom. Proofreaders have found this confusing. So with the better typographical solutions being off-limits, I would like to at least indicate to the reader that the footnote continues on the next page. Is it possible to indicate some sort of symbol, such as a rightward-pointing arrow, at the point where a footnote has been split across pages, to indicate that it's continued elsewhere? I know some periodicals do this when an article is split across pages. MWE adapted from here: \documentclass[oneside]{book} \usepackage{lipsum} \usepackage[splitrule]{footmisc} \begin{document} \lipsum[1-3] \lipsum[1] New paragraph, which is really long, so long in fact that it spans more than one line. New paragraph, which is really long, so long in fact that it spans more than one line. \footnote{Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour. Here's a really long footnote that will probably be longer than one line, which could help to show the problematic behaviour.} % \lipsum \end{document} Current result: What I would like: some kind of symbol (perhaps a ➤?) at the end of the first page, showing that the footnote continues elsewhere and isn't just broken off. \usepackage[splitrule]{footmisc} indicates on the next page that there's a continuation, but I would like a marker on the first page as well. This question, this question, and this question ask the same thing, but none of them includes a MWE; I'm hoping that providing one will help find an answer.
- How to position TikZ shapes directly centered under text labels in a table-like layout?by Oregon Math Tutor on January 23, 2026 at 7:13 pm
I'm creating a geometry reference sheet with a table-like layout using TikZ. I need: the shape label horizontally centered in the cell each figure centered beneath the label As the image shows, I can't achieve this alignment. This image shows my desired output: This image (partial screen shot) shows what the current code renders: Current approach: Using \node for labels positioned with anchor=east Drawing shapes inside \begin{scope}[shift={...}] blocks Each row has a label on the left, shape in the middle-left, and properties on the right Thanks very much for taking time to assist me! mwe: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{amssymb} \usetikzlibrary{calc, shapes.geometric, arrows.meta, decorations.markings} % Use Helvetica (similar to Arial) for a clean look since custom fonts caused errors \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} % Define colors to match the original image \definecolor{colSquare}{RGB}{156, 188, 156} % Muted Green \definecolor{colRect}{RGB}{128, 128, 128} % Greyish \definecolor{colPara}{RGB}{255, 105, 120} % Pink/Red \definecolor{colRhom}{RGB}{190, 140, 190} % Purple \definecolor{colKite}{RGB}{180, 230, 200} % Mint Green \definecolor{colTrap}{RGB}{245, 170, 60} % Orange \definecolor{colText}{RGB}{128, 0, 128} % Purple text for headers \definecolor{colLine}{RGB}{70, 130, 180} % Blue grid lines \begin{document} \begin{tikzpicture}[ thick, % Style for shape outlines myshape/.style={draw=black, line width=1pt}, % Custom tick marks for sides tick/.style={postaction={decorate, decoration={markings, mark=at position 0.5 with {\draw[black, line width=1pt] (-2.5pt,-2.5pt) -- (2.5pt,2.5pt);}}}}, dtick/.style={postaction={decorate, decoration={markings, mark=at position 0.5 with {\draw[black, line width=1pt] (-1.5pt,-2.5pt) -- (2.5pt,2.5pt) (-4.5pt,-2.5pt) -- (-0.5pt,2.5pt);}}}}, % Custom arrows for parallel lines parrow/.style={postaction={decorate, decoration={markings, mark=at position 0.55 with {\arrow[scale=1.5,black]{>}}}}} ] % --- Grid Layout --- % Horizontal lines \draw[colLine] (-4, 1.5) -- (12, 1.5); \draw[colLine] (-4, 0) -- (12, 0); \draw[colLine] (-4, -4) -- (12, -4); \draw[colLine] (-4, -8) -- (12, -8); \draw[colLine] (-4, -12) -- (12, -12); \draw[colLine] (-4, -16) -- (12, -16); \draw[colLine] (-4, -20) -- (12, -20); \draw[colLine] (-4, -24) -- (12, -24); % Vertical separator \draw[colLine] (3.5, 1.5) -- (3.5, -24); % Headers \node[text=colText, scale=2] at (-0.25, 0.75) {Shape}; \node[text=colText, scale=2] at (7.75, 0.75) {Properties}; % --- Row 1: Square --- \begin{scope}[shift={(0,-2)}] \node[text=colText, scale=1.5, anchor=east] at (2,0) {Square}; \coordinate (S1) at (2.5, -1.2); \coordinate (S2) at (4.9, -1.2); \coordinate (S3) at (4.9, 1.2); \coordinate (S4) at (2.5, 1.2); \fill[colSquare] (S1) -- (S2) -- (S3) -- (S4) -- cycle; % Ticks drawn manually to ensure rotation alignment looks just like the image \draw[myshape] (S1) -- (S2) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S2) -- (S3) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S3) -- (S4) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (S4) -- (S1) node[midway, sloped] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw (S1) -- (S3); \draw (S2) -- (S4); % Right angle at center \draw (3.7,0) ++(0.2,0.2) -- ++(-0.2,0.2) -- ++(-0.2,-0.2); % Corner right angles \draw (S1) ++(0.3,0) -- ++(0,0.3) -- ++(-0.3,0); \draw (S2) ++(-0.3,0) -- ++(0,0.3) -- ++(0.3,0); \draw (S3) ++(-0.3,0) -- ++(0,-0.3) -- ++(0.3,0); \draw (S4) ++(0.3,0) -- ++(0,-0.3) -- ++(-0.3,0); \node[anchor=west, align=left] at (4.2, 0) { \begin{minipage}{8cm} \begin{itemize} \setlength\itemsep{0.2em} \item All sides are equal. \item All angles are $90^\circ$. \item Diagonals are equal. \item Diagonals bisect at $90^\circ$. \end{itemize} \end{minipage} }; \end{scope} % --- Row 2: Rectangle --- \begin{scope}[shift={(0,-6)}] \node[text=colText, scale=1.5, anchor=east] at (2,0) {Rectangle}; \coordinate (R1) at (2.5, -0.9); \coordinate (R2) at (5.0, -0.9); \coordinate (R3) at (5.0, 0.9); \coordinate (R4) at (2.5, 0.9); \fill[colRect] (R1) -- (R2) -- (R3) -- (R4) -- cycle; % Sides ticks \draw[myshape] (R1) -- (R2) node[midway] {\tikz \draw[line width=1pt] (-1.5pt,-2.5pt)--(2.5pt,2.5pt) (-4.5pt,-2.5pt)--(-0.5pt,2.5pt);}; \draw[myshape] (R2) -- (R3) node[midway] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw[myshape] (R3) -- (R4) node[midway] {\tikz \draw[line width=1pt] (-1.5pt,-2.5pt)--(2.5pt,2.5pt) (-4.5pt,-2.5pt)--(-0.5pt,2.5pt);}; \draw[myshape] (R4) -- (R1) node[midway] {\tikz \draw[line width=1pt] (-2.5pt,-2.5pt)--(2.5pt,2.5pt);}; \draw (R1) -- (R3); \draw (R2) -- (R4); % Corners \draw (R1) ++(0.2,0) -- ++(0,0.2) -- ++(-0.2,0); \draw (R2) ++(-0.2,0) -- ++(0,0.2) -- ++(0.2,0); \draw (R3) ++(-0.2,0) -- ++(0,-0.2) -- ++(0.2,0); \draw (R4) ++(0.2,0) -- ++(0,-0.2) -- ++(-0.2,0); % Diagonal marks (triple tick) % Manually drawing triple ticks on diagonals \draw[line width=0.8pt] (3.2, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.3, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.4, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.1, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.2, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (4.3, 0.1) -- ++(0.1,0.2); \draw[line width=0.8pt] (3.2, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (3.3, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (3.4, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.1, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.2, -0.1) -- ++(0.1,-0.2); \draw[line width=0.8pt] (4.3, -0.1) -- ++(0.1,-0.2); \node[anchor=west, align=left] at (4.2, 0) { \begin{minipage}{8cm} \begin{itemize} \setlength\itemsep{0.2em} \item Opposite sides are equal. \item All angles are $90^\circ$. \item Diagonals are equal. \item Diagonals bisect each other. \end{itemize} \end{minipage} }; \end{scope} \end{tikzpicture} \end{document}
- circuitikz: 'muxdemux' with exact same dimensions as an 'european resistor (inductor)'by cis on January 23, 2026 at 3:01 pm
Just out of interesst, I asked myself how to configure a muxdemux such that it has the exact same dimensions as an european resistor (european inductor), but with three muxdemux-pins on the underside. (Note: The exact target image is attached.) Here is my approach: \documentclass[border=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors, IPP/.style={muxdemux, muxdemux def={Lh=0.8, Rh=0.8, NL=1, NR=1, NB=3, NT=0, w=2}, %muxdemux label={B2=abc, BL1=1, BL2=2, BL3=3,}, %external pins width=0.4, circuitikz/muxdemuxes/fill=gray!25, }, ] \node [IPP, align=center](A) at (0,0) {}; \draw[] (-1,0.5) to[R, fill=gray!25] +(2,0); \end{circuitikz} \end{document}
- Raise integral signs with limitsby Knudsen on January 23, 2026 at 2:14 pm
Is there a way to raise an integral sign slightly and bring the limits together with it? For example, in \documentclass{report} \begin{document} \[ \int_0^1 \sqrt{a+b\sqrt{a+b\sqrt{a+b\sqrt{x}}}} dx \] \end{document} the integral can benefit from being enlarged and moved up a small bit, even if it going to take it out of alignment with part of the formula.
- TikZ Feynman W loop with Z radiationby Beth Long on January 23, 2026 at 12:55 pm
I want to make the following diagram: But this: \documentclass[a4paper,12pt]{article} \usepackage[compat=1.1.0]{tikz-feynman} \usepackage{xcolor} \definecolor{uctgreen}{rgb}{0,0.45,0} \newcommand\uct[0]{{\color{uctgreen}{u}\color{red}{c}\color{blue}{t}}} \tikzfeynmanset{ every diagram={very thick}, } \begin{document} \resizebox{5cm}{5cm}{ \begin{tikzpicture}[yscale=0.7, xscale=1.4] \begin{feynman} % ~~~ defining the vertices ~~~~~~ \vertex (i1) ; \vertex[below right=of i1] (v1); \vertex[ right=of v1] (v2); \vertex[above right=of v2] (o1); % ~~~ Z-related ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \vertex at ($(v1)!.5!(v2) - (0,15mm)$) (v3); % middle, below \vertex[below=1cm of v3] (v4); % <<< Z "length" % ~~~ lower part ~~~~~~~~~~~~~~ \vertex[below left = 2cm of v4] (i2); % one way to modify \vertex[below right= 2cm of v4] (o2); % ~~~ drawing this diagram ~~~~~~~~~~~~~~~~~~~~~ \diagram*{ {[edges={fermion}](i1) --[edge label=s] (v1) --[edge label=\uct] (v2) --[edge label=d] (o1)}, (v1) --[photon, half right, edge label'=W] (v2), (v3) --[photon, edge label'=Z] (v4), {[edges={fermion}](i2) --[edge label'=$\nu$] (v4) --[edge label'=$\nu$] (o2)}, }; \end{feynman} \end{tikzpicture} } \end{document} produces this: How can I add labels to both sides of the W and make the W-Z vertex match up?
- Is it possible simplify this lualatex code?by xcn on January 23, 2026 at 8:39 am
The following code is used to retrieve and round a variable defined via \directlua. Is it possible to remove the luaround function and replace {\IfValueTF{#1} {luaround(#2, #1)} {#2}} with something like {\IfValueTF{#1} {("%." .. #1 .. "f"):format(#2)} {#2}}? \documentclass[12pt]{article} \usepackage{luacode} \begin{luacode*} function luaround(x, n) return string.format('%.' .. n .. 'f', x ) end \end{luacode*} \NewExpandableDocumentCommand{\usevar}{om}{% \directlua{tex.sprint(% {\IfValueTF{#1} {luaround(#2, #1)} {#2} } % IfValueTF )} } \begin{document} \directlua{ x=0.345 y=2 } \usevar[2]{x} \end{document}
- hyperref + algorithm2e + zref-clever = 🐛: referencing an algorithm and a line in it produces the same type name for both 😢by Mark McGregor on January 22, 2026 at 7:11 pm
We try to reference a line in a shy algorithm and the algorithm itself with zref-clever. Running pdflatex twice on \documentclass{article} \pagestyle{empty} \usepackage{hyperref} \usepackage{algorithm2e} \usepackage{zref-clever} \zcRefTypeSetup{algocf}{ name-sg=Alg.\@, Name-sg=Alg.\@ } \zcRefTypeSetup{AlgoLine}{ Name-sg=line, name-sg=line } \zcRefTypeSetup{algocfline}{ Name-sg=line, name-sg=line } \zcRefTypeSetup{line}{ Name-sg=line, name-sg=line } \begin{document} \begin{algorithm}\LinesNumbered \caption{My great algorithm}\label{algLabel} \KwOut{The oh so great output of my great algorithm} command1\; command2\nllabel{lineLabel}\; command3 \end{algorithm} \zcref[S]{algLabel} contains \zcref{lineLabel}. \end{document} yields As we see, the second type name is “Alg.”, whereas we'd expect “line”. If we comment out hyperref, we get “Alg. 1 contains line 2.” as expected. So far we failed to get different type names for the two references in the presence of hyperref, so you can blame it. At the same time, given that algorithm2e has been unmaintained for about 8½ years and zref-clever for slightly over 1 year, you can blame them, too. Anyway, what is the technical root cause of the failure? Any bugfix, patch, or workaround?
- Unexpected tabular vertical alignmentby itobito on January 22, 2026 at 4:52 pm
I'm having a difficult time understanding the vertical alignment of columns of tables created via tabular. My Code \documentclass{article} \usepackage{array} \begin{document} \begin{tabular}{ | p{2.5cm} | m{2.5cm}| b{2.5cm} | } \hline cell1 dummy text dummy text dummy text& cell2 & cell3 \\ \hline cell4 & cell5 dummy text dummy text dummy text & cell6 \\ \hline cell7 & cell8 & cell9 dummy text dummy text dummy text\\ \hline \end{tabular} \end{document} This example is pretty much taken directly from the Overleaf Tables documentation, with the difference being the varying column alignments. I'd expect the code above to produce Expected table with the text in the first column top-aligned, the text in the second column middle-aligned, and the text in the third column bottom-aligned. However, the code above actually produces Actual table I know it's possible (and easier) with the tabularray package, but I'd like to understand why. Why do my actual table's columns have seemingly incorrect vertical alignments?
- When lemmas share the same counter as theorems, how to print “Lemma” in references produced by zcref-clever?by Mark McGregor on January 22, 2026 at 9:35 am
When cleveref died, we switched to zref-clever, but its \zcref refers to lemmas as theorems when we use the same counter. Namely, running pdflatex on \documentclass{article} \pagestyle{empty} \usepackage{zref-clever} \newtheorem{thm}{Theorem}[section] \newtheorem{lem}[thm]{Lemma} \zcRefTypeSetup{lem}{ name-sg=Lem. } \zcRefTypeSetup{thm}{ name-sg=Thm. } \begin{document} \section{My great section} \begin{lem}\label{lem}My great lemma.\end{lem} \begin{thm}\label{thm}My great theorem.\end{thm} According to \zcref{lem} \ldots \end{document} produces “According to Thm. 1.1 ...”: Above, we expected According to Lem. 1.1 ... though. Who is the culprit and what to do?
- Plotting a rational function in tikzby mf67 on January 21, 2026 at 9:17 pm
I'm trying to plot a rational function, but I constantly get dimensions too large, even if the plot frame is within the page and the function is within limits. \documentclass{book} \usepackage{pgf,tikz,pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture}[declare function={r(\x)=(-\x*\x*\x*\x+600*\x*\x*\x-135000*\x*\x+10125000*\x)/(2109375*(30000-200*\x));}] \begin{axis}[ x=0.05cm,y=1cm, xmin=0, xmax=160, ymin=0, ymax=1, xlabel={\(x\)}, ylabel={\(y\)} ] \draw[domain=0:160,smooth,samples=100] plot ({\x},{r(\x)}); \end{axis} \end{tikzpicture} \end{document} What could be wrong? TIA. This is how the graph looks in Mathematica
- How do I apply some quality control for l3keys and multichoices?by lukascbossert on January 21, 2026 at 3:24 pm
In my keys I have two "special" keys, gender and period. While gender must only have one value of m,f,d, the key period can have any of 1,2,3 (also 1,3 or 2,3 is possible). The order of number doesn’t matter. But it is important that it is one of those numbers, nothing else (besides the ,). For gender I was able to set up such a quality control measure: gender .choices:nn = { m , f , d } {\DTLnewdbentry{person}{gender}{#1}}, gender / unknown .code:n = {\msg_warning:nnnn { person } { invalid-value }{ #1 }{ m,f,d }}, but my attempt to use multichoices:nn fails: period .multichoices:nn = {1,2,3} { \clist_put_right:Nn \l_dfg_person_period_clist { #1 }}, \documentclass{article} \usepackage{datatool} \ExplSyntaxOn \msg_new:nnn { person } { unknown-key } { Key~ '\l_keys_path_str'~ is~ unknown~ and~ being~ ignored.^^J^^J You~passed~the~value~'#1'~ to~ that~ key.^^J Doublecheck~for~spelling~errors.~^^J The~ item~ is~ \msg_line_context: } \msg_new:nnn { person } { invalid-value } { Invalid~value~'#1'~for~key~'\l_keys_path_str'.^^J^^J Allowed~values~are:~'#2'.~^^J The~ item~ is~ \msg_line_context: } \clist_new:N \l_dfg_person_period_clist \keys_define:nn { person } { unknown .code:n = { \msg_warning:nnn { person } { unknown-key } {#1}}, unknown .default:V = \c_novalue_tl, % ---------- id ---------- id .code:n = \DTLnewdbentry{person}{id}{#1}, id .value_required:n = true, % ---------- firstname ---------- firstname .code:n = \DTLnewdbentry{person}{firstname}{#1}, % ---------- lastname ---------- lastname .code:n = \DTLnewdbentry{person}{lastname}{#1}, % ---------- gender ---------- gender .choices:nn = { m , f , d } {\DTLnewdbentry{person}{gender}{#1}}, gender / unknown .code:n = {\msg_warning:nnnn { person } { invalid-value }{ #1 }{ m,f,d }}, gender .value_required:n = true, % ---- period with multiple choices ---- period .initial:n = \clist_clear:N \l_dfg_person_period_clist, period .multichoices:nn = {1,2,3} { \clist_put_right:Nn \l_dfg_person_period_clist { #1 }}, % period / 1 .code:n = { \clist_put_right:Nn \l_dfg_person_period_clist { 1 }}, % period / 2 .code:n = { \clist_put_right:Nn \l_dfg_person_period_clist { 2 }}, % period / 3 .code:n = { \clist_put_right:Nn \l_dfg_person_period_clist { 3 }}, period .code:n = \DTLnewdbentry{person}{period}{ \clist_use:N \l_dfg_person_period_clist}, period / unknown .code:n = {\msg_warning:nnnn { person } { invalid-value }{ #1 }{ 1,2,3 }}, } % ---------------------------------------------------------------- % Interface % ---------------------------------------------------------------- \NewDocumentCommand{\addEntry}{ O{#2} m m } { \DTLifdbexists{#2}{}{ \DTLnewdb{#2} } \DTLnewrow{#2} \keys_set:nn { #1 } { #3 } } \NewDocumentCommand{\getEntry}{o m m O{id}} { \DTLgetvalueforkey{\thevalue}{#3}{#1}{#4}{#2} \DTLifnullorempty{\thevalue}{}{ \thevalue } } \ExplSyntaxOff % ---------------------------------------------------------------- % Test data % ---------------------------------------------------------------- \addEntry{person}{ id = {p1}, firstname = {Alice}, lastname = {Smith}, gender = {m}, period = {1}, } \addEntry{person}{ id = {p2}, firstname = {Bob}, lastname = {Brown}, gender = {m}, period = {2,3}, } % ---------------------------------------------------------------- \begin{document} \section*{Demo of the tiny interface} PI name: \textbf{\getEntry[person]{p1}{lastname}}\\ PI gender: \textbf{\getEntry[person]{p1}{gender}}\\ Periods (p1): \textbf{\getEntry[person]{p1}{period}}\\ Periods (p2): \textbf{\getEntry[person]{p2}{period}} \end{document}
- Defining tabular column with resuming enumerateby user1 on January 21, 2026 at 12:14 pm
I have a follow up question, to this one. I want to define a column type, which creates a resumed enumerated list over several rows. I do not use [series=table,nosep,leftmargin=*,before=\vspace{-0.5\baselineskip}] in the following code. I got the solution using minipage previously from an other problem. But please feel free to change this. \documentclass{article} \usepackage{enumitem} \usepackage{array} \makeatletter \newcolumntype{e}[1]{% >{\minipage[t]{\linewidth}\let\\\tabularnewline \enumerate %TODO does not work: [resume*] \addtolength{\rightskip}{0pt plus 50pt}% for raggedright \setlength{\itemsep}{-\parsep}}% p{#1}% <{\@finalstrut\@arstrutbox\endenumerate\endminipage}} \makeatother \begin{document} text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text \begin{tabular}{|e{5cm}|p{5cm}|} \hline \multicolumn{1}{|p{5cm}|}{Column 1 Heading } & Column 2 Heading \\ \hline \item Item 1 & no items\\ \hline \item Perhaps this text could go on for a while too & no items 2\\ \hline \end{tabular} text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text \end{document}
- Typesetting old Arabic manuscripts (without dots)by imdk4242 on January 21, 2026 at 11:31 am
In the study of old Arabic manuscripts, the letter are commonly written without dots below/above different Arabic letter (b/n/t/tha/dhal/etc.). Is it possible to replicate this old writing using arabluatex package or similar? Sample text to be found here (link, Corpus Coranicum) Update #1: A suitable use it to set in arabluatex (ekdosis) to get TEI xml-compliant editions. Sample code: \documentclass{scrartcl} \usepackage{fontspec} \usepackage[english]{babel} \babelfont{rm}{Old Standard} \usepackage[fullvoc]{arabluatex} \SetArbEasy \begin{document} \txarb{ ٮسم الله الرحمں الرحٮم } \arb[novoc]{bismi llAhi l-ra.hmAni l-ra.hImi} \end{document} Output: (The yaa with/without dots is documented as part of the package) A work around(?) could be (mis)using the \newarbmark{} and define seperat old Arabic letters, e.g. as illustrated for the tanwin here: \newarbmark{Y}{^^^^0649}{} \arb{hud\arbcolor[red]{aN\arbnull{_A}}\arbmark{Y}} \arb[trans]{hud\arbcolor[red]{aN\arbnull{_A}}\arbmark{Y}}
- How to place an extended description of the illustration on the page adjacent to it?by forrest on January 21, 2026 at 10:16 am
I am trying to place a figure (plot) on the right (odd) site and the extended description of this figure on top of left (even) site - the previous one. In other words, I would like to have an option of float placement coexisting with htbp, but rlated to placement on even or odd page, let say l/r. MWE: \documentclass{article} \usepackage{mwe} \begin{document} \blindtext\blindtext \begin{figure}[t] \includegraphics[width=\textwidth,height=.3\textheight]{example-image-a}% \caption{First image description}\label{fig:first} \end{figure} \begin{figure}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-a}% \caption{First image}\label{fig:second} \end{figure} \blindtext\blindtext\blindtext \begin{figure}[t] \includegraphics[width=\textwidth,height=.3\textheight]{example-image-b}% \caption{Second image description}\label{fig:fourth} \end{figure} \begin{figure}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-b}% \caption{Second image}\label{fig:fifth} \end{figure} \blindtext\blindtext\blindtext \end{document} I have found similar questions, but left without answer that can solve my problem: The package afterpage gives no control ability of floats' placement - Placing figure on an even/odd page. Also by execution of @David Carlisle code I have obtained incorrect location of figures - Position two floats on opposing pages. The solution utilizing dpfloat package does not enalbe to place float at the top of the page (together with the document main text on the same page) - How to float until on left (or right) page? I see that the use of afterpage package not only gives not a required result but also changes the order of floats - Placing figure on an even/odd page. The hvfloat package would be useful to me if it had options to place a description at the top of the page, and surrounded by a frame (I am using tcolorbox for this purpose). Demonstration how the afterpage package can not solve the problem: \documentclass{article} \usepackage{afterpage} \usepackage{mwe}% for the example only \begin{document} \blindtext\blindtext\blindtext \blindtext\blindtext\blindtext \afterpage{% \clearpage% flush all other floats \ifodd\value{page} %\else% uncomment this else to get odd/even instead of even/odd \expandafter\afterpage% put it on the next page if this one is odd \fi {% \begin{figure}[t] \includegraphics[width=\textwidth,height=.3\textheight]{example-image-a}% \caption{First image}\label{fig:first} \end{figure} \clearpage \begin{figure}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-b}% \caption{Second image}\label{fig:second} \end{figure} \clearpage }% } \blindtext\blindtext\blindtext \begin{figure}[t] \includegraphics[width=\textwidth,height=.3\textheight]{example-image-c}% \caption{Third image}\label{fig:third} \end{figure} \blindtext\blindtext\blindtext \blindtext\blindtext\blindtext \afterpage{% \clearpage% flush all other floats \ifodd\value{page} %\else% uncomment this else to get odd/even instead of even/odd \expandafter\afterpage% put it on the next page if this one is odd \fi {% \begin{figure}[t] \includegraphics[width=\textwidth,height=.3\textheight]{example-image-a}% \caption{Fourth image}\label{fig:fourth} \end{figure} \clearpage \begin{figure}[p] \includegraphics[width=\textwidth,height=.9\textheight]{example-image-b}% \caption{Fifth image}\label{fig:fifth} \end{figure} \clearpage }% } \blindtext\blindtext\blindtext \end{document}
- tikz, in some cases use of "node contents" doesn't workby Zarko on January 21, 2026 at 9:36 am
I'm curious, why second example in the following MWE doesn't works. Well, I can leave with first example, but anyway ... I'd rather prefer to use the second one. \documentclass[border=3mm, 11pt]{standalone} \usepackage{tikz} %---------------------------------------------------------------% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture}[ Jvmes/.style args = {#1/#2}{double,double distance=#1, thick,draw=#2}, Npin/.style args = {#1/#2}{minimum size=#1, inner sep=0pt, pin=#2, node contents={} }, ] % first example: works fine \draw[Jvmes=4mm/teal] (0,0) -- node (aux) [Npin=4mm/left:some long one line text] {} (0,2); % second example: gives error "Cannot parse this coordinate." \draw[Jvmes=4mm/teal] (0,0) -- node (aux) [Npin=4mm/left:some text] (0,2); \draw[Jvmes=4mm/teal] (0,0) -- node (aux) [Npin=4mm/left:some text] {} (0,2); \end{tikzpicture} \end{document} Result of the first example is: Addendum: However, if I move inserting of node after drawing a path: \documentclass[border=3mm, 11pt]{standalone} \usepackage{tikz} %---------------------------------------------------------------% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture}[ Jvmes/.style args = {#1/#2}{double,double distance=#1, thick,draw=#2}, Npin/.style args = {#1/#2}{minimum size=#1, inner sep=0pt, pin=#2, color=blue, node contents={} }, every pin/.add style = {}{blue}, ] \draw[Jvmes=4mm/red] (0,0) -- (0,2) node [Npin=4mm/left:some text, pos=0.5]; \end{tikzpicture} \end{document} than it works as expected: I hope that Henri Menke will extend his comment (which help me understand what is going on at my examples) to an answer.
- How to change color of equals sign without disturbing alignment?by Arya1050 on January 21, 2026 at 8:42 am
\documentclass{beamer} \begin{document} \begin{frame} \begin{align*} A &= B \\ &\textcolor{blue}{=} C \end{align*} \end{frame} \end{document} I want the last equals sign to be colored blue, but this code disrupts the alignment. It also brings the 'C' closer to the equals sign. How can I fix this? ChatGPT turned out to be of no help. Note: I don't have any particular purpose for doing this. I was just experimenting out of curiosity on my actual slides. Just wanted to see if this problem could be solved in any case.
- alignment of diagrams in xy-picby Olga on January 20, 2026 at 7:10 pm
I'm learning to draw commutative diagrams using the xy-pic package. I don’t know how to insert pictures on this forum yet, so I’ll write what I got with xymatrix: \documentclass[12pt,reqno]{report} \usepackage[all,cmtip]{xy} \usepackage[T1]{fontenc} \usepackage[russian]{babel} \begin{document} $$\xymatrix{% Z \ar@{-->}[r]_h \ar `u/8pt[r] `[rr]^{g} [rr] & \displaystyle Y \ar[r]_f & X }$$ $$\xymatrix{% F(Z) \ar[r]_{\alpha} \ar `u/8pt[r] `[rr]^{F(g)} [rr] & \displaystyle F(Y) \ar[r]_{\beta} & F(X) }$$ \end{document} I would like to align both charts in width and and want to turn the ends of the arrows $g$ and $F(g),$ respectively, towards $X$ and $F(X).$ Edit. Here's what I got with your help:
- Drawing a thick arrow with different fill and outline colorsby aaragon on January 20, 2026 at 11:46 am
Drawing this type of arrow turned out to be quite complex. I looked at the macro in this post and modified accordingly so that I get the shape I want. However, that macro only prints a single color arrow and it looks painfully difficult to modify to get what I want. Therefore, I thought that I would "emulate" the result by printing two superposed arrows, an original one and one scaled slightly so as to mimic that I have a different border color. This is what I have so far: \documentclass{standalone} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc, arrows.meta, bending} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \makeatletter \tikzset{ ararrow/.default={open}{open}, ararrow/.code 2 args={% \tikz@addoption{% \pgfset{tips=true}% draw tips even if the path isn't. \pgfgetpath\currentpath \pgfprocessround{\currentpath}{\currentpath}% \pgf@decorate@parsesoftpath{\currentpath}{\currentpath}% \pgfsetarrowsstart{% Triangle[bend, length=1.*(\pgf@decorate@totalpathlength), width =0.08*(\pgf@decorate@totalpathlength), % <-- added line join=round,#1] } \pgfsetarrowsend{% Stealth[ angle'=60, length=0.22*(\pgf@decorate@totalpathlength), width =0.26*(\pgf@decorate@totalpathlength), line join=round,#2]}% \tikz@mode@drawfalse % disable drawing of path } }, ararrow **/.style={ararrow={}{}}, ararrow oo/.style={ararrow={open}{open}}, ararrow *o/.style={ararrow={}{open}}, ararrow o*/.style={ararrow={open}{}}, } \makeatother \begin{document} \begin{tikzpicture} \coordinate (P) at (0,0); \coordinate (Q) at (1,1); \coordinate (C) at ($(P)!0.5!(Q)$); % outer arrow \draw[blue, ararrow **] (P) to[bend left=45] (Q); % inner arrow: same curve, scaled about C \begin{scope}[ shift={(C)}, scale=0.9, shift={($-1*(C)$)} ] \draw[yellow, ararrow **] (P) to[bend left=45] (Q); \end{scope} \end{tikzpicture} \end{document} which produces the image you see. Ideally, it would be great if the macro can be modified to get what I need so the user can simply type: \draw[draw=blue, fill=yellow, ararrow **] (P) to[bend left=45] (Q);
- Automatically reserve space at bottom of second column on first page in twocolumn articleby Srikanth Mohankumar on January 20, 2026 at 9:33 am
I need to automatically reserve empty space at the bottom of the second column on the first page only in a two-column article. This space will be used later for stamping a thumbnail image during PDF post-processing. Requirements: Only affect the first page, second column Reserve approximately 100pt of blank space at the bottom of the column The text in the second column should be shorter to leave this space empty First column should remain at normal height Should be automatic (no manual commands in document body) Must work with LuaLaTeX (TeX Live 2025) I've tried various approaches with @opcol and @outputdblcol but they either create space at the top instead of bottom, or affect all pages instead of just the first page. \documentclass[twocolumn]{article} \usepackage{lipsum} \makeatletter % Need solution here to reserve 100pt at bottom of second column on page 1 \makeatother \begin{document} \title{Sample Document} \author{Author Name} \maketitle \lipsum[1-20] \end{document} Expected result: The second column on page 1 should have normal text at the top, but stop 100pt before the bottom, leaving that space blank for later thumbnail insertion. What I've tried:I attempted using \afterpage with \footnotetext to create the reserved space: \afterpage{\footnotetext{\fbox{\vbox to 100pt{second column reserved space}}}} This works well for short paragraphs, but fails when long paragraphs continue onto the second page - the reserved space appears on the wrong page. I've also tried various approaches with @opcol and @outputdblcol hooks, but they either create space at the top instead of bottom, or affect all pages instead of just the first page. MWE: \documentclass[fleqn,twocolumn]{article} \usepackage{lipsum} \usepackage{afterpage} \makeatletter % Need solution here to reserve 100pt at bottom of second column on page 1 \makeatother \title{Sample} \author{John Doe} \begin{document} \maketitle % This approach fails with long paragraphs \afterpage{\footnotetext{\fbox{\vbox to 100pt{second column reserved space}}}} \begin{abstract} \lipsum[2] \end{abstract} \section{Introduction} Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. Based on prior theoretical literature on gender differences in ambiguity aversion, we put to the test the hypothesis that female workers are more prone to compete when the structural ambiguity of bidding situations is reduced in an online-work setting. \footnote{Number test.} \end{document}
- Missing definition of \smallsetminus with lua-unicode-mathby murray on January 19, 2026 at 4:42 pm
With the unicode-math package, this source gives the expected output, as shown: % !TEX program = lualatex \NeedsTeXFormat{LaTeX2e}[2025-11-01] \documentclass{article} \usepackage{mathtools} \usepackage{fontspec, unicode-math} % OK with this %\usepackage{fontspec, lua-unicode-math} % this gives undefined control sequence \setmainfont[Scale=1.0]{TeXGyreTermesX} \setmathfont{STIX Two Math}[Scale=MatchUppercase,math-style=ISO] \begin{document} $A \smallsetminus B$ \end{document} However, if lua-unicode-math is loaded instead of unicode-math, then an "undefined control sequence" error results. How fix this? Added: in unicode-math-luatex.sty, which is called by unicode-math when lualatex is used, the definition is given by: \cs_set_protected:Npn \smallsetminus { \mathbin{ \mathpalette \__um_smallsetminus: \relax} } \cs_set:Npn \__um_smallsetminus: #1 { \rotatebox{135}{ \smash{ \raisebox{-\height}{$#1\minus$} } }}
- Adding a hyperlink to a tcolorbox titleby mmjt on January 19, 2026 at 2:44 pm
With help from stackexchange, I have been able to create attractive colorboxes for the exercise and problem sets in a class mathematical physics tutorial. The exercises have hints. I would like to modify the "Exercise" tcolorbox so that an optional clickable hint icon will appear in the title bar, containing a hyperlink to the hint. I cannot simply make the whole exercise box be the clickable area, because that will mask any links that may be in the Exercise text, such as a reference to a particular equation. I have tried using an overlay, as in my MWE, but the link is not working. In the MWE I have replaced the icon graphic file withe a text "?". The MWE is a bit lengthy (apologies), but I want to show that the other links are working – it is just the hint link that fails. The full document is over 600 pages! \documentclass{book} \usepackage{graphicx} \usepackage{tcolorbox} \tcbuselibrary{most} \usepackage{xparse} \usepackage{hyperref} % A simple hint environment \newcounter{hint} \newenvironment{hint} { \par\refstepcounter{hint}\medskip } { \par\medskip } % Key to store hint label \tcbset{ hint/.store in=\exercise@hintlabel, } % New exercise box, with a clickable hint box within \newtcolorbox[auto counter, number within=chapter]{exercise}[3][]{ #2, #3, enhanced, breakable, colback=white, colframe=blue!25!white, coltitle=black, boxrule=0.8pt, left=6pt, right=6pt, top=6pt, bottom=6pt, fonttitle=\bfseries, title={Exercise~\thetcbcounter\ifx#1\empty\else\ (#1)\fi}, overlay={ \ifx\exercise@hintlabel\empty\relax \else \node[ anchor=north east, xshift=0pt, yshift=0pt ] at (frame.north east) { \hyperlink{\exercise@hintlabel}{ \textbf{?} % \includegraphics[width=12pt]{hint-icon.eps} } }; \fi }, } \begin{document} \mainmatter \chapter{The Tutorial} \begin{equation} E = mc^{2} \label{eq_a} \end{equation} \vspace{10\baselineskip} \begin{exercise}[]{label={ex_1}}{hint={hint_ex_a}} Use Eqn.~\ref{eq_a} to find an expression for $m$. Click ``\textbf{?}'' for a hint. \end{exercise} \newpage {\textbf{Hints to Exercises}} \begin{hint} \label{hint_ex_a} \textbf{Exercise \ref{ex_1}} Try an algebraic manipulation. \end{hint} \end{document} How can I make the hint link work correctly?