Hot
- Why is Adobe accessibility checker testing inside figures with PDF-based graphics?by Paul J Hurtado on August 25, 2026 at 5:13 pm
I've seen a few examples now of Adobe Acrobat's PDF checker flagging the contents of a figure graphic based on a PDF file, when the figure in the main document has alt text and should be passing. Is there a way to force it to not check those figure file contents? TO be clear: if the graphic were saved as, say, a PNG instead of a PDF, it wouldn't be flagging the issues. I don't want people to fix their accessibility report by converting those graphics to non-PDF formats. I'm not sure if this is related to this older issue and Form Xobjects: https://github.com/latex3/tagging-project/issues/945 Here is a MWE with two figures. The first gives Character encoding failures for the line segments used in the graph (but the beta on the vertical axis causes no failures), and the second figure gives Character encoding failures for the beta on the horizontal axis. FYI, I compiled the first figure PDF using lualatex (not pdflatex as mentioned in the file below) and it still gives Character encoding errors in the main document. The second figure needs to be created in R (using R Studio) by running the commands set.seed(1); hist(rnorm(1000),40,xlab=expression(beta),main="") then exporting and saving the figure as a PDF. You may need to compile the document below then compile xobject-figure.tex to generate that PDF. Alternatively, you can download the two figure PDFs, the document PDF, and LaTeX file below with this link: http://pauljhurtado.com/latex/tmp/MWE.zip. \begin{filecontents*}[overwrite]{xobject-figure.tex} \documentclass{standalone} % Deliberately use traditional TeX math fonts. \begin{document} \setlength{\unitlength}{1cm} \begin{picture}(5,4) % axes \put(0.5,0.5){\line(1,0){4}} \put(0.5,0.5){\line(0,1){3}} % deliberately problematic math character \put(0.05,2.0){$\beta$} % a little bit of graphical content \put(0.5,0.5){\line(1,1){3}} \end{picture} \end{document} \end{filecontents*} % Generate the external PDF with pdfLaTeX. \immediate\write18{pdflatex -interaction=batchmode xobject-figure.tex} % ------------------------------------------------------------ % Main accessible document % ------------------------------------------------------------ \DocumentMetadata{ lang=en-US, tagging=on, pdfstandard=ua-2 } \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{graphicx} \title{Acrobat Form XObject Character-Encoding Test} \author{Test Author} \begin{document} \maketitle This document contains externally generated PDF figures, represented in the document structure by a Figure tag with alternative text. Both give ``Character encoding'' failures when parsed by the Adobe Acrobat Accessibility checker (the $\beta$ in the second figure no longer causes problems if you omit \texttt{math/setup=\{mathml-SE,mathml-AF\}} from DocumentMetadata.) \begin{figure}[ht] \centering \includegraphics[ width=.45\linewidth, alt={A simple graph showing a diagonal line on coordinate axes.} ]{xobject-figure.pdf} \caption{A simple example graph.} \end{figure} The figure above is generated by xobject-figure.tex which should be created when you compile this document (compile that file to generate the PDF). The figure below was created in R Studio, by running the commands \texttt{set.seed(1); hist(rnorm(1000),40,xlab=expression(beta),main="")} and exporting the file as PDF saved to the file \texttt{Rplot.pdf}. \begin{figure}[ht] \centering \includegraphics[ width=.65\linewidth, alt={A simple graph showing a histogram of a sample from a standard Normal distribution of size N=1000.} ]{Rplot.pdf} \caption{A simple example graph.} \end{figure} \end{document}
- exam.cls and \raggedright \oneparchoiceby Leeser on August 25, 2026 at 3:12 pm
When using \raggedright in exam.cls and the oneparchoices or oneparcheckboxes environment, the choices are listed vertically rather than on the one line. MWE attached. If I comment out \raggedright it works as intended, leaving in \raggedright puts them in a vertical list. I'd be grateful if anyone has a solution to this. I have tried {\justify ...} and {% \rightskip=0pt plus 1em \parfillskip=0pt plus 1em \begin{oneparcheckboxes}...} and a few other tweaks but nothing works. \documentclass{exam} \begin{document} \raggedright % comment in/out \begin{questions} \question What is the minimum number of personnel that should be present in the laboratory when experimental work is in progress? \begin{oneparcheckboxes} \choice 1 \CorrectChoice 2 \choice 3 \choice 4 \end{oneparcheckboxes} \question What is the minimum number of personnel that should be present in the laboratory when experimental work is in progress? \begin{oneparchoices} \choice 1 \CorrectChoice 2 \choice 3 \choice 4 \end{oneparchoices} \end{questions} \end{document}
- How to do a letter [duplicate]by PABLO ALONSO BARRIOS ARTECHE on August 25, 2026 at 2:21 pm
Someone knows how can I make this letter? Thanks!
- Is it possible to have a different tocdepth in two table of contents?by KeithB on August 25, 2026 at 10:49 am
I've not been able to find a way to achieve this behaviour, in which the local toc has full depth, but the main toc suppresses sections for part 2 only. Any suggestions? Document structure: \documentclass{book} \usepackage{etoc} % or is there something better? \begin{document} \part{Part 1} \tableofcontents \chapter{Chapter 1} \section{Section 1.1} \section{Section 1.2} \chapter{Chapter 2} \section{Section 2.1} \section{Section 2.2} \part{Part 2} \localtableofcontents \chapter{Chapter 3} \section{Section 3.1} \section{Section 3.2} \chapter{Chapter 4} \section{Section 4.1} \section{Section 4.2} \chapter{Chapter 5} \section{Section 5.1} \section{Section 5.2} \end{document} Desired toc: Table of contents of both parts % NB: sections of part 2 suppressed (tocdepth changes for part 2) Chapter 1 ..................................................... Section 1.1 ................................................. Section 1.2 ................................................. Chapter 2 ..................................................... Section 2.1 ................................................. Section 2.2 ................................................. Chapter 3 ..................................................... Chapter 4 ..................................................... Chapter 5 ..................................................... Table of contents of part 2 % NB: sections of part 2 shown Chapter 3 ..................................................... Section 3.1 ................................................. Section 3.2 ................................................. Chapter 4 ..................................................... Section 4.1 ................................................. Section 4.2 ................................................. Chapter 5 ..................................................... Section 5.1 ................................................. Section 5.2 .................................................
- colorlet causes Undefined color error with slightly different pdflatex versionby Namal on August 25, 2026 at 9:08 am
I use colorlet to define my own color at the beginning of the document. \usepackage[dvipsnames]{xcolor} \colorlet{row3_color}{red7} This works fine with the current Debian13 Texlive Version (texlive-full): pdfTeX 3.141592653-2.6-1.40.28 (TeX Live 2025) kpathsea version 6.4.1 Copyright 2025 Han The Thanh (pdfTeX) et al. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Han The Thanh (pdfTeX) et al. Compiled with libpng 1.6.46; using libpng 1.6.46 Compiled with zlib 1.3.1; using zlib 1.3.1 Compiled with xpdf version 4.04 But causes an Error: ! Package xcolor Error: Undefined color `red7' with the Alpne Version (texlive-full) pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/Alpine Linux) kpathsea version 6.4.1 Copyright 2025 Han The Thanh (pdfTeX) et al. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Han The Thanh (pdfTeX) et al. Compiled with libpng 1.6.49; using libpng 1.6.58 Compiled with zlib 1.3.1; using zlib 1.3.2 Compiled with xpdf version 4.04 What do I do wrong here? Maybe I can define it differently if I really want to use red7? Otherwise if I use red7 directly in the document it works fine in both versions. Edit: Thanks to your answers I could figure it out. I was using the tabularry package with tblr-extras. Those extras were loading the color definition in the working case and weren't enough in the other case. Adding ninecolors fixes the problem. As requested, an example: \documentclass[ngerman]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{babel} \usepackage[landscape, hmargin=0.5cm, vmargin=1.5cm ]{geometry} \usepackage[dvipsnames]{xcolor} \usepackage{hyperref} \usepackage{tabularray, tblr-extras} \usepackage{ninecolors} \UseTblrLibrary{babel,amsmath,varwidth} %\usepackage{showframe} \colorlet{row3_color}{red7} \begin{document} \centering \begin{longtblr}[ caption = {Mytable} ] { colspec={Q[l,m] Q[l,m] X[l,m] X[3,c] l l X[l,m]}, vlines, rowhead = 2, cell{1}{4}={r=3}{c}, cell{1}{1-Z}={row3_color}, measure=vbox, vspan=even } \hline 0B7 & {KBM-TelegrFehler \\ -Verdichtung} & Verdichtung Telegrammfehler von Anlage auf Linie & wird direkt übernommen & 0B7 & {KBM-TelegrFehler \\ -Verdichtung} & Verdichtung Telegrammfehler von Anlage auf Linie\\ \hline 2 & Empfangstimeout[sec] & Nach ablauf geht die Linie in Ausfall & & 2 & Empfangstimeout[sec] & Empfangs-Timeout\\ \hline 4 & Sendetimeout[sec] & Sende-Timeout& & 4 & Sendetimeout[sec] & Sende-Timeout\\ \hline \end{longtblr} \end{document}
- How to draw realistic scientific calculator buttons and LCD screens in LaTeX? [duplicate]by user446526 on August 25, 2026 at 8:20 am
I am currently working on a mathematical document and I need to explain how to use a scientific calculator (specifically similar to Casio models) for operations like factorials, permutations, and combinations. I would like to recreate the calculator buttons and the LCD screen natively in LaTeX so that they blend perfectly with the text, rather than inserting external images. Here is a reference image (2875.jpg) showing exactly the style I want to achieve: Specifically, I am looking to create macros for: The Buttons: Rounded shapes with a slight 3D/shadow effect. Some buttons are dark blue (like SHIFT), others are dark grey or light grey. Secondary Labels: The ability to add small text above the buttons (like the yellow x! or nCr, and the red LCM). The LCD Screen: A box that mimics the calculator screen, showing the input expression on the left, the result on the bottom right, and tiny indicators at the top (like M, D, Math). I honestly don't know how to achieve this realistic look. I suspect it requires some advanced TikZ or tcolorbox styling, but I couldn't figure out where to start. Could someone provide a minimal working example or guide me on how to design these elements elegantly? Any help would be greatly appreciated!
- How to make two TikZ nodes have exactly the same height?by Marco Moldenhauer on August 25, 2026 at 7:03 am
I am defining custom keyboard-key commands using TikZ and the menukeys package. I defined two types of keystroke commands: one containing a normal letter and another containing a symbol such as \shift. The problem is that the \keystrokeSymbol node does not have the same height as the \keystrokeLetter node. I would like the symbol key to have exactly the same height as the letter key, while still allowing the symbol to be vertically centered. What would be the most elegant TikZ/LaTeX approach to achieve this? Note: I would prefer a solution using TikZ itself, without introducing additional packages, if possible. Code \documentclass{article} \usepackage{tikz} \usepackage{menukeys} \tikzset{ keystroke/.style={ draw=black!50, fill=yellow, %drop shadow={shadow xshift=0.15ex,shadow yshift=-0.15ex,fill=black,opacity=0.7}, rectangle, %rounded corners=0.8pt, inner xsep=0.8pt, inner ysep=0.8pt, line width=0.3pt, %minimum width=0.21cm, %minimum height=0.21cm, font=\sffamily\small, text=blue!75!black, %anchor=south } } \newcommand*\keystrokeLetter[1]{% \tikz[baseline=(key.base)] % \node[keystroke,fill=green!10](key) {#1} ;% } \newcommand*\keystrokeSymbol[1]{% \tikz[baseline=(key.base)] % \node[keystroke](key) {#1} ;% } \newcommand*\menubutton[1]{% \tikz[baseline=(key.base)] % \node[% keystroke, %signal, fill=black!8 ](key) {#1} ;% } \begin{document} first press \keystrokeLetter{A} and \keystrokeSymbol{\shift}\keystrokeLetter{R}, then click on \menubutton{FILE} \menubutton{EDIT}. \end{document} Output Desired Output
- I cannot write any commands inside "\textArab{}"by الطريق طالب العلم on August 24, 2026 at 7:08 pm
I have a problem: After creating my custom character map "MyRules.lua", I can type the characters perfectly, but I cannot type any commands inside \textArab{}. This file 'MyRules.lua' local TransTable = { -- 1. معالجة الحروف المشددة أولاً (لأنها تتكون من رمز مكرر) {a = "%^t", b = "ث"}, {a = "%^H", b = "خ"}, {a = "%^d", b = "ذ"}, {a = "%^r", b = "ز"}, {a = "%^s", b = "ش"}, {a = "%^S", b = "ض"}, {a = "%^T", b = "ظ"}, {a = "%^A", b = "غ"}, {a = "%:y", b = "ي"}, } singlefv = { {a="e", b="ء"}, {a="a", b="ا"}, {a="b", b="ب"}, {a="t", b="ت"}, {a="j", b="ج"}, {a="H", b="ح"}, {a="d", b="د"}, {a="r", b="ر"}, {a="s", b="س"}, {a="S", b="ص"}, {a="T", b="ط"}, {a="f", b="ف"}, {a="A", b="ع"}, {a="f", b="ف"}, {a="q", b="ق"}, {a="k", b="ك"}, {a="l", b="ل"}, {a="m", b="م"}, {a="n", b="ن"}, {a="h", b="ه"}, {a="w", b="و"}, {a="y", b="ى"}, {a="c", b="c"}, } LuaAr = {} function LuaAr.process(text) local inside = text -- حلقة تكرارية تمر على الجدول من أول سطر إلى آخره for i = 1, #TransTable do inside = string.gsub(inside, TransTable[i].a, TransTable[i].b) end for i = 1,#singlefv do inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) end -- إرجاع النص النهائي بعد تحويله بالكامل return inside end This is the code \documentclass{article} \usepackage{amsmath,amssymb,amsfonts} \usepackage{comment,luacode,xstring} \usepackage[no-math]{fontspec} \usepackage{polyglossia} \usepackage{xspace} \setdefaultlanguage[numerals=maghrib]{arabic} % from polyglossia \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic, Mapping=maghrib]{Times New Roman}%Amiri \newfontfamily\englishfont[Script=Arabic,Mapping=maghrib]{Times New Roman} \newfontfamily\fontmath[Script=Arabic,AutoFakeBold=.7,%FakeSlant=-0.2 WordSpace =.8,PunctuationSpace=2, SizeFeatures={ {Size={-8},FakeStretch=1.1,FakeBold=1.5}, {Size={8-14}}, {Size={14-}}, }]{MyFonttwo002-VF.ttf} \directlua{dofile(kpse.find_file("MyRules.lua"))} \newcommand{\trans}[1]{% \bgroup \fontmath % \textdir TRT % جعل اتجاه الكتابة من اليمين إلى اليسار \directlua{tex.sprint(LuaAr.process(\luastringN{#1}))}\egroup% } \makeatletter \def\arabtexcodes{\catcode`^=11\relax\catcode`_=11\relax} %\let\arabtex@codes\arabtexcodes \makeatother \newcommand{\textArab}[1]{% \bgroup% \arabtexcodes \fontmath \ifvmode\leavevmode\fi% \directlua{tex.sprint(LuaAr.process(\luastring{#1}))}% \egroup% } \newcommand{\ar}[1]{%->arb-math inline {\ignorespaces\textArab{#1}} } \newcommand{\afrac}[2]{ {\bfseries\boldmath\fontspec{MyFonttwo002-VF.ttf}[FakeStretch=1.1,FakeBold=1.5]\ensuremath{\!\frac{\text{\textArab{#1}}}{\text{\textArab{#2}}}}} } \begin{document} \textArab{0123456789\\1.2\\ e a b t ^t j H^H d ^d r ^r s ^s S ^S T ^T A ^A f q k l m n h w y c }% $\frac{num}{den}$ \\ \ar{a + \afrac{num}{den}} \end{document} I have a problem. ! Incomplete \iffalse; all text was ignored after line 57. <inserted text> \fi <*> document.tex The file ended while I was skipping conditional text. This kind of error happens when you say `\if...' and forget the matching `\fi'. I've inserted a `\fi'; this might work. ! Emergency stop. <*> document.tex *** (job aborted, no legal \end found) Here is how much of LuaTeX's memory you used: 6259 strings out of 475695 100000,794899 words of node,token memory allocated 1050 words of node memory still in use: 6 hlist, 1 vlist, 2 rule, 1 local_par, 1 dir, 32 glue, 4 kern, 6 penalty, 44 glyph, 12 attribute, 52 glue_spec, 12 attribute_list, 1 temp, 3 if_stack, 2 writ e nodes avail lists: 2:1,4:1,5:6,7:1 29001 multiletter control sequences out of 65536+600000 31 fonts using 14732263 bytes 73i,1n,93p,291b,265s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!
- Can csvsimple can handle such type of csv contains?by Biki Teron on August 24, 2026 at 6:37 pm
Let suppose I have csv file as mentioned below, 1st row not printed in the output SlNo,Name,Affiliation 1,John Deo,"A College, A City" 2,Piter Deo, A College Here is my MWE \documentclass{article} \usepackage{csvsimple-l3} \usepackage{tikz} \begin{document} \csvreader[ % separator=semicolon, head to column names ]{participants.csv}{}{% \begin{tikzpicture} \node[] at (1.2,2.45) {\Name}; \node[] at (1.2,4.45) {\Affiliation}; \end{tikzpicture} \newpage } \end{document}
- Titlesec alignment on section headings versus table of contents headingby tangulo on August 24, 2026 at 5:41 pm
In using the titlesec package to define my own section label, the horizontal alignments for the section label are different for the table of contents and the regular section headers. In the image below, you can see how the first section heading is placed to the right. How can I fix this problem? MWE: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{tikz} \usepackage[explicit]{titlesec} \titleformat{\section}{ \gdef\sectionlabel{} \LARGE\bfseries\sffamily %font }{ \gdef\sectionlabel{\thesection\quad} }{ 0in }{ \begin{tikzpicture} \fill[blue] (0,0) rectangle (\textwidth, 1cm); \node[anchor=mid west] at (0, 0.5cm) {\color{white}\sectionlabel#1}; \end{tikzpicture} } \begin{document} \tableofcontents \section{Section Name 1} \noindent Text. \end{document}
- Use different numbering when in special environmentsby Jacopo Remondina on August 24, 2026 at 4:31 pm
I'm using the Exam class (well, a customize version of it, but it shouldn't matter too much), and I would like to have some equation in the normal text (number for example "Eq. 1.2") and some other numbering when writing the solutions answers (for example "Sol. eq. 1.2a") while preserving all the equation environments (including the ones from asmmath) as untouched as possible. How can I do so? One dumb solution will be to use a completely new counter (i.e. soleqn), starred version of the equation environments + manual tagging/labelling (something like in https://tex.stackexchange.com/a/661520, but I'm wondering if it's possible to tell LaTex to replace any call to counter (\stepcounter, \thecounter, \resetcounter, etc) equation by calls to counter soleqn when entering some special environment (and reverting to the normal behaviour when leaving such environment) [perhaps storing the equation counter value somewhere, resetting equation to 0, linking soleqn operation to eqution, and restoring the original equation value when leaving?]. MWE (working! Solution from Rmano + my modifications): exam class/package: \ProvidesPackage{examPackMWE} \newif\ifsolution \newcounter{soleqn} \def\thesoleqn{Sol. Eqn. \Alph{soleqn}} % here we can format how the label should appear, including displaying other counters \newcommand{\@examclass@initsoleqnenv} {% I moved here Rmano code so that I can call it from several position of my code for testing/debugging/advanced puproses \setcounter{soleqn}{0} \let\c@equation\c@soleqn% Make equation counter point to the soleqn counter \renewcommand{\theequation}{\thesoleqn}% Update equation counter representation } \newenvironment{solution} { \@examclass@initsoleqnenv }{ }% Main document: \documentclass{article} \usepackage{amsmath} \usepackage{examPackMWE} \begin{document} \begin{equation} ThisEquationIsNormal \end{equation} \begin{solution} \begin{align} ThisIsASolutionEquation \end{align} \end{solution} \begin{equation} AnotherNormalEquation \end{equation} \end{document} Ouput of the code: EDIT (25/08/26): corrected a couple of typos EDIT (25/08/26 evening): added (working MWE) + output
- Does CTAN publicly announce new packages?by Nate on August 24, 2026 at 3:44 pm
I was wondering whether CTAN informs the LaTeX community every so often (say, every month) about new packages that have been uploaded and accepted. Or do people have to search for that themselves?
- how to put colored lines into a colored (colortbl) table?by Jürgen on August 24, 2026 at 1:39 pm
I would like to put vertical and horizontal lines in the innermost four cells. How to? \documentclass{scrartcl} \usepackage{colortbl} % \begin{document} \rowcolors{1}{green}{green} \color{blue}% \begin{tabular}{cccc} \rowcolor{blue} \textcolor{red}{$\Omega$} & \textcolor{red}{$T$} & \textcolor{red}{$\overline{T}$} & \textcolor{red}{$\Sigma$} \\ % \cellcolor{blue}\textcolor{red}{$K$} & 1960 & 40 & \cellcolor{blue}\textcolor{red}{2000} \\ % \cellcolor{blue}\textcolor{red}{$\overline{K}$} & 4900 & 93100 & \cellcolor{blue}\textcolor{red}{98000} \\ % \rowcolor{blue} \textcolor{red}{$\Sigma$} & \textcolor{red}{6860} & \textcolor{red}{93140} & \textcolor{red}{100000} \end{tabular} \end{document} Note: The result is definitely very ugly, pls don't comment on that. It is due to the reduction of a far more elaborated table to get a somehow minimal example. Thanks!
- Command producing sentences with words spaced at customby user446112 on August 24, 2026 at 10:21 am
I want to create a command which produces sentences with words spaced at custom. The problem is: after employing the command, all text seems to have the used distance between words. What is wrong here? With thanks. My code is: \documentclass{beamer} \usepackage{ragged2e} \justifying \usepackage{lipsum} \newcommand{\mytext}[2]{\fontdimen2\font=#1 #2} \begin{document} \begin{frame} \mytext{4.5ex}{This is my text with words spaced by 4.5ex}. \bigskip This is my normal text: \lipsum[1][1-2] \end{frame} \end{document}
- Crowded piecewise model formula when using \displaystyle within casesby Marton Horvath on August 24, 2026 at 9:27 am
Considering the equation below, I found that when using \displaystyle, the space between the numerator in the second expression (i.e., t>t_{CP} case) and the fraction bar becomes disproportionate to the space between the numerator and the denominator in the first case. \begin{equation} P(t) = \begin{cases} \displaystyle \frac{W'}{t+\frac{W'}{P_{max}-CP}}+CP,&~~~~t\leq t_{CP}\\ \displaystyle \frac{W'}{t+\frac{W'}{P_{max}-CP}}+CP-A\cdot \ln\frac{t}{t_{CP}},&~~~~t>t_{CP} \end{cases} \end{equation} With \displaystyle: And without: A dummy fix to the version using \displaystyle is to introduce a new empty line between the two cases; nevertheless, it may not be too elegant besides making the equation take up significantly more space overall. I wonder what the best way is to avoid the expression getting crowded, and the explanation is behind this observation? I am using amsmath and amsfonts. Edit: Several nice solutions have been proposed. I would also be interested in why the spacing between the fraction bar and the symbol in the numerator changed seemingly when using \displaystyle?
- How do I create images in the Unicode UCB format in LaTeX?by mathrm alpha on August 24, 2026 at 3:15 am
For example, how can I create an image in a format similar to the Unicode UCB image on Wikipedia? https://commons.wikimedia.org/wiki/User:Antonsusi/Unicode Unicode UCB images like this one: I've tried this: \documentclass[varwidth=16cm, border=0pt]{standalone} \usepackage{array} \usepackage{fontspec} \usepackage{luacode} \usepackage[table]{xcolor} \setmainfont{NewCM10-Regular.otf} % or Other Unicode block fonts \setlength{\tabcolsep}{0pt} \renewcommand{\arraystretch}{1} \newcolumntype{L}{>{\centering\arraybackslash}p{0.5cm}} \begin{luacode} function print_unicode_grid(start_hex, end_hex) local start_code = tonumber(start_hex, 16) local end_code = tonumber(end_hex, 16) local tfmdata = font.getfont(font.current()) local characters = tfmdata and tfmdata.characters tex.sprint("\\noindent\\begin{tabular}{|" .. string.rep("L|", 16) .. "}") tex.sprint("\\hline") local current = start_code while current <= end_code do for i = 0, 15 do local code = current + i if code <= end_code then local hex_str = string.format("U+%04X", code) tex.sprint( "{\\fontsize{3pt}{3.5pt}\\selectfont\\textsf{\\textbf{" .. hex_str .. "}}}" ) end if i < 15 then tex.sprint("&") end end tex.sprint("\\\\ \\hline") for i = 0, 15 do local code = current + i if code <= end_code then local has_glyph = false if characters and characters[code] then has_glyph = true end if has_glyph then tex.sprint( "{\\fontsize{14pt}{14pt}\\selectfont " .. utf8.char(code) .. "}" ) else tex.sprint("\\cellcolor{gray!30}\\rule{0pt}{14pt}") end end if i < 15 then tex.sprint("&") end end tex.sprint("\\\\ \\hline") current = current + 16 end tex.sprint("\\end{tabular}") end \end{luacode} \newcommand{\UnicodeGrid}[2]{% \directlua{print_unicode_grid("#1", "#2")}% } \begin{document} \UnicodeGrid{0370}{03FF} \end{document} However, U+xxxx appears to be twice as tall as the text, and the other half of the display area is blank. Is there a way to shorten the U+xxxx line so that the output matches the input exactly—meaning there won't be any extra whitespace or missing TeX display content?
- tikz how to stop lines at shape edge when using plotted coordinatesby JKomp on August 23, 2026 at 10:49 pm
I'm writing a translator from OmniGraffle (left diagram) to tikz and I've run into a bit of a problem for translating lines (right diagram). Lines in OmniGraffle are specified as a start point, middle vertices and an ending point. I can replicate the exact shape of the line from the OmniGraffle points by using tikz plot/coordinates in a draw but I'm unsure how to change the code to end at the shape boundary. Here's my MWE \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (36pt,-36pt) circle [radius=36pt ] node [] (S0) { S0}; \draw[red] plot [smooth, tension=1] coordinates { (S0) (-17.600000262260437pt, 3.89259546372341pt) (15.955999737740058pt, 28.233391483626292pt) (S0)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (87.40297565709261pt, 7.120001628994942pt) (57.999990582466125pt, 25.534386508502394pt) (36pt, -36pt)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (-15.128618137809553pt, -70.48571669739613pt) (10.699999623000622pt, -91.0802335745775pt) (36pt, -36pt)}; \end{tikzpicture} \end{document} Note, this is an early phase so things like line widths, arrowheads, text formatting, and converting out of pt coordinates are later tasks.
- Follow-up question: Multiple citations of the same reference, each time with a different page numberby Luiz Mendes on August 23, 2026 at 10:19 pm
I found this nice solution regarding the question Multiple citations of the same reference, each time with a different page number. However, it works only for the 'numeric' biblatex bibliographic style. Since my knowledge of low-level TeX/LaTeX commands is very limited, how that solution could be adapted to work also for the 'authoryear' style?
- Aligning a TikZ node with the text baseline and controlling surrounding spacingby Marco Moldenhauer on August 23, 2026 at 4:53 pm
I am creating a \keystroke command using TikZ to typeset keyboard keys as small boxes: Code \documentclass{article} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{shadows} \newcommand*\keystroke[1]{% \tikz[baseline=(key.base)] \node[% draw, fill=black!10, drop shadow={shadow xshift=0.15ex,shadow yshift=-0.15ex,fill=black,opacity=0.7}, rectangle, rounded corners=1pt, inner xsep=1.5pt, inner ysep=1.5pt, line width=0.4pt, minimum width=0em, minimum height=0em, font=\ttfamily\small ](key) {#1} ; } \begin{document} Once Blender has started, press \keystroke{A} to select all existing \end{document} Output Questions I would like to solve two problems: Question Q1: Baseline alignment: How can I vertically position the Tikz node so that the box properly aligned with the baseline of the text outside that node? Question Q2: Horizontal spacing: Why is there apparently more horizontal space after the \keystroke node than before it? How can I make the spacing around the node consistent, so that press \keystroke{A} to has the same spacing before and after the key? Edit (my goal in detail)
- How can I expand tables into column/text width using tabularrayby MadyYuvi on August 23, 2026 at 1:39 pm
My code are: \documentclass[twocolumn]{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{lipsum} \SetTblrInner{ rowsep=0pt, row{1}={l,b}, hborder{1}={belowspace=6pt}, hborder{2}={abovespace=2pt,belowspace=6pt}, hborder{Z}={abovespace=6pt}, width=\textwidth} \begin{document} \lipsum[1] \begin{table} \caption{Value of Grid Convergence Index.\label{table1-09544062261479876}} \begin{tblr}{@{\extracolsep\fill}llll@{\extracolsep\fill}} \toprule {} & {\textit{Cpmin}} & {\textit{Cpmin}} & {\textit{Cpmin}}\\ \midrule {GCI N1-N2} & {0.95\%} & {0.46\%} & {0.86\%}\\ {GCI N2-N3} & {0.59\%} & {0.33\%} & {0.58\%}\\ \bottomrule \end{tblr} \end{table} \lipsum[2-3] \begin{table*} \caption{Value of Grid Convergence Index.\label{table1-09544062261479876}} \begin{tblr}{@{\extracolsep\fill}llll@{\extracolsep\fill}} \toprule {} & {\textit{Cpmin}} & {\textit{Cpmin}} & {\textit{Cpmin}}\\ \midrule {GCI N1-N2} & {0.95\%} & {0.46\%} & {0.86\%}\\ {GCI N2-N3} & {0.59\%} & {0.33\%} & {0.58\%}\\ \bottomrule \end{tblr} \end{table*} \lipsum[1-5] \end{document} This produced the output as: How can I expand table into column/full width (using table*) by auto?
- \underleftarrow and \underrightarrow with New Computer Modernby msx on August 23, 2026 at 10:22 am
I have the two commands defined in the document, \documentclass[12pt, a4paper]{article} \usepackage{fontsetup} \DeclareMathOperator*{\prolim}{\underleftarrow{\lim}} \DeclareMathOperator*{\indlim}{\underrightarrow{\lim}} \begin{document} \begin{equation} \indlim_{i \in I} X_{i} \end{equation} \begin{equation} \prolim_{i \in I} X_{i} \end{equation} \end{document} and with LuaLaTeX, this gives the output The arrows are clearly much shorter and smaler than expected, is there any way I can make the arrows "normal"?
- what is the most reliable way to prevent orphan section title showing on its own at end of a page?by Nasser on August 23, 2026 at 6:09 am
I have this set up. Number of \section{} followed immediately by longtable. All in a chapter. Depending on how large the table is, PDF can end up with section showing on its own at bottom of page. I tried to put \Needspace{10\baselineskip} before \section but this is a hit and miss. sometimes it works and sometimes it does not. I can try to increase the value to 15\baselineskip but how to know this will work all the time? The problem is that the longtable the follows can span more than one page also. Adding an explicit \pagebreak or \newpage before each \section can end up with large empty spaces in pages. I also added \raggedbottom but it did not help in this example below. What is the best way in latex to make sure a section title (or a subsection title also) do not end on its own at end of a page, that works for all cases and for all geometry settings without having to use trial and error each time, as content of tables can change and also amount of text can change. It seems this happens only when a longtable starts right after section title. But I can not be sure. But for now, I need to solve this specific case when longtable follows immediately a section title. It could have something to do with the fact that it is a longtable that follows? Here is MWE \documentclass[12pt]{book} \usepackage{longtable} \usepackage{hyperref} \usepackage{needspace} \usepackage{array} \usepackage{xcolor} \usepackage{pifont} %http : // ctan.org/pkg/pifont \newcommand{\cmark}{\textcolor{blue}{\Large \ding{51}}} \newcommand{\xmark}{\textcolor{red}{\Large \ding{55}}} \newcommand{\notsure}{\ding{103}} % \usepackage{lipsum} \begin{document} \title{my title to solve $\sin x = x$} \tableofcontents \chapter{A} \lipsum[1] some line here some line here some line here some line here some line here some line here some line here some line here some line here some line here some line here some line here some line here some line here \Needspace{10\baselineskip} \section{First order differential equations. Section 1.4 (separable equations). Problems at page 43, Problems at page 88} \begingroup \setlength{\LTleft}{-20cm plus -1fill} \setlength{\LTright}{\LTleft} \begin{longtable}{ |>{\centering\arraybackslash}m{0.6in} |>{\centering\arraybackslash}m{0.6in} |m{3.6in} |>{\centering\arraybackslash}m{0.35in} |>{\centering\arraybackslash}m{0.28in} |>{\centering\arraybackslash}m{0.28in} |>{\centering\arraybackslash}m{0.28in}| } \caption{Lookup table for all problems in current section}\\\hline ID & problem& \multicolumn{1}{c|}{ODE} &{\scriptsize Solved?}&{\scriptsize Maple}&{\scriptsize Mma}&{\scriptsize Sympy} \\\hline \endfirsthead \multicolumn{7}{@{}c@{}}{\parbox{\dimexpr5in+6\tabcolsep-2\arrayrulewidth\relax}{\small\tablename~\thetable\, Lookup table \\ {\footnotesize \emph{Continued from previous page}}\vspace*{1ex}}}\\\hline ID & problem& \multicolumn{1}{c|}{ODE} &{\scriptsize Solved?}&{\scriptsize Maple}&{\scriptsize Mma}&{\scriptsize Sympy} \\\hline \endhead \hline \multicolumn{7}{|r|}{\footnotesize \emph{Continued on next page}}\\\hline \endfoot \hline \endlastfoot \hyperref[41]{41} &1& \[ \begin{array}{>{\displaystyle}r @{\;} >{\displaystyle}l} y^{\prime}+2 y x&=0 \end{array} \] &\cmark&\cmark&\cmark&\cmark\\ \hline \hyperref[42]{42} &2& \[ \begin{array}{>{\displaystyle}r @{\;} >{\displaystyle}l} y^{\prime}+2 x y^{2}&=0 \end{array} \] &\cmark&\cmark&\cmark&\cmark\\ \hline \hyperref[43]{43} &3& \[ \begin{array}{>{\displaystyle}r @{\;} >{\displaystyle}l} y^{\prime}&=y \sin \left(x \right) \end{array} \] &\cmark&\cmark&\cmark&\cmark\\ \hline \hyperref[44]{44} &4& \[ \begin{array}{>{\displaystyle}r @{\;} >{\displaystyle}l} \left(x +1\right) y^{\prime}&=4 y \end{array} \] &\cmark&\cmark&\cmark&\cmark\\ \hline \hyperref[45]{45} &5& \[ \begin{array}{>{\displaystyle}r @{\;} >{\displaystyle}l} 2 \sqrt{x}\, y^{\prime}&=\sqrt{1-y^{2}} \end{array} \] &\cmark&\cmark&\cmark&\cmark\\ \hline \end{longtable} \endgroup \end{document} Compiled with lualatex in TL 2026 gives
- How to Create a Simple Demo Slideshow Showing Unicode Dynamic Ascending Code Values Using LaTeX [closed]by mathrm alpha on August 23, 2026 at 2:46 am
I'd like to use LaTeX to create something similar to the “Animation showing the increasing Unicode encoding values” in this video. Do you know of a way to do this? https://youtu.be/o8XvMlCoOac
- How to accessibly strike through text?by Teepeemm on August 22, 2026 at 8:25 pm
I would like to accessibly strike through some text. Let's start with this: \DocumentMetadata{lang=en,tagging=on,pdfstandard=ua-2} \documentclass{article} \title{Title} \usepackage{ulem} \begin{document} before \sout{struck out} after \end{document} The PDF looks like "before struck out after". Unfortunately, it appears that screen readers cannot tell this has happened: ngPDF.com says that the content is "before struck out after" show-pdf-tags says that the content is "before struckout after" PDFix and Adobe say that the content is "before PathstruckPathPathout after" (Adobe says that the "Path"s are the lines over "struck", " ", and "out") Based on the tagpdf documentation, I created a struckout.css file with .struckout { text-decoration: line-through; } and adjusted the the code to \DocumentMetadata{lang=en,tagging=on,pdfstandard=ua-2, % uncompress, tagging-setup={ role/new-attribute={struckout}{}, css-list-add={struckout.css} } } \documentclass{article} \title{Title} \usepackage{ulem} \NewCommandCopy\oldsout\sout \renewcommand\sout[1]{% \tagstructbegin{tag=Span,attribute-class={struckout}}% \tagmcbegin{tag=Span}% \oldsout{#1}% \tagmcend% \tagstructend% } \begin{document} before \sout{struck out} after \end{document} I can see that the css file has been included, and ngPDF, PDFix and Adobe see that the class has been included. Unfortunately, they all agree that "after" has become an artifact, and show-pdf-tags crashes ("show-pdf-tags:176: assertion failed!"). How can I adjust this to tag the struck through text? (And is a span sufficient, or should I add some actualtext saying this has been struck through?)
- How to plot the graph with better curvature?by user1942348 on August 22, 2026 at 5:44 pm
I want to plot the above Fig. Using the code below, the curvature are not coming same as the Fig. Please help me get the exact Fig. \documentclass[12pt]{article} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture}[ scale=1.5, thick, vertex/.style={circle, draw=black, fill=white, inner sep=1.5pt, minimum size=6pt} ] % Coordinates \coordinate (v2) at (0, 0); \coordinate (v1) at (-1.5, 0.6); \coordinate (v3) at (1.5, 0.6); \coordinate (v7) at (-1.5, -0.6); \coordinate (v6) at (1.5, -0.6); \coordinate (v8) at (-2.5, 0); \coordinate (v5) at (2.5, 0); \coordinate (v0) at (-3.5, 1.8); \coordinate (v4) at (3.5, 1.8); \coordinate (v10) at (-3.5, -1.8); \coordinate (v9) at (3.5, -1.8); % Continuous Curves % Curve 1: Inner (v0 -> v1 -> v2 -> v3 -> v4) \draw (v0) to[out=-30, in=150] (v1) to[out=-30, in=180] (v2) to[out=0, in=210] (v3) to[out=30, in=210] (v4); % Curve 2: Inner (v10 -> v7 -> v2 -> v6 -> v9) \draw (v10) to[out=30, in=210] (v7) to[out=30, in=180] (v2) to[out=0, in=150] (v6) to[out=-30, in=150] (v9); % Curve 3: Top (v8 -> v1 -> v3 -> v5) \draw (v8) to[out=45, in=210] (v1) to[out=30, in=150] (v3) to[out=-30, in=135] (v5); % Curve 4: Bottom (v8 -> v7 -> v6 -> v5) \draw (v8) to[out=-45, in=150] (v7) to[out=-30, in=210] (v6) to[out=30, in=225] (v5); % Curve 5: Left Bow (v0 -> v8 -> v10) \draw (v0) to[out=-60, in=90] (v8) to[out=-90, in=60] (v10); % Curve 6: Right Bow (v4 -> v5 -> v9) \draw (v4) to[out=-120, in=90] (v5) to[out=-90, in=120] (v9); % 3. Hollow Nodes \node[vertex, label=left:$v_0$] at (v0) {}; \node[vertex, label=above:$v_1$] at (v1) {}; \node[vertex, label=above:$v_2$] at (v2) {}; \node[vertex, label=above:$v_3$] at (v3) {}; \node[vertex, label=right:$v_4$] at (v4) {}; \node[vertex, label=right:$v_5$] at (v5) {}; \node[vertex, label=below:$v_6$] at (v6) {}; \node[vertex, label=below:$v_7$] at (v7) {}; \node[vertex, label=left:$v_8$] at (v8) {}; \node[vertex, label=right:$v_9$] at (v9) {}; \node[vertex, label=left:$v_{10}$] at (v10) {}; \end{tikzpicture} \end{center} \end{document}
- How to color \middle| to generate red vertical bar between two array?by Nasser on August 21, 2026 at 9:56 pm
I have to use \middle| to create vertical bar as follows \documentclass[12pt]{book} \usepackage{amsmath} \usepackage{array} \usepackage{xcolor} \begin{document} \[ \left[ \begin{array}{cc} 3i&-3\\ 3&3i \end{array} \middle| \begin{array}{c} 0\\ 0 \end{array} \right] \] \end{document} Compiles to I just need to make the vertical bar red. Tried things such as \middle\color{red}| and \middle\textcolor{red}{|} but these produce Missing delimiter errors. the reason I need \middle| rather than the simpler cc|c is HTML conversion issue. In ordinary LaTeX, cc|c is preferable, but \middle| is currently only workaround that compiled and generates correct vertical bar in HTML. I just like to make the color red if possible, using the same above code, to make the bar more clear. There will only be one vertical bar. But number of rows and columns can change. No tikz solutions please. TL 2026
- How to pass keys values as expl3 token listby Denis Bitouzé on August 21, 2026 at 5:17 pm
I would like to create a document command, say \marginaliagraphic, that: inserts a graphic (using \includegraphics) into the marginal note (using \marginalia from the marginalia package), allows the user to continue specifying the parameters of \marginalia and \includegraphics using key values, for example, like this: \marginaliagraphic[ , marginaliaset = { pos=left, valign=b } , graphicset = { width=.5\linewidth, angle=90 } ]{example-image} The following attempt fails, likely due to an expansion issue: \documentclass{article} \usepackage{marginalia} \usepackage{graphicx} \ExplSyntaxOn \keys_define:nn { mymodule } { , marginaliaset .tl_gset:N = \g__mymodule_marginalia_set_tl , graphicset .tl_gset:N = \g__mymodule_graphic_set_tl } \cs_new_protected:Npn \__mymodule_marginalia_graphic:nn #1 #2 { \keys_set:nn { mymodule } { #1 } \marginalia[\g__mymodule_marginalia_set_tl] { \includegraphics[\g__mymodule_graphic_set_tl]{#2} } } \NewDocumentCommand \marginaliagraphic { O{} m } { \__mymodule_marginalia_graphic:nn {#1} {#2} } \ExplSyntaxOff \begin{document} \marginaliagraphic[ , marginaliaset = { pos=left, valign=b } , graphicset = { width=.5\linewidth, angle=90 } ]{example-image} \end{document} How could I make something like this work?
- Cannot \renewcommand{\Re} in LuaLaTeX with fontsetupby Alexander Voigt on August 21, 2026 at 2:27 pm
I'm using LuaLaTeX and fontsetup to write a mathematical text about complex numbers. In my text I want to use "Re" and "Im" to denote the real and imaginary parts of a complex number, respectively, instead of the curly single letters R and I of plain-TeX. I use the following to re-define the \Re and \Im macros: \documentclass{standalone} \usepackage{fontsetup} \renewcommand{\Re}{\operatorname{Re}} \renewcommand{\Im}{\operatorname{Im}} \begin{document} $x=\Re(z)$, $y=\Im(z)$ \end{document} However, the curly single letters still appear in the output: . Note 1: When I comment out \usepackage{fontsetup} and use \usepackage{amsmath} and replace \renewcommand by \newcommand, the two-letter forms "Re" and "Im" are used. Note 2: The same issue appears when using the physics package: It re-defines \Re and \Im to \operatorname{Re} and \operatorname{Im} respectively. However, the single letter form still appears when using LuaLaTeX and fontspec. (I noticed this issue, because I'm using the physics package.) My question is: How can I overwrite the \Re and \Im macros to show the two-letter form "Re" and "Im" when using LuaLaTeX and fontspec? (I'd like to avoid creating new macros, because the files I'm writing are part of a larger project, which uses \Re and \Im all over the place and I want to be consistent.)
- Making document with big letter size [duplicate]by Maths Rahul on August 21, 2026 at 5:45 am
In daily typing of mathematical work in latex, I am following the initial matter below: \documentclass[a4paper,12pt]{article} \usepackage[a4paper, total={6in, 8in}]{geometry} \usepackage{amssymb, amsfonts, amssymb, amsthm, amsmath} \begin{document} Hello Hello ..... Hello Hello ..... \end{document} I observed with above selection of document-type and size (6 by 8 inch): The word Hello can be typed 14 times. The line, containing 14 Hello words, can be typed a maximum of 40 times on one page. Question: How can I increase the size of fonts, for words as well as mathematical text throughout the document by simpler commands? Question: How can I put fewer than 14 instances of word Hello in a row? How can I reduce the number of lines to 30 or even less? Why am I doing it? This is because my class is narrow, and has 25 rows, and I can't show text in size of 12pt. I need to double it, to visualize to all audience. (Note: I am avoiding Beamer, since I can't show simpler proofs in one slide.) And, I am distributing the material after the class, which is easily readable with respect to font size.
- Promote the "fake column" and "fake row" feature with `tabularray`?by Explorer on August 20, 2026 at 3:29 pm
This post is the follow-up of my previous answer, preceeding to F.Pantigny's nicematrix new feature "false row" and "false column", here below is the simplified version: % Source - https://tex.stackexchange.com/a/763357 \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \setlength\lTblrDefaultHruleWidthDim{2pt}% \setlength\lTblrDefaultVruleWidthDim{2pt}% \begin{document} \begin{tblr}{ colspec={*{8}{c}}, stretch = 0, colsep = 0pt, rowsep = 0pt, rows = {ht=1cm,font=\Large}, columns = {wd=1cm}, row{2} = {ht=.15cm}, column{2} = {wd=.15cm}, hlines = {3-Z}{solid}, hline{3-Z} = {1}{solid}, vline{3-Z} = {1}{solid}, vlines = {3-Z}{solid}, cells = { mode=math, halign=c }, cell{3}{3} = {magenta} } & & e & r & r^2 & f & fr^2 & fr \\ & & & & & & & \\ e & & e & r & r^2 & f & fr^2 & fr \\ r & & r & r^2 & e & fr^2 & fr & f \\ r^2 & & r^2 & e & r & fr & f & fr^2 \\ f & & f & fr & fr^2 & e & r^2 & r \\ fr^2& & fr^2 & f & fr & r & e & r^2 \\ fr & & fr & fr^2 & f & r^2 & r & e \end{tblr} \end{document} It looks good, but the code was not so elegant since I have commented here: Consider the "e" which was colored magenta, semantically, it would be cell{2}{2}, but in my code, that was cell{3}{3}, which is not so friendly for further modification The "fake row/column" distance was not easy to control. In my code, that is row{2} = {ht=.15cm} and column{2} = {wd=.15cm}, together with colspec={*{8}{c}},stretch = 0,colsep = 0pt,rowsep = 0pt In a word, I found my code was existing rooms to refine, maybe introduce similar "fake row/column" feature. Any suggestion on this?