• Adjust vertical space after last item of a list
    by Sunris8 on August 11, 2026 at 8:23 am

    I'm using setlength\itemsep{..} to change the space between subitems of a customized list. The problem is that the last "subitem" is too close to the second "main item" (see picture). This is quite ugly and unbalanced. Is there a way to automatically increase the spacing (other than setlength\itemsep{..} or \vspace) that would fit in this case? \documentclass{article} \usepackage{enumitem} \newlist{questions}{enumerate}{3} \setlist[questions,1]{font=\bfseries, label = Exercise~\arabic*~:, ref = \arabic*, align = left, wide=0cm} \setlist[questions,2]{label=\bfseries \arabic*),align = right, leftmargin=1.2cm} \begin{document} \begin{questions} \item Question? \begin{questions} \item Subquestion 1 \item Subquestion2: nice spacing \end{questions} \item More Questions? \begin{questions} \item Subquestion 1 \item Subquestion2 \end{questions} \end{questions} \vspace{2cm} \begin{questions} \item Question? \begin{questions}\setlength\itemsep{3em} \item Subquestion 1 \item Subquestion2 : bad spacing \end{questions} \item More Questions? \begin{questions} \item Subquestion 1 \item Subquestion2 \end{questions} \end{questions} \end{document}

  • Unknown Template Keys in \EditInstance
    by CarneSeca on August 10, 2026 at 5:17 pm

    I'm trying to write a set of course notes with LaTeX's accessibility tagging on, but I want to change up the chapter and sections headings. The titlesec package is incompatible, so I'm using the \EditInstance command, based on the answers to this previously asked question: Space between top of text area and chapter heading using \EditInstance formating (ruled headformat) I copy-pasted MWE#2 from that answer into my LaTeX editor, re-copied below for completeness. I'm compiling with TexLive 2026's version of lua-latex, which reports itself as ' LuaHBTeX, Version 1.24.0 (TeX Live 2026) ', all packages are up-to-date in tlmgr. The issue is that I get several errors of the form "LaTeX template: Unknown template key 'after-sep'." (I also get the same error for before-sep and decls, as well as "LaTeX template: The instance 'hang' of type 'headformat' is unknown.") I'd like to make this MWE work on my system (so I can modify it to my needs), but I can't for the life of me figure out what is going on. I haven't been able to find any good documentation online about the \EditInstance command, I'm basically just going off of what I can learn from Stack Exchange questions. Any help is appreciated! % Source - https://tex.stackexchange.com/q/760989 % Posted by polaren % Retrieved 2026-08-10, License - CC BY-SA 4.0 \DocumentMetadata{ lang = sv, pdfversion = 2.0, pdfstandard = ua-2, tagging = on, } \documentclass[11pt,a4paper,twoside,final]{report} \usepackage[margin=25mm,top=24mm,bottom=24mm,nomarginpar,nohead,footskip=11mm]{geometry} \usepackage{showframe}\renewcommand\ShowFrameLinethickness{0.05mm} \usepackage[document]{ragged2e} % Needed for compilation. \usepackage{hyperref} % Needed to pass VeraPDF. \hypersetup{ pdftitle={MWE}, pdfauthor={polaren}, pdfsubject={First question to LaTeX Stack Exchange.}, } \EditInstance{heading}{chapter}{ number-format=\makebox[12mm][l]{\theheading.}, number-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, title-decls=\sffamily\fontsize{14pt}{16pt}\selectfont, after-sep=0mm, before-sep=0mm, start-code=\clearpage\vspace*{-10.75mm}\rule{\textwidth}{0.1mm}\newline\vspace*{-18mm}, final-code=\vspace*{-5mm}\rule{\textwidth}{0.1mm}\newline\vspace*{0mm}, headformat-instance=hang, decls=\raggedright\parindent 0pt\rmfamily } \setlength{\parskip}{6pt plus 1pt minus 1pt} %\setlength{\parskip}{0pt} \usepackage{kantlipsum} \begin{document} \chapter*{Unnumbered Chapter} Test. \chapter{Title of Chapter} \kant[1] \end{document}

  • Is There a Simpler Way to Use Lettrines in a Verse Environment without Invoking a Subroutine
    by Yves on August 10, 2026 at 2:10 pm

    This is a follow-up question, based on the solutions found in Is There a Simpler Way to Use Lettrines in a Verse Environment without Invoking a Subroutine? In an attempt to help a friend compose a book of her poems, I have tried to take advantage of the lessons above, in particular the last one using the lettrine method. However when I change the poem (seemingly without any other change), I get the two first lines severely indented and the output is not visually satisfactory. I could not explain the reason for this and even less find a correction. \documentclass[a4paper,10pt]{article} \usepackage{lettrine} \usepackage{verse} \begin{document} \poemtitle{Complete solution via {\em lettrine} methods} \begin{verse}[8cm] \lettrine[lhang=1.5,nindent=0em]{M}{aking} a famine where abundance lies,\\> Thy self thy foe, to thy sweet self too cruel.\\ Thou that art now the world's fresh ornament, \\ And only herald to the gaudy spring, \\ Within thine own bud buriest thy content, \end{verse} \bigskip \poemtitle {The Sea Bell} \begin{verse}[8cm] \lettrine[lhang=1.5,nindent=0em]{I}{walked} by the sea,\\> and there came to me,\\ as a star-beam on the wet sand,\\ a white shell like a sea-bell;\\ trembling it lay\\ in my wet hand.\\ In my fingers shaken I heard waken\\ a ding within, by a harbour bar\\ a buoy swinging, a call ringing\\ over endless seas,\\ faint now and far\ldots \end{verse} \end{document

  • adjust spacing between toc sections with multicolumn
    by Matteo on August 10, 2026 at 11:27 am

    I have a situation where for a couple of sections I do have subsections in the toc but for the remaining two I don't. Below, an example of how the Outline looks like: Now, as you can see, section 1 and 3 align, whereas 2 and 4 does not. Would there be a way to horizontally align section 4 to section 2 in the toc? MWE \documentclass{beamer} \usetheme{Boadilla} \usepackage{calc} \useoutertheme[width=0pt,height=.5in]{sidebar} \newlength\MyColSep \setlength\MyColSep{.1in} \newlength\MyColWd \setlength\MyColWd{0.5\textwidth-\MyColSep} \AtBeginSection[]{ \begin{frame}{Outline} \begin{columns}[T] \begin{column}{.5\textwidth} \setlength{\parskip}{2ex} \tableofcontents[sections={1-2},currentsection,sectionstyle=show/shaded,subsectionstyle=show/shaded] \end{column} \begin{column}{.5\textwidth} \setlength{\parskip}{2ex} \tableofcontents[sections={3-4},currentsection,sectionstyle=show/shaded,subsectionstyle=show/shaded] \end{column} \end{columns} \end{frame} } \AtBeginSubsection[] { \begin{frame} \frametitle{Outline} \begin{columns}[T] \begin{column}{\MyColWd} \setlength{\parskip}{2ex} \tableofcontents[sections={1-2},currentsection,currentsubsection,subsectionstyle=show/shaded] \end{column} \begin{column}{\MyColWd} \setlength{\parskip}{2ex} \tableofcontents[sections={3-4},currentsection,currentsubsection,subsectionstyle=show/shaded] \end{column} \end{columns} \end{frame} } \begin{document} \section{SECTION 1} \subsection{a subsection 1} \subsection{a subsection 2} \subsection{a subsection 3} \section{SECTION 2} \subsection{a subsection 1} \subsection{a subsection 2} \subsection{a subsection 3} \section{SECTION 3} \section{SECTION 4} \end{document}

  • How to reproduce the correct intersection curve of two 3D surfaces using PGFPlots?
    by Samia Rani on August 10, 2026 at 10:50 am

    I am trying to reproduce a 3D figure from a mathematics book in LaTeX using TikZ/PGFPlots. The figure shows two surfaces and their intersection. The two surfaces are given by x^2 + xy - y - 3z = 0 and 2x^2 + 3xy - 2y - 3z = 0. I plotted both surfaces directly from their equations and also added their intersection curve. However, the shape and especially the intersection curve in my output look quite different from the figure in the book, even though I am using the same equations. I am not sure whether the difference is caused by the viewing angle, the plotting ranges, the parametrization of the intersection curve, or something else. Here is my current code: \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ view={120}{25}, axis lines=none, xmin=-2.5, xmax=2.5, ymin=-2.5, ymax=2.5, zmin=-5, zmax=5, width=11cm, height=8cm, ticks=none, ] %================================================ % GREEN SURFACE % 2x^2 + 3xy - 2y - 3z = 0 %================================================ \addplot3[ surf, shader=interp, colormap={greenmap}{ color(0cm)=(green!15); color(1cm)=(green!35) }, colormap name=greenmap, domain=-2:2, y domain=-2:2, samples=35, samples y=35, opacity=0.65, ] { (2*x^2 + 3*x*y - 2*y)/3 }; %================================================ % BLUE SURFACE % x^2 + xy - y - 3z = 0 %================================================ \addplot3[ surf, shader=interp, colormap={bluemap}{ color(0cm)=(blue!15); color(1cm)=(blue!35) }, colormap name=bluemap, domain=-2.2:2.2, y domain=-2.2:2.2, samples=30, samples y=30, opacity=0.55, ] { (x^2 + x*y - y)/3 }; %================================================ % INTERSECTION CURVE % gamma(t) = % ( t, -t^2/(2t-1), t^3/(3(2t-1)) ) %================================================ \addplot3[ very thick, red, samples=100, domain=-2.2:0.35, variable=\t, ] ( {\t}, {-\t^2/(2*\t-1)}, {\t^3/(3*(2*\t-1))} ); \addplot3[ very thick, red, samples=50, domain=0.65:2.2, variable=\t, ] ( {\t}, {-\t^2/(2*\t-1)}, {\t^3/(3*(2*\t-1))} ); \end{axis} \end{tikzpicture} \end{document} The book's figure has a noticeably different orientation and shape for the two surfaces and their intersection. The book's figure looks like this: My current output looks like this: Could someone please explain what is causing this difference and how I can modify my PGFPlots code to obtain a figure that looks like the one in the book? In particular, I would like to know whether I should change the view angles, the plotting domains, or the parametrization of the intersection curve.

  • Punctuation in system of equations
    by Sunris8 on August 10, 2026 at 9:55 am

    I would like to know if there is both a correct and "nice" way to use punctuation in systems of equations. I have tried \documentclass{article} \usepackage{amsmath,array} \usepackage{systeme} \begin{document} This looks correct but ugly $$ \systeme{x+y=7, x-y = 3}\,. $$ What about $$ \systeme{5x+2y=7\, , 5x-2y= 3\,. } $$ \end{document} The first solution is what I would expect to be correct but it's quite ugly. The second solution does not display the comma after the first equation. Is there a rule for punctuation after a system? If yes, how to do it with this command?

  • Asymptote: function which accepts a triple-function and a real t-value, and provides the approximated Frenet basis of that function at that t-value
    by Jasper on August 10, 2026 at 9:24 am

    I have an arbitrary function which outputs a 1D parametric triple in Asymptote. I want to find the Frenet basis of it at a point without resorting to coding derivatives for every individual function. My goal is to have a function which gives me the approximated Frenet basis of any triple-producing 1D function at a specific input. import three; import graph3; unitsize(3cm); triple curve(real t) { real t1 = 3.14 * t; return ( cos(t), sin(t), t ); } path3 f = graph(curve, 0, 2*pi, n=20); draw(f); /* I am attempting to make a function which accepts an arbitrary triple function, and an arbitrary parameter value. It's goal is to produce the matrix containing the position vector, the tangent vector, the normal vector, and the binormal vector - the so called Frenet basis. How can I do this for an arbitrary function. My goal is to not have to write individual matrix functions for every parametric curve. I'd much rather just input the curve's function and a parameter-value and be given the orthonormalized Frenet basis. */ real[][] T(triple function, real param) { triple df(real t) { return (1/0.04)*(function(t+0.02)-function(t-0.02)) } return {{df(param)},{},{},{}} }; I was able to achieve it in Lua, since my software enables verbose input. \documentclass[tikz, border=1cm]{standalone} \usepackage{lua-tikz3dtools} \begin{document} \begin{tikzpicture} \useasboundingbox[scale=0.5] (-5,-5) rectangle (5,5); \ltdtsetobject[ name=objs, object={ return { view = Matrix.zyzrotation(Vector:new{7*pi/6,pi/6,pi/2}), alpha = function(t) return Vector:new{sin(t)+2*sin(2*t),cos(t)-2*cos(2*t),-sin(3*t),1} end, frenet = function(surf, param) local tangent = function(s, p) return s(p + 0.02):hsub(s(p - 0.02)):hscale(1 / 0.04):hnormalize() end local normal = function(s, p) local tang = function(t) return tangent(s, t):hnormalize() end return tangent(tang, p) end local T = tangent(surf, param):hnormalize() local N = normal(surf, param):hnormalize() local B = T:hcross(N):hnormalize() local P = surf(param) local RE = Matrix:new{T, N, B, P} % currently projective, needs to be affine (at this time, at leat) RE[1][4] = 0 RE[2][4] = 0 RE[3][4] = 0 return RE end } } ] \ltdtappendlight[v={return Vector:new{1,1,1,1}}] \iffalse \ltdtappendcurve[ uparams={return Vector:new{0,tau,100}}, v={ return objs.alpha(u) :multiply(objs.view) }, draw options={return "draw, line cap=round"} ] \fi \ltdtappendsurface[ uparams={return Vector:new{0,tau,200}}, vparams={return Vector:new{0,tau,10}}, v={ return Vector:new{0, cos(v)/5, sin(v)/5, 1} :multiply(objs.frenet(objs.alpha, u)) :multiply(objs.view) }, fill options={return "fill=ltdtbrightness"} ] \ltdtdisplaysimplices \end{tikzpicture} \end{document} I also did it ad-hocly in tikz... https://chat.stackexchange.com/transcript/message/69138959#69138959

  • How can I draw the plane and intersection curve on a one-sheet hyperboloid in TikZ?
    by Samia Rani on August 9, 2026 at 5:23 pm

    I am trying to recreate the following mathematical figure in LaTeX/TikZ. The figure shows the one-sheet hyperboloid x^2 + y^2 - z^2 = 1 together with the plane 2x + z = 1. Their intersection is the red curve shown on the hyperboloid. After quite a lot of effort, I have managed to draw the one-sheet hyperboloid reasonably well in TikZ. However, I am having difficulty with the two remaining parts: How can I draw the transparent red plane 2x + z = 1 behind/in front of the hyperboloid, as shown in the reference image? How can I draw the red intersection curve between the plane and the hyperboloid so that it lies correctly on the surface? I would like the final figure to look as close as possible to the reference image, including the perspective, transparency of the plane, and the red intersection curve. Here is the code I currently have for the hyperboloid: \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture}[>=stealth] \begin{axis}[ view={120}{22}, axis lines=none, xmin=-3.3, xmax=3.3, ymin=-3.3, ymax=3.3, zmin=-2.0, zmax=2.0, xtick=\empty, ytick=\empty, ztick=\empty, clip=false, ] %------------------------------------------------ % Red point at the origin %------------------------------------------------ \addplot3[ only marks, mark=*, mark size=2.5pt, draw=red, fill=red, ] coordinates {(0,0,0)}; %------------------------------------------------ % Smooth one-sheet hyperboloid %------------------------------------------------ \addplot3[ surf, shader=interp, draw=blue!55!black, opacity=0.65, samples=45, samples y=80, domain=-2.2:2.2, y domain=0:360, z buffer=sort, ] ( {sqrt(1+x^2)*cos(y)}, {sqrt(1+x^2)*sin(y)}, {x} ); %------------------------------------------------ % POSITIVE x-axis %------------------------------------------------ \draw[ ->, black, thick ] (axis cs:0,0,0) -- (axis cs:5.0,0,0) node[right] {$x$}; %------------------------------------------------ % NEGATIVE x-axis -- dashed %------------------------------------------------ \draw[ dashed, black, thick ] (axis cs:0,0,0) -- (axis cs:-2.0,0,0); %------------------------------------------------ % POSITIVE y-axis %------------------------------------------------ \draw[ ->, black, thick ] (axis cs:0,0,0) -- (axis cs:0,4.0,0) node[above left] {$y$}; %------------------------------------------------ % NEGATIVE y-axis -- dashed %------------------------------------------------ \draw[ dashed, black, thick ] (axis cs:0,0,0) -- (axis cs:0,-1.0,0); %------------------------------------------------ % POSITIVE z-axis %------------------------------------------------ \draw[ ->, black, thick ] (axis cs:0,0,0) -- (axis cs:0,0,3.0) node[above] {$z$}; %------------------------------------------------ % NEGATIVE z-axis -- dashed %------------------------------------------------ \draw[ dashed, black, thick ] (axis cs:0,0,0) -- (axis cs:0,0,-2.0); %------------------------------------------------ % Origin %------------------------------------------------ \node[ below right, inner sep=1pt ] at (axis cs:0,0,0) {$0$}; %------------------------------------------------ % Equation %------------------------------------------------ \node[ blue!75!black, font=\large ] at (axis cs:2.0,-0.5,1.1) {$x^2+y^2-z^2=1$}; \end{axis} \end{tikzpicture} \end{document} I would be very grateful for any suggestions on how to add the plane and, especially, the intersection curve correctly. Thank you!

  • Changing the font of algorithm name in algorithm2e
    by user631620 on August 9, 2026 at 1:38 pm

    I'm trying to format an algorithm using algorithm2e and hyperref. I would like to achieve that the algorithm's name is printed in sans-serif font (in the algorithm caption and whenever it is referenced via \ref). Minimal (non) working example: \documentclass{article} \usepackage[algoruled]{algorithm2e} \usepackage{hyperref} \begin{document} Below, we present Algorithm~\ref{alg:myalg}. \begin{algorithm} \SetAlgoLined \SetAlgoRefName{MyAlg} \If{$x >0$}{ \KwRet{$x$}} \caption{A test algorithm} \label{alg:myalg} \end{algorithm} \end{document} What I have tried: If I use something like \SetAlgoRefName{\sffamily MyAlg} and add \SetAlCapFnt{\normalfont} in the example above, the document will compile with multiple errors, but the result looks correct: Using algorithm2e commands like \SetAlCapFnt or \SetAlCapNameSty also did not work for me, as they seem to set the font not just for the name of the algorithm, but for larger parts of the title. Redefining one of the internal commands of algorithm2e (see below), I managed to get the caption correct, but this does not work for the links created via \ref. \renewcommand{\algocf@captionref}{% \renewcommand{\fnum@algocf}[1]{\AlCapSty{\AlCapFnt\algorithmcfname\nobreakspace\sffamily\algocf@algocfref}}% \addtocounter{algocf}{-1}% \caption do a refstepcounter, so we restore the precedent value \let\old@thealgocf=\thealgocf\renewcommand{\thealgocf}{{\relsize{\algocf@refrelsize}\algocf@algocfref}}% \gdef\@currentlabel{\sffamily\algocf@algocfref}% let the label use the new ref }%

  • rectangle behind first two letters of chapter title
    by G. Bay on August 9, 2026 at 11:28 am

    What I need to achieve is: A rectangle behind the first two letters of the chapter title, spanning up to the paper border (full bleeding over the margin) Change color of the first two letters of the chapter title. I have managed to do this with this specific chapter, but when I repeat the code with different words it gets all bugged, because my method is fine tuned to this word only. I used tikz for no special reason, maybe tcolorbox would be easier. How do I make it so it will work for every chapter without needing to readjust each time? \documentclass{memoir} \usepackage[% left=1.5in, right=1in, top=23.245mm, bottom=3cm ]{geometry} \usepackage{fontspec} \usepackage{moresize} % Configure Raleway: Map \textbf to the 'ExtraBold' font file \setmainfont{Raleway}[ UprightFont = *-Regular, ItalicFont = *-RegularItalic, BoldFont = *-ExtraBold, % \textbf uses Extra-Bold BoldItalicFont = *-ExtraBoldItalic % \textbf{\textit{...}} uses Extra-Bold Italic ] \usepackage{calc} \usepackage{tikz} \usetikzlibrary{positioning,calc} \usetikzlibrary{tikzmark, backgrounds} \usepackage{xcolor} \usepackage[explicit]{titlesec} \usepackage{xstring} \definecolor{cinza}{HTML}{918f90} \titlespacing*{\chapter}{0pt}{-70.5pt}{20pt} % Syntax: \titleformat{cmd}[shape]{format}{label}{sep}{before} \titleformat{\chapter}[display]% {\fontsize{42.5}{48}\selectfont\bfseries} % Format: 40pt, negrito {} % LABEL: Removes "Chapter 1" {0pt} % Separation: 0pt since no label {% \StrLeft{#1}{1}[\first]% Extract first letter \StrLeft{#1}{2}[\firsttwo]% Extract first two letters % % Print the first two letters (White) {\color{white}\MakeUppercase{\first}\StrGobbleLeft{\firsttwo}{1}}% % % CRITICAL FIX: Save the rest into \rest, then print \rest in cinza \StrGobbleLeft{#1}{2}[\rest]% {\color{cinza}\rest}% } \begin{document} \tikzmark{A}\tikzmark{B}\chapter{Apresentação} \AddToHookNext{shipout/background}{% \begin{tikzpicture}[remember picture,overlay] \begin{scope}[on background layer] % Define coordinates \coordinate (nA) at ([xshift=4.1em, yshift=-1.63cm]pic cs:A) ; \coordinate (sB) at ([xshift=9.1em]{pic cs:B} |- {current page.north}); % Draw the rectangle (it will now be behind text) \draw[fill=cinza, draw=none] (nA) rectangle (sB); \end{scope} \end{tikzpicture} } \end{document}

  • align hitbox of rotated reference cited in TikZ image
    by ali bab613 on August 8, 2026 at 2:52 pm

    I have a document which calls a .tex file that contains a standalone TikZ image. Within that image, I cite several references in a rotated node. I have the MWE here: main.tex: \documentclass{article} \usepackage{tikz} \usepackage{standalone} \usepackage{hyperref} \begin{document} \input{Chapter1} \bibliographystyle{IEEEtran} \bibliography{references} \end{document} and Chapter 1.tex: \documentclass{standalone} \usepackage{hyperref} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[color=black,rotate=17] at (3.25,-2.35) {\tiny\cite{Test1,Test2,Test3,Test4,Test5}}; \end{tikzpicture} \end{document} Most answers online deal with hyperref to an image that's entirely rotated, in my case this is one node amongst many, and the picture is not rotated. I did not suppress the hitboxes in hyperref (by using \usepackage[breaklinks]{hyperref}) for demonstration purposes, but the problem (obviously) persists for both cases. Here's a screenshot of the resulting image, and its hitboxes: The issue is not only that the box does not rotate (which isn't a massive problem), it's more that it does not align vertically, especially the further along the node you go. Changing the citation to {\tiny\cite{Test1,Test2,Test3,Test4}\cite{Test5}} also does not adjust the box vertically: This may be a long shot, but is there a way to better align the hitbox with the node?

  • How to create a macro/environment like the figure enviroment? [duplicate]
    by Domi on August 7, 2026 at 9:24 pm

    I want to create an environment that, when I use \begin{name}, will show me the commands I want to fill out, like what happens with the figure environment for example. I've tried using the \newenvironment command but I think I'm doing something incorrectly because when I use the environment I created, it just shows up empty. Edit for clarification: I want to create a macro similar to the figure environment, like, when we use the \begin{figure} the following code shows up: \begin{figure} \centering \includegraphics[width=0.5\linewidth]{} \caption{Caption} \label{fig:placeholder} \end{figure} I want to create a macro that does something similar, showing this code: \begin{tcolorbox}[tabularx=Y|Y|Y, title=Título da Tabela, center title] \textbf{} & \textbf{} & \textbf{} \\ \hline & & \\ \hline & & \\ \hline & & \\ \hline & & \\ \hline \end{tcolorbox} The issue I'm having is that, when I use the \newenvironment command, it creates the environment, but none of the content shows up. Does that make sense? Is that something that can be done?

  • showclefs like command in Musixtex
    by ABV on August 7, 2026 at 6:15 pm

    It is needed to implement a command in Musixtex to do: showclefs like command in Musixtex, the basic code is as follow: \documentclass[% border={2pt -11pt 90pt 8pt},% left bottom right top %border=8pt varwidth]{standalone}% Ejemplo 26 \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \usepackage{amsmath} \usepackage{xcolor} \xdefinecolor{red-undar}{RGB}{179,35,79} \xdefinecolor{naranja}{RGB}{246,146,30} \xdefinecolor{conchevino}{RGB}{179,35,79} \xdefinecolor{plomoOscuro}{RGB}{52,52,52} \begin{document} \begin{music} \hsize=1.25\linewidth% \resetlyrics \setlyrics{AcordesB}{\B I \B II \B I \B II \B I \B IV \B IV6 \B II I\raisebox{0.5ex}{\bfseries\musFig[l]{{7} {\noFig}}} \B I \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{5} {6}}} \B I6 \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{3} {4}}} \B I6}% \setlyrics{AcordesX}{_ _ _ _ _ _ _ _} \setlyrics{AcordesY}{_ _ _ _ _ _ _ _} \setlyrics{AcordesZ}{_ _ _ _ _ _ _ _} \setlyrics{AcordesA}{\B 8J \B 5J \B 3M \B 3m \B 6M \B 6m \B 5 _} %\setsongraise{1}{1.5cm} %\setsongraise{2}{2.5cm} \lyrraisemulti{1}{2}{a -1.9cm} \font\A=phvb8t at 10pt% added for letter type. \font\B=phvb8t at 13pt% added for letter type. \parindent0mm \sepbarrules \generalsignature{0} %\generalmeter{\meterfrac{2}2} \instrumentnumber{1} \interstaff{10}%espacio entre pentagramas del piano \setclef{1}{61}%Clave de Do en 1ra linea \setstaffs1{2}% \nobarnumbers% \startpiece% \A\assignlyricsmulti{1}{2}{AcordesA}%,AcordesX,AcordesY,AcordesB} %\A\assignlyricsmulti{1}{1}{AcordesB}%,AcordesX,AcordesY,AcordesB} \Notes\hqsk\wh{J}\zcharnote{31}{\hspace{-3.5cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 8J}}}; \end{tikzpicture}}|\hqsk\wh{j}\en\doublebar% \setclef{1}{61}\changeclefs% \Notes\wh{J}\zcharnote{31}{\hspace{-3.75cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 5J}}}; \end{tikzpicture}}|\wh{g}\en\doublebar% \Notes\wh{J}\zcharnote{31}{\hspace{-3.75cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 3M}}}; \end{tikzpicture}}|\wh{l}\en% \alaligne% \Notes\wh{a}\zcharnote{31}{\hspace{-3.75cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 3m}}}; \end{tikzpicture}}|\wh{j}\en\doublebar% %\setclef18\zchangeclefs % apply empty clef (no space) \setclef{1}{63}\changeclefs% \Notes\wh{M}\zcharnote{31}{\hspace{-3.75cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 6M}}}; \end{tikzpicture}}|\wh{d}\en\doublebar% \Notes\wh{L}\zcharnote{31}{\hspace{-3.75cm}\begin{tikzpicture} \node (point) at (0,0)[text width=26mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Permitido 6m}}}; \end{tikzpicture}}|\wh{c}\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece \end{music} \end{document} the current output is as follow: The desired output is as follow:

  • TikZ to draw an arrow along the side of a table
    by Maronite Monks on August 7, 2026 at 2:06 pm

    I have a table to which I'd like to add a curved arrow (with an arrowhead at one end) running outside the table. The line will originate at the upper left portion of a table and end with the arrow pointing at the lower left portion. Another similar arrow will be outside the lower right side of the table and end pointing at the upper right side. I'd like some text to follow the curve of the arrows on each side of the table. The text for the left arrow will say: "Gives rise to the irascible". The text on the right will say: "Resolves in the concupiscible". Here's a MWE I've compiled with LuaLaTeX. \documentclass[12pt]{memoir} \addtolength\tabcolsep{.5in} \renewcommand\arraystretch{1.5} \begin{document} \begin{center} \begin{tabular}{c|c} \hline\hline {\scshape Good}& {\scshape Evil}\\\hline\hline\\[-9pt] love & hate \\\hline desire & avoid \\\hline joy & sad \\\hline\hline\\[-9pt] hope & bold \\\hline despair & fear \\\hline\hline\\[-9pt] & anger \end{tabular} \end{center} \end{document}

  • Robust way to write equation solving
    by Sunris8 on August 7, 2026 at 1:29 pm

    I want to write a robust code to write equations solving with vertical bar. I started with the last answer of this. My MWE is copied below. The problem is that the code is not robust (see picture: e.g. the length of the bar is fixed if you add more lines, but maybe some other issues that I have not spotted yet). At best, I would like a command \resolutionstep{...}{...} which would reproduce the picture adapting automatically the line of the equation, so something like: \begin{equation/array} \resolutionstep{3x+2{1}{-2} \resolutionstep{3x}{-1}{\div 3} \resolutionstep{x}{-\frac 13}{} \end{equation/array} Does any one know a good package/code to improve this? Thanks! \documentclass{article} \usepackage{showframe} \renewcommand{\ShowFrameLinethickness}{0.3pt} \usepackage{eqparbox} \usepackage{amsmath,array} \begin{document} blablabla \begin{alignat}{2} \qquad2x+2 &= 7x+3 &\hspace{6em}\smash{\rule[-5\baselineskip]{0.5pt}{6\baselineskip}} \qquad-2 & \\ 2x &= 7x+1 & -7 x & \\ -5x &= 1 &\div(-5) & \\ -5x &= 1 &\div(-5) & \\ -5x &= 1 &\div(-5) & \\ -5x &= 1 &\div(-5) & \\ x &= \boxed{-\frac{1}{5}} & & \end{alignat} \end{document}

  • above and below space for table rules tabularray
    by MadyYuvi on August 7, 2026 at 6:49 am

    My code are: \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}Q[wd=#1]}% %\SetTblrInner{rowsep=0pt,row{1} = {l,b}} \SetTblrInner{rows={abovesep=0pt,belowsep=0pt},row{1} = {l,b}} \heavyrulewidth=0.5pt \lightrulewidth=0.5pt \cmidrulewidth=0.5pt \belowrulesep=14pt \belowbottomsep=14pt \aboverulesep=14pt \abovetopsep=10pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em %\begin{tblr}{@{}XW{20pc}@{}} Test for tblr \begin{tblr}{colspec = {@{}XW{20pc}@{}}, row{1} = {l,b}} \toprule \SetCell[c=1]{l} Variable & \SetCell[c=1]{l} Sources\break Bottom\break test\\ \midrule \SetCell[c=2]{c} \textit{Supply variables}\\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit employees & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit financials & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \end{document} already I gave some large value of above and below space for all rules (e.g., \toprule, etc.) but nothing was affected, how can I fix the space (need to fix 6pt white space for all rules)

  • CMUTypewriter symbols baseline inconsistency?
    by Explorer on August 7, 2026 at 4:46 am

    I have the following code: \documentclass{article} \usepackage{fontspec} \setmonofont{cmun}[ Extension = .otf, UprightFont = *btl, BoldFont = *tb, ItalicFont = *bto, BoldItalicFont = *tx, HyphenChar = None] \begin{document} Hello \texttt{+} world \texttt{-} and everyone! Hello \texttt{\char92 CJKsout+} world \texttt{\char92 CJKsout-} and everyone! \end{document} It gives the unexpected baseline of + and -... Any suggestions? Edited The original case was I want to illustrate two commands: \CJKsout+ \CJKsout- both in xeCJKfntef package. If they are put together, that was in bad looking, if you don't mind to read Chinese, you could see here.

  • Cookbook layouting with minipage?
    by Mr. Undercover on August 6, 2026 at 10:21 pm

    I am trying to create a latex layout for a cookbox, that I want to make. I have trouble however, trying to create 2 textboxes right next to each other as you can see. In my layout I create 2 minipages next to each other and the headlines of them look fine, however the text does not quite match what I want. First of all: the lines of the left box do not break, they break when the text reaches the very end of the page. Secondly, the text of the left box starts way below the title, right under the list of the right box? And thirdly, I defined "Zubereitung" which means preparation as #8 and "Zuaten" (ingredients) as #9, in my file for the recipe I put the instructions in #8 just like in the layout but it appears under the wrong one? I could just change the headlines, however I try to understand why that happens. Please help, it is driving me crazy, thanks!! I thought about trying parbox instead of minipage but I have also read, that you can not use enumerate in parbox? How can I make the 2 boxes "Zubereitung" (preparation) and Zutaten "ingredients" look clean next to each other?? \usepackage[a4paper,margin=2.2cm]{geometry} \usepackage{graphicx} \usepackage{xcolor} \usepackage{fontawesome5} \usepackage{parskip} \usepackage{tcolorbox} \usepackage{titlesec} % Keine Kapitelnummern \titleformat{\chapter}[display] {\Huge\bfseries} {} {0pt} {\Huge} % Kopf- und Fußzeilen ausschalten \pagestyle{plain} \definecolor{recipegreen}{RGB}{39,90,48} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\recipe}[9]{% \typeout{TEST TEST TEST} \clearpage \thispagestyle{empty} %========================================================== % Oberer Teil %========================================================== \noindent \begin{minipage}[t]{0.58\textwidth} \vspace{0pt} \includegraphics[ width=\linewidth, height=0.50\textheight, keepaspectratio ]{#2} \end{minipage} \hfill \begin{minipage}[t]{0.37\textwidth} \vspace{0pt} {\Huge\bfseries\color{recipegreen} #1} \vspace{1cm} {\large\faClock\quad #3} \vspace{0.4cm} {\large\faFire\quad #4} \vspace{0.4cm} {\large\faUserFriends\quad #5} \vspace{0.4cm} {\large\faGlobe\quad #6} \vspace{1cm} \begin{tcolorbox}[ colback=gray!8, colframe=gray!20, boxrule=0.3pt, arc=2mm] #7 \end{tcolorbox} \end{minipage} \vspace{1cm} %========================================================== % Unterer Teil %========================================================== \noindent \begin{minipage}[t]{0.58\textwidth} {\Large\bfseries Zubereitung} \vspace{0.5cm} #8 \end{minipage}\hfill \begin{minipage}[t]{0.37\textwidth} {\Large\bfseries Zutaten} \vspace{0.5cm} #9 \end{minipage} } \recipe {Shakshuka} {rezepte/shakshuka.jpg} {10 Minuten} {20 Minuten} {2 Personen} {Naher Osten} {Ein Frühstück das aus den mittleren Osten stammt. Es basiert auf einer gewürzten Tomaten-Paprika Basis mit gekochten Eiern.} { \begin{enumerate} \item schneiden daus idasdasdadas das das das ads das dassad \item kochen \item essen \end{enumerate} } { \begin{itemize} \item 1 Paprika das adsad s das das das das das das das ads sda das das dasd asd as da dsa dasd das das das dasd asd as dasd \item 3 Tomaten \item 5 Eier \end{itemize} }

  • How to easily draw and parameterize various pH titration curves (including diprotic/dibasic) for a beginner?
    by user446526 on August 6, 2026 at 8:23 am

    I am a complete beginner when it comes to drawing complex functional plots in LaTeX. I am trying to create several types of pH titration curves for a document, but I am struggling to write the code from scratch. I found a very helpful French website that seems to have the exact mathematical logic and LaTeX code for what I need: https://www.astrolabe-science.fr/courbes-titrages-acido-basiques-latex/ However, as a beginner, I find it quite difficult to extract just the essential parts to create a simple, easily editable template. I need to recreate the following types of curves (I have attached images of what I am aiming for): The 4 basic monoprotic titrations: Strong Acid, Strong Base, Weak Acid, and Weak Base. Diprotic acid titration: A curve with two equivalence points (increasing pH). Dibase titration: A curve with two equivalence points (decreasing pH). My request: Could someone help provide a simplified, beginner-friendly pgfplots (or TikZ) template based on the math from that website? Ideally, I am looking for a code structure where the main parameters (like initial concentrations, volumes, and pK_a values) are defined at the top so I can easily change them. It would be incredibly helpful if you could include brief comments/instructions inside the code explaining how to switch between the different types of curves (e.g., "change this sign for a base", "uncomment this for a diprotic acid"). Thank you so much for your time and help! I have attached images of what I am aiming for.

  • \documentclass[14pt]{extarticle} does not seem to work with \DeclareMathSizes{14}{14}{7}{4}
    by D G on August 6, 2026 at 5:52 am

    \documentclass[14pt]{extarticle} \usepackage{amsmath} \DeclareMathSizes{14}{14}{7}{4} \begin{document} $x_P=1$ does not produce the expected output. \end{document}

  • How to work sidenote in solution environment [closed]
    by 조문수 on August 6, 2026 at 3:14 am

    I would like to know how to use sidenotes in the solution environment as well. The solution environment I created is similar to an amsthm proof, and the source code is as follows: % sidenote settings \newcommand{\sidenote}[1]{% \refstepcounter{sidenote}\mbox{\textsuperscript{\arabic{sidenote}}} \marginpar{\footnotesize\mbox{\textsuperscript{\arabic{sidenote}}}% \sffamily\scriptsize\, #1} } \newcounter{sidenote} Sidenotes work well in regular paragraphs. What I want is for sidenotes to function normally in both the proof and solution environments. I ask for help from experts.

  • How to make \imath and \jmath to obey math alphabet changes?
    by mathrm alpha on August 5, 2026 at 11:15 pm

    I discovered that \mathrm and \mathnormal (the default math symbol font) both have dotless i and j characters, but because their TeX font encodings for dotless i and j don't match, characters like \mathrm{\imath} and \mathrm{\jmath} don't work. The dotless i and j glyphs are encoded in slots '020 and 021 in OT1, while \imath and \jmath are encoded in slots "7B and "7C, So even if I try \DeclareSymbolFont{it}{OT1}{cmr}{m}{it} \DeclareMathSymbol{\imath}{\mathord}{it}{'020} \DeclareMathSymbol{\jmath}{\mathord}{it}{'021} This makes \mathrm{\imath} or \mathrm{\jmath} truly become upright style \imath, \jmath, it also retains the original italic style of \imath and \jmath. However, since cmmi10 is a mathematical italic font, its spacing will differ from that of cmti10, which is the \mathit style.

  • Empty Clef is not working on Musixtex
    by ABV on August 5, 2026 at 10:41 pm

    It is needed to use Empty Clef, but it is not working on Musixtex. The basic code is as follow: \documentclass[% border={2pt -11pt 90pt 8pt},% left bottom right top %border=8pt varwidth]{standalone}% Ejemplo 28 \usepackage{tikz} \usetikzlibrary{positioning} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \usepackage{amsmath} \usepackage{xcolor} \xdefinecolor{red-undar}{RGB}{179,35,79} \xdefinecolor{naranja}{RGB}{246,146,30} \xdefinecolor{conchevino}{RGB}{179,35,79} \xdefinecolor{plomoOscuro}{RGB}{52,52,52} \begin{document} \begin{music} \hsize=1.25\linewidth% \resetlyrics \setlyrics{AcordesB}{\B I \B II \B I \B II \B I \B IV \B IV6 \B II I\raisebox{0.5ex}{\bfseries\musFig[l]{{7} {\noFig}}} \B I \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{5} {6}}} \B I6 \B VII\raisebox{-.1ex}{\bfseries\musFig[l]{{3} {4}}} \B I6}% \setlyrics{AcordesA}{\B 8 \B Np \B 5 \B Np \B 5 \B 5 \B Np \B 8 \B Np \B 6 \B 3 \B 8 \B 6 \B Np \B 5 _} %\setsongraise{1}{1.5cm} %\setsongraise{2}{2.5cm} \lyrraisemulti{1}{2}{a -1.9cm} \font\A=phvb8t at 10pt% added for letter type. \font\B=phvb8t at 13pt% added for letter type. \parindent0mm \sepbarrules \generalsignature{0} %\generalmeter{\meterfrac{2}2} \instrumentnumber{1} \interstaff{10}%espacio entre pentagramas del piano \setclef{1}{61}%Clave de Do en 1ra linea \setstaffs1{2}% \nobarnumbers% \startpiece% \A\assignlyricsmulti{1}{2}{AcordesA}%,AcordesX,AcordesY,AcordesB} \A\assignlyricsmulti{1}{1}{AcordesB}%,AcordesX,AcordesY,AcordesB} \Notes\qsk\wh{J}\zcharnote{33}{\hspace{0.5cm}\begin{tikzpicture} \node (point) at (0,0)[text width=24mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Apertura 8va}}}; \end{tikzpicture}}\zcharnote{0}{\hspace{-0.65cm}\begin{tikzpicture} \node (point) at (0,0)[text width=16mm,align=center] {\textcolor{red-undar}{\A\textbf{}}}; \draw[line width=2pt,draw=red-undar] (0.118,2.27) -- ++(0.1,0)-- ++(0,-2.2)-- ++(-0.1,0); \end{tikzpicture}}% |\qsk\hp\hl{j}\en\bar% \notes\wh{K}|\ql{ih}\hl{i}\en\bar \NOtes\sk|\sk\en\doublebar% \setclef18\zchangeclefs % apply empty clef (no space) \setclef{1}{61}\changeclefs% \notes\wh{J}\zcharnote{33}{\hspace{0.5cm}\begin{tikzpicture} \node (point) at (0,0)[text width=27mm,align=center, fill=naranja!10, inner sep=2pt, draw=naranja, line width=1.5pt] {\textcolor{red-undar}{\B\textbf{Apertura 5ta}}}; \end{tikzpicture}}|\qp\ql{gnm}\en\bar% \notes\wh{L}\zcharnote{-3}{\hspace{-4.2cm}\begin{tikzpicture} \node (point) at (0,0)[text width=16mm,align=center] {\textcolor{red-undar}{\A\textbf{}}}; \draw[line width=2pt,draw=red-undar] (0.118,2.27) -- ++(0.1,0)-- ++(0,-1.9)-- ++(-0.1,0); \end{tikzpicture}}% |\ql{lkj}\qsk\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece \end{music} \end{document} The current output is as follow: The desired output is as follow:

  • Latest kernel breaks `xeCJKfntef`'s highlight? [closed]
    by Explorer on August 5, 2026 at 5:56 pm

    Here below is my MWE: % `xelatex` needed \listfiles \documentclass{article} \usepackage[fontset=fandol]{ctex} \usepackage{xcolor} \usepackage{xeCJKfntef} \begin{document} \CJKunderanyline*{0.5ex}{\color{yellow}\rule{2pt}{2.5ex}}{虚室生白,吉祥止止} \end{document} I run tlmgr update today, and I guessed that the latest kernel that cause this bug: *File List* article.cls 2025/01/22 v1.4n Standard LaTeX document class size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ctex.sty 2026/07/14 v2.6.4 Chinese adapter in LaTeX (CTEX) expl3.sty 2026-07-20 L3 programming layer (loader) l3backend-xetex.def 2026-02-18 L3 backend support: XeTeX ctexhook.sty 2026/07/13 v2.6.4 Document and package hooks (CTEX) ctexpatch.sty 2026/07/13 v2.6.4 Patching commands (CTEX) fix-cm.sty 2020/11/24 v1.1t fixes to LaTeX ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file ctexopts.cfg 2026/07/13 v2.6.4 Option configuration file (CTEX) ctex-engine-xetex.def 2026/07/15 v2.6.4 XeLaTeX adapter (CTEX) xeCJK.sty 2026/07/22 v3.10.4 Typesetting CJK scripts with XeLaTeX xtemplate.sty 2025-10-09 L3 Experimental prototype document functions fontspec.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX xparse.sty 2025-10-09 L3 Experimental document command parser fontspec-xetex.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX fontenc.sty 2025/07/18 v2.1d Standard LaTeX package fontspec.cfg xeCJK.cfg 2026/07/22 v3.10.4 Configuration file for xeCJK package zhnumber.sty 2022/07/14 v3.0 Typesetting numbers with Chinese glyphs zhnumber-utf8.cfg 2022/07/14 v3.0 Chinese numerals with UTF8 encoding ctex-scheme-chinese.def 2026/07/13 v2.6.4 Chinese scheme for generic (CTEX) ctex-name-utf8.cfg 2026/07/13 v2.6.4 Caption with encoding UTF-8 (CTEX) indentfirst.sty 2023/07/02 v1.03 Indent first paragraph (DPC) ctex-c5size.clo 2026/07/14 v2.6.4 c5size option (CTEX) ctex-fontset-fandol.def 2026/07/22 v2.6.4 Fandol fonts definition (CTEX) ctex.cfg xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration xetex.def 2025/11/01 v5.0p Graphics/color driver for xetex mathcolor.ltx xeCJKfntef.sty 2026/07/22 v3.10.4 xeCJK font effect ulem.sty 2019/11/18 *********** Anyone knows what happened? And any possible solution to fix this?

  • Fast and feature-complete LaTeX formatters
    by Akira on August 5, 2026 at 3:10 pm

    I am looking for a LaTeX formatter that is both fast and feature-complete. By being fast, I mean it can format a very large tex file (e.g., more than 30,000 lines) in under a second. By being feature-complete, I mean it can handle nested alignment environments. For example, given \begin{align}a&= \begin{aligned}&b + c \\ & d + f\end{aligned} \\ g&= h\end{align} I would expect the formatter to produce something like \begin{align} a & = \begin{aligned} & b + c \\ & d + f \end{aligned} \\ g & = h \end{align} My motivation: I use VSCode where I configure latexindent to format a tex file whenever I save the changes. That being said, I format a tex file multiple times during an edit. Due to this frequent usage, I can feel the delay when using latexindent even on an average tex file I am aware of the following tools: latexindent is mature and feature-complete, but it is not fast enough for large files. For example, it takes about 25 seconds to format this paper source (36,192 lines), as discussed in this issue. tex-fmt is very fast (being implemented in Rust), but it does not yet handle the above example. It formats \begin{align}a&= \begin{aligned}&b + c \\ & d + f\end{aligned} \\ g&= h\end{align} as \begin{align}a&= \begin{aligned}&b + c \\ & d + f \end{aligned} \\ g&= h \end{align} Are there LaTeX formatters that satisfy both of these requirements?

  • How to position some text independent of document flow?
    by lindes on August 5, 2026 at 4:41 am

    I'm relatively new to LaTeX, but... I very much suspect it's a decent tool for what I'm trying to do, but I'm having trouble quite getting the behavior I want. My goal is to create a cover, on a5 paper (ultimately, I'll print 2 on a single sheet of A4 paper), to wrap around an a6-sized booklet (the contents of which I've already created, using just pandoc, and thus LaTeX only implicitly). I've found ways to get two-column text that gets me the basics of things (and also a background image, not shown here), but I'd like to also put some text along what amounts to the spine of the booklet, but I'm having troubles getting the positioning of that correct. Here's what I've got so far (including adding showframe just for debugging purposes): \documentclass[a5paper,landscape]{article} \usepackage{rotating} % sideways, turn \usepackage{multicol} % columns \setlength{\columnsep}{1cm} \usepackage[left=0.5cm,right=0.5cm,top=2cm,bottom=2cm,showframe]{geometry} \pagenumbering{gobble} \begin{document} \begin{multicols}{2} \begin{center} Text here for the back cover... \end{center} \columnbreak \begin{center} {\huge A title here} \vspace{2cm} {\large And a subtitle} \end{center} \end{multicols} \makebox[\textwidth][c]{ \begin{turn}{270} Spine text ends up after subtitle... \end{turn} } \end{document} Which generates this: My hope was that the "S" of the "Spine text..." part would start at the same line as the top of the "A" in "A title here", but instead it seems to come at the roughly the same vertical position (acually a little lower, even) on the page as I'd get if I added another line of text... and if I indeed do that, it goes even lower. So, clearly its getting its positioning information from the other stuff on the page. I presume this is because it's in "Paragraph mode". Because I'm still new to LaTeX, though, I'm not sure what I would need to do to get this either into a different mode, or reset the positioning, or treat this as a third (middle) column, of a much narrower width, or... something I haven't even thought of, yet, perhaps. Any solutions (perhaps a different \documentclass, or adding some other packages, or what have you) would be appreciated. (Especially if they can also get me a simpler page layout -- without the space for headings and such that I see thanks to showframe.) Perhaps something to create a minipage with absolute positioning on the page? Or to just position that one line of text? Anyway, something to a least treat the spine text as somehow separate, positioning-wise, from the rest. I've dug around on this site and various others, and tried a few things, but not yet found something that I've been able to figure out how to apply to the challenge at hand. Hopefully that can soon change. 🙂 Thanks!

  • How to get the exact width of a tabbing row?
    by mbert on August 4, 2026 at 9:14 pm

    In source2e, the box \@curline is described as the contents of current line, excluding left margin skip, and excluding contents of current field Thus I would expect that the width of \@curline in the last field would be everything up to but not including the last field. This is almost correct, but it seems this width is slightly larger than expected. Here's an example. \documentclass{article} \newlength{\firstrowlen} \newlength{\secondrowlen} \begin{document} \makeatletter \begin{tabbing} some text \= some more text \= even more text \= blub \`\global\firstrowlen=\wd\@curline \\ abc \> def \> ghi \> jkl \`\global\secondrowlen=\wd\@curline \end{tabbing} \noindent \raisebox{36pt}[0pt]{\rule{\firstrowlen}{1pt}} \noindent \raisebox{36pt}[0pt]{\rule{\secondrowlen}{1pt}} \end{document} As can be seen, the length of the rules, which are the width of \@curline from each row, extend slightly farther than the actual content. It seems they extend the same amount for both rows. What is this extra amount and where is it coming from? I could not seem to figure this out from the code in source2e.

  • table column heading bottom alignment - tabularray
    by MadyYuvi on August 4, 2026 at 2:33 pm

    I need to align the column heads are in base alignment format, my tags are: \documentclass{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewColumnType{W}[1]{>{\raggedright\hangindent=1em\arraybackslash}p{#1}}% \begin{tblr}{@{}XW{20pc}@{}} \toprule \SetCell[c=1]{l} Variable & \SetCell[c=1]{l} Sources\break Bottom\\ \midrule \SetCell[c=2]{c} \textit{Supply variables}\\ Entry of new nonprofits & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit employees & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ Nonprofit financials & The influence of industry structure on the countries innovation capacity has been examined under three types of agglomeration externalities\\ \bottomrule \end{tblr} \end{document}

  • Multiple cross-references with only hyperref
    by Akira on August 4, 2026 at 11:27 am

    I have a tex file \documentclass{article} \usepackage{amsthm} \usepackage{mathtools} % before hyperref \mathtoolsset{showonlyrefs} \usepackage[hypertexnames=false]{hyperref} \hypersetup{ colorlinks=true, linkcolor=blue, filecolor=blue, urlcolor=red, citecolor=magenta } \begin{document} \begin{align} B & = C , \label{thm:eq1} \\ X & = Y . \label{thm:eq4} \end{align} We have \eqref{thm:eq1,thm:eq4} and \autoref{thm:eq1,thm:eq4}. \end{document} Both cleveref and zref-clever seem not to be maintained anymore. So I would like to stick to hyperref. Can \eqref{thm:eq1,thm:eq4} and \autoref{thm:eq1,thm:eq4} produce Equations (0.1) and (0.2)? I am aware of the solution in Multiple references with \autoref, which is 15 years old. I wonder if recent development is able to provide a simpler solution.

  • Only prevent line breaks if text fits within one line
    by Rincewind on August 4, 2026 at 10:30 am

    I am trying to define a command which I do not want to line break if possible. I know this can be done by wrapping the entire command into an \mbox command. However, I may use this command with very long arguments which cannot fit into a single line. But as far as I am aware \mbox will prevent line breaks even if the argument is longer than one line. Is there a way to prevent line breaks only if the argument can fit within one line or do I have to define two separate commands, one that allows line breaking and one that does not? Edit: Here is a smallish example \documentclass[a4paper]{article} \newcommand{\ProdType}[2]{#1 \times #2} \newcommand{\Pair}[2]{{(#1,\mkern2mu#2)}} \newcommand{\Sum}[2]{{#1 \mathop{+} #2}} \newcommand{\AnnotateType}[2]{#1_{#2}} \newcommand{\SumType}[2]{#1 + #2} \newcommand{\listT}[1][\tau]{list~#1} \newcommand{\type}{\AnnotateType{(\SumType{\AnnotateType{unit}{\emptyset}}{\AnnotateType{(\ProdType{\tau}{\AnnotateType{\listT}{D}})}{\emptyset}})}{\emptyset}} \begin{document} This text defines a reasonably long type namely the type $\type$ that is broken up against my will. On the other hand if I mbox it, it is not broken up, even if it needs to be: \mbox{$\Pair{\SumType{\Pair{\type}{\type}}{\Pair{\type}{\type}}}{\SumType{\Pair{\type}{\type}}{\Pair{\type}{\type}}}$}. \end{document}