diff options
author | Karl Berry <karl@freefriends.org> | 2022-09-27 21:11:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-09-27 21:11:23 +0000 |
commit | 73c6f4e458b99eae1e5ec3281fb1a1f4da9d7d50 (patch) | |
tree | 893ed375eb7d01e64d0baa9b8119e2a8ed4a6e1c /Master/texmf-dist/source | |
parent | d3aff7aca8ab5bf17a9d63151a907893580f3889 (diff) |
latex-dev (26sep22)
git-svn-id: svn://tug.org/texlive/trunk@64533 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
15 files changed, 757 insertions, 212 deletions
diff --git a/Master/texmf-dist/source/latex-dev/base/docstrip.dtx b/Master/texmf-dist/source/latex-dev/base/docstrip.dtx index 22c1f69aa01..de20073c481 100644 --- a/Master/texmf-dist/source/latex-dev/base/docstrip.dtx +++ b/Master/texmf-dist/source/latex-dev/base/docstrip.dtx @@ -29,9 +29,9 @@ \catcode`\{=1 \catcode`\}=2 \def\filename{docstrip.dtx} -\def\fileversion{v2.6a} -\def\filedate{2020-11-23} -\def\docdate {2020-11-23} +\def\fileversion{v2.6b} +\def\filedate{2022-09-03} +\def\docdate {2022-09-03} %% % %\iffalse @@ -42,7 +42,7 @@ %% Frank Mittelbach %% Copyright (C) 1995 Marcin Woli\'nski %% Copyright (C) 1996-1997 Mark Wooding, Marcin Woli\'nski -%% Copyright (C) 1998-2021 LaTeX Project and the above authors. +%% Copyright (C) 1998-2022 LaTeX Project and the above authors. %% All rights are reserved. %% % @@ -2537,12 +2537,16 @@ Z % |\plusOption| is called. This macro is very similar to % |\doOption|, the only difference being that displayed % message now contains `\texttt{+}'. +% \changes{v2.6b}{2022-09-03}{Complete the handling of @@-modules from +% \texttt{l3docstrip.dtx} (gh/337) also for +/- lines (gh/903)} % \begin{macrocode} \def\plusOption+#1>#2\endLine{% \maybeMsg{<+#1 . >}% \Evaluate{#1}% \def\do##1##2##3{% - \if1\Expr{##2}\StreamPut##1{#2}\fi + \if1\Expr{##2}% + \def\inLine{#2}\replaceModuleInLine + \StreamPut##1{\inLine}\fi }% \activefiles } @@ -2553,12 +2557,16 @@ Z % When a `\texttt{-}' is found as a guard modifier, % |\minusOption| is called. This macro is very similar to % |\plusOption|, the difference is that condition is negated. +% \changes{v2.6b}{2022-09-03}{Complete the handling of @@-modules from +% \texttt{l3docstrip.dtx} (gh/337) also for +/- lines (gh/903)} % \begin{macrocode} \def\minusOption-#1>#2\endLine{% \maybeMsg{<-#1 . >}% \Evaluate{#1}% \def\do##1##2##3{% - \if1\Expr{##2}\else \StreamPut##1{#2}\fi + \if1\Expr{##2}\else + \def\inLine{#2}\replaceModuleInLine + \StreamPut##1{\inLine}\fi }% \activefiles } diff --git a/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx b/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx index 43db541b988..b82f5bdb8e2 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltboxes.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltboxes.dtx} - [2022/01/31 v1.4c LaTeX Kernel (Box Commands)] + [2022/09/07 v1.4d LaTeX Kernel (Box Commands)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltboxes.dtx} @@ -1004,6 +1004,16 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\if@in@minipage@env} +% +% \changes{v1.4d}{2022/09/07} +% {Check for nested minipages and warn (gh/168)} +% \begin{macrocode} +\newif\if@in@minipage@env +% \end{macrocode} +% \end{macro} +% +% % \begin{macro}{\minipage} % \changes{v0.1a}{1993/12/03} % {Redefined to support extra optional arguments} @@ -1060,6 +1070,28 @@ \color@begingroup \hsize\@tempdima \textwidth\hsize \columnwidth\hsize +% \end{macrocode} +% We check for nested minipages inside the box so that there is +% always a group resetting the switch even if the code does not use +% \cs{begin} to start the minipage. +% \changes{v1.4d}{2022/09/07} +% {Check for nested minipages and warn (gh/168)} +% \begin{macrocode} + \if@in@minipage@env +% \end{macrocode} +% We only issue a warning if the outer minipage contained footnotes +% because that is the problematical case. +% \begin{macrocode} + \ifvoid\@mpfootins\else + \@latex@warning{Nested minipage: + footnotes may be misplaced}% + \fi + \else + \@in@minipage@envtrue + \fi +% \end{macrocode} +% +% \begin{macrocode} \@parboxrestore \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ \let\@footnotetext\@mpfootnotetext diff --git a/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx b/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx index 59aa5bf475e..14d6756f5c2 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.0l} -\def\ltcmddate{2022-03-18} +\def\ltcmdversion{v1.1a} +\def\ltcmddate{2022-08-16} % \end{macrocode} % %<*driver> @@ -247,6 +247,15 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\l_@@_suppress_strip_bool} +% \changes{v1.1a}{2022/08/10}{New switch} +% Used to indicate that an a pair of braces should not be stripped from +% an optional argument. +% \begin{macrocode} +\bool_new:N \l_@@_suppress_strip_bool +% \end{macrocode} +% \end{variable} +% % \begin{variable}{\l_@@_m_args_int} % The number of \texttt{m} arguments: if this is the same as the total % number of arguments, then a short-cut can be taken in the creation of @@ -315,6 +324,19 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop} +% \begin{macro}{\@@_if_recursion_tail_stop_do:Nn} +% \begin{macro}{\@@_use_i_delimit_by_q_recursion_stop:nw} +% Quarks and functions for internal processing. +% \begin{macrocode} +\quark_new:N \q_@@_recursion_tail +\quark_new:N \q_@@_recursion_stop +\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{variable} +% % \begin{variable}{\l_@@_tmp_prop, \l_@@_tmpa_tl, \l_@@_tmpb_tl} % \begin{macro}{\@@_tmp:w} % Scratch space. @@ -874,7 +896,7 @@ % \item Check that each argument has the correct number of data items % associated with it, and that where a single character is required, % one has actually been supplied. -% \item Check that processors and the markers~|+| and~|!| are followed +% \item Check that processors and the markers~|+|, |!| and~|=| are followed % by an argument for which they make sense, and are not redundant. % \item Check the absence of forbidden types for expandable commands, % namely \texttt{G}/\texttt{v} always, and \texttt{l}/\texttt{u} @@ -918,6 +940,7 @@ \bool_set_true:N \l_@@_grab_expandably_bool \bool_set_false:N \l_@@_obey_spaces_bool \bool_set_false:N \l_@@_long_bool + \bool_set_false:N \l_@@_suppress_strip_bool \bool_set_false:N \l_@@_some_obey_spaces_bool \bool_set_false:N \l_@@_some_long_bool \bool_set_false:N \l_@@_some_short_bool @@ -1020,7 +1043,11 @@ % \@@_normalize_type_>:w, % \@@_normalize_type_+:w, % \@@_normalize_type_!:w, +% \@@_normalize_type_=:w % } +% \changes{v1.1a}{2022/08/10}{Refactor to use common auxiliary} +% \changes{v1.1a}{2022/08/10}{Add support for \texttt{=} modifier} +% \begin{macro}{\@@_normalize_type_aux:NnNn} % Check that these prefixes have arguments, namely that the next token % is not \cs{q_recursion_tail}, and remember to leave it after the % looping macro. Processors are forbidden in expandable commands. @@ -1044,33 +1071,52 @@ } \cs_new_protected:cpn { @@_normalize_type_+:w } #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \@@_bad_arg_spec:wn } - \bool_if:NT \l_@@_long_bool + \@@_normalize_type_aux:NnNn + {#1} + \l_@@_long_bool + { \bool_set_true:N \l_@@_long_bool } + } +\cs_new_protected:cpn { @@_normalize_type_!:w } #1 + { + \@@_normalize_type_aux:NnNn ! {#1} + \l_@@_obey_spaces_bool { - \msg_error:nnxx { cmd } { two-markers } - { \@@_environment_or_command: } { + } - \@@_bad_def:wn + \bool_set_true:N \l_@@_obey_spaces_bool + \bool_set_true:N \l_@@_some_obey_spaces_bool } - \bool_set_true:N \l_@@_long_bool - \int_decr:N \l_@@_current_arg_int - \@@_normalize_arg_spec_loop:n {#1} } -\cs_new_protected:cpn { @@_normalize_type_!:w } #1 +\cs_new_protected:cpn { @@_normalize_type_=:w } #1#2 + { + \@@_normalize_type_aux:NnNn = {#2} + \l_@@_suppress_strip_bool + { + \bool_if:NT \l_@@_expandable_bool + { + \msg_error:nnxx { cmd } { keyval-in-expandable } + { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } + \@@_bad_def:wn + } + \bool_set_true:N \l_@@_suppress_strip_bool + \bool_set_false:N \l_@@_grab_expandably_bool + \tl_put_right:Nx \l_@@_arg_spec_tl + { = { \tl_trim_spaces:n {#1} } } + } + } +\cs_new_protected:Npn \@@_normalize_type_aux:NnNn #1#2#3#4 { - \quark_if_recursion_tail_stop_do:nn {#1} { \@@_bad_arg_spec:wn } - \bool_if:NT \l_@@_obey_spaces_bool + \quark_if_recursion_tail_stop_do:nn {#2} { \@@_bad_arg_spec:wn } + \bool_if:NT #3 { \msg_error:nnxx { cmd } { two-markers } - { \@@_environment_or_command: } { ! } + { \@@_environment_or_command: } { #1 } \@@_bad_def:wn } - \bool_set_true:N \l_@@_obey_spaces_bool - \bool_set_true:N \l_@@_some_obey_spaces_bool + #4 \int_decr:N \l_@@_current_arg_int - \@@_normalize_arg_spec_loop:n {#1} + \@@_normalize_arg_spec_loop:n {#2} } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro} % { @@ -1224,12 +1270,12 @@ % \end{macro} % % \begin{macro}{\@@_allowed_token_check:N} -% Some tokens are now allowed as delimiters for some argument types, +% Some tokens are not allowed as delimiters for some argument types, % notably implicit begin/end-group tokens (|\bgroup|/|\egroup|). % The major problem with these tokens is that for |\peek_...| functions, -% a literal~|{|$_1$. is virtually indistinguishable from a |\bgroup| or +% a literal~|{|$_1$ is virtually indistinguishable from a |\bgroup| or % other token which was |\let| to a~|{|$_1$, and the same goes -% for~|}|$_2$. All other tokens can be easily distingushed from their +% for~|}|$_2$. All other tokens can be easily distinguished from their % implicit counterparts by grabbing them and looking at the string % length (see \cs{@@_token_if_cs:NTF}), but for begin/end group tokens % that is not possible without the risk of mistakenly grabbing the @@ -1324,13 +1370,13 @@ % \begin{macro}{\@@_add_arg_spec:n, \@@_add_arg_spec_mandatory:n} % When adding an argument to the argument specification, set the % \texttt{some_long} or \texttt{some_short} booleans as appropriate -% and clear the booleans keeping track of |+| and |!| markers. +% and clear the booleans keeping track of |+|, |!| and |=| markers. % Before that, test for a short argument following some long % arguments: this is forbidden for expandable commands and prevents % grabbing arguments expandably. % % For mandatory arguments do some more work, in particular complain if -% they were preceeded by~|!|. +% they were preceded by~|!|. % \begin{macrocode} \cs_new_protected:Npn \@@_add_arg_spec:n #1 { @@ -1387,6 +1433,7 @@ \int_zero:N \l_@@_current_arg_int \bool_set_false:N \l_@@_long_bool \bool_set_false:N \l_@@_obey_spaces_bool + \bool_set_false:N \l_@@_suppress_strip_bool \int_zero:N \l_@@_m_args_int \bool_set_false:N \l_@@_defaults_bool \tl_clear:N \l_@@_defaults_tl @@ -1484,6 +1531,23 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_add_type_=:} +% \changes{v1.1a}{2022/08/10}{Add support for \texttt{=} modifier} +% A mix of the ideas from above: set a flag and add a processor. +% \begin{macrocode} +\cs_new_protected:cpn { @@_add_type_=:w } #1 + { + \@@_flush_m_args: + \bool_set_true:N \l_@@_prefixed_bool + \bool_set_true:N \l_@@_suppress_strip_bool + \bool_set_true:N \l_@@_process_some_bool + \tl_put_left:Nn \l_@@_process_one_tl + { { \@@_arg_to_keyvalue:nn {#1} } } + \@@_prepare_signature_bypass:N + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_add_type_b:w} % \begin{macrocode} \cs_new_protected:Npn \@@_add_type_b:w @@ -1677,11 +1741,16 @@ @@_grab_ #1 \bool_if:NT \l_@@_long_bool { _long } \bool_if:NT \l_@@_obey_spaces_bool { _obey_spaces } + \bool_lazy_and:nnT + { \l_@@_suppress_strip_bool } + { \str_if_eq_p:nn {#1} { D } } + { _no_strip } :w } } \bool_set_false:N \l_@@_long_bool \bool_set_false:N \l_@@_obey_spaces_bool + \bool_set_false:N \l_@@_suppress_strip_bool \tl_put_right:Nx \l_@@_process_all_tl { { @@ -2488,7 +2557,7 @@ \quark_if_nil:nF {#1} { \tl_const:cn { c_@@_show_type_#1_tl } {#2} \@@_tmp:w } } -\@@_tmp:w t0 r1 d1 R2 D2 O3 e4 E5 +6 !6 >7 \q_nil \q_nil +\@@_tmp:w t0 r1 d1 R2 D2 O3 e4 E5 +6 !6 >7 =7 \q_nil \q_nil % \end{macrocode} % % \begin{macro}{ @@ -2615,6 +2684,7 @@ % \@@_grab_b_aux:NNw, % \@@_grab_b_end:Nw % } +% \changes{v1.1a}{2022/08/10}{Track changes in \texttt{D}-type implementation} % This uses the well-tested code of \texttt{D}-type arguments, % skipping the peeking step because the \texttt{b}-type argument is % always present, and adding a cleanup stage at the end by hijacking @@ -2640,7 +2710,7 @@ { \@@_grab_b_aux:NNw \cs_set_protected:Npn \exp_not:n } \cs_new_protected:Npn \@@_grab_b_aux:NNw #1#2#3 \@@_run_code: { - \@@_grab_D_aux:NNnN \begin \end {#3} #1 + \@@_grab_D_aux:NNnNN \begin \end {#3} #1 \use_ii:nn \tl_put_left:Nn \l_@@_signature_tl { \@@_grab_b_end:Nw #2 } \tl_set_eq:NN \l_@@_saved_args_tl \l_@@_args_tl \tl_clear:N \l_@@_args_tl @@ -2660,37 +2730,69 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_grab_D:w} -% \begin{macro}{\@@_grab_D_long:w} -% \begin{macro}{\@@_grab_D_obey_spaces:w} -% \begin{macro}{\@@_grab_D_long_obey_spaces:w} +% \begin{macro} +% { +% \@@_grab_D:w , +% \@@_grab_D_long:w , +% \@@_grab_D_obey_spaces:w , +% \@@_grab_D_long_obey_spaces:w , +% \@@_grab_D_no_strip:w , +% \@@_grab_D_long_no_strip:w , +% \@@_grab_D_obey_spaces_no_strip:w , +% \@@_grab_D_long_obey_spaces_no_strip:w +% } +% \changes{v1.1a}{2022/08/10}{Add support for skipping brace stripping} % The generic delimited argument grabber. The auxiliary function does % a peek test before calling \cs{@@_grab_D_call:Nw}, so that the % optional nature of the argument works as expected. % \begin{macrocode} \cs_new_protected:Npn \@@_grab_D:w #1#2#3 \@@_run_code: { - \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected_nopar:Npn - \@@_peek_nonspace_remove:NTF + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected_nopar:Npn + \@@_peek_nonspace_remove:NTF \use_ii:nn } \cs_new_protected:Npn \@@_grab_D_long:w #1#2#3 \@@_run_code: { - \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected:Npn - \@@_peek_nonspace_remove:NTF + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected:Npn + \@@_peek_nonspace_remove:NTF \use_ii:nn } \cs_new_protected:Npn \@@_grab_D_obey_spaces:w #1#2#3 \@@_run_code: { - \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected_nopar:Npn - \@@_peek_meaning_remove:NTF + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected_nopar:Npn + \@@_peek_meaning_remove:NTF \use_ii:nn } \cs_new_protected:Npn \@@_grab_D_long_obey_spaces:w #1#2#3 \@@_run_code: { - \@@_grab_D_aux:NNnNN #1 #2 {#3} \cs_set_protected:Npn - \@@_peek_meaning_remove:NTF + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected:Npn + \@@_peek_meaning_remove:NTF \use_ii:nn + } +\cs_new_protected:Npn \@@_grab_D_no_strip:w + #1#2#3 \@@_run_code: + { + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected_nopar:Npn + \@@_peek_nonspace_remove:NTF \use_none:n + } +\cs_new_protected:Npn \@@_grab_D_long_no_strip:w + #1#2#3 \@@_run_code: + { + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected:Npn + \@@_peek_nonspace_remove:NTF \use_none:n + } +\cs_new_protected:Npn \@@_grab_D_obey_spaces_no_strip:w + #1#2#3 \@@_run_code: + { + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected_nopar:Npn + \@@_peek_meaning_remove:NTF \use_none:n + } +\cs_new_protected:Npn \@@_grab_D_long_obey_spaces_no_strip:w + #1#2#3 \@@_run_code: + { + \@@_grab_D_aux:NNnNNN #1 #2 {#3} \cs_set_protected:Npn + \@@_peek_meaning_remove:NTF \use_none:n } % \end{macrocode} +% \begin{macro}{\@@_grab_D_aux:NNnNNN} % \begin{macro}{\@@_grab_D_aux:NNnNN} -% \begin{macro}{\@@_grab_D_aux:NNnN} % This is a bit complicated. The idea is that, in order to check for % nested optional argument tokens (\texttt{[[...]]} and so on) the % argument needs to be grabbed without removing any braces at all. If @@ -2699,9 +2801,9 @@ % prevents loss of braces, and there is then a test to see if there are % nested delimiters to handle. % \begin{macrocode} -\cs_new_protected:Npn \@@_grab_D_aux:NNnNN #1#2#3#4#5 +\cs_new_protected:Npn \@@_grab_D_aux:NNnNNN #1#2#3#4#5#6 { - \@@_grab_D_aux:NNnN #1#2 {#3} #4 + \@@_grab_D_aux:NNnNN #1#2 {#3} #4 #6 #5 #1 { \@@_grab_D_call:Nw #1 } { \@@_add_arg:o \c_novalue_tl } @@ -2712,9 +2814,10 @@ % extra factors to allow for: the argument might be entirely empty, and % spaces at the start and end of the input must be retained around a brace % group. Also notice that a \emph{blank} argument might still contain -% spaces. +% spaces. To allow for suppression of brace stripping, the business end +% is passed here as |#5|. % \begin{macrocode} -\cs_new_protected:Npn \@@_grab_D_aux:NNnN #1#2#3#4 +\cs_new_protected:Npn \@@_grab_D_aux:NNnNN #1#2#3#4#5 { \tl_set:Nn \l_@@_signature_tl {#3} \exp_after:wN #4 \l_@@_fn_tl ##1 #2 @@ -2728,7 +2831,7 @@ \str_if_eq:eeTF { \exp_not:o { \use_none:n ##1 } } { { \exp_not:o { \use_ii:nnn ##1 \q_nil } } } - { \@@_add_arg:o { \use_ii:nn ##1 } } + { \@@_add_arg:o { #5 ##1 } } { \@@_add_arg:o { \use_none:n ##1 } } } } @@ -2738,9 +2841,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % % \begin{macro}{\@@_grab_D_nested:NNnN} % \begin{macro}{\@@_grab_D_nested:w} @@ -3039,6 +3139,7 @@ % % \begin{macro}{\@@_grab_R:w, \@@_grab_R_long:w} % \begin{macro}{\@@_grab_R_aux:NNnN} +% \changes{v1.1a}{2022/08/10}{Track changes in \texttt{D}-type implementation} % The grabber for \texttt{R}-type arguments is basically the same as % that for \texttt{D}-type ones, but always skips spaces (as it is mandatory) % and has a hard-coded error message. @@ -3049,7 +3150,7 @@ { \@@_grab_R_aux:NNnN #1 #2 {#3} \cs_set_protected:Npn } \cs_new_protected:Npn \@@_grab_R_aux:NNnN #1#2#3#4 { - \@@_grab_D_aux:NNnN #1 #2 {#3} #4 + \@@_grab_D_aux:NNnNN #1 #2 {#3} #4 \use_ii:nn \@@_peek_nonspace_remove:NTF #1 { \@@_grab_D_call:Nw #1 } { @@ -3873,6 +3974,190 @@ % \end{macrocode} % \end{macro} % +% \subsection{Conversion to key--value form} +% +% This is implemented as a process but with no public interfaces, +% hence is treated separately from the others: it's a feature of +% \pkg{ltcmd} which just happens to use the same mechanism as a processor. +% +% \begin{macro}{\@@_arg_to_keyvalue:nn} +% \changes{v1.1a}{2022/08/10}{New internal arg-to-keyval processor} +% \begin{macro}{\@@_arg_to_keyvalue_braces:nnn} +% \begin{macro}{\@@_arg_to_keyvalue_auxi:nnn} +% \begin{macro}{\@@_arg_to_keyvalue_auxii:Nnnn} +% \begin{macro}{\@@_arg_to_keyvalue_auxiii:nnn} +% \begin{macro}{\@@_arg_to_keyvalue_auxiv:Nnnn} +% \begin{macro}{\@@_arg_to_keyvalue_auxv:nn} +% \begin{macro}{\@@_arg_to_keyvalue_loop:w} +% \begin{macro}{\@@_arg_to_keyvalue_loop_group:n} +% \begin{macro}{\@@_arg_to_keyvalue_loop_space:w} +% \begin{macro}{\@@_arg_to_keyvalue_loop_N_type:N} +% \begin{macro}{\@@_arg_to_keyvalue_math:w} +% \begin{macro}{\@@_arg_to_keyvalue_math_N_type:N} +% \begin{macro}{\@@_arg_to_keyvalue_math_group:n} +% \begin{macro}{\@@_arg_to_keyvalue_math_space:w} +% \begin{macro}{\@@_arg_to_keyvalue_set_default:nn} +% \begin{macro}{\@@_arg_to_keyvalue_set_keyvalue:nn} +% \begin{macro}[EXP]{\@@_split_N_head_apply:Nn} +% \begin{macro}[EXP]{\@@_split_N_head_apply_aux:NNw} +% If the entire argument is braced, we treat as free text and return as +% the value for the text key. Alternatively, if the start of the input is +% |=,| then it is forced to be key--value. To avoid needing to worry about +% catcodes for this, and to allow spaces around the |=|, we use a +% series of steps rather than a delimited argument. +% \begin{macrocode} +\cs_new_protected:Npn \@@_arg_to_keyvalue:nn #1#2 + { + \tl_trim_spaces_apply:nN {#2} \@@_arg_to_keyvalue_braces:nnn + {#1} {#2} + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_braces:nnn #1#2#3 + { + \tl_if_head_is_group:nT {#1} + { + \tl_if_blank:oT { \use_none:n #1 } + { + \tl_set:Nx \ProcessedArgument { #2 = { \exp_not:n #1 } } + \use_none:nnnn + } + } + \@@_arg_to_keyvalue_auxi:nnn {#1} {#2} {#3} + } +\cs_new:Npn \@@_arg_to_keyvalue_auxi:nnn #1 + { + \tl_if_head_is_N_type:nTF {#1} + { \@@_split_N_head_apply:Nn \@@_arg_to_keyvalue_auxii:Nnnn {#1} } + { \@@_arg_to_keyvalue_auxv:nn } + } +\cs_new:Npn \@@_arg_to_keyvalue_auxii:Nnnn #1#2 + { + \str_if_eq:eeTF { \exp_not:n {#1} } { = } + { \tl_trim_spaces_apply:nN {#2} \@@_arg_to_keyvalue_auxiii:nnn } + { \@@_arg_to_keyvalue_auxv:nn } + } +\cs_new:Npn \@@_arg_to_keyvalue_auxiii:nnn #1 + { + \tl_if_head_is_N_type:nTF {#1} + { \@@_split_N_head_apply:Nn \@@_arg_to_keyvalue_auxiv:Nnnn {#1} } + { \@@_arg_to_keyvalue_auxv:nn } + } +\cs_new:Npn \@@_arg_to_keyvalue_auxiv:Nnnn #1#2 + { + \str_if_eq:eeTF { \exp_not:n {#1} } { , } + { \tl_set:Nn \ProcessedArgument {#2} \use_none:nn } + { \@@_arg_to_keyvalue_auxv:nn } + } +% \end{macrocode} +% The two clear-cut cases have been eliminated, and we therefore have to deal +% with a search for |=| signs. We need an \enquote{action} loop here +% so we do not get mislead by for example |{=}|. As the code here is for +% very much predictable types of input, we hard-code what constitutes +% math mode opening and closing. At the very beginning, the default +% key (|#1|) and the argument as given by the user (|#2|) are placed +% right after the \cs{q_@@_recursion_stop}, so that when the recursion +% ends, the macros \cs{@@_arg_to_keyvalue_set_default:nn} or +% \cs{@@_arg_to_keyvalue_set_keyvalue:nn} can be used to grab these +% two items and set the \cs{ProcessedArgument} accordingly. +% \begin{macrocode} +\cs_new_protected:Npn \@@_arg_to_keyvalue_auxv:nn #1#2 + { + \@@_arg_to_keyvalue_loop:w #2 + \q_@@_recursion_tail \q_@@_recursion_stop {#1} {#2} + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_loop:w #1 \q_@@_recursion_stop + { + \tl_if_head_is_N_type:nTF {#1} + { \@@_arg_to_keyvalue_loop_N_type:N } + { + \tl_if_head_is_group:nTF {#1} + { \@@_arg_to_keyvalue_loop_group:n } + { \@@_arg_to_keyvalue_loop_space:w } + } + #1 \q_@@_recursion_stop + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_loop_group:n #1 + { \@@_arg_to_keyvalue_loop:w } +\use:n { \cs_new_protected:Npn \@@_arg_to_keyvalue_loop_space:w } ~ + { \@@_arg_to_keyvalue_loop:w } +\cs_new_protected:Npn \@@_arg_to_keyvalue_loop_N_type:N #1 + { + \@@_if_recursion_tail_stop_do:Nn #1 + { \@@_arg_to_keyvalue_set_default:nn } + \str_if_eq:nnTF {#1} { = } + { + \@@_use_i_delimit_by_q_recursion_stop:nw + { \@@_arg_to_keyvalue_set_keyvalue:nn } + } + { + \bool_lazy_or:nnTF + { \token_if_math_toggle_p:N #1 } + { \str_if_eq_p:nn {#1} { \( } } + { \@@_arg_to_keyvalue_math:w } + { \@@_arg_to_keyvalue_loop:w } + } + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_math:w #1 \q_@@_recursion_stop + { + \tl_if_head_is_N_type:nTF {#1} + { \@@_arg_to_keyvalue_math_N_type:N } + { + \tl_if_head_is_group:nTF {#1} + { \@@_arg_to_keyvalue_math_group:n } + { \@@_arg_to_keyvalue_math_space:w } + } + #1 \q_@@_recursion_stop + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_math_N_type:N #1 + { + \@@_if_recursion_tail_stop_do:Nn #1 + { \@@_arg_to_keyvalue_set_default:nn } + \bool_lazy_or:nnTF + { \token_if_math_toggle_p:N #1 } + { \str_if_eq_p:nn {#1} { \) } } + { \@@_arg_to_keyvalue_loop:w } + { \@@_arg_to_keyvalue_math:w } + } +\cs_new_protected:Npn \@@_arg_to_keyvalue_math_group:n #1 + { \@@_arg_to_keyvalue_math:w } +\use:n { \cs_new_protected:Npn \@@_arg_to_keyvalue_math_space:w } ~ + { \@@_arg_to_keyvalue_math:w } +\cs_new_protected:Npn \@@_arg_to_keyvalue_set_default:nn #1#2 + { \tl_set:Nn \ProcessedArgument { #1 = {#2} } } +\cs_new_protected:Npn \@@_arg_to_keyvalue_set_keyvalue:nn #1#2 + { \tl_set:Nn \ProcessedArgument {#2} } +% \end{macrocode} +% A utility to allow us to grab the first \texttt{N}-type token without +% risking brace stripping the rest of the input. +% \begin{macrocode} +\cs_new:Npn \@@_split_N_head_apply:Nn #1#2 + { \exp:w \if_false: { \fi: \@@_split_N_head_apply_aux:NNw #1#2 } } +\cs_new:Npn \@@_split_N_head_apply_aux:NNw #1#2 + { + \exp_after:wN \exp_end: + \exp_after:wN #1 \exp_after:wN #2 \exp_after:wN { \if_false: } \fi: + } + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Access to the argument specification} % % \begin{macro}{\@@_get_arg_spec_error:N, \@@_get_arg_spec_error:n} @@ -4372,6 +4657,13 @@ This~is~only~supported~for~robust~commands,~but~not~for~expandable~ones. \c_@@_ignore_def_tl } +\msg_new:nnnn { cmd } { keyval-in-expandable } + { Invalid~argument~prefix~'='~in~command~'#1'. } + { + The~argument~specification~for~'#1'~contains~a~key--value~marker~'={#2}'.~ + This~is~only~supported~for~robust~commands,~but~not~for~expandable~ones. + \c_@@_ignore_def_tl + } \msg_new:nnnn { cmd } { too-many-args } { Too~many~arguments~for~#1. } { diff --git a/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx b/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx index 8b5e9825919..c8503de8916 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx @@ -31,8 +31,8 @@ %%% From File: ltfilehook.dtx % % \begin{macrocode} -\providecommand\ltfilehookversion{v1.0m} -\providecommand\ltfilehookdate{2022/04/01} +\providecommand\ltfilehookversion{v1.0n} +\providecommand\ltfilehookdate{2022/08/18} % \end{macrocode} % %<*driver> @@ -1513,10 +1513,25 @@ \global\@namedef{@pkg-disable@#1.\@pkgextension}{#2}} % \end{macrocode} % +% \changes{v1.0n}{2022/08/18}{Inhibit checking the loaded version when +% package is load-disabled, and write to the .log (gh/888)} +% Here we check if a control sequence named +% \cs[no-index]{@pkg-disable@\meta{name}.sty} is defined, and if so +% don't use the package loading code |#2|, but use the replacement +% code stored in that control sequence, write something to the log, +% and then prevent \cs{@onefilewithoptions} from sanity-checking the +% requested package date (the \tn{expandafter} here triggers one in +% \cs{@onefilewithoptions} that ends a conditional there, and the +% \tn{@gobbletwo} removes the date checking code from the input +% stream). % \begin{macrocode} \def\@disable@packageload@do#1#2{% - \@ifundefined{@pkg-disable@#1}{#2}% - {\@nameuse{@pkg-disable@#1}}} + \@ifundefined{@pkg-disable@#1}% + {#2}% + {\@nameuse{@pkg-disable@#1}% + \@latex@info{Package '#1' has been disabled.% + \MessageBreak Load request ignored}% + \expandafter\@gobbletwo}} % \end{macrocode} % % \cs{reenable@package@load} undefines diff --git a/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx b/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx index fafd0c69126..69ea7bc942a 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltfinal.dtx} - [2022/07/05 v2.2w LaTeX Kernel (Final Settings)] + [2022/08/29 v2.2w LaTeX Kernel (Final Settings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfinal.dtx} @@ -1103,7 +1103,7 @@ % In order to get round this, we redefine |\MakeUppercase| and % |\MakeLowercase| to grab their argument and brace it. % -% Earlier versions needed to procsss |\@uclclist| in an |\edef| +% Earlier versions needed to process |\@uclclist| in an |\edef| % to handle legacy input encodings, but recent (2022) expl3 versions % handle non-UTF8 text natively so we simply call the |\text_...case:n| % functions. diff --git a/Master/texmf-dist/source/latex-dev/base/ltfssdcl.dtx b/Master/texmf-dist/source/latex-dev/base/ltfssdcl.dtx index dd9f12f802c..49041605e99 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfssdcl.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfssdcl.dtx @@ -36,7 +36,7 @@ % % \ProvidesFile{ltfssdcl.dtx} - [2022/07/04 v3.0z LaTeX Kernel (NFSS Declarative Interface)] + [2022/09/20 v3.1b LaTeX Kernel (NFSS Declarative Interface)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -457,7 +457,7 @@ % % % -% \begin{macro}{\c@localalphabets} +% \begin{macro}{\c@localmathalphabets} % \changes{v3.0x}{2021/09/26}{Counter added for (gh/676)} % To avoid hitting the ``no more math fams available'' limit of 16, we % keep a defined number of math alphabets flexible/local. If we have to @@ -577,118 +577,6 @@ } % \end{macrocode} % -% -% -% \begin{macro}{\freeze@math@version} -% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} -% This command stores the current state of the math version and sets -% things up to return to it after each formula from now on. We use -% L3 programming layer code to set it up. -% \begin{macrocode} -\ExplSyntaxOn -\cs_new_protected:Npn\freeze@math@version #1 { -% \end{macrocode} -% Save the current \cs{mv@\meta{version}} code and the number of -% allocated mathgroups inside. -% \begin{macrocode} - \@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 } } -% \end{macrocode} -% Doing the reset the first time, we wait until we are out of -% math mode, so we use some recursive \cs{group_insert_after:N} for this -% before we execute \cs{mv@\meta{version}@reset}. -% \begin{macrocode} - \group_insert_after:N \__nfss_init_mv_freeze:N - \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: -% \end{macrocode} -% The \cs{check@mathfonts} is called at the very beginning of each -% math formula, so it is a good way to hook in the resetting. -% Again that has to happen after the formula has ended, but we know -% because of the place where \cs{check@mathfonts} is used -% that a single \cs{aftergoup} is sufficient. -% \begin{macrocode} - \tl_gput_right:No \check@mathfonts - { - \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: - } -% \end{macrocode} -% Here is the definition of \cs{mv@\meta{version}@reset}. If there -% has been no new math alphabet allocation, doing a reset would -% just cause a lot of unnecessary processing, so we do a quick -% check upfront for this. -% \begin{macrocode} - \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} -% \end{macrocode} -% If the undo is necessary, we restore the \cs{mv@\meta{version}} code. -% \begin{macrocode} - \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } - \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } -% \end{macrocode} -% But we also should undo changes to the math alphabet -% definitions. We therefore run this code with a modified -% definition for \cs{getanddefine@fonts} because there is no need -% to do anything to the symbol fonts that are permanently allocated. -% \begin{macrocode} - \group_begin: - \cs_set_eq:NN \getanddefine@fonts \use_none:nn - \use:c {mv@#1} - \group_end: - } - { -% \end{macrocode} -% If there was no change, we report that in the log (but this -% branch could go completely). -% \begin{macrocode} - \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} - } -% \end{macrocode} -% If this is executed after a math display, we may have to arrange -% for ignoring spaces, because they are now hidden if -% the tokens from above intervene. This is signaled by the 2e -% switch \texttt{@ignore} which is set in \cs{frozen@everymath} and -% \cs{frozen@everydisplay}. -% -% This is all 2e code so we use that syntax. -% \changes{v3.0z}{2022/07/04}{Ignore spaces if necessary (gh/886)} -% \begin{macrocode} - \if@ignore \ignorespaces \fi - } -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\__nfss_init_mv_freeze:N} -% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} -% To do the initial freeze in a safe place, we check if we are in -% math mode and if so try again after the group has ended by pushing -% the command and its single token argument with two -% \cs{group_insert_after:N}s after the current group. If we are no longer in -% math mode we bypass the -% conditional and so the next token is our argument -% which is then finally executed. -% \begin{macrocode} -\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 -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macrocode} -\ExplSyntaxOff -% \end{macrocode} -% % \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease @@ -786,7 +674,132 @@ %<latexrelease>\EndIncludeInRelease %<*2ekernel> % \end{macrocode} -% \end{macro} +% \end{macro} +% +% +% +% +% \begin{macro}{\freeze@math@version} +% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} +% \changes{v3.1a}{2022/09/17}{New logic for freezing math versions (gh/921)} +% This command stores the current state of the math version and sets +% things up to return to it after each formula from now on. We use +% L3 programming layer code to set it up. +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/11/01}% +%<latexrelease> {\freeze@math@version}{freeze math version}% +\ExplSyntaxOn +\cs_new_protected:Npn\freeze@math@version #1 { +% \end{macrocode} +% Save the current \cs{mv@\meta{version}} code and the number of +% allocated mathgroups inside. +% \begin{macrocode} + \@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 } } +% \end{macrocode} +% Here is the definition of \cs{mv@\meta{version}@reset}. If there +% has been no new math alphabet allocation, doing a reset would +% just cause a lot of unnecessary processing, so we do a quick +% check upfront for this. +% \begin{macrocode} + \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} +% \end{macrocode} +% If the undo is necessary, we restore the \cs{mv@\meta{version}} code. +% \begin{macrocode} + \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } + \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } +% \end{macrocode} +% But we also should undo changes to the math alphabet +% definitions. We therefore run this code with a modified +% definition for \cs{getanddefine@fonts} because there is no need +% to do anything to the symbol fonts that are permanently allocated. +% \begin{macrocode} + \group_begin: + \cs_set_eq:NN \getanddefine@fonts \use_none:nn + \use:c {mv@#1} + \group_end: + } + { +% \end{macrocode} +% If there was no change, we report that in the log (but this +% branch could go completely). +% \begin{macrocode} + \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} + } +% \end{macrocode} +% If this is executed after a math display, we may have to arrange +% for ignoring spaces, because they are now hidden if +% the tokens from above intervene. This is signaled by the 2e +% switch \texttt{@ignore} which is set in \cs{frozen@everymath} and +% \cs{frozen@everydisplay}. +% +% This is all 2e code so we use that syntax. +% \changes{v3.0z}{2022/07/04}{Ignore spaces if necessary (gh/886)} +% \begin{macrocode} + \if@ignore \ignorespaces \fi + } +} +\ExplSyntaxOff +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2021/11/15} +%<latexrelease> {\freeze@math@version}{freeze math version}% +%<latexrelease> +%<latexrelease>\ExplSyntaxOn +%<latexrelease>\cs_set_protected:Npn\freeze@math@version #1 { +%<latexrelease> \@font@info{Freeze~ math~ alphabet~ allocation~ in~ version~ +%<latexrelease> #1.\MessageBreak +%<latexrelease> Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ +%<latexrelease> (local:~ \int_use:N\c@localmathalphabets) } +%<latexrelease> \cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } +%<latexrelease> \tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } +%<latexrelease> \group_insert_after:N \__nfss_init_mv_freeze:N +%<latexrelease> \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: +%<latexrelease> \tl_gput_right:No \check@mathfonts +%<latexrelease> { +%<latexrelease> \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: +%<latexrelease> } +%<latexrelease> \cs_gset:cpn{mv@#1@reset} +%<latexrelease> { +%<latexrelease> \int_compare:nNnTF { \int_use:c{c@mv@#1} } > +%<latexrelease> { \tl_use:c{g__nfss_frozen_mv_ #1 _tl} } +%<latexrelease> { +%<latexrelease> \@font@info{Undo~ math~ alphabet~ allocation~ in~ version~ #1} +%<latexrelease> \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } +%<latexrelease> \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } +%<latexrelease> \group_begin: +%<latexrelease> \cs_set_eq:NN \getanddefine@fonts \use_none:nn +%<latexrelease> \use:c {mv@#1} +%<latexrelease> \group_end: +%<latexrelease> } +%<latexrelease> { +%<latexrelease> \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} +%<latexrelease> } +%<latexrelease> \if@ignore \ignorespaces \fi +%<latexrelease> } +%<latexrelease>} +%<latexrelease>\cs_set_protected:Npn \__nfss_init_mv_freeze:N #1 {% +%<latexrelease> \mode_if_math:T { \group_insert_after:N \__nfss_init_mv_freeze:N +%<latexrelease> \group_insert_after:N } #1 +%<latexrelease>} +%<latexrelease>\ExplSyntaxOff +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% \end{macro} +% % % \begin{macro}{\process@table} % \begin{macrocode} @@ -868,7 +881,7 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease>\IncludeInRelease{2022/11/01}% %<latexrelease> {\DeclareMathVersion}{local alphabets}% \def\DeclareMathVersion#1{% % \end{macrocode} @@ -881,6 +894,21 @@ % \begin{macrocode} \@namedef{g__nfss_frozen_mv_#1_tl}{}% % \end{macrocode} +% We also extend \cs{check@mathfonts} to call a version reset (once +% frozen) after a formula has finished. +% \changes{v3.1a}{2022/09/17}{New logic for freezing math versions (gh/921)} +% \begin{macrocode} + \expandafter\ifx\csname mv@#1\endcsname \relax + \expandafter \g@addto@macro \expandafter \check@mathfonts + \expandafter {\expandafter \aftergroup \csname mv@#1@reset\endcsname}% +% \end{macrocode} +% Initially this macro does nothing. It is, however, important that +% it doesn't stop any \cs{ignorespaces}, so we make it expandable +% and not \cs{relax}. +% \begin{macrocode} + \@namedef{mv@#1@reset}{}% + \fi +% \end{macrocode} % % \begin{macrocode} \expandafter\new@mathversion\csname mv@#1\endcsname} @@ -890,6 +918,12 @@ % \end{macrocode} % % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\DeclareMathVersion}{local alphabets}% +%<latexrelease>\def\DeclareMathVersion#1{% +%<latexrelease> \@namedef{g__nfss_frozen_mv_#1_tl}{}% +%<latexrelease> \expandafter\new@mathversion\csname mv@#1\endcsname} +%<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000/00/00}% %<latexrelease> {\DeclareMathVersion}{local alphabets}% %<latexrelease>\def\DeclareMathVersion#1{% @@ -963,8 +997,24 @@ % \end{macro} % % \begin{macro}{\DeclareSymbolFont} +% First drop any surplus \texttt{m} from the series argument then +% do what has been done since 1994. +% \changes{v3.1b}{2022/09/20}{Drop any surplus 'm' in series argument (gh/918)} % \begin{macrocode} -\def\DeclareSymbolFont#1#2#3#4#5{% +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/11/01}% +%<latexrelease> {\DeclareSymbolFont}{maybe drop m}% +\def\DeclareSymbolFont #1#2#3#4#5{% + \def\reserved@a{\DeclareSymbolFont@m@dropped{#1}{#2}{#3}}% + \edef\reserved@b{#4}% + \series@maybe@drop@one@m\reserved@b\reserved@b + \expandafter\reserved@a\expandafter{\reserved@b}{#5}% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\DeclareSymbolFont@m@dropped #1#2#3#4#5{% \@tempswafalse \edef\reserved@b{#2}% \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% @@ -1018,6 +1068,16 @@ \fi } \@onlypreamble\DeclareSymbolFont +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\DeclareSymbolFont}{maybe drop m}% +%<latexrelease> +%<latexrelease>\let\DeclareSymbolFont\DeclareSymbolFont@m@dropped +%<latexrelease>\let\DeclareSymbolFont@m@dropped\@undefined +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % @@ -1054,8 +1114,24 @@ % \end{macro} % % \begin{macro}{\SetSymbolFont} +% First drop any surplus \texttt{m} from the series argument then +% do what has been done since 1994. +% \changes{v3.1b}{2022/09/20}{Drop any surplus 'm' in series argument (gh/918)} % \begin{macrocode} -\def\SetSymbolFont#1#2#3#4#5#6{% +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/11/01}% +%<latexrelease> {\SetSymbolFont}{maybe drop m}% +\def\SetSymbolFont #1#2#3#4#5#6{% + \def\reserved@a{\SetSymbolFont@m@dropped{#1}{#2}{#3}{#4}}% + \edef\reserved@b{#5}% + \series@maybe@drop@one@m\reserved@b\reserved@b + \expandafter\reserved@a\expandafter{\reserved@b}{#6}% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\SetSymbolFont@m@dropped#1#2#3#4#5#6{% \@tempswafalse \edef\reserved@b{#3}% \def\cdp@elt##1##2##3##4{\def\reserved@c{##1}% @@ -1070,6 +1146,16 @@ \fi } \@onlypreamble\SetSymbolFont +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\SetSymbolFont}{maybe drop m}% +%<latexrelease> +%<latexrelease>\let\SetSymbolFont\SetSymbolFont@m@dropped +%<latexrelease>\let\SetSymbolFont@m@dropped\@undefined +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx b/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx index df671d4259f..88f9315f8a3 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltkeys.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltkeys.dtx} - [2022/07/05 v1.0i LaTeX Kernel (Kevyal options)] + [2022/08/21 v1.0k LaTeX Kernel (Keyval options)] % \iffalse \documentclass{l3doc} \GetFileInfo{ltkeys.dtx} @@ -251,11 +251,15 @@ \@@_option_end: \@@_options_loaded:n {#1} } +% \end{macrocode} +% \changes{v1.0j}{2022/07/23} +% {Output `public' package name in messages} +% \begin{macrocode} \msg_new:nnnn { keys } { option-unknown } { Unknown~option~'#1'~for~package~#2. } { LaTeX~has~been~asked~to~set~an~option~called~'#1'~ - but~the~#2~package~has~not~created~an~option~with~this~name. + but~the~package~"\msg_module_name:n {#2}"~has~not~created~an~option~with~this~name. } % \end{macrocode} % \end{macro} @@ -498,13 +502,29 @@ } { \msg_error:nnnn { keys } { load-only } {#1} {#2} } } +% \end{macrocode} +% \changes{v1.0j}{2022/07/23} +% {Output `public' package name in messages} +% \begin{macrocode} \msg_new:nnn { keys } { load-option-ignored } - { Package~"#1"~has~already~been~loaded:~ignoring~load-time~option~"#2". } + { + Package~"\msg_module_name:n {#1}"~has~already~been~loaded:~ + ignoring~load-time~option~"#2". + } +% \end{macrocode} +% \changes{v1.0j}{2022/07/23} +% {Output `public' package name in messages} +% \changes{v1.0k}{2022/08/21} +% {Correct error message} +% \begin{macrocode} \msg_new:nnnn { keys } { load-only } - { Key~"#2"~may~only~be~used~in~the~during~loading~of~package~"#1". } + { + Key~"#2"~may~only~be~used~during~loading~of~package~ + "\msg_module_name:n {#1}". + } { LaTeX~was~asked~to~set~a~key~called~"#2",~but~this~is~only~allowed~ - in~the~optional~argument~when~loading~package~"#1". + in~the~optional~argument~when~loading~package~"\msg_module_name:n{#1}". } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx b/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx index 18623fd677a..ab81c3620ae 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx @@ -28,7 +28,7 @@ \ProvidesFile{ltluatex.dtx} %</driver> %<*tex> -[2021/12/27 v1.1x +[2022/08/13 v1.1y %</tex> %<plain> LuaTeX support for plain TeX (core) %<*tex> @@ -1398,9 +1398,7 @@ local callbacktypes = callbacktypes or { ligaturing = simple, kerning = simple, insert_local_par = simple, - pre_mlist_to_hlist_filter = list, - mlist_to_hlist = exclusive, - post_mlist_to_hlist_filter = reverselist, +% mlist_to_hlist = exclusive, new_graf = exclusive, % \end{macrocode} % Section 8.5: information reporting callbacks. @@ -1461,6 +1459,30 @@ local callbacktypes = callbacktypes or { luatexbase.callbacktypes=callbacktypes % \end{macrocode} % +% \changes{v1.1y}{2022/08/13}{shared\_callbacks added} +% Sometimes multiple callbacks correspond to a single underlying engine level callback. +% Then the engine level callback should be registered as long as at least one of these +% callbacks is in use. This is implemented though a shared table which counts how many +% of the involved callbacks are currently in use. The enging level callback is registered +% iff this count is not 0. +% +% We add |mlist_to_hlist| directly to the list to demonstrate this, but the handler gets +% added later when it is actually defined. +% +% All callbacks in this list are treated as user defined callbacks. +% +% \begin{macrocode} +local shared_callbacks = { + mlist_to_hlist = { + callback = "mlist_to_hlist", + count = 0, + handler = nil, + }, +} +shared_callbacks.pre_mlist_to_hlist_filter = shared_callbacks.mlist_to_hlist +shared_callbacks.post_mlist_to_hlist_filter = shared_callbacks.mlist_to_hlist +% \end{macrocode} +% % \begin{macro}{callback.register} % \changes{v1.0a}{2015/09/24}{Function modified} % Save the original function for registering callbacks and prevent the @@ -1639,11 +1661,7 @@ local defaults = { % If a default function is not required, it may be declared as |false|. % First we need a list of user callbacks. % \begin{macrocode} -local user_callbacks_defaults = { - pre_mlist_to_hlist_filter = list_handler_default, - mlist_to_hlist = node.mlist_to_hlist, - post_mlist_to_hlist_filter = list_handler_default, -} +local user_callbacks_defaults = {} % \end{macrocode} % % \begin{macro}{create_callback} @@ -1738,9 +1756,19 @@ local function add_to_callback(name, func, description) l = { } callbacklist[name] = l % \end{macrocode} +% \changes{v1.1y}{2022/08/13}{Adapted code for shared\_callbacks} +% Handle count for shared engine callbacks. +% \begin{macrocode} + local shared = shared_callbacks[name] + if shared then + shared.count = shared.count + 1 + if shared.count == 1 then + callback_register(shared.callback, shared.handler) + end +% \end{macrocode} % If it is not a user defined callback use the primitive callback register. % \begin{macrocode} - if user_callbacks_defaults[name] == nil then + elseif user_callbacks_defaults[name] == nil then callback_register(name, handlers[callbacktypes[name]](name)) end end @@ -1778,6 +1806,7 @@ luatexbase.add_to_callback = add_to_callback % \changes{v1.0k}{2015/12/02}{adjust initialization of cb local (PHG)} % \changes{v1.0k}{2015/12/02}{Give more specific error messages (PHG)} % \changes{v1.1m}{2020/03/07}{Do not call callback.register for user-defined callbacks} +% \changes{v1.1y}{2022/08/13}{Adapted code for shared\_callbacks} % Remove a function from a callback. First check arguments. % \begin{macrocode} local function remove_from_callback(name, description) @@ -1823,7 +1852,13 @@ local function remove_from_callback(name, description) ) if #l == 0 then callbacklist[name] = nil - if user_callbacks_defaults[name] == nil then + local shared = shared_callbacks[name] + if shared then + shared.count = shared.count - 1 + if shared.count == 0 then + callback_register(shared.callback, nil) + end + elseif user_callbacks_defaults[name] == nil then callback_register(name, nil) end end @@ -1917,10 +1952,14 @@ luatexbase.uninstall = uninstall % \end{macro} % \begin{macro}{mlist_to_hlist} % \changes{v1.1l}{2020/02/02}{|pre/post_mlist_to_hlist| added} +% \changes{v1.1y}{2022/08/13}{Use shared\_callback system for pre/post/mlist_to_hlist} % To emulate these callbacks, the ``real'' |mlist_to_hlist| is replaced by a % wrapper calling the wrappers before and after. % \begin{macrocode} -callback_register("mlist_to_hlist", function(head, display_type, need_penalties) +create_callback('pre_mlist_to_hlist_filter', 'list') +create_callback('mlist_to_hlist', 'exclusive', node.mlist_to_hlist) +create_callback('post_mlist_to_hlist_filter', 'list') +function shared_callbacks.mlist_to_hlist.handler(head, display_type, need_penalties) local current = call_callback("pre_mlist_to_hlist_filter", head, display_type, need_penalties) if current == false then flush_list(head) @@ -1933,7 +1972,7 @@ callback_register("mlist_to_hlist", function(head, display_type, need_penalties) return nil end return post -end) +end % \end{macrocode} % \end{macro} % \endgroup diff --git a/Master/texmf-dist/source/latex-dev/base/ltmath.dtx b/Master/texmf-dist/source/latex-dev/base/ltmath.dtx index 1bd979f7de5..60394460f57 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltmath.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltmath.dtx @@ -38,7 +38,7 @@ %<*driver> % \fi \ProvidesFile{ltmath.dtx} - [2022/05/08 v1.2l LaTeX Kernel (Math Setup)] + [2022/09/07 v1.2m LaTeX Kernel (Math Setup)] % \iffalse %</driver> % @@ -370,9 +370,39 @@ % \begin{macrocode} \def\makesm@sh#1{% \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finsm@sh} +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/11/01}% +%<latexrelease> {\mathsm@sh}{Guard against reboxing}% \def\mathsm@sh#1#2{% - \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh} + \setbox\z@\hbox{$\m@th#1{#2}$}% +% \end{macrocode} +% The empty brace groups in front of the smashed box (which is +% placed by \cs{finsm@sh}) ensures that a \cs{smash} in math is not +% just producing a single box with its dimensions altered, but a +% box plus this second ord atom. The reason is that \TeX{} sometimes reboxes a +% box if its the only thing in a place like the denominator of a +% fraction. This would then undo the smashing and the additional +% ord atom prevents that. Two ord atoms in a row do not alter the +% horizontal spacing in a formula so this is otherwise transparent. +% \changes{v1.2m}{2022/09/03}{Guard against reboxing in fractions (gh/517)} +% \begin{macrocode} + {}\finsm@sh} % \end{macrocode} +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\mathsm@sh}{Guard against reboxing}% +%<latexrelease>\def\mathsm@sh#1#2{% +%<latexrelease> \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh} +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% % \changes{v1.2b}{2018/09/24}{Start LR-mode if necessary (git/49)} % \begin{macrocode} %</2ekernel> diff --git a/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx b/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx index c2cb8f66b36..1cbc7ab0b1b 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx @@ -37,7 +37,7 @@ %<*driver> % \fi \ProvidesFile{ltoutput.dtx} - [2022/04/03 v1.4i LaTeX Kernel (Output Routine)] + [2022/08/20 v1.4j LaTeX Kernel (Output Routine)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutput.dtx} @@ -829,6 +829,17 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \begin{macro}{\stockheight} +% \changes{v1.4j}{2022/08/20}{Register added} +% \begin{macro}{\stockwidth} +% \changes{v1.4j}{2022/08/20}{Register added} +% New |\stock|\ldots\ registers. +% \begin{macrocode} +\newdimen\stockheight +\newdimen\stockwidth +% \end{macrocode} +% \end{macro} +% \end{macro} % % \begin{macro}{\if@insert} % \begin{macro}{\if@fcolmade} diff --git a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx index 83fab820a9e..ae29c1acade 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx @@ -33,7 +33,7 @@ % % \begin{macrocode} \providecommand\ltshipoutversion{v1.0m} -\providecommand\ltshipoutdate{2022/05/08} +\providecommand\ltshipoutdate{2022/08/26} % \end{macrocode} % %<*driver> @@ -330,7 +330,7 @@ % \begin{syntax} % \cs{AtBeginDvi} \Arg{code} % \end{syntax} - % \cs{AtBeginDvi} is the existing \LaTeXe{} interface to fill the +% \cs{AtBeginDvi} is the existing \LaTeXe{} interface to fill the % \hook{shipout/firstpage} hook. This is not really a good name % as it is not just supporting \texttt{.dvi} but also \texttt{.pdf} % output or \texttt{.xdv}. diff --git a/Master/texmf-dist/source/latex-dev/base/lttextcomp.dtx b/Master/texmf-dist/source/latex-dev/base/lttextcomp.dtx index de6b221b6c5..8f5ec0d2002 100644 --- a/Master/texmf-dist/source/latex-dev/base/lttextcomp.dtx +++ b/Master/texmf-dist/source/latex-dev/base/lttextcomp.dtx @@ -37,7 +37,7 @@ % % \ProvidesFile{lttextcomp.dtx} - [2021/12/09 v1.0f LaTeX Kernel (text companion symbols)] + [2022/08/07 v1.0g LaTeX Kernel (text companion symbols)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -226,7 +226,13 @@ \@ifundefined{#1:#2}% {\@font@info{Setting #2 sub-encoding to #1/#3}}% {\@font@info{Changing #2 sub-encoding to #1/#3}}% - \@namedef{#1:#2}{#3}} +% \end{macrocode} +% This declaration should be usable in \texttt{.fd} files and +% therefore has to make its definition globally, because such files +% can get loaded in random places. +% \changes{v1.0g}{2022/08/07}{Make global declaration (gh/905)} +% \begin{macrocode} + \global\@namedef{#1:#2}{#3}} % \end{macrocode} % % Any reason to allow those in the middle of documents? diff --git a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx index 024d1078400..429ee4d8d1a 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx @@ -112,10 +112,10 @@ %</2ekernel> %<latexrelease>\edef\latexreleaseversion %<*2ekernel|latexrelease> - {2022-06-01} + {2022-11-01} %</2ekernel|latexrelease> %<*2ekernel> -\def\patch@level{-1} +\def\patch@level{-2} % \end{macrocode} % % \begin{macro}{\development@branch@name} diff --git a/Master/texmf-dist/source/latex-dev/tools/array.dtx b/Master/texmf-dist/source/latex-dev/tools/array.dtx index c9f77d77a35..4b163b5f184 100644 --- a/Master/texmf-dist/source/latex-dev/tools/array.dtx +++ b/Master/texmf-dist/source/latex-dev/tools/array.dtx @@ -33,7 +33,7 @@ %<+package>\DeclareCurrentRelease{}{2020-10-01} %<+package> %<+package>\ProvidesPackage{array} -%<+package> [2022/03/10 v2.5f Tabular extension package (FMi)] +%<+package> [2022/09/04 v2.5g Tabular extension package (FMi)] % % \fi % @@ -1727,14 +1727,20 @@ % % For that reason the new implementation does the centering % manually: First we check the height of the cell and if that is -% less or equal to =\ht\@arstrutbox= we assume that this is a +% less or equal to =\ht\strutbox= we assume that this is a % single line cell. In that case we don't do any vertical maneuvre % and simply output the box, i.e., make it behave like a single % line p-cell. +% +% We use the height of \cs{strutbox} not \cs{@arstrutbox} in the comparison, +% because \cs{box}\cs{ar@mcellbox} does not have any strut +% incorporated and if \cs{arraystretch} is made very +% small the test would otherwise incorrectly assume a multi-line cell. % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}} +% \changes{v2.5g}{2022/09/04}{Test against \cs{strutbox} height (gh/766)} % \begin{macrocode} \def\ar@align@mcell{% - \ifdim \ht\ar@mcellbox > \ht\@arstrutbox + \ifdim \ht\ar@mcellbox > \ht\strutbox % \end{macrocode} % Otherwise we realign vertically by lowering the box. The question % is how much do we need to move down? If there is any diff --git a/Master/texmf-dist/source/latex-dev/tools/verbatim.dtx b/Master/texmf-dist/source/latex-dev/tools/verbatim.dtx index c7cb2f02a9a..2018e85505d 100644 --- a/Master/texmf-dist/source/latex-dev/tools/verbatim.dtx +++ b/Master/texmf-dist/source/latex-dev/tools/verbatim.dtx @@ -55,7 +55,7 @@ \and Chris Rowley} -\date{2001/03/12} +\date{2022/07/02} \begin{document} \markboth{Verbatim style option}{Verbatim style option} \MaintainedByLaTeXTeam{tools} @@ -160,7 +160,7 @@ % that skips any commands or text between % |\begin{comment}| % and the next |\end{comment}|. -% It also defines the command \texttt{verbatiminput} to input a whole +% It also defines the command |\verbatiminput| to input a whole % file verbatim. % \end{abstract} % @@ -234,7 +234,7 @@ % % \DescribeMacro{\verbatiminput} % |\verbatiminput| is a command with one argument that inputs a file -% verbatim, i.e.\ the command |verbatiminput{xx.yy}| +% verbatim, i.e.\ the command |\verbatiminput{xx.yy}| % has the same effect as\\[2pt] % \hspace*{\MacroIndent}|\begin{verbatim}|\\ % \hspace*{\MacroIndent}\meta{Contents of the file \texttt{xx.yy}}\\ @@ -508,7 +508,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{verbatim} - [2020-07-07 v1.5u LaTeX2e package for verbatim enhancements] + [2022-07-02 v1.5u LaTeX2e package for verbatim enhancements] \@ifundefined{verbatim@@@}{}{\endinput} % \end{macrocode} % |