Skip to content

Commit

Permalink
moving gathered
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Feb 1, 2025
1 parent e1741b1 commit bdd3cd7
Showing 1 changed file with 46 additions and 42 deletions.
88 changes: 46 additions & 42 deletions luamml-patches-amsmath.sty
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,36 @@
\crcr
\ams@return@opt@arg
}

\renewcommand \gathered [1] [c] {
\RIfM@
\else
\nonmatherr@ { \begin {gathered} }
\fi
\UseTaggingSocket{ math/luamml/annotate/false } {}{ \alignedspace@left }
\ams@start@box {#1} \bgroup
\Let@
\chardef \dspbrk@context \@ne
\restore@math@cr
\spread@equation
\ialign \bgroup
\hfil
\strut@
$
\m@th
\displaystyle
##
\UseTaggingSocket{math/luamml/save/nNn}{ {} \displaystyle {mtd}}
$
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}
\hfil
\crcr
\ams@return@opt@arg
}
\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24}
{}
{
\PackageInfo{luamml}{patching~gathered}
\renewcommand \gathered [1] [c] {
\RIfM@
\else
\nonmatherr@ { \begin {gathered} }
\fi
\UseTaggingSocket{ math/luamml/annotate/false } {}{ \alignedspace@left }
\ams@start@box {#1} \bgroup
\Let@
\chardef \dspbrk@context \@ne
\restore@math@cr
\spread@equation
\ialign \bgroup
\hfil
\strut@
$
\m@th
\displaystyle
##
\UseTaggingSocket{math/luamml/save/nNn}{ {} \displaystyle {mtd}}
$
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last}
\hfil
\crcr
\ams@return@opt@arg
}
}

\cs_set:Npn \endaligned {
\crcr
Expand Down Expand Up @@ -257,22 +261,22 @@
\UseTaggingSocket{math/luamml/mtable/tag/save}
}
}
}
\cs_set:Npn \endalign {
\math@cr
\black@ \totwidth@
\UseTaggingSocket{math/luamml/mtable/finalize} {align}
\egroup
\ifingather@
\restorealignstate@
\egroup
\nonumber
\ifnum0=`{\fi\iffalse}\fi
\else
$$
\fi
\ignorespacesafterend
% this handled in latex-lab through \common@align@ending
\cs_set:Npn \endalign {
\math@cr
\black@ \totwidth@
\UseTaggingSocket{math/luamml/mtable/finalize} {align}
\egroup
\ifingather@
\restorealignstate@
\egroup
\nonumber
\ifnum0=`{\fi\iffalse}\fi
\else
$$
\fi
\ignorespacesafterend
}
}
% For a more interesting one, let's consider multline:
Expand Down

0 comments on commit bdd3cd7

Please sign in to comment.