move \__luamml_amsmath_finalize_table:n into socket

This commit is contained in:
Ulrike Fischer 2025-01-23 18:44:57 +01:00
parent dc22fa31a4
commit 88ab616a78
3 changed files with 31 additions and 5 deletions

View File

@ -160,7 +160,7 @@
\cs_set:Npn \endgather {
\math@cr
\black@ \totwidth@
\__luamml_amsmath_finalize_table:n {gather}
\UseExpandableTaggingSocket{math/luamml/mtable/finalize} {gather}
\egroup
$$
\ignorespacesafterend
@ -258,7 +258,7 @@
\cs_set:Npn \endalign {
\math@cr
\black@ \totwidth@
\__luamml_amsmath_finalize_table:n {align}
\UseTaggingSocket{math/luamml/mtable/finalize} {align}
\egroup
\ifingather@
\restorealignstate@
@ -334,7 +334,7 @@
\fi
\hfilneg
\math@cr
\__luamml_amsmath_finalize_table:n {multline}
\UseExpandableTaggingSocket {math/luamml/mtable/finalize} {multline}
\egroup
$$
}
@ -343,7 +343,8 @@
\hfilneg
\hskip\multlinegap
\math@cr
\__luamml_amsmath_finalize_table:n {multline}
\UseExpandableTaggingSocket {math/luamml/mtable/finalize} {multline}
%\__luamml_amsmath_finalize_table:n {multline}
\egroup
$$
}

View File

@ -1,11 +1,13 @@
\ProvidesExplPackage {luamml-patches-lab-math} {2024-10-30} {0.2.0}
{Feel free to add a description here}
% This definition is identical to the one in latex-lab-math.
% The redefinition and the whole patch file can be removed in 2025-06-01
\AddToHook{begindocument} {
\cs_set:Npn \common@align@ending {
\math@cr
\black@ \totwidth@
\__luamml_amsmath_finalize_table:n {align}
\UseExpandableTaggingSocket{math/luamml/mtable/finalize}{align}
\egroup
\ifingather@
\restorealignstate@

View File

@ -527,6 +527,29 @@
% In various places luamml has to add code to kernel commands. This is done through
% sockets which are predeclared in lttagging.
%
% \subsubsection{amsmath alignments}
%
% This socket finalize the \texttt{mtable} in alignments like align or gather.
% It takes an argument, the environment.
% It should be used normally with \cs{UseExpandableTaggingSocket}.
% \begin{macrocode}
\str_if_exist:cF { l__socket_tagsupport/math/luamml/mtable/finalize_plug_str }
{
\NewSocket{tagsupport/math/luamml/mtable/finalize}{1}
\AssignSocketPlug{tagsupport/math/luamml/mtable/finalize}{noop}
}
% \end{macrocode}
%
% \begin{macrocode}
%<*luatex>
\NewSocketPlug{tagsupport/math/luamml/mtable/finalize}{luamml}
{
\__luamml_amsmath_finalize_table:n {#1}
}
%</luatex>
% \end{macrocode}
%
%
% \subsubsection{Horizontal boxes}
% This socket annotates an \cs{hbox} inside box commands used in math.
% We test for the socket until the release 2025-06-01.