Hot
- Change the anchor of the arrow tip from arrows.metaby Sigur on March 28, 2026 at 7:22 pm
I'm using the Circle[] arrow tip from arrows.meta TikZ library. But I'd like to have the center of the circle at the segment points. Observe below that the circle at the (0,0) is not exactly there. MWE \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \draw[{Circle[]}-{Circle[]}] (0,0) -- (0.5,1); \draw[{Circle[]}-{Circle[]}] (0,0)+(90:1cm) -- +(-90:1cm); \end{tikzpicture} \begin{tikzpicture} \draw[{Circle[]}-{Circle[]}] (0,0) -- (0.5,1); \draw[{Circle[]}-{Circle[]}] (0,1) -- (0,-1); \end{tikzpicture} \end{document}
- How to embed and syntax-highlight EBNF in a LaTeX documentby IA7 on March 28, 2026 at 4:40 pm
I am currently writing a LaTeX document which will involve quite a fair bit of EBNF (Extended Backus-Naur Form). It would be incredibly convenient for the reader of this document if the EBNF was automatically syntax highlighted, but I cannot find a way to do this. If it helps, I am using luaLaTeX and my EBNF snippets are all in external files so I don't have to surround them with a verbatim environment.
- .bib file not working due to a .bib entryby Sam Street on March 28, 2026 at 4:15 pm
Why do .bib files sometimes not work due to bibliography entries? (I do not have any specific problem right now, but thought it might be good to have a page that addresses common issues for example some special characters cause an issue).
- A follow-up question on the scale behavior of different approaches of `\pic`?by Explorer on March 28, 2026 at 2:48 pm
My question is arisen from my previous one, and more specific: As Sammy contributed the excellent solution, says: I find nodes to be an unreliable way to draw circles as the size of the circle depends on it's contents and the value of inner sep. I therefore set inner sep=0pt and specified minimum size. I have the following test example further more: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{calc} \begin{document} \tikzset{ methodA/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=cyan,inner sep=3pt] {}; }, methodB/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=magenta,inner sep=0pt,minimum size=.35cm] {}; }, methodC/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm]; % manual decide the "pos-0.75" \fill[violet] ($(1,0)+(45:1cm)$) circle[radius=3pt]; % but I dislike this method, which need two paths, I would always prefer only one command, if possible.And not always easy to control the "pos" instead of angle... }, } \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(1)inner sep+scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(2)minimum size+scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(3)path+scale}; \end{tikzpicture} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [transform shape,scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(4)inner sep+transform shape,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [transform shape,scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(5)minimum size+transform shape,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [transform shape,scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(6)path,scale}; \end{tikzpicture} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [transform shape,scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(7)inner sep+transform canvas,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [transform shape,scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(8)minimum size+transform canvas,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [transform shape,scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(9)path+transform canvas,scale}; \end{tikzpicture} \end{document} which gives: Now let's consider in such case, I want to \pic the following figure: That is actually a logo, which I want to be \pic[scale](or rotate) at other positions for multiple times. Just to plot the figure as \pic, there are at least three methods, I think: \tikzset{ methodA/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=cyan,inner sep=3pt] {}; }, methodB/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=magenta,inner sep=0pt,minimum size=.35cm] {}; }, methodC/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm]; % manual decide the "pos-0.75" \fill[violet] ($(1,0)+(45:1cm)$) circle[radius=3pt]; % but I dislike this method, which need two paths, I would always prefer only one command, if possible.And not always easy to control the "pos" instead of angle... }, } In the test result above, their behaviour varied with: simply scale=... transform canvas={scale=...} transform shape,scale=... My question is: I wonder why these scale setting on three approach of \pic are different? (A quite natural follow-up question. IMHO, that is the same one, not asking multiple questions at the same time), when I know "That is actually a logo, which I want to \pic[scale](or rotate) at other positions for multiple times." in advance, how could I select the proper drawing method, to avoid further issues later? Edit My simple opinion on the three approaches without considering that it would be \pic and scale: I would prevent two \path method(method C), which I think that is not elegant syntax enough compared with the others With node on the path and control the radius, just with one command, I prefer these two(method A and B) As for trade-off between inner sep=0pt,minimum size=10pt and inner sep=1cm, I think the first one is better, for the sake of better semantics of a circle node...
- Unwanted gap after CC: when wrapping long email listby Erwann on March 28, 2026 at 2:32 pm
When the Cc: line is long, LaTeX wraps it but leaves an extra gap after the label. I don’t want to use `tabular because the content should wrap. Are there any other options? \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{tcolorbox} \usepackage{hyperref} \usepackage{parskip} \pagestyle{empty} % --- email header --- \newcommand{\EmailSubject}{Example Email Subject} \newcommand{\EmailTo}{recipient@example.com} \newcommand{\EmailCc}{cc1@long-example.com, cc2@long-example.com, cc3@example.com, cc4@example.com} \begin{document} \begin{center} {\LARGE\bfseries Example Flyer Title} \end{center} \bigskip \begin{center} \textbf{You can use the following email template:} \end{center} \bigskip \begin{tcolorbox}[colback=gray!5,colframe=black,title=Email Template] \textbf{Subject:} \EmailSubject \medskip \textbf{To:} \EmailTo \medskip \textbf{Cc:} \EmailCc \bigskip Dear Recipient, \medskip [Body of the email goes here.] \medskip Sincerely, \medskip [Name] [Link or Contact Info] \end{tcolorbox} \end{document}
- When and why do we change the order of expansion?by user110391 on March 28, 2026 at 1:19 pm
Let me know if this question is too broad and I will try to narrow it. So, I am trying to learn expl3, and I am using Gemini, a code project and various articles as my tools. The main article I've been reading is this one, and it has helped. So has Gemini. Gemini is making a lot of mistakes and causing confusion, but for some of the basics, it has helped me a lot (I noticed my ability to understand the linked-to article improved after talking with Gemini). But now, Gemini is seemingly no longer able to teach me, because I've reached the end of its more-accurate-than-not region. It cannot precisely and rigorously explain how TeX does macro expansion. As a result, I do not understand it. Gemini seems to have a bias to unnecessarily utilize expansion signatures and use/eval functions (and therefore it has to utilize more _protected and \exp_not:n functions), which is really making a mess of its code. The code compiles correctly, but with massive amounts of unnecessary pre-expansion. And that is thusly making me really confused about when and why we change the order of expansion. [BTW, perhaps unneccesary expansion combined with nonetheless relatively advanced code is a good indicator of AI-written LaTeX?] So, for context, here is the extent of my understanding till now, taken from the linked-to article: \newcommand{\cmda}{abcd} \uppercase{abcd\cmda} %ABCDabcd So, in this example, we're shown that using \uppercase here does NOT produce the output ABCDABCD. This is explained through the fact that \uppercase is acting on letters, and leaves control sequences unchanged. Now, \cmda is control sequence, but its defintion is a string of letters. So, if we could pre-expand \cmda, then we could get the result ABCDABCD. The article explains two ways to do this, but I'm more interested in why we have to do this in the general case. And I wonder if the above example gives me a general understanding of when expansion is needed. So, when we have a function and we DON'T need to expand it, is it simply because the control sequence is "readable/expandable" by that function, and the function is thusly able to act on its definition? My current understanding can be summed up as this: If you want the function to act on a control sequence's definition, and if the function doesn't expand its input for you, you have to expand the input for it. How to expand depends on how many layers you want to expand, and what the control sequence is (function or variable). Knowing when to pre-expand (and knowing when to protect from pre-expansion) thus reduces to knowing which functions don't, and do, expand for you. I have a feeling this is insufficient, however. Like it isn't a fully general explanation. And even if it is general, it seems imprecise. I would like to be able to break things down into the eyes-vs-mouth-vs-stomach analogy and understand how TeX parses the text and when it expands each component thereof. I currenly have an idea of the mouth expanding everything with a default order, and then the text reaches the stomach fully expanded, and there it gets converted by the PDF engine into points on paper. Understanding this pipeline at high level of detail and rigor would make everything a lot simpler to me. The core idea of expansion and the ordering thereof is simple, but the devil is in the details.
- A \catcode, \everypar and environment problemby sgmoye on March 28, 2026 at 11:49 am
I'm trying to make a simple topic-comment environment. The code here accomplishes this, except for the very first entry. Making the ; active is straightforward, but does not seem to take effect for the first line of the environment. Why and what am I missing? \documentclass{article} \usepackage[textwidth=3in]{geometry} \usepackage{xparse} \newlength{\ingindent} \begingroup \lccode`~=`\^^M \lowercase{% \endgroup%% \NewDocumentCommand{\topic}{s o u{~}}% #3=the line {% \hangindent3em \leftskip\ingindent \bfseries\sffamily #3\par \normalfont \addtolength{\ingindent}{1em}% }% }% \NewDocumentCommand{\comment}{}{% comment in italics \leavevmode\normalfont\itshape } \begingroup \catcode`;=\active \gdef\changesc{\let;=\comment} \endgroup \NewDocumentEnvironment{showit}{O{}}{% \parskip1ex \catcode`;=\active \changesc \obeylines \everypar={\topic} }{} \parindent0pt \begin{document} \thispagestyle{empty} \begin{showit} ;This is a start without a topic and the <semicolon> is apparently not yet active~--~why? Adding \string\leavevmode\ or \string\null\ before the semicolon does work topic 1 topic 2; with some comment topic 3; a comment with actually rather a lot of bla bla bla ;a comment without topic, and the <semicolon> is active topic 4; and a concluding comment a lonely topic \end{showit} \end{document}
- Aligning Theorem/Definition Numbering with Sections in Slidesby RFZ on March 28, 2026 at 10:14 am
I am preparing slides for a talk, and everything looks good. However, I want the numbering of my Definitions, Theorems, and Propositions to be aligned with the sections and to be non-repeating, something like this: Section 1: Theorem 1.1 Definition 1.2 Proposition 1.3 Theorem 1.4 Section 2: Theorem 2.1 Definition 2.2 In my current version, the theorems, definitions, and propositions are numbered sequentially (1, 2, 3, …). How can I fix my current code? Here is the relevant block of my code: \documentclass[]{beamer} \usepackage{tikz} \usepackage{amsthm,amsmath} % ------------------------ % Unified block style % ------------------------ \setbeamercolor{block title}{bg=blue, fg=white} \setbeamercolor{block body}{bg=blue!20, fg=black} % ------------------------ % Custom theorem style using plain 'block' % ------------------------ \makeatletter \def\th@unified{% \normalfont \def\inserttheoremblockenv{block} % use plain block } \makeatother \theoremstyle{unified} % ------------------------ % Single counter for all numbered environments % ------------------------ \newtheorem{proposition}[theorem]{Proposition} % shares the counter % ------------------------ % Unnumbered environments % ------------------------ \newtheorem*{remark}{Remark} \newtheorem*{question}{Question} \newtheorem*{openquestion}{Open question} % ------------------------ % Beamer settings % ------------------------ \setbeamertemplate{theorems}[numbered] \mode<presentation>{\usetheme{Madrid}} \setbeamertemplate{caption}[numbered] \setbeamertemplate{bibliography item}{\insertbiblabel} % ------------------------ % Title info % ------------------------ \title[XX]{XX} \author{XX} \institute[]{XX} \date{XX} \begin{document} \end{document}
- How to change vertical spacing above and below lists when using the parskip option of KOMA and enumitem?by Simon on March 28, 2026 at 12:06 am
I use a template that utilizes the document class scrreprt and thus KOMA and 1.5x line spacing. Following given guidelines, paragraphs should be separated by vertical spacing and not by indentation, which is why I put the option parskip=full- in the preamble. In order to adopt the appearance of lists to the given guidelines, I included the package enumitem and set the parameters topsep, partopsep, parsep, and itemsep, accordingly. Almost everything works as intended, with one exception: The vertical spacing above and below lists appears bigger than intended and should be smaller. I have prepared an MWE that describes the desired result. How can the MWE be modified, so that the issue regarding the vertical spacing is resolved? Changing topsep=0pt to topsep=-18pt resolves this issue only for below the list and topsep=-36pt only for above the list, despite them having a symmetric effect according to both answers on \topsep, \itemsep, \partopsep, \parsep - what do they each mean (and what about the bottom)?. Thanks in advance! P.S.: The lists without KOMA also do not fit the given guidelines, yet, it should be mentioned that KOMA changes the formatting of lists (this behavior is mentioned in its documentation) on top. MWE: \documentclass[a4paper,12pt,parskip=full-]{scrreprt} \usepackage[left=3.5cm,right=3cm,top=3.5cm,bottom=2.5cm]{geometry} \pagenumbering{gobble} \usepackage[onehalfspacing]{setspace} \usepackage{enumitem} \setlist{topsep=0pt,partopsep=18pt,parsep=18pt,itemsep=-18pt}%alternatively:topsep=-18pt or topsep=-36pt \begin{document} I want to write about \begin{enumerate} \item this, and \item that, \end{enumerate} without ending the paragraph, so there should appear 1.5x line spacing (= 18pt) above, within, and below the list, but not the increased vertical spacing of a full line that is reserved for the space between the end and the beginning of two paragraphs as follows. \par Furthermore, a list usually has something to do with its preceding and/or following text and hence is put in the same paragraph like in the example above or here, where it is preceded by a colon: \begin{enumerate} \item A sentence about this, and \item one about that \end{enumerate} ends right here. However, a list could potentially also have nothing to do with its preceding and/or following text and hence they are put into seperate paragraphs -- of which one ends with this sentence -- and show the increased vertical spacing of a full line. \par \begin{enumerate} \item A sentence on these. \item A sentence on those. \end{enumerate} \par This here is about something totally different, hence the new paragraph. Last but not least, one should not forget about paragraphs within an item of a list, as they should be seperated by the increased vertical spacing of a full line: \begin{enumerate} \item The first paragraph of the first item. \par The second paragraph of the first item. \item The second item. \end{enumerate} This line concludes the MWE. \end{document} Edit To clarify, what I try to achieve, here is an illustration (https://i.sstatic.net/AJfwWqn8.png) and its description: The red vertical spacing should be as big as the blue one (18pt). The yellow vertical spacing should be as big as the purple one (1 full line/vertical spacing between paragraphs). topsep=-36pt and a theoretical bottomsep=-18pt would achieve just that.
- Large table column overlap (with `tabular`) and UTF-8 handling issues in `listings` (`literate`), seeking an automatic or reusable character mappingby Juan A. on March 27, 2026 at 10:10 pm
I’m working on a LaTeX document to specify an API for my university, and I’ve encountered a couple of issues: In my table, the text in the first column overlaps or collides with the content in the second column. How can I properly format the table to prevent this and ensure correct alignment and spacing? I’m defining a custom JSON language using listings (in json-style.sty) with UTF-8 support via the literate option. Currently, I have to manually declare each accented or special character one by one. Is there a way to reuse or import an existing set of literate definitions (such as those in accents-style.sty) when defining a new language, so I don’t have to duplicate all those character mappings (something like literate += new_definitions)? Any guidance or best practices would be greatly appreciated. Cheers, Juan File: accents-style.sty % Definición de colores para JSON \definecolor{jsonstring}{rgb}{0.70,0.10,0.10} \definecolor{jsonnumber}{rgb}{0.05,0.45,0.05} \definecolor{jsonbool}{rgb}{0.55,0.15,0.55} \definecolor{jsonpunct}{rgb}{0.20,0.20,0.20} \definecolor{gray}{rgb}{0.5,0.5,0.5} % Soporte para UTF-8 \usepackage[utf8]{inputenc} % Comandos auxiliares para caracteres \newcommand{\jsonpunct}[1]{{\textcolor{jsonpunct}{#1}}} \newcommand{\jsonnumchar}[1]{{\textcolor{jsonnumber}{#1}}} % Configuración general de listings % Source - https://tex.stackexchange.com/a/574950 % Posted by Rmano, modified by community. See post 'Timeline' for change history % Retrieved 2026-03-27, License - CC BY-SA 4.0 % Define JSON language style \lstdefinelanguage{json}{ inputencoding = utf8, % Input encoding extendedchars = true, % Extended ASCII showspaces=false, % No mostrar espacios showtabs=false, % No mostrar tabulaciones breaklines=true, % Permitir saltos de línea breakatwhitespace=true, % Romper solo en espacios basicstyle=\ttfamily\small, upquote=false, % No usar comillas tipográficas morestring=[b]", % Cadenas entre comillas dobles stringstyle=\color{jsonstring}, % Color para cadenas morekeywords={true,false,null}, % Palabras clave JSON keywordstyle=\color{jsonbool}\bfseries, % Color y estilo para booleanos y null % numbers=left, % numberstyle=\tiny\color{gray}, % stepnumber=1, literate = { {0}{{{\jsonnumchar{0}}}}{1} {1}{{{\jsonnumchar{1}}}}{1} {2}{{{\jsonnumchar{2}}}}{1} {3}{{{\jsonnumchar{3}}}}{1} {4}{{{\jsonnumchar{4}}}}{1} {5}{{{\jsonnumchar{5}}}}{1} {6}{{{\jsonnumchar{6}}}}{1} {7}{{{\jsonnumchar{7}}}}{1} {8}{{{\jsonnumchar{8}}}}{1} {9}{{{\jsonnumchar{9}}}}{1} {:}{{{\jsonpunct{:}}}}{1} {,}{{{\jsonpunct{,}}}}{1} {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 {ẞ}{{\SS}}1 {ç}{{\c{c}}}1 {Ç}{{\c{C}}}1 {ø}{{\o}}1 {Ø}{{\O}}1 {å}{{\aa}}1 {Å}{{\AA}}1 {ã}{{\~a}}1 {õ}{{\~o}}1 {Ã}{{\~A}}1 {Õ}{{\~O}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1 {¡}{{!`}}1 {„}{\quotedblbase}1 {“}{\textquotedblleft}1 {–}{$-$}1 {°}{{\textdegree}}1 {º}{{\textordmasculine}}1 {ª}{{\textordfeminine}}1 {£}{{\pounds}}1 {©}{{\copyright}}1 {®}{{\textregistered}}1 {«}{{\guillemotleft}}1 {»}{{\guillemotright}}1 {Ð}{{\DH}}1 {ð}{{\dh}}1 {Ý}{{\'Y}}1 {ý}{{\'y}}1 {Þ}{{\TH}}1 {þ}{{\th}}1 {Ă}{{\u{A}}}1 {ă}{{\u{a}}}1 {Ą}{{\k{A}}}1 {ą}{{\k{a}}}1 {Ć}{{\'C}}1 {ć}{{\'c}}1 {Č}{{\v{C}}}1 {č}{{\v{c}}}1 {Ď}{{\v{D}}}1 {ď}{{\v{d}}}1 {Đ}{{\DJ}}1 {đ}{{\dj}}1 {Ė}{{\.{E}}}1 {ė}{{\.{e}}}1 {Ę}{{\k{E}}}1 {ę}{{\k{e}}}1 {Ě}{{\v{E}}}1 {ě}{{\v{e}}}1 {Ğ}{{\u{G}}}1 {ğ}{{\u{g}}}1 {Ĩ}{{\~I}}1 {ĩ}{{\~\i}}1 {Į}{{\k{I}}}1 {į}{{\k{i}}}1 {İ}{{\.{I}}}1 {ı}{{\i}}1 {Ĺ}{{\'L}}1 {ĺ}{{\'l}}1 {Ľ}{{\v{L}}}1 {ľ}{{\v{l}}}1 {Ł}{{\L{}}}1 {ł}{{\l{}}}1 {Ń}{{\'N}}1 {ń}{{\'n}}1 {Ň}{{\v{N}}}1 {ň}{{\v{n}}}1 {Ő}{{\H{O}}}1 {ő}{{\H{o}}}1 {Ŕ}{{\'{R}}}1 {ŕ}{{\'{r}}}1 {Ř}{{\v{R}}}1 {ř}{{\v{r}}}1 {Ś}{{\'S}}1 {ś}{{\'s}}1 {Ş}{{\c{S}}}1 {ş}{{\c{s}}}1 {Š}{{\v{S}}}1 {š}{{\v{s}}}1 {Ť}{{\v{T}}}1 {ť}{{\v{t}}}1 {Ũ}{{\~U}}1 {ũ}{{\~u}}1 {Ū}{{\={U}}}1 {ū}{{\={u}}}1 {Ů}{{\r{U}}}1 {ů}{{\r{u}}}1 {Ű}{{\H{U}}}1 {ű}{{\H{u}}}1 {Ų}{{\k{U}}}1 {ų}{{\k{u}}}1 {Ź}{{\'Z}}1 {ź}{{\'z}}1 {Ż}{{\.Z}}1 {ż}{{\.z}}1 {Ž}{{\v{Z}}}1 {ž}{{\v{z}}}1 } } File: API.tex \section{Funcionalidades Principales} % \begin{landscape} % Esto rotará la tabla si es necesario \resizebox{\textwidth}{!}{ \begin{tabular}{ |p{\firstcolwidth}| % Letra c| % Endpoint c| % Método c| % Descripción c| % Parámetros c| % Request Body c| % Código c| % Estado c| % Response Body } \hline %% ------------------------------ %% Encabezados de la tabla %% ------------------------------ \textbf{ Letra} & \textbf{Endpoint} & \textbf{Verbo} & \textbf{Descripción} & \textbf{Parámetros} & \textbf{Request Body} & \textbf{Código} & \textbf{Estado} & \textbf{Response Body} \\ \hline %% ------------------------------ %% auth/login %% ------------------------------ \multirow{2}{\firstcolwidth}{\raggedright\small\textbf{1.1 Ingreso al sistema (login):} \par El sistema deberá permitir el acceso a la plataforma mediante autenticación basada en email y contraseña. Este mecanismo será común para todos los usuarios, independientemente de su rol (Cliente, Preparador de Pedidos o Administrativo). \par El sistema deberá validar las credenciales ingresadas y responder indicando si el acceso ha sido concedido o rechazado, sin exponer información sensible. } & \multirow{2}{*}{\texttt{/auth/login}} & \multirow{2}{*}{POST} & \multirow{2}{*}{TODO: Descripción} & \multirow{2}{*}{N/A} & \multirow{2}{*}{\resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.1/request-body.json}}} & 200 & OK & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.1/response-body-200.json}} \\ \cline{7-9} & & & & & & 401 & Unauthorized & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.1/response-body-401.json}} \\ \hline %% ------------------------------ %% auth/register %% ------------------------------ \multirow{4}{\firstcolwidth}{\raggedright\small\textbf{1.2 Registro de cliente: el cliente podrá registrarse en la plataforma.} \par Rol: Sin rol (anónimo) en el registro se solicita: \begin{itemize} \item \textbf{Nombre}, el mismo no puede estar vacío, mínimo un caracter. \item \textbf{Apellido}, el mismo no debe ser menos a 3 caracteres ni mayor que 25. \item \textbf{Email}, debe ser un formato de email válido. \item \textbf{Teléfono}: debe ser un teléfono móvil válido en este caso para Uruguay, prever que la plataforma podría tener actividad en otro país. \item \textbf{Contraseña}: al menos una mayúscula, una minúscula, un símbolo, un número, no debe tener secuencias de números y debe ser de largo mínimo de 15 caracteres y máximo de 25. \item Al crear el cliente se deberá generar un identificador único para el mismo que puede ser autonumérico. \end{itemize} } & \multirow{4}{*}{\texttt{/auth/register}} & \multirow{4}{*}{POST} & \multirow{4}{*}{TODO: Descripción} & \multirow{4}{*}{N/A} & \multirow{4}{*}{\resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.2/request-body.json}}} & 201 & Creado & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.2/response-body-201.json}} \\ \cline{7-9} & & & & & & 400 & Error en la solicitud & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.2/response-body-400.json}} \\ \cline{7-9} & & & & & & 409 & Conflicto duplicado (email) & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.2/response-body-409.json}} \\ \cline{7-9} & & & & & & 422 & No se cumple el dominio & \resizebox{\jsonwidth}{!}{\lstinputlisting[language=json]{code/Funcionalidad/1.2/response-body-422.json}} \\ \hline %% ------------------------------ %% /products %% ------------------------------ \end{tabular} } File: Main.tex \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{geometry} \usepackage{longtable} \usepackage{graphicx} \usepackage{multirow} \usepackage{lscape} \usepackage{ragged2e} \usepackage{listings} \usepackage{color} \usepackage{tabularx} % En el preámbulo \geometry{margin=1.5cm} % Define JSON cell width variable \newlength{\jsonwidth} \setlength{\jsonwidth}{3cm} % Define first column width variable \newlength{\firstcolwidth} \setlength{\firstcolwidth}{7cm} \usepackage{lscape} % Si quieres rotar la tabla en caso de que sea muy ancha \input{.style/code-style.sty} \input{.style/json-style.sty} \begin{document} \input{informe/API.tex} \end{document}
- Different types of lines in tree diagramby user242399 on March 27, 2026 at 5:25 pm
I am making a horizontal tree diagram and want the lines (or part of them) to look different in different parts of the diagram. I want to use continuous and dashed lines. Below is an example of what I want to be able to do. I want the lines to be dashed near the root and continuous as they get close to the nodes. The lines can be slightly curved or not, but I specifically do not want them to meet at the root. And a MWE: \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{trees} \begin{document} \begin{tikzpicture}[ grow=right, level distance=3cm, sibling distance=1.5cm, every node/.style={thick, minimum size=8mm} ] \node {Root} child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {C} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {B} child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B3} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B2} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B1} } } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {A} }; \end{tikzpicture} \end{document}
- Ignoring the tail of the letter "g" in setting the baseline of text in nodes of a tikz diagramby user143462 on March 27, 2026 at 4:22 pm
I would like the baseline of "with nitrogen" to be aligned with the bottom edge of the square shaded gray. The bottom of the tail (descender) in the "g" is currently setting the baseline for the phrase. I tried using \makebox[0pt]. Same edit for the other node. \documentclass[10pt]{amsart} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=1cm,y=1.5cm] %The key is drawn. The keys in other bar graphs have sample regions that are squares with edge length 0.25 centimeters. As the vertical dimension is scaled by 150%, the heights of the sample squares must be scaled by 2/3. \path[fill=gray] (6, {2 + (2/3)*0.125}) -- (6.25, {2 + (2/3)*0.125}) -- (6.25, {2 + (2/3)*0.375}) -- (6, {2 + (2/3)*0.375}) -- cycle; \draw (6, {2 +(2/3)*0.125}) -- (6.25, {2 +(2/3)*0.125}) -- (6.25, {2+(2/3)*0.375}) -- (6, {2+(2/3)*0.375}) -- cycle; \node[anchor=south west, inner sep=0, font=\small] at (6.375, {2 + (2/3)*0.125}){\makebox[0pt][l]{with nitrogen}}; \path[fill=black] (6, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.375}) -- (6, {2 - (2/3)*0.375}) -- cycle; \draw (6, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.375}) -- (6, {2 - (2/3)*0.375}) -- cycle; \node[anchor=south west, inner sep=0, font=\small] at (6.375, {2 - (2/3)*0.375}){without nitrogen}; \draw (5.875, {2 - (2/3)*0.5}) -- (5.875, {2 + (2/3)*0.5}) -- (8.85, {2 + (2/3)*0.5}) -- (8.85, {2 - (2/3)*0.5}) -- cycle; \end{tikzpicture} \end{document}
- Scale the \pic failed even with transform canvas?by Explorer on March 27, 2026 at 3:13 pm
I have the following tikzpicture with \pic: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[ orbit/.pic={ \draw[ultra thick,gray] (0,2) arc[start angle=90,delta angle=360,x radius=.85cm, y radius=2cm] node[pos=.6,circle,fill=white,minimum size=15pt] {} node[pos=.6,circle,fill=gray] {} ; }, atom/.pic={\fill[#1] circle[radius=8pt];}, nuclear/.pic={ \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} \pic {atom=gray}; } ] % \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; % \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} % \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} % \pic {atom=gray}; \pic {nuclear}; \end{tikzpicture} \end{document} That is what I was after! Then I want to add this the the chapter, noted that it need lualatex with ctexbook: \documentclass[fontset=fandol]{ctexbook} \usepackage[ a4paper, hmargin=1.5cm, vmargin=2.5cm, ]{geometry} \usepackage{zhlipsum} \usepackage{tikz} \newcommand\chaptertitleformat[1]{% \begin{tikzpicture}[ orbit/.pic={ \draw[ultra thick,gray] (0,2) arc[start angle=90,delta angle=360,x radius=.85cm, y radius=2cm] node[pos=.6,circle,fill=white,minimum size=15pt] {} node[pos=.6,circle,fill=gray] {} ; }, atom/.pic={\fill[##1] circle[radius=8pt];}, nuclear/.pic={ \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} \pic {atom=gray}; } ] \draw[thick,magenta] (1.25,-.2) node[circle,draw,fill=gray!75,inner sep=1.5pt,anchor=west] {} -- node[pos=.15,above,anchor=south] {#1} % pic[pos=0.9,above=1cm,transform canvas={scale=0.5}] {nuclear} %<-!! here pic[pos=0.9,above=1cm=scale=0.5] {nuclear} %<-!! here ++(.85\textwidth,0) node[circle,draw,fill=gray!75,inner sep=1.5pt,anchor=west] {} ; \end{tikzpicture}% } \ctexset{ chapter = { name = {}, numbering = false, titleformat = \chaptertitleformat } } \begin{document} \chapter{AAAA} \section{aaaa} \zhlipsum[1-3] \end{document} I was after something as below: However, I have tried scale=0.5 or transform canvas={scale=0.5}, but all failed, it didn't scale all the \pic! I was not sure that caused by nested \pic? If possible, I don't want to modifiy the tikzpicture code too much, how to scale all the \pic in this specific case?
- tabular text besides imageby Viesturs on March 27, 2026 at 12:32 pm
In a tabular environment, text needs to be placed symmetrically besides a drawing: Code: \documentclass[a4paper]{article} \usepackage{graphicx} \begin{document} \begin{tabular}[t]{@{}c@{\hspace{0.5cm}} l@{}} \includegraphics[width=0.9cm]{example-image-a} & \begin{minipage}[t]{10cm} % [t] ensures top alignment line 1\\ line 2\\ \end{minipage} \end{tabular} \end{document} Output: Text is hanging below the image. How to place the image and text side by side symmetrically?
- Access to overlay information in beamer article class?by JSpitzm on March 27, 2026 at 10:40 am
I know that beamerarticle does not know much of overlays. Is there still a way to access slide changes that would happen in presentation mode from within article mode maybe by patching some beamer(article) definitions? Background is that I would like to add in my article (i.e. the notes to the presentation) markers on each slide change. This is easy for new frames, but I didn't find a way to also do it for new slides within a frame (\beamer@slideinframe is always 1). Edit: here is a MWE as requested: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{beamerarticle} % Define slide change marker \newcommand*\fw{[PP]} % Add marker when new frame starts \AddToHook{env/frame/begin}{% \AddToHookNext{para/begin}{\llap{\fw\hspace{1em}}} } \begin{document} \begin{frame} A new frame starts \begin{itemize}[<+->] \item One \item Two \item Three \end{itemize} \end{frame} \begin{frame} Another frame starts \end{frame} \end{document} The output is: What I want is to add the [PP] marker on every slide change (not only new frame). Consider it an indicator to click forward to the next slide.
- `crossreftools` command `crtcref{...}` does not include environment nameby PhoemueX on March 27, 2026 at 10:00 am
I am trying to follow this answer to fix the references generated by cleveref in section titles. However, the command crtcref proposed in that answer only gives the number of the theorem, without the "name" (i.e., "Theorem" or "theorem"). Here is my minimal code and below the content of the aux file. \documentclass{article} \usepackage{hyperref} \usepackage{cleveref} \newtheorem{theorem}{Theorem}[section] \usepackage{crossreftools} \pdfstringdefDisableCommands{% \let\Cref\crtCref \let\cref\crtcref } \listfiles \begin{document} \section{Test} \begin{theorem}\label{thm:main} text \end{theorem} many pages \section{Proof of \Cref{thm:main}} % correctly typeset, but bookmark does not include "theorem" \crtCref{thm:main}\\ % only prints "1.1" \crtcref{thm:main} % only prints "1.1" \end{document} \relax \providecommand\hyper@newdestlabel[2]{} \providecommand\HyField@AuxAddToFields[1]{} \providecommand\HyField@AuxAddToCoFields[2]{} \@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{section.1}\protected@file@percent } \newlabel{thm:main}{{1.1}{1}{Test}{theorem.1.1}{}} \newlabel{thm:main@cref}{{[theorem][1][1]1.1}{[1][1][]1}{}{}{}} \@writefile{lla}{\contentsline {section}{\numberline {\crtrefnumber{thm:main}}thm:main}{1}{theorem.1.1}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {2}Proof of \Cref {thm:main}}{1}{section.2}\protected@file@percent } \gdef \@abspage@last{1} Finally, here are the versions of the relevant packages: cleveref.sty 2018/03/27 v0.21.4 Intelligent cross-referencing crossreftools.sty 2020/07/19 - v1.0
- Table with varying number of cells per row [duplicate]by fpuentegomez on March 27, 2026 at 8:45 am
I am trying to replicate the table in the image: As you can see, it has varying number of cells in some of the rows. Sample of what I've tried so far (contains only the rows with varying number of cells): \documentclass{article} \usepackage{tabularx} \begin{document} % 1st table with only 1 cell per row \begin{tabularx}{\textwidth}{|>{\centering\arraybackslash}X|} \hline \textbf{LX -- Left Seat LVO}\\ \end{tabularx} % 2nd table with 4 cells per row \begin{tabularx}{\textwidth}{|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|} \hline \textbf{Weights/CG} & A320 & A330 & A350\\ \end{tabularx} % 3rd table with one cell per row \begin{tabularx}{\textwidth}{|>{\centering\arraybackslash}X|} \hline Profile A: Takeoff Perf: FlySmart\\ \end{tabularx} % 4th table with 5 cells per row \begin{tabularx}{\textwidth}{|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|} \hline \textbf{Weights/CG} & A320 CEO & A320 NEO & A330 & A350\\ \hline \end{tabularx} \end{document} I have tried to concatenate tabularx environments because I would like it to fill the whole page laterally, but the problem is that those are different tables, which creates two problems: There are tiny (but still noticeable) gaps in the borders of the cells right after every \end{tabularx} If the "whole table" doesn't fit in the page it is split by one of the \begin{tabularx} instead of filing the page. Is it possible to create everything in a single table? Are there other table packages that you would recommend? Thank you very much in advance
- The indentation of the proof name is not right when invoking babel under some settingsby M. Logic on March 27, 2026 at 8:09 am
First a minimal working sample is as follows. \documentclass{ctexbook} \usepackage[bidi=default,main=chinese,provide=*]{babel} \babelprovide{russian} \babelfont[russian]{rm}[Scale=MatchUppercase, ItalicFont={NewCM10-Italic.otf}, BoldFont={NewCM10-Bold.otf}, BoldItalicFont={NewCM10-BoldItalic.otf}]{NewCM10-Regular.otf} \babelfont[russian]{sf}[Scale=MatchUppercase, ItalicFont={NewCMSans10-Oblique.otf}, BoldFont={NewCMSans10-Bold.otf}, BoldItalicFont={NewCMSans10-BoldOblique.otf}]{NewCMSans10-Regular.otf} \babelfont[russian]{tt}[Scale=MatchUppercase, ItalicFont={NewCMMono10-Italic.otf}, BoldFont={NewCMMono10-Bold.otf}, BoldItalicFont={NewCMMono10-BoldOblique.otf}]{NewCMMono10-Regular.otf} \usepackage{amsthm} \theoremstyle{theorem} \newtheorem{theorem}{定理} \begin{document} \begin{theorem} 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{theorem} \begin{proof} 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{proof} \begin{proof}[解答] 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{proof} \end{document} As you see, in order to input some non-Chinese texts I invoke the babel package, and to solve the problem in the link I add main=chinese,provide=* before the babel package. But it makes the indentation of the proof name be not right, while to my surprise the the indentation of the proof name resetted is right. Note that I use MacTex 2026 the latest version, and the problem comes out after I update it. Is there is any way to fix this when I still add main=chinese,provide=* before the babel package?
- Banded Multicolored Outlined With Copy Paste And Arbitrary Colors LuaLaTeXby keymasta on March 27, 2026 at 5:02 am
The spec: Any number of (arbitrary) color bands that we specify filling text Stroked outline Same positioning as normal text No extra text in the pdf stream (for copy-paste behavior you would expect) Ok and we're back to it! Previous versions have led here. None of the solutions so far have checked every box. We got as far as implementing 1-3. This is why this question is not a duplicate of the linked questions. None of the linked solutions implement 4 which is important to me. They all draw the text multiple times which unfortunately shows up in the pdf stream. I think that it is because for each \node the text is written again, This final version should have completely normal text-selection behavior, i.e, only ONE copy of the text. I have a new macro that attempts to use \accsupp to hide the extra copies of the text, but it does not work when I test it on Sumatra. I think that it does fix it for screen readers though which is why I kept it. It will however work when I try it in random other pdf readers like chrome. What I really want here is something that somehow only writes the text once, while looking exactly as this does, so that it should work in almost all pdf viewers. % !TEX TS-program = lualatex \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{pgfplots} \usepackage{accsupp} \usepackage{pdfrender} \newcommand{\TextShadeContour}[3]{% \begin{tikzpicture}[baseline] % Define reference node invisibly — needed for clip coordinates \node[anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt, opacity=0] (n) at (0,0) {#3}; % Scope contains all the cumulative clips from the loop \BeginAccSupp{method=plain,ActualText={}}% \begin{scope}% \foreach \c in {1,2,...,#1}{% \pgfplotscolormapaccess[1:#1]{\c}{ShadingColor}% \definecolor{colortemp}{rgb}{\pgfmathresult}% \pgfmathparse{1-(\c-1)/#1}% \clip let \p1=(n.south west), \p2=(n.north east), in% (n.south west) rectangle (\x2, \y1+\pgfmathresult*\y2-\pgfmathresult*\y1);% \node[colortemp, anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt]% {#3};% }% \end{scope}% \EndAccSupp{}% % Stroke is now outside the scope, so clipping is fully reset \node[anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt] at (0,0) {\textpdfrender{ TextRenderingMode=Stroke, LineWidth=0.5pt, StrokeColor=#2, MiterLimit=0.5, LineJoinStyle=Round }{#3}}; \end{tikzpicture}% }% \begin{document} \pgfplotsset{colormap={ShadingColor}{rgb255=(112,128,144) rgb255=(255,159,101)}}\TextShadeContour{3}{black}{13}\\ \end{document} The question is (maybe) how to use pdf literal commands to do it. My own knowledge of pdf internals is non-existent. Or it's about drawing the path of the text from within tikz vs. the actual text. Hopefully we don't have to use ghostscript or anything funky. Ideally this will just work in a way where we define the macro once and then use it. I know a pdf file can contain this. I can prove it with this typst MWE. If you run it and copy paste the whole line, it will do it just as we want (stuff and other stuff): #let multicolor_outline(content, colors) = { let grad = gradient.linear(..colors, angle:270deg) set text(stroke: 0.3pt, fill: grad.sharp(colors.len())) box(content) } #multicolor_outline([stuff], (red, orange, yellow, green, blue, purple)) and #multicolor_outline([other stuff], (purple, blue)) Previous discussion (which does not involve functional copy-pasting): Question 1 Question 2
- Ensure \ExplSyntaxOn inside \input'ed fileby Miguel V. S. Frasson on March 27, 2026 at 2:40 am
I have a huge intarray with more than 20k entries, that is to be loaded in some specific cases, so in that specific context, it is \inputed as an external file. The external file has content similar to \intarray_const_from_clist:Nn \g_large_intarray { 15173522, 6038, 173925, 15055255, 5164, 267192, 15044248, 4368, 362979, 14990746, 4547, 460026, 14910139, 410, 557703, 14909833, (skipping more than 2k lines of code...) } The macro that loads this file may be used inside \ExplSyntaxOn/Off regime or outside. If I add \ExplSyntaxOn/\ExplSyntaxOff to the file, if it is used inside ExplSyntax regime, it turns it off after loading it. MWE: \begin{filecontents}{foo.tex} \ExplSyntaxOn % foo code with L3 commands \int_eval:n {1+3} \ExplSyntaxOff \end{filecontents} \documentclass{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % code loaded in a package, user doesn't control it \ExplSyntaxOn % conditional loading, skipped in this MWE % \bool_new:N \g_foo_loaded_bool % \bool_set_false:N \g_foo_loaded_bool \cs_new:Nn \meaningful_cmd: { % some relevant commands... input foo if some condition holds \int_compare:nNnT 1 > 0 { \input{foo} } } % user command that can be used inside or outside ExplSyntax regime \NewDocumentCommand{\MeaningfulCmd}{} { \meaningful_cmd: } \ExplSyntaxOff % end of package %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \MeaningfulCmd % User may want to use ExplSyntax and \MeaningfulCmd inside it \ExplSyntaxOn \MeaningfulCmd % ERROR ! "Missing $ inserted" % as \ExplSyntaxOff was called in foo.tex and now _ is math subscript \int_eval:n { 3 * 5 } \ExplSyntaxOff \end{document} Is there a kind of \TempExplSyntaxOn that saves what \ExplSyntaxOn changes and when one call a fictional command like \TempExplSyntaxOff, restores the scenario, so it may be used in this context? PS.: Afterwards, I came out with a workaround: define a user command like \NewDocumentCommand{\DefineMyIntarray}{ m } { \intarray_const_from_clist:Nn \g_large_intarray { #1 } } that can be used in the external life, avoiding the need to call \ExplSyntaxOn (I will use this solution). Edit: I won't use anymore this solution that passes a huge argument to a command as @jps pointed out. So this question looses it urgency, but it is still an interesting question, as one could want to “safely” input a file with arbitrary L3 code.
- In a `tabularray` environment, drawing horizontal and vertical lines three times thicker than other linesby user143462 on March 26, 2026 at 11:16 pm
I only want two modifications to the pdf file that is made from the following code: First, I do not want the separation between the first row, which is really the column headers, and the second row, which is really the first row of data. Second, I would like an equally thick vertical line separating the first column from the second column. (Again, the first column is really headers for data in the subsequent columns.) \documentclass[10pt]{amsart} \usepackage[utf8]{inputenc} \usepackage{soul} \usepackage{ragged2e} \usepackage{mathtools,array} \usepackage{tabularray} \usepackage{adjustbox} \usepackage{makecell} \begin{document} \begin{center} \begin{tblr}{colspec={Q[c,m,2.9cm]Q[c,m,2.3cm]Q[c,m,3cm]Q[c,m, 3cm]}, hlines, vlines={0.8pt}, vline{1,5}={1}{-}{}, vline{1,5}={2}{-}{0.8pt},row{1}={font=\bfseries}} {Baseline concentration\\of annual precipitation} & {\% change in\\water entering\\aquifers} & {\% change in\\surface water \\used for\\irrigation} & {\% change in\\groundwater used for\\irrigation} \\ \hline[2.4pt] %\hlines={1.6pt}{solid} {Precipitation is currently\\somewhat concentrated}&4.9&0.4&0.9 \\ {Precipitation is currently\\evenly distributed}&11.0&9.0&7.9 \end{tblr} \end{center} \end{document}
- hline between colored rows in tblrby Sak on March 26, 2026 at 8:45 pm
I’m coloring the background of some rows, i have a drawn some hlines leaving the boundary between rows 4 and 5 in column 1 without an hline. Visually, I still get a thin white gap where that missing hline would be, even though both rows cells are fully background‑colored. I tried to “fill” that gap by drawing an hline with the same color as the background, and also by using tblrtikzabove/tblrtikzbelow to paint over the gap as a possible workaround. In all of these cases, a visible artifact remains: a narrow strip that is a slightly different shade or just white than the surrounding background, so the line is still noticeable. I cannot globally change rows/rowsep or similar table‑wide settings, because I need to scope this behavior and later add specific hlines at selected positions. What I’m looking for is a way, localized to certain row boundaries, to either eliminate that white gap entirely or fill it without causing the visible shade difference, ideally without having to restructure the whole table. \documentclass{article} \usepackage{tabularray} \usepackage{graphicx} \usepackage{geometry} \geometry{margin=0in} %\usepackage{showframe} \usepackage{siunitx} \usepackage{xcolor} \usepackage{bm} \UseTblrLibrary{tikz} \UseTblrLibrary{varwidth} \begin{document} \centering \vspace*{1em} \scalebox{0.59}{ \begin{tblrtikzabove}%tikz attempt %\draw[color=blue] (h4-|v1) -- (h4-|v3); \end{tblrtikzabove} \begin{tblr}{ colspec = { Q[c,wd=3.5cm]%1 Q[c,wd=2cm]%2 Q[c,wd=2cm]%3 Q[c,wd=2cm]%4 Q[c,wd=1.5cm]%5 Q[c,wd=1.5cm]%6 Q[c,wd=2cm]%7 Q[c,wd=2cm]%8 Q[c,wd=1.7cm]%9 Q[c,wd=1.7cm]%10 Q[c,wd=1.7cm]%11 Q[c,wd=1.7cm]%12 Q[c,wd=1.7cm]%13 Q[c,wd=1.7cm]%14 },rowsep=6pt, row{1}={h,ht=2.5cm,font=\sffamily\Large},row{2}={ht=2cm,font=\sffamily\bfseries\Large,h},row{3}={ht=.7cm,font=\sffamily\bfseries\Large},row{4}={ht=.6cm,font=\sffamily\bfseries\large},row{Z}={c,m,font=\Large\sffamily,ht=.8cm}, vlines, hline{Z,Y,1}={solid},hline{1-Z}={3-Z}{solid}, row{1-Y}={fg=red,bg=blue}, %hline{4}={1-2}{blue}, } \SetCell[r=3]{c} {\textbf{Designation}} & \SetCell[r=3]{c} \textbf{Mass per metre} & \SetCell[r=2]{c} \textbf{Depth of section} & \SetCell[r=2]{c}\textbf{Width of section} & \SetCell[c=2]{c} \textbf{Thickness} & & \SetCell[r=2]{c} \textbf{Root radius} & \SetCell[r=2]{c} \textbf{Depth between fillets} & \SetCell[c=2]{c,wd=3.4cm} \textbf{Ratios for local buckling} & & \SetCell[c=2]{c,wd=4cm} \textbf{Second moment of area} & & \SetCell[c=2]{c,wd=3.4cm} \textbf{Radius of gyration} \\ & & & & \textbf{of web} & \textbf{of flange} & & & \textbf{Flange} & \textbf{Web} & \textbf{x--x} & \textbf{y--y} & \textbf{x--x} & \textbf{y--y} \\ & & $\bm{D}$ & $\bm{B}$ & $\bm{t}$ & $\bm{T}$ & $\bm{r}$ & $\bm{d}$ & $\bm{B/2T}$ & $\bm{d/t}$ & $\bm{I_{xx}}$ & $\bm{I_{yy}}$ & $\bm{r_{xx}}$ & $\bm{r_{yy}}$ \\ \textbf{Serial size} & kg/m & mm & mm & mm & mm & mm & mm & & & \si{\textbf{cm}^{\bm{4}}} & \si{\textbf{cm}^{\bm{4}}} & cm & cm \\ 356 × 171 × 45 & 45.0 & 351.4 & 171.1 & 7.0 & 9.7 & 12.7 & 306.6 & 8.82 & 43.8 & 12195 & 811 & 14.50 & 3.75 \\ \end{tblr}} \end{document} my end goal
- How can I customize ordered list labels when using a LaTeX preamble with pandoc on a github-flavored markdown source file?by Rich006 on March 26, 2026 at 7:22 pm
I have a markdown source file [source.md] List: 1. first item 1. second item I also have a latex preamble file [preamble.tex] \usepackage{enumitem} \setlist[enumerate]{label=[\Alph*]} I run pandoc source.md --from gfm --include-in-header preamble.tex --output out.pdf I would expect the output to look like: List [A] first item [B] second item but instead it is List 1. first item 2. second item How can I modify the preamble to get the expected result?
- Why does the hook in \chapter fail?by Explorer on March 26, 2026 at 4:56 pm
I have to automatially switch from two-multicols and onecolumn mode with \chapter, here below is what I was after: \documentclass[openany]{book} \usepackage{multicol} \usepackage{lipsum} \begin{document} \chapter{AAAAAAAAAAAAAAAA} \begin{multicols}{2} \section{11} \lipsum[1-3] \section{22} \lipsum[1-3] \end{multicols} \chapter*{BBBBBBBBBBBBBBBBB} \begin{multicols}{2} \section*{11} \lipsum[1-3] \section*{22} \lipsum[1-3] \end{multicols} \chapter{CCCCCCCCCCCCCCCCC} \begin{multicols}{2} \section{11} \lipsum[1-3] \section{22} \lipsum[1-3] \end{multicols} \end{document} However, I want to hook to switch the one/two-columns with \chapter, I tried with: \documentclass{book} \usepackage{multicol} \usepackage{lipsum} \makeatletter \AddToHook{cmd/chapter/before}{\ifnum\col@number>1\end{multicols}\fi\clearpage} \AddToHook{cmd/chapter/after}{\begin{multicols}{2}} \AtEndDocument{\ifnum\col@number>1\end{multicols}\fi} \makeatother \begin{document} \chapter{AAAA} \lipsum[1-3] \chapter*{BBBB} \lipsum[1-3] \chapter{CCCC} \lipsum[1-3] \end{document} but it complained with: ! Argument of \hook_use:nnw has an extra }. <inserted text> \par l.13 \chapter {AAAA} ? Looks like there exists some group mismatch ;-( I wonder why this happened? And how to achieve what I want?
- Multi attribute listsby mf67 on March 26, 2026 at 1:25 pm
I'm trying to understand “lists” and made an attempt to store 2 attributes (name and dates); \documentclass{book} \ExplSyntaxOn \prop_new:N\g_personA_prop \prop_new:N\g_personB_prop \newcommand\storeperson[3]{ \prop_gput:Nnn\g_personA_prop{#1}{#2} \prop_gput:Nnn\g_personB_prop{#1}{#3} } \newcommand\person[1]{ \prop_item:Nn\g_personA_prop{#1}~(\prop_item:Nn\g_personB_prop{#1}) } \ExplSyntaxOff \storeperson{001}{Johann Sebastian Bach}{1685–1750} \storeperson{002}{Ludwig van Beethoven}{1770–1827} \begin{document} \person{001} and \person{002} \end{document} Is this the correct way? Is there a better way to store multiple attributes? Is the ~ the correct “hard space” code? I think I read that ~ is treated differently in latex3. (Credit to Ulrike Fischer, who originally made another (one-attribute) macro from which I “Frankenstein’ed” the above attempt.)
- How to make good use of `tikz-ext.paths.ortho` library to make four-segmented arrow?by Explorer on March 26, 2026 at 6:06 am
The code used the powerful tikz-ext package from Qrrbrbirlbel: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{ext.paths.ortho} \begin{document} \begin{tikzpicture} \node[draw,fill=cyan] (Root) {Root}; \node[draw,fill=magenta] at (-1,-1) (nodeA) {NodeA}; \node[draw,fill=magenta] at (1,-1) (nodeB) {NodeB}; \node[draw,fill=teal] at (3,-1) (nodeC) {NodeC}; \draw[-latex] (Root) |-| (nodeA); \draw[-latex] (Root) |-| (nodeB); \coordinate (aux) at (2,-.75);% I don't want the aux here, `-0.75' is not always easy to determine \draw[-latex,magenta,thick] (Root) |-| (aux) |- (nodeC); \end{tikzpicture} \end{document} which gives: The actual desired result is something like: My code's problem is that, in the actual case, that is not always easy to know exactly the coordinate of aux, says (2,-.75). I wonder whether some extension or patch to plot the FOUR segmented arrow what I want elegantly? Edited: Claim: The difficulity here is that the nodes' position are not always on grid, says (0.123,2.324) for some outer effects, and determine the aux point with absolute distance is not always accurate. Thus, I prefer a "non-absolute-coordinate" solution here, without \coordinate (aux) at (2,-.75).
- 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?
- 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 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) but it does show that the --cycle is not the problem—the issue is the missing connection between the initial segment and the decorated segment. \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}
- 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} \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}$}; \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.