summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/base
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/base')
-rw-r--r--Master/texmf-dist/source/latex/base/ltclass.dtx26
-rw-r--r--Master/texmf-dist/source/latex/base/ltfilehook.dtx39
-rw-r--r--Master/texmf-dist/source/latex/base/lthooks.dtx41
-rw-r--r--Master/texmf-dist/source/latex/base/ltmiscen.dtx5
-rw-r--r--Master/texmf-dist/source/latex/base/ltvers.dtx2
5 files changed, 75 insertions, 38 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltclass.dtx b/Master/texmf-dist/source/latex/base/ltclass.dtx
index e771044e666..b639ae9410a 100644
--- a/Master/texmf-dist/source/latex/base/ltclass.dtx
+++ b/Master/texmf-dist/source/latex/base/ltclass.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltclass.dtx}
- [2020/10/08 v1.3s LaTeX Kernel (Class & Package Interface)]
+ [2020/10/18 v1.3t LaTeX Kernel (Class & Package Interface)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltclass.dtx}
@@ -943,8 +943,9 @@
\def\@pr@videpackage[#1]{%
\expandafter\protected@xdef % <-- protected...
\csname ver@\@currname.\@currext\endcsname{#1}% Loaded package
- \expandafter\protected@xdef % <-- protected...
- \csname ver@\@currpkg@reqd\endcsname{#1}% Requested package
+ \expandafter\let
+ \csname ver@\@currpkg@reqd\expandafter\endcsname % Requested package
+ \csname ver@\@currname.\@currext\endcsname
\ifx\@currext\@clsextension
\typeout{Document Class: \@gtempa\space#1}%
\else
@@ -1064,13 +1065,16 @@
% \begin{macro}{\PassOptionsToClass}
% If the package has been loaded, we check that it was first loaded with
% the options. Otherwise we add the option list to that of the package.
+% \changes{v1.3t}{2020/10/18}{Drop path from \cs{input@path} (gh/414).}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2020/10/01}{\@pass@ptions}
%<latexrelease> {Add file replacement in \@pass@ptions}%
%<*2ekernel|latexrelease>
\def\@pass@ptions#1#2#3{%
- \edef\reserved@a{\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+ \@expl@@@filehook@set@curr@file@@nNN
+ {\@expl@@@filehook@resolve@file@subst@@w #3.#1\@nil}%
+ \reserved@a\reserved@b
\expandafter\xdef\csname opt@\reserved@a\endcsname{%
\@ifundefined{opt@\reserved@a}\@empty
{\csname opt@\reserved@a\endcsname,}%
@@ -1801,7 +1805,13 @@
% \cs{@currext} are used we lose track of the substitution, so
% \cs{CurrentFile} and \cs{CurrentFileUsed} will be (incorrectly)
% the same.
+%
+% \changes{v1.3t}{2020-10-11}{Restore \cs{@currpkg@reqd} after
+% finished loading a package file (gh/408).}
% \begin{macrocode}
+ \expandafter\@swaptwoargs\expandafter
+ {\expandafter{\@currpkg@reqd}}%
+ {% <
\edef\@currpkg@reqd{\@currname.\@currext}%
\ifx\CurrentFile\CurrentFileUsed
\else
@@ -1810,6 +1820,8 @@
\edef\@currext{\string@makeletter\filename@ext}%
\fi
\load@onefile@withoptions{#2}%
+ \def\@currpkg@reqd%{\@currpkg@reqd}
+ }% >
% \end{macrocode}
% Now just clean up and exit.
% \begin{macrocode}
@@ -1836,7 +1848,11 @@
\@popfilename
\@reset@ptions}
% \end{macrocode}
-%
+%
+% \begin{macrocode}
+\let\@currpkg@reqd\@empty
+% \end{macrocode}
+%
% \begin{macrocode}
\@onlypreamble\@onefilewithoptions
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/base/ltfilehook.dtx b/Master/texmf-dist/source/latex/base/ltfilehook.dtx
index 24ba88f576c..ecb499f3475 100644
--- a/Master/texmf-dist/source/latex/base/ltfilehook.dtx
+++ b/Master/texmf-dist/source/latex/base/ltfilehook.dtx
@@ -31,8 +31,8 @@
%%% From File: ltfilehook.dtx
%
% \begin{macrocode}
-\providecommand\ltfilehookversion{v1.0b}
-\providecommand\ltfilehookdate{2020/09/26}
+\providecommand\ltfilehookversion{v1.0c}
+\providecommand\ltfilehookdate{2020/10/18}
% \end{macrocode}
%
%<*driver>
@@ -840,7 +840,7 @@
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\declare@file@substitution}{File substitution}%
\ExplSyntaxOn
-\cs_new_eq:NN \declare@file@substitution \@@_subst_add:nn
+\cs_new_eq:NN \declare@file@substitution \@@_subst_add:nn
\cs_new_eq:NN \undeclare@file@substitution \@@_subst_remove:n
\ExplSyntaxOff
%</2ekernel|latexrelease>
@@ -872,8 +872,8 @@
%
% \begin{macro}{\set@curr@file,\@curr@file,\@curr@file@reqd}
% Now we hook into \cs{set@curr@file} to resolve a possible file
-% substitution, and add \cs{@expl@@@filehook@set@curr@file@@N} at the end, after
-% \cs{@curr@file} is set.
+% substitution, and add \cs{@expl@@@filehook@set@curr@file@@nNN}
+% at the end, after \cs{@curr@file} is set.
%
% A file name is built using
% \cs{expandafter}\cs{string}\cs{csname}\meta{filename}\cs{endcsname}
@@ -987,24 +987,24 @@
.tex\else\string#1\fi}
% \end{macrocode}
%
-% Then we call \cs{@expl@@@filehook@set@curr@file@@N} once for \cs{@curr@file}
-% to set \cs[no-index]{CurrentFile(Path)Used} and once for
+% Then we call \cs{@expl@@@filehook@set@curr@file@@nNN} once for
+% \cs{@curr@file} to set \cs[no-index]{CurrentFile(Path)Used} and once for
% \cs{@curr@file@reqd} to set \cs[no-index]{CurrentFile(Path)}.
% Here too the slower route is only used if a substitution happened,
-% but here \cs{@expl@@@filehook@if@file@replaced@@TF} can't be used because the
-% flag is reset at the \cs{endgroup} above, so we check if
+% but here \cs{@expl@@@filehook@if@file@replaced@@TF} can't be used because
+% the flag is reset at the \cs{endgroup} above, so we check if
% \cs{@curr@file} and \cs{@curr@file@reqd} differ. This macro is
% issued separate from \cs{set@curr@file} because it changes
% \cs{CurrentFile}, and side-effects would quickly get out of control.
% \begin{macrocode}
\def\@filehook@set@CurrentFile{%
- \@expl@@@filehook@set@curr@file@@N{\@curr@file}%
+ \@expl@@@filehook@set@curr@file@@nNN{\@curr@file}%
\CurrentFileUsed\CurrentFilePathUsed
\ifx\@curr@file@reqd\@curr@file
\let\CurrentFile\CurrentFileUsed
\let\CurrentFilePath\CurrentFilePathUsed
\else
- \@expl@@@filehook@set@curr@file@@N{\@curr@file@reqd}%
+ \@expl@@@filehook@set@curr@file@@nNN{\@curr@file@reqd}%
\CurrentFile\CurrentFilePath
\fi}
%</2ekernel|latexrelease>
@@ -1016,8 +1016,7 @@
%
%
%
-% \begin{macro}{\@@_set_curr_file:N,
-% \@@_set_curr_file:nNN,
+% \begin{macro}{\@@_set_curr_file:nNN,
% \@@_set_curr_file_assign:nnnNN}
% When inputting a file, \cs{set@curr@file} does a file lookup
% (in \cs{input@path} and \cs{l_file_search_path_seq}) and returns the
@@ -1032,17 +1031,12 @@
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease> {@@_set_curr_file:N}{Set curr file}%
+%<latexrelease> {@@_set_curr_file:nNN}{Set curr file}%
\ExplSyntaxOn
%<@@=filehook>
-\cs_new_protected:Npn \@@_set_curr_file:N #1
- { \exp_args:NV \@@_set_curr_file:nNN #1 }
-% \end{macrocode}
-%
-% \begin{macrocode}
\cs_new_protected:Npn \@@_set_curr_file:nNN #1
{
- \@@_file_parse_full_name:nN {#1}
+ \exp_args:Nf \@@_file_parse_full_name:nN {#1}
\@@_set_curr_file_assign:nnnNN
}
\cs_new_protected:Npn \@@_set_curr_file_assign:nnnNN #1 #2 #3 #4 #5
@@ -1331,8 +1325,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_eq:NN \@expl@@@filehook@set@curr@file@@N
- \__filehook_set_curr_file:N
+\cs_new_eq:NN \@expl@@@filehook@set@curr@file@@nNN
+ \__filehook_set_curr_file:nNN
% \end{macrocode}
%
% \begin{macrocode}
@@ -1348,7 +1342,6 @@
% \begin{macrocode}
\cs_new_eq:NN \@expl@@@filehook@if@file@replaced@@TF
\__filehook_if_file_replaced:TF
-
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/base/lthooks.dtx b/Master/texmf-dist/source/latex/base/lthooks.dtx
index a5953cc25dd..e4ff7dd2ed4 100644
--- a/Master/texmf-dist/source/latex/base/lthooks.dtx
+++ b/Master/texmf-dist/source/latex/base/lthooks.dtx
@@ -31,8 +31,8 @@
%%% From File: lthooks.dtx
%
% \begin{macrocode}
-\def\lthooksversion{v1.0d}
-\def\lthooksdate{2020/10/09}
+\def\lthooksversion{v1.0e}
+\def\lthooksdate{2020/10/23}
% \end{macrocode}
%
%<*driver>
@@ -1084,6 +1084,7 @@
%
% \subsection{Difference between \enquote{normal} and
% \enquote{one-time} hooks}
+% \label{sec:onetime-hooks}
%
% When executing a hook a developer has the choice of using
% either \cs{UseHook} or \cs{UseOneTimeHook} (or their \pkg{expl3}
@@ -1182,6 +1183,11 @@
%
% \subsection{Legacy \LaTeXe{} interfaces}
%
+% \newcommand\onetimetext{%
+% This is a one-time hook, so after it is executed, all further
+% attempts to add code to it will execute such code immediately
+% (see section~\ref{sec:onetime-hooks}).}
+%
% \LaTeXe{} offered a small number of hooks together with commands to
% add to them. They are listed here and are retained for backwards
% compatibility.
@@ -1211,6 +1217,14 @@
% \cs{AddToHook} \texttt{\{begindocument\}} \oarg{label}
% \Arg{code}.
%
+% \cs{AtBeginDocument} is a wrapper around the \hook{begindocument}
+% hook (see section~\ref{sec:begindocument-hooks}), which is a
+% one-time hook. As such, after the \hook{begindocument} hook is
+% executed at \verb=\begin{document}= any attempt to add \meta{code}
+% to this hook with \cs{AtBeginDocument} or with \cs{AddToHook} will
+% cause that \meta{code} to execute immediately instead.
+% See section~\ref{sec:onetime-hooks} for more on one-time hooks.
+%
% For important packages with known order requirement we may over
% time add rules to the kernel (or to those packages) so that they
% work regardless of the loading-order in the document.
@@ -1345,9 +1359,9 @@
% \end{function}
%
%
-%
%
% \subsubsection{Hooks provided by \cs{begin}\texttt{\{document\}}}
+% \label{sec:begindocument-hooks}
%
% Until 2020 \cs{begin}\texttt{\{document\}} offered exactly one
% hook that one could add to using
@@ -1370,12 +1384,12 @@
% section and this is how it is used by \pkg{etoolbox}'s
% \cs{AtEndPreamble}.
%
-%
+% \onetimetext
%
% \item[\hook{begindocument}]
%
-% This hook is added to when using \cs{AtBeginDocument} and it is executed
-% after the \texttt{.aux} file as be read in and most
+% This hook is added to when using \cs{AtBeginDocument} and it is
+% executed after the \texttt{.aux} file as be read in and most
% initialization are done, so they can be altered and inspected by
% the hook code. It is followed by a small number of further
% initializations that shouldn't be altered and are therefore
@@ -1386,12 +1400,16 @@
% document body. If such material needs to be added to the document
% body use the next hook instead.
%
+% \onetimetext
+%
% \item[\hook{begindocument/end}]
%
% This hook is executed at the end of the \cs{document} code in
% other words at the beginning of the document body. The only
% command that follows it is \cs{ignorespaces}.
%
+% \onetimetext
+%
% \end{description}
% The generic hooks executed by \cs{begin} also exist, i.e.,
% \hook{env/document/before} and \hook{env/document/begin}, but
@@ -1432,6 +1450,7 @@
% called to ensure that all such material gets typeset. If there
% is nothing waiting the \cs{clearpage} has no effect.
%
+% \onetimetext
%
% \item[\hook{enddocument/afterlastpage}]
%
@@ -1448,6 +1467,8 @@
% closed for writing and then read back in to do some tests
% (e.g., looking for missing references or duplicated labels, etc.).
%
+% \onetimetext
+%
% \item[\hook{enddocument/afteraux}]
%
% At this point, the \texttt{.aux} file has been reprocessed and so
@@ -1456,6 +1477,8 @@
% prefer the next hook, so that your information is displayed after the
% (possibly longish) list of files if that got requested via \cs{listfiles}.
%
+% \onetimetext
+%
% \item[\hook{enddocument/info}]
%
% This hook is meant to receive code that write final information
@@ -1470,11 +1493,15 @@
% \cs{listfiles} has been used and the warnings for duplicate
% labels, missing references, font substitutions etc.
%
+% \onetimetext
+%
% \item[\hook{enddocument/end}]
%
% Finally, this hook is executed just in front of the final call
% to \cs{@{}@end}.
%
+% \onetimetext % is it even possible to add code after this one?
+%
% \end{description}
%
%
@@ -3314,7 +3341,7 @@
\cs_new_protected:Npn \@@_log:nN #1 #2
{
\@@_preamble_hook:n {#1}
- \iow_term:x { ^^J ->~The~hook~'#1': }
+ \@@_log_cmd:x { ^^J ->~The~hook~'#1': }
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/base/ltmiscen.dtx b/Master/texmf-dist/source/latex/base/ltmiscen.dtx
index 0c115d3be1b..9acbcccd683 100644
--- a/Master/texmf-dist/source/latex/base/ltmiscen.dtx
+++ b/Master/texmf-dist/source/latex/base/ltmiscen.dtx
@@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{ltmiscen.dtx}
- [2020/08/21 v1.1v LaTeX Kernel (Misc. Environments)]
+ [2020/10/23 v1.1w LaTeX Kernel (Misc. Environments)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltmiscen.dtx}
@@ -239,13 +239,14 @@
% \changes{v1.1k}{2010/08/17}{Use braces around \cs{input} arg (pr/4124)}
% \changes{v1.1l}{2010/08/17}{Change of plan: use \cs{@@input} instead
% (pr/4124)}
+% \changes{v1.1w}{2020/10/23}{Make \texttt{enddocument/afteraux} one-time}
% We use |\@@input| to load the \texttt{.aux} file, so that it doesn't
% show up in the list of files produced by |\listfiles|.
% \begin{macrocode}
\@tempswafalse
\makeatletter \@@input\jobname.aux
\fi
- \UseHook{enddocument/afteraux}%
+ \UseOneTimeHook{enddocument/afteraux}%
% \end{macrocode}
% Next hook is expect to contain only code for writing info
% messages on the terminal.
diff --git a/Master/texmf-dist/source/latex/base/ltvers.dtx b/Master/texmf-dist/source/latex/base/ltvers.dtx
index fcd722b0e88..dd69d5a6e35 100644
--- a/Master/texmf-dist/source/latex/base/ltvers.dtx
+++ b/Master/texmf-dist/source/latex/base/ltvers.dtx
@@ -115,7 +115,7 @@
{2020-10-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{1}
+\def\patch@level{2}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}