• Titlesec alignment on section headings versus table of contents heading
    by 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}

  • 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 custom
    by 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}

  • tikz how to stop lines at shape edge when using plotted coordinates
    by 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 number
    by 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 spacing
    by 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 tabularray
    by 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 Modern
    by 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 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

  • Hiding sections, but keep references with KOMA class
    by Archange on August 21, 2026 at 7:39 pm

    I’m trying to do exactly the same as in Hiding sections, but keep references, especially running the MWE from https://tex.stackexchange.com/a/683261/56823 but with the scrartcl KOMA class instead of the standard article one: \documentclass[a4paper]{scrartcl} \usepackage{environ} \NewEnviron{myhideenv}{% \setbox0\vbox{% \let\xxwrite\write \protected\def\write{\immediate\xxwrite}% {\tiny XX\BODY XX}} } \begin{document} The start of the report. \begin{myhideenv} \section{Testsection not printed} \label{testsection} Test not printed \end{myhideenv} Section reference is still correct: \ref{testsection} \section{This is section two} It is still correct when myhideenv is hidden. The end of the report. \end{document} It used to work up until TeX Live 2024, but not anymore (currently running up-to-date TeX Live 2026). Compiling with lualatex (which I use) gives: ! Incomplete \iffalse; all text was ignored after line 19. <inserted text> \fi l.19 \end{myhideenv} And with pdflatex: ! Emergency stop. <inserted text> }\endwrite l.19 \end{myhideenv}

  • How to pass keys values as expl3 token list
    by 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 fontsetup
    by 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.)

  • How to typeset these two `cases` with multiple alignment requirement?
    by Explorer on August 21, 2026 at 2:13 pm

    Here below is what I want: the image above was generated by tabularray: \documentclass{article} \usepackage{showframe} \usepackage{tabularray} \UseTblrLibrary{tikz} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{calligraphy} \usepackage{amsmath} \begin{document} \[ \begin{tblrtikzabove} \draw[decorate,decoration={calligraphic brace,mirror, amplitude=1.5mm},thick] ([yshift=-2pt]h1-|v2) -- ([yshift=+2pt]h3-|v2); \draw[decorate,decoration={calligraphic brace,mirror, amplitude=1.5mm},thick] ([yshift=-2pt]h3-|v2) -- ([yshift=+2pt]h5-|v2); \end{tblrtikzabove} \begin{tblr}{ % hlines, vlines, colspec = {r*{5}{r}}, columns = {rightsep=2pt, leftsep=2pt}, cell{1,3}{1} = {r = 2, c = 1}{m}, } & x & + & 3y & = & 11 \\ & 2x & - & y & = & -9 \\ \text{result\;\;} & x & & & = & x_1 \\ & & & \dfrac{2}{3}y & = & y_1 \end{tblr} \] \end{document} However, I was not sure whether the spacing was "correct" as amsmath's convention. In other word, I wonder whether there exist more "math"-like solution. Here below is my code with IEEEeqnarray, but, I found it hard to handle \{: % https://tex.stackexchange.com/a/147822 % https://tex.stackexchange.com/a/149396 \documentclass{article} \usepackage{showframe} \usepackage{amsmath} \usepackage{ieeetrantools} \begin{document} \begin{IEEEeqnarray*}{urCrCr} & x &+& 3y & = & 11 \\ & 2x &-& y & = & -9 \\ result & x & & & = & x_1 \\ result & & & \dfrac{2}{3}y & = & y_1 \end{IEEEeqnarray*} \end{document} Any suggestions about this?

  • Using poetrytex, how to adjust vertical space between poems and their titles?
    by Yves on August 21, 2026 at 8:28 am

    My question is related to preparing a book of the poems that a friend wrote. I have selected, for various reasons, the package poetrytex. The beginning of a poem is called by \begin{poem}{Title}{Author, or year, or something}. This looks fine when the two arguments are used. However in my case, the second, typically the author, will be empty, since all the poems will be from a single author. The vertical space between the title and the poem is then increased, and does not look nice. Moreover, chances are that a long poem will spill a few lines on the following page, definitely not suitable. How to reduce consistently the space between the title and the first poem line? \documentclass[11pt, a5paper,draft]{book} \usepackage[english]{babel} \usepackage[numberpoems]{poetrytex} \usepackage{showframe} \begin{document} \begin{poem}{A Limerick}{Anonymous} There was an old party of Lyme\\ Who married three wives at one time. \\ When asked: ‘Why the third?’ \\ He replied: ‘One’s absurd, \\ And bigamy, sir, is a crime.’ \end{poem} \begin{poem}{A Limerick}{} There was an old party of Lyme\\ Who married three wives at one time. \\ When asked: ‘Why the third?’ \\ He replied: ‘One’s absurd, \\ And bigamy, sir, is a crime.’ \end{poem} \end{document}

  • 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.

  • How to create a macro to be concatenated?
    by D G on August 21, 2026 at 5:13 am

    The macro \PointLabel is made to simplify creating label on a graph. \fill \PointLabel[above]{-2} \PointLabel[below]{-1} ; Here below is the full code: \documentclass[tikz,border=1cm,12pt]{standalone} \usepackage{amsmath} \usepackage{xintexpr} \newcommand\fx[1]{(#1)^2} \newcommand{\Rational}[1]{% \xintifboolexpr{\xinttheexpr (#1)<0\relax} {-\xintTeXFrac{\xinttheexpr reduce(-( #1 ))\relax}} {\xintTeXFrac{\xinttheexpr reduce(#1)\relax}} } \newcommand{\CoordLabel}[1]{$\left(\Rational{#1},\Rational{\fx{#1}}\right)$} \newcommand{\PointLabel}[2][]{(#2,{\fx{#2}}) circle (2pt) node[#1]{\CoordLabel{#2}}} \begin{document} \begin{tikzpicture}[scale=1.2] \draw[->] (-3.5,0)--(3.5,0) node[right] {$x$}; \draw[->] (0,-1)--(0,10) node[above] {$y$}; \draw[blue,thick,samples=20,domain=-3:3] plot(\x,{\fx{\x}}); \fill (0,{\fx{0}}) circle(2pt) node[below right,red]{\CoordLabel{0}} (1,{\fx{1}}) circle(2pt) node[right]{\CoordLabel{1}} (2,{\fx{2}}) circle(2pt) node[right]{\CoordLabel{2}} (2.5,{\fx{2.5}}) circle(2pt) node[right]{$y=f(x)$} ; % the following causes errors. \fill \PointLabel[above]{-2} \PointLabel[below]{-1} ; \end{tikzpicture} \end{document} However it produces errors: ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.40 \PointLabel [above]{-2} ?

  • glossaries: can the acronym-list be name:Description?
    by Engelbert Buxbaum on August 20, 2026 at 5:07 pm

    The following example: \documentclass{article} \usepackage[colorlinks]{hyperref} \usepackage[acronym,nomain,% only acronym-list nopostdot,% entries not finished with full-stop as not complete sentences nonumberlist,% entries not numbered shortcuts% use same commands as acronym package ]{glossaries} \begin{filecontents}[overwrite]{TestAcro.inc} \newacronym[description={pattern recognition technique}]{svm}{SVM}{support vector machine} \newacronym[description={cases in cluster analysis}]{otu}{OTU}{operational taxonomic unit} \newacronym[description={clustering criterion, average linkage}]{UPGMA}{UPGMA}{unweighted pair group method with arithmetic mean} \end{filecontents} \setacronymstyle{long-short-desc} \setglossarystyle{altlist} \makenoidxglossaries \loadglsentries[acronym]{TestAcro.inc} \begin{document} Put all \acfp{otu} into a \acl{svm}, or use cluster analysis with the \acs{UPGMA}-criterion. \Acsp{otu} will be grouped by similarity. \printnoidxglossary[sort=word,type=acronym] \end{document} leads to output like operational taxonomic unit (OTU) cases in cluster analysis In a list of acronyms, IMHO, the acronym should come first and then the long form, like OTU operational taxonomic unit: cases in cluster analysis The list should also be sorted by acronym. How can I achieve that? Thanks in advance Engelbert

  • prg_set_conditional with "p" style gives error when "T" and "F" do not
    by karlh on August 20, 2026 at 4:10 pm

    I have a working subroutine that uses \prg_set_conditional:Nnn to define a true/false branch. However, I encountered a situation in which I needed to test two things at once, so I tried using the p style conditional with \bool_lazy_and:nnTF, and I got an error. I now realize that even a trivial function returns the same error; here is a minimal working example: \ExplSyntaxOn \prg_set_conditional:Npnn \my_function:n #1 { p, T, F, TF } { \bool_set_false:N \l_tmpb_bool \prg_return_false: } \my_function:nTF { h } { \bool_set_true:N \l_tmpa_bool } { \bool_set_false:N \l_tmpa_bool } \typeout{TEST:~ \bool_to_str:N \l_tmpa_bool} \bool_set:Nn \l_tmpa_bool { \my_function_p:n {h} } %\bool_set:Nn \l_tmpa_bool { \int_compare_p:nNn { 2 } > { 1 } } \typeout{TEST:~ \bool_to_str:N \l_tmpa_bool} \stop If I uncomment the one line and comment out the one above it, it works fine, so I know it's something in my definition (not usage) that is wrong. Why can't I, say, set boolean variables inside a "_p" conditional? Are there other things that are allowed inside "T" and "F" conditionals but not "p" conditionals?

  • 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?

  • How to make emojis transparently available LaTeX? [duplicate]
    by H-J Salchow on August 20, 2026 at 8:46 am

    I like to use emojis transparently in my source. In other words, I like to type something like Hallo 🌍 directly in my LaTeX file and, after compilation, see the same emoji in the resulting PDF. My current solution uses LuaLaTeX together with the '''emotion''' package. The problem is, that every new emoji requires adding two lines to the preamble: an \emotiondef definition, and a corresponding buffer:gsub(...) replacement in a Lua callback. As the number of emojis grows, the preamble becomes longer and longer, which feels rather inelegant. Is there a more elegant way to achieve this? Here is a mwe: \documentclass{article} \usepackage{emotion} \emotiondef{world}{🌍} \directlua{ luatexbase.add_to_callback( "process_input_buffer", function(buffer) buffer = buffer:gsub("🌍", "\\emotion{world}") return buffer end, "apple_emojis" ) } \begin{document} Hello 🌍 \end{document}

  • adjmulticol in one column bidi RTL
    by الطريق طالب العلم on August 20, 2026 at 8:16 am

    I have a problem with the adjmulticol package; when the text is within two columns, \begin{adjmulticols}{2}{-.5cm}{-5.5cm} displays correctly, but when it's within a single column,\begin{adjmulticols}{1}{-.5cm}{-5.5cm} the text doesn't display correctly. This code \documentclass[twoside]{article} \usepackage{geometry} \geometry{ paperwidth=8.49in, paperheight=297mm, % right=.8in, inner=7.5cm,outer=2.5cm, top=72pt, headsep=16pt, textwidth=320pt, marginparsep=20pt, marginparwidth=180pt, textheight=680pt, reversemarginpar } \usepackage{fontspec} \usepackage{polyglossia} % Or the standard 'bidi' package \usepackage{adjmulticol} \usepackage{lipsum} % Set up your primary RTL language (e.g., Arabic, Persian, Hebrew) \setmainlanguage{arabic} \newfontfamily\arabicfont[Script=Arabic]{Amiri} % Replace with your preferred font \begin{document} % Standard text layout here... % 1-Column Layout with adjusted left (inner) and right (outer) margins % Syntax: \begin{adjmulticols}{Number of Columns}{Left Margin Change}{Right Margin Change} \begin{adjmulticols}{2}{-.5cm}{-5.5cm} \section{Two-Column} \textbf{Now I want to use the outer margin because I need width.} \lipsum[1-10] \end{adjmulticols} %----Problem One-Column {1} \begin{adjmulticols}{1}{-.5cm}{-5.5cm} \section{One-Column} \textbf{Now I want to use the outer margin because I need width.} \lipsum[1-10] \end{adjmulticols} \end{document}

  • Why doesn't longtable like \pagebreak in \NewDocumentCommand?
    by Psychonaut on August 20, 2026 at 12:16 am

    I need to conditionally insert page breaks in a manuscript; sometimes these breaks must occur within a longtable environment. It seems that longtable is fine with this if the command containing the \pagebreak was defined with \newcommand, but not with \NewDocumentCommand: \documentclass{article} \usepackage{longtable} \newcommand{\myPageBreakA}{\pagebreak} \NewDocumentCommand{\myPageBreakB}{}{\pagebreak} \begin{document} \begin{longtable}{l} foo \\ \pagebreak % this works bar \\ \myPageBreakA % this works too baz \\ \myPageBreakB % this doesn't work quux \\ \end{longtable} \end{document} Running the above example produces the following error: ! Misplaced \noalign. \pagebreak ->\noalign {\ifnum `}=0\fi \@testopt {\LT@no@pgbk -}4 l.14 \myPageBreakB % this doesn't work Why does this problem occur, and is there some easy way of working around it? Unlike this minimal example, my actual \myPageBreakB command uses some fairly complex argument processing logic, so I would prefer to define it with \NewDocumentCommand instead of \newcommand.

  • Accessible PDFs while altering \maketitle, \section, etc
    by James on August 19, 2026 at 2:28 pm

    I'm trying to make the handouts I make for my classes (more) accessible using the instructions outlined by overleaf. In particular, I'm trying to make the pdf readable by a screen reader. I don't like how much space the article class leaves around the title and sectioning commands, so I've previously redefined those commands to fit my aesthetic preferences. For instance (borrowed from Roger Cortesi's Handout package) I've used the following macro to redefine \section \renewcommand\section{\@startsection {section}{2}{0mm}{0.1\baselineskip}{0.1\baselineskip}{\normalfont\large\textbf}} I'm hoping that the use of \@startsection will mean that the section headings get tagged properly, but I am not sure. Can anyone confirm? I've also redefined \maketitle, but it's much more naive and doesn't use \@maketitle, which I assume is necessary so that the title things get properly tagged? Finally, I like to have headers and footers that contain useful information (handout title, course title, course code etc). Can anyone explain, or point me at a resource, as to how screen readers will interact with headers and footers?

  • Including image omits page style
    by smthint on August 19, 2026 at 4:28 am

    I want to include image on my chapter title page but don't want the page number to appear there. This is my code: \documentclass[12pt]{book} \usepackage{parskip} \usepackage{microtype} \usepackage{geometry} \usepackage{graphicx} \usepackage{hyperref} \usepackage{fancyhdr} \usepackage{etoolbox} \usepackage{titlesec} \usepackage{lipsum} \geometry{ paperwidth=6in, paperheight=9in, margin=0.75in } \fancyhead[L,C,R]{} \renewcommand{\headrulewidth}{0pt} \cfoot{} \fancyfoot[LE, RO]{\thepage} \begin{document} \pagestyle{fancy} \chapter{my chapter} \thispagestyle{empty} \includegraphics[width=\textwidth]{./image.png} \lipsum[1-10] \end{document} But when image is included, the page number is still appearing. When the image is not included, the code works as intented: the page number is not showing on the chapter title page and starts to appear on the next pages. \begin{document} \pagestyle{fancy} \chapter{my chapter} \thispagestyle{empty} \lipsum[1-10] \end{document} How to stop page number appearing on the chapter title page when image is included?

  • babel package breaks the cleveref package : Missing \endscname inserted [duplicate]
    by Drazer on August 18, 2026 at 4:25 pm

    Recently, I was editing a file that used by default english. I wanted to change the default language to french using \usepackage[french]{babel}. Since then, I reduced to a (almost) MWE showing that whenever I cross ref a theoremenv, it breaks. Note that a simple \ref works. It works if I compiled with lualatex, but with pdflatex, it complained that: ! Missing \endcsname inserted. <to be read again> \penalty l.22 \cref{thm:test} ? Here is the code : \documentclass[11pt]{scrbook} \usepackage[T1]{fontenc} \usepackage[french]{babel} %when this is put in comments, cref works fine \usepackage{amsmath} \usepackage{hyperref} \usepackage[nameinlink]{cleveref} \usepackage{tikz} \usepackage[most]{tcolorbox} \newtheorem{theoremenv}{Theorem} \begin{document} This is a test \begin{theoremenv}{} \label{thm:test} This is a theorem. \end{theoremenv} \cref{thm:test} % \ref{thm:test} %This seems to work fine using babel \end{document}

  • Conflict with `luatexja` and `\DocumentMetadata{tagging=on}`?
    by Explorer on August 18, 2026 at 7:52 am

    Here below is the code, if I load luatexja, it complains: \DocumentMetadata{tagging=on} \documentclass{article} \usepackage{luatexja}% \begin{document} Text with \verb!\item! inline. \end{document} ! Package tagpdf Error: there is no open structure on the stack Type <return> to continue. ... l.6 \end{document} ? Is this the tagging side or the luatexja side should be reported to? Or any fix of this?

  • How to create a dynamic fan in TikZ in LaTeX?
    by mathrm alpha on August 18, 2026 at 5:49 am

    Although I've created a basic fan shape in TikZ, how do I make the center blade of the TikZ fan dynamic rotate? the value you enter determines exactly how fast the TikZ fan I created will spin. \documentclass{article} \usepackage{tikz} \usepackage[paperwidth=9cm, paperheight=9cm, margin=1.5cm]{geometry} \begin{document} \pagestyle{empty} \begin{figure}[htbp] \begin{tikzpicture} \filldraw[color=yellow!60, fill=orange!40, very thick](0,0) circle (3); \filldraw[color=yellow!60, fill=red!0, very thick](0,0) circle (2.5); \begin{scope}[rotate=0] \draw [line width=0.3cm] (0,0) -- (2,2); \draw [line width=0.3cm] (0,0) -- (0,3); \draw [line width=0.3cm] (0,0) -- (-2,2); \draw [line width=0.3cm] (0,0) -- (2,-2); \draw [line width=0.3cm] (0,0) -- (3,0); \draw [line width=0.3cm] (0,0) -- (-3,0); \draw [line width=0.3cm] (0,0) -- (0,-3); \draw [line width=0.3cm] (0,0) -- (-2,-2); \filldraw[orange] (0,0) circle (30pt) node[anchor=west]{}; \end{scope} \end{tikzpicture} \end{figure} \end{document}