handle text command as in latex-lab

This commit is contained in:
Ulrike Fischer 2024-12-03 16:33:37 +01:00
parent 957c8ff803
commit eb4dd9561c

View File

@ -1,37 +1,25 @@
\ProvidesExplPackage {luamml-patches-amstext} {2024-10-30} {0.2.0} \ProvidesExplPackage {luamml-patches-amstext} {2024-10-30} {0.2.0}
{Feel free to add a description here} {Feel free to add a description here}
\int_new:N \g__luamml_amsmath_text_struct_int % This is the same definition as in latex-lab-amsmath. It can go with the
\cs_set:Npn \textdef@ #1 #2 #3 { % 2025-06-01 release.
\int_if_odd:nTF { \int_div_truncate:nn { \l__luamml_flag_int } { 8 } } {
\int_gincr:N \g__luamml_amsmath_text_struct_int \sys_if_engine_luatex:T
\tag_struct_begin:n { {
tag = mtext/mathml, \def\text@#1{
stash, \tag_socket_use:nnn {math/luamml/hbox}{}
label = __luamml_amsmath_text_ \int_use:N \g__luamml_amsmath_text_struct_int {{%
} \ifcase\mathstyle
\tag_mc_begin:n { \hbox{{#1}}\or
tag = mtext \hbox{{#1}}\or
} \hbox{{#1}}\or
\AnnotateFormula { \hbox{{#1}}\or
nucleus = true, \hbox{{\let\f@size\sf@size\selectfont#1}}\or
struct = "__luamml_amsmath_text_ \int_use:N \g__luamml_amsmath_text_struct_int" \hbox{{\let\f@size\sf@size\selectfont#1}}\or
} \hbox{{\let\f@size\ssf@size\selectfont#1}}\or
} { \hbox{{\let\f@size\ssf@size\selectfont#1}}\or
\use:n \ERROR
} \fi
{ \check@mathfonts
\hbox { }}}
{ }
\everymath {#1}
\let \f@size #2
\selectfont
#3
}
}
}
\int_if_odd:nT { \int_div_truncate:nn { \l__luamml_flag_int } { 8 } } {
\tag_mc_end:
\tag_struct_end:
}
}