summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3text.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3text.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3text.dtx25
1 files changed, 18 insertions, 7 deletions
diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx
index 45ed617bd7..1a8b2cc6a0 100644
--- a/macros/latex/contrib/l3kernel/l3text.dtx
+++ b/macros/latex/contrib/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2022-07-04}
+% \date{Released 2022-07-14}
%
% \maketitle
%
@@ -701,6 +701,7 @@
% \@@_expand_explicit:N ,
% \@@_expand_exclude:N
% }
+% \begin{macro}[EXP]{\@@_expand_exclude_switch:Nnnnn}
% \begin{macro}[EXP]{\@@_expand_exclude:nN}
% \begin{macro}[EXP]{\@@_expand_exclude:NN}
% \begin{macro}[EXP]{\@@_expand_exclude:Nw}
@@ -960,17 +961,26 @@
}
% \end{macrocode}
% Next we exclude math commands: this is mainly as there \emph{might} be an
-% \cs{ensuremath}.
+% \cs{ensuremath}. The switching command for case needs special handling
+% as it has to work by meaning.
% \begin{macrocode}
\cs_new:Npn \@@_expand_exclude:N #1
{
- \exp_args:Ne \@@_expand_exclude:nN
+ \cs_if_eq:NNTF #1 \text_case_switch:nnnn
+ { \@@_expand_exclude_switch:Nnnnn #1 }
{
- \exp_not:V \l_text_math_arg_tl
- \exp_not:V \l_text_expand_exclude_tl
- \exp_not:N \text_case_switch:nnnn
+ \exp_args:Ne \@@_expand_exclude:nN
+ {
+ \exp_not:V \l_text_math_arg_tl
+ \exp_not:V \l_text_expand_exclude_tl
+ }
+ #1
}
- #1
+ }
+\cs_new:Npn \@@_expand_exclude_switch:Nnnnn #1#2#3#4#5
+ {
+ \@@_expand_store:n { #1 {#2} {#3} {#4} {#5} }
+ \@@_expand_loop:w
}
\cs_new:Npn \@@_expand_exclude:nN #1#2
{
@@ -1237,6 +1247,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {