• How to control backgrounds for named pages and ODD and EVEN un-named pages in book class
    by keith77777 on September 23, 2026 at 3:56 pm

    There must be something wrong with the following code as it gives no errors but the wrong results. Changing the \getpagerefnumber to \getabspagerefnumber causes a huge number of errors. Please can you correct the syntax. I have deliberately included quite a few named pages in an attempt to trace what is going on. \documentclass{book} \usepackage[a6paper]{geometry} % to get smaller pictures \usepackage{graphicx} \usepackage{xparse} \usepackage{zref-abspage} % Required for \getabspagerefnumber \usepackage{lastpage} \usepackage{refcount} \usepackage{parskip} \ExplSyntaxOn \NewDocumentCommand{\choosebackgrounds}{mmmmmmmmm}% 9 [m]s { \bool_case:n {% {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_one}}} {\putbackground{#1} 111}% named {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_two}}} {\putbackground{#2} 222}% named {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_three}}} {\putbackground{#3}}% named % {\int_compare_p:n {\value{page}=\getpagerefnumber{title_page_one}}} {\putbackground{#5}}% title {\int_compare_p:n {\value{page}=\getpagerefnumber{title_page_two}}} {\putbackground{#6}}% title % {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_four}}} {\putbackground{#4}}% named % {\int_compare_p:n {\value{page}=\getpagerefnumber{LastPage}}} {\putbackground{#7}}% named % {\int_if_odd_p:n {\value{page}}} {\putbackground{#8}}% others {\int_if_even_p:n {\value{page}}} {\putbackground{#9}}% others } } \ExplSyntaxOff \NewDocumentCommand{\putbackground}{m}{\put(30mm,-90mm){#1}} \AddToHook{shipout/background}{% % \choosebackgrounds% on basis that first condition that is satisfied wins {\Huge named page one}% 1 {\Huge named page two}% 2 {\Huge named page three}% 3 {\Huge named page four}% 4 {\Huge title page one}% 5 {\Huge title page two}% 6 {\Huge LAST PAGE}% 7 {\Huge un-named ODD}% 8 {\Huge un-named EVEN}% 9 } \begin{document} \pagenumbering{arabic}% 1, 2, ... \setcounter{page}{1} \label{page:named_page_one}% Front cover: named page one Generated page No. \thepage % % --------------------------------------------------------------------- % \clearpage \label{page:named_page_two}% Inside front cover: named page two Generated page No. \thepage % ------------------------- Facing inside front cover ------------------ % \clearpage \label{page:named_page_three}% Facing inside front cover: named page three Generated page No. \thepage % ------------------------- Facing inside front cover ------------------ % \clearpage No label reference Just before title - a LEFT-HAND or EVEN page Generated page No. \thepage % ------------------------------ First title page --------------------------------- % {\centering \begin{titlepage}% first page of title- becomes revised page No 1 \begin{center} \label{page:title_page_one}% Title page: ONE Generated page No. \thepage Absolute page No: 4 % ------------------------------------ Second title page --------------------------- % \clearpage \label{page:title_page_two} Title page: TWO Generated page No. \thepage Absolute page No: 5 \end{center} \end{titlepage} } % --------------------------------------- Contents ---------------------------------- % \clearpage \label{page:named_page_four} The start of contents Generated page No. \thepage Absolute page No: 6 % ------------------------------------------------------------------------------------- % \clearpage Preface to this volume Generated page No. \thepage Absolute page No: 7 % ------------------------------------------------------------------------------------- % \mainmatter Some introductory content after mainmatter Generated page No. \thepage Absolute page No: 8 \vspace{6pt} First page of book proper. % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Penultimate page Generated page No. \thepage % --------------------------------------------------------------------------------------- % \clearpage This is the rear cover% no background required but made visible here \label{page:LastPage} Generated page No. \thepage Absolute page No: 13 ? \end{document}

  • Looking for a specific LaTex font
    by Rup_LA on September 23, 2026 at 3:40 pm

    I am looking for a specific LaTex font which I loved very much (especially for the lambda it produces) I have already asked a question for the lambda but my preamble was restricted by my institution. But now I just want to use that lambda for my own documents. I'm attaching my previous questions and efforts here: Using lambda in different font than that of the document I want this document to recreate specifically. If anyone knows the font then please do let me know.

  • latex2sympy parses correctly all variables except d and E
    by program programson on September 23, 2026 at 2:42 pm

    So I was playing around with latex2sympy2 - a Python library to convert LaTeX to SymPy objects. I tried to run this code: from latex2sympy2 import latex2sympy latex_code = r"\begin{bmatrix} a & b \\ c & d \end{bmatrix}" print(latex2sympy(latex_code)) and ran into this: Exception: I expected something else here \begin{bmatrix} a & b \\ c & d \end{bmatrix} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ It took me a while to figure out that the problem was d. I checked every letter instead of d and it worked correctly, run this so that you can see that yourself: from latex2sympy2 import latex2sympy for i in range(65, 91): if i == 69: continue # every letter except E print(chr(i), latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & %s \end{bmatrix}" % chr(i))) for i in range(97, 123): if i == 100: continue # every letter except d print(chr(i), latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & %s \end{bmatrix}" % chr(i))) # d try: print(latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & d \end{bmatrix}")) except Exception as e: print(f"{type(e).__name__}: {str(e)}") # E try: print(latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & E \end{bmatrix}")) except Exception as e: print(f"{type(e).__name__}: {str(e)}") I'm not good at LaTeX, though, please don't blame me. How do I fix that? I have no clues.

  • How can I position one node chain relative to another?
    by EnronEvolved on September 23, 2026 at 12:17 pm

    I'm trying to arrange a collection of nodes using \graph, which will be used to define a series of spath3 knot strands. However, the default cartesian placement strategy doesn't work very well for my purposes, as nodes chains that I intend to "tee off" from other nodes. It's possible to get what I want with the following code, but it's obviously rather fragile: \documentclass{article} \usepackage{etoolbox} \usepackage{tikz} \usetikzlibrary{calc, knots, positioning, graphs, graphdrawing} \usetikzlibrary{spath3} \begin{document} \begin{tikzpicture} \graph[nodes={draw, as={}}]{ a -> b -> c, {[placement/width=1, placement/depth=1, grow down] b -> d -> f -> g}, {[placement/width=2, placement/depth=2, grow right] f -> p}, }; \end{tikzpicture} \end{document} How can I achieve the same effect by specifying the node rather than the width and depth?

  • Modern Scientific illustrations: what can we "show off" now that wasn't possible 12 years ago?
    by DJP on September 23, 2026 at 1:05 am

    There is a highly popular post from 2014 showcasing Nice scientific pictures show off but a lot has changed with LaTeX over the last 12 years. What is your best science picture to show off now that wasn't possible 12 years ago? Constraints for each answer: The Picture & Code: Show off a beautiful scientific illustration that utilizes features, packages, or engine capabilities (e.g., LuaLaTeX memory handling, modern pgfplots limits, Luametafun) that remove barriers which routinely stopped typical users from doing this 12 years ago (such as hard memory crashes, lack of default ecosystem support, or prohibitive manual workarounds). The Evolution: You must explicitly explain what technological progress or package developmentover the last decade made this picture possible today. AI usage is allowed, but must be acknowledged per community guidelines.

  • In bidi text using babel with LuaLaTeX, how do I control punctuation placement?
    by David Graff on September 22, 2026 at 10:39 pm

    In the following minimal example, I placed each Arabic word on a separate line to make it clear that first the exclamation mark follows the fifth (final) Arabic word. Using "bidi=basic", the 5 Arabic words appear in the desired order (RTL), but that 1st excl.mark appears between the first Arabic word and the English word "There's", whereas it ought to appear between the word "Example:" and the fifth Arabic word (i.e. the excl.mark should be included within the RTL context of the Arabic phrase). \documentclass{article} \usepackage[english,bidi=basic]{babel} \babelprovide[onchar=ids fonts]{arabic} \babelfont{rm}{FreeSerif} \begin{document} \pagestyle{empty} \paragraph{Example:} يا ناس ما كان باس ! There's nothing wrong! \end{document} The placement is the same when I put the entire Arabic phrase on one line, with the excl.mark immediately after the last Arabic letter. I understand why this is happening. Is there a way to force that excl.mark to be included within the RTL scope of the Arabic phrase? (Edited to add: With all the Arabic on one line, most (all?) bidi-capable displays make the same mistake: the "default" LTR context causes the excl.mark to appear to the right of the Arabic phrase; usually this can be fixed by putting the Unicode RLE character U+202b in front of the first Arabic letter, and "Pop Directional Formatting" U+202c after the excl. mark. Doing that in the .tex file has no effect.)

  • Is there any way to add a little space after a diacritic symbol used for IPA transliteration?
    by Cedric on September 22, 2026 at 3:53 pm

    Using LuaLaTeX for a text in English that includes Cantonese characters and their IPA transliteration, all works fine, except that one diacritic symbol used for some final consonants (P, T, K) merge with the following tone symbol. The result is unreadable. Here is the MWE: \usepackage[english]{babel} \usepackage{fontspec} \babelfont{rm}{TeX Gyre Pagella} \babelprovide[import=yue]{cantonese} \babelfont[cantonese]{rm}[Renderer=Harfbuzz]{Noto Sans HK} \babelfont[tipa]{rm}[Renderer=Harfbuzz]{FreeSans} \usepackage[dvipsnames]{xcolor} \DeclareRobustCommand\gdg[1]{\textcolor{CadetBlue}{\foreignlanguage{cantonese}{#1}}} \DeclareRobustCommand\gdgp[1]{\textcolor{MidnightBlue}{\foreignlanguage{tipa}{[\,{\footnotesize #1}\,]}}} \begin{document} This transliteration without the issue: \gdg{廣州} \gdgp{kʷɔːŋ² tsɐu¹} Here is one example of the problematic case: \gdg{百越} \gdgp{paːk̚³ jyːt̚⁶} \end{document} After compilation, the unreleased stop diacritic, also known as "combining left angle above", UNICODE U+031A, directly merges into the following tone number in superscript. Hence my question: is there a possibility to include a space that would apply only after this diacritic stop symbol and not before any tone number? Thank you in advance for any help or suggestion

  • Correctly closing tagging structure for custom sections in ltx-talk
    by David Purton on September 22, 2026 at 2:01 pm

    I want to add some tagged section headings within frames with ltx-talk. It seems like using the exisiting section templates would be a neat way of doing this. But I am having trouble getting the section tagging structure to close correctly at the end of the frame. I can't find a way to inject sockets to close things without redefining internal ltx-talk macros. And so far, I haven't closed things correctly in all situations even if I do redefine. This seems to work in most cases I try, but seems risky: \cs_set_protected:Npn \__talk_frame_process:nn #1#2 { \__talk_decode_parse:n {#1} \bool_if:NT \l__talk_decode_mode_bool { \__talk_frame_process_aux:nn {#1} { #2 \par \UseTaggingSocket{sec/end}{6} \UseTaggingSocket{sec/end}{5} } } } What is a good way of doing this? MWE %! TeX Program = lualatex \DocumentMetadata{ , lang = en , pdfstandard = ua-2 , tagging = on } \documentclass{ltx-talk} \tagpdfsetup { , role/new-tag = frame-heading/H5 , role/new-tag = frame-subheading/H6 } \AssignStructureRole{sec/5/title}{frame-heading} \NewStructureName{sec/6} \AssignStructureRole{sec/6}{Sect} \NewStructureName{sec/6/title} \AssignStructureRole{sec/6/title}{frame-subheading} \NewStructureName{sec/6/number} \AssignStructureRole{sec/6/number}{section-number} \DeclareInstance{heading}{frame-heading}{display} { , name = frame-heading , level = 5 , before-vspace = \medskipamount , after-vspace = \smallskipamount , heading-decls = \Large\bfseries , headformat-instance = frame-heading } \DeclareInstance{heading}{frame-subheading}{display} { , name = frame-subheading , level = 6 , before-vspace = \medskipamount , after-vspace = \smallskipamount , heading-decls = \large\bfseries , headformat-instance = frame-subheading } \DeclareInstanceCopy{headformat}{frame-heading}{std} \DeclareInstanceCopy{headformat}{frame-subheading}{std} \ExplSyntaxOn \NewDocumentCommand \frameheading { D <> { all } m } { \__talk_if_overlay:nT {#1} { \ParseLaTeXeHeading{frame-heading}{\BooleanTrue}{}{#2} } } \NewDocumentCommand \framesubheading { D <> { all } m } { \__talk_if_overlay:nT {#1} { \ParseLaTeXeHeading{frame-subheading}{\BooleanTrue}{}{#2} } } \ExplSyntaxOff \begin{document} \begin{frame} Filler text. \frameheading{A Heading} Filler text. \framesubheading{A Subheading} Filler text. \end{frame} \begin{frame} \frametitle{A Frame Title} Filler text. \frameheading{A Frame Heading} Filler text. \framesubheading{A Frame Subheading} Filler text. \end{frame} \section{A Section Heading} \begin{frame} \frametitle{A Frame Title} Filler text. \frameheading{A Frame Heading} Filler text. \framesubheading{A Frame Subheading} Filler text. \end{frame} \end{document}

  • Has texi2dvi (and texi2pdf) been removed from MacTeX-2026 [closed]
    by gernophil on September 22, 2026 at 11:30 am

    I just upgraded my MacTeX-2025 to MacTeX-2026 and now the texi2dvi command is not available anymore. I am pretty sure, I could use it before, but it seems to be completely gone. I also don’t find it in '/usr/local/texlive' and '/Library/TeX/texbin'. Has this been removed on purpose or is my install bad for some reason?

  • xr-hyper missing hyperref link
    by Matteo on September 22, 2026 at 11:12 am

    I have two documents where in one of them – the main – I reference items from the other – supplement – and tought to keep links active and visible as such in the main. I'm working with the package xr-hyper, loaded before hyperref, and cleveref, loaded as the last one. See below for a concrete example: MWE main.tex \documentclass{article} \usepackage{graphicx} \usepackage[margin=1in]{geometry} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{lmodern} \usepackage{comment} \usepackage{float} \usepackage{subcaption} \usepackage[labelfont=bf,font=small,skip=0pt]{caption} \usepackage{siunitx} \usepackage[super]{nth} \usepackage{amsmath,amsthm} \usepackage[normalem]{ulem} \usepackage[inline]{enumitem} \usepackage{xr-hyper} \usepackage{titlesec} \usepackage{scalerel} \usepackage{csquotes} \usepackage{setspace} \usepackage{graphicx} \usepackage{booktabs} \usepackage{orcidlink} \usepackage{xcolor, hyperref} \hypersetup{ colorlinks, citecolor=electricultramarine, linkcolor=mediumtealblue, urlcolor=smokyblack } \definecolor{smokyblack}{rgb}{0.06, 0.05, 0.03} \definecolor{mediumtealblue}{rgb}{0.0, 0.33, 0.71} \definecolor{electricultramarine}{rgb}{0.25, 0.0, 1.0} \usepackage[noabbrev]{cleveref} \Crefname{figure}{Fig.}{Figs.} \externaldocument[supp-]{supplement}[supplement.pdf] \begin{document} Some text which points to \Cref{supp-figure:sfig_1}, followed by some other text. \end{document} supplement.tex \documentclass[11pt]{article} \usepackage[letterpaper,margin=1in]{geometry} \usepackage[T1]{fontenc} \usepackage{float} \usepackage[hidelinks]{hyperref} \usepackage{caption} \usepackage{subcaption} \captionsetup{font=small,skip=0pt} \captionsetup[figure]{name=Supplementary Figure} \usepackage{cleveref} \usepackage{graphicx} \begin{document} \begin{figure}[htbp] \centering \includegraphics[width=.9\textwidth]{example-image} \caption{some caption} \label{figure:sfig_1} \end{figure} \end{document} I then compile my supplement first and then the main; however, aside from the color given to the supplementary item in question, no hyperlink is visible or clickable when referenced with cleveref as follow: \Cref{supp-figure:sfig_1} I have in my path the latexmkrc file taken from here, so I'm unsure what is going wrong...

  • What about BasicTeX on Mac?
    by mvs on September 22, 2026 at 8:54 am

    I am on MacOS (Tahoe and in while Golden Gate...). I have MacTeX (i.e. Texlive, basically) and it works. The only thing that troubles me is that I have to keep many many packages which I do not use. On other MacOS machine I have MikTeX and what is good about it is that you only have (mostly) only the packages you use, as you know. Now I do have space on the Mac where I have MacTeX but still it troubles me to have a few GB wasted. I was thinking about installing BasicTeX and then adding the packages I need. I am a fairly advanced tex user and I am also sure that I need quite a few more packages than BasicTeX will provide. I could install MikTeX but it still uses Rosetta and it is not clear to me what will happen when Apple will drop support for it. I am asking to fellow tex users who had experience about BasicTeX on Mac: Would the GUI interface for packages still be there, or I'll need to install via terminal tlmgr command? Under the assumption that I need (for sure) many packages more than provided by BasicTeX would this solution be workable, under your experience?

  • Using lambda in different font than that of the document
    by Rup_LA on September 22, 2026 at 6:36 am

    I am writing my Mid-Sem Report to be submitted to my University and they have fixed a particular style of document to be used. I am attaching my code which I am writing. \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb,graphicx,tikz,amsthm} \usetikzlibrary{arrows,matrix} \usepackage[utf8]{inputenc} \usepackage{titlesec} \titlelabel{\thetitle.\quad} \usepackage{setspace} \usepackage{indentfirst} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{Proposition}[theorem]{Proposition} \newtheorem{definition}{Definition}[section] \newtheorem{corollary}[theorem]{Corollary} \newtheorem{Con}[theorem]{Conjecture} \newtheorem{Prob}[theorem]{Problem} \newtheorem{Fact}[theorem]{Fact} \newtheorem{Remark}[theorem]{Remark} \newtheorem{Def}[theorem]{Definition} \newtheorem{Example}[theorem]{Example} \newtheorem{Question}[theorem]{Question} \newtheorem{Problem}[theorem]{Problem} %\newtheorem{proof}[theorem]{Proof} \renewcommand{\baselinestretch}{1.1} \usepackage{pifont,txfonts,geometry,hyperref} \newcommand{\bcomma}{,\allowbreak} \newcommand{\R}{\mathbb{R}} \newcommand{\ds}{\displaystyle} %%%%%%%%% Set page size and margins here %%%%%%%%%%%%%%% \setlength{\topmargin}{-0.5in} \setlength{\topskip}{0.275in} % between header and text \setlength{\textheight}{9in} % height of main text \setlength{\textwidth}{6.25in} % width of text \setlength{\oddsidemargin}{0.1in} % odd page left margin \setlength{\evensidemargin}{0.1in} % even page left margin %\theoremstyle{definition} %\newtheorem{definition}{Definition} \renewcommand{\theenumi}{\rm(\alph{enumi})} \renewcommand{\labelenumi}{\theenumi} %CAN REFER ITEMS WITH THE ABOVE TWO LINES \renewcommand{\theenumii}{\rm(\roman{enumii})} \renewcommand{\labelenumii}{\theenumii} \begin{document} %%%%%%%%%%%%%%%%%%%%%% Title page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \thispagestyle{empty} \begin{center} \LARGE\textbf{Midterm Report} \end{center} \vspace{1cm} \noindent \textbf{Name: Arghya Das} \vspace{3mm}\\ \noindent \textbf{Roll No: MSI22022} \vspace{3mm}\\ \noindent \textbf{Name of the Supervisor: Prof. Milan Nath} \vspace{2em} \hrule \vspace{1em} \section*{Title: A study on algebraic connectivity and spectral integral variations of graphs.} \section*{Abstract:} Write your abstract within 200 words. \section{Introduction} Throughout this document, all graphs are assumed to be finite and simple, unless otherwise mentioned. Let $G$ be a graph with vertex set $V(G)=\{1,2,\dots,n\}$ and edge set $E(G)=\{e_1, e_2,\dots,e_m\}$. We use the notation $i\sim j$ to mean that the vertices $i$ and $j$ are adjacent. The\textbf{\textit{ adjacency matrix}} of $G$, denoted by $A(G)$, is defined as $A(G)=[a_{ij}]_{n\times n}$, where \\ \\ \indent \indent \indent \indent \indent \indent \indent \indent \indent \indent $a_{ij}=\begin{cases} 1, & \text{if } i \sim j\\ 0, & \text{otherwise.} \end{cases}$ \\ \\ The \textit{\textbf{Laplacian matrix}} of $G$, denoted by $L(G)$, is defined as $L(G) := D(G)-A(G)$, where $D(G)$ is the diagonal matrix with degrees of the vertices of $G$ as diagonal entries. It is well-known that $L(G)$ is symmetric and positive semidefiniite and rank of $L(G)$ is $n-k$ where $k=k(G)$ is the number of connected components in $G$. Since $L(G)$ is symmetric and positive semidefinite so all the eigenvalues of $L(G)$ are real and non-negative. Moreover, $0$ is the smallest eigenvalue of $L(G)$ as for $v=(1 \ \ 1\ \dots \ 1)^T \in \R^n$, \ \ $L(G)v=0v$. \par Suppose that $0=\lambda_1\leq \lambda_2 \leq \cdots$ \section{Preliminaries} \section{Work done} Maximum 03 pages \section{Further study} Maximum 01 page \begin{thebibliography}{33} \bibitem{F1} Castelaz, A.~Commutivity degree of finite groups.~Thesis,~Department of Mathematics,~ Wake Forest University,~North Carolina,~5-8, 2010. \bibitem{C1} Cerf, V.,~Fernandez, E.,~Gostelow, K.,~and~Volausky, S.~ Formal control and low properties of a model of computation. Report ENG 7178, Computer Science Department, University of California, Los Angles, CA,~pp. 81, 1997. \bibitem{E2} Dutta, P.~and~Nath, R.K.~Autocommuting probability of a finite group.~{\em Communications in Algebra},~46(3):961-969, 2018. \end{thebibliography} \end{document} However I didn't like the lambda produced here and I want it changed while rest of the fonts and symbols of the document remain untouched (as I can't change the fonts and symbols very much). I want this lambda to use specifically: I have gone through many Tex exchange answers and AI answers but none of them work. Some of these are: How to make italic greek letter \lambda \usepackage{amsmath,amssymb} \usepackage{unicode-math} \setmathfont{Latin Modern Math} \setmathfont[range=\lambda]{TeX Gyre Termes Math} \DeclareSymbolFont{newtxletters}{OML}{ntxmi}{m}{it} \DeclareMathSymbol{\newtxlambda}{\mathord}{newtxletters}{"15} But either they throw an error or produces the same lambda as in produced before. So any help would be appreciated.

  • How to use new/other `S` column specifier in merged cells of an `tabularray` table?
    by Stefan Pinnow on September 22, 2026 at 4:11 am

    The title says it all. Here an MWE, where the first (regular) tabular is the one I try to replicate using tabularray. (The last table is just to confirm that the S colspec in the second table is used in the merged cells as well.) \documentclass[border=5pt,varwidth]{standalone} \usepackage[table]{xcolor} \usepackage{booktabs} \usepackage{tabularray} \UseTblrLibrary{ booktabs, siunitx, } \SetTblrInner{rowsep=0pt} \usepackage{siunitx} \begin{document} \bgroup \newcommand*{\mc}[1]{\multicolumn{2}{c}{\cellcolor{black!10}\tablenum[table-format=3.2]{#1}}} \begin{tabular}{*{2}{S[table-format=5]}} \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule \mc{0.12} \\ \mc{12.3} \\ \mc{123} \\ \mc{5} \\ \mc{0.8} \\ \bottomrule \end{tabular} \egroup \quad \bgroup \begin{booktabs}{ colspec={*{2}{S[table-format=5]}}, row{1}={guard}, cell{4-Z}{1}={c=2}{ % the `S` column specifier or `colspec` seem to be ignored ... S[table-format=3.2\unit{\percent}], % colspec={S[table-format=3.2\unit{\percent}]}, % ... when a color is given. Otherwise an error is raised % that the `S` or `colspec` are interpreted as a color black!10, % % using "usual" colspec values work as expected ... % (the `S` column specifier of the non-merged column/cells seems % to be still used/applied here) l, % c, % r, }, } \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule 0.12 & 0.12 \\ 12.3 & 12.3 \\ 123 & 123 \\ 5 & 5 \\ 0.8 & 0.8 \\ \bottomrule \end{booktabs} \egroup \quad \bgroup \begin{booktabs}{ colspec={ll}, row{1}={guard}, cell{4-Z}{1}={c=2}{ % the `S` column specifier or `colspec` seem to be ignored ... % S[table-format=3.2\unit{\percent}], colspec={S[table-format=3.2\unit{\percent}]}, % ... when a color is given. Otherwise an error is raised % that the `S` or `colspec` are interpreted as a color black!10, % % using "usual" colspec values work as expected ... % l, c, % r, }, } \toprule Min & Max \\ \midrule 1 & 10 \\ 11111 & 22222 \\ \midrule 0.12 & 0.12 \\ 12.3 & 12.3 \\ 123 & 123 \\ 5 & 5 \\ 0.8 & 0.8 \\ \bottomrule \end{booktabs} \egroup \end{document}

  • \DTLaction, align-specs, text wrapping, & temporary page orientation troubles
    by Zutiala on September 22, 2026 at 3:29 am

    I'm writing a thesis, and as part of my initial attempt to organise myself I ultimately made a small database which I want to include as one of my appendices. I've exported all the tables into .txt format, and I'm using DataTool to import them a page at a time. However, I'm having a lot of trouble formatting them. What I want is ultimately for it to look nice and for the columns to all fit into their page. I'd also really like to fix the page number orientation on the landscape page, but I've been struggling to even make the table cooperate. The Thesis style uses the base class "Book". Swapping to \documentclass{book} breaks a whole lot thanks to the new commands introduced, so I'm supplying the full Thesis.cls file here. My thesis code: \begin{filecontents}{lstpatch.sty} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{lstpatch}[Dummy package to be able to load thesis class] \endinput \end{filecontents} \documentclass[a4paper, 11pt, oneside]{Thesis} % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn \usepackage{lscape} \usepackage{datatool} % Pasting the example .txt file for recreation purposes, oops \begin{filecontents*}{data.txt} "ID","Degradation Method","OECD Test?" 1,"Hydrolytic Conditions",0 2,"Enzymatic Degradation",0 3,"Soil - Test No. 304A: Inherent Biodegradability in Soil",1 4,"Soil - Test No. 307: Aerobic and Anaerobic Transformation in Soil",1 5,"Soil - Non OECD",0 6,"Activated Sludge - Test No. 302A: Inherent Biodegradability: Modified SCAS Test",1 7,"Activated Sludge - Test No. 302B: Inherent Biodegradability: Zahn-Wellens/ EVPA Test",1 8,"Activated Sludge - Test No. 303: Simulation Test - Aerobic Sewage Treatment -- A: Activated Sludge Units; B: Biofilms",1 9,"Gas Production - Test No. 311: Anaerobic Biodegradability of Organic Compounds in Digested Sludge: by Measurement of Gas Production",1 10,"Activated Sludge - Non OECD",0 11,"Larval consumption \& Metabolism",0 12,"Physiological Conditions",0 13,"Bacterial Degradation",0 \end{filecontents*} \DTLloaddb{DegMeths}{data.txt} %% ---------------------------------------------------------------- \begin{document} \chapter{Appendix C} \begin{landscape}% Landscape page \centering % Center table \DTLaction[name={DegMeths}, options={ omit-keys={OECD Test?}, align-specs={|p{0.2\linewidth}r|p{0.8\linewidth}l}, caption={Enzyme Database Table: "Degradation Methods"} } ]{display long}\label{App.EDB.DegMeths} \end{landscape} \end{document} Currently, the code has it looking like this and I don't know why Example of the ultimate goal (but landscape page):

  • Alternative of tcolorbox to make box uncurved
    by Maths Rahul on September 22, 2026 at 3:20 am

    I am using \usepackage{tcolorbox} and \begin{tcolorbox} .... \end{tcolorbox} to make a box in the document, which includes a paragraph with appropriate margins automatically. However, this command produces a box with curved corners. Can one suggest simple alternatives for it to produce a box with no corners (i.e. rectangles)?

  • Kaobook compile ERROR [duplicate]
    by 조문수 on September 21, 2026 at 10:45 pm

    After installing TeX Live 2026 on Windows 11 and compiling main.tex (part of the kaobook package) using TeXstudio, I encounter the error shown in the attached file. Can kaobook no longer be used?

  • How to recreate this chapter title page with a colored banner, framed number and shadowed info boxes? [closed]
    by Abd el hamid BENAOUM on September 21, 2026 at 8:49 pm

    I want to recreate a chapter title page like this one (French math textbook): The design has: A grey background band at the top with the word "Chapitre" in blue serif italic. A blue horizontal banner containing: The chapter number inside a white double-framed box, slightly overlapping the banner (sticking out to the left). The chapter title in white, centered. A blue vertical bar on the left edge of the page (partially visible). Below, several centered "info boxes" (Niveau, Volume horaire, Degré d'importance) with a white fill, thin black frame, and a thick black offset shadow behind them. I tried with tcolorbox but I can't get: the number box to overlap the banner edge like in the picture, the offset shadow on the info boxes. Here is my attempt: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{xcolor} \usepackage{tcolorbox} \definecolor{chapblue}{RGB}{0,120,200} \begin{document} {\Large\itshape\color{chapblue} Chapitre} \begin{tcolorbox}[colback=chapblue, sharp corners, boxrule=0pt] \centering\Huge\bfseries\color{white} Continuité d'une fonction numérique \end{tcolorbox} \end{document} Question: How can I get the overlapping framed number, the full-width banner, and the shadowed info boxes? I'd prefer a solution with tcolorbox or TikZ.

  • TeXstudio: error messages for log and pdf file in different folder
    by Martin on September 21, 2026 at 8:30 pm

    I am using TeXstudio on Linux with TeXlive. In a project, I have the following folder structure: Main Folder subfolder of Main Folder: tex subfolder of Main Folder: pdf subfolder of Main Folder: aux I use a user command to compile my tex files (that are in the folder tex) such that all auxilliary files are in the folder aux and my pdf files are in the folder pdf. For that, I have the user command latexmk -cd -pdf -synctex=1 -interaction=nonstopmode -file-line-error -outdir=../pdf -auxdir=../aux %.tex as user0 and my main tex files look like this: % !TeX program = user0 \documentclass{article} \begin{document} content, includes other tex files that are in a subfolder of tex \end{document} Everything works, but if I have an error I do not get the usual error message that tells me what error I have and in which line. What can I do so that I still get error messages?

  • repeating verbatim text within forloop or equivalent
    by blandish on September 21, 2026 at 6:57 pm

    I would like to use forloop (or multido or another alternative if suggested) so that I can generate a series of short coding quizzes where each quiz uses verbatim (or fancyvrb or listings or another alternative). But when I try to do this: \documentclass{article} \usepackage{forloop} \newcounter{x} \begin{document} \forloop{x}{1}{\value{x} < 7}{% \begin{verbatim} def f(x): return x + 1 \end{verbatim} } \end{document} I get an error: File ended while scanning use of \@xverbatim The same basic problem has occurred when I have tried using multido rather than forloop; likewise fancyvrb or listings instead of verbatim. Is there anyway around this limitation?

  • Displaying a Tabularx Entry on Two Lines
    by DDS on September 21, 2026 at 3:34 pm

    Consider the code: \documentclass[12pt]{book} \usepackage{tabularx,lipsum} \begin{document} \thispagestyle{empty} \begin{tabularx}{\linewidth}{c>{\arraybackslash}X} \emph{Heading:} \emph{(to go on second line)} \hskip 15pt & \lipsum[13] \end{tabularx} \end{document} which produces QUESTION: How may I place Heading: (on the second line) over two lines: Heading and (on the second line)? (\vspace{5pt} or \vspace*{5pt} neither seem to work; and, \\[5pt] gives me an overflow message.) Thank you.

  • Citations not showing up correctly despite correct key and reference file entry
    by RBG on September 21, 2026 at 3:30 pm

    I'm having issues with a specific bibliographic entry. While all other citation call-outs in the document work fine, one shows up as sacco˙neurite˙2020 instead of as "(Sacco et al., 2020)" when I use \cite{sacco_neurite_2020}. Here, sacco_neurite_2020 is the correct key that is in Zotero and also in references.bib. The full entry in references.bib is the following: @article{sacco_neurite_2020, chapter = {Adult Brain}, title = {Neurite {Orientation} {Dispersion} and {Density} {Imaging} for {Assessing} {Acute} {Inflammation} and {Lesion} {Evolution} in {MS}}, volume = {41}, copyright = {© 2020 by American Journal of Neuroradiology. Indicates open access to non-subscribers at www.ajnr.org}, issn = {0195-6108, 1936-959X}, url = {https://www.ajnr.org/content/41/12/2219}, doi = {10.3174/ajnr.A6862}, abstract = {...}, language = {en}, number = {12}, urldate = {2026-07-04}, journal = {American Journal of Neuroradiology}, publisher = {American Journal of Neuroradiology}, author = {Sacco, S. and Caverzasi, E. and Papinutto, N. and Cordano, C. and Bischof, A. and Gundel, T. and Cheng, S. and Asteggiano, C. and Kirkish, G. and Mallott, J. and Stern, W. A. and Bastianello, S. and Bove, R. M. and Gelfand, J. M. and Goodin, D. S. and Green, A. J. and Waubant, E. and Wilson, M. R. and Zamvil, S. S. and Cree, B. A. and Hauser, S. L. and R. G. Henry and and University of California, San Francisco MS-EPIC Team}, month = dec, year = {2020}, pages = {2219--2226}, } In the preamble, I have: \usepackage[ backend=biber, style=apa, natbib=true, url=false, doi=false, eprint=false ]{biblatex} Does anyone have an idea what could be wrong? Thank you.

  • listings does not load language Lua
    by Marek Stepanek on September 21, 2026 at 10:28 am

    I am new to listings package. I am on macOS using the complete TeXLive install 2026 and nvim. In the file /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty are three versions of Lua defined with nr like 5.0 - do I have to add this to my tex request for language Lua? A path error is excluded: kpsewhich lstlang2.sty # Output: /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty Permission error is excluded: ls -l /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty -rw-r--r-- 1 root wheel 106030 Nov 20 2025 /usr/local/texlive/2026/texmf-dist/tex/latex/listings/lstlang2.sty Here a minimal (non) working example: \documentclass{article} \usepackage{listings} % \input{listings-lua.prf} % Define Lua manually (bypassing the broken auto-loader) % \lstdefinelanguage{Lua}{ % keywords={and,break,do,else,elseif,end,false,for,function,if,in,local, % nil,not,or,return,true,then,until,while}, % sensitive=true, % morecomment=[l]{--}, % morestring=[b]\", % morestring=[b]' % } \begin{document} \begin{lstlisting}[language=Lua] print("Hello, Lua!") \end{lstlisting} \end{document} Compiling with lualatex in zsh. Other languages are loaded: bash, TeX etc ... Supplemental question (Do I have to make an own thread for it?): How to include TeX code with \end{lstlisting} and/or \end{document} in it? \begin{lstlisting}[language=TeX, title=TITLE, escapeinside=||] \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[language=Lua, title=TITLE] print("Hello, Lua!") |\end{lstlisting}| |\end{document}| \end{lstlisting}

  • Automatic way to hide every solution environment in handout mode
    by Stephen on September 21, 2026 at 8:46 am

    In beamer, I want all the solution environments' contents to appear in normal beamer mode but disappear in handout mode. Typically this can be achieved by something like \documentclass[handout]{beamer} \begin{document} \begin{frame} \begin{example} example text \end{example} \begin{solution}<2-|handout:0> solution text \end{solution} \end{frame} \end{document} However, adding handout:0 for every solution environment is tedious. Is there any automatic may?

  • math mode: make parentheses smaller?
    by Thibault de Villèle on September 21, 2026 at 8:11 am

    I already know \left<opening operator> <content> \right<closing operator> automatically scales up the operators to adapt to the <content> size. I have the opposite problem: I want to scale a set of parentheses down, specifically in a superscript. Take the symbol below in (1) which I use to refer to a specific curve in my paper. I sometimes want to take the first derivative of it, which needs a \prime in superscript, leading to (2). % (1) The regular curve symbol. \NewDocumentCommand{\curve}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}}% \IfBlankF{#1}{(#1)} }% % (2) Its derivative \NewDocumentCommand{\curvederivative}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}\prime}% \IfBlankF{#1}{(#1)} }% However, these can easily be confused. I want to add parentheses around the \prime in order to make the difference stand out. The problem is the parentheses have a lot of height, but no depth (quite the change compared to the "gen" text, only having depth). This version also adds some height to the surrounding line in text mode... % (3) My attempt with parentheses... \NewDocumentCommand{\curvederivativeparen}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}(\prime)}% \IfBlankF{#1}{(#1)} }% Is there an automatic way to scale the parentheses down to the size of the content (in that case, only the \prime symbol)? I know I can play around with \scalebox and \raisebox, but I don't want to fiddle with the lengths if the content changes... MWE, with EBGaramond: \documentclass{article} \usepackage{fontspec} \usepackage[amsthm,frenchmath,uprightscript]{newtxmath} \usepackage[lining,tabular]{ebgaramond} \usepackage{mathtools} \NewDocumentCommand{\curve}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}}% \IfBlankF{#1}{(#1)}% }% \NewDocumentCommand{\curvederivative}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}\prime}% \IfBlankF{#1}{(#1)}% }% \NewDocumentCommand{\curvederivativeparen}{m}{% \phi_{\vphantom{m}\smash{f}}^{\text{\upshape gen}(\prime)}% \IfBlankF{#1}{(#1)} }% \begin{document} First attempt: \( \curve{} \).\par Second attempt: \( \curvederivative{} \).\par Third attempt: \( \curvederivativeparen{} \).\par \end{document}

  • Index not created automatically by the package imakeidx
    by lyl on September 21, 2026 at 7:53 am

    I try to use Emacs + AUCTeX + Miktex to compile the following code which fails to output the index I expect. The options of the engine is: (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex -shell-escape -aux-directory=./tmp -recorder %(mode)%' %t" TeX-run-TeX nil t)) Then I remove the option -aux-directory=./tmp and the index is created. But temporary files created during compilation are now all located in root path which is very annoying. How to get my index automatically created with imakeidx and meanwhile put all the temporay files in a given path? \documentclass{article} \usepackage[nonewpage]{imakeidx} \makeindex[columns=3,intoc,title=My Index] \begin{document} The first index needed\index{index}\\\clearpage The second index needed\index{second} \printindex \end{document}

  • How to make this matrix fit inside the width of a column, in a document with a two-column page layout
    by Ricky W. on September 20, 2026 at 7:02 pm

    I am trying to put a 12 times 12 matrix into one column of the IEEE conference format. But it turns out like this. How do I make this looks better and fit the 12*12 matrix into the left column? Here is the package I am using \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts % The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out. \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{algorithm} \usepackage{mathtools} \usepackage{matlab-prettifier} \usepackage{diagbox} \usepackage{amsmath} \usepackage{booktabs} \usepackage{amsthm} \setcounter{MaxMatrixCols}{12} \newcommand{\INPUT}{\item[\algorithmicinput]} \newcommand{\algorithmicinput}{\textbf{Input:}} \newcommand{\OUTPUT}{\item[\algorithmicoutput]} \newcommand{\algorithmicoutput}{\textbf{Output:}} \newcommand{\INITIALIZE}{\item[\algorithmicinitialize]} \newcommand{\algorithmicinitialize}{\textbf{Initialize:}} \newcommand{\wvar}[1]{\mathit{#1}} Here is my code: \begin{equation} A = \begin{bmatrix} 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & g\sin{\psi} & g\cos{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -g\cos{\psi} & g\sin{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & r & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -r & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & q & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_y-Jz}{J_x}r & \frac{J_y-J_z}{J_x}q \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_z-J_x}{J_y}r & 0 & \frac{J_z-J_x}{J_y}p \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_x-J_y}{J_z}q & \frac{J_x-J_y}{J_z}p & 0 \\ \end{bmatrix}\label{eq.3} \end{equation}

  • "restore" booktabs rules above/below spacing in tabularray with `rowsep=0pt`
    by Stefan Pinnow on September 20, 2026 at 6:31 pm

    The title says it all. What needs to be done, thus that \toprule, \midrule, and bottomrule (and maybe other rules from booktabs) in a tblr environment have the additional spacing again, as they have in a regular tabular environment? Here a direct comparison in the MWE \documentclass[border=5pt,varwidth]{standalone} \usepackage{booktabs} \usepackage{tabularray} \UseTblrLibrary{booktabs} \SetTblrInner{rowsep=0pt} \begin{document} \begin{tabular}{@{}llr@{}} \toprule \multicolumn{2}{c}{Item} \\ \cmidrule(r){1-2} Animal & Description & Price (\$) \\ \midrule Gnat & per gram & 13.65 \\ & each & 0.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.33 \\ Armadillo & frozen & 8.99 \\ \bottomrule \end{tabular} \vspace{1ex} \begin{tblr}{@{}llr@{}} \toprule \SetCell[c=2]{c} Item \\ \cmidrule[r]{1-2} Animal & Description & Price (\$) \\ \midrule Gnat & per gram & 13.65 \\ & each & 0.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.33 \\ Armadillo & frozen & 8.99 \\ \bottomrule \end{tblr} \end{document} which results in

  • roman numerals as enumeration in italics font style
    by Rup_LA on September 20, 2026 at 2:59 pm

    I'm writing a lemma with italics font style where I need enumeration in lowercase Roman numerals. I tried different ways and the best I could do is to use the package enumerate like this: \usepackage{enumerate} \begin{document} \begin{lemma} For any graph G, \begin{enumerate}[(i)] \item L(G) is symmetric. \item L(G) is positive semidefinite. \item etc. \end{enumerate} \end{lemma} \end{document} But the problem I'm facing is the tilts of parentheses are more than that I like. Actually I want like this: Any help would be appreciated.

  • biber doesn't compile
    by Epimanes on September 19, 2026 at 8:15 pm

    Today I tried to use biber (within TeXShop) and I got this error in the console: usage: lipo <input_file> <command> [<options> ...] command is one of: -create[_album] -info -detailed_info -thin <arch> -extract <arch> [-extract <arch> ...] -remove <arch> [-remove <arch> ...] -replace <arch> <file_name> [-replace <arch> <file_name> ...] -verify_arch <arch> ... -archs options are one or more of: -arch <arch> <input_file> -o <output_file> -segalign <arch> <alignment> /Library/TeX/texbin/biber: extracting arm64 binary with lipo failed (wstatus=256) All of the error makes no sense to me. But when I google that last line, it says that it "does not contain the arm64 architecture slice." I'm wondering if this is an error having to do with the upcoming updates in the OS (???). If anyone has a solution or even a description of what is going on, I'd appreciate the help.

  • Macro for drawing intervals
    by Fabrice on September 19, 2026 at 6:04 pm

    How to modify this macro to ensure the same spacing between the first mark and the opening delimiter, and between the last mark and the closing delimiter ? \documentclass[border=5mm]{standalone} \usepackage{luatex85} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); vardef interval(expr a, b, c, d) = interim ahangle := 30; numeric u; u = 0.5cm; path l; l = (0,0) -- (8*u,0); drawarrow l; for x = (a + 0.2) step 0.2 until (b - 0.2): draw (3 down -- 3 up rotated -45) shifted (x * u, 0); endfor label(c, (2*u,0)); label(d, (6*u,0)); label.bot("$a$", (a*u,-5)); label.bot("$b$", (b*u,-5)); label.bot("$-\infty$", (0,-5)); label.bot("$+\infty$", (8*u,-5)); enddef; interval(2, 6, "[", "]"); endfig; \end{mplibcode} \end{document}