move multline code

This commit is contained in:
Ulrike Fischer 2025-02-07 01:06:46 +01:00
parent 5c8d99818b
commit 29212f284c
2 changed files with 51 additions and 26 deletions

View File

@ -246,12 +246,10 @@
\global \lineht@ \z@ \global \lineht@ \z@
\cr \cr
} }
}
% This was lost anyway, as the latex-lab code overwrites % This was lost anyway, as the latex-lab code overwrites
% the definition again. % 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 \cs_set:Npn \maketag@@@ #1
{ {
\hbox { \hbox {
@ -261,6 +259,7 @@
\UseTaggingSocket{math/luamml/mtable/tag/save} \UseTaggingSocket{math/luamml/mtable/tag/save}
} }
} }
\PackageInfo{luamml}{patching~\string\endalign}
% this handled in latex-lab through \common@align@ending % this handled in latex-lab through \common@align@ending
\cs_set:Npn \endalign { \cs_set:Npn \endalign {
\math@cr \math@cr
@ -277,29 +276,34 @@
\fi \fi
\ignorespacesafterend \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: %this is not move to latex-lab as the luamml_ignore is inserting with
\cs_new_eq:NN \__luamml_amsmath_original_multline:n \multline@ % \measuringtrue
\cs_set:Npn \multline@ #1 { \PackageInfo{luamml}{patching~\string\mmeasure@}
\__luamml_amsmath_original_multline:n { \cs_new_eq:NN \__luamml_amsmath_original_mmeasure:n \mmeasure@
\ifmeasuring@ \else \cs_set:Npn \mmeasure@ #1 {
\__luamml_amsmath_set_row_columnalign:n {left} \exp_last_unbraced:Nno
\fi \use_ii_i:nn
#1 { \luamml_ignore: }
\ifmeasuring@ \else { \__luamml_amsmath_original_mmeasure:n {#1} }
\__luamml_amsmath_set_row_columnalign:n {right} }
\fi } % 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 % Luckily, {multline} uses \endmultline@math in exactly
% the spot where we have to set the flag. % the spot where we have to set the flag.

View File

@ -692,7 +692,7 @@
\AssignSocketPlug{tagsupport/math/luamml/mtable/innertable/finalize}{luamml} \AssignSocketPlug{tagsupport/math/luamml/mtable/innertable/finalize}{luamml}
%</luatex> %</luatex>
% \end{macrocode} % \end{macrocode}
%
% %
% This socket finalize the \texttt{mtable} in alignments like align or gather. % This socket finalize the \texttt{mtable} in alignments like align or gather.
% It takes an argument, the environment. % It takes an argument, the environment.
@ -714,6 +714,27 @@
\AssignSocketPlug{tagsupport/math/luamml/mtable/finalize}{luamml} \AssignSocketPlug{tagsupport/math/luamml/mtable/finalize}{luamml}
%</luatex> %</luatex>
% \end{macrocode} % \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}
%</luatex>
% \end{macrocode}
% %
% \subsubsection{Tags and labels} % \subsubsection{Tags and labels}
% These sockets save and set tags and labels in alignments. % These sockets save and set tags and labels in alignments.