diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-25 20:39:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-25 20:39:11 +0000 |
commit | 6ee34168ae583fe1e26ef62fa4084f20a51badbe (patch) | |
tree | eb1330ed0fc9309601ce2d7a27242f076768e90c /Master/texmf-dist/tex/latex-dev/base | |
parent | f4b30cab122b0e1a4257d45b74bca2753d8b0abd (diff) |
latex-dev (25may23)
git-svn-id: svn://tug.org/texlive/trunk@67218 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev/base')
44 files changed, 2562 insertions, 425 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/base/article.cls b/Master/texmf-dist/tex/latex-dev/base/article.cls index 9a5cf44bcc1..d5084603f5d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/article.cls +++ b/Master/texmf-dist/tex/latex-dev/base/article.cls @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{article} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol diff --git a/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty index a14955d8da5..8bdc7c1b662 100644 --- a/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty +++ b/Master/texmf-dist/tex/latex-dev/base/atbegshi-ltx.sty @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. %% %% Copyright (C) 2020-2023 -%% Frank Mittelbach, LaTeX Team +%% Frank Mittelbach, The LaTeX Project %% %%% From File: ltshipout.dtx \providecommand\ltshipoutversion{v1.0n} diff --git a/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty b/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty index c53479de2cc..2f63091fb5d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty +++ b/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty @@ -42,8 +42,8 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0n} -\providecommand\ltfilehookdate{2022/08/18} +\providecommand\ltfilehookversion{v1.0o} +\providecommand\ltfilehookdate{2023/04/02} \ProvidesPackage{atveryend-ltx} [2020/08/19 v1.0a Emulation of the original atveryend package^^Jwith kernel methods] diff --git a/Master/texmf-dist/tex/latex-dev/base/bk10.clo b/Master/texmf-dist/tex/latex-dev/base/bk10.clo index b2737deebe7..d0a27151f32 100644 --- a/Master/texmf-dist/tex/latex-dev/base/bk10.clo +++ b/Master/texmf-dist/tex/latex-dev/base/bk10.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{bk10.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xpt\@xiipt diff --git a/Master/texmf-dist/tex/latex-dev/base/bk11.clo b/Master/texmf-dist/tex/latex-dev/base/bk11.clo index 9043f0bd0f3..8fb3375e2ef 100644 --- a/Master/texmf-dist/tex/latex-dev/base/bk11.clo +++ b/Master/texmf-dist/tex/latex-dev/base/bk11.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{bk11.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xipt{13.6}% diff --git a/Master/texmf-dist/tex/latex-dev/base/bk12.clo b/Master/texmf-dist/tex/latex-dev/base/bk12.clo index 6c2bd147bb1..73b7d496dce 100644 --- a/Master/texmf-dist/tex/latex-dev/base/bk12.clo +++ b/Master/texmf-dist/tex/latex-dev/base/bk12.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{bk12.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xiipt{14.5}% diff --git a/Master/texmf-dist/tex/latex-dev/base/book.cls b/Master/texmf-dist/tex/latex-dev/base/book.cls index 8cc650f2d05..18f0e8d59d1 100644 --- a/Master/texmf-dist/tex/latex-dev/base/book.cls +++ b/Master/texmf-dist/tex/latex-dev/base/book.cls @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{book} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx index 995e3ccd66a..e5c89802e27 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx @@ -432,6 +432,7 @@ \def\extrafloats#1{% \ifnum#1>\z@ \count@\numexpr\float@count-1\relax + \ifnum\count@<266 \ch@ck0\m@ne\insert\fi \ch@ck0\count@\count \ch@ck1\count@\dimen \ch@ck2\count@\skip @@ -440,8 +441,7 @@ \global\expandafter\e@alloc@chardef \csname bx@\the\float@count\endcsname\float@count \@cons\@freelist{\csname bx@\the\float@count\endcsname}% -\expandafter -\extrafloats\expandafter{\numexpr#1-1\relax}% +\expandafter\extrafloats\expandafter{\the\numexpr#1-1\expandafter}% \fi}% \fi \def\alloc@#1#2#3#4{\e@alloc#2#3{\count1#1}#4\float@count} @@ -706,7 +706,7 @@ \def\fmtname{LaTeX2e} \edef\fmtversion {2023-06-01} -\def\patch@level{-2} +\def\patch@level{-3} \edef\development@branch@name{develop \the\year-\the\month-\the\day} \iffalse \def\reserved@a#1/#2/#3\@nil{% @@ -1803,8 +1803,8 @@ \xdef#1{\the\toks@}% \endgroup} %%% From File: ltcmd.dtx -\def\ltcmdversion{v1.1b} -\def\ltcmddate{2022-11-29} +\def\ltcmdversion{v1.1d} +\def\ltcmddate{2023-04-13} \message{document commands,} \ExplSyntaxOn \tl_new:N \l__cmd_arg_spec_tl @@ -2873,7 +2873,9 @@ \__cmd_set_eq_if_exist:cc { #1 ~ \c_space_tl } { #2 ~ \c_space_tl } \__cmd_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } \exp_after:wN \__cmd_copy_expandable_signature:NnNNNNnnn #4 {#1} {#2} - \cs_set_nopar:Npx #3 + \token_if_protected_macro:NTF #4 + { \cs_set_protected_nopar:Npx }{ \cs_set_nopar:Npx } + #3 { \exp_after:wN \__cmd_copy_expandable:NnNNNNnnn #4 {#1} {#2} } } \cs_new:Npn \__cmd_copy_expandable:NnNNNNnnn #1 #2 #3 #4 #5 #6 #7 #8 #9 @@ -3018,8 +3020,9 @@ { \exp_after:wN \__cmd_show_expandable:NnNNNNnN #1 #1 } \cs_new_protected:Npn \__cmd_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 { - \__cmd_show_command_aux:NnNNn \tl_show:x - { expandable~document~command } #8 #5 {#2} + \exp_args:NNe \__cmd_show_command_aux:NnNNn \tl_show:x + { \token_if_protected_macro:NF #8 { expandable~ } document~command } + #8 #5 {#2} } \cs_new_protected:Npn \__cmd_show_command_aux:NnNNn #1 #2 #3 #4 #5 { @@ -3472,6 +3475,7 @@ \tl_set:Nn \l__cmd_signature_tl {#1} \group_begin: \tex_escapechar:D = 92 \scan_stop: + \tex_endlinechar:D = `\^^M \scan_stop: \tl_clear:N \l__cmd_v_arg_tl \peek_remove_spaces:n { @@ -3489,8 +3493,8 @@ } \cs_new_protected:Npn \__cmd_grab_v_group_end: { - \exp_args:NNNo - \group_end: + \exp_args:NNNo + \group_end: \tl_set:Nn \l__cmd_v_arg_tl { \l__cmd_v_arg_tl } } \cs_new_protected:Npn \__cmd_grab_v_aux_test:N #1 @@ -3568,7 +3572,6 @@ { \cs_set_eq:NN \do \char_set_catcode_other:N \dospecials - \tex_endlinechar:D = `\^^M \scan_stop: \bool_if:NTF \l__cmd_long_bool { \char_set_catcode_other:n { \tex_endlinechar:D } } { \char_set_catcode_parameter:n { \tex_endlinechar:D } } @@ -4617,8 +4620,8 @@ \ExplSyntaxOff %%% From File: lthooks.dtx -\def\lthooksversion{v1.0v} -\def\lthooksdate{2022/06/15} +\def\lthooksversion{v1.1d} +\def\lthooksdate{2023/05/21} \ExplSyntaxOn \bool_new:N \g__hook_debug_bool \cs_new_eq:NN \__hook_debug:n \use_none:n @@ -4649,61 +4652,77 @@ \tl_new:N \g__hook_hook_curr_name_tl \seq_new:N \g__hook_name_stack_seq \cs_new_eq:NN \__hook_tmp:w ? +\tl_const:Nn \c__hook_empty_tl { } +\tl_const:Nn \c__hook_nine_parameters_tl { #1#2#3#4#5#6#7#8#9 } \cs_generate_variant:Nn \tl_gremove_once:Nn { Nx } \cs_generate_variant:Nn \tl_show:n { x } \cs_generate_variant:Nn \tl_log:n { x } +\cs_generate_variant:Nn \tl_set:Nn { Ne } +\cs_generate_variant:Nn \cs_replacement_spec:N { c } +\cs_generate_variant:Nn \prop_put:Nnn { Nne } +\cs_generate_variant:Nn \str_count:n { e } \scan_new:N \s__hook_mark -\cs_new:Npn \__hook_clean_to_scan:w #1 \s__hook_mark { } -\cs_new_protected:Npn \__hook_tl_set:Nn #1#2 - { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w {#2} } } -\cs_new_protected:Npn \__hook_tl_set:Nx #1#2 - { \cs_set_nopar:Npx #1 {#2} } -\cs_generate_variant:Nn \__hook_tl_set:Nn { c } -\cs_generate_variant:Nn \__hook_tl_set:Nx { c } +\cs_new:Npn \__hook_use_none_delimit_by_s_mark:w #1 \s__hook_mark { } +\cs_new:Npn \__hook_use_i_delimit_by_s_mark:nw #1 #2 \s__hook_mark {#1} +\cs_new_protected:Npn \__hook_tl_set:cn #1#2 + { \cs_set_nopar:cpx {#1} { \__kernel_exp_not:w {#2} } } \cs_new_protected:Npn \__hook_tl_gset:Nn #1#2 { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w {#2} } } -\cs_new_protected:Npn \__hook_tl_gset:No #1#2 - { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } } \cs_new_protected:Npn \__hook_tl_gset:Nx #1#2 { \cs_gset_nopar:Npx #1 {#2} } -\cs_generate_variant:Nn \__hook_tl_gset:Nn { c } -\cs_generate_variant:Nn \__hook_tl_gset:No { c } +\cs_generate_variant:Nn \__hook_tl_gset:Nn { c, co } \cs_generate_variant:Nn \__hook_tl_gset:Nx { c } \cs_new_protected:Npn \__hook_tl_gput_right:Nn #1#2 { \__hook_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } } -\cs_generate_variant:Nn \__hook_tl_gput_right:Nn { No, cn } +\cs_generate_variant:Nn \__hook_tl_gput_right:Nn { Ne, cn } \cs_new_protected:Npn \__hook_tl_gput_left:Nn #1#2 { \__hook_tl_gset:Nx #1 { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} } } -\cs_generate_variant:Nn \__hook_tl_gput_left:Nn { No } \cs_new_eq:NN \__hook_tl_gset_eq:NN \tl_gset_eq:NN \cs_new_protected:Npn \__hook_tl_gclear:N #1 { \__hook_tl_gset_eq:NN #1 \c_empty_tl } \cs_generate_variant:Nn \__hook_tl_gclear:N { c } - \cs_new_protected:Npn \hook_new:n #1 - { \__hook_normalize_hook_args:Nn \__hook_new:n {#1} } -\cs_new_protected:Npn \__hook_new:n #1 + { \__hook_normalize_hook_args:Nn \__hook_new:nn {#1} { 0 } } +\cs_new_protected:Npn \hook_new_with_args:nn #1 #2 + { \__hook_normalize_hook_args:Nn \__hook_new:nn {#1} {#2} } +\cs_new_protected:Npn \__hook_new:nn #1 #2 { \__hook_if_declared:nTF {#1} { \msg_error:nnn { hooks } { exists } {#1} } { \tl_new:c { g__hook_#1_declared_tl } - \__hook_make_usable:n {#1} + \cs_undefine:c { __hook~#1 } + \cs_undefine:c { c__hook_#1_parameter_tl } + \__hook_make_usable:nn {#1} {#2} + \__hook_update_hook_code:n {#1} } } -\cs_new_protected:Npn \__hook_make_usable:n #1 +\cs_new_protected:Npn \__hook_make_usable:nn #1 #2 { - \tl_if_exist:cF { __hook~#1 } + \__hook_if_usable:nF {#1} { \seq_gput_right:Nn \g__hook_all_seq {#1} - \tl_new:c { __hook~#1 } + \__kernel_cs_parm_from_arg_count:nnF + { \tl_const:cn { c__hook_#1_parameter_tl } } {#2} + { + \msg_error:nnnn { hooks } { too-many-args } {#1} {#2} + \tl_const:cx { c__hook_#1_parameter_tl } + { \exp_not:V \c__hook_nine_parameters_tl } + } + \__hook_normalise_cs_args:nn { _toplevel } {#1} + \__hook_normalise_cs_args:nn { _next } {#1} + \__hook_code_gset:nn {#1} { } \__hook_init_structure:n {#1} - \clist_new:c { g__hook_#1_labels_clist } - \tl_new:c { g__hook_#1_reversed_tl } + \__hook_normalise_code_pool:n {#1} + \clist_if_exist:cF { g__hook_#1_labels_clist } + { + \clist_new:c { g__hook_#1_labels_clist } + \tl_new:c { g__hook_#1_reversed_tl } + } \__hook_include_legacy_code_chunk:n {#1} } } @@ -4712,27 +4731,53 @@ \__hook_if_structure_exist:nF {#1} { \prop_new:c { g__hook_#1_code_prop } - \tl_new:c { __hook_toplevel~#1 } - \tl_new:c { __hook_next~#1 } + \__hook_toplevel_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } } } \cs_new_protected:Npn \hook_new_reversed:n #1 - { \__hook_normalize_hook_args:Nn \__hook_new_reversed:n {#1} } -\cs_new_protected:Npn \__hook_new_reversed:n #1 + { \__hook_normalize_hook_args:Nn \__hook_new_reversed:nn {#1} { 0 } } +\cs_new_protected:Npn \hook_new_reversed_with_args:nn #1 #2 + { \__hook_normalize_hook_args:Nn \__hook_new_reversed:nn {#1} {#2} } +\cs_new_protected:Npn \__hook_new_reversed:nn #1 #2 { - \__hook_new:n {#1} - \tl_gset:cn { g__hook_#1_reversed_tl } { - } + \__hook_if_declared:nTF {#1} + { \msg_error:nnn { hooks } { exists } {#1} } + { + \__hook_new:nn {#1} {#2} + \tl_gset:cn { g__hook_#1_reversed_tl } { - } + } } \cs_new_protected:Npn \hook_new_pair:nn #1#2 - { \hook_new:n {#1} \hook_new_reversed:n {#2} } + { \__hook_normalize_hook_args:Nnn \__hook_new_pair:nnn {#1} {#2} { 0 } } +\cs_new_protected:Npn \hook_new_pair_with_args:nnn #1#2#3 + { \__hook_normalize_hook_args:Nnn \__hook_new_pair:nnn {#1} {#2} {#3} } +\cs_new_protected:Npn \__hook_new_pair:nnn #1 #2 #3 + { + \__hook_if_declared:nTF {#1} + { \msg_error:nnn { hooks } { exists } {#1} } + { + \__hook_if_declared:nTF {#2} + { \msg_error:nnn { hooks } { exists } {#2} } + { + \__hook_new:nn {#1} {#3} + \__hook_new_reversed:nn {#2} {#3} + } + } + } \cs_new_protected:Npn \__hook_include_legacy_code_chunk:n #1 { \tl_if_exist:cT { @#1hook } { \tl_if_empty:cF { @#1hook } { - \exp_args:Nnnv \__hook_hook_gput_code_do:nnn {#1} - { legacy } { @#1hook } + \__hook_replacing_args_false: + \use:e + { + \__hook_hook_gput_code_do:nnn {#1} { legacy } + { \exp_not:v { @#1hook } } + } + \__hook_replacing_args_reset: \__hook_tl_gclear:c { @#1hook } } } @@ -4748,7 +4793,7 @@ { \bool_lazy_and:nnTF { \tl_if_exist_p:c { g__hook_#1_declared_tl } } - { ! \tl_if_exist_p:c { __hook~#1 } } + { ! \cs_if_exist_p:c { __hook~#1 } } { \prg_return_true: } { \prg_return_false: } } @@ -4762,7 +4807,7 @@ \__hook_if_declared:nF {#1} { \tl_new:c { g__hook_#1_declared_tl } - \__hook_make_usable:n {#1} + \__hook_make_usable:nn {#1} { 0 } \tl_gset:cx { g__hook_#1_reversed_tl } { \__hook_if_generic_reversed:nT {#1} { - } } \__hook_update_hook_code:n {#1} @@ -4909,23 +4954,45 @@ } { \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} } } -\cs_new_protected:Npn \hook_gput_code:nnn #1 #2 - { \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} } +\cs_new_protected:Npn \hook_gput_code:nnn #1 #2 #3 + { + \__hook_replacing_args_false: + \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} {#3} + \__hook_replacing_args_reset: + } +\cs_new_protected:Npn \hook_gput_code_with_args:nnn #1 #2 #3 + { + \__hook_replacing_args_true: + \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} {#3} + \__hook_replacing_args_reset: + } \cs_new_protected:Npn \__hook_gput_code:nnn #1 #2 #3 { + \__hook_chk_args_allowed:nn {#1} { AddToHook } \__hook_if_execute_immediately:nTF {#1} - {#3} { - \__hook_if_usable:nTF {#1} + \__hook_if_replacing_args:TF { - \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} - \__hook_update_hook_code:n {#1} - } - { - \__hook_if_disabled:nTF {#1} - { \msg_error:nnn { hooks } { hook-disabled } {#1} } - { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} } + \msg_error:nnnn { hooks } { one-time-args } + {#1} { AddToHook } } + { } + \use:n + } + { \__hook_gput_code_store:nnn {#1} {#2} } + {#3} + } +\cs_new_protected:Npn \__hook_gput_code_store:nnn #1 #2 #3 + { + \__hook_if_usable:nTF {#1} + { + \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} + \__hook_update_hook_code:n {#1} + } + { + \__hook_if_disabled:nTF {#1} + { \msg_error:nnn { hooks } { hook-disabled } {#1} } + { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} } } } \cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 @@ -4939,18 +5006,57 @@ \str_if_eq:eeTF { top-level } { \__hook_currname_or_default: } { \__hook_init_structure:n {#1} - \__hook_tl_gput_right:cn { __hook_toplevel~#1 } {#3} + \__hook_cs_gput_right:nnn { _toplevel } {#1} {#3} } { \msg_error:nnn { hooks } { misused-top-level } {#1} } } { - \prop_get:cnNTF { g__hook_#1_code_prop } {#2} \l__hook_return_tl + \exp_args:Nx \__hook_prop_gput_labeled_cleanup:nnn + { + \__hook_if_replacing_args:TF + { \exp_not:n } + { \__hook_double_hashes:n } + {#3} + } + {#1} {#2} + } + } +\cs_new_protected:Npn \__hook_prop_gput_labeled_cleanup:nnn #1 #2 #3 + { + \tl_set:Nn \l__hook_return_tl {#1} + \__hook_if_replacing_args:TF + { + \__hook_if_usable:nT {#2} + { + \__hook_set_normalise_fn:nn {#2} + { Invalid~code~added~\msg_line_context: } + \__hook_normalise_fn:nn {#3} {#1} + \prop_get:NnN \l__hook_work_prop {#3} \l__hook_return_tl + } + } + { } + \exp_args:NcV \__hook_prop_gput_labeled_do:Nnn + { g__hook_#2_code_prop } \l__hook_return_tl {#3} + } +\cs_new_protected:Npn \__hook_prop_gput_labeled_do:Nnn #1 #2 #3 + { + \prop_get:NnNTF #1 {#3} \l__hook_return_tl + { \prop_gput:Nno #1 {#3} { \l__hook_return_tl #2 } } + { \prop_gput:Nnn #1 {#3} {#2} } + } +\cs_new_protected:Npn \__hook_chk_args_allowed:nn #1 #2 + { + \__hook_if_replacing_args:TF + { + \__hook_if_declared:nT {#1} + { \tl_if_empty:cT { c__hook_#1_parameter_tl } { \use_ii:nn } } + \use_none:n { - \prop_gput:cno { g__hook_#1_code_prop } {#2} - { \l__hook_return_tl #3 } + \msg_error:nnnn { hooks } { without-args } {#1} {#2} + \__hook_replacing_args_false: } - { \prop_gput:cnn { g__hook_#1_code_prop } {#2} {#3} } } + { } } \cs_new_protected:Npn \__hook_gput_undeclared_hook:nnn #1 #2 #3 { @@ -4960,14 +5066,14 @@ \cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 { \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} - \hook_gput_code:nnn + \__hook_gput_code:nnn \__hook_gput_undeclared_hook:nnn {#1} } \cs_new_protected:Npn \__hook_try_declaring_generic_next_hook:nn #1 { \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} - \hook_gput_next_code:nn + \__hook_gput_next_code:nn \__hook_gput_next_do:nn {#1} } @@ -4979,8 +5085,12 @@ \__hook_if_usable:nF {#5} { \str_if_eq:nnT {#1} { cmd } - { \__hook_try_put_cmd_hook:n {#5} } - \__hook_make_usable:n {#5} + { + \__hook_try_put_cmd_hook:n {#5} + \__hook_make_usable:nn {#5} { 9 } + \use_none:nnn + } + \__hook_make_usable:nn {#5} { 0 } } \__hook_if_generic_reversed:nT {#5} { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } @@ -5020,17 +5130,6 @@ { #3 / #5 / #4 } #1 #2 { #3 / #5 / #4 } } -\prg_new_conditional:Npnn \__hook_if_file_hook:w - #1 / #2 \s__hook_mark #3 { TF } - { - \__hook_if_generic:nTF {#3} - { - \str_if_eq:nnTF {#1} { file } - { \prg_return_true: } - { \prg_return_false: } - } - { \prg_return_false: } - } \clist_map_inline:nn { cmd , env , file , package , class , include } { \tl_const:cn { c__hook_generic_#1/./before_tl } { + } @@ -5046,6 +5145,8 @@ \tl_const:cn { c__hook_deprecated_#1/./after_tl } { } } \tl_const:cn { c__hook_deprecated_include/./end_tl } { } +\tl_const:cn { c__hook_parameter_cmd/./before_tl } { #1#2#3#4#5#6#7#8#9 } +\tl_const:cn { c__hook_parameter_cmd/./after_tl } { #1#2#3#4#5#6#7#8#9 } \cs_new_protected:Npn \hook_gremove_code:nn #1 #2 { \__hook_normalize_hook_args:Nnn \__hook_gremove_code:nn {#1} {#2} } \cs_new_protected:Npn \__hook_gremove_code:nn #1 #2 @@ -5055,12 +5156,12 @@ \str_if_eq:nnTF {#2} {*} { \prop_gclear:c { g__hook_#1_code_prop } - \__hook_tl_gclear:c { __hook_toplevel~#1 } - \__hook_tl_gclear:c { __hook_next~#1 } + \__hook_toplevel_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } } { \str_if_eq:nnTF {#2} { top-level } - { \__hook_tl_gclear:c { __hook_toplevel~#1 } } + { \__hook_toplevel_gset:nn {#1} { } } { \prop_gpop:cnNF { g__hook_#1_code_prop } {#2} \l__hook_return_tl { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } @@ -5078,9 +5179,192 @@ { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } } } -\prop_new:c {g__hook_??_code_prop} -\prop_new:c {__hook~??} -\tl_new:c {g__hook_??_reversed_tl} +\cs_new_protected:Npn \__hook_cs_gput_right:nnn #1 #2 #3 + { + \cs_if_exist:cF { __hook#1~#2 } + { \__hook_code_gset_aux:nnn {#1} {#2} { } } + \__hook_code_gset_auxi:eeen + { + \__hook_if_declared:nTF {#2} + { \tl_use:c { c__hook_#2_parameter_tl } } + { + \__hook_if_generic:nTF {#2} + { \__hook_generic_parameter:n {#2} } + { \c__hook_nine_parameters_tl } + } + } + { + \exp_args:NNo \exp_args:No \__hook_double_hashes:n + { + \cs:w __hook#1~#2 \exp_last_unbraced:Ne \cs_end: + { \__hook_braced_cs_parameter:n { __hook#1~#2 } } + } + } + { + \__hook_if_replacing_args:TF + { \exp_not:n } + { \__hook_double_hashes:n } + {#3} + } + { __hook#1~#2 } + } +\cs_new_protected:Npn \__hook_code_gset_auxi:nnnn #1 #2 #3 #4 + { \cs_gset:cpn {#4} #1 { #2 #3 } } +\cs_generate_variant:Nn \__hook_code_gset_auxi:nnnn { eeen } +\cs_new_protected:Npn \__hook_code_gset:nn + { \__hook_code_gset_aux:nnn { } } +\cs_new_protected:Npn \__hook_toplevel_gset:nn + { \__hook_code_gset_aux:nnn { _toplevel } } +\cs_new_protected:Npn \__hook_next_gset:nn + { \__hook_code_gset_aux:nnn { _next } } +\cs_new_protected:Npn \__hook_code_gset_aux:nnn #1 #2 #3 + { + \cs_gset:cpn { __hook#1~#2 \exp_last_unbraced:Ne } + { \__hook_parameter:n {#2} } + {#3} + } +\cs_generate_variant:Nn \__hook_code_gset:nn { ne } +\cs_new_protected:Npn \__hook_normalise_cs_args:nn #1 #2 + { + \cs_if_exist:cT { __hook#1~#2 } + { + \__hook_code_gset_auxi:eeen + { \tl_use:c { c__hook_#2_parameter_tl } } + { + \exp_args:NNo \exp_args:No \__hook_double_hashes:n + { + \cs:w __hook#1~#2 \exp_last_unbraced:Ne \cs_end: + { \__hook_braced_cs_parameter:n { __hook#1~#2 } } + } + } + { } + { __hook#1~#2 } + } + } +\cs_new_protected:Npn \__hook_normalise_code_pool:n #1 + { + \__hook_set_normalise_fn:nn {#1} { Offending~label:~'##1' } + \prop_clear:N \l__hook_work_prop + \prop_map_function:cN { g__hook_#1_code_prop } \__hook_normalise_fn:nn + \prop_gset_eq:cN { g__hook_#1_code_prop } \l__hook_work_prop + } +\cs_new_protected:Npn \__hook_set_normalise_fn:nn #1 #2 + { + \cs_set:Npn \__hook_tmp:w ##1##2##3##4##5##6##7##8##9 { } + \tl_set:Ne \l__hook_tmpb_tl + { \__hook_braced_cs_parameter:n { __hook_tmp:w } } + \group_begin: + \__hook_tl_set:cn { c__hook_hash_tl } { \exp_not:N \c__hook_hashes_tl } + \use:e + { + \group_end: + \tl_set:Nn \exp_not:N \l__hook_tmpb_tl { \l__hook_tmpb_tl } + } + \exp_last_unbraced:NNf + \cs_set:Npn \__hook_tmp:w { \__hook_parameter:n {#1} } { } + \tl_set:Ne \l__hook_tmpa_tl { \__hook_braced_cs_parameter:n { __hook_tmp:w } } + \cs_gset_protected:Npx \__hook_normalise_fn:nn ##1 ##2 + { + \group_begin: + \int_set:Nn \tex_escapechar:D { -1 } + \cs_set:cpn + { + hook~'#1'. ^^J + (hooks) \prg_replicate:nn { 13 } { ~ } + #2 % more message text + } + \exp_not:v { c__hook_#1_parameter_tl } + {##2} + \group_end: + \cs_set:Npn \exp_not:N \__hook_tmp:w + \exp_not:V \c__hook_nine_parameters_tl + { + \prop_put:Nne \exp_not:N \l__hook_work_prop + {##1} { \exp_not:N \__hook_double_hashes:n {##2} } + } + \exp_not:N \__hook_tmp:w + \exp_not:V \l__hook_tmpa_tl + \exp_args:No \exp_not:o + { \exp_after:wN \__hook_tmp:w \l__hook_tmpb_tl } + } + } +\cs_new_eq:NN \__hook_normalise_fn:nn ? +\prg_new_conditional:Npnn \__hook_cs_if_empty:c #1 { p, T, F, TF } + { + \if:w \scan_stop: \__hook_replacement_spec:c {#1} \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\cs_new:Npn \__hook_replacement_spec:c #1 + { + \exp_args:Nc \token_if_macro:NT {#1} + { \cs_replacement_spec:c {#1} } + } +\cs_new:Npn \__hook_braced_cs_parameter:n #1 + { + \exp_last_unbraced:Ne \__hook_braced_hidden_loop:w + { \exp_args:Nc \__hook_cs_parameter_count:N {#1} } ? \s__hook_mark + } +\cs_new:Npn \__hook_braced_hidden_loop:w #1 + { + \if:w ? #1 + \__hook_use_i_delimit_by_s_mark:nw + \fi: + { \exp_not:N \c__hook_hash_tl #1 } + \__hook_braced_hidden_loop:w + } +\cs_new:Npn \__hook_cs_parameter_count:N #1 + { + \exp_last_unbraced:Nf \__hook_cs_parameter_count:w + { \token_if_macro:NT #1 { \cs_parameter_spec:N #1 } } + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + \s__hook_mark + } +\cs_new:Npn \__hook_cs_parameter_count:w #1#2 #3#4 #5#6 #7#8 + { #2 #4 #6 #8 \__hook_cs_parameter_count:w } +\cs_new:Npn \__hook_cs_end:w #1 \s__hook_mark { } +\cs_new:Npn \__hook_braced_parameter:n #1 + { + \if_case:w + \int_eval:n + { \exp_args:Nv \str_count:n { c__hook_#1_parameter_tl } / 3 } + \exp_stop_f: + \or: {##1} + \or: {##1} {##2} + \or: {##1} {##2} {##3} + \or: {##1} {##2} {##3} {##4} + \or: {##1} {##2} {##3} {##4} {##5} + \or: {##1} {##2} {##3} {##4} {##5} {##6} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} {##9} + \else: + \msg_expandable_error:nnn { latex2e } { should-not-happen } + { Invalid~parameter~spec. } + \fi: + } +\cs_new:Npn \__hook_parameter:n #1 + { + \cs:w c__hook_ + \tl_if_exist:cTF { c__hook_#1_parameter_tl } + { #1_parameter } { empty } + _tl \cs_end: + } +\cs_new:Npn \__hook_generic_parameter:n #1 + { \__hook_generic_parameter:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_generic_parameter:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist_use:cF { c__hook_parameter_#1/./#3_tl } + { \c__hook_empty_tl } + } +\prop_new:c { g__hook_??_code_prop } +\prop_new:c { __hook~?? } +\tl_new:c { g__hook_??_reversed_tl } +\tl_const:cn { c__hook_??_parameter_tl } { } \cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4 { \__hook_normalize_hook_rule_args:Nnnnn \__hook_gset_rule:nnnn @@ -5093,13 +5377,13 @@ \__hook_deprecated_generic_warn:n {#1} \__hook_do_deprecated_generic:Nn \__hook_gset_rule:nnnn {#1} {#2} {#3} {#4} - \__hook_clean_to_scan:w + \__hook_use_none_delimit_by_s_mark:w } \__hook_if_execute_immediately:nT {#1} { \msg_error:nnnnnn { hooks } { rule-too-late } {#1} {#2} {#3} {#4} - \__hook_clean_to_scan:w + \__hook_use_none_delimit_by_s_mark:w } \__hook_init_structure:n {#1} \__hook_rule_gclear:nnn {#1} {#2} {#4} @@ -5164,23 +5448,29 @@ \cs_end: } \cs_new_eq:NN \__hook_update_hook_code:n \use_none:n -\cs_new_protected:Npn \__hook_initialize_all: { - \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n - \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } - \seq_map_inline:Nn \g__hook_all_seq +\cs_new_protected:Npn \__hook_initialize_all: + { + \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n + \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } + \seq_map_inline:Nn \g__hook_all_seq { + \tl_if_empty:cTF { c__hook_##1_parameter_tl } + { \__hook_replacing_args_false: } + { \__hook_replacing_args_true: } \__hook_update_hook_code:n {##1} + \__hook_replacing_args_reset: } - \__hook_debug:n - { \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:} - \prop_map_inline:Nn \g__hook_used_prop - { \iow_term:x{^^J~ ##1~ ->~ - \exp_not:v {__hook~##1}~ } - } - } - \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n - \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n -} + \__hook_debug:n + { + \iow_term:x { ^^J All~initialized~(non-empty)~hooks: } + \prop_map_inline:Nn \g__hook_used_prop + { + \iow_term:x + { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { __hook~##1 } ~ } + } + } + \__hook_post_initialization_defs: + } \cs_new_protected:Npn \__hook_initialize_hook_code:n #1 { \__hook_debug:n @@ -5190,10 +5480,10 @@ { \prop_if_empty:cTF { g__hook_#1_code_prop } { - \__hook_tl_gset:co { __hook~#1 } + \__hook_code_gset:ne {#1} { - \cs:w __hook_toplevel~#1 \exp_after:wN \cs_end: - \cs:w __hook_next~#1 \cs_end: + \exp_not:c { __hook_toplevel~#1 } \__hook_braced_parameter:n {#1} + \exp_not:c { __hook_next~#1 } \__hook_braced_parameter:n {#1} } } { @@ -5284,8 +5574,15 @@ \__hook_debug_label_data:N \l__hook_work_prop \iow_term:x{====================} } - \exp_args:NNo \__hook_tl_gput:Nn #1 { \cs:w __hook_toplevel~#3 \cs_end: } - \__hook_tl_gput_right:No #1 { \cs:w __hook_next~#3 \cs_end: } + \exp_args:NNe \__hook_tl_gput:Nn #1 + { \exp_not:c { __hook_toplevel~#3 } \__hook_braced_parameter:n {#3} } + \__hook_tl_gput_right:Ne #1 + { \exp_not:c { __hook_next~#3 } \__hook_braced_parameter:n {#3} } + \use:e + { + \cs_gset:cpn { __hook~#3 } \use:c { c__hook_#3_parameter_tl } + { \exp_not:V #1 } + } } \cs_generate_variant:Nn \__hook_initialize_single:NNn { cc } \cs_new:Npn \__hook_tl_gput:Nn { \ERROR } @@ -5412,7 +5709,20 @@ } \__hook_preamble_hook:n {#1} \__hook_log_cmd:x - { ^^J ->~The~ \__hook_if_generic:nT {#1} { generic~ } hook~'#1': } + { + ^^J ->~The~ + \__hook_if_generic:nT {#1} { generic~ } + hook~'#1' + \__hook_if_disabled:nF {#1} + { + \exp_args:Nf \__hook_print_args:nn {#1} + { + \int_eval:n + { \str_count:e { \__hook_parameter:n {#1} } / 3 } + } + } + : + } \__hook_if_usable:nF {#1} { \__hook_log_line:x { The~hook~is~not~declared. } } \__hook_if_disabled:nT {#1} @@ -5425,7 +5735,12 @@ { \__hook_log_line_indent:x { --- } } { \prop_map_inline:cn { g__hook_#1_code_prop } - { \__hook_log_line_indent:x { ##1~->~\tl_to_str:n {##2} } } + { + \exp_after:wN \cs_set:Npn \exp_after:wN \__hook_tmp:w + \c__hook_nine_parameters_tl {##2} + \__hook_log_line_indent:x + { ##1~->~\cs_replacement_spec:N \__hook_tmp:w } + } } \__hook_log_line:x { @@ -5435,16 +5750,19 @@ } \__hook_log_line_indent:x { - \tl_if_empty:cTF { __hook_toplevel~#1 } + \__hook_cs_if_empty:cTF { __hook_toplevel~#1 } { --- } - { -> ~ \exp_args:Nv \tl_to_str:n { __hook_toplevel~#1 } } + { -> ~ \cs_replacement_spec:c { __hook_toplevel~#1 } } } \__hook_log_line:x { Extra~code~for~next~invocation: } \__hook_log_line_indent:x { - \tl_if_empty:cTF { __hook_next~#1 } + \__hook_cs_if_empty:cTF { __hook_next~#1 } { --- } - { ->~ \exp_args:Nv \__hook_log_next_code:n { __hook_next~#1 } } + { + -> ~ \exp_last_unbraced:Nf \__hook_log_next_code:w + { \cs_replacement_spec:c { __hook_next~#1 } } + } } \__hook_log_line:x { Rules: } \bool_set_true:N \l__hook_tmpa_bool @@ -5479,7 +5797,7 @@ \@spaces \clist_if_empty:cTF { g__hook_#1_labels_clist } { --- } - { \clist_use:cn {g__hook_#1_labels_clist} { ,~ } } + { \clist_use:cn { g__hook_#1_labels_clist } { ,~ } } } } { @@ -5493,8 +5811,19 @@ } } } -\cs_new:Npn \__hook_log_next_code:n #1 - { \exp_args:No \tl_to_str:n { \use_none:nn #1 } } +\exp_last_unbraced:NNNNo +\cs_new:Npn \__hook_log_next_code:w #1 \c_right_brace_str { } +\cs_new:Npn \__hook_print_args:nn #1 #2 + { + \int_compare:nNnT {#2} > { 0 } + { + \__hook_if_declared:nT {#1} { \use_none:nnn } + \__hook_if_cmd_hook:nT {#1} + { \use_i:nnn { ~ (unknown ~ } } + \use:n { ~ (#2 ~ } + argument \int_compare:nNnT {#2} > { 1 } { s } ) + } + } \cs_new_protected:Npn \__hook_list_rules:nn #1 #2 { \cs_set_protected:Npn \__hook_tmp:w ##1 ##2 ##3 {#2} @@ -5540,105 +5869,147 @@ } \exp_args:No \__hook_tmp:w { \use:nn { ~ } { ~ } } } -\cs_new_protected:Npn \hook_gput_next_code:nn #1 - { \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} } +\cs_new_protected:Npn \hook_gput_next_code:nn #1 #2 + { + \__hook_replacing_args_false: + \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} {#2} + \__hook_replacing_args_reset: + } +\cs_new_protected:Npn \hook_gput_next_code_with_args:nn #1 #2 + { + \__hook_replacing_args_true: + \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} {#2} + \__hook_replacing_args_reset: + } \cs_new_protected:Npn \__hook_gput_next_code:nn #1 #2 { \__hook_if_disabled:nTF {#1} { \msg_error:nnn { hooks } { hook-disabled } {#1} } { \__hook_if_structure_exist:nTF {#1} - { \__hook_gput_next_do:nn {#1} {#2} } - { \__hook_try_declaring_generic_next_hook:nn {#1} {#2} } + { \__hook_gput_next_do:nn } + { \__hook_try_declaring_generic_next_hook:nn } + {#1} {#2} } } \cs_new_protected:Npn \__hook_gput_next_do:nn #1 { - \exp_args:Nc \__hook_gput_next_do:Nnn - { __hook_next~#1 } {#1} - } -\cs_new_protected:Npn \__hook_gput_next_do:Nnn #1 #2 - { - \tl_if_empty:cT { __hook~#2 } - { \__hook_update_hook_code:n {#2} } - \tl_if_empty:NT #1 - { \__hook_tl_gset:Nn #1 { \__hook_clear_next:n {#2} } } - \__hook_tl_gput_right:Nn #1 + \__hook_init_structure:n {#1} + \__hook_chk_args_allowed:nn {#1} { AddToHookNext } + \__hook_cs_if_empty:cT { __hook~#1 } + { \__hook_update_hook_code:n {#1} } + \__hook_cs_if_empty:cT { __hook_next~#1 } + { \__hook_next_gset:nn {#1} { \__hook_clear_next:n {#1} } } + \__hook_cs_gput_right:nnn { _next } {#1} } \cs_new_protected:Npn \hook_gclear_next_code:n #1 { \__hook_normalize_hook_args:Nn \__hook_clear_next:n {#1} } \cs_new_protected:Npn \__hook_clear_next:n #1 - { \cs_gset_eq:cN { __hook_next~#1 } \c_empty_tl } + { \__hook_next_gset:nn {#1} { } } \cs_new_protected:Npn \hook_use:n #1 { - \tl_if_exist:cT { __hook~#1 } - { - \__hook_preamble_hook:n {#1} - \cs:w __hook~#1 \cs_end: - } + \__hook_preamble_hook:n {#1} + \__hook_use_initialized:n {#1} } \cs_new:Npn \__hook_use_initialized:n #1 { \if_cs_exist:w __hook~#1 \cs_end: - \cs:w __hook~#1 \exp_after:wN \cs_end: + \cs:w __hook~#1 \use_i:nn \fi: + \use_none:n + \cs_end: } \cs_new_protected:Npn \__hook_preamble_hook:n #1 - { \__hook_initialize_hook_code:n {#1} } + { + \if_cs_exist:w __hook~#1 \cs_end: + \__hook_initialize_hook_code:n {#1} + \fi: + } +\cs_new_protected:Npn \hook_use:nnw #1 + { + \__hook_preamble_hook:n {#1} + \__hook_use_initialized:nnw {#1} + } +\cs_new:Npn \__hook_use_initialized:nnw #1 #2 + { + \cs:w + \if_cs_exist:w __hook~#1 \cs_end: + __hook~#1 + \else: + use_none: \prg_replicate:nn {#2} { n } + \fi: + \cs_end: + } +\cs_new_protected:Npn \__hook_post_initialization_defs: + { + \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n + \cs_gset_eq:NN \hook_use:nnw \__hook_use_initialized:nnw + \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n + \cs_gset_eq:NN \__hook_post_initialization_defs: \prg_do_nothing: + } \cs_new_protected:Npn \hook_use_once:n #1 { \__hook_if_execute_immediately:nF {#1} - { \__hook_normalize_hook_args:Nn \__hook_use_once:n { \use:n {#1} } } + { \__hook_normalize_hook_args:Nn \__hook_use_once:nn { \use:n {#1} } { 0 } } + } +\cs_new_protected:Npn \hook_use_once:nnw #1 #2 + { + \__hook_if_execute_immediately:nF {#1} + { \__hook_normalize_hook_args:Nn \__hook_use_once:nn { \use:n {#1} } {#2} } } -\cs_new_protected:Npn \__hook_use_once:n #1 +\cs_new_protected:Npn \__hook_use_once:nn #1 #2 { \__hook_preamble_hook:n {#1} \__hook_use_once_set:n {#1} - \__hook_use_initialized:n {#1} - \__hook_use_once_clear:n {#1} + \__hook_replacing_args_false: + \__hook_cs_gput_right:nnn { _next } {#1} { \__hook_use_once_clear:n {#1} } + \__hook_replacing_args_reset: + \__hook_if_usable:nTF {#1} + { \__hook_use_initialized:n {#1} } + { + \int_compare:nNnT {#2} > { 0 } + { \use:c { use_none: \prg_replicate:nn {#2} { n } } } + } } \cs_new_protected:Npn \__hook_use_once_set:n #1 { \__hook_tl_gset:cn { g__hook_#1_reversed_tl } { I } } \cs_new_protected:Npn \__hook_use_once_clear:n #1 { - \__hook_tl_gclear:c { __hook~#1 } - \__hook_tl_gclear:c { __hook_next~#1 } - \__hook_tl_gclear:c { __hook_toplevel~#1 } + \__hook_code_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } + \__hook_toplevel_gset:nn {#1} { } \prop_gclear_new:c { g__hook_#1_code_prop } } \prg_new_conditional:Npnn \__hook_if_execute_immediately:n #1 { T, F, TF } { - \__hook_if_usable:nTF {#1} - { - \exp_after:wN \__hook_clean_to_scan:w - \if:w I \cs:w g__hook_#1_reversed_tl \cs_end: - \s__hook_mark \prg_return_true: - \else: - \s__hook_mark \prg_return_false: + \exp_after:wN \__hook_use_none_delimit_by_s_mark:w + \if:w I + \if_cs_exist:w g__hook_#1_reversed_tl \cs_end: + \cs:w g__hook_#1_reversed_tl \exp_after:wN \cs_end: \fi: - } - { \prg_return_false: } + X + \s__hook_mark \prg_return_true: + \else: + \s__hook_mark \prg_return_false: + \fi: } - \prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } { - \__hook_if_structure_exist:nTF {#1} - { - \bool_lazy_and:nnTF - { \prop_if_empty_p:c { g__hook_#1_code_prop } } - { - \bool_lazy_and_p:nn - { \tl_if_empty_p:c { __hook_toplevel~#1 } } - { \tl_if_empty_p:c { __hook_next~#1 } } - } - { \prg_return_true: } - { \prg_return_false: } - } - { \prg_return_true: } + \if:w + T + \prop_if_exist:cT { g__hook_#1_code_prop } + { \prop_if_empty:cF { g__hook_#1_code_prop } { F } } + \__hook_cs_if_empty:cF { __hook_toplevel~#1 } { F } + \__hook_cs_if_empty:cF { __hook_next~#1 } { F } + T + \prg_return_true: + \else: + \prg_return_false: + \fi: } \prg_new_conditional:Npnn \__hook_if_usable:n #1 { p , T , F , TF } { - \tl_if_exist:cTF { __hook~#1 } + \cs_if_exist:cTF { __hook~#1 } { \prg_return_true: } { \prg_return_false: } } @@ -5656,7 +6027,7 @@ } \prg_new_conditional:Npnn \__hook_if_reversed:n #1 { p , T , F , TF } { - \exp_after:wN \__hook_clean_to_scan:w + \exp_after:wN \__hook_use_none_delimit_by_s_mark:w \if:w - \cs:w g__hook_#1_reversed_tl \cs_end: \s__hook_mark \prg_return_true: \else: @@ -5683,6 +6054,19 @@ } { \prg_return_false: } } +\prg_new_conditional:Npnn \__hook_if_cmd_hook:n #1 { T } + { \__hook_if_cmd_hook:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_cmd_hook:w #1 / #2 / #3 / #4 \s__hook_mark + { + \if:w Y + \str_if_eq:nnF {#1} { cmd } { N } + \tl_if_exist:cF { c__hook_generic_#1/./#3_tl } { N } + Y + \prg_return_true: + \else: + \prg_return_false: + \fi: + } \prg_new_conditional:Npnn \__hook_if_generic_reversed:n #1 { T } { \__hook_if_generic_reversed:w #1 / / / \scan_stop: } \cs_new:Npn \__hook_if_generic_reversed:w #1 / #2 / #3 / #4 \scan_stop: @@ -5693,6 +6077,31 @@ \prg_return_false: \fi: } +\seq_new:N \g__hook_replacing_stack_seq +\cs_new:Npn \__hook_misused_if_replacing_args:nn #1 #2 + { + \msg_expandable_error:nnn { latex2e } { should-not-happen } + { Misused~\__hook_if_replacing_args:. } + } +\cs_new:Npn \__hook_if_replacing_args:TF + { \__hook_misused_if_replacing_args:nn } +\cs_new_protected:Npn \__hook_replacing_args_true: + { + \seq_gpush:No \g__hook_replacing_stack_seq + { \__hook_if_replacing_args:TF } + \cs_set:Npn \__hook_if_replacing_args:TF { \use_i:nn } + } +\cs_new_protected:Npn \__hook_replacing_args_false: + { + \seq_gpush:No \g__hook_replacing_stack_seq + { \__hook_if_replacing_args:TF } + \cs_set:Npn \__hook_if_replacing_args:TF { \use_ii:nn } + } +\cs_new_protected:Npn \__hook_replacing_args_reset: + { + \seq_gpop:NN \g__hook_replacing_stack_seq \l__hook_return_tl + \cs_gset_eq:NN \__hook_if_replacing_args:TF \l__hook_return_tl + } \prop_gput:Nnn \g_msg_module_type_prop { hooks } { LaTeX } \prop_gput:Nnn \g_msg_module_type_prop { latex2e } { LaTeX } \prop_gput:Nnn \g_msg_module_name_prop { latex2e } { kernel } @@ -5711,6 +6120,32 @@ { There~ already~ exists~ a~ hook~ declaration~ with~ this~ name.\\ Please~ use~ a~ different~ name~ for~ your~ hook.} +\msg_new:nnnn { hooks } { too-many-args } + { Too~many~arguments~for~hook~'#1'. } + { + You~tried~to~declare~a~hook~with~#2~arguments,~but~a~ + hook~can~only~have~up~to~nine.~LaTeX~will~define~this~ + hook~with~nine~arguments. + } +\msg_new:nnnn { hooks } { without-args } + { Hook~'#1'~has~no~arguments. } + { + You~tried~to~use~\iow_char:N\\#2WithArguments~ + on~a~hook~that~takes~no~arguments.\\ + Check~the~usage~of~the~hook~or~use~\iow_char:N\\#2~instead.\\ + \\ + LaTeX~will~use~\iow_char:N\\#2. + } +\msg_new:nnnn { hooks } { one-time-args } + { You~can't~have~arguments~in~used~one-time~hook~'#1'. } + { + You~tried~to~use~\iow_char:N\\#2WithArguments~ + on~a~one-time~hook~that~has~already~been~used.~ + You~have~to~add~the~code~before~the~hook~is~used,~ + or~add~the~code~without~arguments~using~\iow_char:N\\#2~instead.\\ + \\ + LaTeX~will~use~\iow_char:N\\#2. + } \msg_new:nnnn { hooks } { hook-disabled } { Cannot~add~code~to~disabled~hook~'#1'. } { @@ -5805,15 +6240,30 @@ Generic~hook~'#1/#2/#3'~is~deprecated. \\ Use~hook~'#1/#3/#2'~instead. } -\NewDocumentCommand \NewHook { m }{ \hook_new:n {#1} } -\NewDocumentCommand \NewReversedHook { m }{ \hook_new_reversed:n {#1} } -\NewDocumentCommand \NewMirroredHookPair { mm }{ \hook_new_pair:nn {#1}{#2} } -\NewDocumentCommand \ActivateGenericHook { m }{ \hook_activate_generic:n {#1} } -\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable_generic:n {#1} } +\NewDocumentCommand \NewHook { m } + { \hook_new:n {#1} } +\NewDocumentCommand \NewReversedHook { m } + { \hook_new_reversed:n {#1} } +\NewDocumentCommand \NewMirroredHookPair { mm } + { \hook_new_pair:nn {#1}{#2} } +\NewDocumentCommand \NewHookWithArguments { mm } + { \hook_new_with_args:nn {#1} {#2} } +\NewDocumentCommand \NewReversedHookWithArguments { mm } + { \hook_new_reversed_with_args:nn {#1} {#2} } +\NewDocumentCommand \NewMirroredHookPairWithArguments { mmm } + { \hook_new_pair_with_args:nnn {#1} {#2} {#3} } +\NewDocumentCommand \ActivateGenericHook { m } + { \hook_activate_generic:n {#1} } +\NewDocumentCommand \DisableGenericHook { m } + { \hook_disable_generic:n {#1} } \NewDocumentCommand \AddToHook { m o +m } { \hook_gput_code:nnn {#1} {#2} {#3} } +\NewDocumentCommand \AddToHookWithArguments { m o +m } + { \hook_gput_code_with_args:nnn {#1} {#2} {#3} } \NewDocumentCommand \AddToHookNext { m +m } { \hook_gput_next_code:nn {#1} {#2} } +\NewDocumentCommand \AddToHookNextWithArguments { m +m } + { \hook_gput_next_code_with_args:nn {#1} {#2} } \NewDocumentCommand \ClearHookNext { m } { \hook_gclear_next_code:n {#1} } \NewDocumentCommand \RemoveFromHook { m o } @@ -5832,6 +6282,8 @@ } \cs_new:Npn \UseHook { \hook_use:n } \cs_new:Npn \UseOneTimeHook { \hook_use_once:n } +\cs_new:Npn \UseHookWithArguments { \hook_use:nnw } +\cs_new:Npn \UseOneTimeHookWithArguments { \hook_use_once:nnw } \cs_new_protected:Npn \ShowHook { \hook_show:n } \cs_new_protected:Npn \LogHook { \hook_log:n } \cs_new_protected:Npn \DebugHooksOn { \hook_debug_on: } @@ -5921,18 +6373,20 @@ \__hook_curr_name_pop: \ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% File: ltcmdhooks.dtx (C) Copyright 2020-2021 -%% Frank Mittelbach, Phelype Oleinik, LaTeX Team +%% File: ltcmdhooks.dtx +%% Copyright (C) 2020-2023 +%% Frank Mittelbach, Phelype Oleinik, The LaTeX Project %%% From File: ltcmdhooks.dtx -\def\ltcmdhooksversion{v1.0f} -\def\ltcmdhooksdate{2021/10/20} +\def\ltcmdhooksversion{v1.0h} +\def\ltcmdhooksdate{2023/05/21} \ExplSyntaxOn \tl_new:N \g_hook_patch_action_list_tl \int_new:N \l__hook_patch_num_args_int \tl_new:N \l__hook_patch_prefixes_tl \tl_new:N \l__hook_param_text_tl \tl_new:N \l__hook_replace_text_tl -\tl_const:Nn \c__hook_hash_tl { # # } +\tl_const:Nn \c__hook_hash_tl { # } +\tl_const:Nn \c__hook_hashes_tl { # # } \cs_new_eq:NN \__hook_exp_not:NN ? \cs_new_eq:NN \__hook_def_cmd:w ? \quark_new:N \q__hook_recursion_tail @@ -6080,10 +6534,10 @@ ##1 \l__hook_replace_text_tl { \__hook_exp_not:n {##2} } } \bool_if:NTF #1 - { \__hook_tmp:w \tl_set:Nx { [ \c__hook_hash_tl 1 ] } } - { \__hook_tmp:w \tl_set:Nx { { \c__hook_hash_tl 1 } } } + { \__hook_tmp:w \tl_set:Nx { [ \c__hook_hashes_tl 1 ] } } + { \__hook_tmp:w \tl_set:Nx { { \c__hook_hashes_tl 1 } } } \int_step_inline:nnn { 2 } { \l__hook_patch_num_args_int } - { \__hook_tmp:w \tl_put_right:Nx { { \c__hook_hash_tl ##1 } } } + { \__hook_tmp:w \tl_put_right:Nx { { \c__hook_hashes_tl ##1 } } } \tl_set:Nx \l__hook_replace_text_tl { \exp_not:N #2 \exp_not:V \l__hook_replace_text_tl } \tl_set:Nx \l__hook_replace_text_tl @@ -6110,16 +6564,24 @@ \tl_set:Nx \exp_not:N \l__hook_patch_prefixes_tl { \exp_not:N \__hook_make_prefixes:w \cs_prefix_spec:N #2 / / } } - \use:x + \__hook_disable:n { cmd / #3 / #4 } + \cs_undefine:c { c__hook_cmd / #3 / #4_parameter_tl } + \__hook_make_usable:nn { cmd / #3 / #4 } { \l__hook_patch_num_args_int } + \use:e { \__hook_redefine_with_hooks:Nnnn \exp_not:N #2 \str_if_eq:nnTF {#4} { after } { \use_ii_i:nn } { \use:nn } - { { \__hook_exp_not:NN \exp_not:N \UseHook { cmd / #3 / #4 } } } + { { + \__hook_exp_not:NN \exp_not:N \UseHookWithArguments + { cmd / #3 / #4 } { \int_use:N \l__hook_patch_num_args_int } + \__hook_braced_parameter:n { cmd / #3 / #4 } + } } { { } } { \__hook_exp_not:NN \exp_not:V \l__hook_replace_text_tl } } + \__hook_update_hook_code:n { cmd / #3 / #4 } } \cs_new_protected:Npn \__hook_redefine_with_hooks:Nnnn #1 #2 #3 #4 { @@ -6168,7 +6630,11 @@ \if_meaning:w \q__hook_recursion_tail #1 \__hook_double_hashes_stop:w \fi: - \if_meaning:w \c__hook_hash_tl #1 + \if:w ? + \if_meaning:w \c__hook_hash_tl #1 ! \fi: + \if_meaning:w \c__hook_hashes_tl #1 ! \fi: + ? + \else: \use_i:nnnn \fi: \use:n @@ -6190,10 +6656,10 @@ { ~ \__hook_double_hashes:w } \cs_new_protected:Npn \__hook_retokenize_patch:Nnn #1 #2 #3 { - \__hook_patch_debug:x { ..~command~can~only~be~patched~by~rescanning } \str_if_eq:eeTF { \cs_argument_spec:N #1 } { } { \__hook_patch_expand_redefine:NNnn \c_false_bool #1 {#2} {#3} } { + \__hook_patch_debug:x { ..~command~can~only~be~patched~by~rescanning } \tl_set:Nx \l__hook_tmpa_tl { \int_compare:nNnTF { \char_value_catcode:n {`\@ } } = { 12 } @@ -6231,7 +6697,7 @@ { \__hook_patch_debug:x { ++~macro~can~be~retokenized~cleanly } \__hook_patch_debug:x { ==~retokenizing~macro~now } - \__hook_patch_retokenize:Nnnn #1 {#2} {#3} {#4} + \__hook_patch_retokenize:Nnnn #1 { cmd / #2 / #3 } {#3} {#4} \use_i_delimit_by_q_recursion_stop:nw \use_none:n } { @@ -6266,8 +6732,41 @@ { \prg_return_true: } { \prg_return_false: } } +\cs_new_protected:Npn \__hook_guess_arg_count:NN #1 + { + \exp_after:wN \__hook_guess_arg_count:wN + \token_to_meaning:N #1 \s__hook_mark + } +\exp_last_unbraced:NNNNo +\cs_new_protected:Npx \__hook_guess_arg_count:wN + #1 { \tl_to_str:n { macro: } } #2 \s__hook_mark #3 + { + \int_set:Nn #3 + { + \exp_not:N \__hook_guess_arg_count:nw { 0 } #2 + \c_hash_str 0 \s__hook_mark + } + } +\use:e + { \cs_new:Npn \exp_not:N \__hook_guess_arg_count:nw #1 #2 \c_hash_str #3 } + { + \int_compare:nNnTF { #1 + 1 } = {#3} + { \__hook_guess_arg_count:nw {#3} } + { #1 \__hook_use_none_delimit_by_s_mark:w } + } \cs_new_protected:Npn \__hook_patch_retokenize:Nnnn #1 #2 #3 #4 { + \__hook_guess_arg_count:NN #1 \l__hook_patch_num_args_int + \__hook_disable:n {#2} + \cs_undefine:c { c__hook_#2_parameter_tl } + \__hook_make_usable:nn {#2} { \l__hook_patch_num_args_int } + \tl_set:Ne \l__hook_tmpa_tl + { \exp_args:Ne \tl_to_str:n { \__hook_braced_parameter:n {#2} } } + \use:x + { + \str_replace_all:Nnn \exp_not:N \l__hook_tmpa_tl + { #### } { \c_hash_str } + } \cs_set_eq:NN \kerneltmpDoNotUse \scan_stop: \cs_set_eq:NN \__hook_tmp:w \scan_stop: \use:x @@ -6278,10 +6777,18 @@ ####1 \def \kerneltmpDoNotUse ####2 { \str_if_eq:nnT {#3} { before } - { \token_to_str:N \UseHook { cmd / #2 / #3 } } + { + \token_to_str:N \UseHookWithArguments {#2} + { \int_use:N \l__hook_patch_num_args_int } + \l__hook_tmpa_tl + } ####3 \str_if_eq:nnT {#3} { after } - { \token_to_str:N \UseHook { cmd / #2 / #3 } } + { + \token_to_str:N \UseHookWithArguments {#2} + { \int_use:N \l__hook_patch_num_args_int } + \l__hook_tmpa_tl + } } } \tl_set:Nx \exp_not:N \l__hook_tmpa_tl @@ -6289,6 +6796,7 @@ } \tl_rescan:nV { #4 \__hook_patch_required_catcodes: } \l__hook_tmpa_tl \cs_gset_eq:NN #1 \kerneltmpDoNotUse + \__hook_update_hook_code:n {#2} } \msg_new:nnnn { hooks } { cant-patch } { @@ -6626,7 +7134,9 @@ Type H <return> for immediate help.}% \def\@setpar#1{\def\par{#1}\def\@par{#1}} \def\@par{\let\par\@@par\par} \def\@restorepar{\def\par{\@par}} -%% File: ltpara.dtx (C) Copyright 2020-2023 +%% File: ltpara.dtx +%% Copyright (C) 2020-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltpara.dtx \def\ltparaversion{v1.0l} \def\ltparadate{2023/01/30} @@ -6755,7 +7265,9 @@ Type H <return> for immediate help.}% \ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% File: ltmeta.dtx (C) Copyright 2021, 2022 +%% File: ltmeta.dtx +%% Copyright (C) 2021-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltmeta.dtx \def\ltmetaversion{v1.0b} \def\ltmetadate{2022/05/18} @@ -6793,6 +7305,7 @@ Type H <return> for immediate help.}% \DeclareRobustCommand\linebreak{\@testopt{\@no@lnbk-}4} \DeclareRobustCommand\nolinebreak{\@testopt\@no@lnbk4} \DeclareRobustCommand\samepage{\interlinepenalty\@M + \predisplaypenalty\@M \postdisplaypenalty\@M \interdisplaylinepenalty\@M \@beginparpenalty\@M @@ -7243,21 +7756,24 @@ Type H <return> for immediate help.}% \set@curr@file{#1}% \expandafter\IfFileExists@\expandafter{\@curr@file}} \long\def \IfFileExists@#1#2#3{% - \openin\@inputcheck"#1" % - \ifeof\@inputcheck - \ifx\input@path\@undefined - \let\reserved@a\@secondoftwo + \edef\@filef@und{\IfFileExists@@{#1}}% + \ifx\@filef@und\@empty + \if\relax\detokenize{#1}\relax + \let\reserved@a\@firstoftwo + \def\@filef@und{".tex" }% \else - \def\reserved@a{\@iffileonpath{#1}}% + \let\reserved@a\@secondoftwo \fi \else - \closein\@inputcheck - \edef\@filef@und{"#1" }% \let\reserved@a\@firstoftwo + \edef\@filef@und{"\@filef@und" }% \fi \expandafter\def\expandafter\reserved@a \expandafter{\reserved@a{#2}{#3}}% \reserved@a} +\ExplSyntaxOn +\cs_new_eq:NN \IfFileExists@@ \file_full_name:n +\ExplSyntaxOff \long\def\@iffileonpath#1{% \let\reserved@a\@secondoftwo \expandafter\@tfor\expandafter\reserved@b\expandafter @@ -8007,6 +8523,11 @@ Type H <return> for immediate help.}% {\@nomath\mathversion \expandafter\ifx\csname mv@#1\endcsname\relax \@latex@error{Math version `#1' is not defined}\@eha\else + \ifcsname mv@\math@version @frozen\endcsname + \expandafter\let + \csname mv@\math@version @frozen\expandafter\endcsname + \csname mv@\math@version\endcsname + \fi \edef\math@version{#1}% \gdef\glb@currsize{}% \aftergroup\glb@settings @@ -11252,11 +11773,13 @@ Type H <return> for immediate help.}% \@latex@warning{Reference `#3' on page \thepage \space undefined}% \else - \expandafter#2#1\null + \expandafter#2#1\@empty\@empty\@empty\null \fi} -\def\@kernel@sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} +\long\def\@firstoffive#1#2#3#4#5{#1} +\long\def\@secondoffive#1#2#3#4#5{#2} +\def\@kernel@sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}} \def\@kernel@spageref#1{\expandafter\@setref\csname r@#1\endcsname - \@secondoftwo{#1}} + \@secondoffive{#1}} \let\@kernel@ref\@kernel@sref \let\@kernel@pageref\@kernel@spageref \NewDocumentCommand\ref{s} @@ -11277,9 +11800,17 @@ Type H <return> for immediate help.}% \def\newlabel{\@newl@bel r} \@onlypreamble\@newl@bel \let \@multiplelabels \relax +\providecommand\@currentlabelname{} +\providecommand\@currentHref{} +\providecommand\@kernel@reserved@label@data{} +\NewHookWithArguments{label}{1} \def\label#1{\@bsphack + \begingroup + \UseHookWithArguments{label}{1}{#1}% \protected@write\@auxout{}% - {\string\newlabel{#1}{{\@currentlabel}{\thepage}}}% + {\string\newlabel{#1}{{\@currentlabel}{\thepage}% + {\@currentlabelname}{\@currentHref}{\@kernel@reserved@label@data}}}% + \endgroup \@esphack} \def\@currentcounter{} \def\refstepcounter#1{\stepcounter{#1}% @@ -11842,6 +12373,10 @@ Type H <return> for immediate help.}% \ifx\mathdefaultsmode\@undefined\else \mathdefaultsmode=1 \fi +\let\@kernel@eqno\eqno +\let\@kernel@leqno\leqno +\protected\def\eqno{\@kernel@eqno\aftergroup\ignorespaces} +\protected\def\leqno{\@kernel@leqno\aftergroup\ignorespaces} %%% From File: ltlists.dtx \newskip\topsep \newskip\partopsep @@ -13781,7 +14316,9 @@ Type H <return> for immediate help.}% \def\@cite#1#2{[{#1\if@tempswa , #2\fi}]} \let\@cite@ofmt\hbox \def\@biblabel#1{[#1]} -%% File: ltmarks.dtx (C) Copyright 2022 +%% File: ltmarks.dtx +%% Copyright (C) 2022-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltmarks.dtx \def\ltmarksversion{v1.0d} \def\ltmarksdate{2022/06/01} @@ -14268,6 +14805,7 @@ Type H <return> for immediate help.}% \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater +\def\IfFileAtLeastTF#1{\expandafter\@ifl@t@r\csname ver@#1\endcsname} \def\@ifl@ter#1#2{% \expandafter\@ifl@t@r \csname ver@#2.#1\endcsname} @@ -15311,8 +15849,8 @@ Type H <return> for immediate help.}% { \__keys_options_expand_module:Nn \keys_set:nn {#1} {#2} } \ExplSyntaxOff %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0n} -\providecommand\ltfilehookdate{2022/08/18} +\providecommand\ltfilehookversion{v1.0o} +\providecommand\ltfilehookdate{2023/04/02} \ExplSyntaxOn \tl_new:N \CurrentFile \tl_new:N \CurrentFilePath @@ -15481,7 +16019,7 @@ Type H <return> for immediate help.}% \def\@kernel@make@file@csname#1#2#3{% \xdef#1{\expandafter\@set@curr@file@aux \csname\expandafter#2\@firstofone#3\@nil\endcsname}} -\def\@set@curr@file@aux#1{% +\long\def\@set@curr@file@aux#1{% \expandafter\ifx\csname\endcsname#1% .tex\else\string#1\fi} \def\@filehook@set@CurrentFile{% @@ -15600,7 +16138,7 @@ Type H <return> for immediate help.}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Copyright (C) 2020-2023 -%% Frank Mittelbach, LaTeX Team +%% Frank Mittelbach, The LaTeX Project %% %%% From File: ltshipout.dtx \providecommand\ltshipoutversion{v1.0n} @@ -17447,6 +17985,17 @@ Type H <return> for immediate help.}% \lccode`\^^[=`\^^[ % oe in OT1 \fi % End of reset block for 8-bit engines \ExplSyntaxOn +\newcommand*\BCPdata[1]{ + \str_case:nn {#1} + { + { language } { en } + { region } { US } + { script } { Latn } + { tag } { en-US } + } +} +\ExplSyntaxOff +\ExplSyntaxOn \keys_define:nn { __kernel } { lang .str_set:N = \reserved@a , @@ -17456,26 +18005,17 @@ Type H <return> for immediate help.}% { \cs_set_nopar:Npn \reserved@a { } \tl_if_blank:nTF {#2} - { \@@text@case@aux@ } - { \keys_set:nn { __kernel } {#2} } - \use:c { text_ #1 case:Vn } \reserved@a {#3} - } -\cs_new_protected:Npn \@@text@case@aux@ { } -\tl_gput_right:Nn \@kernel@after@begindocument - { - \@ifpackageloaded { babel } { - \@ifpackagelater { babel } { 2020-01-15 } + \str_set:Nx \reserved@a + { \BCPdata { casing } } + \str_if_empty:NT \reserved@a { - \cs_gset_protected:Npn \@@text@case@aux@ - { - \str_set:Nx \reserved@a - { \localeinfo* { tag.bcp47 } } - } + \str_set:Nx \reserved@a + { \BCPdata { language } } } - { } } - { } + { \keys_set:nn { __kernel } {#2} } + \use:c { text_ #1 case:Vn } \reserved@a {#3} } \exp_args_generate:n { cnx } \cs_set_protected:Npn \reserved@a #1 @@ -17490,26 +18030,20 @@ Type H <return> for immediate help.}% \reserved@a { Lower } \reserved@a { Title } \cs_new_protected:cpn { MakeLowercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2 - { - \let \kernel@saved@OE \OE + {{ \let \OE \oe \@@text@case@aux { lower } {#1} {#2} - \let \OE \kernel@saved@OE - } + }} \cs_new_protected:cpn { MakeUppercase \c_space_tl \c_space_tl \c_space_tl } [#1] #2 - { - \let \kernel@saved@oe \oe + {{ \let \oe \OE \@@text@case@aux { upper } {#1} {#2} - \let \oe \kernel@saved@oe - } + }} \cs_new_protected:cpn { MakeTitlecase \c_space_tl \c_space_tl \c_space_tl } [#1] #2 - { - \let \kernel@saved@oe \oe + {{ \let \oe \OE \@@text@case@aux { title } {#1} {#2} - \let \oe \kernel@saved@oe - } + }} \cs_new_protected_nopar:Npn\AddToNoCaseChangeList {\tl_put_right:Nn \l_text_case_exclude_arg_tl} \AddToNoCaseChangeList{ \NoCaseChange } @@ -17517,6 +18051,27 @@ Type H <return> for immediate help.}% \cs_new_eq:NN \CaseSwitch \text_case_switch:nnnn \cs_new_eq:NN \DeclareCaseChangeEquivalent \text_declare_case_equivalent:Nn +\NewDocumentCommand \DeclareLowercaseMapping { o m m } + { + \IFNoValueTF {#1} + { \text_declare_lowercase_mapping:nn } + { \text_declare_lowercase_mapping:nnn {#1} } + {#2} {#3} + } +\NewDocumentCommand \DeclareTitlecaseMapping { o m m } + { + \IFNoValueTF {#1} + { \text_declare_titlecase_mapping:nn } + { \text_declare_titlecase_mapping:nnn {#1} } + {#2} {#3} + } +\NewDocumentCommand \DeclareUppercaseMapping { o m m } + { + \IFNoValueTF {#1} + { \text_declare_uppercase_mapping:nn } + { \text_declare_uppercase_mapping:nnn {#1} } + {#2} {#3} + } \ExplSyntaxOff \def\@uclclist{\oe\OE\o\O\ae\AE \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\ij\IJ\th\TH} diff --git a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty index f053ef6e320..dd5d06981a6 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty +++ b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty @@ -765,6 +765,7 @@ of this package available from CTAN} \def\extrafloats#1{% \ifnum#1>\z@ \count@\numexpr\float@count-1\relax + \ifnum\count@<266 \ch@ck0\m@ne\insert\fi \ch@ck0\count@\count \ch@ck1\count@\dimen \ch@ck2\count@\skip @@ -773,8 +774,7 @@ of this package available from CTAN} \global\expandafter\e@alloc@chardef \csname bx@\the\float@count\endcsname\float@count \@cons\@freelist{\csname bx@\the\float@count\endcsname}% -\expandafter -\extrafloats\expandafter{\numexpr#1-1\relax}% +\expandafter\extrafloats\expandafter{\the\numexpr#1-1\expandafter}% \fi}% \fi \EndIncludeInRelease @@ -1986,8 +1986,8 @@ of this package available from CTAN} \EndIncludeInRelease %%% From File: ltcmd.dtx -\def\ltcmdversion{v1.1b} -\def\ltcmddate{2022-11-29} +\def\ltcmdversion{v1.1d} +\def\ltcmddate{2023-04-13} \edef\@latexrelease@catcode@null{\the\catcode`\^^@ } \catcode`\^^@=12 \ExplSyntaxOn @@ -3054,6 +3054,27 @@ of this package available from CTAN} \exp_not:c { #8 ~ } \exp_not:c { #8 ~ code } \exp_not:n { {#5} {#6} {#7} } } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_copy:NN}% + {Support~\NewCommandCopy~in~ltcmd} +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__cmd_copy_expandable:nnNN}% + {Distinguish~non-expandable~document~commands} +\cs_new_protected:Npn \__cmd_copy_expandable:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { #1 ~ code } { #2 ~ code } + \__cmd_set_eq_if_exist:cc { #1 ~ } { #2 ~ } + \__cmd_set_eq_if_exist:cc { #1 ~ \c_space_tl } { #2 ~ \c_space_tl } + \__cmd_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } + \exp_after:wN \__cmd_copy_expandable_signature:NnNNNNnnn #4 {#1} {#2} + \token_if_protected_macro:NTF #4 + { \cs_set_protected_nopar:Npx }{ \cs_set_nopar:Npx } + #3 + { \exp_after:wN \__cmd_copy_expandable:NnNNNNnnn #4 {#1} {#2} } + } +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__cmd_copy_expandable:nnNN}% + {Support~\NewCommandCopy~in~ltcmd} \cs_new_protected:Npn \__cmd_copy_expandable:nnNN #1 #2 #3 #4 { \cs_set_eq:cc { #1 ~ code } { #2 ~ code } @@ -3064,6 +3085,12 @@ of this package available from CTAN} \cs_set_nopar:Npx #3 { \exp_after:wN \__cmd_copy_expandable:NnNNNNnnn #4 {#1} {#2} } } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_copy_expandable:nnNN}% + {Support~\NewCommandCopy~in~ltcmd} +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__cmd_copy:NN (part 2)}% + {Support~\NewCommandCopy~in~ltcmd} \cs_new:Npn \__cmd_copy_expandable:NnNNNNnnn #1 #2 #3 #4 #5 #6 #7 #8 #9 { \exp_not:N #1 \exp_not:n { {#2} } @@ -3180,7 +3207,7 @@ of this package available from CTAN} } \exp_args:No \__cmd_tmp:w { \tl_to_str:n { end } } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\__cmd_copy:NN}% +\IncludeInRelease{2020/10/01}{\__cmd_copy:NN (part 2)}% {Support~\NewCommandCopy~in~ltcmd} \EndIncludeInRelease \IncludeInRelease{2021/11/15}{\__cmd_show:N}% @@ -3210,11 +3237,32 @@ of this package available from CTAN} } \cs_new_protected:Npn \__cmd_show_expandable:N #1 { \exp_after:wN \__cmd_show_expandable:NnNNNNnN #1 #1 } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_show:N}% + {Support~\ShowCommand~in~ltcmd} +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__cmd_show_expandable:NnNNNNnN}% + {Distinguish~non-expandable~document~commands} +\cs_new_protected:Npn \__cmd_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 + { + \exp_args:NNe \__cmd_show_command_aux:NnNNn \tl_show:x + { \token_if_protected_macro:NF #8 { expandable~ } document~command } + #8 #5 {#2} + } +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__cmd_show_expandable:NnNNNNnN}% + {Support~\ShowCommand~in~ltcmd} \cs_new_protected:Npn \__cmd_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 { \__cmd_show_command_aux:NnNNn \tl_show:x { expandable~document~command } #8 #5 {#2} } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_show_expandable:NnNNNNnN}% + {Support~\ShowCommand~in~ltcmd} +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__cmd_show:N (part 2)}% + {Support~\ShowCommand~in~ltcmd} \cs_new_protected:Npn \__cmd_show_command_aux:NnNNn #1 #2 #3 #4 #5 { \__cmd_split_signature:n {#5} @@ -3336,7 +3384,7 @@ of this package available from CTAN} \int_incr:N \l__cmd_current_arg_int } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\__cmd_show:N}% +\IncludeInRelease{2020/10/01}{\__cmd_show:N (part 2)}% {Support~\ShowCommand~in~ltcmd} \EndIncludeInRelease \cs_new_protected:Npn \__cmd_grab_b:w @@ -3670,6 +3718,7 @@ of this package available from CTAN} \tl_set:Nn \l__cmd_signature_tl {#1} \group_begin: \tex_escapechar:D = 92 \scan_stop: + \tex_endlinechar:D = `\^^M \scan_stop: \tl_clear:N \l__cmd_v_arg_tl \peek_remove_spaces:n { @@ -3687,8 +3736,8 @@ of this package available from CTAN} } \cs_new_protected:Npn \__cmd_grab_v_group_end: { - \exp_args:NNNo - \group_end: + \exp_args:NNNo + \group_end: \tl_set:Nn \l__cmd_v_arg_tl { \l__cmd_v_arg_tl } } \cs_new_protected:Npn \__cmd_grab_v_aux_test:N #1 @@ -3766,7 +3815,6 @@ of this package available from CTAN} { \cs_set_eq:NN \do \char_set_catcode_other:N \dospecials - \tex_endlinechar:D = `\^^M \scan_stop: \bool_if:NTF \l__cmd_long_bool { \char_set_catcode_other:n { \tex_endlinechar:D } } { \char_set_catcode_parameter:n { \tex_endlinechar:D } } @@ -4836,8 +4884,8 @@ of this package available from CTAN} \catcode`\^^@=\@latexrelease@catcode@null\relax %%% From File: lthooks.dtx -\def\lthooksversion{v1.0v} -\def\lthooksdate{2022/06/15} +\def\lthooksversion{v1.1d} +\def\lthooksdate{2023/05/21} \ExplSyntaxOn \NewModuleRelease{2020/10/01}{lthooks} {The~hook~management~system} @@ -4870,44 +4918,64 @@ of this package available from CTAN} \tl_new:N \g__hook_hook_curr_name_tl \seq_new:N \g__hook_name_stack_seq \cs_new_eq:NN \__hook_tmp:w ? +\tl_const:Nn \c__hook_empty_tl { } +\tl_const:Nn \c__hook_nine_parameters_tl { #1#2#3#4#5#6#7#8#9 } \cs_generate_variant:Nn \tl_gremove_once:Nn { Nx } \cs_generate_variant:Nn \tl_show:n { x } \cs_generate_variant:Nn \tl_log:n { x } +\cs_generate_variant:Nn \tl_set:Nn { Ne } +\cs_generate_variant:Nn \cs_replacement_spec:N { c } +\cs_generate_variant:Nn \prop_put:Nnn { Nne } +\cs_generate_variant:Nn \str_count:n { e } \scan_new:N \s__hook_mark -\cs_new:Npn \__hook_clean_to_scan:w #1 \s__hook_mark { } -\cs_new_protected:Npn \__hook_tl_set:Nn #1#2 - { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w {#2} } } -\cs_new_protected:Npn \__hook_tl_set:Nx #1#2 - { \cs_set_nopar:Npx #1 {#2} } -\cs_generate_variant:Nn \__hook_tl_set:Nn { c } -\cs_generate_variant:Nn \__hook_tl_set:Nx { c } +\cs_new:Npn \__hook_use_none_delimit_by_s_mark:w #1 \s__hook_mark { } +\cs_new:Npn \__hook_use_i_delimit_by_s_mark:nw #1 #2 \s__hook_mark {#1} +\cs_new_protected:Npn \__hook_tl_set:cn #1#2 + { \cs_set_nopar:cpx {#1} { \__kernel_exp_not:w {#2} } } \cs_new_protected:Npn \__hook_tl_gset:Nn #1#2 { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w {#2} } } -\cs_new_protected:Npn \__hook_tl_gset:No #1#2 - { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } } \cs_new_protected:Npn \__hook_tl_gset:Nx #1#2 { \cs_gset_nopar:Npx #1 {#2} } -\cs_generate_variant:Nn \__hook_tl_gset:Nn { c } -\cs_generate_variant:Nn \__hook_tl_gset:No { c } +\cs_generate_variant:Nn \__hook_tl_gset:Nn { c, co } \cs_generate_variant:Nn \__hook_tl_gset:Nx { c } \cs_new_protected:Npn \__hook_tl_gput_right:Nn #1#2 { \__hook_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } } -\cs_generate_variant:Nn \__hook_tl_gput_right:Nn { No, cn } +\cs_generate_variant:Nn \__hook_tl_gput_right:Nn { Ne, cn } \cs_new_protected:Npn \__hook_tl_gput_left:Nn #1#2 { \__hook_tl_gset:Nx #1 { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} } } -\cs_generate_variant:Nn \__hook_tl_gput_left:Nn { No } \cs_new_eq:NN \__hook_tl_gset_eq:NN \tl_gset_eq:NN \cs_new_protected:Npn \__hook_tl_gclear:N #1 { \__hook_tl_gset_eq:NN #1 \c_empty_tl } \cs_generate_variant:Nn \__hook_tl_gclear:N { c } - +\IncludeInRelease{2023/06/01}{\hook_new_with_args:nn} + {Hooks~with~args} \cs_new_protected:Npn \hook_new:n #1 + { \__hook_normalize_hook_args:Nn \__hook_new:nn {#1} { 0 } } +\cs_new_protected:Npn \hook_new_with_args:nn #1 #2 + { \__hook_normalize_hook_args:Nn \__hook_new:nn {#1} {#2} } +\cs_new_protected:Npn \__hook_new:nn #1 #2 + { + \__hook_if_declared:nTF {#1} + { \msg_error:nnn { hooks } { exists } {#1} } + { + \tl_new:c { g__hook_#1_declared_tl } + \cs_undefine:c { __hook~#1 } + \cs_undefine:c { c__hook_#1_parameter_tl } + \__hook_make_usable:nn {#1} {#2} + \__hook_update_hook_code:n {#1} + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_new_with_args:nn} + {Hooks~with~args} +\cs_gset_protected:Npn \hook_new:n #1 { \__hook_normalize_hook_args:Nn \__hook_new:n {#1} } -\cs_new_protected:Npn \__hook_new:n #1 +\cs_undefine:N \__hook_new:nn +\cs_gset_protected:Npn \__hook_new:n #1 { \__hook_if_declared:nTF {#1} { \msg_error:nnn { hooks } { exists } {#1} } @@ -4916,7 +4984,40 @@ of this package available from CTAN} \__hook_make_usable:n {#1} } } -\cs_new_protected:Npn \__hook_make_usable:n #1 +\cs_gset_protected:Npn \hook_new_with_args:nn #1 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_make_usable:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_make_usable:nn #1 #2 + { + \__hook_if_usable:nF {#1} + { + \seq_gput_right:Nn \g__hook_all_seq {#1} + \__kernel_cs_parm_from_arg_count:nnF + { \tl_const:cn { c__hook_#1_parameter_tl } } {#2} + { + \msg_error:nnnn { hooks } { too-many-args } {#1} {#2} + \tl_const:cx { c__hook_#1_parameter_tl } + { \exp_not:V \c__hook_nine_parameters_tl } + } + \__hook_normalise_cs_args:nn { _toplevel } {#1} + \__hook_normalise_cs_args:nn { _next } {#1} + \__hook_code_gset:nn {#1} { } + \__hook_init_structure:n {#1} + \__hook_normalise_code_pool:n {#1} + \clist_if_exist:cF { g__hook_#1_labels_clist } + { + \clist_new:c { g__hook_#1_labels_clist } + \tl_new:c { g__hook_#1_reversed_tl } + } + \__hook_include_legacy_code_chunk:n {#1} + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_make_usable:nn} + {Hooks~with~args} +\cs_undefine:N \__hook_make_usable:nn +\cs_gset_protected:Npn \__hook_make_usable:n #1 { \tl_if_exist:cF { __hook~#1 } { @@ -4928,38 +5029,127 @@ of this package available from CTAN} \__hook_include_legacy_code_chunk:n {#1} } } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_init_structure:n} + {Hooks~with~args} \cs_new_protected:Npn \__hook_init_structure:n #1 { \__hook_if_structure_exist:nF {#1} { \prop_new:c { g__hook_#1_code_prop } + \__hook_toplevel_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_init_structure:n} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_init_structure:n #1 + { + \__hook_if_structure_exist:nF {#1} + { + \prop_new:c { g__hook_#1_code_prop } \tl_new:c { __hook_toplevel~#1 } \tl_new:c { __hook_next~#1 } } } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_new_reversed_with_args:nn} + {Hooks~with~args} \cs_new_protected:Npn \hook_new_reversed:n #1 + { \__hook_normalize_hook_args:Nn \__hook_new_reversed:nn {#1} { 0 } } +\cs_new_protected:Npn \hook_new_reversed_with_args:nn #1 #2 + { \__hook_normalize_hook_args:Nn \__hook_new_reversed:nn {#1} {#2} } +\cs_new_protected:Npn \__hook_new_reversed:nn #1 #2 + { + \__hook_if_declared:nTF {#1} + { \msg_error:nnn { hooks } { exists } {#1} } + { + \__hook_new:nn {#1} {#2} + \tl_gset:cn { g__hook_#1_reversed_tl } { - } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_new_reversed_with_args:nn} + {Hooks~with~args} +\cs_gset_protected:Npn \hook_new_reversed:n #1 { \__hook_normalize_hook_args:Nn \__hook_new_reversed:n {#1} } -\cs_new_protected:Npn \__hook_new_reversed:n #1 +\cs_undefine:N \__hook_new_reversed:nn +\cs_gset_protected:Npn \__hook_new_reversed:n #1 { \__hook_new:n {#1} \tl_gset:cn { g__hook_#1_reversed_tl } { - } } +\cs_undefine:N \__hook_new_reversed:nn +\cs_gset_protected:Npn \hook_new_reversed_with_args:nn #1 #2 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_new_pair_with_args:nnn} + {Hooks~with~args} \cs_new_protected:Npn \hook_new_pair:nn #1#2 - { \hook_new:n {#1} \hook_new_reversed:n {#2} } + { \__hook_normalize_hook_args:Nnn \__hook_new_pair:nnn {#1} {#2} { 0 } } +\cs_new_protected:Npn \hook_new_pair_with_args:nnn #1#2#3 + { \__hook_normalize_hook_args:Nnn \__hook_new_pair:nnn {#1} {#2} {#3} } +\cs_new_protected:Npn \__hook_new_pair:nnn #1 #2 #3 + { + \__hook_if_declared:nTF {#1} + { \msg_error:nnn { hooks } { exists } {#1} } + { + \__hook_if_declared:nTF {#2} + { \msg_error:nnn { hooks } { exists } {#2} } + { + \__hook_new:nn {#1} {#3} + \__hook_new_reversed:nn {#2} {#3} + } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_new_pair_with_args:nnn} + {Hooks~with~args} +\cs_gset_protected:Npn \hook_new_pair:nn #1#2 + { + \hook_new:n {#1} + \hook_new_reversed:n {#2} + } +\cs_gset_protected:Npn \hook_new_pair_with_args:nnn #1#2#3 + { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_include_legacy_code_chunk:n} + {Hooks~with~args} \cs_new_protected:Npn \__hook_include_legacy_code_chunk:n #1 { \tl_if_exist:cT { @#1hook } { \tl_if_empty:cF { @#1hook } { - \exp_args:Nnnv \__hook_hook_gput_code_do:nnn {#1} - { legacy } { @#1hook } + \__hook_replacing_args_false: + \use:e + { + \__hook_hook_gput_code_do:nnn {#1} { legacy } + { \exp_not:v { @#1hook } } + } + \__hook_replacing_args_reset: \__hook_tl_gclear:c { @#1hook } } } } -\IncludeInRelease{2021/06/01}% - {\hook_disable_generic:n}{Disable~hooks} +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_include_legacy_code_chunk:n} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_include_legacy_code_chunk:n #1 + { + \tl_if_exist:cT { @#1hook } + { + \tl_if_empty:cF { @#1hook } + { + \exp_args:Nnnv \__hook_hook_gput_code_do:nnn + {#1} { legacy } { @#1hook } + \__hook_tl_gclear:c { @#1hook } + } + } + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\hook_disable_generic:n} + {Disable~hooks} \cs_new_protected:Npn \hook_disable_generic:n #1 { \__hook_normalize_hook_args:Nn \__hook_disable:n {#1} } \cs_new_protected:Npn \__hook_disable:n #1 @@ -4971,19 +5161,19 @@ of this package available from CTAN} { \bool_lazy_and:nnTF { \tl_if_exist_p:c { g__hook_#1_declared_tl } } - { ! \tl_if_exist_p:c { __hook~#1 } } + { ! \cs_if_exist_p:c { __hook~#1 } } { \prg_return_true: } { \prg_return_false: } } \EndIncludeInRelease -\IncludeInRelease{2020/10/01} - {\hook_disable_generic:n}{Disable~hooks} +\IncludeInRelease{2020/10/01}{\hook_disable_generic:n} + {Disable~hooks} \cs_new_protected:Npn \hook_disable_generic:n #1 {} \EndIncludeInRelease -\IncludeInRelease{2021/06/01}% - {\hook_activate_generic:n}{Providing~hooks} +\IncludeInRelease{2023/06/01}{\hook_activate_generic:n} + {Providing~hooks} \cs_new_protected:Npn \hook_activate_generic:n #1 { \__hook_normalize_hook_args:Nn \__hook_activate_generic:nn {#1} { } } \cs_new_protected:Npn \__hook_activate_generic:nn #1 #2 @@ -4994,6 +5184,24 @@ of this package available from CTAN} \__hook_if_declared:nF {#1} { \tl_new:c { g__hook_#1_declared_tl } + \__hook_make_usable:nn {#1} { 0 } + \tl_gset:cx { g__hook_#1_reversed_tl } + { \__hook_if_generic_reversed:nT {#1} { - } } + \__hook_update_hook_code:n {#1} + } + } + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\hook_activate_generic:n} + {Providing~hooks} +\cs_gset_protected:Npn \__hook_activate_generic:nn #1 #2 + { + \__hook_if_disabled:nTF {#1} + { \msg_warning:nnn { hooks } { activate-disabled } {#1} } + { + \__hook_if_declared:nF {#1} + { + \tl_new:c { g__hook_#1_declared_tl } \__hook_make_usable:n {#1} \tl_gset:cx { g__hook_#1_reversed_tl } { \__hook_if_generic_reversed:nT {#1} { - } } @@ -5002,11 +5210,9 @@ of this package available from CTAN} } } \EndIncludeInRelease -\IncludeInRelease{2020/10/01} - {\hook_activate_generic:n}{Providing~hooks} - -\cs_new_protected:Npn \hook_activate_generic:n #1 {} - +\IncludeInRelease{2020/10/01}{\hook_activate_generic:n} + {Providing~hooks} +\cs_gset_protected:Npn \hook_activate_generic:n #1 { } \EndIncludeInRelease \cs_new:Npn \__hook_parse_label_default:n #1 { @@ -5161,10 +5367,105 @@ of this package available from CTAN} } { \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} } } -\cs_new_protected:Npn \hook_gput_code:nnn #1 #2 - { \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} } +\IncludeInRelease{2023/06/01}{\hook_gput_code_with_args:nnn} + {Hooks~with~args} +\cs_new_protected:Npn \hook_gput_code:nnn #1 #2 #3 + { + \__hook_replacing_args_false: + \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} {#3} + \__hook_replacing_args_reset: + } +\cs_new_protected:Npn \hook_gput_code_with_args:nnn #1 #2 #3 + { + \__hook_replacing_args_true: + \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} {#3} + \__hook_replacing_args_reset: + } \cs_new_protected:Npn \__hook_gput_code:nnn #1 #2 #3 { + \__hook_chk_args_allowed:nn {#1} { AddToHook } + \__hook_if_execute_immediately:nTF {#1} + { + \__hook_if_replacing_args:TF + { + \msg_error:nnnn { hooks } { one-time-args } + {#1} { AddToHook } + } + { } + \use:n + } + { \__hook_gput_code_store:nnn {#1} {#2} } + {#3} + } +\cs_new_protected:Npn \__hook_gput_code_store:nnn #1 #2 #3 + { + \__hook_if_usable:nTF {#1} + { + \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} + \__hook_update_hook_code:n {#1} + } + { + \__hook_if_disabled:nTF {#1} + { \msg_error:nnn { hooks } { hook-disabled } {#1} } + { \__hook_try_declaring_generic_hook:nnn {#1} {#2} {#3} } + } + } +\cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 + { + \__hook_debug:n{\iow_term:x{****~ Add~ to~ + \__hook_if_usable:nF {#1} { undeclared~ } + hook~ #1~ (#2) + \on@line\space <-~ \tl_to_str:n{#3}} } + \str_if_eq:nnTF {#2} { top-level } + { + \str_if_eq:eeTF { top-level } { \__hook_currname_or_default: } + { + \__hook_init_structure:n {#1} + \__hook_cs_gput_right:nnn { _toplevel } {#1} {#3} + } + { \msg_error:nnn { hooks } { misused-top-level } {#1} } + } + { + \exp_args:Nx \__hook_prop_gput_labeled_cleanup:nnn + { + \__hook_if_replacing_args:TF + { \exp_not:n } + { \__hook_double_hashes:n } + {#3} + } + {#1} {#2} + } + } +\cs_new_protected:Npn \__hook_prop_gput_labeled_cleanup:nnn #1 #2 #3 + { + \tl_set:Nn \l__hook_return_tl {#1} + \__hook_if_replacing_args:TF + { + \__hook_if_usable:nT {#2} + { + \__hook_set_normalise_fn:nn {#2} + { Invalid~code~added~\msg_line_context: } + \__hook_normalise_fn:nn {#3} {#1} + \prop_get:NnN \l__hook_work_prop {#3} \l__hook_return_tl + } + } + { } + \exp_args:NcV \__hook_prop_gput_labeled_do:Nnn + { g__hook_#2_code_prop } \l__hook_return_tl {#3} + } +\cs_new_protected:Npn \__hook_prop_gput_labeled_do:Nnn #1 #2 #3 + { + \prop_get:NnNTF #1 {#3} \l__hook_return_tl + { \prop_gput:Nno #1 {#3} { \l__hook_return_tl #2 } } + { \prop_gput:Nnn #1 {#3} {#2} } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_gput_code:nnn} + {Providing~hooks} +\cs_gset_protected:Npn \hook_gput_code:nnn #1 #2 + { \__hook_normalize_hook_args:Nnn \__hook_gput_code:nnn {#1} {#2} } +\cs_gset_protected:Npn \__hook_gput_code:nnn #1 #2 #3 + { \__hook_if_execute_immediately:nTF {#1} {#3} { @@ -5180,7 +5481,7 @@ of this package available from CTAN} } } } -\cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 +\cs_gset_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 { \__hook_debug:n{\iow_term:x{****~ Add~ to~ \__hook_if_usable:nF {#1} { undeclared~ } @@ -5204,21 +5505,61 @@ of this package available from CTAN} { \prop_gput:cnn { g__hook_#1_code_prop } {#2} {#3} } } } +\cs_gset_protected:Npn \hook_gput_code_with_args:nnn #1#2#3 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_chk_args_allowed:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_chk_args_allowed:nn #1 #2 + { + \__hook_if_replacing_args:TF + { + \__hook_if_declared:nT {#1} + { \tl_if_empty:cT { c__hook_#1_parameter_tl } { \use_ii:nn } } + \use_none:n + { + \msg_error:nnnn { hooks } { without-args } {#1} {#2} + \__hook_replacing_args_false: + } + } + { } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_chk_args_allowed:nn} + {Hooks~with~args} +\cs_undefine:N \__hook_chk_args_allowed:nn +\EndIncludeInRelease \cs_new_protected:Npn \__hook_gput_undeclared_hook:nnn #1 #2 #3 { \__hook_init_structure:n {#1} \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} } +\IncludeInRelease{2023/06/01}{\__hook_try_declaring_generic_hook:nnn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 + { + \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} + \__hook_gput_code:nnn + \__hook_gput_undeclared_hook:nnn + {#1} + } +\cs_new_protected:Npn \__hook_try_declaring_generic_next_hook:nn #1 + { + \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} + \__hook_gput_next_code:nn + \__hook_gput_next_do:nn + {#1} + } +\EndIncludeInRelease \IncludeInRelease{2021/11/15}{\__hook_try_declaring_generic_hook:nnn} {Standardise~generic~hook~names} -\cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 +\cs_gset_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 { \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} \hook_gput_code:nnn \__hook_gput_undeclared_hook:nnn {#1} } -\cs_new_protected:Npn \__hook_try_declaring_generic_next_hook:nn #1 +\cs_gset_protected:Npn \__hook_try_declaring_generic_next_hook:nn #1 { \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} \hook_gput_next_code:nn @@ -5254,8 +5595,8 @@ of this package available from CTAN} { #3 } {#1} } \EndIncludeInRelease -\IncludeInRelease{2021/11/15}{\__hook_try_declaring_generic_hook:wn}% - {Standardise~generic~hook~names} +\IncludeInRelease{2023/06/01}{\__hook_try_declaring_generic_hook:wn} + {Hooks~with~args} \prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn #1 / #2 / #3 / #4 \scan_stop: #5 { TF } { @@ -5264,8 +5605,12 @@ of this package available from CTAN} \__hook_if_usable:nF {#5} { \str_if_eq:nnT {#1} { cmd } - { \__hook_try_put_cmd_hook:n {#5} } - \__hook_make_usable:n {#5} + { + \__hook_try_put_cmd_hook:n {#5} + \__hook_make_usable:nn {#5} { 9 } + \use_none:nnn + } + \__hook_make_usable:nn {#5} { 0 } } \__hook_if_generic_reversed:nT {#5} { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } @@ -5306,6 +5651,34 @@ of this package available from CTAN} #1 #2 { #3 / #5 / #4 } } \EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__hook_try_declaring_generic_hook:wn} + {Standardise~generic~hook~names} +\prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn + #1 / #2 / #3 / #4 \scan_stop: #5 { TF } + { + \__hook_if_generic:nTF {#5} + { + \__hook_if_usable:nF {#5} + { + \str_if_eq:nnT {#1} { cmd } + { \__hook_try_put_cmd_hook:n {#5} } + \__hook_make_usable:n {#5} + } + \__hook_if_generic_reversed:nT {#5} + { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } + \prg_return_true: + } + { + \__hook_if_deprecated_generic:nTF {#5} + { + \__hook_deprecated_generic_warn:n {#5} + \exp_after:wN \__hook_declare_deprecated_generic:NNn + \exp:w % \exp_end: + } + { \prg_return_false: } + } + } +\EndIncludeInRelease \IncludeInRelease{2021/06/01}{\__hook_try_declaring_generic_hook:wn} {Support~cmd~hooks} \prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn @@ -5334,7 +5707,7 @@ of this package available from CTAN} } } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\__hook_try_declaring_generic_hook:wn}% +\IncludeInRelease{2020/10/01}{\__hook_try_declaring_generic_hook:wn} {Support~cmd~hooks} \prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn #1 / #2 / #3 / #4 \scan_stop: #5 { TF } @@ -5356,23 +5729,11 @@ of this package available from CTAN} { \prg_return_false: } } } - \EndIncludeInRelease -\IncludeInRelease{2021/11/15}{\__hook_if_file_hook:w}% +\IncludeInRelease{2021/11/15}{\__hook_if_file_hook:w} {Standardise~generic~hook~names} -\prg_new_conditional:Npnn \__hook_if_file_hook:w - #1 / #2 \s__hook_mark #3 { TF } - { - \__hook_if_generic:nTF {#3} - { - \str_if_eq:nnTF {#1} { file } - { \prg_return_true: } - { \prg_return_false: } - } - { \prg_return_false: } - } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\__hook_if_file_hook:w}% +\IncludeInRelease{2020/10/01}{\__hook_if_file_hook:w} {Standardise~generic~hook~names} \prg_new_conditional:Npnn \__hook_if_file_hook:w #1 / #2 / #3 \s__hook_mark { TF } @@ -5392,10 +5753,10 @@ of this package available from CTAN} { \prg_return_false: } } \EndIncludeInRelease -\IncludeInRelease{2021/11/15}{\__hook_file_hook_normalize:n}% +\IncludeInRelease{2021/11/15}{\__hook_file_hook_normalize:n} {Standardise~generic~hook~names} \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\__hook_file_hook_normalize:n}% +\IncludeInRelease{2020/10/01}{\__hook_file_hook_normalize:n} {Standardise~generic~hook~names} \cs_new:Npn \__hook_file_hook_normalize:n #1 { \__hook_strip_double_slash:n {#1} } @@ -5408,7 +5769,7 @@ of this package available from CTAN} { \__hook_strip_double_slash:w #1/#2/#3 / #4 \s__hook_mark } } \EndIncludeInRelease -\IncludeInRelease{2021/11/15}{\c__hook_generics_prop}% +\IncludeInRelease{2021/11/15}{\c__hook_generics_prop} {Standardise~generic~hook~names} \clist_map_inline:nn { cmd , env , file , package , class , include } { @@ -5426,20 +5787,30 @@ of this package available from CTAN} } \tl_const:cn { c__hook_deprecated_include/./end_tl } { } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\c__hook_generics_prop}% +\IncludeInRelease{2020/10/01}{\c__hook_generics_prop} {Standardise~generic~hook~names} \prop_const_from_keyval:Nn \c__hook_generics_prop {cmd=,env=,file=,package=,class=,include=} \EndIncludeInRelease -\IncludeInRelease{2021/11/15}{\c__hook_generics_reversed_ii_prop}% +\IncludeInRelease{2021/11/15}{\c__hook_generics_reversed_ii_prop} {Standardise~generic~hook~names} \EndIncludeInRelease -\IncludeInRelease{2020/10/01}{\c__hook_generics_reversed_ii_prop}% +\IncludeInRelease{2020/10/01}{\c__hook_generics_reversed_ii_prop} {Standardise~generic~hook~names} \prop_const_from_keyval:Nn \c__hook_generics_reversed_ii_prop {after=,end=} \prop_const_from_keyval:Nn \c__hook_generics_reversed_iii_prop {after=} \prop_const_from_keyval:Nn \c__hook_generics_file_prop {before=,after=} \EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\c__hook_parameter_cmd/./before_tl} + {Hooks~with~args} +\tl_const:cn { c__hook_parameter_cmd/./before_tl } { #1#2#3#4#5#6#7#8#9 } +\tl_const:cn { c__hook_parameter_cmd/./after_tl } { #1#2#3#4#5#6#7#8#9 } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\c__hook_parameter_cmd/./before_tl} + {Hooks~with~args} +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_gremove_code:nn} + {Hooks~with~args} \cs_new_protected:Npn \hook_gremove_code:nn #1 #2 { \__hook_normalize_hook_args:Nnn \__hook_gremove_code:nn {#1} {#2} } \cs_new_protected:Npn \__hook_gremove_code:nn #1 #2 @@ -5449,6 +5820,39 @@ of this package available from CTAN} \str_if_eq:nnTF {#2} {*} { \prop_gclear:c { g__hook_#1_code_prop } + \__hook_toplevel_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } + } + { + \str_if_eq:nnTF {#2} { top-level } + { \__hook_toplevel_gset:nn {#1} { } } + { + \prop_gpop:cnNF { g__hook_#1_code_prop } {#2} \l__hook_return_tl + { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } + } + } + \__hook_if_usable:nT {#1} + { \__hook_update_hook_code:n {#1} } + } + { + \__hook_if_deprecated_generic:nTF {#1} + { + \__hook_deprecated_generic_warn:n {#1} + \__hook_do_deprecated_generic:Nn \__hook_gremove_code:nn {#1} {#2} + } + { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } + } + } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_gremove_code:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_gremove_code:nn #1 #2 + { + \__hook_if_structure_exist:nTF {#1} + { + \str_if_eq:nnTF {#2} {*} + { + \prop_gclear:c { g__hook_#1_code_prop } \__hook_tl_gclear:c { __hook_toplevel~#1 } \__hook_tl_gclear:c { __hook_next~#1 } } @@ -5472,9 +5876,260 @@ of this package available from CTAN} { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } } } -\prop_new:c {g__hook_??_code_prop} -\prop_new:c {__hook~??} -\tl_new:c {g__hook_??_reversed_tl} +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_cs_gput_right:nnn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_cs_gput_right:nnn #1 #2 #3 + { + \cs_if_exist:cF { __hook#1~#2 } + { \__hook_code_gset_aux:nnn {#1} {#2} { } } + \__hook_code_gset_auxi:eeen + { + \__hook_if_declared:nTF {#2} + { \tl_use:c { c__hook_#2_parameter_tl } } + { + \__hook_if_generic:nTF {#2} + { \__hook_generic_parameter:n {#2} } + { \c__hook_nine_parameters_tl } + } + } + { + \exp_args:NNo \exp_args:No \__hook_double_hashes:n + { + \cs:w __hook#1~#2 \exp_last_unbraced:Ne \cs_end: + { \__hook_braced_cs_parameter:n { __hook#1~#2 } } + } + } + { + \__hook_if_replacing_args:TF + { \exp_not:n } + { \__hook_double_hashes:n } + {#3} + } + { __hook#1~#2 } + } +\cs_new_protected:Npn \__hook_code_gset_auxi:nnnn #1 #2 #3 #4 + { \cs_gset:cpn {#4} #1 { #2 #3 } } +\cs_generate_variant:Nn \__hook_code_gset_auxi:nnnn { eeen } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_cs_gput_right:nnn} + {Hooks~with~args} +\cs_undefine:N \__hook_cs_gput_right:nnn +\cs_undefine:N \__hook_code_gset_auxi:nnnn +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_code_gset:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_code_gset:nn + { \__hook_code_gset_aux:nnn { } } +\cs_new_protected:Npn \__hook_toplevel_gset:nn + { \__hook_code_gset_aux:nnn { _toplevel } } +\cs_new_protected:Npn \__hook_next_gset:nn + { \__hook_code_gset_aux:nnn { _next } } +\cs_new_protected:Npn \__hook_code_gset_aux:nnn #1 #2 #3 + { + \cs_gset:cpn { __hook#1~#2 \exp_last_unbraced:Ne } + { \__hook_parameter:n {#2} } + {#3} + } +\cs_generate_variant:Nn \__hook_code_gset:nn { ne } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_code_gset:nn} + {Hooks~with~args} +\cs_undefine:N \__hook_code_gset:nn +\cs_undefine:N \__hook_toplevel_gset:nn +\cs_undefine:N \__hook_next_gset:nn +\cs_undefine:N \__hook_code_gset_aux:nnn +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_normalise_cs_args:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_normalise_cs_args:nn #1 #2 + { + \cs_if_exist:cT { __hook#1~#2 } + { + \__hook_code_gset_auxi:eeen + { \tl_use:c { c__hook_#2_parameter_tl } } + { + \exp_args:NNo \exp_args:No \__hook_double_hashes:n + { + \cs:w __hook#1~#2 \exp_last_unbraced:Ne \cs_end: + { \__hook_braced_cs_parameter:n { __hook#1~#2 } } + } + } + { } + { __hook#1~#2 } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_normalise_cs_args:nn} + {Hooks~with~args} +\cs_undefine:N \__hook_normalise_cs_args:nn +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_normalise_code_pool:n} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_normalise_code_pool:n #1 + { + \__hook_set_normalise_fn:nn {#1} { Offending~label:~'##1' } + \prop_clear:N \l__hook_work_prop + \prop_map_function:cN { g__hook_#1_code_prop } \__hook_normalise_fn:nn + \prop_gset_eq:cN { g__hook_#1_code_prop } \l__hook_work_prop + } +\cs_new_protected:Npn \__hook_set_normalise_fn:nn #1 #2 + { + \cs_set:Npn \__hook_tmp:w ##1##2##3##4##5##6##7##8##9 { } + \tl_set:Ne \l__hook_tmpb_tl + { \__hook_braced_cs_parameter:n { __hook_tmp:w } } + \group_begin: + \__hook_tl_set:cn { c__hook_hash_tl } { \exp_not:N \c__hook_hashes_tl } + \use:e + { + \group_end: + \tl_set:Nn \exp_not:N \l__hook_tmpb_tl { \l__hook_tmpb_tl } + } + \exp_last_unbraced:NNf + \cs_set:Npn \__hook_tmp:w { \__hook_parameter:n {#1} } { } + \tl_set:Ne \l__hook_tmpa_tl { \__hook_braced_cs_parameter:n { __hook_tmp:w } } + \cs_gset_protected:Npx \__hook_normalise_fn:nn ##1 ##2 + { + \group_begin: + \int_set:Nn \tex_escapechar:D { -1 } + \cs_set:cpn + { + hook~'#1'. ^^J + (hooks) \prg_replicate:nn { 13 } { ~ } + #2 % more message text + } + \exp_not:v { c__hook_#1_parameter_tl } + {##2} + \group_end: + \cs_set:Npn \exp_not:N \__hook_tmp:w + \exp_not:V \c__hook_nine_parameters_tl + { + \prop_put:Nne \exp_not:N \l__hook_work_prop + {##1} { \exp_not:N \__hook_double_hashes:n {##2} } + } + \exp_not:N \__hook_tmp:w + \exp_not:V \l__hook_tmpa_tl + \exp_args:No \exp_not:o + { \exp_after:wN \__hook_tmp:w \l__hook_tmpb_tl } + } + } +\cs_new_eq:NN \__hook_normalise_fn:nn ? +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_normalise_code_pool:n} + {Hooks~with~args} +\cs_undefine:N \__hook_normalise_code_pool:n +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_cs_if_empty:c} + {Hooks~with~args} +\prg_new_conditional:Npnn \__hook_cs_if_empty:c #1 { p, T, F, TF } + { + \if:w \scan_stop: \__hook_replacement_spec:c {#1} \scan_stop: + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\cs_new:Npn \__hook_replacement_spec:c #1 + { + \exp_args:Nc \token_if_macro:NT {#1} + { \cs_replacement_spec:c {#1} } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_cs_if_empty:c} + {Hooks~with~args} +\cs_undefine:N \__hook_cs_if_empty:c +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_braced_cs_parameter:n} + {Hooks~with~args} +\cs_new:Npn \__hook_braced_cs_parameter:n #1 + { + \exp_last_unbraced:Ne \__hook_braced_hidden_loop:w + { \exp_args:Nc \__hook_cs_parameter_count:N {#1} } ? \s__hook_mark + } +\cs_new:Npn \__hook_braced_hidden_loop:w #1 + { + \if:w ? #1 + \__hook_use_i_delimit_by_s_mark:nw + \fi: + { \exp_not:N \c__hook_hash_tl #1 } + \__hook_braced_hidden_loop:w + } +\cs_new:Npn \__hook_cs_parameter_count:N #1 + { + \exp_last_unbraced:Nf \__hook_cs_parameter_count:w + { \token_if_macro:NT #1 { \cs_parameter_spec:N #1 } } + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + ? \__hook_cs_end:w ? \__hook_cs_end:w ? \__hook_cs_end:w + \s__hook_mark + } +\cs_new:Npn \__hook_cs_parameter_count:w #1#2 #3#4 #5#6 #7#8 + { #2 #4 #6 #8 \__hook_cs_parameter_count:w } +\cs_new:Npn \__hook_cs_end:w #1 \s__hook_mark { } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_braced_cs_parameter:n} + {Hooks~with~args} +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_braced_parameter:n} + {Hooks~with~args} +\cs_new:Npn \__hook_braced_parameter:n #1 + { + \if_case:w + \int_eval:n + { \exp_args:Nv \str_count:n { c__hook_#1_parameter_tl } / 3 } + \exp_stop_f: + \or: {##1} + \or: {##1} {##2} + \or: {##1} {##2} {##3} + \or: {##1} {##2} {##3} {##4} + \or: {##1} {##2} {##3} {##4} {##5} + \or: {##1} {##2} {##3} {##4} {##5} {##6} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} + \or: {##1} {##2} {##3} {##4} {##5} {##6} {##7} {##8} {##9} + \else: + \msg_expandable_error:nnn { latex2e } { should-not-happen } + { Invalid~parameter~spec. } + \fi: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_braced_parameter:n} + {Hooks~with~args} +\cs_undefine:N \__hook_braced_parameter:n +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_parameter:n} + {Hooks~with~args} +\cs_new:Npn \__hook_parameter:n #1 + { + \cs:w c__hook_ + \tl_if_exist:cTF { c__hook_#1_parameter_tl } + { #1_parameter } { empty } + _tl \cs_end: + } +\cs_new:Npn \__hook_generic_parameter:n #1 + { \__hook_generic_parameter:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_generic_parameter:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist_use:cF { c__hook_parameter_#1/./#3_tl } + { \c__hook_empty_tl } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_parameter:n} + {Hooks~with~args} +\cs_undefine:N \__hook_parameter:n +\cs_undefine:N \__hook_generic_parameter:n +\EndIncludeInRelease +\prop_new:c { g__hook_??_code_prop } +\prop_new:c { __hook~?? } +\tl_new:c { g__hook_??_reversed_tl } +\IncludeInRelease{2023/06/01}{\c__hook_??_parameter_tl} + {Hooks~with~args} +\tl_const:cn { c__hook_??_parameter_tl } { } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\c__hook_??_parameter_tl} + {Hooks~with~args} +\cs_undefine:c { c__hook_??_parameter_tl } +\EndIncludeInRelease \cs_new_protected:Npn \hook_gset_rule:nnnn #1#2#3#4 { \__hook_normalize_hook_rule_args:Nnnnn \__hook_gset_rule:nnnn @@ -5489,13 +6144,13 @@ of this package available from CTAN} \__hook_deprecated_generic_warn:n {#1} \__hook_do_deprecated_generic:Nn \__hook_gset_rule:nnnn {#1} {#2} {#3} {#4} - \__hook_clean_to_scan:w + \__hook_use_none_delimit_by_s_mark:w } \__hook_if_execute_immediately:nT {#1} { \msg_error:nnnnnn { hooks } { rule-too-late } {#1} {#2} {#3} {#4} - \__hook_clean_to_scan:w + \__hook_use_none_delimit_by_s_mark:w } \__hook_init_structure:n {#1} \__hook_rule_gclear:nnn {#1} {#2} {#4} @@ -5585,23 +6240,55 @@ of this package available from CTAN} \cs_end: } \cs_new_eq:NN \__hook_update_hook_code:n \use_none:n -\cs_new_protected:Npn \__hook_initialize_all: { - \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n - \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } - \seq_map_inline:Nn \g__hook_all_seq +\IncludeInRelease{2023/06/01}{\__hook_initialize_all:} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_initialize_all: + { + \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n + \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } + \seq_map_inline:Nn \g__hook_all_seq { + \tl_if_empty:cTF { c__hook_##1_parameter_tl } + { \__hook_replacing_args_false: } + { \__hook_replacing_args_true: } \__hook_update_hook_code:n {##1} + \__hook_replacing_args_reset: } - \__hook_debug:n - { \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:} - \prop_map_inline:Nn \g__hook_used_prop - { \iow_term:x{^^J~ ##1~ ->~ - \exp_not:v {__hook~##1}~ } - } - } - \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n - \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n -} + \__hook_debug:n + { + \iow_term:x { ^^J All~initialized~(non-empty)~hooks: } + \prop_map_inline:Nn \g__hook_used_prop + { + \iow_term:x + { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { __hook~##1 } ~ } + } + } + \__hook_post_initialization_defs: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_initialize_all:} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_initialize_all: + { + \cs_gset_eq:NN \__hook_update_hook_code:n \__hook_initialize_hook_code:n + \__hook_debug:n { \prop_gclear:N \g__hook_used_prop } + \seq_map_inline:Nn \g__hook_all_seq + { \__hook_update_hook_code:n {##1} } + \__hook_debug:n + { + \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:} + \prop_map_inline:Nn \g__hook_used_prop + { + \iow_term:x + { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { __hook~##1 } ~ } + } + } + \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n + \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n + } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_initialize_hook_code:n} + {Hooks~with~args} \cs_new_protected:Npn \__hook_initialize_hook_code:n #1 { \__hook_debug:n @@ -5611,6 +6298,38 @@ of this package available from CTAN} { \prop_if_empty:cTF { g__hook_#1_code_prop } { + \__hook_code_gset:ne {#1} + { + \exp_not:c { __hook_toplevel~#1 } \__hook_braced_parameter:n {#1} + \exp_not:c { __hook_next~#1 } \__hook_braced_parameter:n {#1} + } + } + { + \__hook_if_reversed:nTF {#1} + { \cs_set_eq:NN \__hook_tl_gput:Nn \__hook_tl_gput_left:Nn + \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_left:NV } + { \cs_set_eq:NN \__hook_tl_gput:Nn \__hook_tl_gput_right:Nn + \cs_set_eq:NN \__hook_clist_gput:NV \clist_gput_right:NV } + \prop_set_eq:Nc \l__hook_work_prop { g__hook_#1_code_prop } + \__hook_initialize_single:ccn + { __hook~#1 } { g__hook_#1_labels_clist } {#1} + \__hook_debug:n + { \exp_args:NNx \prop_gput:Nnn \g__hook_used_prop {#1} { } } + } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_initialize_hook_code:n} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_initialize_hook_code:n #1 + { + \__hook_debug:n + { \iow_term:x { ^^J Update~code~for~hook~'#1' \on@line :^^J } } + \__hook_include_legacy_code_chunk:n {#1} + \__hook_if_usable:nT {#1} + { + \prop_if_empty:cTF { g__hook_#1_code_prop } + { \__hook_tl_gset:co { __hook~#1 } { \cs:w __hook_toplevel~#1 \exp_after:wN \cs_end: @@ -5631,6 +6350,7 @@ of this package available from CTAN} } } } +\EndIncludeInRelease \cs_new:Npn \__hook_tl_csname:n #1 { l__hook_label_#1_tl } \cs_new:Npn \__hook_seq_csname:n #1 { l__hook_label_#1_seq } \seq_new:N \l__hook_labels_seq @@ -5638,6 +6358,89 @@ of this package available from CTAN} \tl_new:N \l__hook_front_tl \tl_new:N \l__hook_rear_tl \tl_new:c { \__hook_tl_csname:n { 0 } } +\IncludeInRelease{2023/06/01}{\__hook_initialize_single:NNn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_initialize_single:NNn #1#2#3 + { + \seq_clear:N \l__hook_labels_seq + \int_zero:N \l__hook_labels_int + \tl_set:Nn \l__hook_cur_hook_tl {#3} + \prop_map_inline:Nn \l__hook_work_prop + { + \int_incr:N \l__hook_labels_int + \seq_put_right:Nn \l__hook_labels_seq {##1} + \__hook_tl_set:cn { \__hook_tl_csname:n {##1} } { 0 } + \seq_clear_new:c { \__hook_seq_csname:n {##1} } + } + \prop_map_inline:Nn \l__hook_work_prop + { + \prop_map_inline:Nn \l__hook_work_prop + { + \__hook_if_label_case:nnnnn {##1} {####1} + { \prop_map_break: } + { \__hook_apply_label_pair:nnn {##1} {####1} } + { \__hook_apply_label_pair:nnn {####1} {##1} } + {#3} + } + } + \__hook_debug:n { \__hook_debug_label_data:N \l__hook_work_prop } + \tl_set:Nn \l__hook_rear_tl { 0 } + \tl_set:cn { \__hook_tl_csname:n { 0 } } { 0 } + \seq_map_inline:Nn \l__hook_labels_seq + { + \int_compare:nNnT { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0 + { + \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } }{##1} + \tl_set:Nn \l__hook_rear_tl {##1} + } + } + \tl_set_eq:Nc \l__hook_front_tl { \__hook_tl_csname:n { 0 } } + \__hook_tl_gclear:N #1 + \clist_gclear:N #2 + \bool_while_do:nn { ! \str_if_eq_p:Vn \l__hook_front_tl { 0 } } + { + \int_decr:N \l__hook_labels_int + \prop_get:NVN \l__hook_work_prop \l__hook_front_tl \l__hook_return_tl + \exp_args:NNV \__hook_tl_gput:Nn #1 \l__hook_return_tl + \__hook_clist_gput:NV #2 \l__hook_front_tl + \__hook_debug:n{ \iow_term:x{Handled~ code~ for~ \l__hook_front_tl} } + \seq_map_inline:cn { \__hook_seq_csname:n { \l__hook_front_tl } } + { + \tl_set:cx { \__hook_tl_csname:n {##1} } + { \int_eval:n + { \cs:w \__hook_tl_csname:n {##1} \cs_end: - 1 } + } + \int_compare:nNnT + { \cs:w \__hook_tl_csname:n {##1} \cs_end: } = 0 + { + \tl_set:cn { \__hook_tl_csname:n { \l__hook_rear_tl } } {##1} + \tl_set:Nn \l__hook_rear_tl {##1} + } + } + \tl_set_eq:Nc \l__hook_front_tl + { \__hook_tl_csname:n { \l__hook_front_tl } } + } + \int_compare:nNnF \l__hook_labels_int = 0 + { + \iow_term:x{====================} + \iow_term:x{Error:~ label~ rules~ are~ incompatible:} + \__hook_debug_label_data:N \l__hook_work_prop + \iow_term:x{====================} + } + \exp_args:NNe \__hook_tl_gput:Nn #1 + { \exp_not:c { __hook_toplevel~#3 } \__hook_braced_parameter:n {#3} } + \__hook_tl_gput_right:Ne #1 + { \exp_not:c { __hook_next~#3 } \__hook_braced_parameter:n {#3} } + \use:e + { + \cs_gset:cpn { __hook~#3 } \use:c { c__hook_#3_parameter_tl } + { \exp_not:V #1 } + } + } +\cs_generate_variant:Nn \__hook_initialize_single:NNn { cc } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_initialize_single:NNn} + {Hooks~with~args} \cs_new_protected:Npn \__hook_initialize_single:NNn #1#2#3 { \seq_clear:N \l__hook_labels_seq @@ -5708,7 +6511,8 @@ of this package available from CTAN} \exp_args:NNo \__hook_tl_gput:Nn #1 { \cs:w __hook_toplevel~#3 \cs_end: } \__hook_tl_gput_right:No #1 { \cs:w __hook_next~#3 \cs_end: } } -\cs_generate_variant:Nn \__hook_initialize_single:NNn { cc } +\cs_generate_variant:Nn \__hook_tl_gput_right:Nn { No } +\EndIncludeInRelease \cs_new:Npn \__hook_tl_gput:Nn { \ERROR } \cs_new:Npn \__hook_clist_gput:NV { \ERROR } \cs_new_protected:Npn \__hook_apply_label_pair:nnn #1#2#3 @@ -5823,6 +6627,123 @@ of this package available from CTAN} { \__hook_log_cmd:x { >~#1 } } \cs_new_protected:Npn \__hook_log_line_indent:x #1 { \__hook_log_cmd:x { >~\@spaces #1 } } +\IncludeInRelease{2023/06/01}{\__hook_log:nN} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_log:nN #1 #2 + { + \__hook_if_deprecated_generic:nT {#1} + { + \__hook_deprecated_generic_warn:n {#1} + \__hook_do_deprecated_generic:Nn \__hook_log:nN {#1} #2 + \exp_after:wN \use_none:nnnnnnnnn \use_none:nnnnn + } + \__hook_preamble_hook:n {#1} + \__hook_log_cmd:x + { + ^^J ->~The~ + \__hook_if_generic:nT {#1} { generic~ } + hook~'#1' + \__hook_if_disabled:nF {#1} + { + \exp_args:Nf \__hook_print_args:nn {#1} + { + \int_eval:n + { \str_count:e { \__hook_parameter:n {#1} } / 3 } + } + } + : + } + \__hook_if_usable:nF {#1} + { \__hook_log_line:x { The~hook~is~not~declared. } } + \__hook_if_disabled:nT {#1} + { \__hook_log_line:x { The~hook~is~disabled. } } + \hook_if_empty:nTF {#1} + { #2 { The~hook~is~empty } } + { + \__hook_log_line:x { Code~chunks: } + \prop_if_empty:cTF { g__hook_#1_code_prop } + { \__hook_log_line_indent:x { --- } } + { + \prop_map_inline:cn { g__hook_#1_code_prop } + { + \exp_after:wN \cs_set:Npn \exp_after:wN \__hook_tmp:w + \c__hook_nine_parameters_tl {##2} + \__hook_log_line_indent:x + { ##1~->~\cs_replacement_spec:N \__hook_tmp:w } + } + } + \__hook_log_line:x + { + Document-level~(top-level)~code + \__hook_if_usable:nT {#1} + { ~(executed~\__hook_if_reversed:nTF {#1} {first} {last} ) } : + } + \__hook_log_line_indent:x + { + \__hook_cs_if_empty:cTF { __hook_toplevel~#1 } + { --- } + { -> ~ \cs_replacement_spec:c { __hook_toplevel~#1 } } + } + \__hook_log_line:x { Extra~code~for~next~invocation: } + \__hook_log_line_indent:x + { + \__hook_cs_if_empty:cTF { __hook_next~#1 } + { --- } + { + -> ~ \exp_last_unbraced:Nf \__hook_log_next_code:w + { \cs_replacement_spec:c { __hook_next~#1 } } + } + } + \__hook_log_line:x { Rules: } + \bool_set_true:N \l__hook_tmpa_bool + \__hook_list_rules:nn {#1} + { + \bool_set_false:N \l__hook_tmpa_bool + \__hook_log_line_indent:x + { + ##2~ with~ + \str_if_eq:nnT {##3} {??} { default~ } + relation~ ##1 + } + } + \bool_if:NT \l__hook_tmpa_bool + { \__hook_log_line_indent:x { --- } } + \bool_lazy_and:nnTF + { \__hook_if_usable_p:n {#1} } + { ! \hook_if_empty_p:n {#1} } + { + \__hook_log_line:x + { + Execution~order + \bool_if:NTF \l__hook_tmpa_bool + { \__hook_if_reversed:nT {#1} { ~(after~reversal) } } + { ~(after~ + \__hook_if_reversed:nT {#1} { reversal~and~ } + applying~rules) + } : + } + #2 % \tl_show:n + { + \@spaces + \clist_if_empty:cTF { g__hook_#1_labels_clist } + { --- } + { \clist_use:cn { g__hook_#1_labels_clist } { ,~ } } + } + } + { + \__hook_log_line:x { Execution~order: } + #2 + { + \@spaces Not~set~because~the~hook~ \__hook_if_usable:nTF {#1} + { code~pool~is~empty } + { is~\__hook_if_disabled:nTF {#1} {disabled} {undeclared} } + } + } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_log:nN} + {Hooks~with~args} \cs_new_protected:Npn \__hook_log:nN #1 #2 { \__hook_if_deprecated_generic:nT {#1} @@ -5900,7 +6821,7 @@ of this package available from CTAN} \@spaces \clist_if_empty:cTF { g__hook_#1_labels_clist } { --- } - { \clist_use:cn {g__hook_#1_labels_clist} { ,~ } } + { \clist_use:cn { g__hook_#1_labels_clist } { ,~ } } } } { @@ -5914,8 +6835,28 @@ of this package available from CTAN} } } } -\cs_new:Npn \__hook_log_next_code:n #1 +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_log_next_code:n} + {Hooks~with~args} +\exp_last_unbraced:NNNNo +\cs_new:Npn \__hook_log_next_code:w #1 \c_right_brace_str { } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_log_next_code:n} + {Hooks~with~args} +\cs_gset:Npn \__hook_log_next_code:n #1 { \exp_args:No \tl_to_str:n { \use_none:nn #1 } } +\EndIncludeInRelease +\cs_new:Npn \__hook_print_args:nn #1 #2 + { + \int_compare:nNnT {#2} > { 0 } + { + \__hook_if_declared:nT {#1} { \use_none:nnn } + \__hook_if_cmd_hook:nT {#1} + { \use_i:nnn { ~ (unknown ~ } } + \use:n { ~ (#2 ~ } + argument \int_compare:nNnT {#2} > { 1 } { s } ) + } + } \cs_new_protected:Npn \__hook_list_rules:nn #1 #2 { \cs_set_protected:Npn \__hook_tmp:w ##1 ##2 ##3 {#2} @@ -5961,24 +6902,59 @@ of this package available from CTAN} } \exp_args:No \__hook_tmp:w { \use:nn { ~ } { ~ } } } -\cs_new_protected:Npn \hook_gput_next_code:nn #1 +\IncludeInRelease{2023/06/01}{\hook_gput_next_code:nn} + {Hooks~with~args} +\cs_new_protected:Npn \hook_gput_next_code:nn #1 #2 + { + \__hook_replacing_args_false: + \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} {#2} + \__hook_replacing_args_reset: + } +\cs_new_protected:Npn \hook_gput_next_code_with_args:nn #1 #2 + { + \__hook_replacing_args_true: + \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} {#2} + \__hook_replacing_args_reset: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_gput_next_code:nn} + {Hooks~with~args} +\cs_gset_protected:Npn \hook_gput_next_code:nn #1 { \__hook_normalize_hook_args:Nn \__hook_gput_next_code:nn {#1} } +\cs_gset_protected:Npn \hook_gput_next_code_with_args:nn #1 #2 { } +\EndIncludeInRelease \cs_new_protected:Npn \__hook_gput_next_code:nn #1 #2 { \__hook_if_disabled:nTF {#1} { \msg_error:nnn { hooks } { hook-disabled } {#1} } { \__hook_if_structure_exist:nTF {#1} - { \__hook_gput_next_do:nn {#1} {#2} } - { \__hook_try_declaring_generic_next_hook:nn {#1} {#2} } + { \__hook_gput_next_do:nn } + { \__hook_try_declaring_generic_next_hook:nn } + {#1} {#2} } } +\IncludeInRelease{2023/06/01}{\__hook_gput_next_do:nn} + {Hooks~with~args} \cs_new_protected:Npn \__hook_gput_next_do:nn #1 { + \__hook_init_structure:n {#1} + \__hook_chk_args_allowed:nn {#1} { AddToHookNext } + \__hook_cs_if_empty:cT { __hook~#1 } + { \__hook_update_hook_code:n {#1} } + \__hook_cs_if_empty:cT { __hook_next~#1 } + { \__hook_next_gset:nn {#1} { \__hook_clear_next:n {#1} } } + \__hook_cs_gput_right:nnn { _next } {#1} + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_gput_next_do:nn} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_gput_next_do:nn #1 + { \exp_args:Nc \__hook_gput_next_do:Nnn { __hook_next~#1 } {#1} } -\cs_new_protected:Npn \__hook_gput_next_do:Nnn #1 #2 +\cs_gset_protected:Npn \__hook_gput_next_do:Nnn #1 #2 { \tl_if_empty:cT { __hook~#2 } { \__hook_update_hook_code:n {#2} } @@ -5986,10 +6962,41 @@ of this package available from CTAN} { \__hook_tl_gset:Nn #1 { \__hook_clear_next:n {#2} } } \__hook_tl_gput_right:Nn #1 } +\EndIncludeInRelease \cs_new_protected:Npn \hook_gclear_next_code:n #1 { \__hook_normalize_hook_args:Nn \__hook_clear_next:n {#1} } +\IncludeInRelease{2023/06/01}{\__hook_clear_next:n} + {Hooks~with~args} \cs_new_protected:Npn \__hook_clear_next:n #1 + { \__hook_next_gset:nn {#1} { } } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_clear_next:n} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_clear_next:n #1 { \cs_gset_eq:cN { __hook_next~#1 } \c_empty_tl } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_use:n} + {Hooks~with~args} +\cs_new_protected:Npn \hook_use:n #1 + { + \__hook_preamble_hook:n {#1} + \__hook_use_initialized:n {#1} + } +\cs_new:Npn \__hook_use_initialized:n #1 + { + \if_cs_exist:w __hook~#1 \cs_end: + \cs:w __hook~#1 \use_i:nn + \fi: + \use_none:n + \cs_end: + } +\cs_new_protected:Npn \__hook_preamble_hook:n #1 + { + \if_cs_exist:w __hook~#1 \cs_end: + \__hook_initialize_hook_code:n {#1} + \fi: + } +\EndIncludeInRelease \IncludeInRelease{2021/11/15}{\hook_use:n} {Standardise~generic~hook~names} \cs_new_protected:Npn \hook_use:n #1 @@ -6008,6 +7015,7 @@ of this package available from CTAN} } \cs_new_protected:Npn \__hook_preamble_hook:n #1 { \__hook_initialize_hook_code:n {#1} } +\cs_new:Npn \hook_use:nnw #1 { } \EndIncludeInRelease \IncludeInRelease{2020/10/01}{\hook_use:n} {Standardise~generic~hook~names} @@ -6036,6 +7044,44 @@ of this package available from CTAN} \cs_new_protected:Npn \__hook_preamble_hook:n #1 { \__hook_initialize_hook_code:n {#1} } \cs_new_eq:NN \__hook_use_end: \cs_end: +\cs_new:Npn \hook_use:nnw #1 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_use:nnw} + {Hooks~with~args} +\cs_new_protected:Npn \hook_use:nnw #1 + { + \__hook_preamble_hook:n {#1} + \__hook_use_initialized:nnw {#1} + } +\cs_new:Npn \__hook_use_initialized:nnw #1 #2 + { + \cs:w + \if_cs_exist:w __hook~#1 \cs_end: + __hook~#1 + \else: + use_none: \prg_replicate:nn {#2} { n } + \fi: + \cs_end: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_use:nnw} + {Hooks~with~args} +\cs_gset:Npn \hook_use:nnw #1 #2 + { \use:c { use_none: \prg_replicate:nn {#2} { n } } } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_post_initialization_defs:} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_post_initialization_defs: + { + \cs_gset_eq:NN \hook_use:n \__hook_use_initialized:n + \cs_gset_eq:NN \hook_use:nnw \__hook_use_initialized:nnw + \cs_gset_eq:NN \__hook_preamble_hook:n \use_none:n + \cs_gset_eq:NN \__hook_post_initialization_defs: \prg_do_nothing: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_post_initialization_defs:} + {Hooks~with~args} +\cs_undefine:N \__hook_post_initialization_defs: \EndIncludeInRelease \IncludeInRelease{2021/11/15}{\__hook_use:wn} {Standardise~generic~hook~names} @@ -6066,41 +7112,111 @@ of this package available from CTAN} } } \EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\hook_use_once:nnw} + {Hooks~with~args} \cs_new_protected:Npn \hook_use_once:n #1 { \__hook_if_execute_immediately:nF {#1} + { \__hook_normalize_hook_args:Nn \__hook_use_once:nn { \use:n {#1} } { 0 } } + } +\cs_new_protected:Npn \hook_use_once:nnw #1 #2 + { + \__hook_if_execute_immediately:nF {#1} + { \__hook_normalize_hook_args:Nn \__hook_use_once:nn { \use:n {#1} } {#2} } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_use_once:nnw} + {Hooks~with~args} +\cs_gset_protected:Npn \hook_use_once:n #1 + { + \__hook_if_execute_immediately:nF {#1} { \__hook_normalize_hook_args:Nn \__hook_use_once:n { \use:n {#1} } } } -\cs_new_protected:Npn \__hook_use_once:n #1 +\cs_gset:Npn \hook_use_once:nnw #1 #2 + { \use:c { use_none: \prg_replicate:nn {#2} { n } } } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_use_once:nn} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_use_once:nn #1 #2 + { + \__hook_preamble_hook:n {#1} + \__hook_use_once_set:n {#1} + \__hook_replacing_args_false: + \__hook_cs_gput_right:nnn { _next } {#1} { \__hook_use_once_clear:n {#1} } + \__hook_replacing_args_reset: + \__hook_if_usable:nTF {#1} + { \__hook_use_initialized:n {#1} } + { + \int_compare:nNnT {#2} > { 0 } + { \use:c { use_none: \prg_replicate:nn {#2} { n } } } + } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_use_once:nn} + {Hooks~with~args} +\cs_gset_protected:Npn \__hook_use_once:n #1 { \__hook_preamble_hook:n {#1} \__hook_use_once_set:n {#1} \__hook_use_initialized:n {#1} \__hook_use_once_clear:n {#1} } +\cs_undefine:N \__hook_use_once:nn +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_use_once_clear:n} + {Hooks~with~args} \cs_new_protected:Npn \__hook_use_once_set:n #1 { \__hook_tl_gset:cn { g__hook_#1_reversed_tl } { I } } \cs_new_protected:Npn \__hook_use_once_clear:n #1 { + \__hook_code_gset:nn {#1} { } + \__hook_next_gset:nn {#1} { } + \__hook_toplevel_gset:nn {#1} { } + \prop_gclear_new:c { g__hook_#1_code_prop } + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_use_once_clear:n} + {Hooks~with~args} +\cs_new_protected:Npn \__hook_use_once_clear:n #1 + { \__hook_tl_gclear:c { __hook~#1 } \__hook_tl_gclear:c { __hook_next~#1 } \__hook_tl_gclear:c { __hook_toplevel~#1 } \prop_gclear_new:c { g__hook_#1_code_prop } } +\EndIncludeInRelease \prg_new_conditional:Npnn \__hook_if_execute_immediately:n #1 { T, F, TF } { - \__hook_if_usable:nTF {#1} - { - \exp_after:wN \__hook_clean_to_scan:w - \if:w I \cs:w g__hook_#1_reversed_tl \cs_end: - \s__hook_mark \prg_return_true: - \else: - \s__hook_mark \prg_return_false: + \exp_after:wN \__hook_use_none_delimit_by_s_mark:w + \if:w I + \if_cs_exist:w g__hook_#1_reversed_tl \cs_end: + \cs:w g__hook_#1_reversed_tl \exp_after:wN \cs_end: \fi: - } - { \prg_return_false: } + X + \s__hook_mark \prg_return_true: + \else: + \s__hook_mark \prg_return_false: + \fi: } - +\IncludeInRelease{2023/06/01}{\hook_if_empty:n} + {Hooks~with~args} +\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } + { + \if:w + T + \prop_if_exist:cT { g__hook_#1_code_prop } + { \prop_if_empty:cF { g__hook_#1_code_prop } { F } } + \__hook_cs_if_empty:cF { __hook_toplevel~#1 } { F } + \__hook_cs_if_empty:cF { __hook_next~#1 } { F } + T + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_if_empty:n} + {Hooks~with~args} \prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } { \__hook_if_structure_exist:nTF {#1} @@ -6117,9 +7233,10 @@ of this package available from CTAN} } { \prg_return_true: } } +\EndIncludeInRelease \prg_new_conditional:Npnn \__hook_if_usable:n #1 { p , T , F , TF } { - \tl_if_exist:cTF { __hook~#1 } + \cs_if_exist:cTF { __hook~#1 } { \prg_return_true: } { \prg_return_false: } } @@ -6137,7 +7254,7 @@ of this package available from CTAN} } \prg_new_conditional:Npnn \__hook_if_reversed:n #1 { p , T , F , TF } { - \exp_after:wN \__hook_clean_to_scan:w + \exp_after:wN \__hook_use_none_delimit_by_s_mark:w \if:w - \cs:w g__hook_#1_reversed_tl \cs_end: \s__hook_mark \prg_return_true: \else: @@ -6164,6 +7281,26 @@ of this package available from CTAN} } { \prg_return_false: } } +\IncludeInRelease{2023/06/01}{\__hook_if_cmd_hook:n} + {Hooks~with~args} +\prg_new_conditional:Npnn \__hook_if_cmd_hook:n #1 { T } + { \__hook_if_cmd_hook:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_cmd_hook:w #1 / #2 / #3 / #4 \s__hook_mark + { + \if:w Y + \str_if_eq:nnF {#1} { cmd } { N } + \tl_if_exist:cF { c__hook_generic_#1/./#3_tl } { N } + Y + \prg_return_true: + \else: + \prg_return_false: + \fi: + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_if_cmd_hook:n} + {Hooks~with~args} +\cs_undefine:N \__hook_if_cmd_hook:nT +\EndIncludeInRelease \prg_new_conditional:Npnn \__hook_if_generic_reversed:n #1 { T } { \__hook_if_generic_reversed:w #1 / / / \scan_stop: } \cs_new:Npn \__hook_if_generic_reversed:w #1 / #2 / #3 / #4 \scan_stop: @@ -6174,6 +7311,31 @@ of this package available from CTAN} \prg_return_false: \fi: } +\seq_new:N \g__hook_replacing_stack_seq +\cs_new:Npn \__hook_misused_if_replacing_args:nn #1 #2 + { + \msg_expandable_error:nnn { latex2e } { should-not-happen } + { Misused~\__hook_if_replacing_args:. } + } +\cs_new:Npn \__hook_if_replacing_args:TF + { \__hook_misused_if_replacing_args:nn } +\cs_new_protected:Npn \__hook_replacing_args_true: + { + \seq_gpush:No \g__hook_replacing_stack_seq + { \__hook_if_replacing_args:TF } + \cs_set:Npn \__hook_if_replacing_args:TF { \use_i:nn } + } +\cs_new_protected:Npn \__hook_replacing_args_false: + { + \seq_gpush:No \g__hook_replacing_stack_seq + { \__hook_if_replacing_args:TF } + \cs_set:Npn \__hook_if_replacing_args:TF { \use_ii:nn } + } +\cs_new_protected:Npn \__hook_replacing_args_reset: + { + \seq_gpop:NN \g__hook_replacing_stack_seq \l__hook_return_tl + \cs_gset_eq:NN \__hook_if_replacing_args:TF \l__hook_return_tl + } \prop_gput:Nnn \g_msg_module_type_prop { hooks } { LaTeX } \prop_gput:Nnn \g_msg_module_type_prop { latex2e } { LaTeX } \prop_gput:Nnn \g_msg_module_name_prop { latex2e } { kernel } @@ -6192,6 +7354,38 @@ of this package available from CTAN} { There~ already~ exists~ a~ hook~ declaration~ with~ this~ name.\\ Please~ use~ a~ different~ name~ for~ your~ hook.} +\IncludeInRelease{2023/06/01}{too-many-args} + {Hooks~with~args} +\msg_new:nnnn { hooks } { too-many-args } + { Too~many~arguments~for~hook~'#1'. } + { + You~tried~to~declare~a~hook~with~#2~arguments,~but~a~ + hook~can~only~have~up~to~nine.~LaTeX~will~define~this~ + hook~with~nine~arguments. + } +\msg_new:nnnn { hooks } { without-args } + { Hook~'#1'~has~no~arguments. } + { + You~tried~to~use~\iow_char:N\\#2WithArguments~ + on~a~hook~that~takes~no~arguments.\\ + Check~the~usage~of~the~hook~or~use~\iow_char:N\\#2~instead.\\ + \\ + LaTeX~will~use~\iow_char:N\\#2. + } +\msg_new:nnnn { hooks } { one-time-args } + { You~can't~have~arguments~in~used~one-time~hook~'#1'. } + { + You~tried~to~use~\iow_char:N\\#2WithArguments~ + on~a~one-time~hook~that~has~already~been~used.~ + You~have~to~add~the~code~before~the~hook~is~used,~ + or~add~the~code~without~arguments~using~\iow_char:N\\#2~instead.\\ + \\ + LaTeX~will~use~\iow_char:N\\#2. + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{too-many-args} + {Hooks~with~args} +\EndIncludeInRelease \msg_new:nnnn { hooks } { hook-disabled } { Cannot~add~code~to~disabled~hook~'#1'. } { @@ -6286,24 +7480,61 @@ of this package available from CTAN} Generic~hook~'#1/#2/#3'~is~deprecated. \\ Use~hook~'#1/#3/#2'~instead. } -\NewDocumentCommand \NewHook { m }{ \hook_new:n {#1} } -\NewDocumentCommand \NewReversedHook { m }{ \hook_new_reversed:n {#1} } -\NewDocumentCommand \NewMirroredHookPair { mm }{ \hook_new_pair:nn {#1}{#2} } -\IncludeInRelease{2021/06/01}% - {\hook_activate_generic:n}{Providing~hooks} -\NewDocumentCommand \ActivateGenericHook { m }{ \hook_activate_generic:n {#1} } -\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable_generic:n {#1} } -\EndIncludeInRelease -\IncludeInRelease{2020/10/01} - {\hook_activate_generic:n}{Providing~hooks} - -\def \ActivateGenericHook#1{} - -\EndIncludeInRelease +\NewDocumentCommand \NewHook { m } + { \hook_new:n {#1} } +\NewDocumentCommand \NewReversedHook { m } + { \hook_new_reversed:n {#1} } +\NewDocumentCommand \NewMirroredHookPair { mm } + { \hook_new_pair:nn {#1}{#2} } +\IncludeInRelease{2023/06/01}{\NewHookWithArguments} + {Hooks~with~args} +\NewDocumentCommand \NewHookWithArguments { mm } + { \hook_new_with_args:nn {#1} {#2} } +\NewDocumentCommand \NewReversedHookWithArguments { mm } + { \hook_new_reversed_with_args:nn {#1} {#2} } +\NewDocumentCommand \NewMirroredHookPairWithArguments { mmm } + { \hook_new_pair_with_args:nnn {#1} {#2} {#3} } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\NewHookWithArguments} + {Hooks~with~args} +\cs_new_protected:Npn \NewHookWithArguments #1 #2 { } +\cs_new_protected:Npn \NewReversedHookWithArguments #1 #2 { } +\cs_new_protected:Npn \NewMirroredHookPairWithArguments #1 #2 #3 { } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\ActivateGenericHook} + {Providing~hooks} +\NewDocumentCommand \ActivateGenericHook { m } + { \hook_activate_generic:n {#1} } +\NewDocumentCommand \DisableGenericHook { m } + { \hook_disable_generic:n {#1} } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\ActivateGenericHook} + {Providing~hooks} +\def \ActivateGenericHook #1 { } +\def \DisableGenericHook #1 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\AddToHookWithArguments} + {Hooks~with~args} \NewDocumentCommand \AddToHook { m o +m } { \hook_gput_code:nnn {#1} {#2} {#3} } +\NewDocumentCommand \AddToHookWithArguments { m o +m } + { \hook_gput_code_with_args:nnn {#1} {#2} {#3} } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\AddToHookWithArguments} + {Hooks~with~args} +\cs_new_protected:Npn \AddToHookWithArguments #1 #2 #3 { } +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\AddToHookNextWithArguments} + {Hooks~with~args} \NewDocumentCommand \AddToHookNext { m +m } { \hook_gput_next_code:nn {#1} {#2} } +\NewDocumentCommand \AddToHookNextWithArguments { m +m } + { \hook_gput_next_code_with_args:nn {#1} {#2} } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\AddToHookNextWithArguments} + {Hooks~with~args} +\cs_new_protected:Npn \AddToHookNextWithArguments #1 #2 { } +\EndIncludeInRelease \NewDocumentCommand \ClearHookNext { m } { \hook_gclear_next_code:n {#1} } \NewDocumentCommand \RemoveFromHook { m o } @@ -6320,8 +7551,18 @@ of this package available from CTAN} \str_gset:Nx \g_file_curr_name_str {#3} #1 #2 {#3} } +\IncludeInRelease{2023/06/01}{\UseHookWithArguments} + {Hooks~with~args} \cs_new:Npn \UseHook { \hook_use:n } \cs_new:Npn \UseOneTimeHook { \hook_use_once:n } +\cs_new:Npn \UseHookWithArguments { \hook_use:nnw } +\cs_new:Npn \UseOneTimeHookWithArguments { \hook_use_once:nnw } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\UseHookWithArguments} + {Hooks~with~args} +\cs_new:Npn \UseHookWithArguments #1 #2 { } +\cs_new:Npn \UseOneTimeHookWithArguments #1 #2 { } +\EndIncludeInRelease \cs_new_protected:Npn \ShowHook { \hook_show:n } \cs_new_protected:Npn \LogHook { \hook_log:n } \cs_new_protected:Npn \DebugHooksOn { \hook_debug_on: } @@ -6409,8 +7650,8 @@ of this package available from CTAN} \__hook_initialize_all: \cs_new_eq:NN \@expl@@@hook@curr@name@pop@@ \__hook_curr_name_pop: -\IncludeInRelease{0000/00/00}% - {lthooks}{The~hook~management}% +\IncludeInRelease{0000/00/00}{lthooks} + {The~hook~management}% \def \NewHook#1{} \def \NewReversedHook#1{} @@ -6439,13 +7680,48 @@ of this package available from CTAN} \long\def \IfHookEmptyTF #1#2#3{#2} \EndModuleRelease +\cs:w __hook_rollback_tidying: \cs_end: +\bool_lazy_and:nnT + { \int_compare_p:nNn { \sourceLaTeXdate } > { 20230600 } } + { \int_compare_p:nNn { \requestedLaTeXdate } < { 20230601 } } + { + \cs_gset_protected:Npn \__hook_rollback_tidying: + { + \@latex@error { Rollback~code~executed~twice } + { + Something~went~wrong~(unless~this~was~ + done~on~purpose~in~a~testing~environment). + } + \use_none:nnnn + } + \cs_set:Npn \__hook_tmp:w #1 #2 + { + \__hook_tl_gset:cx { __hook#1~#2 } + { + \exp_args:No \exp_not:o + { + \cs:w __hook#1~#2 \exp_last_unbraced:Ne \cs_end: + { \__hook_braced_cs_parameter:n { __hook#1~#2 } } + } + } + } + \seq_map_inline:Nn \g__hook_all_seq + { + \exp_after:wN \cs_gset_nopar:Npn + \cs:w g__hook_#1_code_prop \exp_args:NNo \exp_args:No + \cs_end: { \cs:w g__hook_#1_code_prop \cs_end: } + \__hook_tmp:w { _toplevel } {#1} + \__hook_tmp:w { _next } {#1} + } + } \ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% File: ltcmdhooks.dtx (C) Copyright 2020-2021 -%% Frank Mittelbach, Phelype Oleinik, LaTeX Team +%% File: ltcmdhooks.dtx +%% Copyright (C) 2020-2023 +%% Frank Mittelbach, Phelype Oleinik, The LaTeX Project %%% From File: ltcmdhooks.dtx -\def\ltcmdhooksversion{v1.0f} -\def\ltcmdhooksdate{2021/10/20} +\def\ltcmdhooksversion{v1.0h} +\def\ltcmdhooksdate{2023/05/21} \ExplSyntaxOn \NewModuleRelease{2021/06/01}{ltcmdhooks} {The~hook~management~system~for~commands} @@ -6454,7 +7730,8 @@ of this package available from CTAN} \tl_new:N \l__hook_patch_prefixes_tl \tl_new:N \l__hook_param_text_tl \tl_new:N \l__hook_replace_text_tl -\tl_const:Nn \c__hook_hash_tl { # # } +\tl_const:Nn \c__hook_hash_tl { # } +\tl_const:Nn \c__hook_hashes_tl { # # } \cs_new_eq:NN \__hook_exp_not:NN ? \cs_new_eq:NN \__hook_def_cmd:w ? \quark_new:N \q__hook_recursion_tail @@ -6596,6 +7873,8 @@ of this package available from CTAN} \exp_args:NNc \__hook_patch_expand_redefine:NNnn \c_false_bool { \cs_to_str:N #1 ~ code } } +\IncludeInRelease{2023/06/01}{\__hook_patch_expand_redefine:NNnn} + {cmd~hooks~with~args} \cs_new_protected:Npn \__hook_patch_expand_redefine:NNnn #1 #2 #3 #4 { \__hook_patch_debug:x { ++~command~can~be~patched~without~rescanning } @@ -6619,6 +7898,81 @@ of this package available from CTAN} ##1 \l__hook_replace_text_tl { \__hook_exp_not:n {##2} } } \bool_if:NTF #1 + { \__hook_tmp:w \tl_set:Nx { [ \c__hook_hashes_tl 1 ] } } + { \__hook_tmp:w \tl_set:Nx { { \c__hook_hashes_tl 1 } } } + \int_step_inline:nnn { 2 } { \l__hook_patch_num_args_int } + { \__hook_tmp:w \tl_put_right:Nx { { \c__hook_hashes_tl ##1 } } } + \tl_set:Nx \l__hook_replace_text_tl + { \exp_not:N #2 \exp_not:V \l__hook_replace_text_tl } + \tl_set:Nx \l__hook_replace_text_tl + { + \token_if_eq_meaning:NNTF \__hook_exp_not:n \exp_not:n + { \exp_args:NNV \exp_args:No \__hook_double_hashes:n } + { \exp_args:NV \exp_not:o } + \l__hook_replace_text_tl + } + \cs_set_eq:NN \__hook_def_cmd:w \tex_gdef:D + \cs_set_eq:NN \__hook_exp_not:NN \prg_do_nothing: + } + { + \tl_clear:N \l__hook_param_text_tl + \tl_set_eq:NN \l__hook_replace_text_tl #2 + \cs_set_eq:NN \__hook_def_cmd:w \tex_xdef:D + \cs_set:Npn \__hook_exp_not:NN ##1 { \exp_not:N ##1 \exp_not:N } + } + \group_begin: + \int_set:Nn \tex_escapechar:D { `\/ } + \use:x + { + \group_end: + \tl_set:Nx \exp_not:N \l__hook_patch_prefixes_tl + { \exp_not:N \__hook_make_prefixes:w \cs_prefix_spec:N #2 / / } + } + \__hook_disable:n { cmd / #3 / #4 } + \cs_undefine:c { c__hook_cmd / #3 / #4_parameter_tl } + \__hook_make_usable:nn { cmd / #3 / #4 } { \l__hook_patch_num_args_int } + \use:e + { + \__hook_redefine_with_hooks:Nnnn \exp_not:N #2 + \str_if_eq:nnTF {#4} { after } + { \use_ii_i:nn } + { \use:nn } + { { + \__hook_exp_not:NN \exp_not:N \UseHookWithArguments + { cmd / #3 / #4 } { \int_use:N \l__hook_patch_num_args_int } + \__hook_braced_parameter:n { cmd / #3 / #4 } + } } + { { } } + { \__hook_exp_not:NN \exp_not:V \l__hook_replace_text_tl } + } + \__hook_update_hook_code:n { cmd / #3 / #4 } + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\__hook_patch_expand_redefine:NNnn} + {cmd~hooks~with~args} +\cs_gset_protected:Npn \__hook_patch_expand_redefine:NNnn #1 #2 #3 #4 + { + \__hook_patch_debug:x { ++~command~can~be~patched~without~rescanning } + \int_set:Nn \l__hook_patch_num_args_int + { + \exp_args:Nf \str_count:n { \cs_argument_spec:N #2 } / 2 + \bool_if:NT #1 { -1 } + } + \int_compare:nNnTF { \l__hook_patch_num_args_int } > { \c_zero_int } + { + \tl_set:Nx \l__hook_tmpa_tl { \bool_if:NTF #1 { [ ] } { { } } } + \int_step_inline:nnn { 2 } { \l__hook_patch_num_args_int } + { \tl_put_right:Nn \l__hook_tmpa_tl { { } } } + \exp_args:NNo \exp_args:No \__hook_if_has_hash:nTF + { \exp_after:wN #2 \l__hook_tmpa_tl } + { \cs_set_eq:NN \__hook_exp_not:n \exp_not:n } + { \cs_set_eq:NN \__hook_exp_not:n \use:n } + \cs_set_protected:Npn \__hook_tmp:w ##1 ##2 + { + ##1 \l__hook_param_text_tl { \use:n ##2 } + ##1 \l__hook_replace_text_tl { \__hook_exp_not:n {##2} } + } + \bool_if:NTF #1 { \__hook_tmp:w \tl_set:Nx { [ \c__hook_hash_tl 1 ] } } { \__hook_tmp:w \tl_set:Nx { { \c__hook_hash_tl 1 } } } \int_step_inline:nnn { 2 } { \l__hook_patch_num_args_int } @@ -6660,6 +8014,7 @@ of this package available from CTAN} { \__hook_exp_not:NN \exp_not:V \l__hook_replace_text_tl } } } +\EndIncludeInRelease \cs_new_protected:Npn \__hook_redefine_with_hooks:Nnnn #1 #2 #3 #4 { \l__hook_patch_prefixes_tl @@ -6707,7 +8062,11 @@ of this package available from CTAN} \if_meaning:w \q__hook_recursion_tail #1 \__hook_double_hashes_stop:w \fi: - \if_meaning:w \c__hook_hash_tl #1 + \if:w ? + \if_meaning:w \c__hook_hash_tl #1 ! \fi: + \if_meaning:w \c__hook_hashes_tl #1 ! \fi: + ? + \else: \use_i:nnnn \fi: \use:n @@ -6729,10 +8088,10 @@ of this package available from CTAN} { ~ \__hook_double_hashes:w } \cs_new_protected:Npn \__hook_retokenize_patch:Nnn #1 #2 #3 { - \__hook_patch_debug:x { ..~command~can~only~be~patched~by~rescanning } \str_if_eq:eeTF { \cs_argument_spec:N #1 } { } { \__hook_patch_expand_redefine:NNnn \c_false_bool #1 {#2} {#3} } { + \__hook_patch_debug:x { ..~command~can~only~be~patched~by~rescanning } \tl_set:Nx \l__hook_tmpa_tl { \int_compare:nNnTF { \char_value_catcode:n {`\@ } } = { 12 } @@ -6762,6 +8121,8 @@ of this package available from CTAN} } } } +\IncludeInRelease{2023/06/01}{\__hook_try_patch_with_catcodes:Nnnnw} + {cmd~hooks~with~args} \cs_new_protected:Npn \__hook_try_patch_with_catcodes:Nnnnw #1 #2 #3 #4 { \quark_if_recursion_tail_stop_do:nn {#4} { \use:n } @@ -6770,6 +8131,25 @@ of this package available from CTAN} { \__hook_patch_debug:x { ++~macro~can~be~retokenized~cleanly } \__hook_patch_debug:x { ==~retokenizing~macro~now } + \__hook_patch_retokenize:Nnnn #1 { cmd / #2 / #3 } {#3} {#4} + \use_i_delimit_by_q_recursion_stop:nw \use_none:n + } + { + \__hook_patch_debug:x { --~macro~cannot~be~retokenized~cleanly } + \__hook_try_patch_with_catcodes:Nnnnw #1 {#2} {#3} + } + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\__hook_try_patch_with_catcodes:Nnnnw} + {cmd~hooks~with~args} +\cs_gset_protected:Npn \__hook_try_patch_with_catcodes:Nnnnw #1 #2 #3 #4 + { + \quark_if_recursion_tail_stop_do:nn {#4} { \use:n } + \__hook_patch_debug:x { ++~trying~to~patch~by~retokenization } + \__hook_cmd_if_scanable:NnTF {#1} {#4} + { + \__hook_patch_debug:x { ++~macro~can~be~retokenized~cleanly } + \__hook_patch_debug:x { ==~retokenizing~macro~now } \__hook_patch_retokenize:Nnnn #1 {#2} {#3} {#4} \use_i_delimit_by_q_recursion_stop:nw \use_none:n } @@ -6778,6 +8158,7 @@ of this package available from CTAN} \__hook_try_patch_with_catcodes:Nnnnw #1 {#2} {#3} } } +\EndIncludeInRelease \cs_new_eq:NN \kerneltmpDoNotUse ! \cs_new_protected:Npn \__hook_patch_required_catcodes: { @@ -6805,8 +8186,86 @@ of this package available from CTAN} { \prg_return_true: } { \prg_return_false: } } +\IncludeInRelease{2023/06/01}{\__hook_guess_arg_count:NN} + {cmd~hooks~with~args} +\cs_new_protected:Npn \__hook_guess_arg_count:NN #1 + { + \exp_after:wN \__hook_guess_arg_count:wN + \token_to_meaning:N #1 \s__hook_mark + } +\exp_last_unbraced:NNNNo +\cs_new_protected:Npx \__hook_guess_arg_count:wN + #1 { \tl_to_str:n { macro: } } #2 \s__hook_mark #3 + { + \int_set:Nn #3 + { + \exp_not:N \__hook_guess_arg_count:nw { 0 } #2 + \c_hash_str 0 \s__hook_mark + } + } +\use:e + { \cs_new:Npn \exp_not:N \__hook_guess_arg_count:nw #1 #2 \c_hash_str #3 } + { + \int_compare:nNnTF { #1 + 1 } = {#3} + { \__hook_guess_arg_count:nw {#3} } + { #1 \__hook_use_none_delimit_by_s_mark:w } + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\__hook_guess_arg_count:NN} + {cmd~hooks~with~args} +\cs_undefine:N \__hook_guess_arg_count:NN +\EndIncludeInRelease +\IncludeInRelease{2023/06/01}{\__hook_patch_retokenize:Nnnn} + {cmd~hooks~with~args} \cs_new_protected:Npn \__hook_patch_retokenize:Nnnn #1 #2 #3 #4 { + \__hook_guess_arg_count:NN #1 \l__hook_patch_num_args_int + \__hook_disable:n {#2} + \cs_undefine:c { c__hook_#2_parameter_tl } + \__hook_make_usable:nn {#2} { \l__hook_patch_num_args_int } + \tl_set:Ne \l__hook_tmpa_tl + { \exp_args:Ne \tl_to_str:n { \__hook_braced_parameter:n {#2} } } + \use:x + { + \str_replace_all:Nnn \exp_not:N \l__hook_tmpa_tl + { #### } { \c_hash_str } + } + \cs_set_eq:NN \kerneltmpDoNotUse \scan_stop: + \cs_set_eq:NN \__hook_tmp:w \scan_stop: + \use:x + { + \cs_set:Npn \__hook_tmp:w + ####1 \tl_to_str:n { macro: } ####2 -> ####3 \s__hook_mark + { + ####1 \def \kerneltmpDoNotUse ####2 + { + \str_if_eq:nnT {#3} { before } + { + \token_to_str:N \UseHookWithArguments {#2} + { \int_use:N \l__hook_patch_num_args_int } + \l__hook_tmpa_tl + } + ####3 + \str_if_eq:nnT {#3} { after } + { + \token_to_str:N \UseHookWithArguments {#2} + { \int_use:N \l__hook_patch_num_args_int } + \l__hook_tmpa_tl + } + } + } + \tl_set:Nx \exp_not:N \l__hook_tmpa_tl + { \exp_not:N \__hook_tmp:w \token_to_meaning:N #1 \s__hook_mark } + } + \tl_rescan:nV { #4 \__hook_patch_required_catcodes: } \l__hook_tmpa_tl + \cs_gset_eq:NN #1 \kerneltmpDoNotUse + \__hook_update_hook_code:n {#2} + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\__hook_patch_retokenize:Nnnn} + {cmd~hooks~with~args} +\cs_gset_protected:Npn \__hook_patch_retokenize:Nnnn #1 #2 #3 #4 + { \cs_set_eq:NN \kerneltmpDoNotUse \scan_stop: \cs_set_eq:NN \__hook_tmp:w \scan_stop: \use:x @@ -6829,6 +8288,7 @@ of this package available from CTAN} \tl_rescan:nV { #4 \__hook_patch_required_catcodes: } \l__hook_tmpa_tl \cs_gset_eq:NN #1 \kerneltmpDoNotUse } +\EndIncludeInRelease \IncludeInRelease{2021/11/15}{wrong-cmd-hook}% {Standardise~generic~hook~names} \EndIncludeInRelease @@ -6915,7 +8375,9 @@ of this package available from CTAN} \let\@latex@note@no@line\@latex@info@no@line \EndIncludeInRelease %%% From File: ltpar.dtx -%% File: ltpara.dtx (C) Copyright 2020-2023 +%% File: ltpara.dtx +%% Copyright (C) 2020-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltpara.dtx \def\ltparaversion{v1.0l} \def\ltparadate{2023/01/30} @@ -7097,7 +8559,9 @@ of this package available from CTAN} \EndModuleRelease \ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% File: ltmeta.dtx (C) Copyright 2021, 2022 +%% File: ltmeta.dtx +%% Copyright (C) 2021-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltmeta.dtx \def\ltmetaversion{v1.0b} \def\ltmetadate{2022/05/18} @@ -7144,6 +8608,7 @@ of this package available from CTAN} \DeclareRobustCommand\linebreak{\@testopt{\@no@lnbk-}4} \DeclareRobustCommand\nolinebreak{\@testopt\@no@lnbk4} \DeclareRobustCommand\samepage{\interlinepenalty\@M + \predisplaypenalty\@M \postdisplaypenalty\@M \interdisplaylinepenalty\@M \@beginparpenalty\@M @@ -7890,8 +9355,31 @@ of this package available from CTAN} \reserved@a} \EndIncludeInRelease +\IncludeInRelease{2023/05/01}% + {\IfFileExists@}{IfFileExists} +\long\def \IfFileExists@#1#2#3{% + \edef\@filef@und{\IfFileExists@@{#1}}% + \ifx\@filef@und\@empty + \if\relax\detokenize{#1}\relax + \let\reserved@a\@firstoftwo + \def\@filef@und{".tex" }% + \else + \let\reserved@a\@secondoftwo + \fi + \else + \let\reserved@a\@firstoftwo + \edef\@filef@und{"\@filef@und" }% + \fi + \expandafter\def\expandafter\reserved@a + \expandafter{\reserved@a{#2}{#3}}% +\reserved@a} +\ExplSyntaxOn +\cs_new_eq:NN \IfFileExists@@ \file_full_name:n +\ExplSyntaxOff +\EndIncludeInRelease \IncludeInRelease{2021/06/01}% - {\IfFileExists@}{manage unbalanced conditionals} + {\IfFileExists@}{IfFileExists} + \long\def \IfFileExists@#1#2#3{% \openin\@inputcheck"#1" % \ifeof\@inputcheck @@ -7908,9 +9396,11 @@ of this package available from CTAN} \expandafter\def\expandafter\reserved@a \expandafter{\reserved@a{#2}{#3}}% \reserved@a} +\let\IfFileExists@@\@undefined \EndIncludeInRelease + \IncludeInRelease{2019/10/01}% - {\IfFileExists@}{manage unbalanced conditionals} + {\IfFileExists@}{IfFileExists} \long\def \IfFileExists@#1#2#3{% \openin\@inputcheck"#1" % @@ -7928,7 +9418,7 @@ of this package available from CTAN} \reserved@a} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% - {\IfFileExists@}{manage unbalanced conditionals} + {\IfFileExists@}{IfFileExists} \let\IfFileExists@\@undefined @@ -11460,11 +12950,58 @@ of this package available from CTAN} %%% From File: ltpageno.dtx %%% From File: ltxref.dtx +\IncludeInRelease{2023/06/01}% + {\@kernel@sref}{store five arguments}% +\def\@setref#1#2#3{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#3' on page \thepage \space + undefined}% + \else + \expandafter#2#1\@empty\@empty\@empty\null + \fi} +\long\def\@firstoffive#1#2#3#4#5{#1} +\long\def\@secondoffive#1#2#3#4#5{#2} +\def\@kernel@sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}} +\def\@kernel@spageref#1{\expandafter\@setref\csname r@#1\endcsname + \@secondoffive{#1}} +\EndIncludeInRelease \IncludeInRelease{2022/06/01}% - {\ref}{Add starred reference commands}% + {\@kernel@sref}{store five arguments}% +\def\@setref#1#2#3{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#3' on page \thepage \space + undefined}% + \else + \expandafter#2#1\null + \fi} +\let\@firstoffive\undefined +\let\@secondoffive\undefined \def\@kernel@sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} \def\@kernel@spageref#1{\expandafter\@setref\csname r@#1\endcsname \@secondoftwo{#1}} +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\@kernel@sref}{store five arguments}% +\def\@setref#1#2#3{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#3' on page \thepage \space + undefined}% + \else + \expandafter#2#1\null + \fi} +\let\@firstoffive\undefined +\let\@secondoffive\undefined +\let\@kernel@sref\undefined +\let\@kernel@spageref\undefined +\EndIncludeInRelease +\IncludeInRelease{2022/06/01}% + {\ref}{Add starred reference commands}% \let\@kernel@ref\@kernel@sref \let\@kernel@pageref\@kernel@spageref \NewDocumentCommand\ref{s} @@ -11483,6 +13020,21 @@ of this package available from CTAN} \@secondoftwo{#1}} \EndIncludeInRelease +\IncludeInRelease{2023/06/01}% + {\label}{store five label arguments}% +\providecommand\@currentlabelname{} +\providecommand\@currentHref{} +\providecommand\@kernel@reserved@label@data{} +\NewHookWithArguments{label}{1} +\def\label#1{\@bsphack + \begingroup + \UseHookWithArguments{label}{1}{#1}% + \protected@write\@auxout{}% + {\string\newlabel{#1}{{\@currentlabel}{\thepage}% + {\@currentlabelname}{\@currentHref}{\@kernel@reserved@label@data}}}% + \endgroup + \@esphack} +\EndIncludeInRelease \IncludeInRelease{2022/06/01}% {\Ref}{Add starred version}% \def\@currentcounter{} @@ -11499,6 +13051,16 @@ of this package available from CTAN} \NewDocumentCommand\Ref{s} {\IfBooleanTF{#1}{\@kernel@sRef}{\@kernel@Ref}} \EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\label}{store five label arguments}% +\let\@currenttitle\@undefined +\let\@currenttarget\@undefined +\let\@kernel@currentdata\@undefined +\def\label#1{\@bsphack + \protected@write\@auxout{}% + {\string\newlabel{#1}{{\@currentlabel}{\thepage}}}% + \@esphack} +\EndIncludeInRelease \IncludeInRelease{2020/10/01}% {\Ref}{Add starred version}% \def\@currentcounter{} @@ -12186,6 +13748,18 @@ of this package available from CTAN} \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}% } \EndIncludeInRelease +\IncludeInRelease{2023/06/01}% + {\eqno}{add ignorespaces to eqno}% +\let\@kernel@eqno\eqno +\let\@kernel@leqno\leqno +\protected\def\eqno{\@kernel@eqno\aftergroup\ignorespaces} +\protected\def\leqno{\@kernel@leqno\aftergroup\ignorespaces} +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\eqno}{add ignorespaces to eqno}% +\let\eqno\@kernel@eqno +\let\leqno\@kernel@leqno +\EndIncludeInRelease %%% From File: ltlists.dtx %%% From File: ltboxes.dtx \IncludeInRelease{2015/01/01}% @@ -13532,7 +15106,9 @@ of this package available from CTAN} \@esphack} \EndIncludeInRelease -%% File: ltmarks.dtx (C) Copyright 2022 +%% File: ltmarks.dtx +%% Copyright (C) 2022-2023 +%% Frank Mittelbach, The LaTeX Project %%% From File: ltmarks.dtx \def\ltmarksversion{v1.0d} \def\ltmarksdate{2022/06/01} @@ -14019,12 +15595,14 @@ of this package available from CTAN} \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater +\def\IfFileAtLeastTF#1{\expandafter\@ifl@t@r\csname ver@#1\endcsname} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% {\IfFormatAtLeastTF}{Test format date}% \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater +\def\IfFileAtLeastTF#1{\expandafter\@ifl@t@r\csname ver@#1\endcsname} \EndIncludeInRelease \IncludeInRelease{2018/04/01}% {\@ifl@t@r}{Guard against bad input}% @@ -14451,7 +16029,7 @@ of this package available from CTAN} \EndIncludeInRelease \IncludeInRelease{2020/10/01}% {\@onefilewithoptions}{Hooks and unused options issue}% -\def\@onefilewithoptions#1[#2][#3]#4{% +\def\load@onefilewithoptions#1[#2][#3]#4{% \@expl@@@filehook@set@curr@file@@nNN{#1.#4}\reserved@a\reserved@b \edef\reserved@c{\def\noexpand\reserved@c####1% \detokenize\expandafter{\expanded{.#4}}% @@ -15014,8 +16592,8 @@ of this package available from CTAN} \endgroup% \EndIncludeInRelease %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0n} -\providecommand\ltfilehookdate{2022/08/18} +\providecommand\ltfilehookversion{v1.0o} +\providecommand\ltfilehookdate{2023/04/02} \IncludeInRelease{2020/10/01}% {\CurrentFile}{Hook management file}% \ExplSyntaxOn @@ -15354,7 +16932,7 @@ of this package available from CTAN} \def\@kernel@make@file@csname#1#2#3{% \xdef#1{\expandafter\@set@curr@file@aux \csname\expandafter#2\@firstofone#3\@nil\endcsname}} -\def\@set@curr@file@aux#1{% +\long\def\@set@curr@file@aux#1{% \expandafter\ifx\csname\endcsname#1% .tex\else\string#1\fi} \def\@filehook@set@CurrentFile{% @@ -15500,7 +17078,7 @@ of this package available from CTAN} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Copyright (C) 2020-2023 -%% Frank Mittelbach, LaTeX Team +%% Frank Mittelbach, The LaTeX Project %% %%% From File: ltshipout.dtx \providecommand\ltshipoutversion{v1.0n} diff --git a/Master/texmf-dist/tex/latex-dev/base/ltnews.cls b/Master/texmf-dist/tex/latex-dev/base/ltnews.cls index f55165d4366..a57d9fc673f 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltnews.cls +++ b/Master/texmf-dist/tex/latex-dev/base/ltnews.cls @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2020 +% Copyright (C) 1993-2023 % The LaTeX Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls b/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls index 587a82df0c6..acdbdc2ec58 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls +++ b/Master/texmf-dist/tex/latex-dev/base/ltxdoc.cls @@ -43,13 +43,16 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltxdoc} - [2022/06/22 v2.1i Standard LaTeX documentation class] + [2023/03/28 v2.1j Standard LaTeX documentation class] \DeclareOption{a5paper}{\@latexerr{Option not supported}% {}} \newif\ifltxdoc@load@cfg@ \ltxdoc@load@cfg@true \DeclareOption{nocfg}{\ltxdoc@load@cfg@false} \let\ltxdoc@doc@version\@empty % use current version by default -\DeclareOption{doc2}{\def\ltxdoc@doc@version{=v2}} +\DeclareOption{doc2}{% + \def\ltxdoc@doc@version{=v2}% + \DeclareRobustCommand\cs[1]{\texttt{\bslash #1}}% +} \DeclareOption*{% \PassOptionsToClass {\CurrentOption}{article}} \ProcessOptions diff --git a/Master/texmf-dist/tex/latex-dev/base/ltxguide.cls b/Master/texmf-dist/tex/latex-dev/base/ltxguide.cls index b743fd9cdae..778f7e993e8 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltxguide.cls +++ b/Master/texmf-dist/tex/latex-dev/base/ltxguide.cls @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2019 +% Copyright (C) 1993-2023 % The LaTeX Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/tex/latex-dev/base/minimal.cls b/Master/texmf-dist/tex/latex-dev/base/minimal.cls index 9024a23bca7..89c233c30f3 100644 --- a/Master/texmf-dist/tex/latex-dev/base/minimal.cls +++ b/Master/texmf-dist/tex/latex-dev/base/minimal.cls @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2019 +% Copyright (C) 1993-2023 % The LaTeX Project and any individual authors listed elsewhere % in this file. % diff --git a/Master/texmf-dist/tex/latex-dev/base/omlcmm.fd b/Master/texmf-dist/tex/latex-dev/base/omlcmm.fd index 0da9d9e3755..2adb5587cc9 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omlcmm.fd +++ b/Master/texmf-dist/tex/latex-dev/base/omlcmm.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{omlcmm.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OML}{cmm}{\skewchar\font127 } \DeclareFontShape{OML}{cmm}{m}{it}% {<5><6><7><8><9>gen*cmmi% diff --git a/Master/texmf-dist/tex/latex-dev/base/omlcmr.fd b/Master/texmf-dist/tex/latex-dev/base/omlcmr.fd index f1a4a80e9ae..2d2d5b39c9d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omlcmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/omlcmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{omlcmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OML}{cmr}{\skewchar\font127 } \DeclareFontShape{OML}{cmr}{m}{n}% {<->ssub*cmm/m/it}{} diff --git a/Master/texmf-dist/tex/latex-dev/base/omscmr.fd b/Master/texmf-dist/tex/latex-dev/base/omscmr.fd index 1caaf455396..43181585fd9 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omscmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/omscmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{omscmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OMS}{cmr}{\skewchar\font48 } \DeclareFontShape{OMS}{cmr}{m}{n}% {<->ssub*cmsy/m/n}{} diff --git a/Master/texmf-dist/tex/latex-dev/base/omscmsy.fd b/Master/texmf-dist/tex/latex-dev/base/omscmsy.fd index 5d61b71471c..ce660e5add9 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omscmsy.fd +++ b/Master/texmf-dist/tex/latex-dev/base/omscmsy.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{omscmsy.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OMS}{cmsy}{\skewchar\font48 } \DeclareFontShape{OMS}{cmsy}{m}{n}{% <5><6><7><8><9><10>gen*cmsy% diff --git a/Master/texmf-dist/tex/latex-dev/base/omxcmex.fd b/Master/texmf-dist/tex/latex-dev/base/omxcmex.fd index 295934d9cd7..24bf1415563 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omxcmex.fd +++ b/Master/texmf-dist/tex/latex-dev/base/omxcmex.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{omxcmex.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OMX}{cmex}{} \DeclareFontShape{OMX}{cmex}{m}{n}{% <->sfixed*cmex10% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmdh.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmdh.fd index 4c167fee378..4436c6fc885 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmdh.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmdh.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmdh.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmdh}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmdh}{m}{n}{% <10>cmdunh10% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmfib.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmfib.fd index ef3fece6c15..21ad4c9adfd 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmfib.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmfib.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmfib.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmfib}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmfib}{m}{n}{% <8>cmfib8% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmfr.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmfr.fd index 10b39fdef20..c1be1c7b4b6 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmfr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmfr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmfr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmfr}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmfr}{m}{n}{% <10>cmff10% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmr.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmr.fd index 8905eecfd94..21b00587b82 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmr}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmr}{m}{n}% {<5><6><7><8><9><10><12>gen*cmr% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmss.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmss.fd index 151698f3a08..48efc3c4095 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmss.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmss.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmss.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmss}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmss}{m}{n} {% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmtt.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmtt.fd index 80e28019328..1e282033c77 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmtt}{\hyphenchar \font\m@ne} \DeclareFontShape{OT1}{cmtt}{m}{n} {% diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1cmvtt.fd b/Master/texmf-dist/tex/latex-dev/base/ot1cmvtt.fd index 5239fddb3b5..e3cb859356e 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1cmvtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ot1cmvtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ot1cmvtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{OT1}{cmvtt}{\hyphenchar\font45 } \DeclareFontShape{OT1}{cmvtt}{m}{n}% {% diff --git a/Master/texmf-dist/tex/latex-dev/base/report.cls b/Master/texmf-dist/tex/latex-dev/base/report.cls index 96d7c1bdc18..3131e66cf47 100644 --- a/Master/texmf-dist/tex/latex-dev/base/report.cls +++ b/Master/texmf-dist/tex/latex-dev/base/report.cls @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{report} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol diff --git a/Master/texmf-dist/tex/latex-dev/base/size10.clo b/Master/texmf-dist/tex/latex-dev/base/size10.clo index 511b32ec19f..57cfdaa612e 100644 --- a/Master/texmf-dist/tex/latex-dev/base/size10.clo +++ b/Master/texmf-dist/tex/latex-dev/base/size10.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{size10.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xpt\@xiipt diff --git a/Master/texmf-dist/tex/latex-dev/base/size11.clo b/Master/texmf-dist/tex/latex-dev/base/size11.clo index 9e66a1c5b66..54da9aad2e8 100644 --- a/Master/texmf-dist/tex/latex-dev/base/size11.clo +++ b/Master/texmf-dist/tex/latex-dev/base/size11.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{size11.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xipt{13.6}% diff --git a/Master/texmf-dist/tex/latex-dev/base/size12.clo b/Master/texmf-dist/tex/latex-dev/base/size12.clo index 6d6818246f5..8bf5ca45a3f 100644 --- a/Master/texmf-dist/tex/latex-dev/base/size12.clo +++ b/Master/texmf-dist/tex/latex-dev/base/size12.clo @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{size12.clo} - [2022/07/02 v1.4n + [2023/05/17 v1.4n Standard LaTeX file (size option)] \renewcommand\normalsize{% \@setfontsize\normalsize\@xiipt{14.5}% diff --git a/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty index 5940e23bbcd..cd77c7b8d2c 100644 --- a/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty +++ b/Master/texmf-dist/tex/latex-dev/base/structuredlog.sty @@ -42,8 +42,8 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0n} -\providecommand\ltfilehookdate{2022/08/18} +\providecommand\ltfilehookversion{v1.0o} +\providecommand\ltfilehookdate{2023/04/02} \ProvidesExplPackage {structuredlog}{\ltfilehookdate}{\ltfilehookversion} {Structuring the TeX transcript file} diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmdh.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmdh.fd index 34d4c9554a1..9e480384ef3 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmdh.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmdh.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmdh.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmfib.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmfib.fd index cc6c8c2f4c0..e4a867cf791 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmfib.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmfib.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmfib.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmfr.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmfr.fd index c3a3622e80e..477e2dcfe70 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmfr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmfr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmfr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmr.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmr.fd index c9a3258c712..e481092f781 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmss.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmss.fd index 3c2360e6322..0463f31391f 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmss.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmss.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmss.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@ssfamily}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8>#50800% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmtt.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmtt.fd index b090661948f..fd119215dfa 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@ttfamily}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8>#50800% diff --git a/Master/texmf-dist/tex/latex-dev/base/t1cmvtt.fd b/Master/texmf-dist/tex/latex-dev/base/t1cmvtt.fd index e81f76f6f35..0880e905269 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1cmvtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/t1cmvtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{t1cmvtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@ttfamily}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8>#50800% diff --git a/Master/texmf-dist/tex/latex-dev/base/ts1cmr.fd b/Master/texmf-dist/tex/latex-dev/base/ts1cmr.fd index 28bfea0905d..ea39de79b98 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ts1cmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ts1cmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ts1cmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/ts1cmss.fd b/Master/texmf-dist/tex/latex-dev/base/ts1cmss.fd index de5a321d20b..31c65faa830 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ts1cmss.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ts1cmss.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ts1cmss.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@family}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8><9><10><10.95><12><14.4>% diff --git a/Master/texmf-dist/tex/latex-dev/base/ts1cmtt.fd b/Master/texmf-dist/tex/latex-dev/base/ts1cmtt.fd index ac5177e1d80..66027bc80b8 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ts1cmtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ts1cmtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ts1cmtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@ttfamily}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8>#50800% diff --git a/Master/texmf-dist/tex/latex-dev/base/ts1cmvtt.fd b/Master/texmf-dist/tex/latex-dev/base/ts1cmvtt.fd index e5bf33ce030..60ea33c0af1 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ts1cmvtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ts1cmvtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ts1cmvtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \providecommand{\EC@ttfamily}[5]{% \DeclareFontShape{#1}{#2}{#3}{#4}% {<5><6><7><8>#50800% diff --git a/Master/texmf-dist/tex/latex-dev/base/ucmr.fd b/Master/texmf-dist/tex/latex-dev/base/ucmr.fd index b4c3225928b..eb81283a900 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ucmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ucmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ucmr.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{U}{cmr}{\hyphenchar\font45 } \DeclareFontShape{U}{cmr}{m}{n}% {<5><6><7><8><9><10><12>gen*cmr% diff --git a/Master/texmf-dist/tex/latex-dev/base/ucmss.fd b/Master/texmf-dist/tex/latex-dev/base/ucmss.fd index 481922f7666..e861d2129f0 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ucmss.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ucmss.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ucmss.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{U}{cmss}{\hyphenchar\font45 } \DeclareFontShape{U}{cmss}{m}{n}% {% diff --git a/Master/texmf-dist/tex/latex-dev/base/ucmtt.fd b/Master/texmf-dist/tex/latex-dev/base/ucmtt.fd index c33222aa540..b889cba996a 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ucmtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/ucmtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{ucmtt.fd} - [2022/07/10 v2.5l Standard LaTeX font definitions] + [2023/04/13 v2.5m Standard LaTeX font definitions] \DeclareFontFamily{U}{cmtt}{\hyphenchar \font\m@ne} \DeclareFontShape{U}{cmtt}{m}{n}% {% @@ -76,6 +76,7 @@ {<->sub*cmtt/m/n}{} \DeclareFontShape{U}{cmtt}{bx}{it}% {<->sub*cmtt/m/it}{} +\DeclareFontShape{U}{cmtt}{bx}{sl} {<->sub*cmtt/m/n}{} \DeclareFontShape{U}{cmtt}{bx}{ui}% {<->sub*cmtt/m/it}{} |