Hot
- Defining list of commands using \foreachby Lorenzo Riva on March 25, 2026 at 11:02 pm
I want to use a \foreach loop to define a series of commands of the form \bf\l where \l runs through the uppercase letters of the alphabet and \bf\l evaluates to \mathbf{\l}. This is so that I don't have to manually define \bfA, \bfB, etcetera at the start of all my documents. I've tried the following setup (patched together from Defining a newcommand, with variable name, inside another newcommand): \documentclass{article} \usepackage{amsmath,pgffor} \foreach \l in {A,B,C,D} { \expandafter\newcommand\csname bf\l\endcsname{ \mathbf{\l}% } } \begin{document} $\bfA$ $\bfB$ $\bfC$ $\bfD$ \end{document} It resulted in four errors, namely that the four commands are undefined. Where am I going wrong, and why does this not work?
- How to Vertically Stretch Arched Wordsby Jethro on March 25, 2026 at 10:52 pm
MWE: \documentclass[12pt]{book} \usepackage{tikz,xcolor,scalefnt,scalerel} \usetikzlibrary{decorations.text} \begin{document} \thispagestyle{empty} {\Huge{\scalefont{1.25}{ \begin{tikzpicture} \path[-latex,white!30!black,postaction={decorate},decoration={text along path,text={HOW TO ADD A VERTICAL STRETCH?},text color={black},text align=center}] (7,0) arc [start angle=180,end angle=0,radius=7]; \end{tikzpicture}}}} \end{document} which produces: How may I add a vertical stretch to the letters? I have called in the scalerel package and tried placing \vstretch{}{} at various places in the code, but to no avail. It is necessary that I compile the code with xelatex.
- Custom glyph mappings for unicode-mathby Gargantuar on March 25, 2026 at 10:35 pm
Latin Modern Math doesn't provide a symbol for \lParen (a double left parenthesis) from unicode-math. Instead of choosing another font, I'd rather want to define a custom symbol, namely (\!( for \lParen (or \big(\!\!\big( for \big\lParen and so on). How do I do this so that \lParen is scalable with \big, ..., \left, and will unicode-math correctly map it to unicode? (I know how to emulate this with \DeclarePairedDelimiterX and the like, but these are not exactly glyphs that can be mapped to a unicode character.) On the other hand, I want to define something like \longtwoheadrightarrow, which is not defined by unicode-math: \newcommand{\longtwoheadrightarrow}{\relbar\joinrel\twoheadrightarrow} Of course, this symbol isn't defined in unicode, but will this be mapped to the closest corresponding symbol, namely the normal "Rightwards Two Headed Arrow" ↠ (U+21A0)? Even more difficult, how can I map \newcommand{\longhookrightarrow}{\lhook\joinrel\longrightarrow} to the unicode character "Rightwards Arrow with Hook" ↪ (U+21AA)? There are a lot of similar long versions of arrows I'd like to define.
- Nesting decorations in TikZ disconnects subpathby Sandy G on March 25, 2026 at 9:49 pm
The decorations in the decorations.fractals library can be used to create fractal lines by applying the decoration repeatedly to an originally straight path. (This can be done with decorations from other libraries as well.) For example, the code \begin{tikzpicture}[decoration=Koch snowflake] \draw decorate{decorate{decorate{(0,0)--(3,0)}}}; \end{tikzpicture} produces the expected result. When a decoration is applied to a subpath however, nesting the decoration produces a result I did not expect. Namely, the decorated subpath appears to be disconnected from the path as a whole. Consider the following image: which is produced by the code below. A single iteration of the decoration produces a closed path (orange) as expected. But when the decoration is nested (blue) the --cycle does not close the whole path, only the portion beginning with the decoration. If you look closely, you can also see that the first segment of the path is not connected to the decorated portion. What is the reason for this behavior? Note the partial fix in purple does not solve the problem, unless one only wanted to fill the path without drawing it. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \begin{document} \begin{tikzpicture}[decoration=Koch snowflake] \draw[help lines] (0,0) grid (5,3); \draw[orange, very thick] (1,0)--(0,0) decorate{--(0,3)}--cycle; \draw[blue, very thick] (3,0)--(2,0) decorate{decorate{--(2,3)}}--cycle; \draw[purple, very thick] (5,0)coordinate(A)--(4,0) decorate{decorate{--(4,3)}}--(A); \end{tikzpicture} \end{document}
- List of all Latin Modern Math symbolsby Gargantuar on March 25, 2026 at 9:01 pm
I'm trying my documents more accessible by using unicode-math. Conveniently, the default font Latin Modern Math provides many symbols, and I think much more than amssymb, but stuff like \lParen or \rParen are missing. Is there a list of all Latin Modern Math symbols, similar to PDFs like for stix2, amssymb, yhmath, etc.?
- Gray vector appears with fading in TikZby Sebastiano on March 25, 2026 at 8:33 pm
In TikZ, for my previous answer here: Circular Motion when I use the fading library to create a vector with a fading effect, a smaller gray vector appears inside the main vector. Why does this happen, and is there a way to prevent the inner gray vector from being visible? \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usetikzlibrary{arrows.meta, decorations.markings} \usetikzlibrary{fadings} \usepackage{newtxmath} \definecolor{myblue}{RGB}{0, 119, 200} \definecolor{mygreen}{RGB}{27, 175, 78} \definecolor{myorange}{RGB}{245, 130, 32} \begin{document} \begin{center} \begin{tikzpicture}[ vvec/.style={mygreen, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, avec/.style={myorange, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, dot/.style={circle, fill=black, inner sep=0pt, minimum size=7pt} ] \def\R{2.5} \def\V{2.8} \def\A{1.2} \draw[myblue, line width=1.2pt, decoration={markings, mark=at position 0.0833 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.4167 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.75 with {\arrow{Latex[length=3mm, width=2.5mm]}} }, postaction={decorate}] (0,0) circle (\R); \draw[gray!20, line width=4mm, -{Latex[length=7mm, width=8mm]}, path fading=north] (155:\R+0.8) arc (155:205:\R+0.8); \node at (180:\R+1.5) {\Large $\boldsymbol{\omega}$}; \node[dot] (P1) at (90:\R) {}; \draw[vvec] (P1) -- ++(180:\V) node[midway, above=2pt] {\Large $\vec{v}$}; \draw[avec] (P1) -- ++(270:\A) node[midway, right=2pt] {\Large $\vec{a}$}; \node[dot] (P2) at (210:\R) {}; \draw[vvec] (P2) -- ++(300:\V) node[midway, below left=2pt] {\Large $\vec{v}$}; \draw[avec] (P2) -- ++(30:\A) node[midway, below right=2pt] {\Large $\vec{a}$}; \node[dot] (P3) at (330:\R) {}; \draw[vvec] (P3) -- ++(60:\V) node[midway, below right=2pt] {\Large $\vec{v}$}; \draw[avec] (P3) -- ++(150:\A) node[midway, below=2pt] {\Large $\vec{a}$}; \end{tikzpicture} \end{center} \end{document}
- Online tool to write LaTeX formulas on a non-editable PDFby Sebastiano on March 25, 2026 at 8:26 pm
Suppose I have a PDF containing Math or Physics exercises, but it is not editable. I would like to know if there is an online tool or web service that allows me to: Upload the PDF. Preview the pages. Write LaTeX formulas directly on top of the PDF (for example, as annotations or overlays). Basically, I am looking for a way to add formulas written in LaTeX to the original PDF without having to recreate the entire document from scratch. Are there any tools like this available? Addendum: After my question I have found PDF Annotator but it is not free.
- longtable cell is not expanded when using multirowby Snowrabbit on March 25, 2026 at 5:52 pm
I like to use longtable because table will be long and span several pages. But I have a problem using multirow in the longtable, the cell is not expanded vertically. How to use multirow correctly in a longtable? Can someone explain in simple terms why the cell doesn't expand? If you have any suggestions for improvements to the code, I would be grateful 🙂 \documentclass{article} \usepackage{longtable} \usepackage{multirow} \usepackage{multicol} \usepackage{lipsum} \usepackage[table]{xcolor} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \begin{document} \begin{longtable}[c]{|L{1cm}|L{3cm}|L{1cm}|L{7cm}|} \caption{Long table with multirow} \label{tab:long table with multirow}\\ \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endfirsthead \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endhead 1 & Name 1 & 42 & \multirow[t]{3}{=}{\lipsum[1]} \\ 2 & Name 2 & & \\ 3 & Name 3 & & \\ \hline \end{longtable} \end{document} I apologize if the question has already been answered elsewhere and please provide a reference.
- sourcesanspro and siunitx conflictby Paul on March 25, 2026 at 2:20 pm
I'm using sourcesanspro as my default text font to write my thesis (with fourier for the math mode), along with siunitx to deal with number and units printing. Everything was working just fine until I decided to update all of my packages with miktex and especially the sourcesans package. The error I got is : ! Use of ??? doesn't match its definition. ??? ! LaTeX Error: Erroneous variable \l__siunitx_print_version... l.27 ...mathrm{l} \left[\unit{\ohm\per\kilo\meter} \right] \cdot x \left[\un... If you say, e.g., \def\a1{...}', then you must always put 1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. This error happen for every siunitx command (\qty, \unit, \num) used in math mode. Outside of math mode (in text mode), it seems to be ok. Here is a MWE : \documentclass[12pt]{article} \usepackage[utf8]{inputenc}\usepackage[T1]{fontenc} \usepackage[default]{sourcesans} % Police Source Sans \usepackage{amsmath,mathtools,amssymb,amsthm,amsfonts,bm,siunitx,commath,xfrac} % Math Presets \sisetup{detect-family=true, detect-mode=true, detect-weight=true, detect-shape=true} %police pour siunitx \begin{document} $\unit{\ohm\per\kilo\meter}$ \unit{\ohm\per\kilo\meter} \qty{90}{\kilo\volt} \end{document} I reported this bug to the sourcesans package git hub (https://github.com/silkeh/latex-sourcesanspro/issues/10#issue-4128078876) and still waiting for a response. What should I do ? Should I try to manually roll back the update ? How should i do that ? Thanks for your help
- ltx-talk: \visible command not working as I expectedby Svend Tveskæg on March 25, 2026 at 12:50 pm
Consider the following (almost?) MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{ltx-talk} \usepackage{fontspec} \usepackage{pstricks} \begin{document} \begin{frame}{\visible<1->{Exercise}} \begin{enumerate} \item \visible<2->{A} \visible<3->{B} \visible<4->{% \begin{center} \begin{pspicture}(8,2) \psframe(8,2) \end{pspicture} \end{center}}% \end{enumerate} \end{frame} \end{document} Do to the order of the visible<n->{} commands, I expected the PSTricks drawing to not show up before the 4th slide but it is drawn right from the beginning. Question How do I fix the above-mentioned "issue"? Thanks in advance.
- The order of \pgfkeys always mattered in tikz's option?by Explorer on March 25, 2026 at 12:11 pm
I have the following code example: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \draw[->,>=latex] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \draw[>=latex,->] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,below=of tmp,node distance=.5cm] {below}; \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,node distance=.5cm,below=of tmp] {below}; \end{tikzpicture} \end{document} Which gives the following: What I get confused is that: ->,>=latex and >=latex,-> behaves the same below=of tmp,node distance=.5cm honer the default value node distance=1cm, and node distance=.5cm,below=of tmp honer the previous node distance=.5cm Why caused the difference between >= and node distance? How to know whether an option's order is important with \pgfkeys? Edited: As jps commented: Keys are generally ordered as key code is executed in the order given. Whether the order of keys then matters strongly depends on the key code. The way to know whether an option's order matters is to either know the implementation by heart, or trial and error and Jasper Habicht supplemented that: Some keys only store a value in a macro that is later retrieved (which is true for the arrow settings, for example). The values stored in the macros are only retrieved when the arrows is drawn, that is at the end of the path. But other keys actually use values that are stored in macros and if these values are set my other keys, the order is relevant. But as was said above: You really need to know how the implementation is exactly to know whether the first or the second holds in a specific case. Here below is my follow-up doubt: In my understanding, "TikZ keys are applied in the order they are given", so is the following always safer (avoid the unexpected behavior of below=of tmp,node distance=.5cm)? >=latex,->: define the arrow style at first, then set the arrow node distance=.5cm,below=of tmp: set the distance at first, then apply the position
- NVDA screen reader with MathML not working properlyby Tricia Bevans on March 25, 2026 at 6:58 am
I'm taking first steps to make accessible math pdf documents. I have used a simple template for a very basic document that compiles properly with luaLatex using the tool here:https://latex3.github.io/tagging-project/documentation/wtpdf/small-example but I want to listen to how it's read by a screen reader. I've downloaded NVDA and the MathCat add-on but nothing seems to read properly like it does in these demo videos: https://latex3.github.io/tagging-project/documentation/wtpdf/fulldoc I've tried to use the actual document from the videos as well to know I was using a document that was tagged properly but it still doesn't read things clearly as it's supposed to. I've tried in Adobe and Foxit. What am I missing? I'll be so grateful for any support I can get. I'm not very sophisticated in any aspect of this process so the simpler the explanations the better.
- Mix and match lowercase letters from different mathematical fontsby Yi Wang on March 25, 2026 at 4:17 am
I'm currently using the unicode-math package and I want to mix lowercase characters from different mathematical fonts. For example, lowercase Latin letters $x$ from XITSMath-Regular.otf and $u,v,w$ from NewCMM-Book.otf. I know that using setmathfont to replace all lowercase Latin letters works, but it doesn't work when I want to replace a single Latin letter. I used Gemini's solution, employing the range parameter of the \setmathfont command to replace individual letters, but this did not work; the lowercase letters I attempted to replace still displayed the NewCMMath font. \documentclass{article} \usepackage{unicode-math} % --- Font Configuration Start --- % 1. Set the main math font (New Computer Modern Book) \setmathfont{NewCMMath-Book.otf} % 2. Map all lowercase Latin letters to XITS Math % This covers a-z in italic (math) mode as the baseline for your request \setmathfont{XITSMath-Regular.otf}[ range=it/{latin-lowercase}, Scale=MatchUppercase ] % 3. Bring back u, v, w from NewCMMath-Book % (Hex: u="75, v="76, w="77) \setmathfont{NewCMMath-Book.otf}[ range={it/"75, it/"76, it/"77}, Scale=MatchUppercase ] % 4. Set f from Erewhon-Math % (Hex: f="66) \setmathfont{Erewhon-Math.otf}[ range=it/"66, Scale=MatchUppercase ] % 5. Set x from XITS Math % (Included in step 2, but isolated here for clarity and specific scaling) \setmathfont{XITSMath-Regular.otf}[ range=it/"78, Scale=MatchUppercase ] % --- Font Configuration End --- \begin{document} \section*{Math Font Mixing Test} The glyphs in the formula below are pulled from different fonts as requested: \begin{itemize} \item $f$: Erewhon-Math (distinctive hook/curve) \item $x$: XITS Math (Times-style) \item $u, v, w$: NewCMMath-Book (Computer Modern style) \item $a, b, c, y, z$: XITS Math \end{itemize} \[ f(x, u, v, w) = a + b + c + y + z \] \[ \int_{u}^{v} f(t) \, dt = \sqrt{x^2 + w^2} \] \end{document}
- Writing environment contents verbatim to a file and also keeping them inlineby seanmk on March 25, 2026 at 12:31 am
I would like to create an environment where the contents are both parsed as LaTeX and also written verbatim to a file. The reason is that I want to create a Jupyter-notebook-style environment where some code can be included in a listings-type environment and then the result of compiling and running that code is included after the code itself. I can write the contents verbatim to a file using VerbatimOut from fancyvrb: \newenvironment{mylisting}{% \VerbatimOut{myfile.c}% }{% \endVerbatimOut } I also can include the contents of that file using \lstinputlisting{myfile.c} after, but this does not end up being parsed the same way as including it inline. Specifically, escaping \labels for later \refs does not work when I use \lstinputlisting{myfile.c}. It seems like there should be a way to copy the contents of the environment into some kind of buffer to use twice, but I haven't been able to figure it out. Any help is appreciated!
- Help cant compile chemformula, compiler is hangingby Felipe9 on March 24, 2026 at 9:37 pm
When i try to compile with the line \ch{2 Fe2O3} uncommented, the compiler just hangs, never finishing, i dont get any errors MWE: \documentclass{article} \usepackage{chemmacros} \chemsetup[phases]{pos=sub} \begin{document} \ch{Fe2O3\sld{} + CO\gas{} <> Fe\sld{} + CO2\gas{}} % \ch{2 Fe2O3} \end{document}
- \end{twocolumn} doesn't workby Alex Degtyarev on March 24, 2026 at 8:58 pm
How do I go from two columns back to a single one? Here is a simple example that no one seems to address in the documentation. \documentclass{amsart} \begin{document} \columnsep1cm \begin{twocolumn} Two column text two column text two column text two column text \newpage Two column text two column text two column text two column text \newpage \end{twocolumn} Now, by the whole idea of ``environment'', this is supposed to continue in a single column, isn't it? \newpage Nevertheless, it sucks! Enhancements like \verb+\usepackage{multicol}+ do not make an iota of difference. \end{document}
- Refactor nested ifx statementby Thomas on March 24, 2026 at 4:53 pm
I'm in a situation where I have nested ifx statements that check if a value equal to another in a list of values. It results in this nested code : \documentclass{article} \begin{document} \def\name{Charlie} \def\nameA{Alice} \def\nameB{Bob} \def\nameC{Charlie} \def\nameD{Denise} \ifx\name\nameA Hello Alice ! \else \ifx\name\nameB Bonjour Bob ! \else \ifx\name\nameC Holà Charlie ! \else \ifx\name\nameD Gutten Tag Denise \else I'm sorry, you are ? \fi \fi \fi \fi \end{document} Is there a way to write this code shortly ? In Python, I would used elif, and in C++ a switch statement.
- Adjusting 'curviness' of edges in tkz-graphby Tarran M on March 24, 2026 at 3:05 pm
I am trying to make this edge not overlap with node number 5, and I didn't find anywhere in the documentation that would let me increase the length of the edge itself so that it curves more steeply. Any help would be appreciated! This is what I have so far: \begin{tikzpicture} \Vertex{1} \WE(1){7} \NOWE(7){5} \SOWE(7){2} \NOWE(2){6} \NOEA(1){3} \SOEA(1){4} \Edge(1)(7) \Edge(2)(5) \Edge[style=bend left](5)(1) \Edge[style=bend left](5)(7) \Edge[style=bend right](5)(6) \Edge[style=bend right](6)(2) \Edge[style=bend left](7)(2) \Edge[style=bend left](1)(2) \Edge[style=bend left](1)(3) \Edge[style=bend left](3)(4) \Edge[style=bend left](4)(1) \tikzset{EdgeStyle/.style={in=90,out=90}} \Edge[style=bend right](6)(1) \end{tikzpicture} with the output
- Chemfig: inconsistent `\chemmove` behaviorby Clydinite on March 24, 2026 at 2:59 pm
I am using chemfig to draw a reaction mechanism and \chemmove for electron flow. I've noticed a very strange behavior: when I draw arrows from/to other atoms, it works perfectly. However, when I use \draw (o1) .. controls +(180:0.5cm) .. (c1);, the arrow tip is significantly offset, no where near the intended carbon atom. I've already verified that the issue doesn't come from failure to compile twice. Here's the minimal reproducible example. \documentclass[border=10pt]{standalone} \usepackage{chemfig} \usepackage{tikz} \setchemfig{atom sep=7mm, bond offset=1.5pt, atom style={font=\small}} \newcommand{\chemneg}[2][45]{% \charge{#1:1pt=$\scriptscriptstyle-$}{#2}% } \begin{document} \schemestart \chemfig{*6(-(-NO_2)=-(-@{c1}C(=[2]O)-[:-30]O-CH_3)=-=)} \+ \chemfig{@{o1}\chemneg[90]{O}H} \arrow{->} \chemfig{*6(-(-NO_2)=-(-C(-[@{sb1}2]@{o2}\chemneg{O})(-[6]OH)-[@{sb2}:-30]@{o3}O-CH_3)=-=)} \arrow{->} \chemfig{*6(-(-NO_2)=-(-C(=[2]O)-[:-30]\chemneg{O})=-=)} \+ \chemfig{CH_3OH} \schemestop \chemmove[red, -stealth, shorten <= 2pt]{ \draw (o1) .. controls +(180:0.5cm) .. (c1); \draw (o2) .. controls +(180:0.5cm) .. (sb1); \draw (sb2) .. controls +(90:0.5cm) .. (o3); } \end{document}
- Proper language / babel / document settings for Swiss Standard Germanby kalle on March 24, 2026 at 2:03 pm
I would like to create a document following the Swiss Standard German variety, but I am getting incorrect quotation marks (I actually get question marks instead of quotation marks). What settings are recommended to fully support Swiss Standard German? MWE: \DocumentMetadata{ lang=de-CH, } \documentclass[nswissgerman]{report} \usepackage[nswissgerman,provide=*]{babel} \usepackage[german=swiss]{csquotes} \begin{document} \chapter{Einführung} \enquote{Dies ist ein Zitat, das besagt \enquote{sind Zitate nicht toll?}}, und doch wundere ich mich, ob es mit einer Gehaltserhöhung des Generalstabsvorstandsvorsitzenden klappen würde. \end{document}
- Setting fixed text labels for enumerate-based environment according to the item counterby Stephen on March 24, 2026 at 12:47 pm
\documentclass{article} \usepackage{enumitem} \newlist{syntax}{enumerate}{1} \renewcommand{\labelsyntaxi}{\bfseries\ifcase\value{syntaxi}\or Usage\or Argument\or Return\fi} \begin{document} \begin{syntax} \item aaa \item bbb \item ccc \end{syntax} \end{document} I've defined an enumerate-based environment (called syntax) and I want the first three labels are Usage, Argument and Return, respectively. However, the above code gives error. How to fix and what's the reason behind the error? Similar question: enumerate with custom alphabet for items
- Vertical distance between description and enumerate env [duplicate]by Gudrun on March 24, 2026 at 11:48 am
How to minimize the space between Workflow and the first item, please? Probably an easy question, but I was unable to figure it out myself. Many thanks for your help. \documentclass[a4paper]{article} \usepackage{enumitem} \begin{document} \begin{description}[style=nextline] \item[Tool:] Get a kitchen. \item[Workflow:]\leavevmode \begin{enumerate} \item Visit a location \item Pass the food into a processor \item Remove the solid pieces \item Enjoy \end{enumerate} \end{description} \end{document}
- How to stop the effect of the "\appendix" command [closed]by moumou85 on March 24, 2026 at 11:03 am
How to stop the effect of the \appendix command and return to regular numbering instead of letters.
- Index of topics at beginning of documentby Martin on March 24, 2026 at 10:20 am
I have a document, where I describe topics (one page per topic). I want to have a list of all topics together with some additional information at the beginning of the document. So far my solution is this: First I make a file whrere the list is at the end of the file. MWE (file called Themen.tex): \documentclass[a4paper,12pt]{scrartcl} \usepackage{longtable} \newcounter{nummer} \def\Uebersicht{% Nr. & Topic & A & Page \\\hline \endfirsthead Nr. & Topic & A & Page \\\hline \endhead } \usepackage{hyperref} \newcommand{\Thema}[3]{% \refstepcounter{nummer}\label{#3}% \begin{center} \LARGE #1 \end{center} \begin{table}[h!] \centering \begin{tabular}{p{4.3cm}p{1cm}p{11cm}} A: && #2 \end{tabular} \end{table} \hrule \appto\Uebersicht{\getrefnumber{#3} & #1 & #2 & \pageref{#3} \\} } \begin{document} \clearpage \Thema{A}{A}{A} \clearpage \Thema{B}{B}{B} \clearpage \Thema{C}{C}{C} \clearpage \Thema{D}{D}{D} \clearpage \clearpage \begin{longtable}[h!]{r|p{0.48\linewidth}|p{0.34\linewidth}|r} \centering \Uebersicht \end{longtable} \end{document} Afterwards, I rearrange the pages. MWE: \documentclass{scrartcl} \usepackage{pdfpages} \pdfximage{Themen.pdf}% Read entire PDF \edef\totalpages{\the\pdflastximagepages}% Store number of pages \edef\lastbutonepage{\number\numexpr\totalpages-1}% Store last page - 1 \begin{document} \includepdf[pages=last]{Themen} \includepdf[pages=1-\lastbutonepage]{Themen} \end{document} The problem is, that in the end, the cross-references to pages inside the document, as well as external links that I put in the description of the topics do not work. How can I achieve what I want with working links (either with my 2-file-solution or directly)?
- Custom date format for copyright years in a BibLaTeX style: c-prefixed date without breaking sortingby Marlon de Col on March 23, 2026 at 9:55 pm
I am writing a paper whose formatting rules for both citations and the bibliography require that the date of a reference, when it refers to the copyright year, be preceded by a lowercase "c" with no intervening space. Therefore, I would like to be able to assign the date field with the corresponding year preceded by the letter c by implementing a new date format, similar to formats such as <date>~, <date>?, etc., but restricted to accepting only the year. With this, the copyright year would be specified in the bib file as follows: date = {c<year>} Using the authoryear style from BibLaTeX as an example, the following MWE would apply: \documentclass{article} \usepackage[style=authoryear]{biblatex} \setlength{\parindent}{0pt} \begin{filecontents}{\jobname.bib} @article{aksin, author = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent and {\c{C}}etinkaya, Bekir and Ni, Chaoying and B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan}, title = {Effect of immobilization on catalytic characteristics of saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck} reactions}, journaltitle = {J.~Organomet. Chem.}, date = {c2006}, volume = 691, number = 13, pages = {3027-3036}, indextitle = {Effect of immobilization on catalytic characteristics}, } @article{glashow, author = {Glashow, Sheldon}, title = {Partial Symmetries of Weak Interactions}, journaltitle = {Nucl.~Phys.}, date = {c1961}, volume = 22, pages = {579-588}, } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} \section{\citeauthor{aksin}} \verb|\cite{aksin}|: \cite{aksin}. \verb|\textcite{aksin}|: \textcite{aksin}. \section{\citeauthor{glashow}} \verb|\cite{glashow}|: \cite{glashow}. \verb|\textcite{glashow}|: \textcite{glashow}. \printbibliography \end{document} With this MWE, the desired output would be as follows: For reference, the document shown in this screenshot was compiled using the year field instead of date in the bib file; otherwise, the c<year> value is considered invalid and consequently ignored. However, in that case, sorting by year does not work. Given these requirements, is there a way to implement this? I have created a custom BibLaTeX style package with a few modifications that I use exclusively for this paper, so this would be implemented in the package files rather than in the document preamble.
- Why does \DocumentMetadata conflict with package mdframed?by Randall on March 23, 2026 at 5:05 pm
In an effort to meet federal (US) law for accessibility of documents, I have started experimenting with various accessibility enhancements for my LaTeX source files. (As a stable TeX user for over 30 years, this is a big change to process.) Following advice posted here and at the LaTex Tagging Project, I have been including the following as the first line in my source: \DocumentMetadata{lang = en, pdfstandard = ua-2, pdfstandard = a-4f, tagging=on, tagging-setup={math/setup=mathml-SE}} I must say, this has thus far worked marvelously. When I compile using LuaLaTeX, I get a PDF that passes all my institution's accessbility checkers. So far, a lifesaver. The sole issue I've experienced is in using the package mdframed. When I attempt to use the package, as in something like \begin{mdframed} This is a key point! \end{mdframed} I get the following fatal error: l.74 This is a key point! ? h Try typing <return> to proceed. If that doesn't work, type X <return> to quit. No output is created. I have toggled on and off all reasonable combinations of packages, and the error only occurs when mdframed is invoked while the DocumentMetadata is inserted. I feel that I am a bit over my head here, so am looking for an explanation of this conflict or a fix for it. I fully admit that I may have something set incorrectly in the DocumentMetadata call, because I do not completely understand the effect that is having.
- How to protect a comma in a name in biblatex (to cite someone known by a noble title)by Roel on March 23, 2026 at 4:08 pm
I would like to cite J. W. Strutt, who--to the best of my knowledge---is best known as Lord Rayleigh: https://archive.org/details/theorysound03raylgoog/page/108/mode/1up I think the name should appear as "J. W. Strutt, Baron Rayleigh" or---to facilitate looking up "Rayleigh" in a sorted list---"Rayleigh, J. W. Strutt, Baron". The latter format (also shown on archive.org) is something I don't see on a daily basis, so maybe there is a better way. This is how far I got. Since I don't think it is common to show his 'real' family name, but also it should not be abbreviated to initials, I treat it as a prefix. Mind that the extra comma in the name is something the bibliography system (biber+biblatex) will choke on, so I had to hide it. Unfortunately, simple wrapping {,} or obfuscating \char44 did not work so I ended up with this: \documentclass{article} \usepackage[ giveninits=true ]{biblatex} \usepackage[hidelinks]{hyperref} \addbibresource{main.bib} \begin{document} According to \textcite[\href{https://archive.org/details/theorysound03raylgoog/page/108/mode/1up}{p 108}]{Rayleigh1878ThSoundv2}: ``Measured by the resulting potential, a source of given magnitude, i.e. a source at which a given introduction and withdrawal of fluid takes place, is thus twice as effective when close to a rigid plane, as if it were situated in the open; and the result is ultimately the same, whether the source be concentrated in a point close to the plane, or be due to a corresponding normal motion of the surface of the plane itself.'' \printbibliography % Once more with names in a different format: \DeclareNameAlias{author}{family-given} \printbibliography[title={References with `family' name first}] \end{document} @preamble{{\newcommand{\comma}{,}}} @book{Rayleigh1878ThSoundv2, title = {The Theory of Sound}, author = {given=John William, prefix={Strutt\comma\ Baron}, family=Rayleigh}, publisher = {MacMillan \& Co., Ltd.}, date = {1896}, volume = {2}, url = {https://archive.org/details/theorysound03raylgoog} } This just doesn't feel right, but is there a better way?
- Shared counter between xsim and theoremenvironmentby Felix Benning on March 23, 2026 at 9:26 am
The package xsim introduces its own counter for exercises and stores the countervalue to reuse it for the solution. I would like it to share a counter with theorems but I did not manage to make this happen. Is there a way to do this? Essentially like \newtheorem{theorem}{Theorem}[section] \newtheorem{prop}[theorem]{Proposition} share a counter
- evenly-padded horizontal line separator in a table with rows with graphicsby Mampac on March 22, 2026 at 10:35 am
when defining a figure that holds a table of images, how do i ensure even and symmetric padding when using \hline in it? by default, there's no padding before the row that was \hlined. i have the following MRE: \documentclass{article} \usepackage{array} \usepackage{graphicx} \newcolumntype{I}{>{\centering\arraybackslash}m{0.18\linewidth}} % simulate images \newcommand{\fakeimg}{\rule{\linewidth}{2.5cm}} \begin{document} \begin{tabular}{c I I I} & A & B & C \\ row1 & \fakeimg & \fakeimg & \fakeimg \\ \hline row2 & \fakeimg & \fakeimg & \fakeimg \\ \end{tabular} \end{document} this produces the following image, where the rule is stuck tightly to the images on the second row: how do i define the padding in a controlled (tunable) manner so that the optional rule perfectly divides it in half (i want to add the divider only between specific pairs of rows)? i've tried interjecting a bunch of artifical spaces and padding in the rows before/after, but they all break apart when i wish for a small-scale padding of, say, 0.3ex: my attemps yield assymetrical padding where the padding before second row is smaller than padding after the first row.
- tikz, scaling widths of linesby Zarko on March 17, 2026 at 2:39 pm
It seems (or is apparently) that thickness of lines is hard coded. Consequently when drawing a line, the use for example of scale=2 only makes the line longer and its thickness is not changed, see MWE below: \documentclass[margin=3mm, varwidth]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{LA/.style = {-Straight Barb, line width=1mm}} \begin{document} \begin{tikzpicture} \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \begin{tikzpicture}[scale=2] \draw[LA] (0,0) -- ++ (2,0); \end{tikzpicture} \end{document} Is there some trick by which the thickness of the line will also be scaled? The best way would be as option of the line style, which will have effect just on this particular line. My quick search on this site so far didn't give me any suggestion ...