From 585c5c75e3ba38128f22077af5b49feaa9ebb895 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Tue, 28 Jan 2025 12:40:09 +0100 Subject: [PATCH] move smash patches into sockets --- luamml-patches-kernel.sty | 44 ++++++++++++++++++++------------------- luamml.dtx | 32 +++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/luamml-patches-kernel.sty b/luamml-patches-kernel.sty index 01c936e..36824a8 100644 --- a/luamml-patches-kernel.sty +++ b/luamml-patches-kernel.sty @@ -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 { diff --git a/luamml.dtx b/luamml.dtx index 2494975..dfaa1c6 100644 --- a/luamml.dtx +++ b/luamml.dtx @@ -666,7 +666,37 @@ \AssignSocketPlug{tagsupport/math/luamml/finph@nt}{luamml} % % \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} +% +% \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}.