more sockets

This commit is contained in:
Ulrike Fischer 2025-01-31 01:01:39 +01:00
parent 06986af907
commit a727a3a309
2 changed files with 52 additions and 29 deletions

View File

@ -15,11 +15,7 @@
\nonmatherr@ { \begin { \@currenvir } } \nonmatherr@ { \begin { \@currenvir } }
\fi \fi
\savecolumn@ % Assumption: called inside a group \savecolumn@ % Assumption: called inside a group
\luamml_annotate:en { \UseTaggingSocket{ math/luamml/annotate/false } {}{ \alignedspace@left }
core = false
} {
\alignedspace@left
}
\ams@start@box {#1} \bgroup \ams@start@box {#1} \bgroup
\maxfields@ #2 \relax \maxfields@ #2 \relax
\ifnum \maxfields@ > \m@ne \ifnum \maxfields@ > \m@ne
@ -44,7 +40,7 @@
{##} {##}
\luamml_save:nNn {} \displaystyle {mtd} \luamml_save:nNn {} \displaystyle {mtd}
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\tabskip \z@skip \tabskip \z@skip
& \column@plus & \column@plus
$ $
@ -56,7 +52,7 @@
} }
\luamml_save:nNn {} \displaystyle {mtd} \luamml_save:nNn {} \displaystyle {mtd}
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\hfil \hfil
\tabskip\alignsep@ \tabskip\alignsep@
\crcr \crcr
@ -68,11 +64,7 @@
\else \else
\nonmatherr@ { \begin {gathered} } \nonmatherr@ { \begin {gathered} }
\fi \fi
\luamml_annotate:en { \UseTaggingSocket{ math/luamml/annotate/false } {}{ \alignedspace@left }
core = false
} {
\alignedspace@left
}
\ams@start@box {#1} \bgroup \ams@start@box {#1} \bgroup
\Let@ \Let@
\chardef \dspbrk@context \@ne \chardef \dspbrk@context \@ne
@ -87,7 +79,7 @@
## ##
\luamml_save:nNn {} \displaystyle {mtd} \luamml_save:nNn {} \displaystyle {mtd}
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\hfil \hfil
\crcr \crcr
\ams@return@opt@arg \ams@return@opt@arg
@ -302,14 +294,14 @@
\cs_set:Npn \endmultline@math { \cs_set:Npn \endmultline@math {
\luamml_save:nNn {} \displaystyle {mtd} \luamml_save:nNn {} \displaystyle {mtd}
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
} }
\cs_set:Npn \rendmultline@ { \cs_set:Npn \rendmultline@ {
\iftag@ \iftag@
\luamml_save:nNn {} \displaystyle {mtd} \luamml_save:nNn {} \displaystyle {mtd}
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\let \endmultline@math \relax \let \endmultline@math \relax
\ifshifttag@ \ifshifttag@
\hskip \multlinegap \hskip \multlinegap
@ -354,12 +346,7 @@
% Finally some slightly different stuff. % Finally some slightly different stuff.
% While {matrix} is covered by {array}, we still have {smallmatrix}: % While {matrix} is covered by {array}, we still have {smallmatrix}:
\renewenvironment {smallmatrix} { \renewenvironment {smallmatrix} {
\luamml_annotate:en { \UseTaggingSocket{ math/luamml/annotate/false } {} { \null\, }
core = false
} {
\null
\,
}
\vcenter \bgroup \vcenter \bgroup
\Let@ \Let@
\restore@math@cr \restore@math@cr
@ -375,7 +362,7 @@
## ##
\luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes \luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\hfil \hfil
&& &&
\thickspace \thickspace
@ -386,7 +373,7 @@
## ##
\luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes \luamml_save:nn {} {mtd} % No \scriptsize here since we want to add the mstyle nodes
$ $
\__luamml_amsmath_add_last_to_row: \UseTaggingSocket{math/luamml/mtable/finalizecol}
\hfil \hfil
\crcr \crcr
}{% }{%
@ -395,11 +382,7 @@
\egroup \egroup
\egroup \egroup
\__luamml_amsmath_finalize_inner_table: \__luamml_amsmath_finalize_inner_table:
\luamml_annotate:en { \UseTaggingSocket{ math/luamml/annotate/false } {}{ \, }
core = false
} {
\,
}
} }
% {cases} is defined by the kernel, but we patch the overwritten version by amsmath. % {cases} is defined by the kernel, but we patch the overwritten version by amsmath.

View File

@ -556,7 +556,27 @@
\AssignSocketPlug{tagsupport/math/luamml/save/nn}{luamml} \AssignSocketPlug{tagsupport/math/luamml/save/nn}{luamml}
% \end{macrocode} % \end{macrocode}
% %
% \subsection{socket plugs for the array package} % \subsubsection{sockets to annotate content}
%
% \begin{macrocode}
\str_if_exist:cF { l__socket_tagsupport/math/luamml/annotate/false_plug_str }
{
\NewSocket{tagsupport/math/luamml/annotate/false}{2}
\NewSocketPlug{tagsupport/math/luamml/annotate/false}{default}{#2}
\AssignSocketPlug{tagsupport/math/luamml/annotate/false}{default}
}
%<*luatex>
\NewSocketPlug{tagsupport/math/luamml/annotate/false}{luamml}
{
\luamml_annotate:en { core = false }
{
#2
}
}
\AssignSocketPlug{tagsupport/math/luamml/annotate/false}{luamml}
%</luatex>
% \end{macrocode}
% \subsubsection{socket plugs for the array package}
% %
% The socket declaration can go with the 2025-06-01 release % The socket declaration can go with the 2025-06-01 release
% \begin{macrocode} % \begin{macrocode}
@ -624,6 +644,26 @@
% \end{macrocode} % \end{macrocode}
% \subsubsection{amsmath alignments} % \subsubsection{amsmath alignments}
% %
% This socket is used at the end of alignment cells and adds the content to
% the current row.
%
% \begin{macrocode}
\str_if_exist:cF { l__socket_tagsupport/math/luamml/mtable/finalizecol_plug_str }
{
\NewSocket{tagsupport/math/luamml/mtable/finalizecol}{0}
}
% \end{macrocode}
% \begin{macrocode}
%<*luatex>
\NewSocketPlug{tagsupport/math/luamml/mtable/finalizecol}{luamml}
{
\__luamml_amsmath_add_last_to_row:
}
\AssignSocketPlug{tagsupport/math/luamml/mtable/finalizecol}{luamml}
%</luatex>
% \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.
% It should be used normally with \cs{UseExpandableTaggingSocket}. % It should be used normally with \cs{UseExpandableTaggingSocket}.