diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev/base/latex.ltx')
-rw-r--r-- | Master/texmf-dist/tex/latex-dev/base/latex.ltx | 204 |
1 files changed, 172 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx index 4580afeec0e..54ca1a8d465 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx @@ -692,7 +692,7 @@ \def\fmtname{LaTeX2e} \edef\fmtversion {2021-11-15} -\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{% @@ -4305,8 +4305,8 @@ \ExplSyntaxOff %%% From File: lthooks.dtx -\def\lthooksversion{v1.0r} -\def\lthooksdate{2021/09/06} +\def\lthooksversion{v1.0s} +\def\lthooksdate{2021/09/28} \ExplSyntaxOn \bool_new:N \g__hook_debug_bool \cs_new_eq:NN \__hook_debug:n \use_none:n @@ -5587,14 +5587,19 @@ %% File: ltcmdhooks.dtx (C) Copyright 2020-2021 %% Frank Mittelbach, Phelype Oleinik, LaTeX Team %%% From File: ltcmdhooks.dtx -\def\ltcmdhooksversion{v1.0d} -\def\ltcmdhooksdate{2021/08/25} +\def\ltcmdhooksversion{v1.0f} +\def\ltcmdhooksdate{2021/10/20} \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_patch_param_text_tl -\tl_new:N \l__hook_patch_replacement_tl +\tl_new:N \l__hook_param_text_tl +\tl_new:N \l__hook_replace_text_tl +\tl_const:Nn \c__hook_hash_tl { # # } +\cs_new_eq:NN \__hook_exp_not:NN ? +\cs_new_eq:NN \__hook_def_cmd:w ? +\quark_new:N \q__hook_recursion_tail +\quark_new:N \q__hook_recursion_stop \prop_new:N \g__hook_delayed_patches_prop \cs_new_protected:Npn \__hook_patch_debug:x #1 { \__hook_debug:n { \iow_term:x { [lthooks]~#1 } } } @@ -5725,19 +5730,40 @@ } \int_compare:nNnTF { \l__hook_patch_num_args_int } > { \c_zero_int } { - \tl_set:Nx \l__hook_patch_param_text_tl - { \bool_if:NTF #1 { [####1] } { ####1 } } - \tl_set:Nx \l__hook_patch_replacement_tl - { \bool_if:NTF #1 { [####1] } { {####1} } } + \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 { - \tl_put_right:Nn \l__hook_patch_param_text_tl { ## ####1 } - \tl_put_right:Nn \l__hook_patch_replacement_tl { { ## ####1 } } + ##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 } + { \__hook_tmp:w \tl_put_right:Nx { { \c__hook_hash_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_patch_param_text_tl - \tl_clear:N \l__hook_patch_replacement_tl + \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 { `\/ } @@ -5749,18 +5775,22 @@ } \use:x { - \l__hook_patch_prefixes_tl \tex_def:D - \exp_not:N #2 \exp_not:V \l__hook_patch_param_text_tl - { - \str_if_eq:nnT {#4} { before } - { \exp_not:N \UseHook { cmd / #3 / #4 } } - \exp_args:No \exp_not:o - { \exp_after:wN #2 \l__hook_patch_replacement_tl } - \str_if_eq:nnT {#4} { after } - { \exp_not:N \UseHook { cmd / #3 / #4 } } - } + \__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:V \l__hook_replace_text_tl } } } +\cs_new_protected:Npn \__hook_redefine_with_hooks:Nnnn #1 #2 #3 #4 + { + \l__hook_patch_prefixes_tl + \exp_after:wN \__hook_def_cmd:w + \exp_after:wN #1 \l__hook_param_text_tl + { #2 #4 #3 } + } \cs_new:Npn \__hook_make_prefixes:w / #1 / { \tl_if_empty:nF {#1} @@ -5769,6 +5799,58 @@ \__hook_make_prefixes:w / } } +\prg_new_conditional:Npnn \__hook_if_has_hash:n #1 { TF } + { \__hook_if_has_hash:w #1 ## \s__hook_mark } +\cs_new:Npn \__hook_if_has_hash:w #1 + { + \tl_if_single_token:nTF {#1} + { + \token_if_eq_catcode:NNTF ## #1 + { \__hook_if_has_hash_check:w } + { \__hook_if_has_hash:w } + } + { \__hook_if_has_hash:w #1 } + } +\cs_new:Npn \__hook_if_has_hash_check:w #1 \s__hook_mark + { \tl_if_empty:nTF {#1} { \prg_return_false: } { \prg_return_true: } } +\cs_new:Npn \__hook_double_hashes:n #1 + { \__hook_double_hashes:w #1 \q__hook_recursion_tail \q__hook_recursion_stop } +\cs_new:Npn \__hook_double_hashes:w #1 \q__hook_recursion_stop + { + \tl_if_head_is_N_type:nTF {#1} + { \__hook_double_hashes_output:N } + { + \tl_if_head_is_group:nTF {#1} + { \__hook_double_hashes_group:n } + { \__hook_double_hashes_space:w } + } + #1 \q__hook_recursion_stop + } +\cs_new:Npn \__hook_double_hashes_output:N #1 + { + \if_meaning:w \q__hook_recursion_tail #1 + \__hook_double_hashes_stop:w + \fi: + \if_meaning:w \c__hook_hash_tl #1 + \use_i:nnnn + \fi: + \use:n + { + \if_catcode:w ## \exp_not:N #1 + \exp_after:wN \use_ii:nnnn + \fi: + \use_none:n + { \exp_not:n { #1 #1 } } + } + \exp_not:N #1 + \__hook_double_hashes:w + } +\cs_new:Npn \__hook_double_hashes_stop:w #1 \q__hook_recursion_stop { \fi: } +\cs_new:Npn \__hook_double_hashes_group:n #1 + { { \__hook_double_hashes:n {#1} } \__hook_double_hashes:w } +\exp_last_unbraced:NNo +\cs_new:Npn \__hook_double_hashes_space:w \c_space_tl + { ~ \__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 } @@ -5869,7 +5951,7 @@ { \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_set_eq:NN #1 \kerneltmpDoNotUse + \cs_gset_eq:NN #1 \kerneltmpDoNotUse } \msg_new:nnnn { hooks } { cant-patch } { @@ -6208,8 +6290,8 @@ Type H <return> for immediate help.}% \def\@restorepar{\def\par{\@par}} %% File: ltpara.dtx (C) Copyright 2020-2021 %%% From File: ltpara.dtx -\def\ltparaversion{v1.0j} -\def\ltparadate{2021/09/18} +\def\ltparaversion{v1.0k} +\def\ltparadate{2021/10/19} \ExplSyntaxOn @@ -6709,6 +6791,7 @@ Type H <return> for immediate help.}% \expandafter\reserved@a \expandafter{\detokenize{.tex}} \def\@include#1 {% +\ifx\@nodocument\relax \clearpage \if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}% @@ -6744,7 +6827,12 @@ Type H <return> for immediate help.}% \deadcycles\z@ \@nameuse{cp@#1}% \fi - \let\@auxout\@mainaux} + \let\@auxout\@mainaux +\else +\@latex@warning{% + \noexpand\include should only be used after \string\begin{document}}% +\@input@{#1}% +\fi} \NewHook{include/before} \NewReversedHook{include/end} \NewReversedHook{include/after} @@ -6957,7 +7045,7 @@ Type H <return> for immediate help.}% \global\mathchardef\accent@spacefactor\spacefactor}% \let\maybe@load@fontshape\relax \let\ignorespaces\relax - \accent#1 #2\egroup\spacefactor\accent@spacefactor} + \accent#1 #2\egroup\ifmmode\else\spacefactor\accent@spacefactor\fi} \let\accent@spacefactor\relax \def\hmode@bgroup{\leavevmode\bgroup} \def\DeclareTextCompositeCommand#1#2#3#4{% @@ -8822,11 +8910,22 @@ Type H <return> for immediate help.}% \endgroup \fi}% \@onlypreamble\dorestore@version +\ifx\c@localmathalphabets\@undefined + \newcount\c@localmathalphabets + \setcounter{localmathalphabets}{2} +\fi \def\document@select@group#1#2#3#4{% \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi {% \ifmmode \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top + \ifnum \numexpr\e@mathgroup@top-\c@localmathalphabets + >\csname c@mv@\math@version\endcsname + \else + \ifcsname mv@\math@version @frozen\endcsname \else + \expandafter\freeze@math@version\expandafter{\math@version}% + \fi + \fi \begingroup \escapechar\m@ne \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% @@ -8840,14 +8939,51 @@ Type H <return> for immediate help.}% \global\advance\csname c@mv@\math@version\endcsname\@ne \else \let#1\relax - \@latex@error{Too many math alphabets used - in version \math@version}% + \@latex@error{Too many math alphabets used in + version \math@version}% \@eha \fi \else \expandafter\expandafter\expandafter\non@alpherr\fi \expandafter#1\ifx\math@bgroup\bgroup{#4}\else#4\fi }% } +\ExplSyntaxOn +\cs_new_protected:Npn\freeze@math@version #1 { + \@font@info{Freeze~ math~ alphabet~ allocation~ in~ version~ + #1.\MessageBreak + Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ + (local:~ \int_use:N\c@localmathalphabets) } + \cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } + \tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } + \group_insert_after:N \__nfss_init_mv_freeze:N \exp_after:wN + \group_insert_after:N \cs:w mv@#1@reset \cs_end: + \tl_gput_right:No \check@mathfonts + { + \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: + } + \cs_gset:cpn{mv@#1@reset} + { + \int_compare:nNnTF { \int_use:c{c@mv@#1} } > + { \tl_use:c{g__nfss_frozen_mv_ #1 _tl} } + { + \@font@info{Undo~ math~ alphabet~ allocation~ in~ version~ #1} + \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } + \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } + \group_begin: + \cs_set_eq:NN \getanddefine@fonts \use_none:nn + \use:c {mv@#1} + \group_end: + } + { + \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} + } + } +} +\cs_new_protected:Npn \__nfss_init_mv_freeze:N #1 {% + \mode_if_math:T { \group_insert_after:N \__nfss_init_mv_freeze:N + \group_insert_after:N } #1 +} +\ExplSyntaxOff \def\process@table{% \def\cdp@elt##1##2##3##4{% \@font@info{Checking defaults for @@ -8893,6 +9029,7 @@ Type H <return> for immediate help.}% } \@onlypreamble\process@table \def\DeclareMathVersion#1{% + \@namedef{g__nfss_frozen_mv_#1_tl}{}% \expandafter\new@mathversion\csname mv@#1\endcsname} \@onlypreamble\DeclareMathVersion \def\new@mathversion#1{% @@ -11230,6 +11367,7 @@ Type H <return> for immediate help.}% \def\eqnarray{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% + \def\@currentcounter{equation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ @@ -11774,6 +11912,7 @@ Type H <return> for immediate help.}% \reset@font\footnotesize \hsize\columnwidth \@parboxrestore + \def\@currentcounter{mpfootnote}% \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup @@ -13076,6 +13215,7 @@ Type H <return> for immediate help.}% \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore + \def\@currentcounter{footnote}% \protected@edef\@currentlabel{% \csname p@footnote\endcsname\@thefnmark }% |