• What is "% !TEX TS-program = lualatex" and "who" cares? [duplicate]
    by Steven Thomas Hatton on November 24, 2025 at 2:14 pm

    In this community I was recently presented with a preamble beginning with% !TEX TS-program = lualatex which I vaguely recall having the generic designation of "magic". A bash file typically begins with #!/bin/bash which, among other things, tells the execution environment where to find the bash executable. In the file grok-fail.txt with the content: \documentclass[a4paper,12pt,leqno]{book} \usepackage[margin=1in]{geometry} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{amsmath} file grok-fail.txt returns grok-fail.txt: LaTeX 2e document, ASCII text same filename with #!/bin/bash \documentclass[a4paper,12pt,leqno]{book} \usepackage[margin=1in]{geometry} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{amsmath} file grok-fail.txt returns grok-fail.txt: Bourne-Again shell script, ASCII text executable With the content: % !TEX TS-program = lualatex #!/bin/bash \documentclass[a4paper,12pt,leqno]{book} \usepackage[margin=1in]{geometry} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{amsmath} file grok-fail.txt returns grok-fail.txt: LaTeX 2e document, ASCII text as it did in the first example. It's helpful to us mere humans to be able to read TS-program = lualatex. But is there an expectation that a computer program will read this string and use it to determine which program to compile the content with? I ask, in particular, because I would like Kile to read that string with understanding. Alas I am forced to intervene upon first "live preview" compilation. So what's % !TEX TS-program = lualatex all about?

  • Add a DPDT switch
    by Nicolas on November 24, 2025 at 1:55 pm

    I've diagrammed the charging and discharging of a capacitor. \documentclass[border = 1mm]{standalone} \usepackage[utf8]{inputenc} \usepackage{siunitx} \usepackage[european, straightvoltages, RPvoltages]{circuitikz} \usetikzlibrary{babel} \begin{document} \begin{circuitikz} \draw (0,0) node[spdt,rotate=90,anchor=in] (Sw) {} (Sw.in)--++(0,-1) coordinate(RC) --++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) --++(-1,0) (RC)--++(-1,0) to[capacitor]++(0,-3)--++(1,0) (RC)--++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) coordinate (basRC) ($(basRC)+(-1,0)$) --++(0,-1) node[ground](GND){} (Sw.out 1) to[R] ++(-2,0) to[leDo, invert, mirror] ++(-2,0) coordinate(posSource) to [vsource] (posSource|-GND) --(GND) (Sw.out 2) --++(3,0) coordinate (posMoteur) to [Telmech=M,n=motor] (posMoteur|-GND)--(GND); \end{circuitikz} \end{document} For the discharge, I'd like to add a DPDT switch (and an LED + protection resistor in the corresponding loop) to be able to change the motor's direction of rotation: I haven't found anything about this in the documentation.

  • Fallback font - LuaLaTeX
    by GowriSaro on November 24, 2025 at 1:43 pm

    MWE is: \documentclass{article} \usepackage{amsfonts,amsmath,amssymb} \usepackage{fontspec} \directlua {luaotfload.add_fallback ("myfallback", { "MinionPro-Regular.otf:mode=harf", } ) } \directlua {luaotfload.add_fallback ("mysansfallback", { "Open Sans:mode=harf", } ) } \setmainfont[RawFeature={fallback=myfallback},Ligatures=TeX,% UprightFont= GentiumPlus-R.ttf, ItalicFont = GentiumPlus-I.ttf,%AutoFakeBold=2.5% BoldFont = GentiumPlus-Bold.ttf,% BoldItalicFont = GentiumPlus-BoldItalic.ttf, ]{GentiumPlus}%% \setsansfont[RawFeature={fallback=mysansfallback},Ligatures=TeX, UprightFont= GillSansStd.otf, ItalicFont = GillSansStd-Italic.otf, BoldFont = GillSansStd-Bold.otf, BoldItalicFont = GillSansStd-BoldItalic.otf]{GillSansStd}% %%%Primary alternative font \newfontfamily\primaryalternat[UprightFont= MinionPro-Regular.otf,ItalicFont = MinionPro-It.otf,BoldFont = MinionPro-Bold.otf,BoldItalicFont = MinionPro-BoldIt.otf]{MinionPro}%% %%%Secondary alternative font \newfontfamily\secondaryalternat[Ligatures=TeX, UprightFont= SourceSansPro-Regular.otf,ItalicFont = SourceSansPro-It.otf, BoldFont = SourceSansPro-Bold.otf, BoldItalicFont = SourceSansPro-BoldIt.otf,]{SourceSansPro}% \begin{document} \def\mytest#1#2{\hbox to 50pt{#1\hfill\symbol{"#1}}\par\addvspace{6pt}} \parindent0pt {\protect\mytest{0104}{}}%%the letter Ą {\protect\mytest{092E}{}}%%the Devanagari letter 'म {\sffamily {\protect\mytest{0104}{}} {\protect\mytest{092E}{}} } \end{document} Above code works without error, but in .log file, showed that luaotfload | cache : Lookup cache loaded from C:/Users/cm30132/.texlive2024/texm f-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc. luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "MinionPro-Regular.otf" not found. Kindly advise how to fix this or shall I ignore this, as I'm new to Lua code.

  • How does autoinst use my provided encoding file?
    by TobiBS on November 24, 2025 at 12:46 pm

    I want to modify T1 encoding in two characters to fix the issue I described in How can I make sure characters 157 and 158 are populated with autoinst? So what I did is I copied the fontools_t1.enc, renamed to t1.enc and put it in the folder from which I run autoinst. However the output encodings do neither use the fontools_t1.enc nor the t1.enc data in the ouput encoding. So the encoding I want for 0x98 should read: % 0x98 /Ydieresis /Zacute /Zcaron /Zdotaccent /IJ /uni0130 /uni0111 /section But instead it reads /Ydieresis /Zacute /Zcaron /Zdotaccent /IJ /Idot /dmacron /section while the original fontools_t1.enc reads: % 0x98 /Ydieresis /Zacute /Zcaron /Zdotaccent /IJ /Idotaccent /dbar /section Any idea where autoinst takes this from?

  • LaTeX "minted" is not working with MikTeX, Win10
    by J AK on November 24, 2025 at 11:29 am

    I want to submit a paper in e-informatica, so I am using their file, which is available here. But without any change, their file is not working. It generates the error Error message: minted v3+ executable is not installed or is not added to PATH with two other errors. I have uninstalled and reinstalled the package, and I have also already tried pdflatex --shell-escape your_document.tex pip install minted Please guide how I can fix this.

  • \setmainfont (missing characters) vs \babelfont (not all settings available)
    by Denis Bitouzé on November 24, 2025 at 11:15 am

    (Disclaimer: if I am not mistaken, this question incidentally concerns transliteration of Sanskrit, but I know nothing about that language.) The following MCE: \documentclass{article} \usepackage{fontspec} \usepackage{babel} \setmainfont{texgyrepagella}[ Extension =.otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-boldItalic, Numbers = OldStyle, ] % \babelfont{rm}[Language=Default]{texgyrepagella} \begin{document} \foreignlanguage{sanskrit}{haṁsamukhī} \end{document} (run with lualatex) doesn't work well: Missing character: There is no ṁ (U+1E41) in font [texgyrepagella-regular.otf ]:mode=node;script=latn;language=dflt;+tlig;+onum;! If the line: % \babelfont{rm}[Language=Default]{texgyrepagella} is uncommented, it works nicely and still works nicely if in addition the \setmainfont command is commented. Hence I would be inclined to just rely on: \babelfont{rm}[Language=Default]{texgyrepagella} but, AFAICS, I would then be unable to adjust the settings precisely (e.g. Numbers = OldStyle). So what would be the right way to both: not have missing characters, be able to adjust the settings of the font precisely? Is it safe to keep both \setmainfont and \babelfont?

  • Self-pointing arrows with tikz-cd
    by Jinwen on November 24, 2025 at 11:10 am

    I am trying to adapt this answer to type a bitorsor structure with tikz-cd. What I am getting so far is: My questions are: How to change the direction of the arrows on the right? I tried to switch the start angle and end angle, but this does not do what I expected. How to properly change the relative position of the arrow? I am writing things like ($(\tikztostart.south)-(1em,0)$) which works but seems rather unnatural. How to properly change the size of the opening of the arrow? On the right diagram I changed the factor 0.5 to 0.3, but somehow the vertical position is shifted. Below is a MWE. \documentclass{article} \usepackage{amssymb} \usepackage{tikz-cd} \usetikzlibrary{calc} \begin{document} \[ \begin{tikzcd} B & C \arrow[from=1-1, to=1-2] \arrow["\displaystyle\mathtt{L}","\mathstrut"{name=0, anchor=center, inner sep=0}, from=1-1, to=1-1, to path={let \p1=($(\tikztostart.north)-(\tikztostart.south)$),\n1={scalar(asin(0.5*\y1/1.5em))} in ($(\tikztostart.south)-(1em,0)$) arc[start angle=-\n1,end angle=-360+\n1,radius=1.5em]\tikztonodes (\tikztotarget)}] \arrow["\displaystyle\mathtt{R}","\mathstrut"{name=1, anchor=center, inner sep=0}, from=1-2, to=1-2, to path={let \p1=($(\tikztostart.north)-(\tikztostart.south)$),\n1={scalar(asin(0.5*\y1/1.5em))} in ($(\tikztostart.north)+(1em,0)$) arc[start angle=180-\n1,end angle=-180+\n1,radius=1.5em]\tikztonodes (\tikztotarget)}] \end{tikzcd} \qquad \leadsto \qquad \begin{tikzcd} {A} \arrow["\displaystyle\mathtt{L}","\mathstrut"{name=0, anchor=center, inner sep=0}, from=1-1, to=1-1, to path={let \p1=($(\tikztostart.north)-(\tikztostart.south)$),\n1={scalar(asin(0.3*\y1/1em))} in ($(\tikztostart.south)-(1em,0)$) arc[start angle=-\n1,end angle=-360+\n1,radius=1em]\tikztonodes (\tikztotarget)}] \arrow["\displaystyle\mathtt{R}","\mathstrut"{name=1, anchor=center, inner sep=0}, from=1-1, to=1-1, to path={let \p1=($(\tikztostart.north)-(\tikztostart.south)$),\n1={scalar(asin(0.3*\y1/1em))} in ($(\tikztostart.north)+(1em,0)$) arc[start angle=180-\n1,end angle=-180+\n1,radius=1em]\tikztonodes (\tikztotarget)}] \end{tikzcd} \] \end{document}

  • tl_2025 and tl_basic_2025 in cygwin
    by Angela on November 24, 2025 at 10:11 am

    I've been using texLive in Cygwin for many years. Now, when I upgraded my texlive to the latest version, I see that there is no tl_2025 or tl_basic_2025 available in cygwin. TexLive does not install. I'm unable to use latex or pdflatex Does anyone know what I need to do?

  • In-text floats vs bottom floats: how to get consistent spacing?
    by Bastien on November 24, 2025 at 9:46 am

    Since the 2025-06-01 LaTeX kernel update, the new socket build/column/baselineattach lets us attach bottom floats using the baseline of the last text line. With \AssignSocketPlug{build/column/baselineattach}{on}, \textfloatsep is now added from the baseline and descenders in the last line no longer affect the spacing. However, \intextsep is still measured from the depth of the last line, not from the baseline. So the vertical space above an h-float changes depending on whether the previous line contains descenders. This produces inconsistent spacing between h-floats and b-floats. In the example image below, the spacing between a paragraph without descenders and an in-text float is 4.25 mm, while with a descender in the last line it becomes 4.94 mm. In contrast, the spacing to a b-float (which uses \textfloatsep and is affected by the socket baselineattach) matches the first value (within measurement uncertainty), confirming that only \intextsep still behaves differently. Is it possible to patch the output routine so that \intextsep behaves like \textfloatsep, i.e., is also attached to the baseline? I attempted to patch the output routine command \@addtocurcol directly by inserting a negative space equal to \theprevdepth, but this failed with compilation errors — presumably because \theprevdepth is not available at that point in the output routine. Here is a MWE : \documentclass{article} \setlength{\textfloatsep}{\intextsep} \AssignSocketPlug{build/column/baselineattach}{on} \AssignSocketPlug{build/column/outputbox}{floats-space-footnotes} \raggedbottom \begin{document} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. \begin{figure}[h] \rule{\textwidth}{2cm} \end{figure} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \begin{figure}[h] \rule{\textwidth}{2cm} \end{figure} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. \begin{figure}[b] \rule{\textwidth}{2cm} \end{figure} \end{document}

  • Why do expl3 setting commands use \edef?
    by jlab on November 24, 2025 at 9:21 am

    Looking at the definition of \tl_set:Nn (for example, with latexdef \tl_set:Nn), we find \tl_set:Nn: \protected\long macro:#1#2->\__kernel_tl_set:Nx #1{\__kernel_exp_not:w {#2}} where \__kernel_tl_set:Nx is simply \edef; and \__kernel_exp_not:w is \unexpanded. So, \tl_set:Nn \l_my_tl {...} means \edef \l_my_tl {\unexpanded ...} that is to say: \edef requests for the expansion of the macro definition, but this expansion is prevented by \unexpanded. I'm curious, why not using instead \def \l_my_tl {...} ?

  • How can I define custom footnote links that respect duplicates, and store the pages they appear on?
    by womble on November 24, 2025 at 9:20 am

    I would like to implement commands for referencing requirements in a technical report. The goal is to streamline referencing requirements in the text as they are discussed, and automatically keep track of locations with links to make it easy for a reader to cross reference requirements between the body text and a post-text table of requirements while reading. There should be three commands: \makerequirement{ID}: Used in the table of requirements at the bottom of the report. Should take the requirement ID (eg. SYS_PWR 2.1), print it, make a label for future use, and place a hypertarget for linking. \refreq{ID}: for use in the body of the text. Will take the ID, and make a footnote with the ID that links to the requirement in the post-text table. If this ID has already been referenced on this page, it will reuse the same marker (so one page doesn't have many identical footnotes). \printrequirementrefs{ID}: For use in the table of requirements. Will print a list of page numbers that this ID appears on, and clicking each page number jumps to the page (so each page needs an anchor somewhere). I expected the implementation to follow this order of operations: All valid requirements are instantiated with \makerequirement at the bottom of the document. In text, \refreq{ID} is called on a page. If this ID has already been referenced on this page, fetch and place the correct footnote marker and move on. If it has not: make the footnote, store a label of some kind so the marker can be used again, set the state to show that this ID has been called, store this page that the ID was called on in a dictionary for \printrequirementrefs The page changes, and the list of used IDs is cleared. Repeat (2) for this page. \printrequirementrefs{ID} is called in the table for each ID, and the list of saved page numbers is iterated through and printed. \refreq will ideally respect the regular footnote numbers, so increment the same counter that any other footnote would. MWE The closest I was able to get to something functional (ie. it compiles) was this: \documentclass[12pt]{article} \usepackage{hyperref} % necessary for links \usepackage{atbegshi} % for clearing state \usepackage{etoolbox} % for logic % instantiate requirement and link target \newcommand*{\makerequirement}[1]{ \hypertarget{reqtarget:#1}{#1} \label{req:#1} } % used to repeat references to existing footnotes \makeatletter \newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark} \makeatother \makeatletter \gdef\reqsOnPage{} % requirements referenced on this page \AtBeginShipoutFirst{\gdef\reqsOnPage{}} % clear on new page % custom command to check if a requirement is in state \newcommand*{\IfReqIn}[4]{% \edef\x{\noexpand\in@{,#1,}{,#2,}}\x% \ifin@ \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {#3}{#4}% } \newcommand*{\refreq}[1]{% \IfReqIn{#1}{\reqsOnPage}% if footnote exists {% \footnoteref{reqfn:#1}% place the same marker }% {% \appto{\reqsOnPage}{#1,}% else add it to the list \footnote{% make the footnote \label{reqfn:#1}% \protect\hyperlink{reqtarget:#1}{#1} }% }% }% \makeatother \newcommand*{\printrequirementrefs}[1]{ % ?? #1 } \begin{document} I have just spoken about how I met requirement\refreq{foo} one, and this places the first footnote correctly. Here is some text\footnote{with a regular footnote}. And now there is the second requirement\refreq{bar}, which works, too. And this\refreq{foo} is the first one again, but it references the next occurrence (6) of this ID. \clearpage I am now talking about the second\refreq{bar} requirement, and again\refreq{bar} on the next page which works. And\footnote{generic footnote} the first\refreq{foo} one again, which also works. \clearpage The first\refreq{foo} one again, now broken again! \clearpage \begin{table}[h] \centering \begin{tabular}{*{3}{|l}|} \hline \textbf{ID} & \textbf{Description} & \textbf{References} \\ \hline \makerequirement{foo} & This is a sample requirement & \printrequirementrefs{foo} \\ \makerequirement{bar} & Another one! & \printrequirementrefs{bar} \\ \hline \end{tabular} \end{table} \end{document} The \footnoteref is courtesy of this post. The second page of output works as I need, but the first and third do not, referencing the incorrect marker when called. And, clearly, I wasn't even sure how to start with \printrequirementrefs. I could not get a version that compiled when trying to implement dictionary behaviour. What I've tried Using conditional checks and a state macro \reqsOnPage to store a comma-separated list of the requirements on the current page, and clearing it in between pages. I couldn't find an appropriate way to clear state that didn't leave relics across pages. The same method but with \thepage for the ID of the footnotes on each page as an attempt to sidestep the state-clearing issues of the previous approach. This never compiled as I ran into issues trying to expand the value. It also requires storing an additional list of page numbers, so doesn't seem like a great approach to me. Learning expl3 syntax and using prop as a dictionary to store the instance. This was promising as a programmatic approach, but I found it impenetrable and an extremely steep learning curve for something that, to me, feels like it shouldn't really need it. Maybe I'm wrong. Using LuaTeX to embed Lua scripts to handle the logic of \refreq and \printrequirementrefs. I'm clearly missing something fundamental to how Latex handles this sort of thing or a package that would make it trivial, but I'm at a loss for where to go from here. This has been deceptively hard to implement given how straightforward I think the logic is and I would very much appreciate some input. Thanks in advance.

  • Prevent page break after first line in five-line set examples in gb4e
    by renoh on November 24, 2025 at 8:38 am

    I'm writing a book that present hundreds of examples using gb4e (in the 2nd Part), and wondering how I could prevent page break after the first line. It is similar (almost the same) to Prevent page break after first line of example . However, its solution doesn't seem to work, probably because I have five lines in the exe environment, like in the MWE below: \documentclass[twoside,a4paper,12pt]{book} \usepackage{geometry} \geometry{margin=30truemm} \usepackage{fontspec} \setmainfont{Noto Serif} \usepackage{gb4e} \begin{document} \begin{exe} \ex{{[here I place the phonetic transcription]} \glll the target language here\\ the= seg-mented analysis here \\ DET= gloss gloss gloss\\ \glt `the translation here'} \end{exe} \begin{exe} \ex{{[here I place the phonetic transcription]} \glll the target language here\\ the= seg-mented analysis here \\ DET= gloss gloss gloss\\ \glt `the translation here'} \end{exe} \begin{exe} \ex{{[here I place the phonetic transcription]} \glll the target language here\\ the= seg-mented analysis here \\ DET= gloss gloss gloss\\ \glt `the translation here'} \end{exe} \end{document}

  • LaTeX and tabluarray theme
    by Aaron on November 24, 2025 at 7:26 am

    The table with the local settings works perfectly. But if I want to have a theme = compact, it no longer works. I want to write lines 25 and 26 into a global theme and only customize the specific changes locally, see line 25. \documentclass{scrbook} \usepackage{fontspec} \usepackage[sfdefault]{noto} \setmonofont{Noto Sans Mono}[UprightFont = * SemiBold] \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewTblrTheme{compact}{% \DefTblrTemplate{contfoot-text}{default}{}% \DefTblrTemplate{conthead-text}{default}{}% % Style for the first line (header) \SetTblrStyle{row}{1}{font={\sffamily\bfseries\small},abovesep=3pt,belowsep=3pt}% % Style for all data rows \SetTblrStyle{row}{2-Z}{font={\sffamily\small},abovesep=1pt,belowsep=1pt}% } \begin{longtblr}[ theme = compact, caption = {Test}, label = {tab:test} ]{ colspec = {cX[l]}, rowhead = 1, % row{1} = {font={\small\sffamily\bfseries}, abovesep=3pt, belowsep=3pt}, % row{2-Z} = {font={\small\sffamily}, abovesep=1pt, belowsep=1pt}, cell{2-Z}{1} = {font=\ttfamily\small} } \toprule Spalte 1 & Spalte \\ \midrule 123 - 456 & Zeile 1 \\ 123 - 456 & Zeile 2 \\ 123 - 456 & Zeile 3 \\ 123 - 456 & Zeile 4 \\ \bottomrule \end{longtblr} \end{document}

  • floating point arithmetic and boolean operations with \ifthenelse
    by underflow on November 24, 2025 at 6:50 am

    This is a follow up to my previous post about arithmetic operations and tikz I would like to performance floating point arithmetic & boolean operations in conjunction with \ifthenelse. Here is a minimal example: \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \a in {-6,...,6} { \foreach \b in {-6,...,6} { \ifthenelse{ (\a+1.4*b < 4) \and (\a - 1.4*b)> 1 } { \node at ( (\a, \b ) {(\a, \b)}; } {} } } \end{tikzpicture} \end{document} Many thanks for your help!

  • How to fix overlays breaking in tcolorbox
    by Uncle C on November 24, 2025 at 5:19 am

    For some reason(s) i can't explain. When i use the codes below, the overalys on the right does not break to a new page. see MWE \documentclass[openany]{book} \usepackage[many]{tcolorbox} \tcbuselibrary{skins, breakable} %\tcbset{shield externalize} %\usepackage{mathspec} %\setmainfont{ntaqat} %\setmathsfont(Digits,Greek,Latin){ntaqat} %\setmathrm{ntaqat} \everymath{\displaystyle} \newtcolorbox[auto counter,number within=chapter]{myturn}{% enhanced, empty, breakable, coltitle=black, title={\hspace*{.2cm}\large Here's How We Do It \thetcbcounter}, fonttitle=\bfseries, % lefttitle=1cm, attach boxed title to top left={xshift=1mm}, overlay unbroken and first={\draw[dashed,line width=1pt] ([xshift=.2cm]frame.north west)-|([yshift=20mm,xshift=.2cm]frame.south west); \draw[dashed,line width=1pt] ([yshift=-15mm]frame.north east)--([yshift=5mm]frame.south east)--([xshift=-5mm]frame.south east)--++(180:2cm); \draw[line width=1pt] ([yshift=3mm]frame.south east)--([xshift=-3mm]frame.south east); \node[fill=black,rectangle,minimum width=4pt,minimum height=4pt,inner sep=0pt]at ([yshift=-15mm]frame.north east){}; \node[fill=black,rectangle,minimum width=4pt,minimum height=4pt,inner sep=0pt]at ([yshift=20mm,xshift=.2cm]frame.south west){}; % \draw[fill=black]([yshift=-15mm]frame.north east)circle(2pt); % \draw[fill=black]([yshift=20mm,xshift=.2cm]frame.south west)circle(2pt); \node[fill=white, draw=black, text=red, font=\small, circle, minimum size=12pt, inner sep=0pt] at ([xshift=2.5pt,yshift=-.3pt]title.west) {\includegraphics[clip,width=.5cm,height=.5cm,keepaspectratio]{cal1}}; } } \begin{document} \begin{myturn} \raggedright A civil-engineering team evaluates a reinforced beam where:\\ Concrete compression response is \(\sqrt{x^2+5x+2}\)\\[1ex] Steel reinforcement response is \(\sqrt{x^2+5}\)\\[1ex] The structural-safety model predicts that the difference between concrete and steel responses should match the predicted deflection index which is equal to one.\\[1ex] Task:\\[1ex] Identify the reinforcement level x where the predicted behaviour of the concrete–steel system aligns exactly with the deflection index.\\[1ex] What to do \vspace*{10cm} \begin{enumerate} \item Write down the required equation:\\[1ex] \(\sqrt{x^2+5x+2}\) \(=1+\sqrt{x^2+5}\) \item Square both sides of the equation to eliminate the outer square roots. \item Simplify the equation and isolate the remaining square root term. \item Square both sides again to eliminate the remaining square root. \item Rearrange the equation into a quadratic equation and solve it. \item Check both solutions in the original equation to see if they are valid. \end{enumerate} \end{myturn} \end{document} How can I fix this?? Thanks in advance

  • Incompatibility between array and bidi in LaTeX2e 2025-11-01
    by Psychonaut on November 24, 2025 at 3:29 am

    Following a recent update to TeX Live 2025, bidi has stopped working with array and packages that depend on it, such as nicematrix. Consider the following minimal example: \documentclass{article} \usepackage{array} \usepackage{bidi} \begin{document} \begin{tabular}{c} \end{tabular} \end{document} This results in the error ! Undefined control sequence. \@@array ...idth \z@ }\tbl_save_outer_table_cols: \begingroup \@mkpream {#2}... l.5 \begin{tabular}{c} It seems that the bidi file array-xetex-bidi.def references \tbl_save_outer_table_cols, but according to the LaTeX2e changelog, that identifier was removed in the 2025-11-01 release. I reported the issue in the vafa/bidi issue tracker on GitHub, though it's not clear to me whether that repository is still the official one or whether the package is still actively maintained. Is there a relatively easy way of working around this problem?

  • Font Warnings with scrextend and minipage
    by dedded on November 24, 2025 at 1:00 am

    I'm using \changefontsizes from scrextend and a scalable font to set my font size to 10.5. This seems to work fine, until I put text in a minipage. At that point I get a bunch of font warnings that look as if Latex is trying to make some sort of use of the default cm fonts. The resulting .pdf looks OK. Here's a MWE: \documentclass{article} \usepackage{fontspec} \setmainfont{TeX Gyre Schola} \usepackage{scrextend} \changefontsizes[13pt]{10.5pt} \begin{document} \begin{minipage}{2in} Hello \end{minipage} \end{document} And here are the warnings I get: LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <10.5> not available (Font) size <10.95> substituted on input line 9. LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <10.5> not available (Font) size <10.95> substituted on input line 9. LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <10.5> not available (Font) size <10.95> substituted on input line 9.

  • How to align the visual bottom of a large quotation mark with the cap height of the text?
    by Mihai on November 23, 2025 at 10:03 pm

    I am trying to figure how to correctly place a symbol (e.g., a quotation mark) as illustrated below. So, far I have the following: % Document class. \documentclass[12pt]{article} % Dependencies. \usepackage{lipsum} % Start. \ExplSyntaxOn % Define a box for the quote symbol. \box_new:N \l_quote_box % Define the `\pquote` command. \NewDocumentCommand{\pquote}{ m }{% % Start the quote environment. \begin{quote} % Enter horizontal mode. \leavevmode % Set the quote box to its content. \hbox_set:Nn \l_quote_box {% % Define the quote symbol. \rule{1em}{1em}% } % Place the quote symbol to the left. \llap{% % Smash to avoid affecting line spacing. \smash{% % Raise to align with the top of the first line. \raisebox{ \dim_eval:n { \fontcharht\font`H } }{% % Render the box containing the quote symbol. \box_use:N \l_quote_box }% }% }% % Render the quote content. #1 \end{quote} } % Stop. \ExplSyntaxOff \begin{document} \lipsum[1][1-3] \pquote{\lipsum[1][1-3]} \end{document} Which produces as output: However, the moment I redefine \l_quote_box as % Set the quote box to its content. \hbox_set:Nn \l_quote_box {% % Define the quote symbol. \fontsize{46}{0}\selectfont``% } the positioning of the symbol along the y-axis offset seems off, and the output obtained is: I can correctly reposition the symbol by tweaking the \raisebox, e.g. by setting \dim_eval:n { \fontcharht\font`H - 0.8em } but this feels arbitrary and perhaps dependent on the size used in \fontsize, which is not what I want. I would ideally like to: Determine (i.e., or scale) the size of quotation mark without compromising its "touch" point with the cap height, and thus not have to adjust the y-shift manually. Be mindful that large quotation marks do not overlap the text above, but rather push the entire quote environment down. Is there a robust way of achieving this, preferably without tikZ? I'd appreciate any ideas!

  • Footer shows “Page X of A3” instead of total number of pages
    by Jose Dias on November 23, 2025 at 9:19 pm

    I’m having a strange issue with the page numbering in the footer of my LaTeX document. My footer is defined like this: \cfoot{Page \thepage\ of \pageref{LastPage2}} On the first page everything appears correctly, but in the appendix I get: Page 1 of A3 Page 2 of A3 Page 3 of A3 In other words, the total page count shows up as “A3”. After inspecting the document, I suspect this is caused by the page numbering configuration I apply right before starting the appendix: \pagenumbering{arabic} \renewcommand{\thepage}{A\arabic{page}} It looks like the value “A3” doesn’t actually come from the total number of pages, but from my own redefinition of \thepage — so the footer is literally reading “A3” as the last page label. Can someone confirm if this is indeed the cause? And what is the correct way to add a prefix (like "A") only to appendix page numbers without breaking the “Page X of Y” footer? Thanks in advance! Appeding stard and end of the document: \documentclass[11pt,a4paper]{report} % Encoding e língua \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english,portuguese]{babel} % Layout e tipografia \usepackage[margin=3cm]{geometry} \usepackage{setspace} \doublespacing \usepackage{indentfirst} \usepackage{ragged2e} % permite \justifying e variantes % Figuras, tabelas e formatação avançada \usepackage[table]{xcolor} % SEMPRE primeiro entre os pacotes de tabela \usepackage{array} \usepackage{booktabs} \usepackage{multirow} \usepackage{makecell} \usepackage{tabularx} \usepackage{longtable} \usepackage{ltablex} % DEPOIS de tabularx + longtable \keepXColumns \usepackage{collcell} \usepackage{float} \usepackage{adjustbox} % SEMPRE por último % Matemática e código \usepackage{amsmath} \usepackage{listings} \definecolor{graygray}{gray}{0.95} % Ferramentas adicionais úteis \usepackage{csquotes} \usepackage{comment} \usepackage{textcomp} \usepackage{changepage} % adjustwidth \usepackage{datetime} % datas personalizadas \usepackage{pdfpages} % inserir páginas PDF % Gráficos e elementos posicionados \usepackage{tikz} \usepackage{eso-pic} % fundos e overlays \usepackage[absolute,overlay]{textpos} % Anexos e índice \usepackage[toc,page]{appendix} \usepackage{imakeidx} \makeindex % Glossários \usepackage[toc,acronym,nopostdot,nonumberlist]{glossaries} \makeglossaries % Bibliografia \usepackage{biblatex} \addbibresource{ref.bib} % Estilo de página \usepackage{fancyhdr} \usepackage{lastpage} \usepackage[bottom]{footmisc} % Legendas \usepackage{caption} % Hyperref — deve ser sempre o último \usepackage[hidelinks]{hyperref} \newcommand\BackgroundPic{ \put(0,0){ \parbox[b][\paperheight]{\paperwidth}{ \vfill \centering \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{Capa.pdf}% \vfill } } } \begin{document} \thispagestyle{empty} \ClearShipoutPicture \begin{adjustwidth}{0pt}{20pt} \begin{flushright} \includegraphics[scale=0.45]{figs/logo-ipvc-old.pdf}\\ \vspace*{2cm} \textsf{\huge xxx}\\ \vspace{3cm} \large \textsf{Autor(a)}\\ \textcolor{gray}{\textsf{\Large José Dias}}\\ \vspace{3cm} \vspace{1cm} \large \textsf{Trabalho orientado por}\\ \textcolor{gray}{\large \textsf{xxx}}\\ \vspace{2cm} \textcolor{gray}{\large \textsf{xxxx}}\\ \vspace{2cm} \large \textsf{20 de 09 de 2025}\\ \end{flushright} \end{adjustwidth} \newpage \ClearShipoutPicture \begin{titlepage} \begin{tikzpicture}[remember picture,overlay,shift={(current page.center)}] \node[anchor=center,xshift=-2.8cm,yshift=10.4cm]{\includegraphics[scale=0.18]{figs/MCiber-logo.pdf}}; \node[anchor=center,xshift=2.8cm,yshift=10.3cm]{\includegraphics[scale=0.7]{figs/letter-MCiber.pdf}}; \node[anchor=center,xshift=7cm,yshift=-13cm]{\includegraphics[scale=0.6]{figs/MCiber-end2.pdf}}; \end{tikzpicture} \centering \vspace{4.5cm} \huge xxxxxxx\\ \vspace{1.5cm} \large authored by\\ \Large xxx\\ \vspace{1.5cm} \large and supervised by\\ \large xxx\\ \vspace{0.2cm} \large xxxx\\ \vspace{1.5cm} \normalsize This was submitted in partial fulfilment of the requirements for the degree in\\ \vspace{0.5cm} \includegraphics[scale=0.65]{figs/logo-XXXX-s.pdf}\\ \vspace{0.2cm} \newdateformat{daymonthyear}{\THEDAY\ of \monthname[\THEMONTH], \THEYEAR} \daymonthyear\today \\ %December, 2019 %\large v2.3 \end{titlepage} \input{acro_list} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \selectlanguage{english} \pagenumbering{roman} %\chapter*{\centering\Large\bfseries Abstract} \chapter*{Abstract} \begin{center}\Large\bfseries Abstract\end{center} %context %problem %proposal %solution This xxx \vspace{2cm} \textbf{Keywords:} 5G networks. network slicing. vulnerabilities. security. risk mitigation. \selectlanguage{portuguese} %\chapter*{\centering\Large\bfseries Resumo} \chapter*{Resumo} \begin{center}\Large\bfseries Resumo\end{center} XXXX \vspace{2cm} \textbf{Palavras-chave:} 5G networks. network slicing. vulnerabilities. security. risk mitigation. \selectlanguage{english} \chapter*{Aknowledgements} I would like to express my deepest gratitude ... %insert index \tableofcontents \clearpage \phantomsection \addcontentsline{toc}{chapter}{\listfigurename} % The List of Figures (Do not modify) \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{\listtablename} % The List of Tables (Do not modify) \listoftables %in case there are listings with code: \clearpage \renewcommand\lstlistlistingname{List of Listings} \phantomsection \addcontentsline{toc}{chapter}{List of Listings} % \lstlistoflistings \glsaddall %\printglossary[type=\acronymtype] \printglossary[type=\acronymtype,title={List of Abbreviations},toctitle={List of Abbreviations}] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clearpage \pagestyle{fancy} \fancyhf{} %\fancyhead[LE,LO]{Title Short} \fancyhead[CO]{\nouppercase{\leftmark}} %\fancyfoot[CE,CO]{\leftmark} \fancyfoot[CO]{\thepage} \cfoot{Page \thepage\ of \pageref{lastpage2}} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \fancypagestyle{plain}{% \fancyhf{}% \fancyfoot[C]{Page \thepage\ of \pageref{lastpage1}}% \renewcommand{\headrulewidth}{0pt}% Line at the header invisible \renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible } \glsresetall \chapter{Introduction} \pagenumbering{arabic} \label{chap:introduction} MY TEXT \clearpage \addcontentsline{toc}{chapter}{References} \printbibliography[title={References}] \label{lastpage1} \clearpage \pagestyle{fancy} \fancyhf{} %\fancyhead[LE,LO]{Title Short} \fancyhead[RO]{\nouppercase{\leftmark}} %\fancyfoot[CE,CO]{\leftmark} \fancyfoot[CO]{\thepage} \cfoot{Page \thepage\ of \pageref{LastPage2}} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \fancypagestyle{plain}{% \fancyhf{}% \fancyfoot[C]{Page \thepage\ of \pageref{lastpage2}}% \renewcommand{\headrulewidth}{0pt}% Line at the header invisible \renewcommand{\footrulewidth}{0.4pt}% Line at the footer visible } \pagenumbering{arabic}% resets `page` counter to 1 \renewcommand*{\thepage}{A\arabic{page}} \appendix \begin{appendices} \chapter{Title of Appendix} The contents... A\arabic{page \chapter{Title of other Appendix} The contents... \end{appendices} \label{lastpage2} \end{document} %HELP %https://tikz.dev/pgfplots/reference-2dplots

  • HowTo produce footnotes *) , **), ***), etc?
    by Steven Thomas Hatton on November 23, 2025 at 8:12 pm

    The current preamble is this: \documentclass[a4paper,12pt,leqno]{book} \usepackage[margin=1in]{geometry} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{amsmath} \usepackage{accents} \usepackage{unicode-math} \usepackage{amsthm} \usepackage{csquotes} \usepackage{graphicx} \usepackage{hyperref} \usepackage[g]{esvect} \usepackage{mathtools} \usepackage[svgnames]{xcolor} \usepackage{tabularray} \usepackage{outlines} \usepackage{eso-pic} \usepackage{fancyhdr} \usepackage{enumitem} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan, } \urlstyle{same} \pagestyle{fancy} \fancyhead[LE]{\thepage} \fancyhead[RE]{[9} \fancyhead[LO]{9]} \fancyhead[RO]{\thepage} \fancyhead[C]{RICERCHE DI ANALISI APPLICATA ALLA GEOMETRIA.} \renewcommand{\headrulewidth}{0.4pt} \fancyfoot{} \setlength{\headheight}{15pt} \addtolength{\topmargin}{-3pt} \begin{document} preamble template \end{document} How do I produce footnotes that look like the ones in this page from Beltrami's original text?

  • How to Make TikZ Overlay Arrows Smoother and Better Arranged in Table?
    by mingabua on November 23, 2025 at 6:33 pm

    I'm creating a table with TikZ overlay arrows to illustrate the data flow between cells. The arrows currently work, but they look somewhat crude and could be improved. I'm looking for suggestions on: How to make the curved arrows look more fluid and natural Better positioning strategies for the labeled nodes (A, B, C, D) so they don't overlap with arrows How to avoid awkward arrow angles and improve the overall visual flow Here's my MWE: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{booktabs} \usepackage{xcolor} \usepackage{lipsum} \usepackage{caption} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage[most]{tcolorbox} % Color \definecolor{boxBack}{RGB}{245, 247, 250} \definecolor{darkgrey}{HTML}{464e51} \definecolor{customGray}{HTML}{DDDDDD} \definecolor{customRed}{HTML}{FDE7A9} \definecolor{customOrange}{HTML}{FC8E64} \definecolor{customBlue}{HTML}{B83779} % tcolorbox settings \tcbset{ enhanced, colback=boxBack, colframe=gray!40, boxrule=0.5pt, fonttitle=\bfseries\sffamily, coltitle=black, attach boxed title to top left={xshift=0.5cm, yshift=-3mm}, boxed title style={colback=white, colframe=gray!40, arc=3pt}, top=1em, bottom=1em, left=1em, right=1em } \begin{document} \lipsum[1-3] \begin{tcolorbox}[title=Test] \footnotesize $\quad$ \lipsum[1] \renewcommand{\arraystretch}{1.2} \begin{center} \captionsetup{font=footnotesize,labelfont={color=darkgrey,bf}} \captionof{table}{\textcolor{darkgray}{Example}} \label{tab:shifte} \vspace{-0.5cm} \[ \begin{array}{@{\hspace{1em}}c@{\hspace{2em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{2em}}c@{\hspace{1.0em}}} \toprule \text{Day} & \text{$1$} & \text{$2$} & \text{$3$} & \text{$4$} & \text{$\ldots$} \\ \midrule \text{{\fontsize{9}{10}\selectfont ...}} & \text{{E}} & \text{{L}} & \text{{O}} & \text{{E}} & \text{$\ldots$} \\[6pt] \text{$a_{ds}$} & \tikzmarknode{A2}{\text{$(1,0)$}} & \tikzmarknode{A3}{\text{$(0,1)$}} & \tikzmarknode{A4}{\text{$(0,0)$}} & \tikzmarknode{A5}{\text{$(1,0)$}} & \tikzmarknode{A6}{$\ldots$} \\[6pt] \text{$b_{ds}$} & \tikzmarknode{B2}{\text{$(1,0)$}} & \tikzmarknode{B3}{\text{$(1,0)$}} & \tikzmarknode{B4}{\text{$(0,1)$}} & \tikzmarknode{B5}{\text{$(0,1)$}} & \tikzmarknode{B6}{$\ldots$} \\[6pt] \text{$c_{ds}$} & \text{$(0,0)$} & \text{$(0,0)$} & \tikzmarknode{Z1}{\text{$(0,1)$}} & \text{$(0,0)$} & \text{$\ldots$} \\[6pt] \text{$v_{ds}$} & \tikzmarknode{E3}{\text{$(0,0)$}} & \tikzmarknode{E4}{\text{$(0,1)$}} & \text{$(0,0)$} & \tikzmarknode{E5}{\text{$(1,0)$}} & \tikzmarknode{E6}{$\ldots$ } \\ [6pt] \text{$d_{d}$} & \text{$0$} & \text{$1$} & \tikzmarknode{Z12}{\text{$0$}} & \text{$1$} & \text{$\ldots$} \\ \bottomrule \end{array} \] \begin{tikzpicture}[remember picture,overlay] % Fixed the typo here \draw[thick, ->] (-1.94,0.98) -- (-1.32,0.98); \draw[thick, -<] (-1.94,2.02) -- (-1.32,2.02); \draw[thick, -<] (-1.94,2.58) -- (-1.32,2.58); \draw[thick, ->] (-2.44,2.8) -- (-1.32,2.26); \draw[thick, customGray, -] (1.48,1.6) -- (2.56,2.22); \draw[thick, ->] (-0.44,2.8) -- (0.6,1.60); \draw[thick, ->] (1.48,1.6) -- (2.56,2.22); \draw[thick, -] (-1.94,2.58) -- (-1.94,0.98); \fill[customGray] (-2.21,2.65) circle (0.19); \fill[customGray] (2.02,1.91) circle (0.19); \fill[customGray] (0.08,2.16) circle (0.19); \fill[customGray] (-1.94,1.5) circle (0.19); \node[circle,draw,inner sep=1pt,font=\tiny] at (-2.21,2.65) {A}; \node[circle,draw,inner sep=1pt,font=\tiny] at (-1.94,1.5) {B}; \node[circle,draw,inner sep=1pt,font=\tiny] at (0.08,2.16) {C}; \node[circle,draw,inner sep=1pt,font=\tiny] at (2.02,1.91) {D}; \end{tikzpicture} \end{center} \noindent \lipsum[1] \end{tcolorbox} \normalsize \lipsum[2] \end{document} I want the arrows to look something like this:

  • arithmetic operations with \ifthenelse
    by underflow on November 23, 2025 at 5:47 pm

    Is there a way to add arithmetic operations to \ifthenelse statements? Here is a minimal (non)example: \documentclass{amsart} \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \a in {-6,...,6} { \foreach \b in {-6,...,6} { \ifthenelse{ (\a + \b) < 4 } { \node at ( (\a, \b ) {(\a, \b)}; } {} } } \end{tikzpicture} \end{document} It is not working because \ifthenelse does not allow \a+\b. Bonus question: Is there a way to e.g. define \c = \a + \b in advance so I can use \c elsewhere, in \ifthenelse and subsequence \draw commands? EDIT: Actually what I needed is \a + 1.414*\b < 4 AND \a - 1.414*\b > 0. I thought I could handle the rest once I know how to insert arithmetic operations into \ifthenelse, but apparently it's more complicated than that. Apologies for the mixup and thanks for your help.

  • \foreach loop inside tikz
    by underflow on November 23, 2025 at 5:16 pm

    I need to loop through a variables in tikz, using the ifthen package. Here is a MWE: \documentclass{amsart} \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \x in {-1,0,1, 2, 3, 4, 5} { \ifthenelse{ \x > 3 } { $\bullet$ } { $\star$ } } \end{tikzpicture} \end{document} This works, but when I replace \foreach \x in {-1,0,1, 2, 3, 4, 5} with \foreach \x in {-1,0,1, ... , 5} (or similar variations) I got the error message Runaway argument? 5\pgffor@@stop \expandafter \pgffor@dots@charcheck \pgffor@dotsvalue \ETC. ! Paragraph ended before \pgffor@dots@stripcontext was complete. <to be read again> \par l.13 ? s OK, entering \scrollmode... ! Missing number, treated as zero. <to be read again> . l.25 } ! Missing = inserted for \ifnum. <to be read again> . I tried to look up the tikz manual but I could not figure out what happen. Many thanks for your help!

  • Breakline with underline can't work together
    by Sunshine on November 23, 2025 at 5:11 pm

    I want to break line to show the unshown content, how to do it? \documentclass[openany,a4paper]{ctexart} \usepackage{amsmath,amssymb,mathrsfs,bm,tcolorbox,enumerate,graphicx} \usepackage[top=1cm,bottom=1cm,left=0.5cm,right=0.5cm]{geometry} \usepackage{setspace} \usepackage{lipsum,paracol} \usepackage{ulem} % for '\uline' and '\uuline' macros \begin{document}\columnratio{0.6} \begin{paracol}{2} \lipsum{1}\switchcolumn \uuline{\bfseries aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\uline{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} \lipsum{1} \end{paracol} \end{document}

  • Producing the sums outside of the 3x3 Magic Square
    by Vee on November 23, 2025 at 2:49 pm

    How can I align the column of sums outside of this 3x3 magic square? I've coursed through different variations of code, but I can't seem to get it correct. Kindly see the photo below. The 15s representing the diagonal sums don't seem to align with the row sums. \[ \begin{blockarray}{ccc@{\hspace{5mm}}c} \matindex{15} & \matindex{15} & \matindex{15} & \matindex{15} \\ % top column sums \begin{block}{[ccc]c} 4 & 9 & 2 & 15 \\ % row sums 3 & 5 & 7 & 15 \\ 8 & 1 & 6 & 15 \\ \end{block} & & & \matindex{15} % extra bottom-right 15 \end{blockarray} \]

  • Automatic (but deactivatable) language switching when typing cyrillic
    by Apothikon on November 23, 2025 at 10:50 am

    this is my first question on this site, so I hope I didn't broke any social convention in not introducing myself. I'm writing a simple grammar of Church Slavonic, a slavic liturgical language written with an archaich variant of the cyrillic script. The main text of my document is in English (actually in Italian, but here I use English for clarity's sake) but it obviously contains quite a bit of Church Slavonic, both in long example texts and in short words or even single letters scattered in the English sentences. I've loaded the appropriate polyglossia options and a font for archaic cyrillic letters, and the long Church Slavonic passages are easily handled with \textchurchslavonic{⟨random text⟩} or: \begin{churchslavonic} ⟨random text⟩ \end{churchslavonic} However, in sentences such as the following, the use on \textchurchslavonic{} is quite inefficient: Letters \textchurchslavonic{і}, \textchurchslavonic{и} and \textchurchslavonic{ѵ} usually represent the same sound, but sometimes \textchurchslavonic{ѵ} is pronounced like \textchurchslavonic{в} instead. The above case is very frequent and not the worst possible. So I wanted a way to make the language switch more or less automatic using LuaLaTeX. A possible solution I found would be to load \usepackage{newunicodechar} and redefine each cyrillic letter to be treated as Church Slavonic, like this: \newunicodechar{А}{{\textchurchslavonic А}} \newunicodechar{а}{{\textchurchslavonic а}} The problem of this approach is that it seems impossible to deactivate the language/font switching in the rare instances in which I need to write in modern cyrillic, as shown in the following MWE: \documentclass{article} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{xkeyval} % it solves an incompatibility issue between polyglossia and churchslavonic \usepackage{churchslavonic} \usepackage{newunicodechar} %%%%%%%%%%% \setmainlanguage{english} \setotherlanguage{churchslavonic} \setmainfont{EB Garamond} \newfontfamily\churchslavonicfont{Arial} % I actually use a specialized font which I've installed on my computer \newunicodechar{А}{{\textchurchslavonic А}} \newunicodechar{а}{{\textchurchslavonic а}} \begin{document} These letters are in Church Slavonic script (here set in Arial): А, а. These following should be in EB Garamond: \textnormal{А, а}, which are not! \end{document} I know that \textnormal or similar commands can't work in this situation, so I'm asking: is there any solution in LuaLaTeX? Thank you in advance

  • Plans for evolution/support of {Xe|Lua[node|harf]}LaTeX?
    by Alain Stalder on November 23, 2025 at 7:44 am

    Let me first give some context: As far as I can see, the original TeX/LaTeX including rendering with pdflatex has been very reliably producing the same visual output for decades now and presumably will for many more decades into the future, while there can be glitches due to various optional packages influencing each other. If you plan to or need to support a series of possibly evolving documents with a shared *TeX source code base, that is a very important feature, often close to an absolute necessity. However, I guess still due to Donald E. Knuth’s decision of 1990 in a TUGboat article titled The Future of TeX and METAFONT to not allow especially METAFONT to evolve into the future, and with in parallel newer font features broadly needed and desired, new variants/"variants" of LaTeX emerged that use especially OpenType fonts, I presume having evolved partially via ConTeXt to now XeLaTeX and LuaLaTeX. As far as I understand, XeLaTeX uses the HarfBuzz library (C++, the basis of font support in modern web browsers, Android and a lot more), which is also used by LuaLaTeX with the HarfBuzz renderer, while LuaLaTeX with the default Node renderer is doing it in some other way (maybe native Lua or C?). These three "engines" (XeLaTeX, LuaLaTeX/HarfBuzz and LuaLaTeX/Node) seem to produce similar output in many typical use cases, but in border cases differ. In contrast, as Knuth writes in the above article, at least at the time he wrote it there were tests called TRIP and TRAP that specifically focus on border/edge cases, again a very desirable feature in the context of long-term reliability. Since I write software for a living and partially also as a hobby, I am well aware that for all that it appears the situation is not easy or simple: The three "engines" are broadly used (except maybe LuaLaTeX/HarfBuzz?) so that I presume even making small meaningful changes or small bug fixes would often be close to impossible. Now to the main question (which I presume is of interest to many *TeX users): What are the plans and/or the likely outcome for the three "engines" and thus what is the recommendation which of those three (if any) to use if you want long-term reliable output and need features beyond pdflatex? Related questions that could at least make it easier to decide individually for users: • Any plans to freeze one or some of the "engines"? (Has XeLaTeX already been essentially frozen? And maybe LuaLaTeX/HarfBuzz less future than LuaLaTeX/Node? Or the other way round? Or both to evolve? If several "engines" are planned to keep evolving, any plans to harmonize their output a bit further? Or plans for a new "engine" that would be largely compatible with "the best of all three" but have a more stringent design and tests? Maybe a new renderer "..." for LuaLaTeX?) • Are there tests similar to "TRIP and TRAP" for any of those "engines" or plans to implement more of that in the future? • Any helpful links around the planned/envisioned future of *TeX would be appreciated... Questions on the side: • Did anybody recently ask Donald E. Knuth if he would maybe be willing to change his mind regarding the Computer Modern font under some circumstances, like maybe a well-defined and well-tested environment, like maybe in a future "engine" out of or derived from the mentioned three? (In my personal view, the quality of the font is unparalleled, but it is also tied to it being typeset as intended, which I why I can understand his decision in 1990.)

  • Refactor AI code for a forest diagram
    by projetmbc on November 22, 2025 at 9:40 pm

    In the code below, made using the "AI" Claude, there is too much copying and pasting of lines like the ones shown below. What is the best way to refactor the full code? archivefile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{orange!80}{\faFileArchive}\ ##1 } } } Here is the full code. \documentclass{article} \usepackage{forest} \usepackage{fontawesome5} \definecolor{foldercolor}{RGB}{124,166,198} \definecolor{filecolor}{RGB}{88,88,88} \forestset{ dir tree/.style={ for tree={ font = \sffamily, grow' = 0, child anchor = west, parent anchor= south, anchor = west, calign = first, inner ysep = 1pt, inner xsep = 1.75pt, text depth = 0pt, edge path = { \noexpand \path[draw, \forestoption{edge}] (!u.south west) +(7.5pt,0) |- (.child anchor)\forestoption{edge label}; }, before typesetting nodes={ if n=1 {insert before={[,phantom]}} {} }, fit = band, before computing xy = {l = 15pt}, } }, open/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{foldercolor}{\faFolderOpen}\ ##1 } } }, closed/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{foldercolor}{\faFolder}\ ##1 } } }, file/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{filecolor}{\faFile}\ ##1 } } }, codefile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{filecolor}{\faFileCode}\ ##1 } } }, pdffile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{red!70}{\faFilePdf}\ ##1 } } }, textfile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{filecolor}{\faFile*}\ ##1 } } }, imagefile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{blue!70}{\faFileImage}\ ##1 } } }, archivefile/.style={ before typesetting nodes={ content/.wrap value={ \textcolor{orange!80}{\faFileArchive}\ ##1 } } }, } \begin{document} \subsection*{Exemple d'arborescence de fichiers} \begin{forest} dir tree [system, open [config, closed [settings.conf, textfile] [database.yml, codefile] ] [doc, open [manual.pdf, pdffile] [README.md, textfile] [images, closed [logo.png, imagefile] [banner.jpg, imagefile] ] ] [lib, closed [utils.py, codefile] [helpers.js, codefile] [archive.zip, archivefile] ] [test, open [test\_unit.py, codefile] [test\_integration.py, codefile] [fixtures, closed [data.json, file] ] ] ] \end{forest} \subsection*{Exemple simple} \begin{forest} dir tree [system, open [config, closed] [Dog, closed] [lib, closed] [test, closed] ] \end{forest} \end{document}

  • how to shade an region bounded by curves
    by underflow on November 22, 2025 at 6:43 pm

    I have a region on the plane bounded by two hyperbolas xy = +/- C. What is the best/simplest way to shade (not filled) the "star shaped" region enclosed by these two hyperbolas? Advanced version of this question: I have two rays in the first quadrant, starting from the origin. These two rays cut out a curved wedge in the star shaped region. How I can shade this wedge in a different color from the rest of the region? Here is a MWE for the star shaped region, plus the two rays: \documentclass{amsart} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw [thick, domain=0.5:3] plot (\x, { 1.2/\x)}); \draw [thick, domain=-3:-0.5] plot (\x, { 1.2/\x)}); \draw [thick, domain=0.5:3] plot (\x, {-1.2/\x)}); \draw [thick, domain=-3:-0.5] plot (\x, {-1.2/\x)}); \draw (-3.4,0) -- (3.4,0); \draw (0,-2.6) -- (0,2.6); \draw [thick] (0,0) -- (2.2,2.2); \draw [thick] (0,0) -- (3.1,1.5); \end{tikzpicture} \end{document} Thanks for your help! EDIT: I know how to fill a polygon using \draw [filled] (coord) -- (coord) -- etc but I don't know how to handle the parabolas.

  • How to recreate a DuPont scheme
    by Dorian on November 22, 2025 at 1:30 pm

    I'd like to recreate a DuPont scheme as the image below. I’m not necessarily asking for the exact code used to recreate the graphic, but rather for the packages and commands that would allow me to do it myself. Is there anything more “accessible” than TikZ? Thank you in advance 😉