diff --git a/luamml-patches-amsmath.sty b/luamml-patches-amsmath.sty index ffe1a05..e62b6b6 100644 --- a/luamml-patches-amsmath.sty +++ b/luamml-patches-amsmath.sty @@ -246,12 +246,10 @@ \global \lineht@ \z@ \cr } -} + % This was lost anyway, as the latex-lab code overwrites % the definition again. -\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24} - {} - { \PackageInfo{luamml}{patching~\string\maketag@@@} + \PackageInfo{luamml}{patching~\string\maketag@@@} \cs_set:Npn \maketag@@@ #1 { \hbox { @@ -261,6 +259,7 @@ \UseTaggingSocket{math/luamml/mtable/tag/save} } } + \PackageInfo{luamml}{patching~\string\endalign} % this handled in latex-lab through \common@align@ending \cs_set:Npn \endalign { \math@cr @@ -277,29 +276,34 @@ \fi \ignorespacesafterend } -} + + \PackageInfo{luamml}{patching~\string\multline@} + % For a more interesting one, let's consider multline: + \cs_new_eq:NN \__luamml_amsmath_original_multline:n \multline@ + \cs_set:Npn \multline@ #1 { + \__luamml_amsmath_original_multline:n { + \ifmeasuring@ \else + \UseTaggingSocket{math/luamml/mtable/aligncol} {left} + \fi + #1 + \ifmeasuring@ \else + \UseTaggingSocket{math/luamml/mtable/aligncol} {right} + \fi + } + } -% For a more interesting one, let's consider multline: -\cs_new_eq:NN \__luamml_amsmath_original_multline:n \multline@ -\cs_set:Npn \multline@ #1 { - \__luamml_amsmath_original_multline:n { - \ifmeasuring@ \else - \__luamml_amsmath_set_row_columnalign:n {left} - \fi - #1 - \ifmeasuring@ \else - \__luamml_amsmath_set_row_columnalign:n {right} - \fi - } -} + %this is not move to latex-lab as the luamml_ignore is inserting with + % \measuringtrue + \PackageInfo{luamml}{patching~\string\mmeasure@} + \cs_new_eq:NN \__luamml_amsmath_original_mmeasure:n \mmeasure@ + \cs_set:Npn \mmeasure@ #1 { + \exp_last_unbraced:Nno + \use_ii_i:nn + { \luamml_ignore: } + { \__luamml_amsmath_original_mmeasure:n {#1} } + } + } % end package test -\cs_new_eq:NN \__luamml_amsmath_original_mmeasure:n \mmeasure@ -\cs_set:Npn \mmeasure@ #1 { - \exp_last_unbraced:Nno - \use_ii_i:nn - { \luamml_ignore: } - { \__luamml_amsmath_original_mmeasure:n {#1} } -} % Luckily, {multline} uses \endmultline@math in exactly % the spot where we have to set the flag. diff --git a/luamml.dtx b/luamml.dtx index 204b4ec..20b8360 100644 --- a/luamml.dtx +++ b/luamml.dtx @@ -692,7 +692,7 @@ \AssignSocketPlug{tagsupport/math/luamml/mtable/innertable/finalize}{luamml} % % \end{macrocode} - +% % % This socket finalize the \texttt{mtable} in alignments like align or gather. % It takes an argument, the environment. @@ -714,6 +714,27 @@ \AssignSocketPlug{tagsupport/math/luamml/mtable/finalize}{luamml} % % \end{macrocode} +% +% This socket adds attributes for the alignment in \texttt{multline}. +% It takes an argument, the alignment. +% \begin{macrocode} +\str_if_exist:cF { l__socket_tagsupport/math/luamml/mtable/aligncol_plug_str } + { + \NewSocket{tagsupport/math/luamml/mtable/aligncol}{1} + \AssignSocketPlug{tagsupport/math/luamml/mtable/aligncol}{noop} + } +% \end{macrocode} +% +% \begin{macrocode} +%<*luatex> +\NewSocketPlug{tagsupport/math/luamml/mtable/aligncol}{luamml} + { + \__luamml_amsmath_set_row_columnalign:n {#1} + } +\AssignSocketPlug{tagsupport/math/luamml/mtable/aligncol}{luamml} +% +% \end{macrocode} + % % \subsubsection{Tags and labels} % These sockets save and set tags and labels in alignments.