Hot
- Match Math Font to Text Fontby GregH on January 28, 2026 at 6:48 pm
Using XeLaTeX, one can easily set the math font to match the main text using the mathspec package. For example, using the open font Carlito on Overleaf, the code \documentclass{article} \usepackage{mathspec} \setallmainfonts{Carlito} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces numbers lettering that match the main text font: As LuaLaTeX is now the recommended engine, and XeLaTeX support may not be continued, I am looking for a LuaLaTeX equivalent. I cannot find one. I thought the mathastext package was designed to solve my problem, but using \documentclass{article} \usepackage{fontspec} \setmainfont{Carlito} \usepackage{mathastext} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces Clearly the numbers from math mode are typeset in a different font face. I also tried the unicode-math package with \setmathfont{Carlito}, but that produces the same/similar output with a warning that an OpenType Math font was expected. How do I get mathmode font to match the regular text font?
- Remove numbering at top of a page in scrlayer-scrpageby Sebastiano on January 28, 2026 at 6:32 pm
How do you remove the upper numbering? \documentclass[a4paper]{article} \usepackage[fontsize=12.5pt]{fontsize} \usepackage[italian]{babel} \usepackage{geometry} \geometry{ paperwidth=21cm, paperheight=29.7cm, textwidth=18cm, textheight=27cm, headsep=0.5cm, top=1cm, left=1.5cm, footskip=.5cm } \usepackage{scrlayer-scrpage} \rofoot*{\pagemark} \begin{document} Test \end{document}
- Help align the numbers in this bespoke siunitx macroby Miloop on January 28, 2026 at 5:36 pm
I am writing a document where I keep having to write variables that fall between two numbers, say, 10 < x \leq 3 or in some cases even between two quantities such as 12.5 mg < x \leq 3.5 mg. I wrote a macro named \nestednumrange and \nestedqtyrange. Here is my minimal example: \documentclass{article} \usepackage{siunitx} \newcommand{\nestednumrange}[3]{% \ensuremath{\num{#1} #2 \num{#3}}% } \newcommand{\nestedqtyrange}[4]{% \ensuremath{\qty{#1}{#4} #2 \qty{#3}{#4}}% } \begin{document} \nestednumrange{3}{\leq x}{<2} \nestedqtyrange{3}{\leq c}{\leq 3}{\milli\gram} \end{document} I'm happy that is (somehow) works, but the output is a bit ugly, imho: How do I "center" the variable correctly? Should I perhaps add two more {}s specifically for the signs, so that they aren't linked to any element in the macro? Unfortunately, I don't know how to make the macro only accept operators like <, >, \leq, \geq, and =, and throw errors at others.
- Referencing to figures and tables, hungarianby palloc on January 28, 2026 at 5:13 pm
I'am hungarian, I would like to reference to figures and tables, but none of these works properly. \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{float} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \usepackage[figurewithin=none, tablewithin=none]{caption} \begin{document} \begin{figure}[H] \caption{Caption} \label{fig} \end{figure} \begin{table}[H] \caption{Caption} \label{tab} \end{table} \autoref{fig}, \autoref{tab} \end{document} In Hungarian, the proper format is the number followed by ábra/táblázat (meaning figure/table), for example: 1. ábra, 1. táblázat. I would like both the number and ábra/táblázat to be clickable. Hungarian also uses suffixes, so there is a high chance that I need to use forms like 1. táblázaton or 1. ábrán (and there are other possible suffixes as well).
- How listoftables creates lot file - aux file processingby Marcel Kanter on January 28, 2026 at 4:25 pm
I try to figure out how to create conditional list of tables without reading the counters or using packages like assoccnt and found an answer that uses \IfFileExists{\jobname.lot}{% \listoftables }{ } There is other code around it (that uses the counters)... The aux file of the document (book class) contains the entries that should be written to the toc file: \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Table to test captions and labels.}}{1}{}\protected@file@percent } This aux file is read in at the beginning and adding some errous commands will throw an error as expected. BUT the lot file is only created when I add \listoffigures without the IfFileExists to the document. How do I manage that the \@writefile actually writes to the file? Open the file, but with which handle? There is no error in the pdflatex output. MWE \documentclass{book} \begin{document} \begin{table}[h] \begin{tabular}{c} abc\\ def \end{tabular} \caption{Table to test captions and labels.} \label{table:1} \end{table} \IfFileExists{\jobname.lot}{% \listoftables }{ % create lot file %\immediate\openout\lotfile=\jobname.lot % ??? } \end{document}
- Modifing tableofcontents, listoffigures and listoftables with hungarian babelby palloc on January 28, 2026 at 4:22 pm
I am having the following code: \documentclass[11pt]{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{parskip} \usepackage{float} \usepackage{setspace} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none,tablewithin=none]{caption} \captionsetup[figure]{labelsep=colon} % In-text: "1. ábra: ..." \captionsetup[table]{labelsep=colon} % In-text: "1. táblázat: ..." \usepackage{tocloft} \addcontentsline{toc}{chapter}{Ábrák és táblázatok jegyzéke}% \begin{document} \onehalfspacing \tableofcontents \clearpage \chapter{First} \section{First} \begin{figure}[H] \caption{First fig} \end{figure} \begin{table}[!ht] \caption{First tab} \end{table} \section{Second} \begin{table}[!ht] \caption{Second tab} \end{table} \chapter{Second} \begin{figure}[!ht] \caption{Second fig} \end{figure} \end{document} I would like to merge listoffigures and listoftables into one, and its name would be Ábrák és táblázatok jegyzéke which means List of Figures and Tables. And I also want an extra word between figure/table number and figure/table caption (táblázat means table, ábra means figure). This is how it should look like: And I also would like to modify the tableofcontents, adding the extra Fejezet (which means Chapter) word between the chapter number and chapter name
- Bibliography issues while creating an ADA-compliant pdf with LuaLaTeXby ckhenderson on January 28, 2026 at 2:53 pm
I am trying to convert a set of notes created with pdflatex to ones that are compliant with the new ADA regulations. I have everything working except for the bibliography, which comes with an error: "" when I run it with LuaLaTeX. See screenshot below also. Here is a MWE: \DocumentMetadata{ lang=en-US, pdfstandard=ua-2, testphase={tagpdf,math,table,graphic} } \documentclass{book} \usepackage{amsmath, amsfonts, amssymb} \usepackage{unicode-math} \usepackage{hyperref} \usepackage{bookmark} \hypersetup{ pdftitle={MWE}, pdfauthor={Author}, pdfsubject={Technical Documentation}, pdfdisplaydoctitle=true, pdflang={en-US} } \tagpdfsetup{ activate, tabsorder=structure, math/mathml/luamml/load=true } \title{MWE} \author{Author} \begin{document} \maketitle \cite{reference} \begin{thebibliography}{99} \bibitem{reference} Author, \textit{Title}, Publisher, Year. \end{thebibliography} \end{document}
- Best ways to calculate sums in LaTeXby cis on January 28, 2026 at 2:13 pm
In many CAS-systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}
- Issue interacting with mhchem (\ce) and align environment when fetching dynamic data via csnames / expl3by Le Ngoc on January 28, 2026 at 2:06 pm
The Goal: I am building a chemistry database package (chemdata.sty) where chemical equations and properties are generated from a CSV file (via Python) and stored as control sequences using etoolbox's \csdef (or expl3 property lists). My goal is to call these stored values inside mhchem's \ce{...} command and within align environments. The Problem: I keep encountering expansion issues (Missing \endgroup, Runaway argument, or mhchem Error: Assertion failed: Unexpected input character) when trying to pass the stored data into \ce. Approaches I have tried: I have attempted two main strategies to handle the equations: The "Pre-wrapped" Strategy (Storing formatted code) In this approach, I format the data fully in the backend (Python) and store it with \ce already included. Storage: \csdef{data@H3PO4@eq}{\ce{H3PO4 <=> H+ + H2PO4-}} Usage: \NewDocumentCommand{\getEq}{m}{\csuse{data@#1@eq}} Result: Works fine for simple inline equations. However, it fails when I need to combine data (e.g., redox couples) or when I need to split the equation for align environments (nested \ce calls often break). The "Raw Data + Expansion" Strategy (Storing plain strings) I store raw strings without any formatting and try to force expansion before passing them to mhchem. Storage: \csdef{data@H3PO4@raw}{H3PO4 <=> H+ + H2PO4-} Usage (attempt with expl3): \ExplSyntaxOn \NewDocumentCommand{\getEq}{m}{ \cs_if_exist:cTF { data@#1@raw } { \exp_args:Nv \ce { data@#1@raw } } % Trying to expand variable before \ce sees it { ?? } } \ExplSyntaxOff Result: This often throws Assertion failed: Unexpected input character from mhchem, presumably because mhchem's parser sees the expansion mechanism instead of the chemical characters. Handling the align environment For alignment, I split the equation into LHS and RHS in the database to expose the & token to LaTeX. Storage: \csdef{data@id@lhs}{H3PO4} \csdef{data@id@rhs}{<=> H+ + H2PO4-} Definition: \NewDocumentCommand{\eqAlign}{m}{ \exp_args:Nv \ce {data@#1@lhs} & \exp_args:Nv \ce {data@#1@rhs} } Result: This causes Missing \endgroup or Misplaced alignment tab character &, likely because the expansion order confuses the align scanner. My Question: What is the correct robust way to retrieve a stored string (containing chemical formulas) and pass it into \ce{...} so that it works reliably inside an align environment without breaking mhchem's parsing? Minimal Working Example (MWE): \documentclass{article} \usepackage{amsmath} \usepackage[version=4]{mhchem} \usepackage{etoolbox} \usepackage{xparse} % Simulated Database (Generated by Python) \csdef{mydata@H3PO4@raw}{H3PO4 <=> H+ + H2PO4-} \csdef{mydata@H3PO4@lhs}{H3PO4} \csdef{mydata@H3PO4@rhs}{<=> H+ + H2PO4-} \ExplSyntaxOn % Attempt to expand content before passing to \ce \NewDocumentCommand{\ChemEq}{m}{ \exp_args:Nv \ce { mydata@#1@raw } } \NewDocumentCommand{\ChemAlign}{m}{ \exp_args:Nv \ce { mydata@#1@lhs } & \exp_args:Nv \ce { mydata@#1@rhs } } \ExplSyntaxOff \begin{document} % Case 1: Inline - Sometimes works, sometimes "Assertion Failed" Test Inline: \ChemEq{H3PO4} % Case 2: Align - Fails with "Missing \endgroup" or similar \begin{align} \ChemAlign{H3PO4} \end{align} \end{document}
- Arithmetic in an enumerate labelby marmistrz on January 28, 2026 at 2:01 pm
I'm doing a hybrid-argument based proof: \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} Can I somehow automate it? The following doesn't work because it doesn't do the arithmetic \begin{enumerate}[label=$H_{\arabic*} \approx H_{\arabic*+1}$] \item (argue indistinguishability) \item (argue indistinguishability) \item (argue indistinguishability) \end{enumerate} Here's a minimal working example: \documentclass{article} \begin{document} \begin{enumerate} \item $H_0 \approx H_1$: (argue indistinguishability) \item $H_1 \approx H_2$: (argue indistinguishability) \item $H_2 \approx H_3$: (argue indistinguishability) \end{enumerate} \end{document}
- Environment shown conditionallyby Federico Poloni on January 28, 2026 at 1:58 pm
I am trying to define an environment whose content is displayed only if a certain argument appears in a comma-separated list that is given as an optional argument to the environment. I used forcsvlist in etoolbox. Here is a M(not)WE: \documentclass{article} \usepackage{etoolbox,verbatim,xstring} \newcommand{\checkkey}[1]{% \ifstrequal{#1}{inf}{\def\showcontent{true}}{}% } \newenvironment{conditional}[1][]{% \def\showcontent{false}% \forcsvlist{\checkkey}{#1}% \ifstrequal{\showcontent}{true}{\begingroup}{\expandafter\comment}% }{% \ifstrequal{\showcontent}{true}{\endgroup}{\expandafter\endcomment}% } \begin{document} Shown? % only environments whose comma-separated list arg % contains "inf" should be displayed. \begin{conditional}[inf, ich] Yes \end{conditional} \begin{conditional}[foo, bar] No \end{conditional} \end{document} Unfortunately the content of neither environment is shown. How to fix this? I suspect something is going amiss with the expansion order, so that \forcsvlist checks the string "#1" rather than "inf, ich", but I haven't been able to fix the issue. (Feel free to suggest better solutions instead. Use case: in a second moment, I will want to replace "inf" with a string defined conditionally depending on the jobname, to obtain multiple version of a document; but for this question this is irrelevant.)
- tikz Wiener sausage [duplicate]by 20-sided-dice on January 28, 2026 at 1:41 pm
Let's say I have a curve defined by y=f(x) with some explicit function f for x between 0 and 1. I define the sausage of that curve to be the set of points (x,y) at distance less than 1 from any point of the curve. How do I draw the sausage in TikZ without deriving mathematically the actual shape of the sausage ? Even with simple functions it's quickly painful to derive by hand. I would prefer if TikZ could directly draw it.
- Latex verapdf warning duplicated key /Groupby Eder on January 28, 2026 at 12:12 pm
I encountered the same issue described in this question. I generated a PDF/A-compliant document using LuaLaTeX with MiKTeX 25.12. When the resulting file is tested with veraPDF, it passes validation, however, the following warning is reported: WARNING: Dictionary/Stream contains duplicated key /Group(object key = 6 0 obj, offset = 10058) After some investigation, I traced the issue to the inclusion of vectorized PDF images in the document. Below is a minimal working example that reproduces the problem: \documentclass[12pt]{article} \usepackage[a-3b]{pdfx} \usepackage{graphicx} \usepackage{blindtext} \begin{document} \blindtext \includegraphics[width=0.5\linewidth]{shape.pdf} \end{document} I am not a PDF expert, however, after opening the generated PDF in Notepad++, I inferred that the warning is caused by the duplicated occurrence of the /Group key in the following Dictionary/Stream: << /Type /XObject /Subtype /Form /FormType 1 /PTEX.PageNumber 1 /PTEX.InfoDict << /Producer (cairo 1.18.4 (https://cairographics.org)) /Creator (Inkscape 1.4.3 \(https://inkscape.org\)) /CreationDate (D:20260128075234-04'00) >> /BBox [ 0 0 595.275591 841.889764 ] /Group << /Type /Group /S /Transparency /I true /CS /DeviceRGB >> /Resources << /ExtGState << /a0 << /CA 0.616 /ca 0.616 >> >> /XObject << /x7 13 0 R /x8 14 0 R /x9 15 0 R /x10 16 0 R >> >> /Group<</S/Transparency/K false/I false>> /Length 68 /Filter /FlateDecode >> The vectorized image "shape.pdf" was drawn in Inkscape and saved as PDF. EDIT: Available here Interesting to note that this problem does not seem to occur in previous versions of MikTex. I suspect some recent update in LuaLaTeX generated this issue. Is there any way to fix it?
- Writing a file with Lua on Overleafby N. Virgo on January 28, 2026 at 11:11 am
The following code works as expected if I run it in LuaLaTeX on my machine, creating a file containing the text "Hello, World!". \documentclass{article} \begin{document} \directlua{ local file = assert(io.open("output.txt", "w")) assert(file:write("Hello, World!")) assert(file:close()) tex.print("Hopefully this worked?") } \end{document} However, if I run it on Overleaf the file doesn't appear. It generates the pdf and there are no errors or warnings or anything else in the logs suggesting that anything has gone wrong, I just don't see the output.txt file. It could be that Overleaf disables this for security reasons, but their documentation mentions file:write explicitly, and other documentation even says running external commands should work on Overleaf, so I have the impression I should expect it to work. Does anyone know if this can be made to work on Overleaf, and if so how I can access the generated file? edit: as @samcarter_is_at_topanswers.xyz and @daleif pointed out, the file is there in the logs and can be downloaded (using the 'Other logs and files' button at the bottom right of the log screen in the new editor), it just can't be viewed in the editor. So the question becomes, how can I bring the file into the editor so that I can view its contents there? (While still having it update when I compile.) I tried creating an empty output.txt file manually, but unfortunately it stays empty after compiling, and output.txt disappears from the "other files and logs" list.
- How do 256+ character pdfLaTeX fonts work, and how to make one?by Grzegorz Brzęczyszczykiewicz on January 28, 2026 at 9:48 am
I am talking about those "fake fonts" that are composed of multiple fonts to have more characters. An example is Computer Modern, which uses multiple fonts, one for text symbols, one for math symbols, and another for Greek letters. Is it possible to make a font that works like this?
- Matching the length of parts of an equationby Jinwen on January 28, 2026 at 9:48 am
In the following expression: is it possible to somehow match the length of the P(T) and Q(T) part, so that the 1+T part is vertically aligned? \documentclass{article} \usepackage{kpfonts} % I'm using this font to make the issue more visible \begin{document} \( \frac{1 \,+\, T\,P(T)}{1 \,+\, T\,Q(T)} \) \end{document}
- custom command to put a bold title, a line break and normal textby user1850133 on January 28, 2026 at 6:16 am
I'm trying to make a command that would put the first argument in bold. Then it must create a line break and put the remaining text normally, which should have been passed as second arg. The problem is that the line-break must occur only if after the bold text there is space enough to put at least two lines from the text in the second argument. Otherwise it must do a page-break and put that line in bold and the normal text thereafter. here is my mwe: \documentclass[a4paper]{article} \usepackage{blindtext} \usepackage[vmargin=1.3in]{geometry} \NewDocumentCommand{\monbloc}{ m m }{\textbf{#1}\par#2} \begin{document} \begin{itemize} \item \monbloc{abc}{\blindtext[1]} \item \monbloc{def}{\blindtext[1]} \item \monbloc{ghi}{\blindtext[1]} \item \monbloc{jkl}{\blindtext[1]} \item \monbloc{mno}{\blindtext[1]} \end{itemize} \end{document}
- tikz diagram works in overleaf but fails in texworks [closed]by duality on January 28, 2026 at 6:01 am
I am trying to get the following tikz diagram to work in texworks. It works fine in overleaf but fails in texworks. Any idea how to fix this? \documentclass[11pt]{article} \usepackage{tikz} \usepackage{float} \usetikzlibrary{calc} \usetikzlibrary{external,quotes,chains} \tikzset{vertex/.style={black,fill,draw,minimum size=6pt,inner sep=0pt,circle,thin},bold/.style={black,line width=0.6mm},plain/.style={black,thin},bold edges/.style=bold,plain edges/.style=plain,label distance=1mm,text node/.style={rectangle,fill=none,draw=none},every label/.style=text node,caption node/.style={text node,font=\Large}} \newcommand{\AR}[1]{\overrightarrow{#1}} \title{something} \author{someone} \begin{document} \maketitle \begin{figure}[H] \centering \begin{tikzpicture} [node distance=2cm, base node/.style={circle,draw,minimum size=15pt},scale=0.8] \node[base node, very thick] (5){5}; \node[base node, very thick][left of=5] (3){3}; \node[base node, very thick][above of=5] (1){1}; \node[base node, very thick][below of=5] (4){4}; \node[base node, very thick][right of=5] (2){2}; \path [->, very thick] (3) edge node[left] {} (5); \path [<-, very thick] (5) edge node[right] {} (2); \path [->, very thick](1) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (3); \path [->, very thick](4) edge node[left] {} (2); \path [->, very thick](1) edge node[left] {} (2); \path [->, very thick] (5) edge node[left] {} (1); \path [->, very thick] (5) edge node[left] {} (4); % ------- First copy of the circulant ------- \node[base node, very thick] (w1) at ($(90:2) + (3,-4)$) {6}; \node[base node, very thick] (w2) at ($(30:2) + (3,-4)$) {7}; \node[base node, very thick] (w3) at ($(-30:2) + (3,-4)$) {10}; \node[base node, very thick] (w4) at ($(-90:2) + (3,-4)$) {9}; \node[base node, very thick] (w5) at ($(-150:2) + (3,-4)$) {8}; %\node[base node, very thick] (w6) at ($(150:2) + (3,-4)$) {5}; %repeated \path[->, very thick] (w1) edge [bend left=5] (5); \path[->, very thick] (w1) edge (w3); \path[->, very thick] (w2) edge (w1); \path[->, very thick] (w2) edge (w4); \path[->, very thick] (w3) edge (w2); \path[->, very thick] (w3) edge (w5); \path[->, very thick] (w4) edge (w3); \path[->, very thick] (w4) edge [bend right=10] (5); \path[->, very thick] (w5) edge (w4); \path[->, very thick] (w5) edge (w1); \path[->, very thick] (5) edge [bend left=5] (w5); \path[->, very thick] (5) edge [bend left=15] (w2); % ------- Second copy of the circulant ------- \node[base node, very thick] (z1) at ($(90:2) + (9,-4)$) {11}; %2 \node[base node, very thick] (z2) at ($(30:2) + (9,-4)$) {12}; %3 \node[base node, very thick] (z3) at ($(-30:2) + (9,-4)$) {15}; %6 \node[base node, very thick] (z4) at ($(-90:2) + (9,-4)$) {14}; %5 \node[base node, very thick] (z5) at ($(-150:2) + (9,-4)$) {13}; %4 %\node[base node, very thick] (z6) at ($(150:2) + (9,-4)$) {10}; %1 \path[->, very thick] (z1) edge[bend right=10] (w3); \path[->, very thick] (z1) edge (z3); \path[->, very thick] (z2) edge (z1); \path[->, very thick] (z2) edge (z4); \path[->, very thick] (z3) edge (z2); \path[->, very thick] (z3) edge (z5); \path[->, very thick] (z4) edge (z3); \path[->, very thick] (z4) edge[bend left=10] (w3); \path[->, very thick] (z5) edge (z4); \path[->, very thick] (z5) edge (z1); \path[->, very thick] (w3) edge (z5); \path[->, very thick] (w3) edge[bend left=10] (z2); \end{tikzpicture} \caption{A graph $\AR{R_5} \cdot R_6$} \label{fig:gluingToGetAllN} \end{figure} \end{document}
- Ligatures disappear with package spelling under LuaLaTeXby Knudsen on January 28, 2026 at 3:52 am
The package spelling extracts the text from a standard LaTeX file under LuaTeX, but on this MWE: \documentclass{report} \usepackage{spelling} \begin{document} We differentiate using the definition of differentiability and and diffusion efforts offered. \end{document} the standard run of lualatex filename also removes the ligatures ff and fi rendering We dierentiate using the denition of dierentiability and diusion eorts oered in the file filename.spell.txt. The addition of the mapping command: \spellingmapping{0xfb00}{ff} which is supposed to be the default does not change the behaviour. How are ligatures handled in the package?
- Does OpenAI's Prism support project versioning or file history?by Franck Dernoncourt on January 28, 2026 at 3:40 am
OpenAI recently launched Prism, their AI-native LaTeX workspace for scientific writing. As someone looking to transition from Overleaf as they pissed me off when they started charging for compilation time and adding collaborators and because I much prefer Prism's AI assistant, one of my main requirements is a robust way to track changes or revert to previous states of my .tex files. I’ve noticed that Prism (built on the acquisition of Crixet) emphasizes real-time collaboration and "persistent project memory", but I haven't been able to find a specific "History" tab or "Version Control" panel similar to Overleaf’s history or a Git-backed workflow. Does Prism currently have a built-in feature to view and restore previous versions of files in a project?
- Is there a expl3 interface for lttemplate?by Noiv on January 28, 2026 at 1:26 am
in developing a class I have come to use the so called templates documented in lttemplate. It is a expl3-Class therefore I looked at ways to define Template Types, Templates and Instances in expl3 Syntax but there are no such interfaces. Is there a particular reason why templates do not have a expl3 interface? Or was I not capable enough to find it?
- Table of Contents: prevent line break between dotted line and the page numberby Jinwen on January 28, 2026 at 1:00 am
With \titlecontents of the package titletoc to configure table of contents, I am encountering an issue that if the text is essentially occupying the whole line, then the page number might be wrapped to the beginning of the next line, which looks quite strange. For example, in the following, the last page number "101" is expected to be shown on the right, not at the beginning of a new line: I tried \nolinebreak and \hfill, but neither worked. (Edit: The above result is obtained by using LuaLaTeX, the version shipped with TeX Live 2025. If using pdfLaTeX instead, the result would be: which raises another issue: the dots are somehow not properly aligned due to the automatic line break... ) Is there some way to prevent this behavior? Below is a MWE (I am using an example where the text cannot be hyphened, but this is close to my actual case, where the problematic section title ends with several authors' name like Author1--Author2--Author3 and cannot be properly hyphened...): \documentclass{book} \usepackage{titletoc} \titlecontents{chapter} [2em] % i.e., 0em (part) + 2em {\addvspace{.5pc}\normalfont} {\contentslabel[\thecontentslabel]{2em}} {\hspace*{-2em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{section} [5.75em] % i.e., 2em (chapter) + 2.75em + 1em {\normalfont} {\contentslabel[\thecontentslabel]{2.75em}} {\hspace*{-2.75em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{subsection} [10.5em] % i.e., 5.75em (section) + 3.75em + 1em {\normalfont} {\contentslabel[\thecontentslabel]{3.75em}} {\hspace*{-3.75em}} {\titlerule*[1em]{.}\normalfont\contentspage} \titlecontents{subsubsection} [15.75em] % i.e., 10.5em (subsection) + 4.25em + 1em {\normalfont\itshape} {\contentslabel[\thecontentslabel]{4.25em}} {\hspace*{-4.25em}} {\titlerule*[1em]{.}\normalfont\contentspage} \setcounter{secnumdepth}{4} \setcounter{tocdepth}{4} \begin{document} \tableofcontents \addtocounter{page}{100} \section{Test} \subsection{Test--Test} \subsubsection{Test--Test--Test--Test--Test--Test--Test--} \end{document}
- Is there a simpler way to define a piecewise function?by xcn on January 28, 2026 at 12:43 am
In the code below, a piecewise function is defined using nested \fp_compare:nNnTF commands. Could this be achieved in a simpler manner? \documentclass{article} \begin{document} % Define a piecewise function \ExplSyntaxOn \NewDocumentCommand{\clampvalue}{m} { % If x < 0.2, return 0.2 \fp_compare:nNnTF {#1} < {0.2} {0.2} { % Otherwise, if x > 1, return 1 \fp_compare:nNnTF {#1} > {1} {1} % Otherwise (0.2 ≤ x ≤ 1), return 0.5 {0.5} } } % Test case \clampvalue{0.1} % Outputs 0.2 \par \clampvalue{0.5} % Outputs 0.5 \par \clampvalue{1.2} % Outputs 1 \ExplSyntaxOff \end{document}
- How can I map TFM data for a type1 font in LuaLaTeX (probably using luaotfload.patch_font_unsafe) when the font encoding has unused slots?by cfr on January 28, 2026 at 12:06 am
This code is derived from code by Max Chernoff, but the mangling is entirely my responsibility. Aim: to add tounicode mappings to the characters in uzdr.pfb (URW's clone of Zapf Dingbats) when compiling with a LuaLaTeX format based on the LuaHBTeX binary in (updated) TeX Live 2025. Note that I am NOT asking for a practical solution to the problem of typesetting these symbols with correct tounicode values, which would be better done using a Unicode font. I apologise for the length of this example. Usually, I would reduce the data file to a couple of lines, but then I would need a type1 font in TeX Live with a 'gappy' but very short encoding. Or I could eliminate lines here, but then it might seem as if that in itself is part of the problem. \begin{filecontents*}[overwrite]{fixit.lua} The Lua code: pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes Now the overly-long data file: \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} The actual example: \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document} This loses characters from the font. Not only are the tounicode mappings missing, the characters also disappear from the PDF. LuaTeX warns me something is wrong: </usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr.pfb warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): embedded subset is smaller than expected: 136 instead of 188 glyph s warning (file /usr/local/texlive/2025/texmf-dist/fonts/type1/urw/zapfding/uzdr .pfb) (cff): invalid real value to pack. Continuing, but the font looks wrong. > The mappings are not obviously-to-me wrong: Adding callback for pzdr uzdr table: 0x437e5320 (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/pifont.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/psnfss/upzd.fd) Lua's listing of the inputs for the function (abbreviated to satisfy SE character limit): id 16 spec pzdr tfmdata table: 0x43833f70 Mapping tounicode values for pzdr uzdr table: 0x437e5320 pzdr uzdr 1 -1 ... pzdr uzdr 31 -1 pzdr uzdr 32 32 pzdr uzdr 33 9985 pzdr uzdr 34 9986 ... ... pzdr uzdr 126 10078 pzdr uzdr 127 -1 ... pzdr uzdr 160 -1 pzdr uzdr 161 10081 ... pzdr uzdr 239 10159 pzdr uzdr 240 -1 pzdr uzdr 241 10161 ... pzdr uzdr 254 10174 These seem to get used correctly when mapping the TFM data i.e. only the values corresponding to actual characters get used: Mapping: 32 33 32 table: 0x4383bfd0 Mapping: 33 34 9985 table: 0x4383c050 Mapping: 34 35 9986 table: 0x4383c0d0 Mapping: 35 36 9987 table: 0x4383c150 Mapping: 36 37 9988 table: 0x4383c1d0 Mapping: 37 38 9742 table: 0x4383c250 Mapping: 38 39 9990 table: 0x4383c2d0 Mapping: 39 40 9991 table: 0x4383c350 Mapping: 40 41 9992 table: 0x4383c400 Mapping: 41 42 9993 table: 0x4383c4b0 Mapping: 42 43 9755 table: 0x4383c560 Mapping: 43 44 9758 table: 0x4383c610 Mapping: 44 45 9996 table: 0x4383c6c0 Mapping: 45 46 9997 table: 0x4383c770 Mapping: 46 47 9998 table: 0x4383c820 Mapping: 47 48 9999 table: 0x4383c8d0 Mapping: 48 49 10000 table: 0x4383c980 Mapping: 49 50 10001 table: 0x4383ca30 Mapping: 50 51 10002 table: 0x4383cae0 Mapping: 51 52 10003 table: 0x4383cb90 Mapping: 52 53 10004 table: 0x4383cc40 Mapping: 53 54 10005 table: 0x4383ccf0 Mapping: 54 55 10006 table: 0x4383cda0 Mapping: 55 56 10007 table: 0x4383ce50 Mapping: 56 57 10008 table: 0x4383cf00 Mapping: 57 58 10009 table: 0x4383cfb0 Mapping: 58 59 10010 table: 0x4383d060 Mapping: 59 60 10011 table: 0x4383d110 Mapping: 60 61 10012 table: 0x4383d1c0 Mapping: 61 62 10013 table: 0x4383d270 Mapping: 62 63 10014 table: 0x4383d320 Mapping: 63 64 10015 table: 0x4383d3d0 Mapping: 64 65 10016 table: 0x4383d480 Mapping: 65 66 10017 table: 0x4383d530 Mapping: 66 67 10018 table: 0x4383d5e0 Mapping: 67 68 10019 table: 0x4383d690 Mapping: 68 69 10020 table: 0x4383d740 Mapping: 69 70 10021 table: 0x4383d7f0 Mapping: 70 71 10022 table: 0x4383d8a0 Mapping: 71 72 10023 table: 0x4383d950 Mapping: 72 73 9733 table: 0x4383da00 Mapping: 73 74 10025 table: 0x4383dab0 Mapping: 74 75 10026 table: 0x4383db60 Mapping: 75 76 10027 table: 0x4383dc10 Mapping: 76 77 10028 table: 0x4383dcc0 Mapping: 77 78 10029 table: 0x4383dd70 Mapping: 78 79 10030 table: 0x4383de20 Mapping: 79 80 10031 table: 0x4383ded0 Mapping: 80 81 10032 table: 0x4383df80 Mapping: 81 82 10033 table: 0x4383e030 Mapping: 82 83 10034 table: 0x4383e0e0 Mapping: 83 84 10035 table: 0x4383e190 Mapping: 84 85 10036 table: 0x4383e240 Mapping: 85 86 10037 table: 0x4383e2f0 Mapping: 86 87 10038 table: 0x4383e3a0 Mapping: 87 88 10039 table: 0x4383e450 Mapping: 88 89 10040 table: 0x4383e500 Mapping: 89 90 10041 table: 0x4383e5b0 Mapping: 90 91 10042 table: 0x4383e660 Mapping: 91 92 10043 table: 0x4383e710 Mapping: 92 93 10044 table: 0x4383e7c0 Mapping: 93 94 10045 table: 0x4383e870 Mapping: 94 95 10046 table: 0x4383e920 Mapping: 95 96 10047 table: 0x4383e9d0 Mapping: 96 97 10048 table: 0x4383ea80 Mapping: 97 98 10049 table: 0x4383eb30 Mapping: 98 99 10050 table: 0x4383ebe0 Mapping: 99 100 10051 table: 0x4383ec90 Mapping: 100 101 10052 table: 0x4383ed40 Mapping: 101 102 10053 table: 0x4383edf0 Mapping: 102 103 10054 table: 0x4383eea0 Mapping: 103 104 10055 table: 0x4383ef50 Mapping: 104 105 10056 table: 0x4383f000 Mapping: 105 106 10057 table: 0x4383f0b0 Mapping: 106 107 10058 table: 0x4383f160 Mapping: 107 108 10059 table: 0x4383f210 Mapping: 108 109 9679 table: 0x4383f2c0 Mapping: 109 110 10061 table: 0x4383f370 Mapping: 110 111 9632 table: 0x4383f420 Mapping: 111 112 10063 table: 0x4383f4d0 Mapping: 112 113 10064 table: 0x4383f580 Mapping: 113 114 10065 table: 0x4383f630 Mapping: 114 115 10066 table: 0x4383f6e0 Mapping: 115 116 9650 table: 0x4383f790 Mapping: 116 117 9660 table: 0x4383f840 Mapping: 117 118 9670 table: 0x4383f8f0 Mapping: 118 119 10070 table: 0x4383f9a0 Mapping: 119 120 9687 table: 0x4383fa50 Mapping: 120 121 10072 table: 0x4383fb00 Mapping: 121 122 10073 table: 0x4383fbb0 Mapping: 122 123 10074 table: 0x4383fc60 Mapping: 123 124 10075 table: 0x4383fd10 Mapping: 124 125 10076 table: 0x4383fdc0 Mapping: 125 126 10077 table: 0x4383fe70 Mapping: 126 127 10078 table: 0x4383ff20 Mapping: 161 162 10081 table: 0x4383ffd0 Mapping: 162 163 10082 table: 0x43840080 Mapping: 163 164 10083 table: 0x43840130 Mapping: 164 165 10084 table: 0x438401e0 Mapping: 165 166 10085 table: 0x43840290 Mapping: 166 167 10086 table: 0x43840340 Mapping: 167 168 10087 table: 0x438403f0 Mapping: 168 169 9827 table: 0x438404a0 Mapping: 169 170 9830 table: 0x43840550 Mapping: 170 171 9829 table: 0x43840600 Mapping: 171 172 9824 table: 0x438406b0 Mapping: 172 173 9312 table: 0x43840760 Mapping: 173 174 9313 table: 0x43840810 Mapping: 174 175 9314 table: 0x438408c0 Mapping: 175 176 9315 table: 0x43840970 Mapping: 176 177 9316 table: 0x43840a20 Mapping: 177 178 9317 table: 0x43840ad0 Mapping: 178 179 9318 table: 0x43840b80 Mapping: 179 180 9319 table: 0x43840c30 Mapping: 180 181 9320 table: 0x43840ce0 Mapping: 181 182 9321 table: 0x43840d90 Mapping: 182 183 10102 table: 0x43840e40 Mapping: 183 184 10103 table: 0x43840ef0 Mapping: 184 185 10104 table: 0x43840fa0 Mapping: 185 186 10105 table: 0x43841050 Mapping: 186 187 10106 table: 0x43841100 Mapping: 187 188 10107 table: 0x438411b0 Mapping: 188 189 10108 table: 0x43841260 Mapping: 189 190 10109 table: 0x43841310 Mapping: 190 191 10110 table: 0x438413c0 Mapping: 191 192 10111 table: 0x43841470 Mapping: 192 193 10112 table: 0x43841520 Mapping: 193 194 10113 table: 0x438415d0 Mapping: 194 195 10114 table: 0x43841680 Mapping: 195 196 10115 table: 0x43841730 Mapping: 196 197 10116 table: 0x438417e0 Mapping: 197 198 10117 table: 0x43841890 Mapping: 198 199 10118 table: 0x43841940 Mapping: 199 200 10119 table: 0x438419f0 Mapping: 200 201 10120 table: 0x43841aa0 Mapping: 201 202 10121 table: 0x43841b50 Mapping: 202 203 10122 table: 0x43841c00 Mapping: 203 204 10123 table: 0x43841cb0 Mapping: 204 205 10124 table: 0x43841d60 Mapping: 205 206 10125 table: 0x43841e10 Mapping: 206 207 10126 table: 0x43841ec0 Mapping: 207 208 10127 table: 0x43841f70 Mapping: 208 209 10128 table: 0x43842020 Mapping: 209 210 10129 table: 0x438420d0 Mapping: 210 211 10130 table: 0x43842180 Mapping: 211 212 10131 table: 0x43842230 Mapping: 212 213 10132 table: 0x438422e0 Mapping: 213 214 8594 table: 0x43842390 Mapping: 214 215 8596 table: 0x43842440 Mapping: 215 216 8597 table: 0x438424f0 Mapping: 216 217 10136 table: 0x438425a0 Mapping: 217 218 10137 table: 0x43842650 Mapping: 218 219 10138 table: 0x43842700 Mapping: 219 220 10139 table: 0x438427b0 Mapping: 220 221 10140 table: 0x43842860 Mapping: 221 222 10141 table: 0x43842910 Mapping: 222 223 10142 table: 0x438429c0 Mapping: 223 224 10143 table: 0x43842a70 Mapping: 224 225 10144 table: 0x43842b20 Mapping: 225 226 10145 table: 0x43842bd0 Mapping: 226 227 10146 table: 0x43842c80 Mapping: 227 228 10147 table: 0x43842d30 Mapping: 228 229 10148 table: 0x43842de0 Mapping: 229 230 10149 table: 0x43842e90 Mapping: 230 231 10150 table: 0x43842f40 Mapping: 231 232 10151 table: 0x43842ff0 Mapping: 232 233 10152 table: 0x438430a0 Mapping: 233 234 10153 table: 0x43843150 Mapping: 234 235 10154 table: 0x43843200 Mapping: 235 236 10155 table: 0x438432b0 Mapping: 236 237 10156 table: 0x43843360 Mapping: 237 238 10157 table: 0x43843410 Mapping: 238 239 10158 table: 0x438434c0 Mapping: 239 240 10159 table: 0x43843570 Mapping: 241 242 10161 table: 0x43843620 Mapping: 242 243 10162 table: 0x438436d0 Mapping: 243 244 10163 table: 0x43843780 Mapping: 244 245 10164 table: 0x43843830 Mapping: 245 246 10165 table: 0x438438e0 Mapping: 246 247 10166 table: 0x43843990 Mapping: 247 248 10167 table: 0x43843a40 Mapping: 248 249 10168 table: 0x43843af0 Mapping: 249 250 10169 table: 0x43843ba0 Mapping: 250 251 10170 table: 0x43843c50 Mapping: 251 252 10171 table: 0x43843d00 Mapping: 252 253 10172 table: 0x43843db0 Mapping: 253 254 10173 table: 0x43843e60 Mapping: 254 255 10174 table: 0x43843f10 What am I doing wrong? Note that I know there are lots of font options and that I can easily find OpenType fonts with suitable symbols for use with LuaTeX. There are lots of practical solutions, but this is not a practical question. I'm just curious about what is happening and how this should be corrected. I'm also aware than the problem will hopefully disappear in a few weeks time when TeX Live 2026 is released. I want to ask now precisely because this will be harder to reproduce soon and that just isn't a satisfying solution to the puzzle. Complete code as a single block: \begin{filecontents*}[overwrite]{fixit.lua} pdf.setgentounicode(1) local function fnt_tounicodes (targtexfont,targfont,targtab) print("Adding callback for",targtexfont,targfont,targtab) luatexbase.add_to_callback("luaotfload.patch_font_unsafe", function(tfmdata, specification, id) print("id",id,"spec",specification,"tfmdata",tfmdata) if not specification:match(targtexfont) then print("No match for " .. targtexfont) return end print("Mapping tounicode values for",targtexfont,targfont,targtab) for i,j in pairs(targtab) do print(targtexfont,targfont,i,j) end for index, character in pairs(tfmdata.characters) do character.index = index + 1 local u = targtab[index] character.tounicode = { u } print("Mapping:",index,character.index,u,character.tounicode) end tfmdata.filename = kpse.find_file(targfont .. ".pfb", "type1 fonts") tfmdata.type = "real" tfmdata.format = "type1" tfmdata.tounicode = 1 tfmdata.encodingbytes = 2 -- Needed for Type 1 fonts end, targtexfont .. "_" .. targfont .. "_tounicode") end fixit = {} fixit.tounicodes = fnt_tounicodes \end{filecontents*} \begin{filecontents}[overwrite]{pzd-data.sty} \ProvidesPackage{pzd-data}[0000-00-00] \ExplSyntaxOn \seq_new:N \l_pzd_unis_seq % note these are all taken from the mappings in pdfTeX's glyphtounicode \seq_set_from_clist:Nn \l_pzd_unis_seq { -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 0020, % space % 32 2701, % a1 % 33 2702, % a2 2703, % a202 2704, % a3 260E, % a4 2706, % a5 2707, % a119 2708, % a118 2709, % a117 261B, % a11 261E, % a12 270C, % a13 270D, % a14 270E, % a15 270F, % a16 2710, % a105 2711, % a17 2712, % a18 2713, % a19 2714, % a20 2715, % a21 2716, % a22 2717, % a23 2718, % a24 2719, % a25 271A, % a26 271B, % a27 271C, % a28 271D, % a6 271E, % a7 271F, % a8 2720, % a9 2721, % a10 2722, % a29 2723, % a30 2724, % a31 2725, % a32 2726, % a33 2727, % a34 2605, % a35 2729, % a36 272A, % a37 272B, % a38 272C, % a39 272D, % a40 272E, % a41 272F, % a42 2730, % a43 2731, % a44 2732, % a45 2733, % a46 2734, % a47 2735, % a48 2736, % a49 2737, % a50 2738, % a51 2739, % a52 273A, % a53 273B, % a54 273C, % a55 273D, % a56 273E, % a57 273F, % a58 2740, % a59 2741, % a60 2742, % a61 2743, % a62 2744, % a63 2745, % a64 2746, % a65 2747, % a66 2748, % a67 2749, % a68 274A, % a69 274B, % a70 25CF, % a71 274D, % a72 25A0, % a73 274F, % a74 2750, % a203 2751, % a75 2752, % a204 25B2, % a76 25BC, % a77 25C6, % a78 2756, % a79 25D7, % a81 2758, % a82 2759, % a83 275A, % a84 275B, % a97 275C, % a98 275D, % a99 275E, % a100 % 126 -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing -1, % missing 2761, % a101 % 161 2762, % a102 2763, % a103 2764, % a104 2765, % a106 2766, % a107 2767, % a108 2663, % a112 2666, % a111 2665, % a110 2660, % a109 2460, % a120 2461, % a121 2462, % a122 2463, % a123 2464, % a124 2465, % a125 2466, % a126 2467, % a127 2468, % a128 2469, % a129 2776, % a130 2777, % a131 2778, % a132 2779, % a133 277A, % a134 277B, % a135 277C, % a136 277D, % a137 277E, % a138 277F, % a139 2780, % a140 2781, % a141 2782, % a142 2783, % a143 2784, % a144 2785, % a145 2786, % a146 2787, % a147 2788, % a148 2789, % a149 278A, % a150 278B, % a151 278C, % a152 278D, % a153 278E, % a154 278F, % a155 2790, % a156 2791, % a157 2792, % a158 2793, % a159 2794, % a160 2192, % a161 2194, % a163 2195, % a164 2798, % a196 2799, % a165 279A, % a192 279B, % a166 279C, % a167 279D, % a168 279E, % a169 279F, % a170 27A0, % a171 27A1, % a172 27A2, % a173 27A3, % a162 27A4, % a174 27A5, % a175 27A6, % a176 27A7, % a177 27A8, % a178 27A9, % a179 27AA, % a193 27AB, % a180 27AC, % a199 27AD, % a181 27AE, % a200 27AF, % a182 % 239 -1, % missing 27B1, % a201 % 241 27B2, % a183 27B3, % a184 27B4, % a197 27B5, % a185 27B6, % a194 27B7, % a198 27B8, % a186 27B9, % a195 27BA, % a187 27BB, % a188 27BC, % a189 27BD, % a190 27BE % a191 % 254 } \ExplSyntaxOff \end{filecontents} \documentclass{article} \usepackage{pzd-data} \ExplSyntaxOn \lua_load_module:n { fixit } \cs_set_nopar:Npn \__fixit_tounicode:n #1 { \lua_now:n { table.insert(fixitTab,tonumber("#1",16)) } } \lua_now:n { fixitTab = {} } \seq_map_function:NN \l_pzd_unis_seq \__fixit_tounicode:n \lua_now:e { for~i,j ~in~pairs(fixitTab)~do~print(i,j)~end~ fixit.tounicodes("pzdr","uzdr",fixitTab) } \ExplSyntaxOff \usepackage{pifont} \parindent=0pt \pagestyle{empty} \begin{document} \ExplSyntaxOn \int_step_inline:nnn { 33 } { 126 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 161 } { 239 } { \ding { #1 } \c_space_tl } \int_step_inline:nnn { 241 } { 254 } { \ding { #1 } \c_space_tl } \ExplSyntaxOff \end{document}
- Numbering Issue in Cross-Referencing a Definition Blockby ranaya on January 27, 2026 at 5:38 pm
I have some definition blocks written in my Latex code. These blocks give a nice graphical view to my definitions and here's how the code looks like: In preamb: \newtcbtheorem[number within=section]{definition}{Definition} { theorem style = plain apart, enhanced, frame hidden, breakable, boxrule=2mm,titlerule=0mm,toptitle=1mm,bottomtitle=1mm, fonttitle=\bfseries\large, fontupper=\normalsize, coltitle=black!60!PinkNude, colbacktitle=white!70!PinkNude, colback=white!80!PinkNude }{def} And here's an example definition block: \begin{definition}{}{}\label{def:2_1} \begin{itemize}[leftmargin=*] \item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor. \vspace*{1mm} \item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor. \end{itemize} \end{definition} And the cross reference: we define the inertial delay ($\tau$\textsubscript{D}) of a MOSFET in the definition block \ref{def:2_1}. However, this does not produce the correct cross referencing as shown below: Can anybody shed a light on to what's happening here? Why the cross-referencing is wrong here? Thanks and Regards Anuradha
- How to thicken the subpath's segment with specific position?by Explorer on January 27, 2026 at 12:37 pm
This question is similar to this question, but not exactly the same. I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw[help lines] (-1,-1) grid (7,2); \draw[thick,magenta] (0,0) .. controls (3,3) and (4,-1) .. % coordinate[pos=.3] (A) %<- point start of thick line % coordinate[pos=.5] (B) %<- point end of thick line (6,0); \clip (2,0) rectangle (3,3); \draw[line width=3pt,cyan] (0,0) .. controls (3,3) and (4,-1) .. (6,0); \end{tikzpicture} \end{document} Noted that the GREEN cut is what I was after, the cut should along the path, but not the \clip-ed rectangle. What I saied is not the same as Paul Gaborit's solution, is that I want to control the proportion of (says 0.3 and 0.5, and coloe them thicker) the "subpath". The solution with: decoration={ show path construction, curveto code={ \addtocounter{pos}{1} \pgfmathtruncatemacro{\min}{#1 - 1} \ifthenelse{\thepos < #2 \AND \thepos > \min}{ \draw[#3] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast); }{} } } points here \tikzinputsegmentfirst, \tikzinputsegmentsupportX and \tikzinputsegmentlast looks not easy to control two points position as pos=0.3, is there any better solution? Any possible(plain-TikZ,tkz-elements,luadraw) are all welcome!
- How to expand the macros in tabularray first with `expand` key?by Explorer on January 27, 2026 at 11:30 am
I want the following result: There are two features I want to control: The columns: First Col to be itshape Second Col to add cmdA left Third Col to add cmdB right The rows: What's more, every line's content is the same, replicated for THREE times. It could be achieved by: \documentclass[border=1cm]{standalone} \usepackage{tabularray} \DeclareRobustCommand{\cmdA}[1]{cmdA#1}% \DeclareRobustCommand{\cmdB}[1]{#1cmdB}% \newcommand\columnA[1]{\textit{#1}} \newcommand\columnB[1]{\cmdA{#1}} \newcommand\columnC[1]{\cmdB{#1}} \NewExpandableDocumentCommand{ \addcols }{ m }{ {#1} & {#1} & {#1} \\} \begin{document} \begin{tblr}[expand=\addcols]{ colspec = {*{3}{X[c,m,5cm]}}, row{1} = {font=\Large\bfseries}, cell{2-Z}{1} = {cmd=\columnA}, cell{2-Z}{2} = {cmd=\columnB}, cell{2-Z}{3} = {cmd=\columnC}, hlines={1.5pt}, vlines={1.5pt}, } ColA & ColB & ColC \\ % \addcols{Line1} % \addcols{Line2} % \addcols{Line3} Line1 & Line1 & Line1 \\ Line2 & Line2 & Line2 \\ Line3 & Line3 & Line3 \end{tblr} \end{document} Now, assuming that there are too many columns(for example,10 columns), it's diffcult to type it for so many times. So I tried with \addcols, but the expand and cell{...}={cmd=...} complained with: ! Misplaced alignment tab character &. \addcols code #1-> {#1} & {#1} & {#1} \\ l.26 \end {tblr} ? Is that possible to achieve this at the same time?
- Showcase of beautiful 'electrical circuit diagrams' done in TeX & friendsby cis on January 27, 2026 at 7:03 am
When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}
- How can I accessibly make my pdf have an H1 heading?by Teepeemm on January 26, 2026 at 7:03 pm
My accessibility checker (Ally) complains that the following "PDF does not have headings": \DocumentMetadata{tagging=on,lang=en-US,pdfstandard=ua-2, tagging-setup={ math/setup=mathml-SE, % role/new-tag=Title/H1, } } \documentclass{article} \usepackage{lipsum} \title{Title} \begin{document} \maketitle \lipsum[1-9] \end{document} I understand this means that Ally is looking for a \section command (or similar), but that doesn't make sense for this document. I saw elsewhere that uncommenting the role line would cause the title to become an H1, satisfying the need for headings. This satisfies Ally, but now the compilation gives a warning Parent-Child 'pdf2:H1' --> 'pdf2:P'. Relation is not allowed! and VeraPDF says that the PDF is no longer UA-2. Is there a way to make the title become H1 and not P?
- How to define a LaTeX command with multiple \replacecmpd inputs?by palloc on January 26, 2026 at 5:13 pm
I have the following LaTeX code using the chemstyle and chemnum packages: \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} \usepackage{chemnum} \begin{document} \begin{scheme} \replacecmpd{PhH} \replacecmpd{PhMe} \includegraphics[scale=0.8]{chem.eps} \caption{Caption I} \label{sch:first} \end{scheme} % In my real project the chemicals are different \begin{scheme} \replacecmpd{PhNH2} \replacecmpd{PhNO2} \includegraphics[scale=0.8]{chem.eps} \caption{Caption II} \label{sch:second} \end{scheme} \end{document} I would like to define a new command, for example \schCall, that wraps this structure into a single macro. Desired syntax example: \schCall[0.6]{chem}{PhH, PhMe}{Caption I}{first} Where: the optional argument is the scale (default = 0.8) the first mandatory argument is the image filename (without .eps) the second mandatory argument is a comma-separated list of arguments for \replacecmpd the third argument is the caption text the fourth argument is used for the label