• Vertical alignment of equations inside tabularx
    by Andi Bauer on December 4, 2025 at 8:34 pm

    I'm trying to put multiple numbered equations into one line to save space. One way to do this is to put the equations inside a tabularx table. However, when I try to put an equation environment inside a tabularx the vertical alignment is off: \documentclass{article} \usepackage{tabularx,amsmath} \begin{document} \begin{equation*} \begin{tabularx}{\textwidth}{m{0.4\textwidth}m{0.4\textwidth}} \begin{equation} \begin{pmatrix}1\\2\\3\end{pmatrix} \end{equation} & \begin{equation} x \end{equation} \end{tabularx} \end{equation*} \end{document} produces As you can see, the vertical alignment between the two labels (1) and (2) is slightly off. I've not been able to figure out what latex aligns in this case, it seems erratic to me. Changing the column type from m to p or b didn't fix the problem.

  • TikZ word search diagram v2
    by yannis on December 4, 2025 at 7:16 pm

    As a continuation of TikZ word search diagram here is the problem I'm facing. I did what Explorer suggested and it worked fine except that my rounded rectangles look like sausages or like Hieroglyphic cartouches because at their narrow ends they have lines on the secondary axis: Here is the code: \documentclass{article} \usepackage[cmyk]{xcolor} \definecolor{myPB}{cmyk}{0.85,0.75,0,0} \definecolor{myLB}{cmyk}{0.1,0.06,0,0} \usepackage{tikz} \usetikzlibrary{matrix,backgrounds} \newlength{\mydrawlinewidth} \setlength{\mydrawlinewidth}{1pt} \NewDocumentCommand{\markA}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5, line width=2pt,myPB,fill=myLB] ([xshift=5pt,yshift=-5pt]yannis-#2.north west) rectangle ([xshift=-5pt,yshift=5pt]yannis-#3.south east); } \NewDocumentCommand{\markB}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([yshift=2pt]yannis-#2.north) -- ([xshift=2pt]yannis-#3.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#2.west) -- cycle; } \NewDocumentCommand{\markC}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([xshift=2pt]yannis-#2.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#3.west) -- ([yshift=2pt]yannis-#2.north) -- cycle; } \begin{document} \begin{tikzpicture} \matrix (yannis) [% matrix of nodes,% column sep=0mm,% row sep=0mm, nodes={ % draw, rectangle,anchor=center, line width=0.5pt, inner sep=2pt,outer sep=0pt, %font=\bfseries\huge, minimum size=1.1cm, } ] { S & G & A & Q & Q & T & C & E & F & R & E & P & Y & W & R \\ W & L & Q & E & L & B & A & R & A & P & M & O & C & E & L \\ Y & I & T & S & X & E & L & I & Y & A & H & U & W & R & A \\ B & K & E & E & Y & C & W & L & J & T & M & A & K & B & F \\ J & E & R & I & O & R & T & M & K & E & R & L & Q & E & T \\ P & N & P & L & S & B & R & W & H & D & U & U & E & H & E \\ E & E & R & R & E & W & V & S & S & M & L & N & K & E & R \\ H & S & E & E & H & T & A & P & H & Y & S & I & C & A & L \\ S & S & T & D & S & H & E & U & Q & V & L & V & R & Z & I \\ O & R & N & N & I & F & L & L & A & S & N & E & E & K & F \\ M & T & I & U & N & L & G & E & P & H & U & R & A & S & E \\ W & K & O & Q & U & P & U & H & A & M & G & S & T & M & I \\ A & F & A & R & P & J & M & S & L & R & O & E & E & H & C \\ B & X & H & C & A & I & H & S & A & M & S & C & D & F & G \\ I & P & R & O & P & H & E & T & S & N & S & I & F & X & Q \\ }; \begin{scope}[on background layer] \markA{1-6}{1-12} \markA{1-14}{6-14} \markC{1-15}{7-9} \markA{2-2}{9-2} \markA{2-4}{2-13} \markA{3-3}{11-3} \markA{3-4}{11-4} \markA{3-6}{3-12} \markA{3-15}{11-15} \markC{4-11}{9-6} \markA{6-5}{13-5} \markA{6-12}{13-12} \markA{7-1}{11-1} \markB{7-5}{14-12} \markA{8-8}{8-15} \markA{8-13}{14-13} \markB{10-7}{15-12} \markB{11-2}{15-6} \markA{14-3}{14-10} \markA{15-2}{15-9} \end{scope} \end{tikzpicture} \end{document} How can I fix this? @mickep I replaced the snippets by a complete minimal example.

  • In `zref-clever` global options ovverride local ones
    by Máté Wierdl on December 4, 2025 at 4:43 pm

    Some global options to zref-clever override a local one. This seems to contradict the documentation which says "zcsetup has local effects, so it can be issued inside the respective environments for the purpose." Here is an example for the options cap and abbrev \documentclass{article} \usepackage{zref-clever} \zcsetup{nocap,noabbrev,reftype=lemma} % \AddToHook{env/theorem/begin} % {\zcsetup{cap,abbrev,reftype=equation}} \newtheorem{theorem}{Theorem} \begin{document} \begin{theorem} \zcsetup{cap,abbrev,reftype=equation} \label{thm:1} We have $a=b$ \end{theorem} Setting \verb!cap! and \verb!abbrev! as direct options to \verb!\zcref! works: \zcref[cap,abbrev]{thm:1}, but otherwise it has no effect: \zcref{thm:1}. On the other hand, \verb!reftype! does work locally. \end{document} I remark that what I originally wanted to do was setting cap=true globally but nocap,abbrev for all equation and similar environments. I still don't know how to do that. If I set nocap,abbrev globally then figure is also affected.

  • Using acronyms in longtable causes a warning
    by jonnybolton16 on December 4, 2025 at 4:36 pm

    When using acronym commands inside a longtable alongside cleveref , I get the warning Label(s) may have changed. Rerun to get cross-references right., however clearing the cache / rerunning the compile doesn't fix it. It appears the problem is caused by a repeated use of the acronym inside the table, when it hasn't been used before the table but is subsequently used after it. Is there any way to fix this? \documentclass{article} \usepackage[parfill]{parskip} \usepackage{acronym} \usepackage{hyperref,cleveref} \usepackage{longtable} \usepackage{booktabs} \makeatletter \newcommand*{\org@overidelabel}{} \let\org@overridelabel\AC@verridelabel \renewcommand*{\AC@verridelabel}[1]{% \@bsphack \protected@write\@auxout{}{\string\AC@undonewlabel{#1@cref}}% \org@overridelabel{#1}% \@esphack }% \makeatother \begin{document} \section*{List of Abbreviations} \begin{acronym} \acro{ABC}{Australian Broadcasting Corporation} \acro{BBC}{British Broadcasting Corporation} \acro{CBC}{Canadian Broadcasting Corporation} \end{acronym} \section{Latex warning} The presence of acronyms in \Cref{tab:mylabel} causes Latex to produce the following warning: \textit{Label(s) may have changed. Rerun to get cross-references right.} Clearing the cache and rerunning has no effect. % In the table below, there is a repeated use of the \ac{BBC} acronym, % but there is only one use of the \ac{ABC} acronym; with both % acronyms in use here. There are also two uses of the CBC acronym in % the table, but that hasn't been used here. The problem is the % combination of the use of \ac{BBC} outside of the table, together % with two uses of it inside the table. Because \ac{ABC} is only used % once in the table, there is no warning. Similarly, because CBC is % not used outside the table, there is no warning. However, note that % because this paragraph comes before the table, the use of \ac{BBC} % before the table removes the warning. Commenting out this paragraph % causes the warning to appear. \begin{longtable}{ll} \caption{My caption.} \label{tab:mylabel}\\ Acronym & Meaning\\ \midrule \endfirsthead \multicolumn{2}{@{}l}{\small{Table \thetable{} (continued)}}\\ Acronym & Meaning\\ \midrule \endhead \multicolumn{2}{r@{}}{\footnotesize{(continued on next page)}}\\ \endfoot \endlastfoot \acs{ABC} & Australian Broadcasting Corporation\\ \acs{BBC} & \acl{BBC}\\ \acs{CBC} & \acl{CBC} \\ \end{longtable} In the table above, there is a repeated use of the \ac{BBC} acronym, but there is only one use of the \ac{ABC} acronym; with both acronyms in use here. There are also two uses of the CBC acronym in the table, but that hasn't been used here. The problem is the combination of the use of \ac{BBC} outside of the table, together with two uses of it inside the table. Because \ac{ABC} is only used once in the table, there is no warning. Similarly, because CBC is not used outside the table, there is no warning. (commenting out the \ac{BBC} line of the table proves this). \end{document}

  • During (expl3) *-map_inline, get the index of the considered item without any auxiliary integer
    by Denis Bitouzé on December 4, 2025 at 3:29 pm

    In the following MCE, I apply to every item stored within the \l_tmpa_clist clist an inline function that displays this item preceded by its index (its position in the list). For this index, an auxiliary integer is manually incremented at each item considered: \documentclass{article} \begin{document} \ExplSyntaxOn \clist_set:Nn \l_tmpa_clist {Foo,Bar,Baz} The~ \verb|\l_tmpa_clist|~ list~ has,~ as: \begin{itemize} \clist_map_inline:Nn \l_tmpa_clist { \int_incr:N \l_tmpa_int \item element~ \# \int_use:N\l_tmpa_int :~ #1 } \end{itemize} \ExplSyntaxOff \end{document} My question, not restricted to clists' mapping, is as follows: during *-map_inline, is it possible to access to the index of the considered item without the need to resort an auxiliary integer?

  • is it possible to keep the space when using url in latex
    by Dolphin on December 4, 2025 at 2:10 pm

    when facing the text in latex: Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser it could not wrap properly, so I tried to put the text with \url like this: \url{Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser} but the space was moved automatically. is it possible to keep the space? this is the full reproduce demo: \documentclass{article} \usepackage{xurl} \usepackage{hyperref} \usepackage{path} \begin{document} hello world!12\url{Receiver class org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient does not define or inherit an implementation of the resolved method 'abstract org.springframework.cloud.client.ServiceInstance choose(java.lang.String, org.springframework.cloud.client.loadbalancer.Request)' of interface org.springframework.cloud.client.loadbalancer.ServiceInstanceChooser} \end{document} this is the result has no space: I also tried to use \href command, still did not work.

  • Float too large with minipage of \textheight
    by schtandard on December 4, 2025 at 12:38 pm

    I sometimes want to put the content of a float on a page by itself and control the alignment in the usual type area. To do this, I use a minipage that has exactly the size \textwidth x \textheight. However, depending on the content (and the packages loaded), I get Float too large warnings. In the following example, both figures contain only a minipage with some text in them, the second one additionally has a footnote. For the first one I get a warning about the float being too large by 1.94397pt, for the second one by 2.85002pt. If I remove \usepackage[T1]{fontenc}, the first warning goes away, but the second stays. If I switch to LuaLaTeX, the first warning is back, this time about 2.06pt. Why does the minipage not perfectly fit the type area and how can I fix this? Why does it even depend on the minipage's content? I would have thought the whole point of a fixed-height minipage is that the height is, well, fixed. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lipsum} \begin{document} Hello World! \begin{figure}[p] \begin{minipage}[b][\textheight]{\textwidth} \lipsum[1] \end{minipage} \end{figure} \begin{figure}[p] \begin{minipage}[b][\textheight]{\textwidth} \lipsum[1]\footnote{test} \end{minipage} \end{figure} \end{document}

  • Using beamer notes near a minted block makes font color white [duplicate]
    by bobismijnnaam on December 4, 2025 at 12:38 pm

    As the title says. I've got the following repro: \documentclass{beamer} \usepackage{minted} \setbeameroption{show notes on second screen=right} \begin{document} \frame{} \begin{frame}[fragile] \begin{minted}{c} char XXXX; \end{minted} \end{frame} \end{document} Output 1 with pdflatex --shell-escape: Output 2 with xelatex --shell-escape: I expect output 1 to be the "right" one, but maybe I'm wrong and the standard settings should cause "XXXX" to be colored white. If I remove the first empty frame, the text becomes regular grey. Is this something I can (should?) resolve with configuration, or might it be a subtle bug? I tested this with Overleaf's 2025 pdflatex and xelatex runners.

  • How to both use and pass on an option in a package
    by dedded on December 4, 2025 at 12:11 pm

    I can't figure out how to both use an option in a package and pass it to a second package. This will store to \cmdA in mwe_pkgA, but will not pass to mwe_pkgB: % -------------------------------- % mwe_pkgA.sty \ProvidesPackage{mwe_pkgA} \providecommand\cmdA{default-A} \DeclareKeys{ optA.store = \cmdA, } \PassOptionsToPackage{optA}{mwe_pkgB} \ProcessKeyOptions \RequirePackage{mwe_pkgB} \endinput This will pass optA to mwe_pkgB, but how can I also store to \cmdA in mwe_pkgA?: % -------------------------------- % mwe_pkgA.sty \ProvidesPackage{mwe_pkgA} \providecommand\cmdA{default-A} \DeclareKeys{ optA.code = \PassOptionsToPackage{\CurrentOption}{mwe_pkgB} } \ProcessKeyOptions \RequirePackage{mwe_pkgB} \endinput The mwe_pkgB.sty: % -------------------------------- % mwe_pkgB.sty \ProvidesPackage{mwe_pkgB} \providecommand\cmdB{default-B} \DeclareKeys{ optA.store = \cmdB, } \ProcessKeyOptions \endinput The document loading mwe_pkgA.sty: % -------------------------------- % mydoc.tex \documentclass{article} \usepackage[optA=newA]{mwe_pkgA} \begin{document} cmdA: \cmdA cmdB: \cmdB \end{document}

  • Embedding Arabic using polyglossia and lualatex
    by MJM on December 4, 2025 at 11:19 am

    I am trying to make a document with English and Arabic letters. Due to package support, I need to use PDFLaTeX or LuaLaTex. I have Amiri and Noto Sans Arabic installed, but when I use the \begin{arabic} command I get an error about a missing number. Here's a minimum (non)working document: \documentclass[10pt, twocolumn]{article} \usepackage{polyglossia} \setmainlanguage[variant=us]{english} \setotherlanguage{arabic} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \title{Arabic} \author{} \date{} \begin{document} \maketitle Hello world \begin{arabic}عائشة\end{arabic} \end{document} I get the following error: ! Missing number, treated as zero. <to be read again> \c@ع l.18 \begin{arabic}ع ائشة\end{arabic} ? S OK, entering \scrollmode... Missing character: There is no ا (U+0627) in font [lmroman10-regular]:+tlig;! The errors continue that the characters aren't found. What number is missing? Why are the characters not showing?

  • Diagonal Arrows Under an Equation
    by Lucy on December 4, 2025 at 10:13 am

    I need to put diagonal arrows under an equation (the red ones in the picture). I tried using \swarrow \qquad \searrow, but they are not positioned where I need them. I would prefer not to use tikzmark. Is there another way to achieve this? Thanks for your help. \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage[T1]{fontenc} \usepackage{pgfplots} \usepackage{multicol,array,tabularx,xcolor,enumitem} \usepackage{amsmath,amsfonts,amssymb,mathrsfs} \pagestyle{empty} % % % % \definecolor{modra}{cmyk}{1,0,0,0} %%%%DEFINCIE%%%%%BARVY \definecolor{cerna}{cmyk}{0,0,0,1} \definecolor{bila}{cmyk}{0,0,0,0} % %\color{modra} % \begin{document} \begin{align*} S & = \rho \cdot \dfrac{a + b +c}{2} & S & = \dfrac{a \cdot b}{2} \\ \rho \cdot \dfrac{a + b +c}{2} & = \dfrac{a \cdot b}{2} \qquad | \cdot 2 & & \\ 18 (a +b+ c ) & = a \cdot b & a & = b \\ 18 (a + a + c ) & = a \cdot a & c^2 & = a^2 + b^2 \\ 18 (2a + c ) & = a^2 & c^2 & = a^2 + a^2 = 2a^2 \\ 36 a + 18 c & = a^2 & c & = \sqrt{2a^2} = a \sqrt{2} \\ 36 a + 18 a \sqrt{2} & = a^2 & & \\ a^2 - 36 a - 18 a \sqrt{2} & = 0 & & \\ a \left( a - 36 - 18 \sqrt{2} \right) & = 0 & & \\ \Large \swarrow \qquad \searrow \end{align*} % % \end{document}

  • Is that possible to tweak the related location and scale in the nested integral formula?
    by Explorer on December 4, 2025 at 10:02 am

    My previous question's actual case is as below: In this YouTube link, it introduced a following nested integral question: Or the simpler the SAME one: The most important patterns, here, is described as below, the Recursive Formula: Now I have the following code: \documentclass[border=5pt]{standalone} \usepackage{amsmath} \usepackage{fourier} \usepackage{cmupint} \usepackage{fixdif} \parindent=0pt % \DeclareMathOperator{\myint}{\int\nolimits} \DeclareRobustCommand{\myint}{\int\nolimits} \newcommand{\basicint}{\myint_0^1xdx} \newcommand{\basicintt}{\myint_{\basicint}^{\basicint}xdx} % https://tex.stackexchange.com/a/5192/322482 \makeatletter \newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}} \newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}} \makeatother \newcommand{\originintunit}{% \displaystyle\myint_{ \textstyle\myint^{0}_{\basicintt} }^{ \textstyle\myint_{1}^{\basicintt} } }% \newcommand{\intunit}[2]{% \myint_{ \myint^{0}_{\myint_{#1}^{\basicint}xdx} }^{ \myint_{1}^{\myint_{\basicint}^{#2}xdx} } } \ExplSyntaxOn % \cs_generate_variant:Nn \tl_use:N {V} \tl_new:N \l_explorer_base_tl \tl_new:N \l_explorer_tmp_tl \tl_new:N \l_explorer_script_tl \tl_new:N \g_explorer_tmp_tl \cs_new_protected:Npn \typeset_integral_recursive:Nn #1#2 { % #1:tl to store % #2:depth \group_begin: \tl_set_eq:NN \l_explorer_tmp_tl #1 \int_compare:nNnTF { #2 } = { 1 } { \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\basicint}{\basicint} } } { \tl_clear:N \l_explorer_script_tl \typeset_integral_recursive:Nn \l_explorer_script_tl { \int_eval:n { #2 - 1 } } \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\l_explorer_script_tl}{\l_explorer_script_tl} } } \tl_put_right:Nn \l_explorer_tmp_tl { xdx } \tl_gset_eq:NN \g_explorer_tmp_tl \l_explorer_tmp_tl \group_end: \tl_set_eq:NN #1 \g_explorer_tmp_tl } % \typeset_integral_recursive:Nn \l_explorer_base_tl { 4 } \NewDocumentCommand{\explorerint}{ m }{ \begingroup \typeset_integral_recursive:Nn \l_explorer_base_tl { #1 } $\l_explorer_base_tl$ \endgroup } \ExplSyntaxOff \begin{document} \explorerint{3} \end{document} But it gives the following, with no tweak of the location of subscript and superscript. I don't think in this case, l3coffin could handle better than just recursion with l3tl, but it's not easy for me, now, to tweak the sub/superscript's position, and the \int's scale, to make the final result looks more like an \int "tower". Any suggestions or perspectives would be welcome! And IMO, this question, deserved my bounty😀. I would start one in three days.

  • I would like to discretize the "tiles" into rectangular prismatic groups, sort each group, then sort the groups by each other or be shown a better way
    by Jasper on December 4, 2025 at 7:58 am

    I have built a comparator which can determine the occlusive relationship between two 0--2-dimensioal affine tiles (using their simplicial representations). In English, if I have two tiles (a tile is a point, line segment, or triangle), I can determining which one occludes the other, or if there is no occlusion (the inconclusive case). Currently, this requires an extremely expensive SCC topological sort (quadratic based on the number of tiles). I have the idea that I would like to speed this up, and I have a proposal for doing so (though, I am all ears to alternative ideas too). Basically, my idea is to partition the scene into rectangular prismatic regions (possibly with some overlap), sorting each one individually. Then, each rectangular prismatic region could use a waaay simpler sorting method on the set of rectangular prismatic region, once their constituent parts are sorted. This is my AI generated SCC topological sort routine, which has been working for ages. I am confident in it, based on it having not failed yet. How could I go about implementing this without visual artefacts from tiles which cross the boundary of two or more prisms? Alternatively, what better methods might I consider which I haven't yet? -- occlusion graph + SCC topo sort (bboxes computed on Cartesian coords) local n = #items local bboxes, graph = {}, {} for i = 1, n do bboxes[i] = { get_bbox2(items[i]) }; graph[i] = {} end for i = 1, n - 1 do for j = i + 1, n do if bboxes_overlap2(bboxes[i], bboxes[j]) then local r = cmp(items[i], items[j]) if r == true then table.insert(graph[i], j) elseif r == false then table.insert(graph[j], i) end end end end local index, stack, indices, lowlink, onstack, sccs = 0, {}, {}, {}, {}, {} for i = 1, n do indices[i], lowlink[i] = -1, -1 end local function dfs(v) indices[v], lowlink[v] = index, index; index = index + 1 stack[#stack+1] = v; onstack[v] = true for _, w in ipairs(graph[v]) do if indices[w] == -1 then dfs(w); lowlink[v] = math.min(lowlink[v], lowlink[w]) elseif onstack[w] then lowlink[v] = math.min(lowlink[v], indices[w]) end end if lowlink[v] == indices[v] then local scc = {} while true do local w = table.remove(stack); onstack[w] = false scc[#scc+1] = w if w == v then break end end sccs[#sccs+1] = scc end end for v = 1, n do if indices[v] == -1 then dfs(v) end end local scc_index, scc_graph, indeg = {}, {}, {} for i, comp in ipairs(sccs) do for _, v in ipairs(comp) do scc_index[v] = i end scc_graph[i], indeg[i] = {}, 0 end for v = 1, n do for _, w in ipairs(graph[v]) do local si, sj = scc_index[v], scc_index[w] if si ~= sj then table.insert(scc_graph[si], sj); indeg[sj] = indeg[sj] + 1 end end end local queue, sorted = {}, {} for i = 1, #sccs do if indeg[i] == 0 then queue[#queue+1] = i end end while #queue > 0 do local i = table.remove(queue, 1) for _, v in ipairs(sccs[i]) do sorted[#sorted+1] = items[v] end for _, j in ipairs(scc_graph[i]) do indeg[j] = indeg[j] - 1 if indeg[j] == 0 then queue[#queue+1] = j end end end In fact, I would also like to employ a similar strategy for partitioning, since it is also quadratic, but I think that if I saw it for occlusion, that it would be simple to re-implement for partitioning. This MWE, for example, takes ages to compile, and I believe it should be speed-up-able. This version is currently on TeXLive and MikTeX (and on CTAN), so there is no need to use the GitHub version. \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \begin{luatikztdtoolspicture}[ C1 = { {{-3,-3,0,1}} } ,C2 = { {{3,3,-10,1}} } ,light = { {{0,0,-2,1}} } ] \pgfmathsetmacro{\param}{0} \setobject[ name = {T} ,object = { matrix_multiply( matrix_multiply( euler(pi/2,pi/4+pi/4*sin(\param),5.25*pi/6+\param) ,translate(0,0,-5) ) ,matrix_multiply( { {1,0,0,0} ,{0,1,0,0} ,{0,0,1,0} ,{0,0,0,1} } ,matrix_multiply(xscale(1/2),yscale(1/2)) ) ) } ] \setobject[ name = {I} ,object = { matrix_inverse(T) } ] \appendsurface[ ustart = {-2} ,ustop = {2} ,usamples = {20} ,vstart = {-2} ,vstop = {2} ,vsamples = {20} ,transformation = {T} ,x = {u} ,y = {v} ,z = {u^4 + v^4 - 4*u*v + 1} ,fill options = { preaction = { fill = green ,fill opacity = 0.2 } ,postaction = { draw = blue ,ultra thin ,line join = round } } ,filter = { abs(matrix_multiply(A,I)[1][3])<2.01 and abs(matrix_multiply(B,I)[1][3])<2.01 and abs(matrix_multiply(C,I)[1][3])<2.01 and abs(matrix_multiply(A,I)[1][2])<2.01 and abs(matrix_multiply(B,I)[1][2])<2.01 and abs(matrix_multiply(C,I)[1][2])<2.01 and abs(matrix_multiply(A,I)[1][1])<2.01 and abs(matrix_multiply(B,I)[1][1])<2.01 and abs(matrix_multiply(C,I)[1][1])<2.01 } ] \appendsolid[ ustart = {-2} ,ustop = {2} ,usamples = {2} ,vstart = {-2} ,vstop = {2} ,vsamples = {2} ,wstart = {-2} ,wstop = {2} ,wsamples = {2} ,transformation = {T} ,x = {u} ,y = {v} ,z = {w} ,fill options = { preaction = { fill = none ,fill opacity = 0.5 } ,postaction = { draw = none ,ultra thin ,line join = round ,line cap = round } } ] \appendcurve[ ustart = {0} ,ustop = {4} ,usamples = {2} ,x = {0} ,y = {0} ,z = {u} ,transformation = {T} ,arrow tip = {true} ,draw options = { draw ,ultra thin ,line cap = round } ] \appendlabel[ x = {0} ,y = {0} ,z = {4.3} ,transformation = {T} ,name = {\(z\)} ] \appendcurve[ ustart = {0} ,ustop = {4} ,usamples = {2} ,x = {0} ,y = {u} ,z = {0} ,transformation = {T} ,arrow tip = {true} ,draw options = { draw ,ultra thin ,line cap = round } ] \appendlabel[ x = {0} ,y = {4.3} ,z = {0} ,transformation = {T} ,name = {\(y\)} ] \appendcurve[ ustart = {0} ,ustop = {4} ,usamples = {2} ,x = {u} ,y = {0} ,z = {0} ,transformation = {T} ,arrow tip = {true} ,draw options = { draw ,ultra thin ,line cap = round } ] \appendlabel[ x = {4.3} ,y = {0} ,z = {0} ,transformation = {T} ,name = {\(x\)} ] \foreach \p in {-4,-3,...,4} { \appendcurve[ ustart = {-4} ,ustop = {4} ,usamples = {2} ,x = {u} ,y = {\p} ,z = {0} ,transformation = {T} ,draw options = { draw = black!70!white ,ultra thin ,line cap = round ,densely dashed } ] \appendcurve[ ustart = {-4} ,ustop = {4} ,usamples = {2} ,x = {\p} ,y = {u} ,z = {0} ,transformation = {T} ,draw options = { draw = black!90!white ,ultra thin ,line cap = round ,densely dashed } ] } \appendsurface[ ustart = {-4} ,ustop = {4} ,usamples = {2} ,vstart = {-4} ,vstop = {4} ,vsamples = {2} ,transformation = {T} ,x = {u} ,y = {v} ,z = {0} ,fill options = { preaction = { fill = gray!70!white ,fill opacity = 0.6 } ,postaction = { draw = none ,ultra thin ,line join = round } } ] \end{luatikztdtoolspicture} \end{document}

  • The defined date command doesn't work before \today when invoking babel
    by M. Logic on December 4, 2025 at 4:41 am

    A MWS is as follows. \documentclass{ctexart} \usepackage[main=chinese, provide=*]{babel}% \babelprovide{greek} \babelfont[greek]{rm}[Scale=MatchUppercase, ItalicFont={GFSArtemisiaIt.otf}, BoldFont={GFSArtemisiaBold.otf}, BoldItalicFont={GFSArtemisiaBoldIt.otf}]{GFSArtemisia.otf} \usepackage{datetime}%after babel package \newdateformat{eightdate}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}} \title{测试} \author{佚名} \date{} \begin{document} \maketitle \verb|\today| works fine, i.e., it produces \today. While \verb|\eightdate| doesn't work before \verb|\today|, i.e., \verb|\eightdate\today| also produces \today, but I'd like \verb|\eightdate\today| to produce 20251204. \end{document} \today works fine, i.e., it produces 2025年12月4日. While \eightdate doesn't work before \today, i.e., \eightdate\today also produces 2025年12月4日, but I'd like \eightdate\today to produce 20251204. Then how to make both \today and \eightdate\today work as desired when invoking babel and datetime? Note that \usepackage[main=chinese, provide=*]{babel} is for special use.

  • Why `\raisemath` doesn't work if there exists some barriers to raise the math symbols?
    by Explorer on December 4, 2025 at 4:15 am

    I want to typeset the following formula: Now consider that TWO red boxes are in proper location towards TWO blue boxes \int. With the following code, learning \raisemath from here: \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{fourier} \usepackage{cmupint} \usepackage{fixdif} \parindent=0pt % \DeclareMathOperator{\myint}{\int\nolimits} \DeclareRobustCommand{\myint}{\int\nolimits} \newcommand{\basicint}{\myint_0^1x \d x} \newcommand{\basicintt}{\myint_{\basicint}^{\basicint} x\d x} % https://tex.stackexchange.com/a/5192/322482 \makeatletter \newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}} \newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}} \makeatother \begin{document} $\basicint$ $\basicintt$ \bigskip $ \displaystyle\myint_{ \textstyle\myint^{0}_{\basicintt} }^{ \textstyle\myint_{1}^{\basicintt} }x\d x $ \bigskip Shift to another direction, it works: $ \displaystyle\myint_{ \textstyle\myint^{0}_{\raisemath{-20pt}{\basicintt}} }^{ \textstyle\myint_{1}^{\raisemath{20pt}{\basicintt}} }x\d x $ However, look like \texttt{1} obstructs \texttt{basicintt}'s shift down, another direction's shift failed. $ \displaystyle\myint_{ \textstyle\myint^{0}_{\raisemath{20pt}{\basicintt}} }^{ \textstyle\myint_{1}^{\raisemath{-20pt}{\basicintt}} }x\d x $ \end{document} How to tune the location of \int here, to better mimic the hand-written image shown above?

  • TexStudio Disable automatic backslash in quick tabular
    by Asigan on December 3, 2025 at 11:46 pm

    In TexStudio, when I used quick tabular and typed maths like $a_n$ (see pictures), it is automatically converted to \begin{tabular}{|c|c|} \hline \$a\_n\$ & \\ \hline & \\ \hline \end{tabular} Could we disable the backslash and let the output be simply $a_n$?

  • Why is stretch glue ignored on pages with top or bottom floats?
    by Bastien on December 3, 2025 at 7:51 pm

    I am experimenting with custom page-building logic by redefining \@texttop and \@textbottom (which determine the behavior of \flushbottom and \raggedbottom), and I need to access the value of \pagestretch once LaTeX has finished assembling the page. In many cases, it work and LaTeX gives me the expected result. However, I discovered that it fails when a page contains a top float and/or a bottom float. In such pages, \pagestretch is always 0pt, even though the page contains at least one occurrence of \textfloatsep, which I set for this test to \textfloatsep = 10pt plus 100pt. Therefore I would expect a total finite stretch of at least 100 pt. The log confirms the issue. For the first page of the following MWE (which contains both a top and a bottom float), we get: ... % t=334.0 g=365.76004 b=10000 p=0 c=100000# % t=382.0 g=365.76004 b=* p=0 c=* Page 1 - page stretch: 0.0pt Page 1 - page shrink: 0.0pt Page 1 - content natural height: 526.66096pt Page 1 - page height: 556.47656pt ... The same MWE also contains h-floats and commands with positive stretch, and these do correctly contribute to \pagestretch. The issue seems specific to pages with top and/or bottom floats. My questions are: Why does \pagestretch remain zero on a page containing both a top and a bottom float? Is LaTeX using some glue other than \textfloatsep in this situation? If so, what glue is being inserted, and why does it contribute no finite stretch to \pagestretch? The MWE: \documentclass{book} \usepackage{lipsum, babel} \usepackage[showframe]{geometry} \def\myrule{\rule{\linewidth}{3cm}} \def\testA{\vspace{10pt plus 100pt} TEST A \vspace{10pt plus 100pt}} \def\testB{\vspace{10pt plus 5pt} TEST B \vspace{10pt plus 5pt}} \setlength{\floatsep}{10pt plus 100pt} \setlength{\textfloatsep}{\floatsep} \setlength{\intextsep}{\floatsep} \setlength{\parskip}{0pt} \widowpenalties 4 10000 10000 10000 0% Value for testing \clubpenalties 4 10000 10000 10000 0 \makeatletter \newbox\@currentColumnBox \def\mypagebottom{% \def\@texttop{% \setbox\@currentColumnBox = \vbox{\unvcopy\@outputbox}% \typeout{Page \the\c@page\space - page stretch: \the\pagestretch}% \typeout{Page \the\c@page\space - page shrink: \the\pageshrink}% \typeout{Page \the\c@page\space - content natural heigth: \the\ht\@currentColumnBox}% \typeout{Page \the\c@page\space - page heigth: \the\@colht}% %% TEST: % \ifdim\dimexpr \@colht - \ht\@currentColumnBox - \pagestretch > \z@\relax% % \typeout{Raggedbottom on page \the\c@page. \the\dimexpr\ht\@currentColumnBox + \pagestretch\relax\space < \the\@colht.}% % \def\@textbottom{\vskip \z@ \@plus 0.0001 fil}% % \else% % \typeout{Flushbottom on page \the\c@page. \the\dimexpr\ht\@currentColumnBox + \pagestretch\relax\space >= \the\@colht.}% % \def\@textbottom{}% % \fi% }% \def\@textbottom{}% } \makeatother \tracingpages=1 \mypagebottom \begin{document} \begin{figure}[t] \myrule \end{figure} \lipsum[1-4] \begin{figure}[b] \myrule \end{figure} \lipsum[1-3] \begin{figure}[ht] \myrule \end{figure} \lipsum[1-3] \testA \lipsum[1-6] \testB \lipsum[1-9] \end{document}

  • Dynamic calculation of part number width in the memoir table of contents
    by nowox on December 3, 2025 at 6:07 pm

    In this simple example, I have a memoir document with eight parts. By default, LaTeX doesn’t know how wide the part number in the table of contents will be. Since \cftpartnumwidth requires a fixed width, it has to be adjusted manually for every document, and updated every time I add a new part — which makes no sense. I understand the goal is to align titles, so a fixed width is reasonable, but alternatives like the tabbed environment can align entries without hard-coding lengths. Ideally, I’d like LaTeX to determine the correct width automatically, regardless of the document content. I love LaTeX, but sometimes it feels unnecessarily rigid… Here is the example: \documentclass{memoir} \begin{document} \tableofcontents* \part{First} \part{Second} \part{Third} \part{Fourth} \part{Fifth} \part{Sixth} \part{Seventh} \part{Eighth} \end{document} What currently works for me (since I generate the document programmatically) is something like: \newlength{\maxpartnumwidth} \newcounter{maxpart} \setcounter{maxpart}{8} \AtBeginDocument{% \settowidth{\maxpartnumwidth}{Part~\Roman{maxpart}} \addtolength{\maxpartnumwidth}{1em} \setlength{\cftpartnumwidth}{\maxpartnumwidth}% } But this approach is fragile: “Part” is hard-coded, and I don’t know the final font or font size, so the result may not be accurate. Is there a cleaner or more robust way to do this automatically?

  • How to reset poles of coffins with two attachment?
    by Explorer on December 3, 2025 at 5:07 pm

    I have the following code: \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_int_left_coffin \coffin_new:N \l_int_right_coffin \coffin_new:N \l_base_int_coffin \hcoffin_set:Nn \l_base_int_coffin { \myint } \coffin_new:N \l_dx_int_coffin \hcoffin_set:Nn \l_dx_int_coffin { $\d x$ } \coffin_new:N \l_tmp_coffin \coffin_set_eq:NN \l_tmp_coffin \l_base_int_coffin \coffin_scale:Nnn \l_tmp_coffin { .5 } { .5 } % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_join:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_base_int_coffin \coffin_display_handles:Nn \l_base_int_coffin {magenta} \ExplSyntaxOff \end{document} Now the poles is as below: What I want, is the GREEN coffin's border. The key code here is: % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_join:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } If I use two join, two small \int is not vertical align. I also try to make the final \l_base_int_coffin into a \fbox, together with two attach, but also failed, the border is still not what I want: \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_int_left_coffin \coffin_new:N \l_int_right_coffin \coffin_new:N \l_base_int_coffin \hcoffin_set:Nn \l_base_int_coffin { \myint } \coffin_new:N \l_dx_int_coffin \hcoffin_set:Nn \l_dx_int_coffin { $\d x$ } \coffin_new:N \l_tmp_coffin \coffin_set_eq:NN \l_tmp_coffin \l_base_int_coffin \coffin_scale:Nnn \l_tmp_coffin { .5 } { .5 } % first \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { t } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_attach:NnnNnnnn \l_base_int_coffin { r } { b } \l_tmp_coffin { l } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_base_int_coffin \hcoffin_set:Nn \l_tmpa_coffin { \fbox{\coffin_typeset:Nnnnn \l_base_int_coffin{l}{vc}{0pt}{0pt}} } \coffin_display_handles:Nn \l_tmpa_coffin {magenta} \ExplSyntaxOff \end{document} Is there elegant method to get my desired \l_base_int_coffin's border? Edit with more general case Since cfr has given a tricky r handles' solution to solve my original question, but my case has a more widely-extensive case(Let's consider that the TWO sub-coffins is not hold the some width): \documentclass{article} \usepackage{cmupint} \usepackage{fixdif} \DeclareRobustCommand{\myint}{$\displaystyle\int\nolimits$} \begin{document} \ExplSyntaxOn \coffin_new:N \l_explorer_int_left_coffin \coffin_new:N \l_explorer_int_right_coffin \coffin_new:N \l_explorer_base_int_coffin \coffin_new:N \l_explorer_dx_int_coffin \coffin_new:N \l_explorer_tmp_coffin \coffin_new:N \l_explorer_tmpA_coffin \coffin_new:N \l_explorer_tmpB_coffin \hcoffin_set:Nn \l_explorer_base_int_coffin { \myint } \hcoffin_set:Nn \l_explorer_dx_int_coffin { $\d x$ } \coffin_set_eq:NN \l_explorer_tmp_coffin \l_explorer_base_int_coffin \coffin_set_eq:NN \l_explorer_tmpA_coffin \l_explorer_base_int_coffin \coffin_set_eq:NN \l_explorer_tmpB_coffin \l_explorer_base_int_coffin \coffin_scale:Nnn \l_explorer_tmpA_coffin { .5 } { .5 } \coffin_scale:Nnn \l_explorer_tmpB_coffin { 1.5 } { .25 } % first \coffin_attach:NnnNnnnn \l_explorer_base_int_coffin { r } { t } \l_explorer_tmpA_coffin { l } { vc } { 0pt } { 0pt } % second \coffin_attach:NnnNnnnn \l_explorer_base_int_coffin { r } { b } \l_explorer_tmpB_coffin { l } { vc } { 0pt } { 0pt } % just use `r' would shift back too much, for not the same width of `\l_explorer_tmpA_coffin' and `\l_explorer_tmpB_coffin' % \coffin_join:NnnNnnnn \l_explorer_base_int_coffin { r } { b } \l_explorer_tmpB_coffin { r } { vc } { 0pt } { 0pt } \coffin_reset_poles:N \l_explorer_base_int_coffin \coffin_display_handles:Nn \l_explorer_base_int_coffin {magenta} \ExplSyntaxOff \end{document}

  • Vertical Alignment in a Longtblr Table
    by Ernest on December 3, 2025 at 4:52 pm

    I've encountered a problem with vertical alignment in cells. I hoped that everything would work automatically with X[c,m], but for some reason, this only works from row (4) onwards (highlighted in gray). The previous row consists of merged cells (2,3), and in this case, the cell contents are centered. The required result from the authors of the article: MWE: \documentclass{article} \usepackage{rotating,makecell,xcolor,biblatex} \usepackage{tabularray} \usepackage{changepage} \begin{document} \newcommand\rot[1]{\rotatebox{90}{\centering #1}} \newcommand\Tr[1]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}} \begin{adjustwidth}{-3cm}{0cm} \begin{longtblr}[ caption = {DAS ice cover experiments}, label = {tab:01}, ]{ width = 18.46cm, hlines, vlines, colspec = { X[0.3,c,m] X[0.3,c,m] X[0.7,c,m] X[0.8,c,m] X[0.4,c,m] X[0.3,c,m] X[0.5,c,m] X[0.5,c,m] X[0.8,c,m] X[3cm,c,m] X[3cm,c,m] X[1,c,m] }, % row{1} = {ht=3cm}, rowhead = 1, cell{2}{3} = {r=2}{}, cell{2}{4} = {r=2}{}, cell{2}{5} = {r=2}{}, cell{2}{6} = {r=2}{}, cell{2}{7} = {r=2}{}, cell{2}{8} = {r=2}{}, cell{2}{9} = {r=2}{}, cell{2}{10} = {r=2}{}, cell{2}{11} = {r=2}{}, cell{2}{12} = {r=2}{}, cell{5}{3} = {r=2}{}, cell{5}{5} = {r=2}{}, cell{5}{9} = {r=2}{}, cell{5}{10} = {r=2}{}, cell{5}{11} = {r=2}{}, cell{5}{12} = {r=2}{}, cell{7}{1} = {}, cell{7}{3} = {r=2}{}, cell{7}{9} = {r=2}{}, cell{7}{10} = {r=2}{}, cell{7}{11} = {r=2}{}, cell{7}{12} = {r=2}{}, cell{8}{1} = {}, cell{9}{1} = {r=2}{}, cell{9}{2} = {r=2}{}, cell{9}{3} = {r=2}{}, cell{9}{4} = {r=2}{}, cell{9}{5} = {r=2}{}, cell{9}{6} = {r=2}{}, cell{9}{7} = {r=2}{}, cell{9}{8} = {r=2}{}, cell{9}{9} = {r=2}{}, cell{9}{11} = {r=2}{}, row{4}= {gray9}, } % \rot{Time} & \rot{Duration} & \rot{Site} & \rot{\parbox{2cm}{\centering Working\\ part\\ of fiber}} & \rot{Interrogator} & \rot{Sampling} & \rot{\parbox{2cm}{Gauge\\ length}} & \rot{\parbox{2cm}{Spatial\\ sampling}} & \rot{\parbox{2cm}{\centering Additional\\ data}} & Measured parameters & Note & Reference \\ % \rot{06.2021}& \rot{7~days} & \rot{\parbox{2cm}{\centering Beaufort Sea}} & \rot{34.5~km} & \rot{Silixa iDAS} & \rot{1~kHz} & \rot{10~m} & \rot{200~m} & \rot{\parbox{2.5cm}{\centering NRT DMSP and MASIE\\ satellite data}} & Presence/absence of ice & The cable is buried in the bottom by 2--4~m. Dark fiber of the underwater cable & \parencite{35} \\ % \rot{11.2021}& \rot{7~days} & & & & & & & & & & \\ \rot{03.2012}& & \rot{\parbox{3cm}{\centering Mendota Lakes, Wisconsin, USA}} & \rot{443~m} & \rot{Silixa iDAS} & \rot{1~kHz} & \rot{10~m} & \rot{10~m} & \rot{\centering \parbox{2.5cm}{\centering Vertical and horizontal geophones}} & Estimate of capability of DAS for wave field measurement, cable comparison & {Different cables in parallel 4~times in a~triangle with a~side of 30~m. Source~-- sledgehammer} & \parencite{6} \\ % \rot{03.2020}& \rot{1~day} & \rot{\parbox{2cm}{\centering Lake Robert, France}} & \rot{200~m} & \rot{\parbox{2.5cm}{\centering A1-R (FEBUS-Optics)}} & \rot{0.5~kHz} & \rot{10~m} & \rot{0.8~m} & & Lake depth, ice thickness and Young's modulus measurements & Deployment using a drone. The cable is reinforced with kevlar & \parencite{33} \\ %% \rot{02.2021}& \rot{1~day} & \rot{} & \rot{320~m} & \rot{} & \rot{2~kHz} & \rot{2~m} & \rot{0.1~m} & & & & \\ % \rot{12.2023}& \rot{1~day} & \rot{\parbox{2cm}{\centering Hanover Ponds, New Hampshire, USA}} & \rot{\parbox{2cm}{\centering 3 lines \\ 50~m each}} & \rot{Sintela Onyx} & \rot{2.5~kHz} & \rot{3.2~m} & \rot{1.6~m} & \rot{\parbox{2cm}{\centering GPS \\ time synchronization}} & Ice thickness measurements & Source~-- Proctor hammer & \parencite{38} \\ % \rot{01.2025}& \rot{1~day} & \rot{} & \rot{100~m} & \rot{Silixa iDAS Carina IU} & \rot{5~kHz} & \rot{2~m} & \rot{0.25~m} & & & & \\ \rot{01.2023}& \rot{65~hours} & \rot{\parbox{2cm}{\centering Xiushui Reservoir, China}} & \rot{\parbox{2cm}{\centering 1.2~km in two circles}} & \rot{Ovlink DAS} & \rot{1~kHz} & \rot{2~m} & \rot{2~m} & \rot{CMG-40T seismometer} & Study of ice destruction and deformation & Sources~-- underwater air gun and sledgehammer & \parencite{52} \\ % & & & & & & & & & Evaluation of ice thickness, Young's modulus & & \parencite{53} \\ % \rot{05.2021}& \rot{3~weeks} & \rot{\parbox{2cm}{\centering Volcanic Lake, Iceland}} & \rot{12.5~km} & \rot{Silixa iDAS v2.} & \rot{0.2~kHz} & \rot{10~m} & \rot{8~m} & & Detection of volcanic tremors & Ice cover of lake- signal amplifier at a certain frequency & \parencite{10} \\ % \rot{02.2024}& \rot{1~day} & \rot{\parbox{2cm}{\centering Klyazma Reservoir, Moscow Region}} & \rot{360~m} & \rot{\parbox{2.5cm}{\centering Dunay, LLC~T8~Sensor}} & \rot{0.5~kHz} & \rot{10~m} & \rot{5~m} & \rot{See text} & Ice thickness and Young's modulus measurements. Evaluation of coiled fiber capabilities & Fiber optic rings and straight sections were used & See text \\ \end{longtblr} \end{adjustwidth} \end{document} Perhaps I took the wrong approach by rotating the rows using \rotation, but when I rotated the columns using X[c,m,cmd=\rotcell] (from the makecell package), I couldn't configure the heights automatically, so I switched to the current approach.

  • memoir: fontsize and baselineskip in the TOC
    by matteofg on December 3, 2025 at 10:13 am

    In memoir I customized the TOC, setting the sub(sub)sections to a "paragraph-style" entry. Below the mwe: % !TEX encoding = UTF-8 Unicode % !TEX program = lualatex \documentclass{memoir} \makeatletter \cftinsertcode{parasubsection}{% \renewcommand{\l@subsection}[2]{% \ifnum \c@tocdepth > 1 \leftskip=\cftsubsectionindent \rightskip=\@tocrmarg \parfillskip=\fill \begingroup \footnotesize\selectfont \def\numberline####1{####1\nobreakspace}% \ifhmode {\cftsubsectionfont\enspace} \else \noindent \fi \ignorespaces% {\cftsubsectionfont##1\string,}\nobreakspace{\cftsubsectionpagefont##2}% \ignorespaces% \endgroup \fi } \renewcommand{\l@subsubsection}[2]{% \ifnum \c@tocdepth > 2 \begingroup \footnotesize\selectfont \def\numberline####1{####1\nobreakspace}% \ifhmode {\cftsubsubsectionfont\enspace} \else \noindent \fi \ignorespaces% {\cftsubsubsectionfont##1\string,}\nobreakspace{\cftsubsubsectionpagefont##2}% \ignorespaces% \endgroup \fi } } \makeatother \AddToHook{enddocument}{\addtocontents{toc}{\par}} \cftinserthook{toc}{parasubsection} \setsecnumdepth{subsection} \settocdepth{subsubsection} \begin{document} \tableofcontents* \directlua{ for i = 1, 2 do tex.print("\\chapter{Chapter}") for i = 1, 2 do tex.print("\\section{Section}") for i = 1, 4 do tex.print("\\subsection{Subsection}") for i = 1, 2 do tex.print("\\subsubsection{Subsubsection}") end end end end } \end{document} The problem is that when I set the paragraphs in an another fontsize (e.g. \footnotesize), the corresponding \baselineskip value doesn’t change. I read that adding \selectfont should be enough, but apparently it isn’t... Also, I’m sure that \l@subsection and \l@subsubsection could be redefined in a cleaner way, code-wise :-p

  • Why does forest baseline alignment seem to stop, once drawing circles around each node?
    by MS-SPO on December 3, 2025 at 10:05 am

    Situation While working on this forest-based solution I was puzzled by the vertical alignment, once I draw circles around the nodes. So for test purposes I copied said basic tree three times: left: without any forest preamble right: preamble only names nodes (for later use) middle: also draws a circle around each node Observations Comparing left and right all characters seem to align by their baselines (light-blue). For the middle one this is more puzzling: light-pink: b, c, d seem to match baselines, but this can be accidental e and f as well, while g and i clearly don't light-blue: k, l, m, y, z seem to "do what they want" orange: there seems to be a tendency to roughly align the circles south (with content dependent size variation from Tikz) Question Actually I have two questions, which are connected like face and back of a coin: how to understand the forest-way of these vertical alignments (middle)? how to obtain baseline alignments for the nodes content (characters, light-blue) instead of the shapes south? I see that this solution seems to solve a similar problem, but honestly I'm lost at the moment in identifying the relevant alignment statements introduced. Code \documentclass[10pt,border=3mm]{standalone} \usepackage{forest} \begin{document} % ~~~ correct baselining ~~~~~~~~~~~ \begin{forest} [a, label=north:baselined [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} % ~~~ incorrect/unexpected ~~~~~~~~~~~~ \begin{forest} delay={ for tree={ name/.option=content,% now node name is same as content circle,draw, % nodes as circles, }, } [a, label=north:{well \dots} [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} % ~~~ correct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{forest} delay={ for tree={ name/.option=content,% now node name is same as content % circle,draw, % nodes as circles, }, } [a, label=north:baselined [b [e [k][l]] [f [m]]] [c [g [y][z]]] [d [i]] ] \end{forest} \end{document}

  • How to tagging documents with figures mixed latex/pdf from fig
    by user2609605 on December 3, 2025 at 7:57 am

    I want tagged pdf from latex and for that specify tagging=on in \DocumentMetatdata. I know that if including PDF figures thePic with \includegraphics, an alt text must be given like so: \includegraphics[alt=whats on the pic]{thePic} Now my problem is that I have a lot of fig pictures consisting of a kind of graphs annotated with latex text. Thus I export with fig2dev in two parts: fig2dev -L pdftex thePic.fig thePic.pdf fig2dev -L pdftex_t -p xxx thePic.fig thePic.tex The result is some thePic.tex I can include with \input{thePic} which contains a picture environment which defines the latex text directly and includes the graphics via \includegraphics{thePic.pdf}. A short latex document could be the following: \DocumentMetadata{lang=en_US,tagging=on} \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage{color} \usepackage{unicode-math} \title{On Tagging created pictures} \author{E. Reißner} \date{\today} \begin{document} \maketitle Some text. \input{thePic} \end{document} The FIG file I spare the reader, whereas thePic.tex created by fig2dev may be interesting: \begin{picture}[artifact](0,0) %\begin{picture}(0,0) \includegraphics{thePic}% \end{picture}% % % Conversion of xxx.fig into xxx.ptx, xxx.pdf and xxx.eps % \setlength{\unitlength}{2072sp}% \begin{picture}[alt=Transformation of pics from fig format to tex picture including a pdf.](8492,4797)(1114,-4621) %\put(1000,-4797){\includegraphics{thePic}} \put(1351,-2311){\makebox(0,0)[lb]{\smash{\fontsize{10}{12}\usefont{T1}{ptm}{m}{n}{\color[rgb]{0,0,0}\texttt{xxx.fig}}% }}} \put(6976,-286){\makebox(0,0)[lb]{\smash{\fontsize{10}{12}\usefont{T1}{ptm}{m}{n}{\color[rgb]{0,0,0}\texttt{xxx.pdf}}% }}} \put(6976,-2311){\makebox(0,0)[lb]{\smash{\fontsize{10}{12}\usefont{T1}{ptm}{m}{n}{\color[rgb]{0,0,0}\texttt{xxx.ptx}}% }}} ... \end{picture}% As i said, this is 'essentially' created by fig2dev which cannot know about the meaning of the pics. What I inserted by hand are [artifact] and alt=...]. I know, this is not really correct, because of course the pdf part is of course no pure artifact. I remember fig2dev once created a single picture environment, and I can imagine we could return to that. I showed with \put(1000,-4797){\includegraphics{thePic}} where the pdf could be included. That way, a single alt would remain. Still I have the problem, that creation of such a document is done automatically and I cannot just include alt or artifact in created sources. I found the accessibility package but unfortunately this seems to support pdflatex only and I have for good reasons lualatex. I also found package latex-lab-graphic but the status of this package is not clear. It is not very explicit about how to use it. Seemingly one can enclose pictures in a structure to tag them. This would be what I need. My feeling is, that I would prefer if the alt text would be included in the pic itself, but I think this is in general no option. I know there are many formats out there to be included in latex and even more techniques to do so. Why assigning alt to includegraphics and not to \caption of figures and tables? I imagine \caption[alt=desc, ...]{normal text}.

  • Inconsistent spacing behavior between `equation`s with `fleqn` option?
    by Explorer on December 3, 2025 at 6:38 am

    Let's see the following two codes: \documentclass[12pt,a4paper]{article} \usepackage{showframe} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:1} \end{equation}% \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:2} \end{equation}% \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:3} \end{equation}% \lipsum[1][1-3] aa \eqref{eq:1} and \eqref{eq:2} and \eqref{eq:3} \end{document} It gives normally: While, when I add fleqn: \documentclass[12pt,a4paper,fleqn]{article} \usepackage{showframe} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:1} \end{equation}% \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:2} \end{equation}% \lipsum[1][1-3] \begin{equation}% x^2+y^2=z^2 \label{eq:3} \end{equation}% \lipsum[1][1-3] aa \eqref{eq:1} and \eqref{eq:2} and \eqref{eq:3} \end{document} The spacing expand unexpectedly. IMHO, flqno.clo just move the formula left, without adding the spacing. I want to know how to keep the \above(below)display(short)skip the same as the reqno's case. I found two (maybe) relative links.... But not exactly the same, I think(they both relative with hyperref)... https://tex.stackexchange.com/a/235837/322482 https://tex.stackexchange.com/a/122358/322482

  • Shaded Tabular table not working as expected
    by Álvaro on December 3, 2025 at 4:27 am

    I have this code: \documentclass{article} \usepackage{array,multirow,xcolor,colortbl} \definecolor{tableheadercolor}{HTML}{FFCE63} % Orange from the Keams template \colorlet{tablerowcolor}{tableheadercolor!20} % 20% header color + 80% white \begin{document} \begin{table}[ht] \centering \caption{Opened and Closed JIRA Tickets for ED by Month} \begin{tabular}{| >{\centering\arraybackslash}m{0.1\textwidth}| >{\centering\arraybackslash}m{0.15\textwidth}| >{\centering\arraybackslash}m{0.15\textwidth}| >{\centering\arraybackslash}m{0.15\textwidth}|} \hline \rowcolor{tableheadercolor} \textbf{Year} & \textbf{Month} & \textbf{Opened JIRAs} & \textbf{Closed JIRAs} \\ \hline \multirow{1}{*}{\centering 2023} & December & 2 & 1 \\ \hline \multirow{12}{*}{\cellcolor{tablerowcolor}\centering 2024} & \cellcolor{tablerowcolor} January & \cellcolor{tablerowcolor} 1 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & February & 0 & 1 \\ \cline{2-4} & \cellcolor{tablerowcolor} March & \cellcolor{tablerowcolor} 0 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & April & 0 & 0 \\ \cline{2-4} & \cellcolor{tablerowcolor} May & \cellcolor{tablerowcolor} 3 & \cellcolor{tablerowcolor} 1 \\ \cline{2-4} & June & 0 & 0 \\ \cline{2-4} & \cellcolor{tablerowcolor} July & \cellcolor{tablerowcolor} 0 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & August & 2 & 2 \\ \cline{2-4} & \cellcolor{tablerowcolor} September & \cellcolor{tablerowcolor} 0 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & October & 1 & 0 \\ \cline{2-4} & \cellcolor{tablerowcolor} November & \cellcolor{tablerowcolor} 1 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & December & 2 & 1 \\ \hline \multirow{11}{*}{\centering 2025} & \cellcolor{tablerowcolor} January & \cellcolor{tablerowcolor} 2 & \cellcolor{tablerowcolor} 8 \\ \cline{2-4} & February & 4 & 2 \\ \cline{2-4} & \cellcolor{tablerowcolor} March & \cellcolor{tablerowcolor} 0 & \cellcolor{tablerowcolor} 3 \\ \cline{2-4} & April & 8 & 4 \\ \cline{2-4} & \cellcolor{tablerowcolor} May & \cellcolor{tablerowcolor} 2 & \cellcolor{tablerowcolor} 0 \\ \cline{2-4} & June & 2 & 4 \\ \cline{2-4} & \cellcolor{tablerowcolor} July & \cellcolor{tablerowcolor} 1 & \cellcolor{tablerowcolor} 4 \\ \cline{2-4} & August & 2 & 1 \\ \cline{2-4} & \cellcolor{tablerowcolor} September & \cellcolor{tablerowcolor} 1 & \cellcolor{tablerowcolor} 3 \\ \cline{2-4} & October & 2 & 0 \\ \cline{2-4} & \cellcolor{tablerowcolor} November & \cellcolor{tablerowcolor} 0 & \cellcolor{tablerowcolor} 1 \\ \hline \end{tabular} \end{table} \end{document} However, the row for year 2024 is not correctly shaded: What I want to achieve is rows with alternate shading.

  • Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)?
    by Jasper on December 2, 2025 at 5:38 pm

    Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)? The only way I can think of it so string check each letter, but that sounds too computationally expensive. M(non)WE: \documentclass[tikz,border=1cm]{standalone} \newcommand{\letterpos}[1]{ \pgfmathparse{#1 == a} \ifnum\pgfmathresult=1 1 \fi \pgfmathparse{#1 == ab} \ifnum\pgfmathresult=1 2 \fi \pgfmathparse{#1 == c} \ifnum\pgfmathresult=1 3 \fi \pgfmathparse{#1 == d} \ifnum\pgfmathresult=1 4 \fi \pgfmathparse{#1 == e} \ifnum\pgfmathresult=1 5 \fi } \begin{document} \begin{tikzpicture} \foreach \letter in {a,b,...,e} { \node at (\letterpos{\letter},0) {\letter}; } \end{tikzpicture} \end{document}

  • Redefine quotation environment to remove initial indent
    by agoldst on December 2, 2025 at 4:13 pm

    The default LaTeX quotation environment starts each paragraph with an indentation. I prefer for a multi-paragraph block quote not to indent the first paragraph (as recommended by the Chicago Manual of Style, for example). It is of course possible to write \begin{quotation}\noindent every time. But I would like to redefine the environment. I tried to modify the default article.cls definition of quotation minimally, but the result somehow puts a word space at the start of the quotation. How do I avoid this space without having to manually begin every block quote with a \noindent? Example: \documentclass{article} \newenvironment{lquote}{\list{}{\listparindent 1.5em% \itemindent\listparindent \rightmargin \leftmargin \parsep 0pt plus 1pt}\item\noindent\relax}% {\endlist} \begin{document} Quotation environment with explicit noindent: \begin{quotation} \noindent He finally lit on the ground and walked around the body to see if it were really dead. Peered into its nose and mouth. Examined it well from end to end and leaped upon it and bowed, and the others danced a response. That being over, he balanced and asked: ``What killed this man?'' \end{quotation} Custom environment attempting to put noindent at the beginning \begin{lquote} He finally lit on the ground and walked around the body to see if it were really dead. Peered into its nose and mouth. Examined it well from end to end and leaped upon it and bowed, and the others danced a response. That being over, he balanced and asked: ``What killed this man?'' \end{lquote} \end{document} On my system, pdflatex gives this:

  • Section title with \star
    by Roberto Rastapopoulos on December 2, 2025 at 1:47 pm

    I am trying to get the following: But when I insert it in this way: \documentclass[a4paper,12pt]{amsart} \usepackage{hyperref} \begin{document} \tableofcontents \section{Introduction} \subsection{$\star$ N-Soliton solutions} Some text about N-soliton solutions... \end{document} I get the error "Package hyperref Warning: Token not allowed in a PDF string (Unicode): removing `math shift' [...]". When I write \subsection{\star N-Soliton solutions} I get How can I get the first one without the error? I have tried several things, but all come with another problem.

  • xcolor not fully colouring commutative diagrams drawn by tikzcd
    by Ishan Deo on December 2, 2025 at 3:12 am

    I'm using xcolor in a table whose cells contain commutative diagrams drawn by tikzcd. However, the colour from xcolor is not fully going through these commutative diagrams, as can be seen by the image below Here is a MWP for the code \documentclass[12pt]{article} \usepackage[svgnames,table]{xcolor} \usepackage{tikz-cd} \begin{document} \begin{table} \centering \rowcolors{1}{Gray!10}{} \begin{tabular}{c} $\displaystyle \begin{tikzcd}[column sep=huge, ampersand replacement=\&] * \arrow[r, bend left = 40, "\,", ""{name=U, inner sep=1pt, below}] \arrow[r, bend right = 40, "\,"{below}, ""{name=D, inner sep=1pt}] \& \arrow[Rightarrow, from=U, to=D, "\alpha"] * \end{tikzcd}$ \end{tabular} \end{table} \end{document} Why is this error happening? And how can I fix it?

  • Numbering only in a specific line of an align environment (without \tag or extra packages)
    by Sebastiano on December 1, 2025 at 9:56 am

    I’m trying to number a system of equations using the amsmath package, but I would like the equation number to appear on a specific line within the align environment. In my example, I want the numbering to appear on the second line instead of the first one. Here is the code: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align}\label{498h} \mathcal{L}\left\{ t \cos(a t) \right\} & = \frac{ s^2 - a^2 }{ (s^2 + a^2)^2 } \int_0^t \frac{\partial{K(\sigma,\gamma)}}{\partial \sigma}K_L e(\sigma) \\ & = \frac{8 h^3}{a^3}-\frac{8 (h^2-1) h}{a^3}+\frac{16 u}{a^2} \end{align} I want the numered equation on the 2nd \eqref{498h} \end{document} I would like only the second line to be numbered, leaving the first one unnumbered. Moreover, I do not want to use additional packages or the \tag command or \nonumber. In general, for example, if I have 35 line of equation, how is it possible to put, the number in the 24-th equation? I have not checked whether a similar question has already been answered on the site. Thank you all!