diff --git a/luamml-patches-amsmath.sty b/luamml-patches-amsmath.sty index 0b09bc7..68f68a8 100644 --- a/luamml-patches-amsmath.sty +++ b/luamml-patches-amsmath.sty @@ -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 $$ } diff --git a/luamml-patches-lab-math.sty b/luamml-patches-lab-math.sty index 7776576..f329911 100644 --- a/luamml-patches-lab-math.sty +++ b/luamml-patches-lab-math.sty @@ -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@ diff --git a/luamml.dtx b/luamml.dtx index 498444f..0f98744 100644 --- a/luamml.dtx +++ b/luamml.dtx @@ -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} + } +% +% \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.