From bdd3cd74800ac0b070150230557bea86fbaf7ad1 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 1 Feb 2025 01:15:22 +0100 Subject: [PATCH] moving gathered --- luamml-patches-amsmath.sty | 88 ++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/luamml-patches-amsmath.sty b/luamml-patches-amsmath.sty index 5adedcd..e4e5a6d 100644 --- a/luamml-patches-amsmath.sty +++ b/luamml-patches-amsmath.sty @@ -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 @@ -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: