From ef57fc77f3c939d55d51322d428e40a5a3c9ed8e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 10 Jan 2021 03:01:42 +0000 Subject: CTAN sync 202101100301 --- macros/latex-dev/base/ltexpl.dtx | 127 ++++++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 23 deletions(-) (limited to 'macros/latex-dev/base/ltexpl.dtx') diff --git a/macros/latex-dev/base/ltexpl.dtx b/macros/latex-dev/base/ltexpl.dtx index 4100da79c2..b642fd72a3 100644 --- a/macros/latex-dev/base/ltexpl.dtx +++ b/macros/latex-dev/base/ltexpl.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2019-2020 +% Copyright (C) 2019-2021 % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltexpl.dtx} - [2020/09/06 v1.2f LaTeX Kernel (expl3-dependent code)] + [2020/12/18 v1.2h LaTeX Kernel (expl3-dependent code)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltexpl.dtx} @@ -72,16 +72,45 @@ % {Define a local version of some \LaTeXe{} basic macros to support % package loading} % +% \begin{macro}{\@kernel@after@enddocument, +% \@kernel@after@enddocument@afterlastpage} +% These two kernel hooks are used by the shipout code. They are +% defined earlier here because the \pkg{lthooks} code adds material +% to them. +% \changes{v1.2h}{2020/12/18} +% {Define kernel \cs{enddocument} hooks early} +% \begin{macrocode} +%<*2ekernel|latexrelease> +%\IncludeInRelease{2020/10/01}% +% {kernel@enddocument hooks}{Define kernel enddocument Hooks}% +\let\@kernel@after@enddocument\@empty +\let\@kernel@after@enddocument@afterlastpage\@empty +%\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%\IncludeInRelease{0000/00/00}% +% {kernel@enddocument hooks}{Define kernel enddocument Hooks}% +%\let\@kernel@after@enddocument\@undefined +%\let\@kernel@after@enddocument@afterlastpage\@undefined +%\EndIncludeInRelease +% +% \end{macrocode} +% \end{macro} +% % First define some blank commands, so that in case something goes wrong while % loading \textsf{expl3}, we won't get strange \texttt{Undefined control % sequence} errors. % \begin{macrocode} -%<*2ekernel> +%<*2ekernel|latexrelease> +%\IncludeInRelease{2020/10/01}% +% {\@expl@sys@load@backend@@}{Roll forward support}% \def\@expl@sys@load@backend@@{} \def\@expl@push@filename@@{} \def\@expl@push@filename@aux@@{} \def\@expl@pop@filename@@{} -% +%\EndIncludeInRelease +% % \end{macrocode} % % \changes{v1.2d}{2020/07/08} @@ -183,9 +212,20 @@ \errmessage{LaTeX requires expl3}% \batchmode \read -1 to \reserved@a % +% \end{macrocode} +% We do not support a roll forward across 2019. You need to start +% with 2019 if you want to get to 2020 or beyond. +% \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)} +% \begin{macrocode} %<*latexrelease> - \@latex@error{LaTeX requires expl3}\@ehd - \@gobble + \@latex@warning@no@line + {You need a format that already contains a recent\MessageBreak + expl3 as part of the kernel, e.g. at least a kernel\MessageBreak + from 2019 to roll forward to that date!\MessageBreak + --- I'm giving up!\MessageBreak\MessageBreak + Note that manually loading the expl3 package\MessageBreak + from your distribution is not enough}% + \@@end % die % }% {% @@ -222,9 +262,39 @@ %\EndIncludeInRelease % \end{macrocode} % +% +% Starting with 2020-10 the kernel contains most of the +% \texttt{xparse} interfaces loaded above. These interfaces are +% later used to define various user command. However, if somebody +% with an earlier installation tries to roll forward (using a +% \texttt{latexrelease} package from a newer release) this will not +% work as the earlier kernel doesn't contain commands such as +% \cs{NewDocumentCommand}. +% +% We therefore add code into \texttt{latexrelease.sty} to load the +% \texttt{xparse} package of the current installation instead. this +% may not work if the installation is really old, but roll forward +% can't do miracles. +% +% If the kernel is 2020-10 or later \cs{NewDocumentCommand} is +% already known (whether or not you roll forward or back) so +% nothing happens, but if you start from am earlier kernel the +% \texttt{xparse} package gets loaded by \texttt{latexrelease}. +% \changes{v1.2g}{2020/11/24}{Load xparse in latexrelease if needed (gh/434)} +% \begin{macrocode} +%\IncludeInRelease{2020/10/01}% +% {\NewDocumentCommand}{Emergency loading xparse}% +% +%\ifdefined\NewDocumentCommand \else +% \RequirePackage{xparse} +%\fi +% +%\EndIncludeInRelease +% \end{macrocode} +% % \subsection{Using expl3 code} % -% In order to ease the implemantation of some new features in +% In order to ease the implementation of some new features in % \LaTeXe\ we may (temporarily) use some coding based on the % \pkg{expl3}-code. % Such macros will eventually vanish and may be changed @@ -242,9 +312,6 @@ % if that \pkg{expl3} command is needed in places that are others % coded in \LaTeXe{} conventions. % -% \begin{macrocode} -\ExplSyntaxOn -% \end{macrocode} % % In this file, each release of LaTeX adds an \cs{IncludeInRelease} % block, in which the macros copied for that release were defined. @@ -259,8 +326,16 @@ % redefinitions. % % \begin{macrocode} -%\IncludeInRelease{2020/10/01}{expl3~2020-10-01}% -% {expl3~macros~added~for~the~2020-10-01~release}% +%\IncludeInRelease{2020/10/01}{\@expl@cs@to@str@@N}% +% {expl3 macros added for the 2020-10-01 release}% +% \end{macrocode} +% +% The expl3 activation needs to be inside the release guards as +% otherwise rolling forward is broken in old kernels that do not +% have expl3 loaded. +% \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)} +% \begin{macrocode} +\ExplSyntaxOn % \end{macrocode} % % \changes{v1.2e}{2020/08/19} @@ -290,21 +365,27 @@ % \end{macrocode} % % \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% +% Here we can't assume that expl3 is available. It will be if we +% roll back but if this code is executed rolling forward it needs +% to be pure 2e. +% \changes{v1.2g}{2020/11/24}{Support for roll forward (gh/434)} +% \begin{macrocode} %\EndIncludeInRelease -%\IncludeInRelease{0000/00/00}{expl3~2020-10-01}% -% {expl3~macros~added~for~the~2020-10-01~release}% -%\cs_undefine:N \@expl@cs@to@str@@N -%\cs_undefine:N \@expl@str@if@eq@@nnTF -%\cs_undefine:N \@expl@cs@prefix@spec@@N -%\cs_undefine:N \@expl@cs@argument@spec@@N -%\cs_undefine:N \@expl@cs@replacement@spec@@N -%\cs_undefine:N \@expl@str@map@function@@NN +%\IncludeInRelease{0000/00/00}{\@expl@cs@to@str@@N}% +% {expl3 macros added for the 2020-10-01 release}% +%\let \@expl@cs@to@str@@N \@undefined +%\let \@expl@str@if@eq@@nnTF \@undefined +%\let \@expl@cs@prefix@spec@@N \@undefined +%\let \@expl@cs@argument@spec@@N \@undefined +%\let \@expl@cs@replacement@spec@@N \@undefined +%\let \@expl@str@map@function@@NN \@undefined %\EndIncludeInRelease % % \end{macrocode} % -% \begin{macrocode} -\ExplSyntaxOff -% \end{macrocode} % % \Finale -- cgit v1.2.3