Hot
- 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}
- 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?
- Biography functionality similar to Bibliographyby mf67 on March 27, 2026 at 11:47 am
Is there some kind of biography functionality in LaTeX that mimics the bibliography functionality? I would like to build a “library” of composer names, their dates, and biographical text, and then, like the \gls{} command, have LaTeX extract and include relevant information. The article Multi attribute lists is very helpful for implementing similar functionality, but perhaps there are solutions or packages I'm not aware of?
- 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}
- Producing an Elliptical Ring of Different Imagesby DDS on March 26, 2026 at 9:43 pm
This question is an extension of--- Producing an Elliptical Ring of Images Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \fill[green!35!black] rectangle (6,8); \draw[ decoration={markings, mark=between positions 0 and 1 step 1/4 with { \node {\includegraphics[width=2.5em]{example-image}}; } }, decorate ] (3,4) ellipse (2cm and 3cm); \end{tikzpicture} \end{center} \end{document} which produces the output: QUESTION: How may I distribute four different images (say, example-image, example-image-, example-image-b, and example-image-c) over the four displayed nodes? I compile with xelatex. Thank you.
- 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?
- tikz, drawing edge with option "double"by Zarko on March 26, 2026 at 4:13 pm
I'm just curious why drawing a line with edge doesn't consider option double. For example: \documentclass[margin=1pt, 11pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[auto=right, Jvmes/.style args = {#1/#2}{very thick, double distance=#1, draw=#2, double=#2!30}, Jvmes/.default = 2mm/orange, ] \draw[Jvmes] (0,0) -- ++ (0,1); % works as expected \draw[Jvmes] (1,0) edge ++ (0,1); % doesn't works \end{tikzpicture} \end{document}
- Resizing fonts inside a BibLaTeX entry that requires another scriptby Knudsen on March 26, 2026 at 2:45 pm
If you are using biblatex on an entry that use another script, biblatex applies the language rules of that entry, ignoring the style and size of the keys in the bibliography as a whole. For example, if you have an entry in English and another in Chinese, it applies the Chinese font on the entire entry, and the numbers, parens of the key will use the arabic numbers of that Chinese font instead of the numbers being used in the text. Resulting on what you see above where each script will have a different key with its own numbers. I attempted to correct this by creating a sort of hybrid font that has the Chinese characters and, for example, Times Roman numerals, in LuaLaTeX. I have succeeded in changing the font by a fall-back scheme as in here: \documentclass{report} % 1. The Multi-lingual Bibliography Database \begin{filecontents*}{multilingual.bib} @book{rudin:zh, author = {Walter Rudin}, title = {实分析与复分析}, translator = {戴牧民 and 张更容 and 郑顶伟 and 李世余}, publisher = {机械工业出版社}, address = {北京}, year = {2006}, langid = {chinese}, } @book{rudin:jp, author = {Walter Rudin}, title = {実解析と複素解析}, translator = {水野 弘文}, publisher = {共立出版}, address = {東京}, year = {1995}, langid = {japanese}, } @book{rudin:kr, author = {Walter Rudin}, title = {실해석학과 복소해석학}, translator = {김성기 and 김도상 and 계승혁}, publisher = {한티미디어}, address = {서울}, year = {2011}, langid = {korean}, } @BOOK{rudin:en, title = {Real and Complex Analysis}, author = {Walter Rudin}, publisher = {McGraw-Hill Book Co.}, address = {New York}, year = {1987}, langid = {english}, } \end{filecontents*} % 2. Localization Files for all three languages \begin{filecontents*}{chinese.lbx} \ProvidesFile{chinese.lbx}[2025/12/29 Chinese strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{% % translator = {{译者}{译}}, bytranslator = {{译}{译}}, andothers = {{等}{等}}, } \end{filecontents*} \begin{filecontents*}{japanese.lbx} \ProvidesFile{japanese.lbx}[2025/12/29 Japanese strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{ translator = {{翻訳者}{訳}} } \end{filecontents*} \begin{filecontents*}{korean.lbx} \ProvidesFile{korean.lbx}[2025/12/29 Korean strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{ translator = {{번역자}{역}} } \end{filecontents*} \usepackage{fontspec} \setmainfont{Times New Roman} % 3. The Cascading Lua Fallback Array % The engine will check these fonts in exact order for missing characters. \directlua{ luaotfload.add_fallback("cjkfallback", { "Noto Serif CJK SC:mode=node;scale=0.74;", % Checks Chinese first "Noto Serif CJK JP:mode=node;scale=0.74;", % Falls to Japanese (for Kana/unique Kanji) "Noto Serif CJK KR:mode=node;scale=0.74;" % Falls to Korean (for Hangul) }) } \usepackage{polyglossia} \usepackage{csquotes} \setmainlanguage[variant=american]{english} \setotherlanguage{chinese} \setotherlanguage{japanese} \setotherlanguage{korean} % 4. Create the Hybrid Fonts for Polyglossia % We give Polyglossia three separate font commands so it passes all internal % script checks, but they all secretly point to the exact same Times+Fallback hybrid! \newfontfamily\chinesefont{Times New Roman}[RawFeature={fallback=cjkfallback}] \newfontfamily\japanesefont{Times New Roman}[RawFeature={fallback=cjkfallback}] \newfontfamily\koreanfont{Times New Roman}[RawFeature={fallback=cjkfallback}] \usepackage[style=authoryear, language=auto, autolang=other, backend=biber]{biblatex} \addbibresource{multilingual.bib} \makeatletter \AtBeginDocument{% \def\blx@ifhyphenationundef#1{\@secondoftwo}} \makeatother \begin{document} \nocite{*} \printbibliography \end{document} but I failed in controlling the size of the font, and CJK shows up in a much larger size that would be appropriate for a text involving two scripts. How can I rescale the CJK scrip to something that is usual, like 0.72 in this construct, without affecting the size of the numerals, which are coming from another font?
- How to restore Type1-style subscript placement when using unicode-math?by tmc on March 26, 2026 at 2:20 pm
I recently noticed that switching from Type1 Latin Modern to OpenType Latin Modern (via unicode-math) changes the placement of subscripts (and superscripts) in both inline and display math. Inline math Consider \sum_{k = 1}^{n} a_{k}. With Type1 Latin Modern (loaded via the lmodern package), the result looks like this: Notice how the subscripts sit compactly: the subscript k in the operator does not protrude far below the baseline; also notice the subscript k in the term of the sum. With OpenType Latin Modern and unicode-math, the result is as follows: Notice that the subscript k on the operator protrudes noticeably further below the baseline, and the subscript k in a_{k} also drops lower. I prefer the Type1 behavior, where the subscripts are more compact and the overall inline expression feels tighter, so that the formula wont't stick out too much. The following GIF might also be helpful to further notice the differences: the first frame is Type1 Latin Modern and the second frame is OpenType Latin Modern. Display math A similar, but opposite, issue appears in displayed sums: with unicode-math, the upper limit n of the index of summation appears noticeably closer to the \sum operator than with Type1 fonts. I am happy with this aspect of the unicode-math behavior. However, the subscript k in the term a_{k} once again drops lower with unicode-math. This may be fine in this context, since it is a formula in display mode (hence, one does not need to be concerned with how it fits with subsequent lines in a paragraph); nevertheless, for consistency with the inline case, I would also prefer to restore the Type1 behavior for subscript placement. Here is a GIF — the first frame is without unicode-math, and the second frame is with unicode-math: Minimal working example (MWE) For Type1 Latin Modern, compile with pdftex: \documentclass{article} \usepackage{lmodern} \begin{document} \(\sum_{k = 1}^{n} a_{k}\) \[ \sum_{k = 1}^{n} a_{k} \] \end{document} For OpenType Latin Modern via unicode-math, compile with luatex: \documentclass{article} \usepackage{unicode-math} % Latin Modern Math is the default font; included for clarity. \setmathfont{Latin Modern Math} \begin{document} \(\sum_{k = 1}^{n} a_{k}\) \[ \sum_{k = 1}^{n} a_{k} \] \end{document} Question Is there a way to restore subscript placement as in the Type1 Latin Modern defaults, without switching back to Type1 fonts? Also, should I do it? That is: would this break other features where one would actually want the subscript placement of unicode-math?
- 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.)
- Incompatibilities bewteen xfrac and lua-unicode-mathby PHL on March 26, 2026 at 7:25 am
The following MWE gives 3 warnings Font shape in size <3.486> not available with lua-unicode-math, but none with unicode-math % !TEX TS-program = lualatex \documentclass{article} \usepackage{xfrac}% \sfrac for a/b fractions \usepackage{lua-unicode-math} %\usepackage{unicode-math} \begin{document} \(\sfrac{4}{5}\) \end{document} It is unclear to me if the fix should be on the xfrac side or on the lua-unicode-side. The three warnings are for OT1/cmr/m/n, OML/cmm/m/it and OMS/cmsy/m/n. Changing the separator (as in \sfrac{4}[L]{5}) does not remove the warnings.
- 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?
- 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} This is what I get: This is the desired result: 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.