diff options
Diffstat (limited to 'macros/latex/contrib/l3kernel')
84 files changed, 794 insertions, 725 deletions
diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md index 82782d208d..a889c04c8c 100644 --- a/macros/latex/contrib/l3kernel/CHANGELOG.md +++ b/macros/latex/contrib/l3kernel/CHANGELOG.md @@ -7,6 +7,19 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-11-12] + +### Fixed +- DeviceN colorspace conversions with alternative model RGB + +### Added +- `.str_set:N`, etc., key properties (issue #1007) +- `\bool_to_str:n` (issue #1010) + +### Changed +- `\prop_..._from_keyval:Nn` functions now support active comma or + equal sign (pull #1012) + ## [2021-10-18] ### Added @@ -971,7 +984,8 @@ this project uses date-based 'snapshot' version identifiers. - Step functions have been added for dim variables, e.g. `\dim_step_inline:nnnn` -[Unreleased]: https://github.com/latex3/latex3/compare/2021-10-18...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-11-12...HEAD +[2021-11-12]: https://github.com/latex3/latex3/compare/2021-10-18...2021-11-12 [2021-10-18]: https://github.com/latex3/latex3/compare/2021-10-17...2021-10-18 [2021-10-17]: https://github.com/latex3/latex3/compare/2021-10-12...2021-10-17 [2021-10-12]: https://github.com/latex3/latex3/compare/2021-08-27...2021-10-12 diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md index 0ceca4ca19..027c1c9636 100644 --- a/macros/latex/contrib/l3kernel/README.md +++ b/macros/latex/contrib/l3kernel/README.md @@ -1,7 +1,7 @@ LaTeX3 Programming Conventions ============================== -Release 2021-10-18 +Release 2021-11-12 Overview -------- diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx index 24246f1ace..01a2dbf0fb 100644 --- a/macros/latex/contrib/l3kernel/expl3.dtx +++ b/macros/latex/contrib/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2021-10-18}% +\def\ExplFileDate{2021-11-12}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf Binary files differindex 60e57d4148..92b32349e6 100644 --- a/macros/latex/contrib/l3kernel/expl3.pdf +++ b/macros/latex/contrib/l3kernel/expl3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf Binary files differindex 19980978f9..eee082fa60 100644 --- a/macros/latex/contrib/l3kernel/interface3.pdf +++ b/macros/latex/contrib/l3kernel/interface3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex index b2c52db293..f64cd3abbb 100644 --- a/macros/latex/contrib/l3kernel/interface3.tex +++ b/macros/latex/contrib/l3kernel/interface3.tex @@ -54,7 +54,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx index d54bc9a70a..5b810b393d 100644 --- a/macros/latex/contrib/l3kernel/l3basics.dtx +++ b/macros/latex/contrib/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1203,7 +1203,7 @@ % Tests whether the \meta{control sequence} is currently free to % be defined. This test is \texttt{false} if the % \meta{control sequence} currently exists (as defined by -% \cs{cs_if_exist:N}). +% \cs{cs_if_exist:NTF}). % \end{function} % % \subsection{Primitive conditionals} diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx index c0c676dd9f..7cf40957e7 100644 --- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx +++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx index 8e000f70f5..c71f489712 100644 --- a/macros/latex/contrib/l3kernel/l3box.dtx +++ b/macros/latex/contrib/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx index e0787f1a0e..ebfb71b81e 100644 --- a/macros/latex/contrib/l3kernel/l3candidates.dtx +++ b/macros/latex/contrib/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3cctab.dtx b/macros/latex/contrib/l3kernel/l3cctab.dtx index 0d53ada539..4669bcc875 100644 --- a/macros/latex/contrib/l3kernel/l3cctab.dtx +++ b/macros/latex/contrib/l3kernel/l3cctab.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -699,7 +699,7 @@ % % \subsection{Category code table conditionals} % -% \begin{macro}{\cctab_if_exist:N,\cctab_if_exist:c} +% \begin{macro}[pTF]{\cctab_if_exist:N,\cctab_if_exist:c} % Checks whether a \meta{cctab~var} is defined. % \begin{macrocode} \prg_new_eq_conditional:NNn \cctab_if_exist:N \cs_if_exist:N diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx index 8ca665469b..718c75d07a 100644 --- a/macros/latex/contrib/l3kernel/l3clist.dtx +++ b/macros/latex/contrib/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx index 1a47fa6b73..ca112398ab 100644 --- a/macros/latex/contrib/l3kernel/l3coffins.dtx +++ b/macros/latex/contrib/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3color.dtx b/macros/latex/contrib/l3kernel/l3color.dtx index cef2e7bef1..b3f10132d3 100644 --- a/macros/latex/contrib/l3kernel/l3color.dtx +++ b/macros/latex/contrib/l3kernel/l3color.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -654,20 +654,20 @@ \tl_set:Nx #4 { \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w } - { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop } + { \use:c { @@_convert_ #1 _ #2 :w } #3 \s_@@_stop } { \use:c { c_@@_fallback_ #2 _tl } } } } \cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV } -\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop +\cs_new:Npn \@@_convert_gray_rgb:w #1 \s_@@_stop { #1 ~ #1 ~ #1 } -\cs_new:Npn \@@_convert_gray_cmyk:w #1 ~ #2 \s_@@_stop +\cs_new:Npn \@@_convert_gray_cmyk:w #1 \s_@@_stop { 0 ~ 0 ~ 0 ~ \fp_eval:n { 1 - #1 } } % \end{macrocode} % These rather odd values are based on \textsc{ntsc} television: the set are % used for the |cmyk| conversion. % \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop +\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 \s_@@_stop { \fp_eval:n { 0.3 * #1 + 0.59 * #2 + 0.11 * #3 } } % \end{macrocode} % The conversion from |rgb| to |cmyk| is the most complex: a two-step @@ -677,7 +677,7 @@ % Moreover, as the likelihood of anyone using a non-unitary matrix here is % tiny, we simplify and treat those two concepts as no-ops. % \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop +\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 \s_@@_stop { \exp_args:Nf \@@_convert_rgb_cmyk:nnnn { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } } {#1} {#2} {#3} @@ -689,9 +689,9 @@ \fp_eval:n { min ( 1 , max ( 0 , 1 - #4 - #1 ) ) } \c_space_tl #1 } -\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop +\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop { \fp_eval:n { 1 - min ( 1 , 0.3 * #1 + 0.59 * #2 + 0.11 * #3 + #4 ) } } -\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop +\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop { \fp_eval:n { 1 - min ( 1 , #1 + #4 ) } \c_space_tl \fp_eval:n { 1 - min ( 1 , #2 + #4 ) } \c_space_tl @@ -1664,7 +1664,10 @@ { \fp_compare:nNnTF {#1} = { 0 } { 00 } - { \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } } + { + \fp_compare:nNnT { #1 * 255 } < { 16 } { 0 } + \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } + } } \cs_new_protected:cpn { @@_export_space-sep-rgb:Nw } #1#2 \s_@@_stop { \tl_set:Nn #1 {#2} } @@ -1930,7 +1933,7 @@ } \cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #4} ~ @@ -1945,7 +1948,7 @@ } \cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #4} ~ @@ -1959,16 +1962,16 @@ } \cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ @@ -1982,11 +1985,11 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_model_convert:nnn #1#2#3 { - \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 \s_@@_stop { \exp_not:N \exp_args:NNe \exp_not:N \use:nn \exp_not:c { @@_convert_ #2 _ #3 :w } - { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 ~ ##2 \s_@@_stop } + { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 \s_@@_stop } \c_space_tl \exp_not:N \s_@@_stop } } @@ -2018,11 +2021,11 @@ \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl } { \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 } - \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 \s_@@_stop { 0 ~ 0 ~ 0 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 \s_@@_stop { 1 ~ 1 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 \s_@@_stop { 1 } } { @@ -2311,7 +2314,7 @@ \prop_get:NnN \g_@@_alternative_values_prop {##1} \l_@@_value_tl \exp_after:wN \@@_model_devicen_transform:w - \l_@@_value_tl , 0 , 0 , 0 \s_@@_stop {#1} {#2} + \l_@@_value_tl , 0 , 0 , 0 , \s_@@_stop {#1} {#2} } \tl_put_right:Nx \l_@@_internal_tl { @@ -2349,7 +2352,7 @@ { \@@_model_devicen_transform:nnn {#5} { 1 } {#1} } \cs_new_protected:cpn { @@_model_devicen_transform_3:nnnnn } #1#2#3#4#5 { - \clist_map_inline { #1 , #2 , #3 } + \clist_map_inline:nn { #1 , #2 , #3 } { \@@_model_devicen_transform:nnn {#5} { 3 } {##1} } } \cs_new_protected:cpn { @@_model_devicen_transform_4:nnnnn } #1#2#3#4#5 @@ -2407,8 +2410,9 @@ { \exp_not:c { @@_convert_devicen_ #2 : \prg_replicate:nn {#3} { n } w } \prg_replicate:nn {#3} { { 1 } } - ##1 \exp_not:N \s_@@_mark + ##1 ~ \exp_not:N \s_@@_mark \clist_map_function:nN {#4} \@@_model_devicen_convert:n + {} \exp_not:N \s_@@_stop } } @@ -2490,7 +2494,7 @@ \cs_new:Npn \@@_convert_devicen_rgb:nnnw #1#2#3#4 ~ #5 \s_@@_mark #6#7 \s_@@_stop { - \@@_convert_devicen_cmyk:nnnnnn {#4} {#1} {#2} {#3} #6 + \@@_convert_devicen_rgb:nnnnnnn {#4} {#1} {#2} {#3} #6 #5 \s_@@_mark #7 \s_@@_stop } \cs_new:Npn \@@_convert_devicen_rgb:nnnnnnn #1#2#3#4#5#6#7 diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx index cbc2ba0dd3..39c210f013 100644 --- a/macros/latex/contrib/l3kernel/l3debug.dtx +++ b/macros/latex/contrib/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx index 118446f74d..c4ac6b343f 100644 --- a/macros/latex/contrib/l3kernel/l3deprecation.dtx +++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx index f8ddfd6744..3926f4298b 100644 --- a/macros/latex/contrib/l3kernel/l3doc.dtx +++ b/macros/latex/contrib/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % \tableofcontents % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx index 77b11bec37..56d569dc86 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.dtx +++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf Binary files differindex 62968c5aa0..2a9399305e 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.pdf +++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx index de04809b76..ff7dafb094 100644 --- a/macros/latex/contrib/l3kernel/l3expan.dtx +++ b/macros/latex/contrib/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx index e2c608cdfc..59322d5c92 100644 --- a/macros/latex/contrib/l3kernel/l3file.dtx +++ b/macros/latex/contrib/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -876,8 +876,8 @@ % \cs{file_if_exist_input:nF} \Arg{file name} \Arg{false code} % \end{syntax} % Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by -% \cs{file_path_include:n}. If found then +% path and the additional paths included in \cs{l_file_search_path_seq}. +% If found then % reads in the file as additional \LaTeX{} source as described for % \cs{file_input:n}, otherwise inserts the \meta{false code}. % Note that these functions do not raise diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx index 7a6712d474..86e6f65a9b 100644 --- a/macros/latex/contrib/l3kernel/l3flag.dtx +++ b/macros/latex/contrib/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx index 357481da6b..18ed230b7f 100644 --- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx index e735876dd4..edae5678c2 100644 --- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx index bb869cd5ca..759a6e1c92 100644 --- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx index b113e024f7..0ae265ad82 100644 --- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx index f5f58acbe6..89769f7ad8 100644 --- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1000,8 +1000,7 @@ \cs_new:Npn \@@_pow_normal_o:ww \s_@@ \@@_chk:w 1 #1#2#3; \s_@@ \@@_chk:w #4#5 { - \if_int_compare:w \@@_str_if_eq:nn { #2 #3 } - { 1 {1000} {0000} {0000} {0000} } = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { #2 #3 } { 1 {1000} {0000} {0000} {0000} } \if_int_compare:w #4 #1 = 32 \exp_stop_f: \exp_after:wN \@@_case_return_ii_o:ww \fi: diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx index 820faac536..ee1a7dfbed 100644 --- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx index 254983bcad..64f25bcd70 100644 --- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx index c07bbc130f..e2648f74fa 100644 --- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1755,9 +1755,7 @@ { \if_catcode:w \scan_stop: \exp_not:N #1 \if_meaning:w \scan_stop: #1 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@ } { \exp_not:N #1 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@ } { \exp_not:N #1 } 0 \msg_expandable_error:nnn { fp } { after-e } { floating~point~ } @@ -1769,9 +1767,7 @@ \prg_return_false: \fi: \else: - \if_int_compare:w - \@@_str_if_eq:nn { \int_value:w #1 } { \tex_the:D #1 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \int_value:w #1 } { \tex_the:D #1 } \int_value:w #1 \else: 0 @@ -2263,9 +2259,7 @@ \cs_new:Npn \@@_parse_infix:NN #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN \else: @@ -2315,9 +2309,7 @@ \cs_new:Npn \@@_parse_infix_after_paren:NN #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN \else: diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx index 8defd82e8a..2edef81d72 100644 --- a/macros/latex/contrib/l3kernel/l3fp-random.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx index 4669afeff6..f261a87690 100644 --- a/macros/latex/contrib/l3kernel/l3fp-round.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx index d12dfb5e9f..41736a6c92 100644 --- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx index e7147443b1..4ae3c33f4b 100644 --- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx index eef38c230f..ed3468a076 100644 --- a/macros/latex/contrib/l3kernel/l3fp.dtx +++ b/macros/latex/contrib/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx index 9646b84a94..5afd5f774a 100644 --- a/macros/latex/contrib/l3kernel/l3fparray.dtx +++ b/macros/latex/contrib/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx index 1e5ded3b6b..749de68557 100644 --- a/macros/latex/contrib/l3kernel/l3int.dtx +++ b/macros/latex/contrib/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx index 13ba3a394c..3d95e6e04b 100644 --- a/macros/latex/contrib/l3kernel/l3intarray.dtx +++ b/macros/latex/contrib/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx index bdc195d0a1..e9da0d7e8c 100644 --- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx +++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx index e85bbc1d97..355de420bd 100644 --- a/macros/latex/contrib/l3kernel/l3keys.dtx +++ b/macros/latex/contrib/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -178,10 +178,10 @@ % \begin{function}[updated = 2013-07-08] % {.bool_set:N, .bool_set:c, .bool_gset:N, .bool_gset:c} % \begin{syntax} -% \meta{key} .bool_set:N = \meta{boolean} +% \meta{key} .bool_set:N = \meta{boolean variable} % \end{syntax} -% Defines \meta{key} to set \meta{boolean} to \meta{value} (which -% must be either \texttt{true} or \texttt{false}). If the variable +% Defines \meta{key} to set \meta{boolean variable} to \meta{value} (which +% must be either \enquote{\texttt{true}} or \enquote{\texttt{false}}). If the variable % does not exist, it will be created globally at the point that % the key is set up. % \end{function} @@ -192,12 +192,12 @@ % .bool_gset_inverse:N, .bool_gset_inverse:c % } % \begin{syntax} -% \meta{key} .bool_set_inverse:N = \meta{boolean} +% \meta{key} .bool_set_inverse:N = \meta{boolean variable} % \end{syntax} -% Defines \meta{key} to set \meta{boolean} to the logical -% inverse of \meta{value} (which must be either \texttt{true} or -% \texttt{false}). -% If the \meta{boolean} does not exist, it will be created globally +% Defines \meta{key} to set \meta{boolean variable} to the logical +% inverse of \meta{value} (which must be either \enquote{\texttt{true}} or +% \enquote{\texttt{false}}). +% If the \meta{boolean variable} does not exist, it will be created globally % at the point that the key is set up. % \end{function} % @@ -435,6 +435,27 @@ % require a value at point-of-use unless a default is set. % \end{function} % +% \begin{function}[added = 2021-10-30] +% {.str_set:N, .str_set:c, .str_gset:N, .str_gset:c} +% \begin{syntax} +% \meta{key} .str_set:N = \meta{string variable} +% \end{syntax} +% Defines \meta{key} to set \meta{string variable} to \meta{value}. +% If the variable does not exist, it is created globally +% at the point that the key is set up. +% \end{function} +% +% \begin{function}[added = 2021-10-30] +% {.str_set_x:N, .str_set_x:c, .str_gset_x:N, .str_gset_x:c} +% \begin{syntax} +% \meta{key} .str_set_x:N = \meta{string variable} +% \end{syntax} +% Defines \meta{key} to set \meta{string variable} to \meta{value}, +% which will be subjected to an \texttt{x}-type expansion +% (\emph{i.e.}~using \cs{str_set:Nx}). If the variable does not exist, +% it is created globally at the point that the key is set up. +% \end{function} +% % \begin{function}{.tl_set:N, .tl_set:c, .tl_gset:N, .tl_gset:c} % \begin{syntax} % \meta{key} .tl_set:N = \meta{token list variable} @@ -467,7 +488,7 @@ % \end{syntax} % Specifies that \meta{key} cannot receive a \meta{value} when used. % If a \meta{value} is given then an error will be issued. Setting -% the property \texttt{false} cancels the restriction. +% the property \enquote{\texttt{false}} cancels the restriction. % \end{function} % % \begin{function}[added = 2015-07-14]{.value_required:n} @@ -476,7 +497,7 @@ % \end{syntax} % Specifies that \meta{key} must receive a \meta{value} when used. % If a \meta{value} is not given then an error will be issued. Setting -% the property \texttt{false} cancels the restriction. +% the property \enquote{\texttt{false}} cancels the restriction. % \end{function} % % \section{Sub-dividing keys} @@ -1001,6 +1022,16 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\l__kernel_keyval_allow_blank_keys_bool} +% The general behavior of the \pkg{l3keys} module is to throw an error on +% blank key names. However to support the usage of \cs{keyval_parse:nnn} in +% the \pkg{l3prop} module we allow this error to be switched off temporarily +% and just ignore blank names. +% \begin{macrocode} +\bool_new:N \l__kernel_keyval_allow_blank_keys_bool +% \end{macrocode} +% \end{variable} +% % This temporary macro will be used since some of the definitions will need an % active comma or equals sign. Inside of this macro |#1| will be the active % comma and |#2| will be the active equals sign. @@ -1343,9 +1374,11 @@ % \begin{macrocode} \cs_new:Npn \@@_blank_true:w \s_@@_mark \s_@@_stop \@@_trim:nN #1 \@@_key:nn { \@@_loop_other:nnw } -\cs_new:Npn \@@_blank_key_error:w #1 \@@_loop_other:nnw +\cs_new:Npn \@@_blank_key_error:w \s_@@_mark \s_@@_stop #1 \@@_loop_other:nnw { - \msg_expandable_error:nn { keyval } { blank-key-name } + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { #1 } + { \msg_expandable_error:nn { keyval } { blank-key-name } } \@@_loop_other:nnw } % \end{macrocode} @@ -2052,7 +2085,7 @@ } { \msg_error:nnx { keys } - { property-boolean-values-only } + { boolean-values-only } { .value_ #1 :n } } } @@ -2398,6 +2431,34 @@ % \end{macro} % \end{macro} % +% \begin{macro}{.str_set:N, .str_set:c} +% \begin{macro}{.str_gset:N, .str_gset:c} +% \begin{macro}{.str_set_x:N, .str_set_x:c} +% \begin{macro}{.str_gset_x:N, .str_gset_x:c} +% Setting a variable is very easy: just pass the data along. +% \begin{macrocode} +\cs_new_protected:cpn { \c_@@_props_root_str .str_set:N } #1 + { \@@_variable_set:NnnN #1 { str } { } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set:c } #1 + { \@@_variable_set:cnnN {#1} { str } { } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set_x:N } #1 + { \@@_variable_set:NnnN #1 { str } { } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set_x:c } #1 + { \@@_variable_set:cnnN {#1} { str } { } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset:N } #1 + { \@@_variable_set:NnnN #1 { str } { g } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset:c } #1 + { \@@_variable_set:cnnN {#1} { str } { g } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset_x:N } #1 + { \@@_variable_set:NnnN #1 { str } { g } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset_x:c } #1 + { \@@_variable_set:cnnN {#1} { str } { g } x } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{.tl_set:N, .tl_set:c} % \begin{macro}{.tl_gset:N, .tl_gset:c} % \begin{macro}{.tl_set_x:N, .tl_set_x:c} diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx index 29872a655f..c04f318fad 100644 --- a/macros/latex/contrib/l3kernel/l3legacy.dtx +++ b/macros/latex/contrib/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx index f95ddecc82..ac63d0f89a 100644 --- a/macros/latex/contrib/l3kernel/l3luatex.dtx +++ b/macros/latex/contrib/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx index 722f902e29..5804d528ca 100644 --- a/macros/latex/contrib/l3kernel/l3msg.dtx +++ b/macros/latex/contrib/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1979,7 +1979,7 @@ \msg_new:nnn { prg } { negative-replication } { Negative~argument~for~\iow_char:N\\prg_replicate:nn. } \msg_new:nnn { prop } { prop-keyval } - { Missing/extra~'='~in~'#1'~(in~'..._keyval:Nn') } + { Missing~'='~in~'#1'~(in~'..._keyval:Nn') } \msg_new:nnn { kernel } { unknown-comparison } { Relation~'#1'~not~among~=,<,>,==,!=,<=,>=. } \msg_new:nnn { kernel } { zero-step } diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx index 9a34a74d24..2f3c8460ca 100644 --- a/macros/latex/contrib/l3kernel/l3names.dtx +++ b/macros/latex/contrib/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf Binary files differindex aea97df6cd..e1c52b5cc3 100644 --- a/macros/latex/contrib/l3kernel/l3news.pdf +++ b/macros/latex/contrib/l3kernel/l3news.pdf diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf Binary files differindex 8ca02b765d..1b6dc0fbe3 100644 --- a/macros/latex/contrib/l3kernel/l3news01.pdf +++ b/macros/latex/contrib/l3kernel/l3news01.pdf diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf Binary files differindex d4f88d8113..28c7194858 100644 --- a/macros/latex/contrib/l3kernel/l3news02.pdf +++ b/macros/latex/contrib/l3kernel/l3news02.pdf diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf Binary files differindex 6ff2937537..a52b994d20 100644 --- a/macros/latex/contrib/l3kernel/l3news03.pdf +++ b/macros/latex/contrib/l3kernel/l3news03.pdf diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf Binary files differindex 42b13884be..dcaa766fd7 100644 --- a/macros/latex/contrib/l3kernel/l3news04.pdf +++ b/macros/latex/contrib/l3kernel/l3news04.pdf diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf Binary files differindex 87426871bc..5110b7df1a 100644 --- a/macros/latex/contrib/l3kernel/l3news05.pdf +++ b/macros/latex/contrib/l3kernel/l3news05.pdf diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf Binary files differindex 825152e720..7f5bd08342 100644 --- a/macros/latex/contrib/l3kernel/l3news06.pdf +++ b/macros/latex/contrib/l3kernel/l3news06.pdf diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf Binary files differindex 3309098d71..57e35fbd7c 100644 --- a/macros/latex/contrib/l3kernel/l3news07.pdf +++ b/macros/latex/contrib/l3kernel/l3news07.pdf diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf Binary files differindex beed982815..28c0de51a5 100644 --- a/macros/latex/contrib/l3kernel/l3news08.pdf +++ b/macros/latex/contrib/l3kernel/l3news08.pdf diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf Binary files differindex 4e7870ec4e..571f491b28 100644 --- a/macros/latex/contrib/l3kernel/l3news09.pdf +++ b/macros/latex/contrib/l3kernel/l3news09.pdf diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf Binary files differindex 6c12559b81..d0239237a2 100644 --- a/macros/latex/contrib/l3kernel/l3news10.pdf +++ b/macros/latex/contrib/l3kernel/l3news10.pdf diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf Binary files differindex 36b254b236..e5cc04782c 100644 --- a/macros/latex/contrib/l3kernel/l3news11.pdf +++ b/macros/latex/contrib/l3kernel/l3news11.pdf diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf Binary files differindex b199276937..b619536016 100644 --- a/macros/latex/contrib/l3kernel/l3news12.pdf +++ b/macros/latex/contrib/l3kernel/l3news12.pdf diff --git a/macros/latex/contrib/l3kernel/l3pdf.dtx b/macros/latex/contrib/l3kernel/l3pdf.dtx index 0ccb6817f1..8a4b70eb16 100644 --- a/macros/latex/contrib/l3kernel/l3pdf.dtx +++ b/macros/latex/contrib/l3kernel/l3pdf.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf Binary files differindex cdaa3fe63b..06fe96aef0 100644 --- a/macros/latex/contrib/l3kernel/l3prefixes.pdf +++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx index ae119af206..4a91ce9a8a 100644 --- a/macros/latex/contrib/l3kernel/l3prg.dtx +++ b/macros/latex/contrib/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -313,6 +313,16 @@ % based on this result. % \end{function} % +% \begin{function}[EXP, added = 2021-11-01]{\bool_to_str:N, \bool_to_str:c, \bool_to_str:n} +% \begin{syntax} +% \cs{bool_to_str:N} \meta{boolean} +% \cs{bool_to_str:n} \meta{boolean expression} +% \end{syntax} +% Expands to the letters \texttt{true} or \texttt{false} depending on +% the logical truth of the \meta{boolean} or \meta{boolean +% expression}. +% \end{function} +% % \begin{function}[added = 2012-02-09, updated = 2021-04-29]{\bool_show:N, \bool_show:c} % \begin{syntax} % \cs{bool_show:N} \meta{boolean} @@ -961,20 +971,24 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[EXP]{\bool_to_str:N, \bool_to_str:c, \bool_to_str:n} +% Expands to \texttt{true} or \texttt{false} with category code letter. +% \begin{macrocode} +\cs_new:Npn \bool_to_str:N #1 { \bool_if:NTF #1 { true } { false } } +\cs_generate_variant:Nn \bool_to_str:N { c } +\cs_new:Npn \bool_to_str:n #1 { \bool_if:nTF {#1} { true } { false } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\bool_show:n, \bool_log:n} -% \begin{macro}{\@@_to_str:n} -% Show the truth value of the boolean, as \texttt{true} or -% \texttt{false}. +% Show the truth value of the boolean. % \begin{macrocode} \cs_new_protected:Npn \bool_show:n - { \msg_show_eval:Nn \@@_to_str:n } + { \msg_show_eval:Nn \bool_to_str:n } \cs_new_protected:Npn \bool_log:n - { \msg_log_eval:Nn \@@_to_str:n } -\cs_new:Npn \@@_to_str:n #1 - { \bool_if:nTF {#1} { true } { false } } + { \msg_log_eval:Nn \bool_to_str:n } % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{\bool_show:N, \bool_show:c, \bool_log:N, \bool_log:c, \@@_show:NN} % Show the truth value of the boolean, as \texttt{true} or diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx index df20a5c02c..ca6f9a3467 100644 --- a/macros/latex/contrib/l3kernel/l3prop.dtx +++ b/macros/latex/contrib/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -52,10 +52,10 @@ % \LaTeX3 implements a \enquote{property list} data type, which contain % an unordered list of entries each of which consists of a \meta{key} and % an associated \meta{value}. The \meta{key} and \meta{value} may both -% be any \meta{balanced text}, but the \meta{key} is processed using -% \cs{tl_to_str:n}, meaning that category codes are ignored. It is -% possible to map functions to property lists such that the function is -% applied to every key--value pair within the list. +% be any \meta{balanced text}, the \meta{key} is processed using +% \cs{tl_to_str:n}, meaning that category codes are ignored. It is possible to +% map functions to property lists such that the function is applied to every +% key--value pair within the list. % % Each entry in a property list must have a unique \meta{key}: if an entry is % added to a property list which already contains the \meta{key} then the new @@ -111,7 +111,7 @@ % \meta{property list_2}. % \end{function} % -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] +% \begin{function}[added = 2017-11-28, updated = 2021-11-07] % { % \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn, % \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn, @@ -131,9 +131,11 @@ % group then a set of outer braces is removed. This enables both the % \meta{key} and the \meta{value} to contain spaces, commas or equal % signs. The \meta{key} is then processed by \cs{tl_to_str:n}. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] +% \begin{function}[added = 2017-11-28, updated = 2021-11-07] % {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn} % \begin{syntax} % \cs{prop_const_from_keyval:Nn} \meta{prop~var} @@ -147,6 +149,8 @@ % contain key--value pairs given in the second argument, processed in % the way described for \cs{prop_set_from_keyval:Nn}. If duplicate % keys appear only the last of the values is kept. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % % \section{Adding and updating property list entries} @@ -205,7 +209,7 @@ % last value, namely the value in \meta{prop~var_3} is kept. % \end{function} % -% \begin{function}[added = 2021-05-16] +% \begin{function}[added = 2021-05-16, updated = 2021-11-07] % { % \prop_put_from_keyval:Nn, \prop_put_from_keyval:cn, % \prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn, @@ -230,6 +234,8 @@ % \cs{prop_concat:NNN}. In particular, the \meta{keys} and % \meta{values} are space-trimmed and unbraced as described in % \cs{prop_set_from_keyval:Nn}. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % % \section{Recovering values from property lists} @@ -793,7 +799,7 @@ \cs_new_protected:Npn \@@_concat:NNNN #1#2#3#4 { \prop_set_eq:NN \l_@@_internal_prop #3 - \prop_map_tokens:Nn #4 { \prop_put:Nnn \l_@@_internal_prop } + \prop_map_inline:Nn #4 { \prop_put:Nnn \l_@@_internal_prop {##1} {##2} } #1 #2 \l_@@_internal_prop } % \end{macrocode} @@ -804,16 +810,7 @@ % \begin{macro}{\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn} % \begin{macro}{\prop_put_from_keyval:Nn, \prop_put_from_keyval:cn} % \begin{macro}{\prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn} -% \begin{macro} -% { -% \@@_from_keyval:n, -% \@@_from_keyval_loop:w, -% \@@_from_keyval_split:Nw, -% \@@_from_keyval_key:n, -% \@@_from_keyval_key:w, -% \@@_from_keyval_value:n, -% \@@_from_keyval_value:w -% } +% \begin{macro}{\@@_missing_eq:n} % To avoid tracking throughout the loop the variable name and whether % the assignment is local/global, do everything in a scratch variable % and empty it afterwards to avoid wasting memory. Loop through items @@ -832,80 +829,48 @@ % output one key--value pair for the property list; otherwise complain % about a missing or extra~|=|. % \begin{macrocode} -\cs_new_protected:Npn \prop_set_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_set_from_keyval:Nn #1 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} - \prop_set_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \prop_clear:N #1 + \prop_put_from_keyval:Nn #1 } \cs_generate_variant:Nn \prop_set_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} - \prop_gset_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \prop_gclear:N #1 + \prop_gput_from_keyval:Nn #1 } \cs_generate_variant:Nn \prop_gset_from_keyval:Nn { c } \cs_new_protected:Npn \prop_const_from_keyval:Nn #1#2 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} + \prop_set_from_keyval:Nn \l_@@_internal_prop {#2} \tl_const:Nx #1 { \exp_not:o \l_@@_internal_prop } \prop_clear:N \l_@@_internal_prop } \cs_generate_variant:Nn \prop_const_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_put_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_put_from_keyval:Nn { - \prop_set_eq:NN \l_@@_internal_prop #1 - \@@_from_keyval:n {#2} - \prop_set_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { \@@_keyval_parse:NNNn \c_true_bool } + { \@@_keyval_parse:NNNn \c_false_bool } + \prop_put:Nnn } \cs_generate_variant:Nn \prop_put_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_gput_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_gput_from_keyval:Nn { - \prop_set_eq:NN \l_@@_internal_prop #1 - \@@_from_keyval:n {#2} - \prop_gset_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { \@@_keyval_parse:NNNn \c_true_bool } + { \@@_keyval_parse:NNNn \c_false_bool } + \prop_gput:Nnn } \cs_generate_variant:Nn \prop_gput_from_keyval:Nn { c } -\cs_new_protected:Npn \@@_from_keyval:n #1 - { - \@@_from_keyval_loop:w \prg_do_nothing: #1 , - \q_@@_recursion_tail , \q_@@_recursion_stop - } -\cs_new_protected:Npn \@@_from_keyval_loop:w #1 , - { - \@@_if_recursion_tail_stop:o {#1} - \@@_from_keyval_split:Nw \@@_from_keyval_key:n - #1 = = \s_@@_stop {#1} - \@@_from_keyval_loop:w \prg_do_nothing: - } -\cs_new_protected:Npn \@@_from_keyval_split:Nw #1#2 = - { \tl_trim_spaces_apply:oN {#2} #1 } -\cs_new_protected:Npn \@@_from_keyval_key:n #1 - { \@@_from_keyval_key:w #1 \s_@@_mark } -\cs_new_protected:Npn \@@_from_keyval_key:w #1 \s_@@_mark #2 \s_@@_stop +\cs_new_protected:Npn \@@_missing_eq:n + { \msg_error:nnn { prop } { prop-keyval } } +\cs_new_protected:Npn \@@_keyval_parse:NNNn #1#2#3#4 { - \@@_from_keyval_split:Nw \@@_from_keyval_value:n - \prg_do_nothing: #2 \s_@@_stop {#1} - } -\cs_new_protected:Npn \@@_from_keyval_value:n #1 - { \@@_from_keyval_value:w #1 \s_@@_mark } -\cs_new_protected:Npn \@@_from_keyval_value:w #1 \s_@@_mark #2 \s_@@_stop #3#4 - { - \tl_if_single:nTF {#2} - { \prop_put:Nnn \l_@@_internal_prop {#3} {#1} } - { - \tl_if_empty:nF { #3 #1 #2 } - { - \msg_error:nnx { prop } { prop-keyval } - { \exp_not:o {#4} } - } - } + \bool_set_eq:NN \l__kernel_keyval_allow_blank_keys_bool \c_true_bool + \keyval_parse:nnn \@@_missing_eq:n { #2 #3 } {#4} + \bool_set_eq:NN \l__kernel_keyval_allow_blank_keys_bool #1 } % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx index a2d1080356..907bd9453e 100644 --- a/macros/latex/contrib/l3kernel/l3quark.dtx +++ b/macros/latex/contrib/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx index db1ddee245..ac70e76eea 100644 --- a/macros/latex/contrib/l3kernel/l3regex.dtx +++ b/macros/latex/contrib/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -83,11 +83,12 @@ % % If a regular expression is to be used several times, % it can be compiled once, and stored in a regex -% variable using \cs{regex_const:Nn}. For example, +% variable using \cs{regex_set:Nn}. For example, % \begin{verbatim} -% \regex_const:Nn \c_foo_regex { \c{begin} \cB. (\c[^BE].*) \cE. } +% \regex_new:N \l_foo_regex +% \regex_set:Nn \l_foo_regex { \c{begin} \cB. (\c[^BE].*) \cE. } % \end{verbatim} -% stores in \cs[no-index]{c_foo_regex} a regular expression which matches the +% stores in \cs[no-index]{l_foo_regex} a regular expression which matches the % starting marker for an environment: \cs[no-index]{begin}, followed by a % begin-group token (|\cB.|), then any number of tokens which are % neither begin-group nor end-group character tokens (|\c[^BE].*|), @@ -164,7 +165,7 @@ % |\A|, |\B|, \ldots{} have special meanings; % \item non-alphanumeric printable ascii characters can (and should) % always be escaped: many of them have special meanings (\emph{e.g.}, -% use |\(|, |\)|, |\?|, |\.|); +% use |\(|, |\)|, |\?|, |\.|, |\^|); % \item spaces should always be escaped (even in character % classes); % \item any other character may be escaped or not, without any @@ -335,11 +336,14 @@ % \meta{regex}, anchored at the beginning and end, so that |\c{begin}| % matches exactly \cs[no-index]{begin}, and nothing else. % \item[\\cX] Applies to the next object, which can be a character, -% character property, class, or group, and forces this object to -% only match tokens with category |X| (any of |CBEMTPUDSLOA|. For -% instance, |\cL[A-Z\d]| matches uppercase letters and digits of -% category code letter, |\cC.| matches any control sequence, and -% |\cO(abc)| matches |abc| where each character has category other. +% escape character sequence such as |\x{0A}|, character class, or +% group, and forces this object to only match tokens with category +% |X| (any of |CBEMTPUDSLOA|. For instance, |\cL[A-Z\d]| matches +% uppercase letters and digits of category code letter, |\cC.| +% matches any control sequence, and |\cO(abc)| matches |abc| where +% each character has category other.\footnote{This last example also +% captures \enquote{\texttt{abc}} as a regex group; to avoid this +% use a non-capturing group \texttt{\textbackslash cO(?:abc)}.} % \item[{\\c[XYZ]}] Applies to the next object, and forces it to only % match tokens with category |X|, |Y|, or |Z| (each being any of % |CBEMTPUDSLOA|). For instance, |\c[LSO](..)| matches two tokens of @@ -531,21 +535,27 @@ % \meta{regex~var} is initially such that it never matches. % \end{function} % -% \begin{function}[added = 2017-05-26] -% {\regex_set:Nn, \regex_gset:Nn, \regex_const:Nn} +% \begin{function}[added = 2017-05-26]{\regex_set:Nn, \regex_gset:Nn} % \begin{syntax} % \cs{regex_set:Nn} \meta{regex~var} \Arg{regex} % \end{syntax} -% Stores a compiled version of the \meta{regular expression} -% in the \meta{regex~var}. For instance, this function can be used -% as +% Stores a compiled version of the \meta{regular expression} in the +% \meta{regex~var}. The assignment is local for \cs{regex_set:Nn} and +% global for \cs{regex_gset:Nn}. For instance, this function can be +% used as % \begin{verbatim} % \regex_new:N \l_my_regex % \regex_set:Nn \l_my_regex { my\ (simple\ )? reg(ex|ular\ expression) } % \end{verbatim} -% The assignment is local for \cs{regex_set:Nn} and global for -% \cs{regex_gset:Nn}. Use \cs{regex_const:Nn} for compiled expressions -% which never change. +% \end{function} +% +% \begin{function}[added = 2017-05-26]{\regex_const:Nn} +% \begin{syntax} +% \cs{regex_const:Nn} \meta{regex~var} \Arg{regex} +% \end{syntax} +% Creates a new constant \meta{regex~var} or raises an error if the name +% is already taken. The value of the \meta{regex~var} is set +% globally to the compiled version of the \meta{regular expression}. % \end{function} % % \begin{function}[added = 2021-04-26, updated = 2021-04-29] @@ -722,7 +732,7 @@ % locally to \meta{tl~var}. % \end{function} % -% \section{Constants and variables} +% \section{Scratch regular expressions} % % \begin{variable}[added = 2017-12-11]{\l_tmpa_regex, \l_tmpb_regex} % Scratch regex for local assignment. These are never used by diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx index 5585aa3ddb..5420a6df3e 100644 --- a/macros/latex/contrib/l3kernel/l3seq.dtx +++ b/macros/latex/contrib/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx index 1556f14ed8..ef814af3f9 100644 --- a/macros/latex/contrib/l3kernel/l3skip.dtx +++ b/macros/latex/contrib/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx index 8261afa088..6315417c35 100644 --- a/macros/latex/contrib/l3kernel/l3sort.dtx +++ b/macros/latex/contrib/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx index 72c260cdc0..edc2dd3cf5 100644 --- a/macros/latex/contrib/l3kernel/l3str-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx index e84e2162a2..40fd7437f0 100644 --- a/macros/latex/contrib/l3kernel/l3str.dtx +++ b/macros/latex/contrib/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -95,7 +95,7 @@ % appropriately. % \end{itemize} % -% \section{Building strings} +% \section{Creating and initialising string variables} % % \begin{function}[added = 2015-09-18]{\str_new:N, \str_new:c} % \begin{syntax} @@ -164,6 +164,16 @@ % this function does not convert their contents to a string. % \end{function} % +% \begin{function}[EXP, pTF, added = 2015-09-18] +% {\str_if_exist:N, \str_if_exist:c} +% \begin{syntax} +% \cs{str_if_exist_p:N} \meta{str~var} +% \cs{str_if_exist:NTF} \meta{str~var} \Arg{true code} \Arg{false code} +% \end{syntax} +% Tests whether the \meta{str~var} is currently defined. This does not +% check that the \meta{str~var} really is a string. +% \end{function} +% % \section{Adding data to string variables} % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] @@ -210,84 +220,8 @@ % var} are not automatically converted to a string. % \end{function} % -% \section{Modifying string variables} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_replace_once:Nnn, \str_replace_once:cnn, -% \str_greplace_once:Nnn, \str_greplace_once:cnn -% } -% \begin{syntax} -% \cs{str_replace_once:Nnn} \meta{str~var} \Arg{old} \Arg{new} -% \end{syntax} -% Converts the \meta{old} and \meta{new} token lists to strings, then -% replaces the first (leftmost) occurrence of \meta{old string} in the -% \meta{str~var} with \meta{new string}. -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_replace_all:Nnn, \str_replace_all:cnn, -% \str_greplace_all:Nnn, \str_greplace_all:cnn -% } -% \begin{syntax} -% \cs{str_replace_all:Nnn} \meta{str~var} \Arg{old} \Arg{new} -% \end{syntax} -% Converts the \meta{old} and \meta{new} token lists to strings, then -% replaces all occurrences of \meta{old string} in the -% \meta{str~var} with \meta{new string}. -% As this function -% operates from left to right, the pattern \meta{old string} -% may remain after the replacement (see \cs{str_remove_all:Nn} -% for an example). -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_remove_once:Nn, \str_remove_once:cn, -% \str_gremove_once:Nn, \str_gremove_once:cn -% } -% \begin{syntax} -% \cs{str_remove_once:Nn} \meta{str~var} \Arg{token list} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then -% removes the first (leftmost) occurrence of \meta{string} from the -% \meta{str~var}. -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_remove_all:Nn, \str_remove_all:cn, -% \str_gremove_all:Nn, \str_gremove_all:cn -% } -% \begin{syntax} -% \cs{str_remove_all:Nn} \meta{str~var} \Arg{token list} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then -% removes all occurrences of \meta{string} from the -% \meta{str~var}. -% As this function -% operates from left to right, the pattern \meta{string} -% may remain after the removal, for instance, -% \begin{quote} -% \cs{str_set:Nn} \cs{l_tmpa_str} |{abbccd}| -% \cs{str_remove_all:Nn} \cs{l_tmpa_str} |{bc}| -% \end{quote} -% results in \cs{l_tmpa_str} containing \texttt{abcd}. -% \end{function} -% % \section{String conditionals} % -% \begin{function}[EXP, pTF, added = 2015-09-18] -% {\str_if_exist:N, \str_if_exist:c} -% \begin{syntax} -% \cs{str_if_exist_p:N} \meta{str~var} -% \cs{str_if_exist:NTF} \meta{str~var} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests whether the \meta{str~var} is currently defined. This does not -% check that the \meta{str~var} really is a string. -% \end{function} -% % \begin{function}[EXP,pTF, added = 2015-09-18] % {\str_if_empty:N, \str_if_empty:c} % \begin{syntax} @@ -459,6 +393,19 @@ % receives the \meta{character} as |#1|. % \end{function} % +% \begin{function}[rEXP, added = 2021-05-05] +% {\str_map_tokens:nn, \str_map_tokens:Nn, \str_map_tokens:cn} +% \begin{syntax} +% \cs{str_map_tokens:nn} \Arg{token list} \Arg{code} +% \cs{str_map_tokens:Nn} \meta{str~var} \Arg{code} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then applies +% \meta{code} to every \meta{character} in the \meta{string} including +% spaces. The \meta{code} receives each character as a trailing brace +% group. This is equivalent to \cs{str_map_function:nN} if the +% \meta{code} consists of a single function. +% \end{function} +% % \begin{function}[added = 2017-11-14] % {\str_map_variable:nNn, \str_map_variable:NNn, \str_map_variable:cNn} % \begin{syntax} @@ -475,19 +422,6 @@ % \meta{string} is empty. See also \cs{str_map_inline:Nn}. % \end{function} % -% \begin{function}[rEXP, added = 2021-05-05] -% {\str_map_tokens:nn, \str_map_tokens:Nn, \str_map_tokens:cn} -% \begin{syntax} -% \cs{str_map_tokens:nn} \Arg{token list} \Arg{code} -% \cs{str_map_tokens:Nn} \meta{str~var} \Arg{code} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then applies -% \meta{code} to every \meta{character} in the \meta{string} including -% spaces. The \meta{code} receives each character as a trailing brace -% group. This is equivalent to \cs{str_map_function:nN} if the -% \meta{code} consists of a single function. -% \end{function} -% % \begin{function}[added = 2017-10-08, rEXP]{\str_map_break:} % \begin{syntax} % \cs{str_map_break:} @@ -698,6 +632,72 @@ % instances of |bcde|. % ^^A\end{function} % +% \section{Modifying string variables} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_replace_once:Nnn, \str_replace_once:cnn, +% \str_greplace_once:Nnn, \str_greplace_once:cnn +% } +% \begin{syntax} +% \cs{str_replace_once:Nnn} \meta{str~var} \Arg{old} \Arg{new} +% \end{syntax} +% Converts the \meta{old} and \meta{new} token lists to strings, then +% replaces the first (leftmost) occurrence of \meta{old string} in the +% \meta{str~var} with \meta{new string}. +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_replace_all:Nnn, \str_replace_all:cnn, +% \str_greplace_all:Nnn, \str_greplace_all:cnn +% } +% \begin{syntax} +% \cs{str_replace_all:Nnn} \meta{str~var} \Arg{old} \Arg{new} +% \end{syntax} +% Converts the \meta{old} and \meta{new} token lists to strings, then +% replaces all occurrences of \meta{old string} in the +% \meta{str~var} with \meta{new string}. +% As this function +% operates from left to right, the pattern \meta{old string} +% may remain after the replacement (see \cs{str_remove_all:Nn} +% for an example). +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_remove_once:Nn, \str_remove_once:cn, +% \str_gremove_once:Nn, \str_gremove_once:cn +% } +% \begin{syntax} +% \cs{str_remove_once:Nn} \meta{str~var} \Arg{token list} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then +% removes the first (leftmost) occurrence of \meta{string} from the +% \meta{str~var}. +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_remove_all:Nn, \str_remove_all:cn, +% \str_gremove_all:Nn, \str_gremove_all:cn +% } +% \begin{syntax} +% \cs{str_remove_all:Nn} \meta{str~var} \Arg{token list} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then +% removes all occurrences of \meta{string} from the +% \meta{str~var}. +% As this function +% operates from left to right, the pattern \meta{string} +% may remain after the removal, for instance, +% \begin{quote} +% \cs{str_set:Nn} \cs{l_tmpa_str} |{abbccd}| +% \cs{str_remove_all:Nn} \cs{l_tmpa_str} |{bc}| +% \end{quote} +% results in \cs{l_tmpa_str} containing \texttt{abcd}. +% \end{function} +% % \section{String manipulation} % % \begin{function}[EXP, added = 2019-11-26] @@ -1163,22 +1163,23 @@ % \str_if_eq:ee % } % Modern engines provide a direct way of comparing two token lists, -% but returning a number. This set of conditionals therefore make life -% a bit clearer. The \texttt{nn} and \texttt{xx} versions are created -% directly as this is most efficient. +% but returning a number. This set of conditionals therefore makes life +% a bit clearer. The \texttt{nn} and \texttt{ee} versions are created +% directly as this is most efficient. Since \cs{@@_if_eq:nn} will expand to +% |0| as an explicit character with category 12 if the two lists match (and +% either |-1| or |1| if they don't) we can use \cs{if:w} here which is faster +% than using \cs{if_int_compare:w}. % \begin{macrocode} \prg_new_conditional:Npnn \str_if_eq:nn #1#2 { p , T , F , TF } { - \if_int_compare:w - \@@_if_eq:nn { \exp_not:n {#1} } { \exp_not:n {#2} } - = \c_zero_int + \if:w 0 \@@_if_eq:nn { \exp_not:n {#1} } { \exp_not:n {#2} } \prg_return_true: \else: \prg_return_false: \fi: } \prg_generate_conditional_variant:Nnn \str_if_eq:nn { V , v , o , nV , no , VV , nv } { p , T , F , TF } \prg_new_conditional:Npnn \str_if_eq:ee #1#2 { p , T , F , TF } { - \if_int_compare:w \@@_if_eq:nn {#1} {#2} = \c_zero_int + \if:w 0 \@@_if_eq:nn {#1} {#2} \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} @@ -1186,14 +1187,13 @@ % % \begin{macro}[EXP, pTF] % {\str_if_eq:NN, \str_if_eq:Nc, \str_if_eq:cN, \str_if_eq:cc} -% Note that \cs{str_if_eq:NN} is different from -% \cs{tl_if_eq:NN} because it needs to ignore category codes. +% Note that \cs{str_if_eq:NNTF} is different from +% \cs{tl_if_eq:NNTF} because it needs to ignore category codes. % \begin{macrocode} \prg_new_conditional:Npnn \str_if_eq:NN #1#2 { p , TF , T , F } { - \if_int_compare:w - \@@_if_eq:nn { \tl_to_str:N #1 } { \tl_to_str:N #2 } - = \c_zero_int \prg_return_true: \else: \prg_return_false: \fi: + \if:w 0 \@@_if_eq:nn { \tl_to_str:N #1 } { \tl_to_str:N #2 } + \prg_return_true: \else: \prg_return_false: \fi: } \prg_generate_conditional_variant:Nnn \str_if_eq:NN { c , Nc , cc } { T , F , TF , p } diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf Binary files differindex 4589d6a2d2..e8ec9a0b73 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.pdf +++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex index 3b3ec1b3bf..07f8105824 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.tex +++ b/macros/latex/contrib/l3kernel/l3styleguide.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \begin{document} diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf Binary files differindex 55d08cee70..c0043ad4b1 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex index 882304511f..035b9117fc 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx index 6aab0ca25f..39b091d7df 100644 --- a/macros/latex/contrib/l3kernel/l3sys.dtx +++ b/macros/latex/contrib/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf Binary files differindex 51c0c6d52c..33d947829f 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf +++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex index 8e289903b6..88221a01da 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.tex +++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx index 4647339a81..d27bae37d2 100644 --- a/macros/latex/contrib/l3kernel/l3text-case.dtx +++ b/macros/latex/contrib/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx index 5655cc757c..f1ad3be0fc 100644 --- a/macros/latex/contrib/l3kernel/l3text-purify.dtx +++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx index defd0585f4..0fa054ccee 100644 --- a/macros/latex/contrib/l3kernel/l3text.dtx +++ b/macros/latex/contrib/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx index 84d740e6df..70522a9aac 100644 --- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx +++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx index 13625c2542..bda39b5cf0 100644 --- a/macros/latex/contrib/l3kernel/l3tl.dtx +++ b/macros/latex/contrib/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -205,159 +205,6 @@ % \meta{tl~var}. % \end{function} % -% \section{Modifying token list variables} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_replace_once:Nnn, \tl_replace_once:cnn, -% \tl_greplace_once:Nnn, \tl_greplace_once:cnn -% } -% \begin{syntax} -% \cs{tl_replace_once:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} -% \end{syntax} -% Replaces the first (leftmost) occurrence of \meta{old tokens} in the -% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} -% cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_replace_all:Nnn, \tl_replace_all:cnn, -% \tl_greplace_all:Nnn, \tl_greplace_all:cnn -% } -% \begin{syntax} -% \cs{tl_replace_all:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} -% \end{syntax} -% Replaces all occurrences of \meta{old tokens} in the -% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} -% cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% As this function -% operates from left to right, the pattern \meta{old tokens} -% may remain after the replacement (see \cs{tl_remove_all:Nn} -% for an example). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_remove_once:Nn, \tl_remove_once:cn, -% \tl_gremove_once:Nn, \tl_gremove_once:cn -% } -% \begin{syntax} -% \cs{tl_remove_once:Nn} \meta{tl~var} \Arg{tokens} -% \end{syntax} -% Removes the first (leftmost) occurrence of \meta{tokens} from the -% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_remove_all:Nn, \tl_remove_all:cn, -% \tl_gremove_all:Nn, \tl_gremove_all:cn -% } -% \begin{syntax} -% \cs{tl_remove_all:Nn} \meta{tl~var} \Arg{tokens} -% \end{syntax} -% Removes all occurrences of \meta{tokens} from the -% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% As this function -% operates from left to right, the pattern \meta{tokens} -% may remain after the removal, for instance, -% \begin{quote} -% \cs{tl_set:Nn} \cs{l_tmpa_tl} |{abbccd}| -% \cs{tl_remove_all:Nn} \cs{l_tmpa_tl} |{bc}| -% \end{quote} -% results in \cs{l_tmpa_tl} containing \texttt{abcd}. -% \end{function} -% -% \section{Reassigning token list category codes} -% -% These functions allow the rescanning of tokens: re-apply \TeX{}'s -% tokenization process to apply category codes different from those -% in force when the tokens were absorbed. Whilst this functionality is -% supported, it is often preferable to find alternative approaches -% to achieving outcomes rather than rescanning tokens (for example -% construction of token lists token-by-token with intervening category -% code changes or using \cs{char_generate:nn}). -% -% \begin{function}[updated = 2015-08-11] -% { -% \tl_set_rescan:Nnn, \tl_set_rescan:Nno, \tl_set_rescan:Nnx, -% \tl_set_rescan:cnn, \tl_set_rescan:cno, \tl_set_rescan:cnx, -% \tl_gset_rescan:Nnn, \tl_gset_rescan:Nno, \tl_gset_rescan:Nnx, -% \tl_gset_rescan:cnn, \tl_gset_rescan:cno, \tl_gset_rescan:cnx -% } -% \begin{syntax} -% \cs{tl_set_rescan:Nnn} \meta{tl~var} \Arg{setup} \Arg{tokens} -% \end{syntax} -% Sets \meta{tl~var} to contain \meta{tokens}, applying the category -% code r\'{e}gime specified in the \meta{setup} before carrying out -% the assignment. (Category codes applied to tokens not explicitly covered -% by the \meta{setup} are those in force at the point of use of -% \cs{tl_set_rescan:Nnn}.) -% This allows the \meta{tl~var} to contain material -% with category codes other than those that apply when \meta{tokens} -% are absorbed. The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes, -% such as uses of \cs{cctab_select:N}, -% are relevant. See also \cs{tl_rescan:nn}. -% \begin{texnote} -% The \meta{tokens} are first turned into a string (using -% \cs{tl_to_str:n}). If the string contains one or more characters -% with character code \tn{newlinechar} (set equal to -% \tn{endlinechar} unless that is equal to $32$, before the user -% \meta{setup}), then it is split into lines at these characters, -% then read as if reading multiple lines from a file, ignoring -% spaces (catcode $10$) at the beginning and spaces and tabs -% (character code $32$ or $9$) at the end of every line. -% Otherwise, spaces (and tabs) are retained at both ends of the -% single-line string, as if it appeared in the middle of a line -% read from a file. -% \end{texnote} -% \end{function} -% -% \begin{function}[updated = 2015-08-11]{\tl_rescan:nn} -% \begin{syntax} -% \cs{tl_rescan:nn} \Arg{setup} \Arg{tokens} -% \end{syntax} -% Rescans \meta{tokens} applying the category code r\'{e}gime -% specified in the \meta{setup}, and leaves the resulting tokens in -% the input stream. (Category codes applied to tokens not explicitly covered -% by the \meta{setup} are those in force at the point of use of -% \cs{tl_rescan:nn}.) -% The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes, -% such as uses of \cs{cctab_select:N}, -% are relevant. See also \cs{tl_set_rescan:Nnn}, which is more -% robust than using \cs{tl_set:Nn} in the \meta{tokens} argument of -% \cs{tl_rescan:nn}. -% \begin{texnote} -% The \meta{tokens} are first turned into a string (using -% \cs{tl_to_str:n}). If the string contains one or more characters -% with character code \tn{newlinechar} (set equal to -% \tn{endlinechar} unless that is equal to $32$, before the user -% \meta{setup}), then it is split into lines at these characters, -% then read as if reading multiple lines from a file, ignoring -% spaces (catcode $10$) at the beginning and spaces and tabs -% (character code $32$ or $9$) at the end of every line. -% Otherwise, spaces (and tabs) are retained at both ends of the -% single-line string, as if it appeared in the middle of a line -% read from a file. -% -% Contrarily to the \tn{scantokens} primitive, \cs{tl_rescan:nn} -% tokenizes the whole string in the same category code regime rather -% than one token at a time, so that directives such as \tn{verb} -% that rely on changing category codes will not function properly. -% \end{texnote} -% \end{function} -% % \section{Token list conditionals} % % \begin{function}[EXP,pTF, updated = 2019-09-04] @@ -473,7 +320,7 @@ % \cs{tl_if_single_p:N} \meta{tl~var} % \cs{tl_if_single:NTF} \meta{tl~var} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the content of the \meta{tl~var} consists of a single item, +% Tests if the content of the \meta{tl~var} consists of a single \meta{item}, % \emph{i.e.}~is a single normal token (neither an explicit space % character nor a begin-group character) or a single brace group, % surrounded by optional spaces on both sides. In other words, such a @@ -485,7 +332,7 @@ % \cs{tl_if_single_p:n} \Arg{token list} % \cs{tl_if_single:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the \meta{token list} has exactly one item, \emph{i.e.}~is +% Tests if the \meta{token list} has exactly one \meta{item}, \emph{i.e.}~is % a single normal token (neither an explicit space character nor a % begin-group character) or a single brace group, surrounded by % optional spaces on both sides. In other words, such a token list has @@ -498,7 +345,7 @@ % \cs{tl_if_single_token:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the token list consists of exactly one token, \emph{i.e.}~is -% either a single space character or a single \enquote{normal} token. +% either a single space character or a single normal token. % Token groups (|{|\ldots|}|) are not single tokens. % \end{function} % @@ -526,152 +373,93 @@ % available. % \end{function} % -% \section{Mapping over token lists} +% \subsection{Testing the first token} % -% All mappings are done at the current group level, \emph{i.e.}~any -% local assignments made by the \meta{function} or \meta{code} discussed -% below remain in effect after the loop. -% -% \begin{function}[updated = 2012-06-29, rEXP] -% {\tl_map_function:NN, \tl_map_function:cN} -% \begin{syntax} -% \cs{tl_map_function:NN} \meta{tl~var} \meta{function} -% \end{syntax} -% Applies \meta{function} to every \meta{item} in the \meta{tl~var}. -% The \meta{function} receives one argument for each iteration. -% This may be a number of tokens if the \meta{item} was stored within -% braces. Hence the \meta{function} should anticipate receiving -% \texttt{n}-type arguments. See also \cs{tl_map_function:nN}. -% \end{function} -% -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_function:nN} -% \begin{syntax} -% \cs{tl_map_function:nN} \Arg{token list} \meta{function} -% \end{syntax} -% Applies \meta{function} to every \meta{item} in the \meta{token list}, -% The \meta{function} receives one argument for each iteration. -% This may be a number of tokens if the \meta{item} was stored within -% braces. Hence the \meta{function} should anticipate receiving -% \texttt{n}-type arguments. See also \cs{tl_map_function:NN}. -% \end{function} -% -% \begin{function}[updated = 2012-06-29] -% {\tl_map_inline:Nn, \tl_map_inline:cn} +% \begin{function}[updated = 2012-07-09, EXP, pTF] +% {\tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:oN} % \begin{syntax} -% \cs{tl_map_inline:Nn} \meta{tl~var} \Arg{inline function} +% \cs{tl_if_head_eq_catcode_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_catcode:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Applies the \meta{inline function} to every \meta{item} stored within the -% \meta{tl~var}. The \meta{inline function} should consist of code which -% receives the \meta{item} as |#1|. See also \cs{tl_map_function:NN}. +% Tests if the first \meta{token} in the \meta{token list} has the +% same category code as the \meta{test token}. In the case where the +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[updated = 2012-06-29]{\tl_map_inline:nn} +% \begin{function}[updated = 2012-07-09, EXP, pTF] +% {\tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:fN} % \begin{syntax} -% \cs{tl_map_inline:nn} \Arg{token list} \Arg{inline function} +% \cs{tl_if_head_eq_charcode_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_charcode:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Applies the \meta{inline function} to every \meta{item} stored within the -% \meta{token list}. The \meta{inline function} should consist of code which -% receives the \meta{item} as |#1|. See also \cs{tl_map_function:nN}. +% Tests if the first \meta{token} in the \meta{token list} has the +% same character code as the \meta{test token}. In the case where the +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[rEXP, added = 2019-09-02] -% {\tl_map_tokens:Nn, \tl_map_tokens:cn, \tl_map_tokens:nn} +% \begin{function}[updated = 2012-07-09, EXP, pTF]{\tl_if_head_eq_meaning:nN} % \begin{syntax} -% \cs{tl_map_tokens:Nn} \meta{tl~var} \Arg{code} -% \cs{tl_map_tokens:nn} \Arg{tokens} \Arg{code} +% \cs{tl_if_head_eq_meaning_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_meaning:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Analogue of \cs{tl_map_function:NN} which maps several tokens -% instead of a single function. The \meta{code} receives each item in -% the \meta{tl~var} or in \meta{tokens} as a trailing brace group. For -% instance, -% \begin{verbatim} -% \tl_map_tokens:Nn \l_my_tl { \prg_replicate:nn { 2 } } -% \end{verbatim} -% expands to twice each item in the \meta{tl~var}: for each item in -% \cs[no-index]{l_my_tl} the function \cs{prg_replicate:nn} receives |2| and -% \meta{item} as its two arguments. The function -% \cs{tl_map_inline:Nn} is typically faster but is not expandable. +% Tests if the first \meta{token} in the \meta{token list} has the +% same meaning as the \meta{test token}. In the case where +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[updated = 2012-06-29] -% {\tl_map_variable:NNn, \tl_map_variable:cNn} +% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_group:n} % \begin{syntax} -% \cs{tl_map_variable:NNn} \meta{tl~var} \meta{variable} \Arg{code} +% \cs{tl_if_head_is_group_p:n} \Arg{token list} +% \cs{tl_if_head_is_group:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Stores each \meta{item} of the \meta{tl~var} in turn in the (token -% list) \meta{variable} and applies the \meta{code}. The \meta{code} -% will usually make use of the \meta{variable}, but this is not -% enforced. The assignments to the \meta{variable} are local. Its -% value after the loop is the last \meta{item} in the \meta{tl~var}, -% or its original value if the \meta{tl~var} is blank. See also -% \cs{tl_map_inline:Nn}. +% Tests if the first \meta{token} in the \meta{token list} +% is an explicit begin-group character (with category code~$1$ +% and any character code), in other words, if the \meta{token list} +% starts with a brace group. In particular, the test is \texttt{false} +% if the \meta{token list} starts with an implicit token such as +% \cs{c_group_begin_token}, or if it is empty. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29]{\tl_map_variable:nNn} +% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_N_type:n} % \begin{syntax} -% \cs{tl_map_variable:nNn} \Arg{token list} \meta{variable} \Arg{code} +% \cs{tl_if_head_is_N_type_p:n} \Arg{token list} +% \cs{tl_if_head_is_N_type:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Stores each \meta{item} of the \meta{token list} in turn in the -% (token list) \meta{variable} and applies the \meta{code}. The -% \meta{code} will usually make use of the \meta{variable}, but this -% is not enforced. The assignments to the \meta{variable} are local. -% Its value after the loop is the last \meta{item} in the -% \meta{tl~var}, or its original value if the \meta{tl~var} is blank. -% See also \cs{tl_map_inline:nn}. +% Tests if the first \meta{token} in the \meta{token list} +% is a normal \texttt{N}-type argument. In other words, +% it is neither an explicit space character +% (explicit token with character code~$32$ and category code~$10$) +% nor an explicit begin-group character +% (with category code~1 and any character code). An empty +% argument yields \texttt{false}, as it does not have a normal +% first token. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:} +% \begin{function}[updated = 2012-07-08, EXP, pTF]{\tl_if_head_is_space:n} % \begin{syntax} -% \cs{tl_map_break:} +% \cs{tl_if_head_is_space_p:n} \Arg{token list} +% \cs{tl_if_head_is_space:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all -% entries in the \meta{token list variable} have been processed. This -% normally takes place within a conditional statement, for example -% \begin{verbatim} -% \tl_map_inline:Nn \l_my_tl -% { -% \str_if_eq:nnT { #1 } { bingo } { \tl_map_break: } -% % Do something useful -% } -% \end{verbatim} -% See also \cs{tl_map_break:n}. -% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low -% level \TeX{} errors. -% \begin{texnote} -% When the mapping is broken, additional tokens may be inserted -% before the \meta{tokens} are -% inserted into the input stream. -% This depends on the design of the mapping function. -% \end{texnote} +% Tests if the first \meta{token} in the \meta{token list} +% is an explicit space character +% (explicit token with character code~$12$ and category code~$10$). +% In particular, the test is \texttt{false} if the \meta{token list} +% starts with an implicit token such as \cs{c_space_token}, or if it +% is empty. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:n} -% \begin{syntax} -% \cs{tl_map_break:n} \Arg{code} -% \end{syntax} -% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all -% entries in the \meta{token list variable} have been processed, inserting -% the \meta{code} after the mapping has ended. This -% normally takes place within a conditional statement, for example -% \begin{verbatim} -% \tl_map_inline:Nn \l_my_tl -% { -% \str_if_eq:nnT { #1 } { bingo } -% { \tl_map_break:n { <code> } } -% % Do something useful -% } -% \end{verbatim} -% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low -% level \TeX{} errors. -% \begin{texnote} -% When the mapping is broken, additional tokens may be inserted -% before the \meta{code} is -% inserted into the input stream. -% This depends on the design of the mapping function. -% \end{texnote} -% \end{function} +% \section{Working with token lists as a whole} % -% \section{Using token lists} +% \subsection{Using token lists} % % \begin{function}[EXP]{\tl_to_str:n, \tl_to_str:V} % \begin{syntax} @@ -733,7 +521,7 @@ % a \meta{tl~var} directly without an accessor function. % \end{function} % -% \section{Working with the content of token lists} +% \subsection{Counting and reversing token lists} % % \begin{function}[added = 2012-05-13, EXP] % {\tl_count:n, \tl_count:V, \tl_count:o} @@ -752,7 +540,7 @@ % \begin{syntax} % \cs{tl_count:N} \meta{tl~var} % \end{syntax} -% Counts the number of token groups in the \meta{tl~var} +% Counts the number of \meta{items} in the \meta{tl~var} % and leaves this information in the input stream. Unbraced tokens % count as one element as do each token group (|{|\ldots|}|). This % process ignores any unprotected spaces within the \meta{tl~var}. @@ -867,36 +655,194 @@ % \emph{resets} the content of the variable. % \end{function} % -% \begin{function}[added = 2017-02-06] -% {\tl_sort:Nn, \tl_sort:cn, \tl_gsort:Nn, \tl_gsort:cn} +% \subsection{Viewing token lists} +% +% \begin{function}[updated = 2021-04-29]{\tl_show:N, \tl_show:c} % \begin{syntax} -% \cs{tl_sort:Nn} \meta{tl var} \Arg{comparison code} +% \cs{tl_show:N} \meta{tl~var} % \end{syntax} -% Sorts the items in the \meta{tl var} according to the -% \meta{comparison code}, and assigns the result to -% \meta{tl var}. The details of sorting comparison are -% described in Section~\ref{sec:l3sort:mech}. +% Displays the content of the \meta{tl~var} on the terminal. +% \begin{texnote} +% This is similar to the \TeX{} primitive \tn{show}, wrapped to a +% fixed number of characters per line. +% \end{texnote} % \end{function} % -% \begin{function}[added = 2017-02-06, EXP]{\tl_sort:nN} +% \begin{function}[updated = 2015-08-07]{\tl_show:n} % \begin{syntax} -% \cs{tl_sort:nN} \Arg{token list} \meta{conditional} +% \cs{tl_show:n} \Arg{token list} % \end{syntax} -% Sorts the items in the \meta{token list}, using the -% \meta{conditional} to compare items, and leaves the result in the -% input stream. The \meta{conditional} should have signature |:nnTF|, -% and return \texttt{true} if the two items being compared should be -% left in the same order, and \texttt{false} if the items should be -% swapped. The details of sorting comparison are -% described in Section~\ref{sec:l3sort:mech}. +% Displays the \meta{token list} on the terminal. % \begin{texnote} -% The result is returned within \cs{exp_not:n}, which means that the -% token list does not expand further when appearing in an -% \texttt{x}-type or \texttt{e}-type argument expansion. +% This is similar to the \eTeX{} primitive \tn{showtokens}, wrapped +% to a fixed number of characters per line. +% \end{texnote} +% \end{function} +% +% \begin{function}[added = 2014-08-22, updated = 2021-04-29]{\tl_log:N, \tl_log:c} +% \begin{syntax} +% \cs{tl_log:N} \meta{tl~var} +% \end{syntax} +% Writes the content of the \meta{tl~var} in the log file. See also +% \cs{tl_show:N} which displays the result in the terminal. +% \end{function} +% +% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\tl_log:n} +% \begin{syntax} +% \cs{tl_log:n} \Arg{token list} +% \end{syntax} +% Writes the \meta{token list} in the log file. See also +% \cs{tl_show:n} which displays the result in the terminal. +% \end{function} +% +% \section{Manipulating items in token lists} +% +% \subsection{Mapping over token lists} +% +% All mappings are done at the current group level, \emph{i.e.}~any +% local assignments made by the \meta{function} or \meta{code} discussed +% below remain in effect after the loop. +% +% \begin{function}[updated = 2012-06-29, rEXP] +% {\tl_map_function:NN, \tl_map_function:cN} +% \begin{syntax} +% \cs{tl_map_function:NN} \meta{tl~var} \meta{function} +% \end{syntax} +% Applies \meta{function} to every \meta{item} in the \meta{tl~var}. +% The \meta{function} receives one argument for each iteration. +% This may be a number of tokens if the \meta{item} was stored within +% braces. Hence the \meta{function} should anticipate receiving +% \texttt{n}-type arguments. See also \cs{tl_map_function:nN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_function:nN} +% \begin{syntax} +% \cs{tl_map_function:nN} \Arg{token list} \meta{function} +% \end{syntax} +% Applies \meta{function} to every \meta{item} in the \meta{token list}, +% The \meta{function} receives one argument for each iteration. +% This may be a number of tokens if the \meta{item} was stored within +% braces. Hence the \meta{function} should anticipate receiving +% \texttt{n}-type arguments. See also \cs{tl_map_function:NN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29] +% {\tl_map_inline:Nn, \tl_map_inline:cn} +% \begin{syntax} +% \cs{tl_map_inline:Nn} \meta{tl~var} \Arg{inline function} +% \end{syntax} +% Applies the \meta{inline function} to every \meta{item} stored within the +% \meta{tl~var}. The \meta{inline function} should consist of code which +% receives the \meta{item} as |#1|. See also \cs{tl_map_function:NN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29]{\tl_map_inline:nn} +% \begin{syntax} +% \cs{tl_map_inline:nn} \Arg{token list} \Arg{inline function} +% \end{syntax} +% Applies the \meta{inline function} to every \meta{item} stored within the +% \meta{token list}. The \meta{inline function} should consist of code which +% receives the \meta{item} as |#1|. See also \cs{tl_map_function:nN}. +% \end{function} +% +% \begin{function}[rEXP, added = 2019-09-02] +% {\tl_map_tokens:Nn, \tl_map_tokens:cn, \tl_map_tokens:nn} +% \begin{syntax} +% \cs{tl_map_tokens:Nn} \meta{tl~var} \Arg{code} +% \cs{tl_map_tokens:nn} \Arg{tokens} \Arg{code} +% \end{syntax} +% Analogue of \cs{tl_map_function:NN} which maps several tokens +% instead of a single function. The \meta{code} receives each \meta{item} in +% the \meta{tl~var} or in \meta{tokens} as a trailing brace group. For +% instance, +% \begin{verbatim} +% \tl_map_tokens:Nn \l_my_tl { \prg_replicate:nn { 2 } } +% \end{verbatim} +% expands to twice each \meta{item} in the \meta{tl~var}: for each \meta{item} in +% \cs[no-index]{l_my_tl} the function \cs{prg_replicate:nn} receives |2| and +% \meta{item} as its two arguments. The function +% \cs{tl_map_inline:Nn} is typically faster but is not expandable. +% \end{function} +% +% \begin{function}[updated = 2012-06-29] +% {\tl_map_variable:NNn, \tl_map_variable:cNn} +% \begin{syntax} +% \cs{tl_map_variable:NNn} \meta{tl~var} \meta{variable} \Arg{code} +% \end{syntax} +% Stores each \meta{item} of the \meta{tl~var} in turn in the (token +% list) \meta{variable} and applies the \meta{code}. The \meta{code} +% will usually make use of the \meta{variable}, but this is not +% enforced. The assignments to the \meta{variable} are local. Its +% value after the loop is the last \meta{item} in the \meta{tl~var}, +% or its original value if the \meta{tl~var} is blank. See also +% \cs{tl_map_inline:Nn}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29]{\tl_map_variable:nNn} +% \begin{syntax} +% \cs{tl_map_variable:nNn} \Arg{token list} \meta{variable} \Arg{code} +% \end{syntax} +% Stores each \meta{item} of the \meta{token list} in turn in the +% (token list) \meta{variable} and applies the \meta{code}. The +% \meta{code} will usually make use of the \meta{variable}, but this +% is not enforced. The assignments to the \meta{variable} are local. +% Its value after the loop is the last \meta{item} in the +% \meta{tl~var}, or its original value if the \meta{tl~var} is blank. +% See also \cs{tl_map_inline:nn}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:} +% \begin{syntax} +% \cs{tl_map_break:} +% \end{syntax} +% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all +% entries in the \meta{token list variable} have been processed. This +% normally takes place within a conditional statement, for example +% \begin{verbatim} +% \tl_map_inline:Nn \l_my_tl +% { +% \str_if_eq:nnT { #1 } { bingo } { \tl_map_break: } +% % Do something useful +% } +% \end{verbatim} +% See also \cs{tl_map_break:n}. +% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low +% level \TeX{} errors. +% \begin{texnote} +% When the mapping is broken, additional tokens may be inserted +% before the \meta{tokens} are +% inserted into the input stream. +% This depends on the design of the mapping function. % \end{texnote} % \end{function} % -% \section{The first token from a token list} +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:n} +% \begin{syntax} +% \cs{tl_map_break:n} \Arg{code} +% \end{syntax} +% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all +% entries in the \meta{token list variable} have been processed, inserting +% the \meta{code} after the mapping has ended. This +% normally takes place within a conditional statement, for example +% \begin{verbatim} +% \tl_map_inline:Nn \l_my_tl +% { +% \str_if_eq:nnT { #1 } { bingo } +% { \tl_map_break:n { <code> } } +% % Do something useful +% } +% \end{verbatim} +% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low +% level \TeX{} errors. +% \begin{texnote} +% When the mapping is broken, additional tokens may be inserted +% before the \meta{code} is +% inserted into the input stream. +% This depends on the design of the mapping function. +% \end{texnote} +% \end{function} +% +% \subsection{Head and tail of token lists} % % Functions which deal with either only the very first item (balanced % text or single normal token) in a token list, or the remaining tokens. @@ -979,89 +925,7 @@ % \end{texnote} % \end{function} % -% \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:oN} -% \begin{syntax} -% \cs{tl_if_head_eq_catcode_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_catcode:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same category code as the \meta{test token}. In the case where the -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:fN} -% \begin{syntax} -% \cs{tl_if_head_eq_charcode_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_charcode:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same character code as the \meta{test token}. In the case where the -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[updated = 2012-07-09, EXP, pTF]{\tl_if_head_eq_meaning:nN} -% \begin{syntax} -% \cs{tl_if_head_eq_meaning_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_meaning:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same meaning as the \meta{test token}. In the case where -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_group:n} -% \begin{syntax} -% \cs{tl_if_head_is_group_p:n} \Arg{token list} -% \cs{tl_if_head_is_group:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is an explicit begin-group character (with category code~$1$ -% and any character code), in other words, if the \meta{token list} -% starts with a brace group. In particular, the test is \texttt{false} -% if the \meta{token list} starts with an implicit token such as -% \cs{c_group_begin_token}, or if it is empty. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_N_type:n} -% \begin{syntax} -% \cs{tl_if_head_is_N_type_p:n} \Arg{token list} -% \cs{tl_if_head_is_N_type:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is a normal \texttt{N}-type argument. In other words, -% it is neither an explicit space character -% (explicit token with character code~$32$ and category code~$10$) -% nor an explicit begin-group character -% (with category code~1 and any character code). An empty -% argument yields \texttt{false}, as it does not have a \enquote{normal} -% first token. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \begin{function}[updated = 2012-07-08, EXP, pTF]{\tl_if_head_is_space:n} -% \begin{syntax} -% \cs{tl_if_head_is_space_p:n} \Arg{token list} -% \cs{tl_if_head_is_space:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is an explicit space character -% (explicit token with character code~$12$ and category code~$10$). -% In particular, the test is \texttt{false} if the \meta{token list} -% starts with an implicit token such as \cs{c_space_token}, or if it -% is empty. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \section{Using a single item} +% \subsection{Items and ranges in token lists} % % \begin{function}[added = 2014-07-17, EXP] % {\tl_item:nn, \tl_item:Nn, \tl_item:cn} @@ -1172,44 +1036,190 @@ % \end{texnote} % \end{function} % -% \section{Viewing token lists} +% \subsection{Sorting token lists} % -% \begin{function}[updated = 2021-04-29]{\tl_show:N, \tl_show:c} +% \begin{function}[added = 2017-02-06] +% {\tl_sort:Nn, \tl_sort:cn, \tl_gsort:Nn, \tl_gsort:cn} % \begin{syntax} -% \cs{tl_show:N} \meta{tl~var} +% \cs{tl_sort:Nn} \meta{tl var} \Arg{comparison code} % \end{syntax} -% Displays the content of the \meta{tl~var} on the terminal. -% \begin{texnote} -% This is similar to the \TeX{} primitive \tn{show}, wrapped to a -% fixed number of characters per line. -% \end{texnote} +% Sorts the items in the \meta{tl var} according to the +% \meta{comparison code}, and assigns the result to +% \meta{tl var}. The details of sorting comparison are +% described in Section~\ref{sec:l3sort:mech}. % \end{function} % -% \begin{function}[updated = 2015-08-07]{\tl_show:n} +% \begin{function}[added = 2017-02-06, EXP]{\tl_sort:nN} % \begin{syntax} -% \cs{tl_show:n} \Arg{token list} +% \cs{tl_sort:nN} \Arg{token list} \meta{conditional} % \end{syntax} -% Displays the \meta{token list} on the terminal. +% Sorts the items in the \meta{token list}, using the +% \meta{conditional} to compare items, and leaves the result in the +% input stream. The \meta{conditional} should have signature |:nnTF|, +% and return \texttt{true} if the two items being compared should be +% left in the same order, and \texttt{false} if the items should be +% swapped. The details of sorting comparison are +% described in Section~\ref{sec:l3sort:mech}. % \begin{texnote} -% This is similar to the \eTeX{} primitive \tn{showtokens}, wrapped -% to a fixed number of characters per line. +% The result is returned within \cs{exp_not:n}, which means that the +% token list does not expand further when appearing in an +% \texttt{x}-type or \texttt{e}-type argument expansion. % \end{texnote} % \end{function} % -% \begin{function}[added = 2014-08-22, updated = 2021-04-29]{\tl_log:N, \tl_log:c} +% \section{Manipulating tokens in token lists} +% +% \subsection{Replacing tokens} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_replace_once:Nnn, \tl_replace_once:cnn, +% \tl_greplace_once:Nnn, \tl_greplace_once:cnn +% } % \begin{syntax} -% \cs{tl_log:N} \meta{tl~var} +% \cs{tl_replace_once:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} % \end{syntax} -% Writes the content of the \meta{tl~var} in the log file. See also -% \cs{tl_show:N} which displays the result in the terminal. +% Replaces the first (leftmost) occurrence of \meta{old tokens} in the +% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} +% cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). % \end{function} % -% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\tl_log:n} +% \begin{function}[updated = 2011-08-11] +% { +% \tl_replace_all:Nnn, \tl_replace_all:cnn, +% \tl_greplace_all:Nnn, \tl_greplace_all:cnn +% } % \begin{syntax} -% \cs{tl_log:n} \Arg{token list} +% \cs{tl_replace_all:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} % \end{syntax} -% Writes the \meta{token list} in the log file. See also -% \cs{tl_show:n} which displays the result in the terminal. +% Replaces all occurrences of \meta{old tokens} in the +% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} +% cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% As this function +% operates from left to right, the pattern \meta{old tokens} +% may remain after the replacement (see \cs{tl_remove_all:Nn} +% for an example). +% \end{function} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_remove_once:Nn, \tl_remove_once:cn, +% \tl_gremove_once:Nn, \tl_gremove_once:cn +% } +% \begin{syntax} +% \cs{tl_remove_once:Nn} \meta{tl~var} \Arg{tokens} +% \end{syntax} +% Removes the first (leftmost) occurrence of \meta{tokens} from the +% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% \end{function} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_remove_all:Nn, \tl_remove_all:cn, +% \tl_gremove_all:Nn, \tl_gremove_all:cn +% } +% \begin{syntax} +% \cs{tl_remove_all:Nn} \meta{tl~var} \Arg{tokens} +% \end{syntax} +% Removes all occurrences of \meta{tokens} from the +% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% As this function +% operates from left to right, the pattern \meta{tokens} +% may remain after the removal, for instance, +% \begin{quote} +% \cs{tl_set:Nn} \cs{l_tmpa_tl} |{abbccd}| +% \cs{tl_remove_all:Nn} \cs{l_tmpa_tl} |{bc}| +% \end{quote} +% results in \cs{l_tmpa_tl} containing \texttt{abcd}. +% \end{function} +% +% \subsection{Reassigning category codes} +% +% These functions allow the rescanning of tokens: re-apply \TeX{}'s +% tokenization process to apply category codes different from those +% in force when the tokens were absorbed. Whilst this functionality is +% supported, it is often preferable to find alternative approaches +% to achieving outcomes rather than rescanning tokens (for example +% construction of token lists token-by-token with intervening category +% code changes or using \cs{char_generate:nn}). +% +% \begin{function}[updated = 2015-08-11] +% { +% \tl_set_rescan:Nnn, \tl_set_rescan:Nno, \tl_set_rescan:Nnx, +% \tl_set_rescan:cnn, \tl_set_rescan:cno, \tl_set_rescan:cnx, +% \tl_gset_rescan:Nnn, \tl_gset_rescan:Nno, \tl_gset_rescan:Nnx, +% \tl_gset_rescan:cnn, \tl_gset_rescan:cno, \tl_gset_rescan:cnx +% } +% \begin{syntax} +% \cs{tl_set_rescan:Nnn} \meta{tl~var} \Arg{setup} \Arg{tokens} +% \end{syntax} +% Sets \meta{tl~var} to contain \meta{tokens}, applying the category +% code r\'{e}gime specified in the \meta{setup} before carrying out +% the assignment. (Category codes applied to tokens not explicitly covered +% by the \meta{setup} are those in force at the point of use of +% \cs{tl_set_rescan:Nnn}.) +% This allows the \meta{tl~var} to contain material +% with category codes other than those that apply when \meta{tokens} +% are absorbed. The \meta{setup} is run within a group and may +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, +% are relevant. See also \cs{tl_rescan:nn}. +% \begin{texnote} +% The \meta{tokens} are first turned into a string (using +% \cs{tl_to_str:n}). If the string contains one or more characters +% with character code \tn{newlinechar} (set equal to +% \tn{endlinechar} unless that is equal to $32$, before the user +% \meta{setup}), then it is split into lines at these characters, +% then read as if reading multiple lines from a file, ignoring +% spaces (catcode $10$) at the beginning and spaces and tabs +% (character code $32$ or $9$) at the end of every line. +% Otherwise, spaces (and tabs) are retained at both ends of the +% single-line string, as if it appeared in the middle of a line +% read from a file. +% \end{texnote} +% \end{function} +% +% \begin{function}[updated = 2015-08-11]{\tl_rescan:nn} +% \begin{syntax} +% \cs{tl_rescan:nn} \Arg{setup} \Arg{tokens} +% \end{syntax} +% Rescans \meta{tokens} applying the category code r\'{e}gime +% specified in the \meta{setup}, and leaves the resulting tokens in +% the input stream. (Category codes applied to tokens not explicitly covered +% by the \meta{setup} are those in force at the point of use of +% \cs{tl_rescan:nn}.) +% The \meta{setup} is run within a group and may +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, +% are relevant. See also \cs{tl_set_rescan:Nnn}, which is more +% robust than using \cs{tl_set:Nn} in the \meta{tokens} argument of +% \cs{tl_rescan:nn}. +% \begin{texnote} +% The \meta{tokens} are first turned into a string (using +% \cs{tl_to_str:n}). If the string contains one or more characters +% with character code \tn{newlinechar} (set equal to +% \tn{endlinechar} unless that is equal to $32$, before the user +% \meta{setup}), then it is split into lines at these characters, +% then read as if reading multiple lines from a file, ignoring +% spaces (catcode $10$) at the beginning and spaces and tabs +% (character code $32$ or $9$) at the end of every line. +% Otherwise, spaces (and tabs) are retained at both ends of the +% single-line string, as if it appeared in the middle of a line +% read from a file. +% +% Contrarily to the \tn{scantokens} primitive, \cs{tl_rescan:nn} +% tokenizes the whole string in the same category code regime rather +% than one token at a time, so that directives such as \tn{verb} +% that rely on changing category codes will not function properly. +% \end{texnote} % \end{function} % % \section{Constant token lists} @@ -1442,7 +1452,7 @@ % By using \cs{exp_not:n} token list variables can contain |#| tokens, % which makes the token list registers provided by \TeX{} % more or less redundant. The \cs{tl_set:No} version is done -% \enquote{by hand} as it is used quite a lot. +% by hand as it is used quite a lot. % \begin{macrocode} \cs_new_protected:Npn \tl_set:Nn #1#2 { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w {#2} } } @@ -2289,7 +2299,7 @@ % The \cs{if_false:} constructions are a faster way to do % \cs{group_align_safe_begin:} and \cs{group_align_safe_end:}. % The \cs{scan_stop:} ensures that \texttt{f}-expanding -% \cs{tl_if_in:nn} does not lead to unbalanced braces. +% \cs{tl_if_in:nnTF} does not lead to unbalanced braces. % \begin{macrocode} \prg_new_protected_conditional:Npnn \tl_if_in:nn #1#2 { T , F , TF } { @@ -2335,7 +2345,7 @@ % \end{macro} % % \begin{macro}[EXP,pTF]{\tl_if_single:N} -% Expand the token list and feed it to \cs{tl_if_single:n}. +% Expand the token list and feed it to \cs{tl_if_single:nTF}. % \begin{macrocode} \cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n } \cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT } diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx index 33960f4ec0..527ce36e08 100644 --- a/macros/latex/contrib/l3kernel/l3token.dtx +++ b/macros/latex/contrib/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -541,7 +541,7 @@ % \begin{function}[EXP,pTF]{\token_if_parameter:N} % \begin{syntax} % \cs{token_if_parameter_p:N} \meta{token} \\ -% \cs{token_if_alignment:NTF} \meta{token} \Arg{true code} \Arg{false code} +% \cs{token_if_parameter:NTF} \meta{token} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if \meta{token} has the category code of a macro parameter token % (|#| when normal \TeX{} category codes are in force). diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx index 38f142f04f..5aa2987d19 100644 --- a/macros/latex/contrib/l3kernel/l3unicode.dtx +++ b/macros/latex/contrib/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf Binary files differindex 9884bf29d1..8d919c1a26 100644 --- a/macros/latex/contrib/l3kernel/source3.pdf +++ b/macros/latex/contrib/l3kernel/source3.pdf diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex index 7910459271..56c5f487d7 100644 --- a/macros/latex/contrib/l3kernel/source3.tex +++ b/macros/latex/contrib/l3kernel/source3.tex @@ -53,7 +53,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \pagenumbering{roman} \maketitle |