Hot
- How to duplicate `\vert` and reduce its thickness at larger sizes?by Nyx on August 27, 2026 at 1:13 pm
I regularly use newpx for my LuaLaTeX documents with the font setup being similar to § 5, Example I of the documentation but using Asana Math as the OTF math font: \usepackage{newpxtext} \usepackage{unicode-math} \setmathfont{Asana Math} Unfortunately, I find that Asana Math's \vert is too thick at larger sizes for my taste. The following is version 1 of the MWE (with \otfmathtrue being uncommented) of my current problem: % !TEX program = lualatex \documentclass{article} \usepackage{mathtools} \usepackage{mleftright} % math fonts \newif\ifotfmath \otfmathtrue \ifotfmath \usepackage[ warnings-off={ mathtools-colon, mathtools-overbracket, }, ]{unicode-math} \setmathfont{Asana Math} \else \renewcommand*{\rmdefault}{minzpl} \usepackage[T1]{fontenc} \usepackage{newpxmath} \fi % \abs macro \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % \set macro from https://tex.stackexchange.com/a/763668 \ExplSyntaxOn \newcommand*{\suchthatvert}{\vert} \NewDocumentCommand{\set}{sO{}m} { \group_begin: \seq_set_split:Nnn \l__egreg_set_input_seq {\suchthat} {#3} \int_case:nnF { \seq_count:N \l__egreg_set_input_seq } { {1} { \__egreg_set_bylist:nnn {#1} {#2} {#3} } {2} { \__egreg_set_byproperty:nnee {#1} {#2} { \seq_item:Nn \l__egreg_set_input_seq {1} } { \seq_item:Nn \l__egreg_set_input_seq {2} } } }{OOPS!} \group_end: } \seq_new:N \l__egreg_set_input_seq \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_byproperty:nnnn { \bool_if:nTF {#1} {% auto sizing \left\lbrace #3 \nonscript\;\middle\suchthatvert\nonscript\; #4 \right\rbrace } { \mathopen{#2\lbrace} #3 \mathrel{#2|} #4 \mathclose{#2\rbrace} } } \cs_generate_variant:Nn \__egreg_set_byproperty:nnnn {nnee} \cs_new_protected:Nn \__egreg_set_bylist:nnn { \bool_if:nTF {#1} { \left\lbrace } { \mathopen{#2\lbrace} } \group_begin: \clist_use:nn {#3} {,\penalty0~\hspace{0pt plus 3pt}} \group_end: \bool_if:nTF {#1} { \right\rbrace } { \mathclose{#2\rbrace} } } \ExplSyntaxOff \begin{document} \(\abs{x}\) \(\abs{A}\) \(\abs{M}\) \(\abs{S}\) \(\set[\big]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set[\Big]{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\bigg]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set*{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\Bigg]{x \suchthat \dfrac{1}{2} < x <3}\) \end{document} The following is version 2 of the MWE (with \otfmathtrue being commented) of my current problem: % !TEX program = lualatex \documentclass{article} \usepackage{mathtools} \usepackage{mleftright} % math fonts \newif\ifotfmath % \otfmathtrue \ifotfmath \usepackage[ warnings-off={ mathtools-colon, mathtools-overbracket, }, ]{unicode-math} \setmathfont{Asana Math} \else \renewcommand*{\rmdefault}{minzpl} \usepackage[T1]{fontenc} \usepackage{newpxmath} \fi % \abs macro \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % \set macro from https://tex.stackexchange.com/a/763668 \ExplSyntaxOn \newcommand*{\suchthatvert}{\vert} \NewDocumentCommand{\set}{sO{}m} { \group_begin: \seq_set_split:Nnn \l__egreg_set_input_seq {\suchthat} {#3} \int_case:nnF { \seq_count:N \l__egreg_set_input_seq } { {1} { \__egreg_set_bylist:nnn {#1} {#2} {#3} } {2} { \__egreg_set_byproperty:nnee {#1} {#2} { \seq_item:Nn \l__egreg_set_input_seq {1} } { \seq_item:Nn \l__egreg_set_input_seq {2} } } }{OOPS!} \group_end: } \seq_new:N \l__egreg_set_input_seq \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_byproperty:nnnn { \bool_if:nTF {#1} {% auto sizing \left\lbrace #3 \nonscript\;\middle\suchthatvert\nonscript\; #4 \right\rbrace } { \mathopen{#2\lbrace} #3 \mathrel{#2|} #4 \mathclose{#2\rbrace} } } \cs_generate_variant:Nn \__egreg_set_byproperty:nnnn {nnee} \cs_new_protected:Nn \__egreg_set_bylist:nnn { \bool_if:nTF {#1} { \left\lbrace } { \mathopen{#2\lbrace} } \group_begin: \clist_use:nn {#3} {,\penalty0~\hspace{0pt plus 3pt}} \group_end: \bool_if:nTF {#1} { \right\rbrace } { \mathclose{#2\rbrace} } } \ExplSyntaxOff \begin{document} \(\abs{x}\) \(\abs{A}\) \(\abs{M}\) \(\abs{S}\) \(\set[\big]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set[\Big]{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\bigg]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set*{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\Bigg]{x \suchthat \dfrac{1}{2} < x <3}\) \end{document} I generally try to only use OpenType math fonts and use unicode-math's \setmathfont{...}[range={...}] or \setmathfont{...}[version=...] commands for additional glyphs or secondary fonts. In this particular case, I would like to duplicate the \vert macro into \suchthatvert and have the latter use the extensible delimiter from newpxmath (if that is possible) in order to have a \suchthatvert with reduced thickness at larger sizes without affecting other instances of \vert. Using \setmathfont{secondary-font.otf}[range={\vert}] with another OpenType math font would not work as it would affect \verts globally and using \setmathfont{secondary-font.otf}[version=secondary-font] would also not work as I believe it is not possible to do the following because of how \mathversion works: \newcommand*{\suchthatvert}{\mathversion{secondary-font}\vert\mathversion{default}}
- tikz pgfplot fill area between multiple graphs or pathsby paul_schaefer on August 27, 2026 at 12:22 pm
MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[scale=1] \begin{axis}[ axis equal, % axis line style=thick, axis x line=center, ylabel={$y$}, xlabel={$x$}, major tick style = {black}, axis y line=middle, every axis y label/.style={ at={(current axis.above origin)}, inner sep=3, anchor=north east, }, every axis x label/.style={ at={(current axis.right of origin)}, inner sep=3, anchor=north east, }, xtick={-1,1}, xticklabels={$-\frac{w}{2}$,$\frac{w}{2}$}, ytick={1}, yticklabels={$h$}, yticklabel style={anchor=south west}, xmin=-1.75, xmax=3.25, ymin=-0.1, ymax=1.5, height=4cm, samples=100] \addplot[domain=-1:1,thick, name path=A] {1 - x * x}; \addplot[domain=0.5:2.5,thick, name path=B] {1 - (x-1.5) * (x-1.5)}; \draw[name path=C, thin] (1/3,8/9) -- (1.5,1); \path [name path=D] (\pgfkeysvalueof{/pgfplots/xmin},0) -- (\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[black!15] fill between[of=C and A, soft clip={domain=0:0.75}]; \addplot[black!15] fill between[of=C and B, soft clip={domain=0.75:1.5}]; \addplot[black!40] fill between[of=B and D, soft clip={domain=0.5:0.75}]; \addplot[black!40] fill between[of=A and D, soft clip={domain=0.75:1}]; \end{axis} \end{tikzpicture} \end{document} results in a graph, where the areas between the both graphs are filled in gray. In this example I splitted the areas into four sections and colored them. Is there a possibility to fill the areas without splitting them into sections? A second problem is, that the separation of each area into two parts will sometimes result in in slight white vertical line between the colored areas. In my case it depends on the scaling of the pdf viewer I use. If there area could be described without separation this should not happen.
- Unicode/Collate/Locale/zh_pin.pl can't be found after updating mactexby M. Logic on August 27, 2026 at 7:33 am
An error occurs after updating mactex recently when I compile biber 2.22: Unicode/Collate/Locale/zh_pin.pl can't be found at /var/folders/8y/zkd60m1s7jz_73wr7hjjnq5r0000gn/T/par-436f6e64656e/cache-364a02962a45a52cab8961a336f60ec963624107/inc/lib/Biber.pm line 4304.
- How do I create a combining character similar to \vec{} but with up and down arrows?by mathrm alpha on August 27, 2026 at 1:20 am
Although I can see the reverse \vec, unicode-math cannot directly produce the native unicode combining characters with the codes ‘COMBINING UP ARROW ABOVE’ and ‘COMBINING DOWN ARROW ABOVE’. How can I create these? https://tex.stackexchange.com/a/245346/286078
- How to draw 3D animation of reflection of a triangle about the bisector?by Learner on August 26, 2026 at 6:50 pm
I want to plot a 3D animation of an equilateral triangle about one bisector. I have plotted the steps by using tikz: \documentclass[a4paper,11pt]{article} \usepackage{tikz} \usepackage[margin=1.2cm]{geometry} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] % First triangle: \begin{scope}[shift={(0,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Median = axis of reflection \draw[dashed,very thick] (0,0) -- (0,2); % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below right] at (C) {$C$}; % Element \node at (0,-0.7) {I}; \end{scope} %Arrow from first triangle to second triangle \draw[->,thick] (2.2,1) -- (5.8,1); \node at (4,1.2) {s}; \node at (4,0.5) {$(\text{reflection})$}; %second triangle \begin{scope}[shift={(8,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Reflect in the vertical median \begin{scope}[xscale=-1] % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above left] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below] at (C) {$C$}; \end{scope} % Reflection axis \draw[dashed,very thick] (0,0) -- (0,2); \node at (0,-1) {II}; \end{scope} \end{tikzpicture} \end{document} which gives the following two triangles: I want to plot a 3D animation to display the reflection about the bisector.I would appreciate to do that. The vertices B and C will be changing every time but A will remain fixed. Note that the first triangle and the last triangle are same.
- PDFs not displayed in a document with background imageby Rodrigo Tavares on August 26, 2026 at 5:14 pm
I used a background image on the main part of the document, which is an RPG book, with the command \AddToHook, here my preamble: \documentclass[a5paper,oneside]{book} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,latexsym} \usepackage{graphicx} \usepackage{amsthm} \usepackage{marvosym} \usepackage{lipsum} \usepackage{wrapfig} \usepackage{makeidx} \usepackage{siunitx} \usepackage{caption} \usepackage{pdfpages} \usepackage{lipsum} \makeindex \AddToHook{shipout/background} { \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{fundo.pdf}} } \usepackage{lipsum} \usepackage[Lenny]{fncychap} \begin{document} \chapter{one} \lipsum \chapter{Two] \lipsum \newpage \includepdf{ficha3dnd.pdf} \newpage \includepdf{fichastoryweller.pdf} \newpage \printindex \end{document} But in the end of the document I wanted to show the images of the character sheets. I used the package pdfpages and used the command \includepdf to display the two character sheets in a entire page each. But when I compile the images are not displayed, instead the background appear without any image in it. How can I solve it? There's a way to deactivate the background in these two pages?
- tikz datavisualization place axis labels next to axis tipsby paul_schaefer on August 26, 2026 at 12:44 pm
MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \begin{document} \begin{tikzpicture}[baseline=(current bounding box.center), >=Stealth]% \datavisualization[% school book axes,% visualize as smooth line,% x axis={% label={$x$},% include value={-1.25, 1.25},% ticks={% major at={% -1 as $-\frac{w}{2}$,% 1 as $\frac{w}{2}$% },% },% },% y axis={% label={$y$},% include value=1.5,% ticks={% major at={% 1 as $h$% },% node style={anchor=south west},% },% },% ]% data [format=function] {% var x : interval [-1.0:1.0];% func y = 1 - (\value x * \value x);% };% \end{tikzpicture} \end{document} provides the following graph: What do I have to change to place the axis description next to the arrow tips (shown in red)? Adding visualize label={x axis={goto pos=.5}}, to the x axis definition leads to a second label. Trying to change the node style using visualize label={node style={anchor=north}}, doesn't has any effect. How can I change/access the label inside the axis definition?
- Why \pgfkeysifdefined gives a confused result when working with \pgfkeysby lyl on August 26, 2026 at 6:50 am
\documentclass{article} \usepackage{tikz} \begin{document} \pgfkeys{/vv/.initial} \pgfkeysifdefined{/vv}{yes}{no} \end{document} Since the key vv is not given any value, why is the output "yes", not "no"?
- Why does \pgfkeysvalueof give different results between nearly same codesby lyl on August 26, 2026 at 4:34 am
\documentclass{article} \usepackage{tikz} \begin{document} \pgfkeys{my family/my key/.initial=hello} \pgfkeysvalueof{my family/my key} % Running the above two lines of code gets nothing \pgfkeys{/my family/my key/.initial=hello} \pgfkeysvalueof{/my family/my key} % Running the above two lines of code gets right output as expected. % What causes such different results between the two block of codes? \end{document}
- How to draw chemistry flowchartsby Alcino Junior on August 26, 2026 at 2:06 am
I want to know if there are some package to draw flow charts for guiding chemistry lab experiments.
- Typeset a reference based on `zc@cntval`, not the \label / `\the` value?by Thibault de Villèle on August 25, 2026 at 8:35 pm
Note: this was posted into a Github issue on zref-clever's repository, but I figured it might also be a good idea to ask about it here. Note: all code blocks here, concatenated, form a MWE. This is only broken up to ease reading. I currently have a setup to make \labels to parts of a TikZ image using a custom counter named tikzcaption, relative to the figure counter (since none of those tikzpictures will be in a subfigure environment). I want a couple things to happen when I reference those labels: if I'm in the figure environment where this tikzpicture is shown, references should be typeset as figure ("tikzcaption" in \alph, typewriter text) ; if I'm not in that figure environment, references should be typeset as figure (regular figure numbering).("tikzcaption" in \alph, typewriter text). Here's the basic setup of the counter and the reference type: \documentclass{scrbook} \KOMAoption{parskip}{half-}% % Hyperref only included to get hyperlinks working. \usepackage{tikz, zref-clever, hyperref} \makeatletter% % Create the counter for parts of a TikZ image: \newcounter{tikzcaption} \counterwithin{tikzcaption}{figure} \renewcommand*{\thetikzcaption}{\thefigure.\texttt{\arabic{tikzcaption}}} % Typeset the parts of TikZ images as the figure ones for the main document: \zcRefTypeSetup{tikzcaption}{ name-sg = {figure}, name-pl = {figures}, Name-sg = {Figure}, Name-pl = {Figures}, } % Link tikzcaption <-> figure, as zref-clever doesn't seem to detect it: \zcsetup{counterresetby = { tikzcaption = figure }}% How I (think I should) achieve the behaviour I want is by having a custom figure-like environment where I can freely change commands. Here's a rough outline of how that works: \newif\ifinreftikzpicture% Used for a couple things relative to \caption... % #1: floating env parameters \NewDocumentEnvironment{reftikzpicture}{O{htp}} { \figure[#1]% Manually start the "figure" environment. \inreftikzpicturetrue% Signal we're in the reftikzpicture env. \setcounter{tikzcaption}{0}% % Override \thetikzcaption: \let\@outside@the@tikzcaption=\thetikzcaption% \renewcommand*{\thetikzcaption}{\texttt{\alph{tikzcaption}}}% % Make the reference "names" nil within the reftikzpicture env: \zcRefTypeSetup{tikzcaption}{% name-sg = {}, name-pl = {},% Name-sg = {}, Name-pl = {},% % Ideally, should not be needed since % \thetikzcaption switches to \ttfamily reffont={\ttfamily},% }% } { % Reset the original formatting of \thetikzcaption: \renewcommand*{\thetikzcaption}{\@outside@the@tikzcaption}% \inreftikzpicturefalse% \endfigure% End the figure environment manually. } % Create the \label inside a tikzpicture: % #1: Don't print the label on the tikzpicture. % #2: Node options for the label on that picture. % #3: What node is it a legend of? (can be a string) % #4: Position of the label inside the picture. % #5: The label name for \ref and friends. \NewDocumentCommand{\labeltikzat}{s O{} m m m}{ \refstepcounter{tikzcaption}% % Manually set the current counter value, and its name: \gdef\@currentcounter{tikzcaption}% \gdef\@currentlabel{\thetikzcaption}% \label{#5}% Label is #5 \IfBooleanF{#1}{% \begin{scope}[shift={#4}]% % Print the current label value in a node somewhere (#4) on the tikzpicture: \node[#2] (legend #3) at (0, 0) {\texttt{\alph{tikzcaption}}};% \end{scope}% }% } \makeatother% While this works (it sets a label and makes it referencable by zref-clever), it seems I cannot customize the typesetting of the label \zcref{} call beyond redefining the \the<counter> command. Furthermore, from the documentation it looks like the text to typeset is defined whenever the \label command is issued, and cannot be customized any further. See the document contents here: \begin{document} \begin{reftikzpicture}[ht] \centering% \begin{tikzpicture}[inner sep=0pt, outer sep=5pt]% \coordinate (circ) at (0,0);% \draw[thick, black] (circ) circle [radius=3cm];% \labeltikzat{circ}{(circ.center)}{fig/circ}% \end{tikzpicture} \caption{\zcref[S]{fig} is a \texttt{reftikzpicture}, with a single label named \zcref{fig/circ}.}% \label{fig} \end{reftikzpicture} Here are the expected and real values of the typeset references using \texttt{\string\zcref} for the different labels in the main document text: \begin{center} \begin{tabular}{p{4cm}|p{4cm}|p{4cm}} Label & Expected & Actual \\ \hline \hline \texttt{fig} & figure 1 & \zcref{fig} \\ \texttt{fig/circ} & figure 1.\texttt{a} & \zcref{fig/circ} \end{tabular} \end{center} \end{document} Gives the following document: However, I see the \zref@newlabel command records a \zc@cntval property which stores the current (local-only) value of the counter. Can I somehow use that value to print references (with hyperlinks and ranges+pairs formatting) within the reftikzpicture environment ? Using that counter to format the reference inside the reftikzpicture environment would allow for the references in the caption to be printed as they are now, but the references in the main document body would be printed as the expected values in the table. Full code: \documentclass{scrbook} \KOMAoption{parskip}{half-}% % Hyperref only included to get hyperlinks working. \usepackage{tikz, zref-clever, hyperref} \makeatletter% % Create the counter for parts of a TikZ image: \newcounter{tikzcaption} \counterwithin{tikzcaption}{figure} \renewcommand*{\thetikzcaption}{\thefigure.\texttt{\arabic{tikzcaption}}} % Typeset the parts of TikZ images as the figure ones for the main document: \zcRefTypeSetup{tikzcaption}{ name-sg = {figure}, name-pl = {figures}, Name-sg = {Figure}, Name-pl = {Figures}, } % Link tikzcaption <-> figure, as zref-clever doesn't seem to detect it: \zcsetup{counterresetby = { tikzcaption = figure }}% \newif\ifinreftikzpicture% Used for a couple things relative to \caption... % #1: floating env parameters \NewDocumentEnvironment{reftikzpicture}{O{htp}} { \figure[#1]% Manually start the "figure" environment. \inreftikzpicturetrue% Signal we're in the reftikzpicture env. \setcounter{tikzcaption}{0}% % Override \thetikzcaption: \let\@outside@the@tikzcaption=\thetikzcaption% \renewcommand*{\thetikzcaption}{\texttt{\alph{tikzcaption}}}% % Make the reference "names" nil within the reftikzpicture env: \zcRefTypeSetup{tikzcaption}{% name-sg = {}, name-pl = {},% Name-sg = {}, Name-pl = {},% % Ideally, should not be needed since % \thetikzcaption switches to \ttfamily reffont={\ttfamily},% }% } { % Reset the original formatting of \thetikzcaption: \renewcommand*{\thetikzcaption}{\@outside@the@tikzcaption}% \inreftikzpicturefalse% \endfigure% End the figure environment manually. } % Create the \label inside a tikzpicture: % #1: Don't print the label on the tikzpicture. % #2: Node options for the label on that picture. % #3: What node is it a legend of? (can be a string) % #4: Position of the label inside the picture. % #5: The label name for \ref and friends. \NewDocumentCommand{\labeltikzat}{s O{} m m m}{ \refstepcounter{tikzcaption}% % Manually set the current counter value, and its name: \gdef\@currentcounter{tikzcaption}% \gdef\@currentlabel{\thetikzcaption}% \label{#5}% Label is #5 \IfBooleanF{#1}{% \begin{scope}[shift={#4}]% % Print the current label value in a node somewhere (#4) on the tikzpicture: \node[#2] (legend #3) at (0, 0) {\texttt{\alph{tikzcaption}}};% \end{scope}% }% } \makeatother% \begin{document} \begin{reftikzpicture}[ht] \centering% \begin{tikzpicture}[inner sep=0pt, outer sep=5pt]% \coordinate (circ) at (0,0);% \draw[thick, black] (circ) circle [radius=3cm];% \labeltikzat{circ}{(circ.center)}{fig/circ}% \end{tikzpicture} \caption{\zcref[S]{fig} is a \texttt{reftikzpicture}, with a single label named \zcref{fig/circ}.}% \label{fig} \end{reftikzpicture} Here are the expected and real values of the typeset references using \texttt{\string\zcref} for the different labels in the main document text: \begin{center} \begin{tabular}{p{4cm}|p{4cm}|p{4cm}} Label & Expected & Actual \\ \hline \hline \texttt{fig} & figure 1 & \zcref{fig} \\ \texttt{fig/circ} & figure 1.\texttt{a} & \zcref{fig/circ} \end{tabular} \end{center} \end{document}
- 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} EDIT POST ANSWERS FROM kabenyuk and David Carlisle Following testing of both answers, both answers worked as I'm sure you tried yourselves before posting. I compiled the answers and both worked. I then compiled my original faulty behaviour MWE without making any changes and it worked fine. I deleted all .aux etc files and recompiled my original file and all fine. Headscratching. I have selected the first answer by kabenyuk to mark a solution but both work.
- 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 version [closed]by 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} It seems that the texlive-full package in the alpine 3.23 Version is broken, at least for the tabularray. Switching to 3.24 solves the problem.
- 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!
- 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
- 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?
- 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.
- 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 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
- 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.)
- 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?