diff options
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3token.dtx')
-rw-r--r-- | macros/latex/contrib/l3kernel/l3token.dtx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx index dabd6ea6ac..676c55747a 100644 --- a/macros/latex/contrib/l3kernel/l3token.dtx +++ b/macros/latex/contrib/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2020-10-05} +% \date{Released 2020-10-27} % % \maketitle % @@ -692,6 +692,14 @@ % Tests if the \meta{token} is defined to be a mathchardef. % \end{function} % +% \begin{function}[EXP,pTF, added=2020-10-27]{\token_if_font_selection:N} +% \begin{syntax} +% \cs{token_if_font_selection_p:N} \meta{token} \\ +% \cs{token_if_font_selection:NTF} \meta{token} \Arg{true code} \Arg{false code} +% \end{syntax} +% Tests if the \meta{token} is defined to be a font selection command. +% \end{function} +% % \begin{function}[EXP,pTF, updated=2012-01-20]{\token_if_dim_register:N} % \begin{syntax} % \cs{token_if_dim_register_p:N} \meta{token} \\ @@ -1496,7 +1504,7 @@ \tl_put_right:Nn \l_@@_tmp_tl { ^^@ \if_false: } } \char_set_catcode_group_end:n { 0 } \tl_put_right:Nn \l_@@_tmp_tl { { \fi: \exp_not:N \or: ^^@ } % } - \tl_set:Nx \l_@@_tmp_tl { \l_@@_tmp_tl } + \__kernel_tl_set:Nx \l_@@_tmp_tl { \l_@@_tmp_tl } \char_set_catcode_math_toggle:n { 0 } \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } \char_set_catcode_alignment:n { 0 } @@ -2222,6 +2230,7 @@ % \@@_delimit_by_char":w, % \@@_delimit_by_count:w, % \@@_delimit_by_dimen:w, +% \@@_delimit_by_ font:w, % \@@_delimit_by_macro:w, % \@@_delimit_by_muskip:w, % \@@_delimit_by_skip:w, @@ -2233,6 +2242,9 @@ % argument delimited by a string, a second one delimited by % \cs{s_@@_stop}, and returns the first one and its delimiter. % This result is eventually compared to another string. +% Note that the ``font'' auxiliary is delimited by a space followed by +% ``\texttt{font}''. This avoids an unnecessary check for the +% \tn{font} primitive below. % \begin{macrocode} \group_begin: \cs_set_protected:Npn \@@_tmp:w #1 @@ -2247,6 +2259,7 @@ \@@_tmp:w { char" } \@@_tmp:w { count } \@@_tmp:w { dimen } +\@@_tmp:w { ~ font } \@@_tmp:w { macro } \@@_tmp:w { muskip } \@@_tmp:w { skip } @@ -2260,6 +2273,7 @@ % \token_if_chardef:N, \token_if_mathchardef:N, % \token_if_long_macro:N, % \token_if_protected_macro:N, \token_if_protected_long_macro:N, +% \token_if_font_selection:N, % \token_if_dim_register:N, \token_if_int_register:N, % \token_if_muskip_register:N, % \token_if_skip_register:N, \token_if_toks_register:N, @@ -2292,8 +2306,9 @@ % space after |\protected| but a space after |\long|, hence the % mixture of \cs{token_to_str:N} and \cs{tl_to_str:n}. % -% For the first five conditionals, \cs{cs_if_exist:cT} turns out to -% be \texttt{false}, and the code boils down to a string comparison +% For the first six conditionals, \cs{cs_if_exist:cT} turns out to +% be \texttt{false} (thanks to the leading space for \texttt{font}), +% and the code boils down to a string comparison % between the result of the auxiliary on the \tn{meaning} of the % conditional's argument~|####1|, and~|#3|. Both are evaluated at % run-time, as this is important to get the correct escape character. @@ -2348,6 +2363,7 @@ { \tl_to_str:n { \protected } macro } \@@_tmp:w { protected_long_macro } { macro } { \token_to_str:N \protected \tl_to_str:n { \long } macro } +\@@_tmp:w { font_selection } { ~ font } { select ~ font } \@@_tmp:w { dim_register } { dimen } { \token_to_str:N \dimen } \@@_tmp:w { int_register } { count } { \token_to_str:N \count } \@@_tmp:w { muskip_register } { muskip } { \token_to_str:N \muskip } |