move smash patches into sockets

This commit is contained in:
Ulrike Fischer 2025-01-28 12:40:09 +01:00
parent 6b34c20542
commit 585c5c75e3
2 changed files with 54 additions and 22 deletions

View File

@ -1,30 +1,32 @@
\ProvidesExplPackage {luamml-patches-kernel} {2024-10-30} {0.2.0}
{Feel free to add a description here}
\cs_set:Npn \mathsm@sh #1 #2 {
\setbox \z@ \hbox {
$
\m@th #1 {
#2
}
\luamml_save:nNn {mathsmash} #1 {mpadded}
\luamml_pdf_write:
$
}
\luamml_annotate:nen {2} {
nucleus = true,
core = consume_label('mathsmash', function(padded)
padded.height, padded.depth = 0, 0~
end),
} {
{}
\finsm@sh
}
}
\IfPackageAtLeastTF{latex-lab-testphase-text}{2025-01-27}
\IfPackageAtLeastTF{latex-lab-testphase-math}{2025-01-24}
{}
{
\PackageInfo{luamml}{patching~\string\mathsm@sh}
\cs_set:Npn \mathsm@sh #1 #2 {
\setbox \z@ \hbox {
$
\m@th #1 {
#2
}
\luamml_save:nNn {mathsmash} #1 {mpadded}
\luamml_pdf_write:
$
}
\luamml_annotate:nen {2} {
nucleus = true,
core = consume_label('mathsmash', function(padded)
padded.height, padded.depth = 0, 0~
end),
} {
{}
\finsm@sh
}
}
\PackageInfo{luamml}{patching~\string\mathph@nt}
\cs_set:Npn \mathph@nt #1 #2 {
\setbox \z@ = \hbox {

View File

@ -666,7 +666,37 @@
\AssignSocketPlug{tagsupport/math/luamml/finph@nt}{luamml}
%</luatex>
% \end{macrocode}
% \subsubsection{Math smash socket}
% This socket is used around \cs{finsm@sh}.
% It should provided until 2025-06-01
% \begin{macrocode}
\str_if_exist:cF { l__socket_tagsupport/math/luamml/finsm@sh_plug_str }
{
\NewSocket{tagsupport/math/luamml/finsm@sh}{2}
\NewSocketPlug{tagsupport/math/luamml/finsm@sh}{default}{#2}
\AssignSocketPlug{tagsupport/math/luamml/finsm@sh}{default}
}
% \end{macrocode}
%
% \begin{macrocode}
%<*luatex>
\NewSocketPlug{tagsupport/math/luamml/finsm@sh}{luamml}
{
\luamml_annotate:nen {2}
{
nucleus = true,
core =
consume_label('mathsmash',
function(padded)
padded.height, padded.depth = 0, 0~
end),
}
{ #2 }
}
\AssignSocketPlug{tagsupport/math/luamml/finsm@sh}{luamml}
%</luatex>
% \end{macrocode}
% \subsection{Patching}
% For some packages, we ship with patches to make them more compatible and to
% demonstrate how other code can be patched to work with \texttt{luamml}.