move mathtool patch

This commit is contained in:
Ulrike Fischer 2025-02-07 17:40:27 +01:00
parent b0149a45a3
commit f8a3d35aa1

View File

@ -1,35 +1,38 @@
\ProvidesExplPackage {luamml-patches-mathtools} {2024-10-26} {0.2.0} \ProvidesExplPackage {luamml-patches-mathtools} {2024-10-26} {0.2.0}
{Feel free to add a description here} {Feel free to add a description here}
\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24}
\RequirePackage{luamml-patches-amsmath} {}
% see https://github.com/latex3/tagging-project/issues/734 {
\renewcommand*\MT_mult_internal:n [1]{ \RequirePackage{luamml-patches-amsmath}
\MH_if_boolean:nF {outer_mult}{\alignedspace@left} %<-- requires amsmath 2016/11/05 % see https://github.com/latex3/tagging-project/issues/734
\MT_next: \renewcommand*\MT_mult_internal:n [1]{
\bgroup \MH_if_boolean:nF {outer_mult}{\alignedspace@left} %<-- requires amsmath 2016/11/05
\Let@ \MT_next:
\def\l_MT_multline_lastline_fint{0 } \bgroup
\chardef\dspbrk@context\@ne \restore@math@cr \Let@
\MH_let:NwN \math@cr@@\MT_mult_mathcr_atat:w \def\l_MT_multline_lastline_fint{0 }
\MH_let:NwN \shoveleft\MT_shoveleft:wn \chardef\dspbrk@context\@ne \restore@math@cr
\MH_let:NwN \shoveright\MT_shoveright:wn \MH_let:NwN \math@cr@@\MT_mult_mathcr_atat:w
\spread@equation \MH_let:NwN \shoveleft\MT_shoveleft:wn
\MH_set_boolean_F:n {mult_firstline} \MH_let:NwN \shoveright\MT_shoveright:wn
\MT_measure_mult:n {#1} \spread@equation
\MH_if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim \MH_set_boolean_F:n {mult_firstline}
\MH_setlength:dn \l_MT_multwidth_dim{\l_MT_multline_measure_fdim} \MT_measure_mult:n {#1}
\fi \MH_if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim
\MH_set_boolean_T:n {mult_firstline} \MH_setlength:dn \l_MT_multwidth_dim{\l_MT_multline_measure_fdim}
\MH_if_num:w \l_MT_multline_lastline_fint=\@ne \fi
\MH_let:NwN \math@cr@@ \MT_mult_firstandlast_mathcr:w \MH_set_boolean_T:n {mult_firstline}
\MH_fi: \MH_if_num:w \l_MT_multline_lastline_fint=\@ne
\ialign\bgroup \MH_let:NwN \math@cr@@ \MT_mult_firstandlast_mathcr:w
\hfil\strut@$\m@th\displaystyle{}## \MH_fi:
\UseTaggingSocket{math/luamml/save/nNn}{ {} \displaystyle {mtd}} \ialign\bgroup
$ \hfil\strut@$\m@th\displaystyle{}##
\UseTaggingSocket{math/luamml/mtable/finalizecol}{last} \UseTaggingSocket{math/luamml/save/nNn}{ {} \displaystyle {mtd}}
\hfil $
\crcr \UseTaggingSocket{math/luamml/mtable/finalizecol}{last}
\hfilneg \hfil
#1 \crcr
\hfilneg
#1
}
} }