diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-20 20:07:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-20 20:07:55 +0000 |
commit | e024a58f1f127a9723f5e381efcedead06cb0373 (patch) | |
tree | 1b3e7814df155c17969f6612176e523b64238809 | |
parent | d291f73c830f767b003eabd72656e171ef0e4597 (diff) |
latex-dev (20sep21)
git-svn-id: svn://tug.org/texlive/trunk@60566 c570f23f-e606-0410-a88d-b1316a301751
236 files changed, 6277 insertions, 1951 deletions
diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/README.md b/Master/texmf-dist/doc/latex-dev/amsmath/README.md index 40541978833..48f1e27234c 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/README.md +++ b/Master/texmf-dist/doc/latex-dev/amsmath/README.md @@ -1,7 +1,7 @@ The amsmath bundle for LaTeX ============================ -Release 2021-11-15 pre-release 1 +Release 2021-11-15 pre-release 2 Overview -------- @@ -12,7 +12,7 @@ developed by the American Mathematical Society (AMS) and released for general use as a service to the mathematical community. A number of smaller auxiliary packages are also distributed with the `amsmath` package. -Effective in 2016, maintenance of `amsmath was transferred from AMS to +Effective in 2016, maintenance of `amsmath` was transferred from AMS to the LaTeX Project; as `amsmath` is considered a "required" package, this centralizes control over the core LaTeX components. @@ -28,7 +28,7 @@ Release distribution is carried out only through the CTAN archives. Documentation ------------- -The primary documentation for `amsmath` is in provided as `amsldoc.pdf`. +The primary documentation for `amsmath` is provided as `amsldoc.pdf`. Additional documentation files include: diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsbsy.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsbsy.pdf Binary files differindex 9766310c661..b85ad28df05 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsbsy.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsbsy.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amscd.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amscd.pdf Binary files differindex ef305b0d627..23a47f71d6b 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amscd.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amscd.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsgen.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsgen.pdf Binary files differindex 1872ad8fe18..b5dda96a10d 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsgen.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsgen.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.pdf Binary files differindex caf0dffb06e..38f627d41de 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.tex b/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.tex index 26ea6cf8088..97294772e7a 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.tex +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsldoc.tex @@ -69,6 +69,11 @@ Bug reports can be opened (category \texttt{#1}) at\\% \def\@thanks{\bigskip\MaintainedByLaTeXTeam{amslatex}} \makeatother +% Very minor changes are not listed in the \date above: +% +% 2021-08-22: reported typo fixed mathools -> mathtools + + % Use the amsmath package and amscd package in order to print % examples. \usepackage{amsmath} @@ -1616,7 +1621,7 @@ bar symbols: \end{verbatim} whereupon the document would contain |\abs{z}| to produce $\lvert z\rvert$ and |\norm{v}| to produce $\lVert v\rVert$. -The \pkg{mathools} provides the command \cn{DeclarePairedDelimiter} +The \pkg{mathtools} provides the command \cn{DeclarePairedDelimiter} for defining |\abs|-like macros with scaling delimiters. \index{delimiters|)} diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsmath.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsmath.pdf Binary files differindex 7bce876d7ba..e845d543870 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsmath.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsmath.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsopn.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsopn.pdf Binary files differindex 4665ba523bc..bc4a3590d9b 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsopn.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsopn.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amstext.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amstext.pdf Binary files differindex a612a817cf1..d3d5dbf0935 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amstext.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amstext.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/amsxtra.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/amsxtra.pdf Binary files differindex 2005cf88435..485d56d23e1 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/amsxtra.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/amsxtra.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/changes.txt b/Master/texmf-dist/doc/latex-dev/amsmath/changes.txt index 63bea7e7275..a07a5cee267 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/amsmath/changes.txt @@ -2,6 +2,11 @@ All changes above are only part of the development branch for the next release. ================================================================================ +2021-08-24 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + * amsmath.dtx (subsection{Implementing tags and labels}): + move \incr@eqnum inside the equation if fleqn isn't used and guard + it with a mathopen for better compability with hyperref, issue gh/652 + ######################### # 2021-06-01 Release ######################### diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/subeqn.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/subeqn.pdf Binary files differindex 9b600cf7e66..88db5466cd8 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/subeqn.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/subeqn.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/technote.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/technote.pdf Binary files differindex dc43245376d..73fafa5f809 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/technote.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/technote.pdf diff --git a/Master/texmf-dist/doc/latex-dev/amsmath/testmath.pdf b/Master/texmf-dist/doc/latex-dev/amsmath/testmath.pdf Binary files differindex 3376cc99586..811bb8be8b9 100644 --- a/Master/texmf-dist/doc/latex-dev/amsmath/testmath.pdf +++ b/Master/texmf-dist/doc/latex-dev/amsmath/testmath.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/README.md b/Master/texmf-dist/doc/latex-dev/base/README.md index cb626b79db5..ae8444f5dd3 100644 --- a/Master/texmf-dist/doc/latex-dev/base/README.md +++ b/Master/texmf-dist/doc/latex-dev/base/README.md @@ -1,7 +1,7 @@ The LaTeX kernel ================ -Release 2021-11-15 pre-release 1 +Release 2021-11-15 pre-release 2 Overview -------- diff --git a/Master/texmf-dist/doc/latex-dev/base/alltt.pdf b/Master/texmf-dist/doc/latex-dev/base/alltt.pdf Binary files differindex 22f9cff11c8..637e33bf8bb 100644 --- a/Master/texmf-dist/doc/latex-dev/base/alltt.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/alltt.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf b/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf Binary files differindex 5a8bf4282c1..cc8ced07f76 100644 --- a/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/cfgguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/changes.txt b/Master/texmf-dist/doc/latex-dev/base/changes.txt index dfd7a9609f2..50f916b2332 100644 --- a/Master/texmf-dist/doc/latex-dev/base/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/base/changes.txt @@ -6,6 +6,182 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ================================================================================ +2021-09-18 David Carlisle <David.Carlisle@latex-project.org> + + * ltpara.dtx: use a \hskip rather than \kern as the guard to + prevent more than one glue item being removed when the primitive + par is called twice to process the end of paragraph hooks. + +2021-09-12 David Carlisle <David.Carlisle@latex-project.org> + + * ltfntcmd.dtx: guard definition in \text@command with \unexpanded (gh/665) + +2021-09-12 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltoutenc.dtx (subsection{Definitions for the OT1 encoding}): + Move zero skip between i and j for hyphenation (gh/658) + +2021-09-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfssini.dtx: + Improve handling of legacy changes to \bfdefault or \mddefault in + relation to \DeclareFontSeriesDefault setting (gh/663) + +2021-09-06 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfinal.dtx (subsection{Lccodes and uccodes}): + Correctly upper and lowercase \ij and \IJ (gh/658) + +2021-08-30 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx (subsection{Using the hook}): + Clean up after \UseOneTimeHook and prevent a second usage (gh/606). + +2021-08-30 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmd.dtx (subsubsection{Copying a command and its internal structure}): + Add support for copying and showing ltcmd commands (gh/569). + +2021-08-27 Joseph Wright <Joseph.Wright@latex-project.org> + + * ltfilehook.dtx: + Use \msg_... instead of \__kernel_msg... commands for normalized + error and warning commands. + + * ltfilehooks.dtx, lthooks.dtx, ltpara.dtx: + Internal changes to message names + + * ltcmd.dtx: + Check for end-of-enviroment commands + +2021-08-25 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx, ltcmdhooks.dtx, ltfilehook.dtx, ltclass.dtx, ltfiles.dtx: + Standardise generic hook names (gh/648). + +2021-08-20 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * lthooks.dtx: + Documentation updates for generic hook commands (gh/638). + + Deprecate \hook_disable:n, \hook_provide:n, + \hook_provide_reversed:n, \hook_provide_pair:nn, + \DisableHook, \ProvideHook, \ProvideReversedHook, + and \ProvideMirroredHookPair. + + Instead: \hook_activate_generic:n, \hook_disable_generic:n, + \ActivateGenericHook and \DisableGenericHook. + + * lterror.dtx (subsection{Specific errors}): + Improve \@badend error message (gh/587) + +2021-08-12 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * lthooks.dtx (subsubsection{Generic hooks for all environments}): + Fixed documentation of \AtBeginEnvironment and friends + -- was missing the main "env" argument (gh/646) + +2021-08-11 Marcel Krüger <Marcel.Krueger@latex-project.org> + + * ltluatex.dtx: + Define missing local copy of flush_list in ltluatex.lua found + by Michal Vlasák. + +2021-08-10 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltvers.dtx (section{Version Identification}): + Throw an error when a date 0000/00/00 is misused in \IncludeInRelease. + +2021-08-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfinal.dtx (subsection{Prepare for suporting PDF management in backends}): + Default definition for \IfPDFManagementActiveTF added (gh/640) + +2021-08-07 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmd.dtx (subsection{Setting up a standard signature}): + Replicate argument processors for all embellishments (gh/639). + +2021-07-31 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltoutput.dtx (subsubsection{Float control}): + Add \ShowFloat to fltrace.sty so that you can easily display the + contents of a float register, argument is just the uppercase + letter (or letters or numbers) denoting the register. + +2021-07-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltsect.dtx (section| or |\caption|): + \contentsline now picks up all four arguments and doesn't rely on + the fourth being empty (gh/633) + +2021-07-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * lthooks.dtx: + Some clarification on hook command behavior. + Commands \ClearHookNext and \hook_gclear_next_code:n added (gh/565) + +2021-07-23 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltclass.dtx (section{Implementation}): + Make class/.../name one-time hooks; + Make package/.../name one-time hooks (gh/626) + + * ltfiles.dtx (section{File Handling}): + Make include/.../name one-time hooks (gh/626) + +2021-07-23 Marcel Krüger <marcel.krueger@latex-project.org> + + * tulm.fdd: + For Unicode engines, use OpenType version of Latin Modern Upright Italic. + +2021-07-20 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx: + Simplify \RemoveFromHook to not queue the removal of code chunks + that aren't yet in the hook (gh/625). + +2021-07-20 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmdhooks.dtx: + Fix usage of \@if@newcommand when patching a robust command (gh/623). + +2021-07-19 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltclass.dtx: Provide public names: + \IfPackageLoadedTF, \IfPackageLoadedWithOptionsTF, + \IfClassLoadedTF, \IfClassLoadedWithOptionsTF. + + Drop \@onlypremable restriction for several commands. + +2021-07-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltplain.dtx (section{Plain \TeX}): + Use 2 as value for \tracinglostchars so that one gets at least warnings + on the terminal (3 would be better as a missing char is an error) + +2021-07-12 David Carlisle <David.Carlisle@latex-project.org> + + * ltclass.dtx: fix for gh/617 prevent expansion in raw option list. + +2021-07-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * lterror.dtx (subsection{General commands}): + Provide \ClassNote and \PackageNote that write information to the + terminal but labels it as "Info" and not as "Warning", i.e. a cross + between \PackageWarning and \PackageInfo + +2021-07-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltcounts.dtx (subsection{Environment Counter Macros}): + New implementation for \counterwithout and \counterwithin + with an additional optional arg so it becomes a drop-in + replacement for amsmath \numberwithin + +2021-06-21 David Carlisle <David.Carlisle@latex-project.org> + + * base/utf8ienc.dtx: additional characters for gh/593 + 2021-06-09 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * ltshipout.dtx: diff --git a/Master/texmf-dist/doc/latex-dev/base/classes.pdf b/Master/texmf-dist/doc/latex-dev/base/classes.pdf Binary files differindex 40f0cef13e0..937b11968eb 100644 --- a/Master/texmf-dist/doc/latex-dev/base/classes.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/classes.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf b/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf Binary files differindex 9f39397b24a..4d049fe5401 100644 --- a/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/clsguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf b/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf Binary files differindex d1707408add..bdb26b26721 100644 --- a/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/cmfonts.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf b/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf Binary files differindex 6b9ed561eac..5fca8b39535 100644 --- a/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/cyrguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/doc.pdf b/Master/texmf-dist/doc/latex-dev/base/doc.pdf Binary files differindex b5254608ea7..60f15ff69f9 100644 --- a/Master/texmf-dist/doc/latex-dev/base/doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf b/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf Binary files differindex 08224e2a4c4..325df35eb6e 100644 --- a/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/docstrip.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/encguide.pdf b/Master/texmf-dist/doc/latex-dev/base/encguide.pdf Binary files differindex 30aad2cd6c5..98a03a7bb16 100644 --- a/Master/texmf-dist/doc/latex-dev/base/encguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/encguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/exscale.pdf b/Master/texmf-dist/doc/latex-dev/base/exscale.pdf Binary files differindex 9785c78a4dd..e00c839154f 100644 --- a/Master/texmf-dist/doc/latex-dev/base/exscale.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/exscale.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf b/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf Binary files differindex d3e32f16782..cc3df9f5db8 100644 --- a/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/fix-cm.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf b/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf Binary files differindex d1da1e3f195..976d3064138 100644 --- a/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/fntguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf b/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf Binary files differindex 7d65e21df66..bc9c7853989 100644 --- a/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/graphpap.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf b/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf Binary files differindex 289b5c7f370..a291da6184c 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ifthen.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf b/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf Binary files differindex 64c99acc9a1..d8a2f584ed1 100644 --- a/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/inputenc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/manual.err b/Master/texmf-dist/doc/latex-dev/base/lamport-manual.err index c6ea889ed38..1f72c349383 100644 --- a/Master/texmf-dist/doc/latex-dev/base/manual.err +++ b/Master/texmf-dist/doc/latex-dev/base/lamport-manual.err @@ -19,7 +19,7 @@ \def\ypmd{% % % % % % - Last modified on Sat 13 October 2018 at 12:56:41 PST by lamport % + Last modified on Thu 5 August 2021 at 12:56:59 PST by lamport % endypmd} % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -56,7 +56,7 @@ Please report any additional errors to The \LaTeX\ Project at Replace \verb|{\em all\/}| by \verb|\emph{all}|. \reportedby{Rosemary Bailey}{29 Aug 1994} -\erratum{page 28, first paragraph} +\erratum{page 28, first paragraph} Not an error, but it would be helpful to add the following sentence to the end of that paragraph: ``(If a declaration has arguments, they become additional @@ -78,7 +78,7 @@ Change \verb|{\em ...}| to \verb|\emph{...}| \erratum{page 101} This is not an error, but some readers will find it helpful if, in the descriptions of \verb|\setlength| and \verb|\addtolength|, -\verb|\gnat| were replaced by \verb|\parskip|. +\verb|\gnat| were replaced by \verb|\parskip|. \reportedby{Ellen Gilkerson}{9 Aug 1994} \erratum{page 108, lines 7 and 10} @@ -152,7 +152,7 @@ Change ``\verb|\resettime|'' to ``\verb|\settime|''. \erratum{page 84, after line $11$} Add the following sentence: ``The \hbox{\verb|\onlyslides|} and \hbox{\verb|\onlynotes|} commands may not work right if a \texttt{slide}, \texttt{overlay}, or \texttt{note} -environment appears in the argument of any command.'' +environment appears in the argument of any command.'' \reportedby{Eike Ritter}{May 1996} \erratum{page 153, line 1} @@ -163,11 +163,11 @@ Add ``or subentry'' after ``entry''. Add the following before line $-4$: \begin{description} \item[\mytt \bs columnwidth] -Normal width +Normal width \cindex{columnwidth}% of a column; -% \index{column!width}% - \index{width!of column}% +% \index{column!width}% + \index{width!of column}% equals \verb|\textwidth| except for multiple-column styles. Its value should not be changed with the length-setting commands. \end{description} @@ -175,7 +175,7 @@ Also, in line $-4$, change \verb|\textwidth| to \verb|\columnwidth|. %\reportedby{Volker Kuhlmav}{20 Jan 1995} \reportedby{Rosemary Bailey}{9 Sep 1994} -\erratum{page 180, lines 15--19} +\erratum{page 180, lines 15--19} % Replace these five lines (which begin ``These commands are overridden'') with: @@ -194,7 +194,7 @@ command immediately after the sectioning command. \end{itemize} \reportedby{Jerome Breitenbach}{14 Dec 1995} -\erratum{page 182} +\erratum{page 182} The dimensions \verb|\pageheight| and \verb|\pagewidth| should be \verb|\paperheight| and \verb|\paperwidth|, @@ -222,7 +222,7 @@ These declarations may not be used in math mode. Replace lines 16-19 (beginning ``None of these commands'') with \begin{quote} When these commands are used in math mode, the \emph{text} -argument is processed in LR mode. +argument is processed in LR mode. These commands and declarations are robust. Words typeset in typewriter style are not hyphenated except where permitted by \verb|\-| @@ -253,21 +253,21 @@ Change ``through a symbol'' by ``through a relation symbol''. \erratum{page 137} This is not an error, but it would be better to change lines 23 and 24 to: \begin{quote} -\LaTeX\ +\LaTeX\ \index{file!not found error}% \index{file!nonexistent}% is trying to read a file that apparently doesn't exist. If the missing file has the extension \texttt{tex}, then \LaTeX\ is trying to \index{input)@\verb+\input+!of nonexistent file}% \index{include)@\verb+\include+!of nonexistent file}% -\verb|\input| or \verb|\include| it; if it +\verb|\input| or \verb|\include| it; if it \end{quote} \erratum{page 171, line 19} Change the description of \verb|\indent| to: \begin{description} \item[\mytt \bs indent] -Produces a +Produces a % \cindex{indent}% % \index{paragraph!indentation}% horizontal space whose width equals the width of the @@ -279,7 +279,7 @@ try typing \verb|\indent\indent|.) Robust. \erratum{page 179, line 19} % -Change to: +Change to: \begin{quote} page style for the \texttt{article} and \texttt{report} document classes. \end{quote} @@ -292,7 +292,7 @@ with ``\textit{num}$_1$ and \textit{num}$_2$ are numbers''. \erratum{page 196, line $-5$} Change \verb|\newboolean{|\emph{name}\verb|}| to -\verb|\newboolean{|\emph{nam}\verb|}|. +\verb|\newboolean{|\emph{nam}\verb|}|. \reportedby{Christopher von B\"{u}low}{28 Aug 2000} @@ -321,14 +321,14 @@ Add a space after ``bibliography''. \reportedby{Marcin Wolinski}{17 Sep 2003} \subsection*{Error Corrected in the Twenty-First Printing} -\erratum{page 198, line $-11$} +\erratum{page 198, line $-11$} The sentence beginning ``The last three rules'' is hard to read. Better would be: \begin{quote} -\noindent The last three rules are suspended when a +\noindent The last three rules are suspended when a \verb|\clearpage|,\linebreak \verb|\cleardoublepage|, or - \verb|\end{document}| command occurs, + \verb|\end{document}| command occurs, at which point all unprocessed figures and tables are allowed a \hbox{\mytt p} option and printed. \end{quote} @@ -336,7 +336,7 @@ at which point all unprocessed figures and tables are allowed a \subsection*{Error Corrected in the Twenty-Second Printing} -\erratum{page 253, column 2, lines $-5$ and $-6$} +\erratum{page 253, column 2, lines $-5$ and $-6$} The two index entries for \verb|\ldots| should be combined. @@ -359,7 +359,25 @@ argument with \verb|@{}| will suppress that space. \end{quote} \reportedby{Ulrike Fischer, Frank Mittelbach}{23 Sep 2018} + +\erratum{page 201, line $-1$ and page 202, line 1 (\emph{next\_tab\_stop} + explanation)} +Change ``it is reset to the value of \emph{left\_margin\_tab}'' to ``it is +reset to the value of $\mathit{left\_margin\_tab} + 1$''. +\reportedby{Austin Kim}{25 June 2021} + +\erratum{page 202, lines 23--24 (\texttt{\string\\} command) + and lines 25--27 (\texttt{\string\kill} command)} +Change ``to the value of +\emph{left\_margin\_tab}'' to ``to the value of $\mathit{left\_margin\_tab} + 1$''. +\reportedby{Austin Kim}{25 June 2021} + +% \erratum{page 202, line 25--27 (\texttt{\string\kill} command)} +% Change ``sets the value of \emph{next\_tab\_stop} to the value of +% \emph{left\_margin\_tab}'' to ``sets the value of \emph{next\_tab\_stop} equal +% to the value of $\mathit{left\_margin\_tab} + 1$''. + \end{document} %try -%try +%try
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex-dev/base/manual.pdf b/Master/texmf-dist/doc/latex-dev/base/lamport-manual.pdf Binary files differindex 946069a0b40..06adb9a77a6 100644 --- a/Master/texmf-dist/doc/latex-dev/base/manual.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lamport-manual.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf b/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf Binary files differindex 5664c1789b4..75144a2fd06 100644 --- a/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/latexchanges.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf b/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf Binary files differindex cdc6dec4155..0bdfb2ccf3d 100644 --- a/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/latexrelease.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf b/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf Binary files differindex 5f1b36c59a9..5b7ae7f8b49 100644 --- a/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/latexsym.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/lb2.err b/Master/texmf-dist/doc/latex-dev/base/lb2.err index 767cc86a056..53148e28330 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lb2.err +++ b/Master/texmf-dist/doc/latex-dev/base/lb2.err @@ -36,9 +36,10 @@ % % v1.0a - changed name from errata.cls to ttcterrata.cls % v1.0b - added \arraybackslash +% v1.0c - and took it out again and used \tabularnewline instead \ProvidesClass{ttcterrata} - [2021/04/22 v1.0b Mini class for errata files; subject to change (FMi)] + [2021/08/03 v1.0c Mini class for errata files; subject to change (FMi)] \LoadClass{article} @@ -63,7 +64,9 @@ \setbox\@tempboxa\vbox\bgroup \let\endgobble\egroup \let\hideamp\relax - \let\\\relax\let\par\@@par} + \let\\\relax + \let\tabularnewline\relax + \let\par\@@par} \newcommand*\hideamp{&} @@ -140,7 +143,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -154,18 +157,18 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } \newcommand\CHAPTER[1]{\endgobble - &\\[4pt]% - \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \\} + &\tabularnewline[4pt]% + \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \tabularnewline} \newenvironment{erratalist} - {\begin{longtable}{r>{\raggedright\arraybackslash}p{2cm}l>{\raggedright\arraybackslash}p{10cm}l}} + {\begin{longtable}{r>{\raggedright}p{2cm}l>{\raggedright}p{10cm}l}} {\endgobble\end{longtable}} \newcommand\erratatitle[2] @@ -213,7 +216,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -228,7 +231,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp diff --git a/Master/texmf-dist/doc/latex-dev/base/lb2.pdf b/Master/texmf-dist/doc/latex-dev/base/lb2.pdf Binary files differindex f8e55264271..6c01b2a28f6 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lb2.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lb2.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/letter.pdf b/Master/texmf-dist/doc/latex-dev/base/letter.pdf Binary files differindex 846fabe6bc9..258a7682771 100644 --- a/Master/texmf-dist/doc/latex-dev/base/letter.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/letter.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/lgc2.err b/Master/texmf-dist/doc/latex-dev/base/lgc2.err index cbee8d6f35f..96fd378fe95 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lgc2.err +++ b/Master/texmf-dist/doc/latex-dev/base/lgc2.err @@ -34,9 +34,10 @@ % % v1.0a - changed name from errata.cls to ttcterrata.cls % v1.0b - added \arraybackslash +% v1.0c - and took it out again and used \tabularnewline instead \ProvidesClass{ttcterrata} - [2021/04/22 v1.0b Mini class for errata files; subject to change (FMi)] + [2021/08/03 v1.0c Mini class for errata files; subject to change (FMi)] \LoadClass{article} @@ -61,7 +62,9 @@ \setbox\@tempboxa\vbox\bgroup \let\endgobble\egroup \let\hideamp\relax - \let\\\relax\let\par\@@par} + \let\\\relax + \let\tabularnewline\relax + \let\par\@@par} \newcommand*\hideamp{&} @@ -138,7 +141,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -152,18 +155,18 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } \newcommand\CHAPTER[1]{\endgobble - &\\[4pt]% - \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \\} + &\tabularnewline[4pt]% + \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \tabularnewline} \newenvironment{erratalist} - {\begin{longtable}{r>{\raggedright\arraybackslash}p{2cm}l>{\raggedright\arraybackslash}p{10cm}l}} + {\begin{longtable}{r>{\raggedright}p{2cm}l>{\raggedright}p{10cm}l}} {\endgobble\end{longtable}} \newcommand\erratatitle[2] @@ -211,7 +214,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -226,7 +229,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp diff --git a/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf b/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf Binary files differindex 5ef3d284032..2bf91f2d664 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lgc2.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/lppl.pdf b/Master/texmf-dist/doc/latex-dev/base/lppl.pdf Binary files differindex ce56cf02d9b..f55fe971886 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lppl.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lppl.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-code.pdf Binary files differindex 093f9d41bbf..7dc8850331e 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-doc.pdf Binary files differindex 75febb8f367..6ee7bc215c8 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltcmdhooks-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf Binary files differindex 029273e28df..01d8a525835 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf Binary files differindex 137af2e877d..ed7c6213e61 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltfilehook-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf b/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf Binary files differindex 675f0686769..8f563f39550 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lthooks-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf Binary files differindex 54f688d47bb..9f6df1b13b7 100644 --- a/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/lthooks-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf b/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf Binary files differindex d67b1c48f9d..6eeefd94d43 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltluatex.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf Binary files differindex 7fbbd4e7bf1..2869b242c96 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf Binary files differindex 702de3cb4ab..cfcc5d6c604 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews01.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf Binary files differindex 2996986cf0e..4d389f4e2c9 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews02.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf Binary files differindex 00e326d04ea..4ad827fbe13 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews03.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf Binary files differindex 4c7e8605ee3..3e3948c9419 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews04.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf Binary files differindex 0c5fe190a57..6619a66579e 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews05.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf Binary files differindex 43bf07971fa..85e49967095 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews06.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf Binary files differindex 14a96266dbc..79b731a27bf 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews07.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf Binary files differindex 50a61a1f6ec..2ae4ed4d23c 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews08.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf Binary files differindex 334fd2fc9ac..0bce55eaa57 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews09.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf Binary files differindex 1702b9dd603..437faed1d79 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews10.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf Binary files differindex 4c5a9ef0e87..45c6fd4d57c 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews11.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf Binary files differindex 68c5fd29c28..69b3920e0a8 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews12.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf Binary files differindex 315c89b06db..304fe2ab43a 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews13.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf Binary files differindex cb07e551cfb..e6b444ca021 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews14.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf Binary files differindex 798c8b12229..e8b197ddc1c 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews15.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf Binary files differindex 8acc6372f15..6ef0fdbd513 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews16.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf Binary files differindex 7b0b0857276..1475bf5fb5f 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews17.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf Binary files differindex ddecd73fc12..368f8089086 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews18.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf Binary files differindex f0f6e8dfb07..aa2c6801a45 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews19.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf Binary files differindex 5b0f4563792..d0dcaaad1b5 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews20.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf Binary files differindex 3d67ec68271..258f2ad4d69 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews21.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf Binary files differindex ae3c410845a..878636b1f72 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews22.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf Binary files differindex 6c88bbe343f..7978622df5b 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews23.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf Binary files differindex 2fe187077e2..1752ed71a7b 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews24.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf Binary files differindex d5ac053d58c..6314a5dce50 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews25.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf Binary files differindex c370c8bfffc..1e9afbaf6d7 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews26.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf Binary files differindex e99eb472230..cc752c82a07 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews27.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf Binary files differindex 57d61639948..ac35b00b699 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews28.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf Binary files differindex 6887325d795..fc3b51d12b5 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews29.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf Binary files differindex 47a6003be50..a02ff71f462 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews30.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf Binary files differindex c169d35899c..42ba4d841e2 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews31.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf Binary files differindex 2ad8dc792b6..9061a66608b 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews32.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews33.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews33.pdf Binary files differindex fe95ad1a99d..a4344abff55 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews33.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews33.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews34.pdf b/Master/texmf-dist/doc/latex-dev/base/ltnews34.pdf Binary files differindex 174751f9d9a..cf2cdcf1398 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews34.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews34.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltnews34.tex b/Master/texmf-dist/doc/latex-dev/base/ltnews34.tex index 94d2d595df2..7497b71879e 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltnews34.tex +++ b/Master/texmf-dist/doc/latex-dev/base/ltnews34.tex @@ -106,14 +106,18 @@ \let\finalvspace\vspace % for document layout fixes - +% Undo ltnews's \verbatim@font with active < and > +\makeatletter +\def\verbatim@font{% + \normalsize\ttfamily} +\makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \providecommand\tubcommand[1]{} \tubcommand{\input{tubltmac}} \publicationmonth{November} -\publicationyear{2021 --- Draft Version} +\publicationyear{2021 --- Draft Version (with many unfinished blocks)} \publicationissue{34} @@ -138,13 +142,313 @@ \emph{write} -\section{???} -\emph{write} + + +\section{Hook business} + +After the introduction of the hook management system in the 2020 +release of \LaTeX{}~\cite{34:ltnews32} package developers have started +to make more and more use of the new functionality. This resulted in a +number of queries showing that some of the documentation was not +precise enough and that one or the other clarification was +needed. This has now been addressed in the documentation. The extended +usage also showed a small number of deficiencies that we thought +should be corrected now while the adoption rate is still relatively +small. These are addressed in this release and documented below. + + +\subsection{Providing \cs{ActivateGenericHook}} + +The hook management system offers a number of generic hooks, i.e., +hooks whose names contain a variable component, for example the name +of an environment. Predeclaring such hooks as not really feasible +which is why these hooks use a different mechanism: they are +implicitly available end spring into life the moment a package or the +user in the preamble adds code to them using \cs{AddToHook}. The +kernel offers such hooks for environments \texttt{env/...}, commands +\texttt{cmd/...}, and files, package or classes, \texttt{file/...}, +\texttt{include/...}, \texttt{package/...}, and \texttt{class/...}. + +It is possible to offer generic hooks in packages, e.g., if you have +hooks that depend on the current language and therefore need the +language name as part of the hook name and you don't know all possible +names beforehand. + +If you want to offer your generic hooks you do this by using +\cs{UseHook} or \cs{UseOneTimeHook} in your (package) code, but +\emph{without declaring the hook} with \cs{NewHook}. Without any +further work a call to \cs{UseHook} with an undeclared hook name does +nothing. So as an additional setup step, it is necessary to explicitly +activate the generic hook with \cs{ActivateGenericHook}.\footnote{Note + that in the previous release we offered \cs{ProvideHook} as a means + to achieve this effect, but the name was badly chosen so we decided + to deprecate it and now offer \cs{ActivateGenericHook} instead + because that is what it is meant for.} + +Assuming +that you don't know all the different hook names up front it will +remain the task of the users of your package to activate the hook +themselves before adding code to it. For example, Babel offers hooks +such as \texttt{babel/afterextras/\meta{language}} enabling the user +to add language specific declarations there. They can then write +\begin{verbatim} +\ActivateGenericHook + {babel/afterextras/ngerman} +\AddToHook{babel/afterextras/ngerman} + {\color{blue}} +\end{verbatim} +after which all German words would be colored blue in the text. + +Note that a generic hook produced in this way is always a normal hook. + + + + +\subsection{Clear extra hook code for next invocation} + +There are a few use cases where it would be helpful if one can cancel +an earlier use of \cs{AddToHookNext}, for example, when a page is +discarded with \cs{DiscardShipoutBox} because only some pages of the +document are printed. For such situations the new command +\cs{ClearHookNext} is provided. +% +\githubissue{565} + + + +\subsection{Clean up after \cs{UseOneTimeHook}} + +Some hooks are meant to be used only once in a document, and any +further attempt to add code to them causes the code to be executed +immediately instead of being added to the hook. The initial implementation of +this concept was very simple and didn't anticipate that packages may try to +execute a one-time hook several times resulting in the hook code +being executed repeatedly. Thus, the implementation was fine for +simple usages (e.g., the \hook{begindocument} hook), but caused +trouble if the one-time hook was intended, for example, as an +initialization hook that is used once when a command is first +called, but then ignored in further calls. + +This deficiency has been addressed, and now a one-time hook will only be executed once +and the hook code is removed after usage to free up the memory. +% +\githubissue{565} + + + +\subsection{Class, package, and include hook improvements} + +Classes, packages and include files can only be loaded once in a +\LaTeX{} document. For that reasons hooks that are specific to such +files have been made one-time hooks. Beside being more efficient this +supports the following important use case +\begin{verbatim} +\AddToHook{package/varioref/after} + { ... apply my customizations if the package + gets loaded (or was loaded already) ... } +\end{verbatim} +without the need to first test if the package was already loaded +before. +% +\githubissue{623} + + +\subsection{Standardizing generic hook names} + +The initial set of generic hooks provided by the \LaTeXe{} kernel had +two patterns of hook names: ones like +\verb|env/|\meta{name}\verb|/after|, with the variable (\meta{name}) +part in the middle position, and ones like +\verb|file/after/|\meta{name}, with the variable part in the third +position. The coexistence of these two types caused confusion, because +the user had to remember in which position was the variable part +supposed to go, and made the code more complicated and slower. + +The file-related hooks have been renamed so that the variable part of +their is in the middle, as with other hooks. The changes were: +\begin{center} + \small\ttfamily + \begin{tabular}{l@{\;$\rightarrow$\;}l} + \hline + \multicolumn{1}{l}{Old name} & \rmfamily New name \\ + \hline + file/before/\meta{name} & file/\meta{name}/before \\ + file/after/\meta{name} & file/\meta{name}/after \\ + package/before/\meta{name} & package/\meta{name}/before \\ + package/after/\meta{name} & package/\meta{name}/after \\ + class/before/\meta{name} & class/\meta{name}/before \\ + class/after/\meta{name} & class/\meta{name}/after \\ + include/before/\meta{name} & include/\meta{name}/before \\ + include/end/\meta{name} & include/\meta{name}/end \\ + include/after/\meta{name} & include/\meta{name}/after \\ + \hline + \end{tabular} +\end{center} + +Since this is a breaking change, the old names will still work for a +while, so that users and package authors have enough time to adjust, and +a warning will be issued when the old names are used. Eventually the +deprecated names will be turned into errors and then removed completely. +% +\githubissue{648} + + + +\subsection{Changed how \cs{RemoveFromHook} treats code that isn't in the hook} + +In the first version of \cs{RemoveFromHook}, in case the code label +being removed didn't exist in the hook, a ``removal order'' would be +queued, and the next time something tried to add that label to the hook, +the \cs{AddToHook} would be cancelled by the removal order, and no code +would be added that once. This was so that in principle package loading +order wouldn't matter. However this implementation didn't work quite as +intended, because while two \cs{AddToHook} to a given label would be +removed by a single \cs{RemoveFromHook}, one \cs{RemoveFromHook} could +not cancel two \cs{AddToHook} to that label, and this asymmetry caused +confusion and was a recipe for further problems. + +The implementation was changed and now \cs{RemoveFromHook} only removes +labels that already exist in a hook, and will display a warning if they +don't. For usage across packages, for removing code in a hook, the +\texttt{voids} relation should be used instead: this relation is +non-destructive (meaning it can be later reverted with another one), and +it is truly independent of package loading order, so it should be +preferred. +% +\githubissue{625} + + + + +\subsection{???} + +% +\githubissue{000} + + \section{New or improved commands} + +\subsection{Added \cs{PackageNote} and \cs{ClassNote}} + +\LaTeX{} offers \cs{PackageError} to signal errors that stop +processing, \cs{PackageWarning} that generates a warning message on the +terminal, but continues with the processing and also \cs{PackageInfo} +to provide some information that is only written to the \texttt{.log} +file. What hasn't existed up to now is a way to provide some +information on the terminal that is identifying itself as coming from +a specific package but which isn't claiming to be a warning. Thus, +packages that wanted to write to the terminal used \cs{PackageWarning} +even though the information wasn't really warning the user. For this +we now have \cs{PackageNote} and \cs{PackageNoteNoLine}, that identify +themselves as \enquote{informational}, but still go to the terminal and +not only to the transcript. + +Similar commands exist for classes and there we have added the missing +\cs{ClassNote} and \cs{ClassNoteNoLine} as well. +% +\githubissue{613} + + +\subsection{New implementation for \cs{counterwithin}} + +New implementation for \cs{counterwithout} and \cs{counterwithin} with +an additional optional arg so it becomes a drop-in replacement for +amsmath \cs{numberwithin}. + +\emph{write appropriate description} + + + +\subsection{New default for \cs{tracinglostchars}} + +In 2021 the \TeX{} engines got enhanced so that \cs{tracinglostchars} +is now also supporting the value \texttt{3}, turning missing +characters into errors and not just warnings. This change made us +realize that \LaTeX{} should use a better default for this parameter +(so far the warning was only written to the transcript file). +Using the now available \texttt{3} would really be the best, but for +compatibility reasons we only set it to \texttt{2} in the kernel. +However, we recommend adding \cs{tracinglostchars}\texttt{=3} to the +preamble of documents, because missing glyphs in the output are an +error and should therefore be properly looked at. + + + + + + +\subsection{Provide tests for package and class loading} + +To test if a package was loaded you can now use \cs{IfPackageLoadedTF} +\Arg{package} \Arg{true} \Arg{false} and based on the result execute +different code. It is also possible to check if the package was loaded +with certain options. This is done with +\cs{IfPackageLoadedWithOptionsTF}. It takes four arguments: +\Arg{package}\Arg{option-list}\Arg{true}\Arg{false}. It uses the +\meta{false} code if at least one option in the \meta{option-list} has +not been used during loading or if the package hasn't been loaded at +all. +% +Both commands can be used anywhere in the document, i.e., they are not +restricted to the preamble.\footnote{This is now also true for the + corresponding internal commands, e.g., \cs{@ifpackageloaded}, that + had this restriction in the past.} + +For classes similar commands (\texttt{Package} replaced by +\texttt{Class} in the name) are provided. +% +\githubissue{621} + + + + + + + + + +\subsection{New \cs{ShowFloat} command} + +The package \pkg{fltrace} offers a (fairly low-level but very +detailed) way to trace \LaTeX's float mechanism. This can help to +understand why a certain float is placed into a certain region or why +it shows up unexpectedly on a later page. \LaTeX{} stores floats in +registers named \cs{bx@A}, \cs{bx@B}, etc., and these names show up in +the tracing information. +% +To display their contents you can now say +\verb=\ShowFloat{=\textit{identifier}\verb=}= where +\textit{identifier} is the uppercase letter (or letters) after +\texttt{bx@} in the register name shown in the tracing. If additional +registers have been allocated with \cs{extrafloats}, the +\textit{identifier} can also be a number. The command is generally +available, whether or not you have loaded \pkg{fltrace}, because it is +also useful when interpreting the tracing output of the +\pkg{fewerfloatpages} package. + + +\subsection{Add \pkg{ltcmd} support for \cs{NewCommandCopy} and \cs{ShowCommand}} + +Since the 2020-10-01 release (see~\cite{34:ltnews32}), \LaTeX{} provides +\cs{NewCommandCopy} to copy robust commands, and \cs{ShowCommand} to +show their definition in the terminal. In the same release, the +\pkg{xparse} package was integrated in the kernel (now called +\pkg{ltcmd}). However, the extended support for \cs{NewCommandCopy} and +\cs{ShowCommand} was not implemented in \pkg{ltcmd}. The present +\LaTeX{} release ships with that support implemented, so now commands +defined with \pkg{xparse}/\pkg{ltcmd} can be copied and their definition +can be easily shown in the terminal without \cs{csname} gymnastics. +% +\githubissue{569} + + + + + \subsection{???} % @@ -155,6 +459,68 @@ \section{Code improvements} +\subsection{Detect ``\cs{endfoo}'' when using \cs{NewDocumentEnvironment}} + +The \cs{newenvironment} command has always checked that both \cs{foo} and +\cs{endfoo} do not exist before creating a \texttt{foo} environment. In +contrast, \cs{NewDocumentEnvironment} has only to date checked for \cs{foo}; +this reflects the fact that historically the code was designed around the +target of an entirely new format. The behavior of \cs{NewDocumentEnvironment} +now aligns with \cs{newenvironment}, except that it gives separate errors +for the existence of \cs{foo} and \cs{endfoo}. + +\subsection{Improve ``\cs{begin} ended by'' error message} + +In the past it was possible to get an error message stating something +like \verb=\begin{foo} ended by \end{foo}=. This could happen when the +environment name was partly hidden inside a macro, because the test was +comparing the literal strings while the error message expanded the +strings fully. This has now been changed to show a more sensible error +message in this instance. +% +\githubissue{587} + + + +\subsection{Additional Extended Latin characters predefined} +Some additional characters such as \'k (U+1E131) are now pre-defined and +will work without needing \verb|\DeclareUnicodeCharacter| declarations. +% +\githubissue{593} + + +\subsection{Use OpenType version of Latin Modern Upright Italic} +When Latin Modern is used with the TU encoding under \XeTeX\ or \LuaTeX\ +and fontshape \texttt{ui} is requested, \LaTeX\ now uses the OpenType +version instead of substituting the (T1 encoded) Type 1 version. + + +\subsection{Pick up all arguments to \cs{contentsline}} + +The \cs{contentsline} commands in the TOC file are always followed by +four arguments, the last one being empty by default and only used by +\pkg{hyperref}. The \cs{contentsline} command itself only used the +first three arguments and relied on the fourth being empty (and thus +doing no harm). But this assumption is not always correct, e.g., if +you use \pkg{hyperref} and then remove it from the preamble. + +So now we pick up all four arguments and save the last one away, so +that it can be used by \pkg{hyperref}. +% +\githubissue{633} + + +\subsection{Fix dropping math lists in \LuaTeX\ callbacks} + +The \LuaTeX\ callbacks \texttt{pre\_mlist\_to\_hlist\_filter} +and \texttt{post\_mlist\_to\_hlist\_filter} no longer create an error if +the callback handler indicates to remove the entire math block. +% +\githubissue{644} + + + + \subsection{???} % @@ -163,7 +529,82 @@ -\section{Changes to packages in the \pkg{graphics} category} +\section{Bug fixes} + +\subsection{Replicate argument processors for all embellishments} + +There was a bug in \pkg{ltcmd} (former \pkg{xparse}) that caused +commands to misbehave if they were defined with embellishments and +argument processors. In that case, only one (possibly void) argument +processor would be added to the full set of embellishment arguments, +resulting in too few processors in some cases, leading to unpredictable +behavior. This bug has been fixed by applying the same argument +processors to all the embellishments in a set, so a declaration like: +\begin{verbatim} +\NewDocumentCommand\foo{>{\TrimSpaces}e{_^}} + {(#1)[#2]} +\foo^{ a }_{ b } +\end{verbatim} +will now correctly apply \cs{TrimSpaces} to both arguments. +% +\githubissue{639} + + + +\subsection{Correct case changes for \cs{ij} and \cs{IJ}} + + +The ligatures \enquote{\ij} and \enquote{\IJ}, as used in Dutch, +are only available in most \TeX{} fonts, if the commands \cs{ij} or +\cs{IJ} are used or when you enter them as UTF-8 characters U+0133 or +U+0132. +% +However, when using \texttt{OT1} or \texttt{T1} encoded fonts in +\pdfTeX, the upper or lower casing with \cs{MakeUppercase} and +\cs{MakeLowercase} would always fail regardless of the input method. +This has now been corrected. At the same time we improved the +hyphenation results for words containing this ligature (when +typesetting is done in \texttt{OT1} encoding). +% +\githubissue{658} + + + +\subsection{Improve handling of legacy \cs{bfdefault} changes} + +In the past, changes to the font series defaults were made by directly +altering \cs{bfdefault} or \cs{mddefault}. Since 2020 there is now +\cs{DeclareFontSeriesDefault} that allows more granular control, +i.e., with that declaration you can alter the default for individual meta +font families, for example, by only altering the bold settings for the +sans serif family without changing it for \cs{rmfamily} or \cs{ttfamily}. +See~\cite{34:ltnews31} for more details. + +For backwards compatibility, changing \cs{bfdefault} with +\cs{renewcommand} remained possible. If used, it alters the setting +for all meta families in one go. This cannot be done when the +\cs{renewcommand} happens and was therefore delayed until the next +time \cs{bfseries} or \cs{mdseries} was executed. + +However, the problem with that +approach was that any call to \cs{DeclareFontSeriesDefault} that +happened in the mean time was overwritten---the two approaches didn't +work well side by side. This is a problem because older font packages +use the legacy method while newer ones use +\cs{DeclareFontSeriesDefault}. This has now been corrected by changing +\cs{DeclareFontSeriesDefault} to do any necessary resetting prior to +setting new defaults. +% +\githubissue{663} + + +\subsection{Use of \# in \cs{textbf} and similar commands} +Previously you could not use the macro parameter character \# in inline functions +in the argument of \cs{texbf} and similar text font commands. +An internal definition is now guarded with \cs{unexpanded} +so that \# does not generate an error. +% +\githubissue{665} \subsection{???} @@ -173,8 +614,56 @@ + + + +\section{Changes to packages in the \pkg{graphics} category} + + +\subsection{Key for alt text} +A new key \texttt{alt} has been added to \verb|\includegraphics| allowing specification +of an alternative text for accessibility. +This is unused by default but may be used by extension packages and possible future use. +% +\githubissue{651} + + + \section{Changes to packages in the \pkg{tools} category} +\subsection{\pkg{varioref}: Improve missing label handling} + +If an undefined label is referenced, \pkg{varioref} makes a default +definition so that later processing finds the right structure (two +brace groups inside \cs{r@}\meta{label}) However, if \pkg{nameref} or +\pkg{hyperref} is loaded, the data structure changes to five +arguments, resulting in low-evel errors in some cases. The code has +been changed to avoid these errors. +% +\sxissue{603948} + + +\subsection{\pkg{array}: Cancel \cs{mathsurround} for \env{tabular}} + +A \env{tabular} environment is internally typeset as an \env{array} +environment with special settings and therefore in math mode. This +math group should not get any \cs{mathsuround} added as it isn't a +real formula because otherwise the spacing around the \env{tabular} +changes. This bug has been there forever (which means not many people +use \cs{mathsurround} or noticed the difference). Anyhow, this now got +fixed. +% +\githubissue{614} + +\subsection{\pkg{longtable}: Improve behavior after a section heading} +The \env{longtable} environment now sets the \cs{@nobreakfalse} flag so that +spacing and indentation changes after a section heading are not triggered by +a paragraph which follows a table which starts a section. Similarly a test for +\cs{if@noskipsec} added so that a table follows a run-in heading +rather than appearing before it. +% +\githubissue[s]{131 and 173} + \subsection{???} % @@ -182,6 +671,15 @@ \section{Changes to packages in the \pkg{amsmath} category} +\subsection{Improve compability with hyperref} + +When \pkg{hyperref} is used, incrementing a counter creates anchors and this can affect spacing. +For a long time \pkg{hyperref} patched the \env{equation} environment to +avoid some of the side effects. This patch has now been moved directly into \pkg{amsmath}. +Additionally, +a \cs{mathopen} has been added to avoid that the anchor affects a following unary symbol. +% +\githubissue{652} \subsection{???} @@ -205,6 +703,10 @@ \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\ \url{https://latex-project.org/help/documentation/} +\bibitem{34:ltnews31} \LaTeX{} Project Team: + \emph{\LaTeXe{} news 31}.\\ + \url{https://latex-project.org/news/latex2e-news/ltnews31.pdf} + \bibitem{34:ltnews32} \LaTeX{} Project Team: \emph{\LaTeXe{} news 32}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews32.pdf} diff --git a/Master/texmf-dist/doc/latex-dev/base/ltpara-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltpara-code.pdf Binary files differindex 5a16a8c1e47..c39ce4eb6be 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltpara-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltpara-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltpara-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltpara-doc.pdf Binary files differindex 296d0201421..2d05e77304a 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltpara-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltpara-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf b/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf Binary files differindex b9b89d57e0a..2bb3e8e5600 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltshipout-code.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf Binary files differindex 288b55cce98..c422ae9794b 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltshipout-doc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf b/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf Binary files differindex 595d23353b9..3f492d24c77 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltx3info.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf b/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf Binary files differindex e149e03cf98..7f3de033122 100644 --- a/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/ltxdoc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf b/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf Binary files differindex 47e9bbe4fe5..736ef277a21 100644 --- a/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/makeindx.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/manifest.txt b/Master/texmf-dist/doc/latex-dev/base/manifest.txt index 65e6f803893..f6afcccce78 100644 --- a/Master/texmf-dist/doc/latex-dev/base/manifest.txt +++ b/Master/texmf-dist/doc/latex-dev/base/manifest.txt @@ -76,7 +76,7 @@ % % ltx3info.tex -- Information about the LaTeX3 project. % -% manual.err -- Errata for the LaTeX Manual. +% lamport-manual.err -- Errata for the LaTeX Manual book, second edition. % tlc2.err -- Errata for the LaTeX Companion, second edition. % lb2.err -- Errata for the LaTeX-Begleiter, 2te erw. Auflage (German). % lgc2.err -- Errata for the LaTeX Graphics Companion, second edition. diff --git a/Master/texmf-dist/doc/latex-dev/base/modguide.pdf b/Master/texmf-dist/doc/latex-dev/base/modguide.pdf Binary files differindex 4c1ddbe9494..73386625ce7 100644 --- a/Master/texmf-dist/doc/latex-dev/base/modguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/modguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf b/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf Binary files differindex 82938a5bd83..904aafcd7db 100644 --- a/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/nfssfont.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/proc.pdf b/Master/texmf-dist/doc/latex-dev/base/proc.pdf Binary files differindex 2997bbec092..7edbb77c6bd 100644 --- a/Master/texmf-dist/doc/latex-dev/base/proc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/proc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/slides.pdf b/Master/texmf-dist/doc/latex-dev/base/slides.pdf Binary files differindex e71d6e8bc2a..69e2a0c1ae3 100644 --- a/Master/texmf-dist/doc/latex-dev/base/slides.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/slides.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf b/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf Binary files differindex f0de95ec175..c18e1a26d22 100644 --- a/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/slifonts.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/source2e.pdf b/Master/texmf-dist/doc/latex-dev/base/source2e.pdf Binary files differindex d400012bb09..cb22937a33b 100644 --- a/Master/texmf-dist/doc/latex-dev/base/source2e.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/source2e.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf b/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf Binary files differindex 6b6d25627dc..4ab7c3814b0 100644 --- a/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/syntonly.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/tlc2.err b/Master/texmf-dist/doc/latex-dev/base/tlc2.err index a361d1673a4..46ba9ed8451 100644 --- a/Master/texmf-dist/doc/latex-dev/base/tlc2.err +++ b/Master/texmf-dist/doc/latex-dev/base/tlc2.err @@ -19,7 +19,7 @@ \begin{filecontents}{ttcterrata.cls} %% -%% Copyright (C) 1997,2004,2005,2007, 2014 Frank Mittelbach +%% Copyright (C) 1997-2021 Frank Mittelbach %% This class file is licenced under LPPL latest version; %% see https://www.latex-project.org/lppl % @@ -36,9 +36,10 @@ % % v1.0a - changed name from errata.cls to ttcterrata.cls % v1.0b - added \arraybackslash +% v1.0c - and took it out again and used \tabularnewline instead \ProvidesClass{ttcterrata} - [2021/04/22 v1.0b Mini class for errata files; subject to change (FMi)] + [2021/08/03 v1.0c Mini class for errata files; subject to change (FMi)] \LoadClass{article} @@ -63,7 +64,9 @@ \setbox\@tempboxa\vbox\bgroup \let\endgobble\egroup \let\hideamp\relax - \let\\\relax\let\par\@@par} + \let\\\relax + \let\tabularnewline\relax + \let\par\@@par} \newcommand*\hideamp{&} @@ -140,7 +143,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -154,18 +157,18 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } \newcommand\CHAPTER[1]{\endgobble - &\\[4pt]% - \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \\} + &\tabularnewline[4pt]% + \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \tabularnewline} \newenvironment{erratalist} - {\begin{longtable}{r>{\raggedright\arraybackslash}p{2cm}l>{\raggedright\arraybackslash}p{10cm}l}} + {\begin{longtable}{r>{\raggedright}p{2cm}l>{\raggedright}p{10cm}l}} {\endgobble\end{longtable}} \newcommand\erratatitle[2] @@ -213,7 +216,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -228,7 +231,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp @@ -420,7 +423,7 @@ Contest period ends & Winner \\[4pt] -\CHAPTER{Front matter} +\CHAPTER{Front matter} \erroronpage{iv}{bottom}{FMi}{2004/04/23}{2} Some updates indicating second printing (with corrections) diff --git a/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf b/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf Binary files differindex b31dc5d6372..60c2def5197 100644 --- a/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/tlc2.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/tulm.pdf b/Master/texmf-dist/doc/latex-dev/base/tulm.pdf Binary files differindex 5aa6b501411..eae26e7a6c9 100644 --- a/Master/texmf-dist/doc/latex-dev/base/tulm.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/tulm.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf b/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf Binary files differindex 423fe4c8b49..35201e63bd2 100644 --- a/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/usrguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/usrguide3.pdf b/Master/texmf-dist/doc/latex-dev/base/usrguide3.pdf Binary files differindex 347116d1574..bf279eb39a9 100644 --- a/Master/texmf-dist/doc/latex-dev/base/usrguide3.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/usrguide3.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/usrguide3.tex b/Master/texmf-dist/doc/latex-dev/base/usrguide3.tex index e86b2d8b0a3..82c1c068630 100644 --- a/Master/texmf-dist/doc/latex-dev/base/usrguide3.tex +++ b/Master/texmf-dist/doc/latex-dev/base/usrguide3.tex @@ -302,7 +302,7 @@ argument specification: \end{verbatim} where \verb*|\foobar{arg1} [arg2]| will not find an optional argument. -There is one subtly here due to the difference in handling by \TeX{} of +There is one subtlety here due to the difference in handling by \TeX{} of `control symbols', where the command name is made up of a single character, such as `\texttt{\textbackslash\textbackslash}'. Spaces are not ignored by \TeX{} here, @@ -454,6 +454,18 @@ category code $13$ (active) character matching the \meta{token} will be replaced before the split takes place. Spaces are trimmed at each end of each item parsed. +The \texttt{E} argument type is somewhat special, because with a single +\texttt{E} in the command declaration you may end up with several +arguments in a command (one formal argument per embellishment token). +Therefore, when an argument processor is applied to an \texttt{E}-type +argument, all the arguments pass through that processor before being fed +to the \meta{code}. For example, this command +\begin{verbatim} + \NewDocumentCommand \foo { >{\TrimSpaces} e{_^} } + { [#1](#2) } +\end{verbatim} +applies \cs{TrimSpaces} to both arguments. + \begin{decl} |\SplitList| \arg{token(s)} \end{decl} diff --git a/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf b/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf Binary files differindex ac071196184..bbcff9bc6f8 100644 --- a/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/utf8ienc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/base/webcomp.err b/Master/texmf-dist/doc/latex-dev/base/webcomp.err index 6a62e258c50..1b3b7a24751 100644 --- a/Master/texmf-dist/doc/latex-dev/base/webcomp.err +++ b/Master/texmf-dist/doc/latex-dev/base/webcomp.err @@ -29,9 +29,10 @@ % % v1.0a - changed name from errata.cls to ttcterrata.cls % v1.0b - added \arraybackslash +% v1.0c - and took it out again and used \tabularnewline instead \ProvidesClass{ttcterrata} - [2021/04/22 v1.0b Mini class for errata files; subject to change (FMi)] + [2021/08/03 v1.0c Mini class for errata files; subject to change (FMi)] \LoadClass{article} @@ -56,7 +57,9 @@ \setbox\@tempboxa\vbox\bgroup \let\endgobble\egroup \let\hideamp\relax - \let\\\relax\let\par\@@par} + \let\\\relax + \let\tabularnewline\relax + \let\par\@@par} \newcommand*\hideamp{&} @@ -133,7 +136,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -147,18 +150,18 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } \newcommand\CHAPTER[1]{\endgobble - &\\[4pt]% - \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \\} + &\tabularnewline[4pt]% + \multicolumn{4}{l}{\framebox[10cm][l]{\textbf{\normalsize\strut#1}}} \tabularnewline} \newenvironment{erratalist} - {\begin{longtable}{r>{\raggedright\arraybackslash}p{2cm}l>{\raggedright\arraybackslash}p{10cm}l}} + {\begin{longtable}{r>{\raggedright}p{2cm}l>{\raggedright}p{10cm}l}} {\endgobble\end{longtable}} \newcommand\erratatitle[2] @@ -206,7 +209,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp } @@ -221,7 +224,7 @@ \typeout{Ignoring entry #1 #2 #3 #4}% \expandafter\gobbleerrata \fi - \hideamp \\% + \hideamp \tabularnewline \fbox{\bfseries !!}\hfill \displayrevisionfix{#1}{#5} \hideamp #2 \hideamp (\textsf{#3}) \hideamp diff --git a/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf b/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf Binary files differindex 6451799f0d9..c28756a894a 100644 --- a/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf +++ b/Master/texmf-dist/doc/latex-dev/base/webcomp.pdf diff --git a/Master/texmf-dist/doc/latex-dev/firstaid/changes.txt b/Master/texmf-dist/doc/latex-dev/firstaid/changes.txt index 634e3e5c9b1..f84c9dbc5b7 100644 --- a/Master/texmf-dist/doc/latex-dev/firstaid/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/firstaid/changes.txt @@ -1,8 +1,28 @@ +2021-06-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * latex2e-first-aid-for-external-files.dtx: + Add first aid for strange bogus para/end error due to listings's + redefinition of \vskip. + +2021-06-24 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * latex2e-first-aid-for-external-files.dtx (subsection{\footref first aid}): + Taken out first aid for memoir and scrbase, they are now fixed + + (section{The Implementation}): show more details if a first aid + is not applied. + +2021-06-23 Marcel Krüger <Marcel.Krueger@latex-project.org> + + * latex2e-first-aid-for-external-files.dtx: + Temporary fix for gh591 to be taken out when the engine is fixed. + 2021-06-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * latex2e-first-aid-for-external-files.dtx: ulem doesn't handle \hspace gracefully now that it is calc aware. - varwidth needs an additional \unskip when unraveling a vertical list. + varwidth needs an additional \unskip when unraveling a vertical list + (but only if that skip is 0pt) 2021-03-15 Frank Mittelbach <Frank.Mittelbach@latex-project.org> diff --git a/Master/texmf-dist/doc/latex-dev/firstaid/latex2e-first-aid-for-external-files.pdf b/Master/texmf-dist/doc/latex-dev/firstaid/latex2e-first-aid-for-external-files.pdf Binary files differindex 137d4a9274f..d57cfbc1666 100644 --- a/Master/texmf-dist/doc/latex-dev/firstaid/latex2e-first-aid-for-external-files.pdf +++ b/Master/texmf-dist/doc/latex-dev/firstaid/latex2e-first-aid-for-external-files.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/README.md b/Master/texmf-dist/doc/latex-dev/graphics/README.md index 51707022ae3..c2ba96233dd 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/README.md +++ b/Master/texmf-dist/doc/latex-dev/graphics/README.md @@ -1,7 +1,7 @@ The LaTeX `graphics` bundle =========================== -Release 2021-11-15 pre-release 1 +Release 2021-11-15 pre-release 2 Overview -------- diff --git a/Master/texmf-dist/doc/latex-dev/graphics/changes.txt b/Master/texmf-dist/doc/latex-dev/graphics/changes.txt index 0616e3b6927..bd328646f14 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/graphics/changes.txt @@ -4,12 +4,24 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ======================================================================= +2021-09-16 David Carlisle <David.Carlisle@latex-project.org> + + * graphicx.dtx: Add an alt key to \includegraphics gh/651 + +2021-08-13 David Carlisle <David.Carlisle@latex-project.org> + + * longtable.dtx: ensure \ext@table is defined (gh/g37) + +2021-08-11 David Carlisle <David.Carlisle@latex-project.org> + + * trig.dtx: correct csname for 180 \@clxxx not \@clxx + ================================================================================ All changes above are only part of the development branch for the next release. ================================================================================ ######################### -# 2021-16-01 Release +# 2021-06-01 Release ######################### 2021-03-04 Phelype Oleinik <phelype.oleinik@latex-project.org> diff --git a/Master/texmf-dist/doc/latex-dev/graphics/color.pdf b/Master/texmf-dist/doc/latex-dev/graphics/color.pdf Binary files differindex 1118a879ede..dbc9c257882 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/color.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/color.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/drivers.pdf b/Master/texmf-dist/doc/latex-dev/graphics/drivers.pdf Binary files differindex 009b496ee68..ecd63d0fb48 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/drivers.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/drivers.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/epsfig.pdf b/Master/texmf-dist/doc/latex-dev/graphics/epsfig.pdf Binary files differindex 40ba1614105..5787ecf75bb 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/epsfig.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/epsfig.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/graphics.pdf b/Master/texmf-dist/doc/latex-dev/graphics/graphics.pdf Binary files differindex d52ec97ee7e..2a78345161c 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/graphics.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/graphics.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/graphicx.pdf b/Master/texmf-dist/doc/latex-dev/graphics/graphicx.pdf Binary files differindex 01724f9bb33..210d251efc9 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/graphicx.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/graphicx.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/grfguide.pdf b/Master/texmf-dist/doc/latex-dev/graphics/grfguide.pdf Binary files differindex b5e770a191e..792686e0af6 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/grfguide.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/grfguide.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/keyval.pdf b/Master/texmf-dist/doc/latex-dev/graphics/keyval.pdf Binary files differindex ff9f10e7e0f..3571d1347e5 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/keyval.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/keyval.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/lscape.pdf b/Master/texmf-dist/doc/latex-dev/graphics/lscape.pdf Binary files differindex d2bd4fa4573..caf9f95ee71 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/lscape.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/lscape.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/rotating.pdf b/Master/texmf-dist/doc/latex-dev/graphics/rotating.pdf Binary files differindex 1f257d72e50..e4c4a0df13d 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/rotating.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/rotating.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/rotex.pdf b/Master/texmf-dist/doc/latex-dev/graphics/rotex.pdf Binary files differindex 6d963e82bdb..6a89c2edff8 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/rotex.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/rotex.pdf diff --git a/Master/texmf-dist/doc/latex-dev/graphics/trig.pdf b/Master/texmf-dist/doc/latex-dev/graphics/trig.pdf Binary files differindex fce1bfec2fc..fcfbf0a4dad 100644 --- a/Master/texmf-dist/doc/latex-dev/graphics/trig.pdf +++ b/Master/texmf-dist/doc/latex-dev/graphics/trig.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/README.md b/Master/texmf-dist/doc/latex-dev/tools/README.md index d2f51a78c9e..4eb7829acdd 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/README.md +++ b/Master/texmf-dist/doc/latex-dev/tools/README.md @@ -1,7 +1,7 @@ The LaTeX `tools` bundle ======================== -Release 2021-11-15 pre-release 1 +Release 2021-11-15 pre-release 2 Overview -------- diff --git a/Master/texmf-dist/doc/latex-dev/tools/afterpage.pdf b/Master/texmf-dist/doc/latex-dev/tools/afterpage.pdf Binary files differindex 118a18b6582..f1532c82b64 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/afterpage.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/afterpage.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/array.pdf b/Master/texmf-dist/doc/latex-dev/tools/array.pdf Binary files differindex a0b803946e5..28778ed39c6 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/array.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/array.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/bm.pdf b/Master/texmf-dist/doc/latex-dev/tools/bm.pdf Binary files differindex 2e7cf36c46c..e69390ef576 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/bm.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/bm.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/calc.pdf b/Master/texmf-dist/doc/latex-dev/tools/calc.pdf Binary files differindex dd772bbba34..327661413aa 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/calc.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/calc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/changes.txt b/Master/texmf-dist/doc/latex-dev/tools/changes.txt index 17278e4a54d..aa5a3419604 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/changes.txt +++ b/Master/texmf-dist/doc/latex-dev/tools/changes.txt @@ -1,4 +1,3 @@ - ======================================================================= This file lists changes to the LaTeX2e files in reverse chronological order. It is provided for convenience only. It therefore makes no claims to @@ -6,6 +5,28 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ======================================================================= +2021-09-01 David Carlisle <David.Carlisle@latex-project.org> + + * longtable.dtx: add \@nobreakfalse for github/173 and \if@noskipsec for gh/131 + +2021-07-12 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * array.dtx (section{The Environment Definitions}): + Cancel any outside \mathsurround on the outside of tabular which is + internally execuded in math mode (gh/614) + +2021-07-07 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * varioref.dtx (subsubsection{Supporting ranges}): + Use 3 additional (empty) arguments as default in case + nameref is active (sx/603948) + +2021-07-06 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * multicol.dtx (subsection{The output routines}]): + Removed spurious but harmless empty line (\par) in + code. + ================================================================================ All changes above are only part of the development branch for the next release. ================================================================================ diff --git a/Master/texmf-dist/doc/latex-dev/tools/dcolumn.pdf b/Master/texmf-dist/doc/latex-dev/tools/dcolumn.pdf Binary files differindex 8384bed4820..c6e3921f1e8 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/dcolumn.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/dcolumn.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/delarray.pdf b/Master/texmf-dist/doc/latex-dev/tools/delarray.pdf Binary files differindex 81c884c7ffa..e5ad5342da3 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/delarray.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/delarray.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/enumerate.pdf b/Master/texmf-dist/doc/latex-dev/tools/enumerate.pdf Binary files differindex 4e133226043..1cf36525a6c 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/enumerate.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/enumerate.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/fileerr.pdf b/Master/texmf-dist/doc/latex-dev/tools/fileerr.pdf Binary files differindex 95ef092d454..9c6316e99a6 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/fileerr.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/fileerr.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/fontsmpl.pdf b/Master/texmf-dist/doc/latex-dev/tools/fontsmpl.pdf Binary files differindex 2e852de100f..123c70457c1 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/fontsmpl.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/fontsmpl.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/ftnright.pdf b/Master/texmf-dist/doc/latex-dev/tools/ftnright.pdf Binary files differindex 55a28a91a3d..78e4d069f7c 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/ftnright.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/ftnright.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/hhline.pdf b/Master/texmf-dist/doc/latex-dev/tools/hhline.pdf Binary files differindex fc6171e4544..36a4dd71049 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/hhline.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/hhline.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/indentfirst.pdf b/Master/texmf-dist/doc/latex-dev/tools/indentfirst.pdf Binary files differindex 5d10ea37a8f..709cf3fef51 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/indentfirst.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/indentfirst.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/layout.pdf b/Master/texmf-dist/doc/latex-dev/tools/layout.pdf Binary files differindex 7d34729a49e..5b447f8f6da 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/layout.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/layout.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/longtable.pdf b/Master/texmf-dist/doc/latex-dev/tools/longtable.pdf Binary files differindex 80927e9f7b5..05c3f41a994 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/longtable.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/longtable.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/multicol.pdf b/Master/texmf-dist/doc/latex-dev/tools/multicol.pdf Binary files differindex 82adeb962e1..e76bfdc8cc3 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/multicol.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/multicol.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/rawfonts.pdf b/Master/texmf-dist/doc/latex-dev/tools/rawfonts.pdf Binary files differindex 223b57484d9..e6163af0637 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/rawfonts.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/rawfonts.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/shellesc.pdf b/Master/texmf-dist/doc/latex-dev/tools/shellesc.pdf Binary files differindex 87a3c463e5f..2897cfc51ab 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/shellesc.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/shellesc.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/showkeys.pdf b/Master/texmf-dist/doc/latex-dev/tools/showkeys.pdf Binary files differindex 7d9da9be0c3..239bf98ed9b 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/showkeys.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/showkeys.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/somedefs.pdf b/Master/texmf-dist/doc/latex-dev/tools/somedefs.pdf Binary files differindex 0bf8da7a7ae..35da07a9437 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/somedefs.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/somedefs.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/tabularx.pdf b/Master/texmf-dist/doc/latex-dev/tools/tabularx.pdf Binary files differindex 101fd32634c..ac4f8d0765c 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/tabularx.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/tabularx.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/theorem.pdf b/Master/texmf-dist/doc/latex-dev/tools/theorem.pdf Binary files differindex 5ac90392398..7464f0e78e8 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/theorem.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/theorem.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/tools-overview.pdf b/Master/texmf-dist/doc/latex-dev/tools/tools-overview.pdf Binary files differindex 9c9f973bcd7..8292ac5e8da 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/tools-overview.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/tools-overview.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/trace.pdf b/Master/texmf-dist/doc/latex-dev/tools/trace.pdf Binary files differindex 9c6c99faf90..ce8a6d778f4 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/trace.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/trace.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/varioref.pdf b/Master/texmf-dist/doc/latex-dev/tools/varioref.pdf Binary files differindex 5b72c6e8234..3504106b149 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/varioref.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/varioref.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/verbatim.pdf b/Master/texmf-dist/doc/latex-dev/tools/verbatim.pdf Binary files differindex 768d0fa36bb..11e237e5e3d 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/verbatim.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/verbatim.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/xr.pdf b/Master/texmf-dist/doc/latex-dev/tools/xr.pdf Binary files differindex 2e53781fce0..8b1eeee4965 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/xr.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/xr.pdf diff --git a/Master/texmf-dist/doc/latex-dev/tools/xspace.pdf b/Master/texmf-dist/doc/latex-dev/tools/xspace.pdf Binary files differindex cb250640f3f..db9fa6bb442 100644 --- a/Master/texmf-dist/doc/latex-dev/tools/xspace.pdf +++ b/Master/texmf-dist/doc/latex-dev/tools/xspace.pdf diff --git a/Master/texmf-dist/source/latex-dev/amsmath/amsmath.dtx b/Master/texmf-dist/source/latex-dev/amsmath/amsmath.dtx index 88578611019..eec51f50cbe 100644 --- a/Master/texmf-dist/source/latex-dev/amsmath/amsmath.dtx +++ b/Master/texmf-dist/source/latex-dev/amsmath/amsmath.dtx @@ -86,7 +86,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \end{macrocode} % % \begin{macrocode} -\ProvidesPackage{amsmath}[2021/04/20 v2.17j AMS math features] +\ProvidesPackage{amsmath}[2021/08/28 v2.17k AMS math features] % \end{macrocode} % % \section{Catcode defenses} @@ -2627,7 +2627,9 @@ ill-advised in LaTeX.% % % \begin{macro}{\numberwithin} % Provide a convenient way to specify that equations should be -% numbered within sections. +% numbered within sections. The \LaTeX{} kernel contains a similar command +% \cs{counterwithin} (with a slightly extended syntax) that can be used +% as a drop-in replacement for \cs{numberwithin}. % \begin{macrocode} \newcommand{\numberwithin}[3][\arabic]{% \@ifundefined{c@#2}{\@nocounterr{#2}}{% @@ -6500,8 +6502,17 @@ Cannot use `split' here;\MessageBreak trying to recover with `aligned'}% \let\mathdisplay@pop\@empty \def\mathdisplay@@pop{\the\mathdisplay@stack} % \end{macrocode} -% +%\changes{v2.17k}{2021/08/24}{Move the counter inside the equation and guard +% with a mathopen for better compability with hyperref, issue gh/652} +% As with hyperref incrementing the counter creates a box to raise the anchor +% it should be in a place where is doesn't affect spacing. +% Currently the code from hyperref is used to avoid this problem: +% If fleqn isn't active the counter is set inside the equation and the potential +% box guarded by a mathopen to avoid side effects on following unary symbols. +% If fleqn is activated it has to be outside to avoid problems with labels. +% This solution is temporary and not necessarly the best. % \begin{macrocode} +\if@fleqn \renewenvironment{equation}{% \incr@eqnum \mathdisplay@push @@ -6512,6 +6523,18 @@ Cannot use `split' here;\MessageBreak trying to recover with `aligned'}% \mathdisplay@pop \ignorespacesafterend } +\else +\renewenvironment{equation}{% + \mathdisplay@push + \st@rredfalse \global\@eqnswtrue + \mathdisplay{equation}% + \incr@eqnum\mathopen{}% +}{% + \endmathdisplay{equation}% + \mathdisplay@pop + \ignorespacesafterend +} +\fi % \end{macrocode} % % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/amsmath/amsopn.dtx b/Master/texmf-dist/source/latex-dev/amsmath/amsopn.dtx index a71c13d6c89..03df1a116bc 100644 --- a/Master/texmf-dist/source/latex-dev/amsmath/amsopn.dtx +++ b/Master/texmf-dist/source/latex-dev/amsmath/amsopn.dtx @@ -58,7 +58,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [1994/12/01]% LaTeX date must December 1994 or later -\ProvidesPackage{amsopn}[2016/03/08 v2.02 operator names] +\ProvidesPackage{amsopn}[2021/08/26 v2.02 operator names] % \end{macrocode} % % What \cs{nolimits@} does is keep a \cn{limits} typed by the user @@ -72,13 +72,13 @@ Bug reports can be opened (category \texttt{#1}) at\\% % punctuation characters such as |*-/:'|. % Because the body of an % operator name is set in math mode, these few punctuation -% characters will not come out right (wrong symbol/and or wrong +% characters will not come out right (wrong symbol and/or wrong % spacing). The purpose of \cs{newmcodes@} is to make them act like % their normal text versions. % % Where practical, we use decimal numbers to cut down main mem % usage (\qc{\"} not needed). -% use |\Umathcodedefnum| with xetex and LuaTeX to avoid problems +% Use |\Umathcodedefnum| with xetex and LuaTeX to avoid problems % using |\mathcode| if |-| has already been defined using |\Umathcode|. % \changes{v2.02}{2016/03/08}{Unicode TeX version of \cs{newmcodes@}} % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/amsmath/amstext.dtx b/Master/texmf-dist/source/latex-dev/amsmath/amstext.dtx index d6475561fb0..88cc837f03a 100644 --- a/Master/texmf-dist/source/latex-dev/amsmath/amstext.dtx +++ b/Master/texmf-dist/source/latex-dev/amsmath/amstext.dtx @@ -77,7 +77,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [1994/12/01]% LaTeX date must be December 1994 or later -\ProvidesPackage{amstext}[2000/06/29 v2.01 AMS text] +\ProvidesPackage{amstext}[2021/08/26 v2.01 AMS text] % \end{macrocode} % % \section{The implementation} @@ -108,7 +108,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % If \cn{text} is encountered inside math mode the macro % \cs{text@} is called. It has one mandatory argument, the text % which should be produced. Since we do not know in which math -% style we are currently in we call \cs{mathchoice} to tyeset +% style we are currently in we call \cs{mathchoice} to typeset % our text in all four possible styles. % \begin{macrocode} \def\text@#1{{\mathchoice @@ -277,7 +277,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% %\subsection{Applications of \cn{text}} % % \begin{macro}{\mathhexbox} -% We start with an re-definition of the \fn{plain.tex} macro +% We start with a re-definition of the \fn{plain.tex} macro % \cs{mathhexbox}. (Although M. Spivak in \amstex/ uses the name % \cs{mathhexbox@} for this purpose, I [FMi] don't see any reason % to use a new name since the new definition is superior, has the diff --git a/Master/texmf-dist/source/latex-dev/base/classes.dtx b/Master/texmf-dist/source/latex-dev/base/classes.dtx index ffe04c620fa..fdf0ef3a5b0 100644 --- a/Master/texmf-dist/source/latex-dev/base/classes.dtx +++ b/Master/texmf-dist/source/latex-dev/base/classes.dtx @@ -53,7 +53,7 @@ %<*driver> \ProvidesFile{classes.drv} %</driver> - [2021/02/12 v1.4n + [2021/09/11 v1.4n %<article|report|book> Standard LaTeX document class] %<10pt|11pt|12pt> Standard LaTeX file (size option)] % \end{macrocode} @@ -221,9 +221,9 @@ % file has version number \fileversion, last revised \filedate.}} % % \author{% -% Copyright (C) 1992 by Leslie Lamport and -% Copyright (C) 1994-2020 by Frank Mittelbach and Johannes Braams and -% LaTeX Project Team +% Copyright (C) 1992 by Leslie Lamport \and +% Copyright (C) 1994-2021 by Frank Mittelbach, \and Johannes Braams and +% the \LaTeX\ Project Team % } % \date{\filedate} % \MaintainedByLaTeXTeam{latex} diff --git a/Master/texmf-dist/source/latex-dev/base/ltclass.dtx b/Master/texmf-dist/source/latex-dev/base/ltclass.dtx index 643587b0ef5..06e0f437af1 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltclass.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltclass.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltclass.dtx} - [2021/06/09 v1.4c LaTeX Kernel (Class & Package Interface)] + [2021/08/25 v1.4f LaTeX Kernel (Class & Package Interface)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltclass.dtx} @@ -68,6 +68,7 @@ % \changes{v1.0z}{1998/03/21}{Added to documentation of filecontents} % \changes{v1.1c}{1998/08/17}{(RmS) Minor documentation fixes.} % \changes{v1.3o}{2020/08/21}{Integration of new hook management interface} +% \changes{v1.4f}{2021/08/25}{Standardise generic hook names (gh/648)} % % % \section{Introduction} @@ -311,27 +312,49 @@ % default option handler, which is not used for |landscape| as that % option is explicitly declared. % +% \DescribeMacro\IfPackageLoadedTF +% \DescribeMacro\IfClassLoadedTF % \DescribeMacro\@ifpackageloaded -% To find out if a package has already been loaded, use\\ % \DescribeMacro\@ifclassloaded -% |\@ifpackageloaded{|\meta{package}|}{|\meta{true}|}{|\meta{false}|}|. -% +% To find out if a package has already been loaded, use +% \begin{quote} +% |\IfPackageLoadedTF{|\meta{package}|}{|\meta{true}|}{|\meta{false}|}|\\ +% \end{quote} +% or the old name \cs{@ifpackageloaded}. +% +% \DescribeMacro\IfPackageAtLeastTF +% \DescribeMacro\IfClassAtLeastTF % \DescribeMacro\@ifpackagelater +% \DescribeMacro\@ifclasslater % \changes{v1.1i}{2013/07/07}{Correctly describe how the date in % \cs{@ifpackagelater} is used} % To find out if a package has already been loaded with a version % equal to or more -% recent than \meta{version}, use\\ -% \DescribeMacro\@ifclasslater -% |\@ifpackagelater{|\meta{package}|}{|\meta{version}|}{|^^A -% \meta{true}|}{|\meta{false}|}|. -% +% recent than \meta{date}, use +% \begin{quote} +% |\IfPackageAtLeastTF{|\meta{package}|}{|\meta{date}|}{|^^A +% \meta{true}|}{|\meta{false}|}| +% \end{quote} +% or the old name \cs{@ifpackagelater}. + +% \DescribeMacro\IfFormatAtLeastTF +% To test the format date use +% \begin{quote} +% |\IfFormatAtLeastTF{|\meta{date}|}{|^^A +% \meta{true}|}{|\meta{false}|}| +% \end{quote} +% +% \DescribeMacro\IfPackageLoadedWithOptionsTF +% \DescribeMacro\IfClassLoadedWithOptionsTF % \DescribeMacro\@ifpackagewith +% \DescribeMacro\@ifclasswith % To find out if a package has already been loaded with at least the % options \meta{options}, use -% \DescribeMacro\@ifclasswith -% |\@ifpackagewith{|\meta{package}|}{|\meta{options}|}{|^^A -% \meta{true}|}{|\meta{false}|}|. +% \begin{quote} +% |\IfPackageLoadedWithOptionsTF{|\meta{package}|}{|\meta{options}|}{|^^A +% \meta{true}|}{|\meta{false}|}| +% \end{quote} +% or the old name \cs{@ifpackagewith}. % % There exists one package that can't be tested with the above % commands: the \texttt{fontenc} package pretends that it was never @@ -499,9 +522,10 @@ % \begin{macro}{\@classoptionslist} % List of options of the main class. % \changes{v1.0u}{1996/07/26}{made only preamble} +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \let\@classoptionslist\relax -\@onlypreamble\@classoptionslist +%\@onlypreamble\@classoptionslist % \end{macrocode} % \end{macro} % @@ -517,9 +541,10 @@ % \changes{v1.0u}{1996/07/26}{made only preamble} % List of options of the main class that haven't been declared or % loaded as class option files. +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \let\@unusedoptionlist\@empty -\@onlypreamble\@unusedoptionlist +%\@onlypreamble\@unusedoptionlist % \end{macrocode} % \end{macro} % @@ -571,11 +596,10 @@ % \begin{macro}{\@clsextension} % \begin{macro}{\@pkgextension} % The two possible values of |\@currext|. +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@clsextension{cls} \def\@pkgextension{sty} -\@onlypreamble\@clsextension -\@onlypreamble\@pkgextension % \end{macrocode} % \end{macro} % \end{macro} @@ -811,10 +835,11 @@ % % \begin{macro}{\@ptionlist} % Returns the option list of the file. +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@ptionlist#1{% \@ifundefined{opt@#1}\@empty{\csname opt@#1\endcsname}} -\@onlypreamble\@ptionlist +%\@onlypreamble\@ptionlist % \end{macrocode} % \end{macro} % @@ -824,11 +849,10 @@ % Checks to see whether a file has been loaded. % \changes{v0.2t}{1994/01/18} % {Fix typo \cs{@pkgetension}} +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@ifpackageloaded{\@ifl@aded\@pkgextension} \def\@ifclassloaded{\@ifl@aded\@clsextension} -\@onlypreamble\@ifpackageloaded -\@onlypreamble\@ifclassloaded % \end{macrocode} % % \begin{macrocode} @@ -838,11 +862,12 @@ \else \expandafter\@firstoftwo \fi} -\@onlypreamble\@ifl@aded % \end{macrocode} % \end{macro} % \end{macro} % +% +% % \begin{macro}{\@ifpackagelater} % \begin{macro}{\@ifclasslater} % |\@ifpackagelater{|\meta{name}|}{YYYY/MM/DD}{|\meta{true @@ -852,17 +877,17 @@ % A better name for it would therefore been % |\@ifpackagelaterorequal| but it is in use for more than 30 % years, so \ldots +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@ifpackagelater{\@ifl@ter\@pkgextension} \def\@ifclasslater{\@ifl@ter\@clsextension} -\@onlypreamble\@ifpackagelater -\@onlypreamble\@ifclasslater % \end{macrocode} % \end{macro} % \end{macro} % % % +% % \begin{macro}{\IfPackageAtLeastTF} % \begin{macro}{\IfClassAtLeastTF} % \begin{macro}{\IfFormatAtLeastTF} @@ -870,6 +895,7 @@ % code}|}{|\meta{false code}|}| % Test if the format is later or equal to the given date. % \changes{v1.3k}{2020/04/07}{Macro added; also in rollback (gh/168)} +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> @@ -878,9 +904,6 @@ \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater -\@onlypreamble\IfFormatAtLeastTF -\@onlypreamble\IfPackageAtLeastTF -\@onlypreamble\IfClassAtLeastTF % \end{macrocode} % For rollback pretend it was available since the beginning of dawn. % \begin{macrocode} @@ -899,11 +922,11 @@ % \end{macro} % % \begin{macro}{\@ifl@ter} +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@ifl@ter#1#2{% \expandafter\@ifl@t@r \csname ver@#2.#1\endcsname} -\@onlypreamble\@ifl@ter %</2ekernel> % \end{macrocode} % @@ -942,9 +965,6 @@ %<*2ekernel> % \end{macrocode} % -% \begin{macrocode} -\@onlypreamble\@ifl@t@r -% \end{macrocode} % \end{macro} % % \changes{v1.1j}{2016/06/20} @@ -974,17 +994,15 @@ % |\@ifpackagewith{|\meta{name}|}{|\meta{option-list}|}| % Checks that \meta{option-list} is a subset of the options % \textbf{with} which \meta{name} was loaded. +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} \def\@ifpackagewith{\@if@ptions\@pkgextension} \def\@ifclasswith{\@if@ptions\@clsextension} -\@onlypreamble\@ifpackagewith -\@onlypreamble\@ifclasswith % \end{macrocode} % % \begin{macrocode} \def\@if@ptions#1#2{% \@expandtwoargs\@if@pti@ns{\@ptionlist{#2.#1}}} -\@onlypreamble\@if@ptions % \end{macrocode} % % Probably shouldn't use |\CurrentOption| here\ldots (changed to @@ -993,6 +1011,7 @@ % {Add extra ,s so `two' is not matched with `twocolumn'} % \changes{v1.1i}{2011/08/19} % {Re-jig definition after more stringent \cs{in@} test.} +% \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}} % \begin{macrocode} %</2ekernel> %<latexrelease>\IncludeInRelease{2017/01/01}% @@ -1038,12 +1057,45 @@ %<*2ekernel> % \end{macrocode} % -% \begin{macrocode} -\@onlypreamble\@if@pti@ns -% \end{macrocode} % \end{macro} % \end{macro} % +% +% +% +% \begin{macro}{\IfPackageLoadedTF,\IfPackageLoadedWithOptionsTF, +% \IfClassLoadedTF,\IfClassLoadedWithOptionsTF} +% More public names for the commands already available for a long time. +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\IfPackageLoadedtTF}{Test package loading}% +\let \IfPackageLoadedTF \@ifpackageloaded +\let \IfClassLoadedTF \@ifclassloaded +\let \IfPackageLoadedWithOptionsTF \@ifpackagewith +\let \IfClassLoadedWithOptionsTF \@ifclasswith +% \end{macrocode} +% For rollback pretend it was available since the beginning of dawn. +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\IfPackageLoadedtTF}{Test package loading}% +%<latexrelease> +%<latexrelease>\let \IfPackageLoadedTF \@ifpackageloaded +%<latexrelease>\let \IfClassLoadedTF \@ifclassloaded +%<latexrelease>\let \IfPackageLoadedWithOptionsTF \@ifpackagewith +%<latexrelease>\let \IfClassLoadedWithOptionsTF \@ifclasswith +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% \end{macro} +% +% +% +% % \begin{macro}{\ProvidesPackage} % Checks that the current filename is correct, and defines % |\ver@filename|. @@ -1979,8 +2031,9 @@ \ifx\@nnil##1\@nnil\else % \end{macrocode} % +% \changes{v1.4d}{2021/07/12}{add \cs{unexpanded}} % \begin{macrocode} - \noexpand\@onefilewithoptions##1[{#2}][{#4}]% + \noexpand\@onefilewithoptions##1[{\unexpanded{#2}}][{#4}]% \noexpand\@pkgextension \fi \expandafter\reserved@b @@ -2289,7 +2342,7 @@ % \changes{v1.3u}{2020/11/20} % {Copy option list to the requested package.} % \changes{v1.4c}{2021/06/06} -% {Copy raw raw options for gh/580} +% {Copy raw options for gh/580} % \begin{macrocode} \expandafter\let \csname opt@\@currpkg@reqd\expandafter\endcsname @@ -2309,15 +2362,17 @@ % package otherwise, if it is \cs{@clsextension}, a class, so % depending on that we execute different hooks. If the extension is % neither, then it is another type of file without special hooks. +% \changes{v1.4e}{2021/07/23}{Make class/name/before a one-time hook} +% \changes{v1.4e}{2021/07/23}{Make package/name/before a one-time hook} % \begin{macrocode} %----------------------------------------- \ifx\@currext\@pkgextension \UseHook{package/before}% - \UseHook{package/before/\@currname}% + \UseOneTimeHook{package/\@currname/before}% \else \ifx\@currext\@clsextension \UseHook{class/before}% - \UseHook{class/before/\@currname}% + \UseOneTimeHook{class/\@currname/before}% \fi \fi % \end{macrocode} @@ -2376,27 +2431,35 @@ % \end{macrocode} % And same procedure, James, when we are finished loading, except % that the hook order is now reversed. +% \changes{v1.4e}{2021/07/23}{Make class/name/after a one-time hook} +% \changes{v1.4e}{2021/07/23}{Make package/name/after a one-time hook} % \begin{macrocode} %----------------------------------------- \ifx\@currext\@pkgextension - \UseHook{package/after/\@currname}% + \UseOneTimeHook{package/\@currname/after}% \UseHook{package/after}% \else \ifx\@currext\@clsextension - \UseHook{class/after/\@currname}% + \UseOneTimeHook{class/\@currname/after}% \UseHook{class/after}% \fi \fi}% %----------------------------------------- \@ifl@aded\@currext\@currname{}{\reserved@a}} % \end{macrocode} -% \end{macro} -% +% +% \changes{v1.4f}{2021/08/25}{Declare non-generic package and class hooks} +% Now declare the non-generic package and class hooks used above: % \begin{macrocode} -%</2ekernel|latexrelease> +\NewHook{package/before} +\NewHook{class/before} +\NewReversedHook{package/after} +\NewReversedHook{class/after} % \end{macrocode} -% +% \end{macro} +% % \begin{macrocode} +%</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000/00/00}% %<latexrelease> {\@onefilewithoptions}{Hooks and unused options issue}% diff --git a/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx b/Master/texmf-dist/source/latex-dev/base/ltcmd.dtx index 6f2153c6ea0..04be2abfbfd 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.0f} -\def\ltcmddate{2021-06-04} +\def\ltcmdversion{v1.0h} +\def\ltcmddate{2021-08-30} % \end{macrocode} % %<*driver> @@ -343,8 +343,7 @@ % % \begin{macro}{\@@_declare_cmd:Nnn, \@@_declare_expandable_cmd:Nnn} % \begin{macro}{\@@_declare_cmd_aux:Nnn} -% \begin{macro} -% {\@@_declare_cmd_internal:Nnnn, \@@_declare_cmd_internal:cnxn} +% \begin{macro}{\@@_declare_cmd_internal:Nnnn} % The main functions for creating commands set the appropriate flag then % use the same internal code to do the definition. % \begin{macrocode} @@ -400,7 +399,6 @@ #4 \@@_break_point:n {#2} } -\cs_generate_variant:Nn \@@_declare_cmd_internal:Nnnn { cnx } % \end{macrocode} % \end{macro} % \end{macro} @@ -565,15 +563,8 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_declare_env_internal:nnnn #1#2#3#4 { - \@@_declare_cmd_internal:cnxn { environment~ #1 } {#2} - { - \cs_set_nopar:Npx \exp_not:c { environment~ #1 ~end~aux } - { - \exp_not:N \exp_not:N \exp_not:c { environment~ #1~end~aux~ } - \exp_not:n { \exp_not:o \l_@@_args_tl } - } - \exp_not:n {#3} - } + \exp_args:Nc \@@_declare_cmd_internal:Nnnn { environment~ #1 } {#2} + {#3} { \cs_set_nopar:cpx { environment~ #1 ~end } { \exp_not:c { environment~ #1 ~end~aux } } @@ -584,6 +575,14 @@ \cs_set_eq:cc { end #1 } { environment~ #1 ~end } } } +\cs_new_protected:Npn \@@_set_environment_end:n #1 + { + \cs_set_nopar:cpx { environment~ #1 ~end~aux } + { + \exp_not:c { environment~ #1 ~end~aux~ } + \exp_not:o \l_@@_args_tl + } + } % \end{macrocode} % \end{macro} % \end{macro} @@ -639,7 +638,10 @@ \tl_set:Nn \l_@@_fn_code_tl {#2} \tl_set:Nn \l_@@_defaults_tl {#5} \tl_set:Nn \l_@@_process_all_tl {#6} - #4 \@@_run_code: + #4 + \bool_if:NT \l_@@_environment_bool + { \exp_args:No \@@_set_environment_end:n \l_@@_environment_str } + \@@_run_code: } \cs_generate_variant:Nn \@@_start_aux:NNnnnn { cc } % \end{macrocode} @@ -1505,12 +1507,21 @@ % % \begin{macro}{\@@_add_type_E:w} % The \texttt{E}-type argument needs a special handling of default -% values. +% values. Since each embellishment is a separate argument, it +% also needs to replicate the argument processors for each embellishment +% argument so that the numbers of arguments and processors remain in sync. +% \changes{v1.0g}{2021/08/07} +% {Replicate argument processors for all embellishments (gh/639)} % \begin{macrocode} \cs_new_protected:Npn \@@_add_type_E:w #1#2 { \@@_flush_m_args: \@@_add_default_E:nn {#1} {#2} + \use:x + { + \@@_replicate_processor:nn { \tl_count:n {#1} } + { \exp_not:o \l_@@_process_one_tl } + } \@@_add_grabber:N E \tl_put_right:Nn \l_@@_signature_tl { {#1} } \@@_prepare_signature:N @@ -1518,6 +1529,48 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_replicate_processor:nn} +% In the command's argument processor signature (the final argument of +% \cs{@@_start:nNNnnn}) there is one braced item for each formal +% argument (up to nine), and in each of these items there is one +% braced item for each processor (as many as there were processors +% declared for a given argument). Something like this: +% \begin{quote} +% \ttfamily \obeylines +% \{ \% argument processors +% \ \ \{ \% argument 1 +% \ \ \ \ \{ processor 1 \} \{ processor 2 \} \ldots\ \{ processor n \} +% \ \ \} \% end argument 1 +% \ \ \{ \ldots\ \} \% argument 2 +% \ \ \ \ \ \vdots +% \ \ \{ \ldots\ \} \% argument n +% \} \% end argument processors +% \end{quote} +% +% The function \cs{@@_add_grabber:N} adds one single grabber for an +% argument, and adds the braced item for that one argument. However, +% in an |E|-type argument each embellishment requires its own formal +% argument, so we need to break out of one layer of braces in +% \cs{l_@@_process_one_tl}, add copies of the processor as necessary, +% and then return the removed brace. The function below does just +% that: it defines \cs{l_@@_process_one_tl} starting with a |}|$_2$ +% and ending with a |{|$_1$, so that it adds as many processors as +% needed when |x|-expanded. +% \begin{macrocode} +\cs_new_protected:Npn \@@_replicate_processor:nn #1 #2 + { + \int_compare:nNnF {#1} > { 1 } { \use_none:nnn } + \tl_set:Nx \l_@@_process_one_tl + { + \exp_not:n { \exp_not:n {#2} \if_false: { \fi: } } + \prg_replicate:nn { #1 - 2 } + { \exp_not:n { \exp_not:n { {#2} } } } + \exp_not:n { { \if_false: } \fi: \exp_not:n {#2} } + } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_add_type_m:w} % The \texttt{m} type is special as short arguments which are not % post-processed are simply counted at this stage. Thus there is a check @@ -1608,6 +1661,8 @@ % \cs{l_@@_obey_spaces_bool} boolean can only be \texttt{true} for % trailing optional arguments. In that case spaces will not be % ignored when looking for that optional argument. +% \changes{v1.0g}{2021/08/07} +% {Replicate argument processors for all embellishments (gh/639)} % \begin{macrocode} \cs_new_protected:Npn \@@_add_grabber:N #1 { @@ -1624,7 +1679,12 @@ \bool_set_false:N \l_@@_long_bool \bool_set_false:N \l_@@_obey_spaces_bool \tl_put_right:Nx \l_@@_process_all_tl - { { \exp_not:o \l_@@_process_one_tl } } + { + { + \if_charcode:w E #1 \use_i:nn \fi: + \exp_not:o \l_@@_process_one_tl + } + } \tl_clear:N \l_@@_process_one_tl } % \end{macrocode} @@ -1676,8 +1736,7 @@ % We have already checked that short arguments are before long % arguments, so \cs{l_@@_long_bool} only changes from \texttt{false} % to \texttt{true} once (and there is no need to reset it after each -% argument). Also knock back the argument count because |+| is not an -% argument. Continue the loop. +% argument). Continue the loop. % \begin{macrocode} \cs_new_protected:cpn { @@_add_expandable_type_+:w } { @@ -1875,6 +1934,657 @@ % \end{macro} % \end{macro} % +% \subsubsection{Copying a command and its internal structure} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_copy:NN}% +%<latexrelease> {Support~\NewCommandCopy~in~ltcmd} +% \end{macrocode} +% +% \changes{v1.0h}{2021/08/30}{Added support for \cs{NewCommandCopy}} +% Since the 2020-10-01 \LaTeXe{} release, support for copying, and +% showing the definition of, robust commands has been available, but the +% specifics of each command are implemented separately. Here we'll add +% support for copying and showing \pkg{ltcmd} definitions. +% +% To fully support copying, we need two commands: a conditional to test +% if a command is in fact a \pkg{ltcmd} command, and another command to +% actually copy the command. The conditional is defined later as +% \cs{__kernel_cmd_if_xparse:NTF}, so now to the copying: +% +% \begin{macro}{\@@_copy:NN} +% \begin{macro}{\@@_set_eq_if_exist:NN,\@@_set_eq_if_exist:cc} +% This macro just branches to the proper copying command by using +% \cs{@@_cmd_type_cases:NnnnnF}. The copying command takes the names +% of the commands to be copied to and from, and the actual commands +% as its four arguments. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy:NN #1 #2 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \@@_cmd_type_cases:NnnnnF \exp_not:N #2 + { \@@_copy_command:nnNN } + { \@@_copy_expandable:nnNN } + { \@@_copy_environment:nnNN } + { \@@_copy_environment_end:nnNN } + { \@@_cant_copy:nwn { non-ltcmd } } + { \cs_to_str:N #1 } { \cs_to_str:N #2 } + \exp_not:N #1 \exp_not:N #2 + \exp_not:N \@@_break_point:n { \cs_to_str:N #2 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +\cs_new_protected:Npn \@@_set_eq_if_exist:NN #1 #2 + { \cs_if_exist:NTF #2 { \cs_set_eq:NN } { \use_none:nn } #1 #2 } +\cs_generate_variant:Nn \@@_set_eq_if_exist:NN { cc } +% \end{macrocode} +% +% \begin{macro}{\@@_cant_copy:nwn} +% An utility macro similar to \cs{@@_bad_def:wn} to abort a command +% copy. Contrary to \cs{@@_bad_def:wn} though, when this happens the +% issue is most likely internal, because the command was already +% (supposedly) correcly defined so it should be copyable. Hopefully +% this macro will never be used ever, but if it does, apologise and +% give the reason for the failure so the user can report. +% \begin{macrocode} +\cs_new_protected:Npn \@@_cant_copy:nwn #1 #2 \@@_break_point:n #3 + { \msg_error:nnnn { cmd } { copy-bug } {#1} {#3} } +\msg_new:nnn { cmd } { copy-bug } + { + Error~while~copying~command~\iow_char:N\\#2:\\ + \str_case:nn {#1} + { + { non-ltcmd } { Command~is~not~a~valid~ltcmd~command. } + { unknown-type } { Found~an~unknown~argument~type. } + { invalid-end } + { Target~command~is~not~named~\iow_char:N \\end<name>. } + } + } +% \end{macrocode} +% \end{macro} +% +% And, of course, add \cs{__kernel_cmd_if_xparse:NTF} and +% \cs{@@_copy:NN} to \cs{@declarecommandcopylisthook}: +% \begin{macrocode} +\tl_gput_right:Nn \@declarecommandcopylisthook + { { \__kernel_cmd_if_xparse:NTF \@@_copy:NN } } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_copy_command:nnNN,\@@_copy_command:NnNNnnnn} +% A normal (non-expandable) command has a pretty straightforward +% structure. Its definition is stored in +% \cs{\meta{cmd}\textvisiblespace code}, its defaults (if any) are +% stored in \cs{\meta{cmd}\textvisiblespace defaults}, and its +% top-level definition contains its signature, which can just be +% copied over. \cs{@@_copy_command:nnNN} copies the command code and +% defaults, and then defines the top-level command using the auxiliary +% \cs{@@_copy_command:NnNNnnnn}. This macro takes the signature of +% the command being copied from its top-level definition, and replaces +% the named bits with the new name. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_command:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { #1 ~ code } { #2 ~ code } + \@@_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } + \cs_set_protected_nopar:Npx #3 + { \exp_after:wN \@@_copy_command:NnNNnnnn #4 {#1} } + } +\cs_new:Npn \@@_copy_command:NnNNnnnn #1 #2 #3 #4 #5 #6 #7 #8 + { + #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } \exp_not:c { #8 ~ code } + \exp_not:n { {#5} {#6} {#7} } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_copy_expandable:nnNN,\@@_copy_expandable:NnNNNNnnn} +% An expandable command is slightly more complicated. Besides the +% \cs{\meta{cmd}\textvisiblespace code}, and +% \cs{\meta{cmd}\textvisiblespace defaults}, it also has an auxiliary +% \cs{\meta{cmd}\textvisiblespace} for grabbing delimited arguments, +% and possibly another auxiliary +% \cs{\meta{cmd}\textvisiblespace\textvisiblespace}, if the command +% has both long and short arguments. Then, its signature also has +% several specific bits that are unique to that command; this is in contrast to +% non-expandable commands, which use a common set of parsing functions. +% +% We start by copying the basics, then call +% \cs{@@_copy_expandable_signature:NnNNNNnnn} to parse the signature +% of the command and build up the modified copy in a temporary token list, +% then we call \cs{@@_copy_expandable:NnNNNNnnn} that will copy the +% top-level definition of the command, with the proper internal +% renames. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_expandable:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { #1 ~ code } { #2 ~ code } + \@@_set_eq_if_exist:cc { #1 ~ } { #2 ~ } + \@@_set_eq_if_exist:cc { #1 ~ \c_space_tl } { #2 ~ \c_space_tl } + \@@_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } + \exp_after:wN \@@_copy_expandable_signature:NnNNNNnnn #4 {#1} {#2} + \cs_set_nopar:Npx #3 + { \exp_after:wN \@@_copy_expandable:NnNNNNnnn #4 {#1} {#2} } + } +\cs_new:Npn \@@_copy_expandable:NnNNNNnnn #1 #2 #3 #4 #5 #6 #7 #8 #9 + { + \exp_not:N #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } + \exp_not:c + { + #8 ~ + \str_if_eq:eeT + { \exp_not:c { #9 ~ \c_space_tl } } { \exp_not:N #4 } + { \c_space_tl } + } + \exp_not:c { #8 ~ code } + \str_if_eq:eeTF { \exp_not:N #6 } { ? } + { ? } + { \exp_not:c { #8 ~ defaults } } + { \exp_not:V \l_@@_tmpa_tl } + } +% \end{macrocode} +% +% \begin{macro}{ +% \@@_copy_expandable_signature:NnNNNNnnn, +% \@@_copy_expandable:nnN, +% \@@_copy_parse_grabber:w, +% } +% A signature for an expandable command contains as many +% \cs{expandable_grab_\meta{type}:w} as there are arguments, and what +% follows this macro depends on the \meta{type}. We'll start a loop +% through the signature, and at each argument grabber, we'll step the +% argument count, and look for the \meta{type} with +% \cs{@@_copy_parse_grabber:w} so that we know which +% \cs{@@_copy_grabber_\meta{type}:w} to call next. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_expandable_signature:NnNNNNnnn + #1 #2 #3 #4 #5 #6 #7 #8 #9 + { + \int_zero:N \l_@@_current_arg_int + \tl_clear:N \l_@@_tmpa_tl + \@@_copy_expandable:nnN {#8} {#9} #7 + \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \@@_copy_expandable:nnN #1 #2 #3 + { + \quark_if_recursion_tail_stop:n {#3} + \int_incr:N \l_@@_current_arg_int + \exp_after:wN \@@_copy_parse_grabber:w \token_to_str:N #3 {#1} {#2} + } +\use:x + { + \cs_new_protected:Npn \exp_not:N \@@_copy_parse_grabber:w ##1 + \tl_to_str:n { expandable_grab_ } ##2 \tl_to_str:n { :w } + { + \tl_put_right:Nx \exp_not:N \l_@@_tmpa_tl + { \exp_not:N \exp_not:c { @@_expandable_grab_##2:w } } + \exp_not:N \cs_if_exist_use:cF { @@_copy_grabber_##2:w } + { \@@_cant_copy:nwn { unknown-type } } + } + } +% \end{macrocode} +% +% \begin{macro}{ +% \@@_copy_grabber_D:w,\@@_copy_grabber_D_alt:w, +% \@@_copy_grabber_R:w,\@@_copy_grabber_R_alt:w, +% \@@_copy_grabber_E:w,\@@_copy_grabber_E_long:w, +% \@@_copy_grabber_t:w, +% \@@_copy_grabber_m:w,\@@_copy_grabber_m_long:w, +% } +% The most complicated is the |D|elimited argument: each argument has +% a dedicated grabbing function named after the command that has to be +% copied over (of the form +% \cs{\meta{cmd}\textvisiblespace(arg\textvisiblespace\meta{num})}). +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_D:w #1 #2 #3 #4 #5 + { + \tl_put_right:Nx \l_@@_tmpa_tl + { + \exp_not:c { #1 ~ (arg ~ \int_use:N \l_@@_current_arg_int ) } + \exp_not:n { #4 #5 } + } + \cs_set_eq:cc + { #1 ~ (arg ~ \int_use:N \l_@@_current_arg_int ) } + { #2 ~ (arg ~ \int_use:N \l_@@_current_arg_int ) } + \@@_copy_expandable:nnN {#1} {#2} + } +% \end{macrocode} +% +% |D_alt| is just a special case of |D| that uses a single delimiter +% (used when both delimiters of the argument are identical): +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_D_alt:w #1 #2 #3 #4 + { \@@_copy_grabber_D:w {#1} {#2} {#3} {#4} { } } +% \end{macrocode} +% +% As far as copying is concerned, |R| is identical to |D|: +% \begin{macrocode} +\cs_new_eq:NN \@@_copy_grabber_R:w \@@_copy_grabber_D:w +\cs_new_eq:NN \@@_copy_grabber_R_alt:w \@@_copy_grabber_D_alt:w +% \end{macrocode} +% +% |E| is straightforward: we just copy the embellishments over, and +% increase the current argument number \cs{l_@@_current_arg_int} by +% the number of embellishments (minus one because there is a +% \cs{int_incr:N} down the line). +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_E:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l_@@_tmpa_tl { {#3} {#4} } + \int_add:Nn \l_@@_current_arg_int { \tl_count:n {#4} - 1 } + \@@_copy_expandable:nnN {#1} {#2} + } +\cs_new_eq:NN \@@_copy_grabber_E_long:w \@@_copy_grabber_E:w +% \end{macrocode} +% +% |t| just needs copying the token to be tested for: +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_t:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l_@@_tmpa_tl { #3 #4 } + \@@_copy_expandable:nnN {#1} {#2} + } +% \end{macrocode} +% +% And last but not least, |m| is the simplest; the grabber is just +% \cs{@@_expandable_grab_m:w}, which is already added to the new +% command so here we just resume the loop: +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_m:w { \@@_copy_expandable:nnN } +\cs_new_eq:NN \@@_copy_grabber_m_long:w \@@_copy_grabber_m:w +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_copy_environment:nnNN} +% \begin{macro}{\@@_copy_environment:Nnnnnnn} +% Copying an environment's \cs{begin} part is pretty much like copying +% a command, except it has a longer name, and at the end we have to +% copy \cs[no-index]{environment~\meta{name}} into +% \cs[no-index]{\meta{name}}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_environment:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { environment~ #1 ~ code } { environment~ #2 ~ code } + \@@_set_eq_if_exist:cc + { environment~ #1 ~ defaults } { environment~ #2 ~ defaults } + \cs_set_protected_nopar:cpx { environment~ #1 } + { \exp_after:wN \@@_copy_environment:Nnnnnnn #4 {#1} } + \cs_set_eq:cc {#1} { environment~ #1 } + } +\cs_new:Npn \@@_copy_environment:Nnnnnnn #1 #2 #3 #4 #5 #6 #7 + { #1 \exp_not:n { {#2} } {#7} \exp_not:n { {#4} {#5} {#6} } } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_copy_environment_end:nnNN} +% \begin{macro}{\@@_copy_environment_end_aux:nnNN} +% Copying an environment's \cs{end} part is a bit trickier. We first +% have to make sure that both parts are named +% \cs[no-index]{end\meta{name}} (that's actually not a hard +% requirement, but an environment \cs{end} command makes no sense +% without the |end| in its name), and strip the leading |end| from the +% strings. After that, copying is straightforward. +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_environment_end:nnNN #1 #2 + { + \@@_check_end:Nn \l_@@_tmpa_tl {#1} + \@@_check_end:Nn \l_@@_tmpb_tl {#2} + \exp_args:Noo \@@_copy_environment_end_aux:nnNN + { \l_@@_tmpa_tl } { \l_@@_tmpb_tl } + } +\cs_new_protected:Npn \@@_copy_environment_end_aux:nnNN #1 #2 #3 #4 + { + \cs_set_nopar:cpx { environment~ #1 ~end } + { \exp_not:c { environment~ #1 ~end~aux } } + \cs_set_eq:cc + { environment~ #1 ~end~aux~ } { environment~ #2 ~end~aux~ } + \cs_set_eq:cc { end #1 } { environment~ #1 ~end } + } +% \end{macrocode} +% +% \begin{macro}{\@@_check_end:Nn,\@@_check_end:n,\@@_check_end:w} +% To check whether an \cs{end} command is valid, we look for the +% string |end| at the beginning of the command name, and if not found, +% raise an error: +% \begin{macrocode} +\cs_new_protected:Npn \@@_check_end:Nn #1 #2 + { + \tl_set:Nx #1 { \@@_check_end:n {#2} } + \token_if_eq_meaning:NNT #1 \q_nil + { \@@_cant_copy:nwn { invalid-end } } + } +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new:Npn \@@_check_end:n ##1 + { + \exp_after:wN \@@_check_end:w \tl_to_str:n {##1} + #1 \q_mark #1 \q_stop + } + \cs_new:Npn \@@_check_end:w ##1 #1 ##2 #1 ##3 \q_stop + { \if_meaning:w ##2 \q_mark \exp_not:N \q_nil \else: ##2 \fi: } + } +\exp_args:No \@@_tmp:w { \tl_to_str:n { end } } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Not much to do regarding \pkg{latexrelease}: we could remove the +% entries from \cs{@declarecommandcopylisthook}, but it doesn't seem +% worth it. +% \begin{macrocode} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_copy:NN}% +%<latexrelease> {Support~\NewCommandCopy~in~ltcmd} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \subsubsection{Showing the definition of a command} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_show:N}% +%<latexrelease> {Support~\ShowCommand~in~ltcmd} +% \end{macrocode} +% +% \changes{v1.0h}{2021/08/30}{Added support for \cs{ShowCommand}} +% To show the definition of a command we need more or less the same +% building blocks as for copying, except that instead of making a copy, +% we'll just print stuff to the terminal. +% +% \begin{macro}{\@@_show:N} +% This macro just branches to the proper showing command by using +% \cs{@@_cmd_type_cases:NnnnnF}. The showing command takes the command +% to be shown as argument. +% \begin{macrocode} +\cs_new_protected:Npn \@@_show:N #1 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \@@_cmd_type_cases:NnnnnF \exp_not:N #1 + { \@@_show_command:N } + { \@@_show_expandable:N } + { \@@_show_environment:N } + { \@@_show_environment_end:N } + { \@@_cant_copy:nwn { non-ltcmd } } + \exp_not:N #1 + \exp_not:N \@@_break_point:n { \cs_to_str:N #1 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \@@_show_command:N, +% \@@_show_command:NnNNwN, +% \@@_show_expandable:N, +% \@@_show_expandable:NnNNNNnN, +% \@@_show_command_aux:nNNn, +% \@@_show_environment:N, +% } +% These commands just expand the command once to reveal its innards, +% then pass the type of command, the control sequence, the signature, +% and the code macro to \cs{@@_show_command_aux:nNNn}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_show_command:N #1 + { \exp_after:wN \@@_show_command:NnNNwN #1 \q_@@ #1 } +\cs_new_protected:Npn \@@_show_command:NnNNwN #1 #2 #3 #4 #5 \q_@@ #6 + { \@@_show_command_aux:nNNn { document~command } #6 #4 {#2} } +\cs_new_protected:Npn \@@_show_expandable:N #1 + { \exp_after:wN \@@_show_expandable:NnNNNNnN #1 #1 } +\cs_new_protected:Npn \@@_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 + { \@@_show_command_aux:nNNn { expandable~document~command } #8 #5 {#2} } +% \end{macrocode} +% +% Now just print everything in the required format. The auxiliary +% \cs{@@_split_signature:n} stores a ready-to-print token list in +% \cs{l_@@_tmpa_tl}, so we ust use that here: +% \begin{macrocode} +\cs_new_protected:Npn \@@_show_command_aux:nNNn #1 #2 #3 #4 + { + \@@_split_signature:n {#4} + \iow_term:x + { + > ~ \token_to_str:N #2 = #1: \iow_newline: + \tl_use:N \l_@@_tmpa_tl + -> \cs_replacement_spec:N #3 . + } + } +% \end{macrocode} +% +% We can reuse most of the above to show an environment, except that +% we need to ensure that the proper \cs[no-index]{environment~\ldots} +% are passed to \cs{@@_show_command_aux:nNNn}. Additionally, when +% |\ShowCommand\foo| is used (if |foo| is an environment), we show +% |\endfoo| as well, and when |\ShowCommand\endfoo| is used, change +% that to |\ShowCommand\foo| and do the same. +% \begin{macrocode} +\cs_new_protected:Npn \@@_show_environment:N #1 + { + \exp_after:wN \@@_show_environment:Nnnw #1 \q_@@ + \iow_term:x + { + > ~ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline: + -> \exp_args:Nc \cs_replacement_spec:N + { environment~ \cs_to_str:N #1 ~end~aux~ } . + } + } +\cs_new_protected:Npn \@@_show_environment:Nnnw #1 #2 #3 #4 \q_@@ + { + \use:x + { + \@@_show_command_aux:nNNn { document~environment } + { \exp_not:N \begin {#3} } + \exp_not:c { environment~ #3 ~ code } + {#2} + } + } +\cs_new_protected:Npn \@@_show_environment_end:N #1 + { + \exp_args:NNx \@@_check_end:Nn \l_@@_tmpa_tl { \cs_to_str:N #1 } + \exp_args:Nc \@@_show_environment:N { \l_@@_tmpa_tl } + } +% \end{macrocode} +% +% And, of course, add \cs{__kernel_cmd_if_xparse:NTF} and +% \cs{@@_show:N} to \cs{@showcommandlisthook}: +% \begin{macrocode} +\tl_gput_right:Nn \@showcommandlisthook + { { \__kernel_cmd_if_xparse:NTF \@@_show:N } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_split_signature:n} +% Now we'll try a least-effort adventure into splitting the symbolic +% user-provided signature for a command into individual parameters for +% pretty-printing. A counter is used to keep track of the current +% argument number, and two token lists are used: \cs{l_@@_tmpa_tl} +% holds the final token list to be printed, and \cs{l_@@_tmpb_tl} +% holds just the current item, so that we can make changes to an +% individual item without having to dissect the whole thing (this is +% used for |e|- and |E|-types). +% \begin{macrocode} +\cs_new_protected:Npn \@@_split_signature:n #1 + { + \int_set:Nn \l_@@_current_arg_int { 1 } + \tl_clear:N \l_@@_tmpa_tl + \tl_clear:N \l_@@_tmpb_tl + \@@_split_signature_loop:Nw #1 \q_recursion_tail \q_recursion_stop + } +% \end{macrocode} +% +% \begin{macro}{\@@_split_signature_loop:Nw} +% This is the main chunk of the loop: it starts an item with +% \cs{@@_split_start_item:} +% (this adds indentation and the argument number to +% \cs{l_@@_tmpb_tl}), then checks if a special token list +% \cs[no-index]{c_@@_show_type_\meta{type}_tl} exists. If it doesn't, +% the current argument is a ``simple'' type which needs no extra +% processing. Otherwise, call a specific function depending on the +% value of said token list. +% \begin{macrocode} +\cs_new_protected:Npn \@@_split_signature_loop:Nw #1 + { + \quark_if_recursion_tail_stop:N #1 + \tl_if_empty:NT \l_@@_tmpb_tl { \@@_split_start_item: } + \tl_if_exist:cTF { c_@@_show_type_#1_tl } + { + \use:c + { + @@_show_ + \if_case:w \tl_use:c { c_@@_show_type_#1_tl } \exp_stop_f: + delim \or: delims \or: delims_opt \or: opt \or: + e \or: E \or: prefix \or: processor \fi: :Nw + } #1 + } + { \@@_split_end_item:n {#1} \@@_split_signature_loop:Nw } + } +% \end{macrocode} +% +% \begin{macro}{ +% \c_@@_show_type_t_tl, +% \c_@@_show_type_r_tl,\c_@@_show_type_d_tl, +% \c_@@_show_type_R_tl,\c_@@_show_type_D_tl, +% \c_@@_show_type_O_tl, +% \c_@@_show_type_e_tl, +% \c_@@_show_type_E_tl, +% \c_@@_show_type_+_tl,\c_@@_show_type_!_tl, +% \c_@@_show_type_>_tl, +% } +% The token lists \cs[no-index]{c_@@_show_type_\meta{type}_tl} exist +% for nontrivial (for printing) \meta{types} that require special +% parsing (like delimiters or optional arguments). Values from~0 to~7 +% are assigned to each type: +% \begin{enumerate} +% \item a single delimiter token; +% \item two delimiter tokens; +% \item two delimiter tokens plus a default value; +% \item a default value; +% \item a list of embellishments (exclusive for |e|-type); +% \item embellishments plus defaults (exclusive for |E|-type); +% \item simple prefixes; +% \item prefixes with arguments (argument processors); +% \end{enumerate} +% \begin{macrocode} +\cs_set_protected:Npn \@@_tmp:w #1 #2 + { + \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 +% \end{macrocode} +% +% \begin{macro}{ +% \@@_show_delim:Nw,\@@_show_delims:Nw, +% \@@_show_delims_opt:Nw,\@@_show_opt:Nw, +% \@@_show_e:Nw,\@@_show_E:Nw, +% \@@_show_prefix:Nw,\@@_show_processor:Nw, +% } +% Now, based on each type we know how to act. In most cases it is +% just a matter of feeding in the grabbed arguments and resuming the +% loop. The embellishments require a bit more attention: the +% |e|-type loops through the list of embellishments and adds each to +% the token list as a separate argument. The |E|-type does more or +% less the same, but uses \cs{@@_tl_mapthread_function:nnN} to map +% over two lists simultaneously, adding each token and default to the +% token list for printing. +% \begin{macrocode} +\cs_new_protected:Npn \@@_show_delim:Nw #1 #2 + { \@@_split_end_item:n { #1 #2 } \@@_split_signature_loop:Nw } +\cs_new_protected:Npn \@@_show_delims:Nw #1 #2 #3 + { \@@_split_end_item:n { #1 #2 #3 } \@@_split_signature_loop:Nw } +\cs_new_protected:Npn \@@_show_delims_opt:Nw #1 #2 #3 #4 + { \@@_split_end_item:n { #1 #2 #3 {#4} } \@@_split_signature_loop:Nw } +\cs_new_protected:Npn \@@_show_opt:Nw #1 #2 + { \@@_split_end_item:n { #1 {#2} } \@@_split_signature_loop:Nw } +\cs_new_protected:Npn \@@_show_e:Nw #1 #2 + { + \tl_map_inline:nn {#2} + { + \@@_split_start_item: + \@@_split_end_item:n { #1 ##1 } + } + \@@_split_signature_loop:Nw + } +\cs_set_protected:Npn \@@_tmp:w #1 + { + \cs_new_protected:Npn \@@_show_E:Nw ##1 ##2 ##3 + { + \cs_set_protected:Npn \@@_tmp:w ####1 ####2 + { + \@@_split_start_item: + \@@_split_end_item:n { ##1 ####1 {####2} } + } + \@@_tl_mapthread_function:nnN {##2} + { ##3 {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} } \@@_tmp:w + \@@_split_signature_loop:Nw + } + } +\exp_args:NV \@@_tmp:w \c_novalue_tl +% \end{macrocode} +% +% Minor wrinkle with the prefixes: they use \cs{@@_split_add_item:n} +% instead of \cs{@@_split_end_item:n} (|add| \emph{vs.} |end|) because +% they are followed by an argument, so they can't end the item. +% \begin{macrocode} +\cs_new_protected:Npn \@@_show_prefix:Nw #1 + { \@@_split_add_item:n {#1} \@@_split_signature_loop:Nw } +\cs_new_protected:Npn \@@_show_processor:Nw #1 #2 + { \@@_split_add_item:n { #1 {#2} } \@@_split_signature_loop:Nw } +% \end{macrocode} +% +% \begin{macro}{ +% \@@_split_start_item:, +% \@@_split_add_item:n, +% \@@_split_end_item:n, +% } +% And now the auxiliaries that store the strings to be printed. +% \cs{@@_split_start_item:} starts an item from scratch, +% \cs{@@_split_add_item:n} adds tokens to an item without adding a +% newline, and \cs{@@_split_end_item:n} adds tokens, terminates the +% item with a newline, and steps the argument count. +% \begin{macrocode} +\cs_new_protected:Npn \@@_split_start_item: + { + \tl_set:Nx \l_@@_tmpb_tl + { ~ \c_space_tl \c_hash_str \int_use:N \l_@@_current_arg_int : } + } +\cs_new_protected:Npn \@@_split_add_item:n #1 + { \tl_put_right:Nx \l_@@_tmpb_tl { \tl_to_str:n {#1} } } +\cs_new_protected:Npn \@@_split_end_item:n #1 + { + \tl_put_right:Nx \l_@@_tmpa_tl + { \l_@@_tmpb_tl \tl_to_str:n {#1} \iow_newline: } + \tl_clear:N \l_@@_tmpb_tl + \int_incr:N \l_@@_current_arg_int + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Not much to do regarding \pkg{latexrelease}: we could remove the +% entries from \cs{@showcommandlisthook}, but it doesn't seem +% worth it. +% \begin{macrocode} +%<latexrelease>\EndIncludeInRelease +% +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_show:N}% +%<latexrelease> {Support~\ShowCommand~in~ltcmd} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% % \subsection{Grabbing arguments} % % All of the grabbers follow the same basic pattern. The initial @@ -2023,6 +2733,7 @@ % \end{macro} % \end{macro} % \end{macro} +% % \begin{macro}{\@@_grab_D_nested:NNnN} % \begin{macro}{\@@_grab_D_nested:w} % \begin{macro}{\l_@@_nesting_a_tl} @@ -3375,8 +4086,11 @@ % \end{macro} % % \begin{macro}{\__kernel_cmd_if_xparse:NTF} +% \begin{macro}{\@@_cmd_type_cases:Nnnnn} % \changes{v1.0d}{2021/04/19}{Renamed \cs{__cmd_cmd_if_xparse:NTF} to % \cs{__kernel_cmd_if_xparse:NTF} for cross-module usage} +% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:Nnnnn} for +% \cs{NewCommandCopy} and \cs{ShowCommand} support} % \begin{macro}{\@@_cmd_if_xparse_aux:N} % % To determine whether the command is an \pkg{xparse} command check @@ -3384,31 +4098,50 @@ % that its |replacement_spec| starts with either % \cs{@@_start:nNNnnn} (non-expandable command) or % \cs{@@_start_expandable:nNNNNn} (expandable command) or -% \cs{@@_start_env:nnnnn} (environment). +% \cs{@@_start_env:nnnnn} (environment) or +% \cs[no-index]{environment~\#1~end~aux} (environment end). % % This conditional is needed in several kernel modules and is % therefore has a kernel-internal name. % \begin{macrocode} -\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 +\cs_new_protected:Npn \@@_cmd_type_cases:NnnnnF #1 #2 #3 #4 #5 #6 { - \exp_args:Nf \str_case_e:nnTF + \exp_args:Ne \str_case_e:nnF { \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 } { - \exp_last_unbraced:Nf \@@_cmd_if_xparse_aux:w - { \cs_replacement_spec:N #1 } ~ \q_stop + \token_if_macro:NT #1 + { + \exp_after:wN \exp_after:wN + \exp_after:wN \token_to_str:N + \exp_after:wN \use_i_delimit_by_q_stop:nw + #1 \scan_stop: \q_stop + } } } { - { \token_to_str:N \@@_start:nNNnnn } { } - { \token_to_str:N \@@_start_expandable:nNNNNn } { } - { \token_to_str:N \@@_start_env:nnnnn } { } + { \token_to_str:N \@@_start:nNNnnn } {#2} + { \token_to_str:N \@@_start_expandable:nNNNNn } {#3} + { \token_to_str:N \@@_start_env:nnnnn } {#4} + { + \exp_after:wN \token_to_str:N + \cs:w environment~ + \exp_last_unbraced:Ne \use_none:nnn + { \cs_to_str:N #1 } ~end~aux \cs_end: + } {#5} } + {#6} + } +\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 + { + \@@_cmd_type_cases:NnnnnF #1 + { } { } { } { } { \use_iii:nnn } + \use_i:nn } -\cs_new:Npn \@@_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1} % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\@@_peek_nonspace:NTF, \@@_peek_nonspace_remove:NTF, \@@_peek_nonspace_aux:nNNTF} % Collect spaces in a loop, and put the collected spaces back in the @@ -3434,7 +4167,7 @@ % token is a control sequence, also check that the \meta{csname} is % the same as the control sequence peeked at. This extra verification % is necessary when the command is delimited by control sequence tokens -% (as opposed to character tokens), and we want the the exact same +% (as opposed to character tokens), and we want the exact same % control sequence to match. % \begin{macrocode} \cs_new_protected:Npn \@@_peek_meaning:NTF @@ -3541,6 +4274,13 @@ with~an~environment~that~already~has~a~definition. \\ \\ The~existing~definition~of~'#1'~will~not~be~altered. } +\msg_new:nnnn { cmd } { env-end-already-defined } + { End~of~environment~'#1'~already~defined. } + { + You~have~used~\NewDocumentEnvironment + with~an~environment~that~already~has~a~definition~for~'end#1'. \\ \\ + The~existing~definition~of~'#1'~will~not~be~altered. + } \msg_new:nnnn { cmd } { env-undefined } { Environment~'#1'~undefined. } { @@ -3829,6 +4569,7 @@ % \end{macro} % % \begin{macro}{\NewDocumentEnvironment} +% \changes{v1.0h}{2021/08/27}{Check for end-of-environment command} % \begin{macro}{\RenewDocumentEnvironment} % \begin{macro}{\ProvideDocumentEnvironment} % \begin{macro}{\DeclareDocumentEnvironment} @@ -3838,7 +4579,11 @@ { \cs_if_exist:cTF {#1} { \msg_error:nnx { cmd } { env-already-defined } {#1} } - { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } + { + \cs_if_exist:cTF { end #1 } + { \msg_error:nnx { cmd } { env-end-already-defined } {#1} } + { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } + } } \cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4 { diff --git a/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx b/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx index 40cd55e52c7..b6c57a41acc 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltcmdhooks.dtx @@ -13,8 +13,8 @@ % %%% From File: ltcmdhooks.dtx % -\def\ltcmdhooksversion{v1.0b} -\def\ltcmdhooksdate{2021/05/26} +\def\ltcmdhooksversion{v1.0d} +\def\ltcmdhooksdate{2021/08/25} % % % @@ -400,24 +400,44 @@ % % \subsection{Patching or delaying} % -% \begin{macro}{\@@_try_put_cmd_hook:n,\@@_try_put_cmd_hook:w} % Before |\begin{document}| all patching is delayed. +% +% \begin{macro}{\@@_try_put_cmd_hook:n,\@@_try_put_cmd_hook:w} % This function is called from within \cs{AddToHook}, when code is -% added to a generic |cmd| hook is newly declared. It checks whether -% the patch position is valid, then proceeds to trying to patch or -% delaying to |\begin{document}| if in the preamble. +% first added to a generic |cmd| hook. +% If it is called within in the preamble, it delays the action +% until |\begin{document}|; +% otherwise it tries to update the hook. +% \changes{v1.0d}{2021/08/25}{Simplify generic hook detection} % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_put_cmd_hook:n}% +%<latexrelease> {Standardise~generic~hook~names} \cs_new_protected:Npn \@@_try_put_cmd_hook:n #1 { \@@_try_put_cmd_hook:w #1 / / / \s_@@_mark {#1} } \cs_new_protected:Npn \@@_try_put_cmd_hook:w #1 / #2 / #3 / #4 \s_@@_mark #5 { \@@_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } } - \str_case:nnTF {#3} - { { before } { } { after } { } } - { \exp_args:Nc \@@_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } - { \msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} } + \exp_args:Nc \@@_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/06/01}{\@@_try_put_cmd_hook:n}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\cs_new_protected:Npn \@@_try_put_cmd_hook:n #1 +%<latexrelease> { \@@_try_put_cmd_hook:w #1 / / / \s_@@_mark {#1} } +%<latexrelease>\cs_new_protected:Npn \@@_try_put_cmd_hook:w +%<latexrelease> #1 / #2 / #3 / #4 \s_@@_mark #5 +%<latexrelease> { +%<latexrelease> \@@_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } } +%<latexrelease> \str_case:nnTF {#3} +%<latexrelease> { { before } { } { after } { } } +%<latexrelease> { \exp_args:Nc \@@_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } +%<latexrelease> { \msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % @@ -592,17 +612,28 @@ % % With \cs{@@_patch_DeclareRobustCommand:Nnn} we check if the command % has an optional argument (with a test counter-intuitively called -% \tn{@if@newcommand}). If so, we forward the action to -% \cs{@@_patch_newcommand:Nnn}, otherwise call the patching engine +% \tn{@if@newcommand}; also make sure the command doesn't take args by +% calling \cs{robust@command@chk@safe}). If so, we pass the patching action +% to \cs{@@_patch_newcommand:Nnn}, otherwise we call the patching engine % \cs{@@_patch_expand_redefine:NNnn} with a \cs{c_false_bool} to % indicate that there is no optional argument. +% +% \changes{v1.0c}{2021/07/20} +% {Use \cs{robust@command@chk@safe} before \cs{@if@newcommand}.} % \begin{macrocode} \cs_new_protected:Npn \@@_patch_DeclareRobustCommand:Nnn #1 { - \exp_args:Nc \@if@newcommand { \cs_to_str:N #1 ~ } - { \exp_args:Nc \@@_patch_newcommand:Nnn } - { \exp_args:NNc \@@_patch_expand_redefine:NNnn \c_false_bool } - { \cs_to_str:N #1 ~ } + \exp_args:Nc \@@_patch_DeclareRobustCommand_aux:Nnn + { \cs_to_str:N #1 ~ } + } +\cs_new_protected:Npn \@@_patch_DeclareRobustCommand_aux:Nnn #1 + { + \robust@command@chk@safe #1 + { \@if@newcommand #1 } + { \use_ii:nn } + { \@@_patch_newcommand:Nnn } + { \@@_patch_expand_redefine:NNnn \c_false_bool } + #1 } % \end{macrocode} % \end{macro} @@ -1039,15 +1070,21 @@ % \subsection{Messages} % % \begin{macrocode} -\msg_new:nnnn { hooks } { wrong-cmd-hook } - { - Generic~hook~`cmd/#1/#2'~is~invalid. -% The~hook~should~be~`cmd/#1/before'~or~`cmd/#1/after'. - } - { - You~tried~to~add~a~generic~hook~to~command~\iow_char:N \\#1,~but~`#2'~ - is~an~invalid~component.~Only~`before'~or~`after'~are~allowed. - } +%<latexrelease>\IncludeInRelease{2021/11/15}{wrong-cmd-hook}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2021/11/15}{wrong-cmd-hook}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\msg_new:nnnn { hooks } { wrong-cmd-hook } +%<latexrelease> { +%<latexrelease> Generic~hook~`cmd/#1/#2'~is~invalid. +%<latexrelease>% The~hook~should~be~`cmd/#1/before'~or~`cmd/#1/after'. +%<latexrelease> } +%<latexrelease> { +%<latexrelease> You~tried~to~add~a~generic~hook~to~command~\iow_char:N \\#1,~but~`#2'~ +%<latexrelease> is~an~invalid~component.~Only~`before'~or~`after'~are~allowed. +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease \msg_new:nnnn { hooks } { cant-patch } { Generic~hooks~cannot~be~added~to~'#1'. diff --git a/Master/texmf-dist/source/latex-dev/base/ltcounts.dtx b/Master/texmf-dist/source/latex-dev/base/ltcounts.dtx index 445cac2f2e4..39fb47728d3 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltcounts.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltcounts.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltcounts.dtx} - [2020/12/04 v1.1l LaTeX Kernel (Counters)] + [2021/07/08 v1.1m LaTeX Kernel (Counters)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltcounts.dtx} @@ -106,20 +106,22 @@ % % % \DescribeMacro\counterwithin -% |\counterwithin|\marg{counter}\marg{within-counter}: +% |\counterwithin|\oarg{format}\marg{counter}\marg{within-counter}: % Resets \meta{counter} whenever % \meta{within-counter} is stepped. Also % redefines |\the|\meta{counter} command to produce -% |\the|\meta{within-counter}|.\arabic|\marg{counter}. +% |\the|\meta{within-counter}.\meta{format}\marg{counter} with \cs{arabic} as +% the default for \meta{format}. % Star form omits redefining the print representation. % % \DescribeMacro\counterwithout -% |\counterwithout|\marg{counter}\marg{within-counter}: +% |\counterwithout|\oarg{format}\marg{counter}\marg{within-counter}: % Removes \meta{counter} from the reset list of \meta{within-counter}. % Also % redefines |\the|\meta{counter} command to produce -% |\arabic|\marg{counter}. +% \meta{format}\marg{counter} with \cs{arabic} as +% the default for \meta{format}. % Star form omits redefining the print representation. % % \StopEventually{} @@ -371,67 +373,94 @@ #3}}} % \end{macrocode} % \end{macro} - - -% \begin{macro}{\counterwithout} % -% \changes{v1.1k}{2018/03/08}{Interface added} % \begin{macrocode} -\def\counterwithout {\@ifstar\counterwithout@s\counterwithout@x} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000-00-00} +%<latexrelease> {\@removefromreset}{Add interfaces}% +%<latexrelease>\let \@removefromreset \undefined +%<latexrelease>\let \@ifbothcounters \undefined +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % -% \begin{macrocode} -\def\counterwithout@s#1#2{% - \@ifbothcounters{#1}{#2}{\@removefromreset{#1}{#2}}} -% \end{macrocode} % -% \begin{macrocode} -\def\counterwithout@x#1#2{% - \@ifbothcounters{#1}{#2}% - {\@removefromreset{#1}{#2}% - \expandafter - \gdef\csname the#1\expandafter\endcsname\expandafter - {\expandafter - \@arabic\csname c@#1\endcsname}}} -% \end{macrocode} -% \end{macro} - - - -% \begin{macro}{\counterwithin} % -% \changes{v1.1k}{2018/03/08}{Interface added} +% +% \begin{macro}{\counterwithout,\counterwithin} +% New implementation using xparse and supporting an optional +% format argument. +% \changes{v1.1m}{2021/07/08}{New implementation for +% \cs{counterwithout} and \cs{counterwithin}} % \begin{macrocode} -\def\counterwithin{\@ifstar\counterwithin@s\counterwithin@x} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\counterwithout}{counter without/within}% % \end{macrocode} % % \begin{macrocode} -\def\counterwithin@s#1#2{% - \@ifbothcounters{#1}{#2}{\@addtoreset{#1}{#2}}} +\NewDocumentCommand \counterwithout {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@removefromreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\endcsname {#2{#3}}}% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand \counterwithin {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@addtoreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\expandafter\endcsname + \expandafter + {\csname the#4\endcsname .#2{#3}}}% + }% +} % \end{macrocode} % -% \changes{v1.1l}{2018/04/11}{Correct default (issue/38)} +% \changes{v1.1k}{2018/03/08}{Interface added} % \begin{macrocode} -\def\counterwithin@x#1#2{% - \@ifbothcounters{#1}{#2}% - {\@addtoreset{#1}{#2}% - \expandafter - \gdef\csname the#1\expandafter\endcsname\expandafter - {\csname the#2\expandafter\endcsname\expandafter - .\expandafter - \@arabic\csname c@#1\endcsname}}} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2018-04-01} +%<latexrelease> {\counterwithout}{counter without/within}% +%<latexrelease> +%<latexrelease>\def\counterwithout {\@ifstar\counterwithout@s\counterwithout@x} +%<latexrelease>\def\counterwithout@s#1#2{% +%<latexrelease> \@ifbothcounters{#1}{#2}{\@removefromreset{#1}{#2}}} +%<latexrelease>\def\counterwithout@x#1#2{% +%<latexrelease> \@ifbothcounters{#1}{#2}% +%<latexrelease> {\@removefromreset{#1}{#2}% +%<latexrelease> \expandafter +%<latexrelease> \gdef\csname the#1\expandafter\endcsname\expandafter +%<latexrelease> {\expandafter +%<latexrelease> \@arabic\csname c@#1\endcsname}}} +%<latexrelease> +%<latexrelease>\def\counterwithin{\@ifstar\counterwithin@s\counterwithin@x} +%<latexrelease>\def\counterwithin@s#1#2{% +%<latexrelease> \@ifbothcounters{#1}{#2}{\@addtoreset{#1}{#2}}} % \end{macrocode} -% \end{macro} - - % +% \changes{v1.1l}{2018/04/11}{Correct default (issue/38)} % \begin{macrocode} -%</2ekernel|latexrelease> +%<latexrelease>\def\counterwithin@x#1#2{% +%<latexrelease> \@ifbothcounters{#1}{#2}% +%<latexrelease> {\@addtoreset{#1}{#2}% +%<latexrelease> \expandafter +%<latexrelease> \gdef\csname the#1\expandafter\endcsname\expandafter +%<latexrelease> {\csname the#2\expandafter\endcsname\expandafter +%<latexrelease> .\expandafter +%<latexrelease> \@arabic\csname c@#1\endcsname}}} +%<latexrelease> %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000-00-00} -%<latexrelease> {\@removefromreset}{Add interfaces}% -%<latexrelease>\let \@removefromreset \undefined -%<latexrelease>\let \@ifbothcounters \undefined +%<latexrelease> {\counterwithout}{counter without/within}% %<latexrelease>\let \counterwithout \undefined %<latexrelease>\let \counterwithout@s \undefined %<latexrelease>\let \counterwithout@x \undefined @@ -441,6 +470,9 @@ %<latexrelease>\EndIncludeInRelease %<*2ekernel> % \end{macrocode} +% \end{macro} +% +% % % % Numbering commands for definitions of |\theCOUNTER| and |\list| @@ -596,7 +628,7 @@ % recommended) this unfortunate side effect is not present. % \begin{macrocode} %</2ekernel> -%<latexrelease>\IncludeInRelease{2015/01/01}{\@fnsymbol}{Use \TexOrMath}% +%<latexrelease>\IncludeInRelease{2015/01/01}{\@fnsymbol}{Use \TextOrMath}% %<*2ekernel|latexrelease> \def\@fnsymbol#1{% \ifcase#1\or \TextOrMath\textasteriskcentered *\or @@ -612,7 +644,7 @@ }% %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease -%<latexrelease>\IncludeInRelease{0000/00/00}{\@fnsymbol}{Use \TexOrMath}% +%<latexrelease>\IncludeInRelease{0000/00/00}{\@fnsymbol}{Use \TextOrMath}% %<latexrelease>\def\@fnsymbol#1{\ensuremath{% %<latexrelease> \ifcase#1\or *\or \dagger\or \ddagger\or \mathsection\or %<latexrelease> \mathparagraph\or \|\or **\or \dagger\dagger diff --git a/Master/texmf-dist/source/latex-dev/base/lterror.dtx b/Master/texmf-dist/source/latex-dev/base/lterror.dtx index 43eef7b2890..10d93a1dbd1 100644 --- a/Master/texmf-dist/source/latex-dev/base/lterror.dtx +++ b/Master/texmf-dist/source/latex-dev/base/lterror.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{lterror.dtx} - [2021/06/09 v1.2r LaTeX Kernel (errors)] + [2021/08/20 v1.2t LaTeX Kernel (errors)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{lterror.dtx} @@ -375,6 +375,58 @@ Type H <return> for immediate help.}% % \end{macro} % \end{macro} % +% +% +% \begin{macro}{\ClassNote,\ClassNoteNoLine, +% \PackageNote,\PackageNoteNoLine} +% +% \changes{v1.2s}{2021/07/11}{Provide \cs{ClassNote} and \cs{PackageNote}} +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\ClassNote}{Notes for classes/packages}% +% \end{macrocode} +% +% \begin{macrocode} +\def\ClassNote#1#2{% + \GenericWarning{% + (#1) \space\space\@spaces\@spaces + }{% + Class #1 Info: #2% + }% +} +\def\ClassNoteNoLine#1#2{\ClassNote{#1}{#2\@gobble}} +% \end{macrocode} +% +% \begin{macrocode} +\def\PackageNote#1#2{% + \GenericWarning{% + (#1) \@spaces\@spaces\@spaces + }{% + Package #1 Info: #2% + }% +} +\def\PackageNoteNoLine#1#2{\PackageNote{#1}{#2\@gobble}} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% We don't roll back, because if this code is used by packages then +% most often they will not have rollback code implemented, so they +% would immediately break even if they otherwise would work fine. +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\ClassNote}{Notes for classes/packages}% +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% \end{macro} +% +% +% +% +% % \begin{macro}{\@latex@error} % \begin{macro}{\@latex@warning} % \begin{macro}{\@latex@warning@no@line} @@ -635,10 +687,19 @@ Type H <return> for immediate help.}% % RmS 1992/08/24: added code to |\@badend| to display position of % non-matching |\begin|. % FMi 1993/01/14: missing space added. +% +% The environment name has to literally match, i.e., what is stored +% in \cs{@currenvir} (after one expansion) must match what is +% passed to \cs{end} (without expansion). If not we complain. Not +% the absolute best solution but at least it avoids getting +% \verb=\begin{foo} ended by \end{foo}= which was possible in the +% past. +% \changes{v1.2t}{2021/08/20}{Improve \cs{@badend} error message (gh/587)} % \begin{macrocode} \gdef\@badend#1{% - \@latex@error{\protect\begin{\@currenvir}\@currenvline - \space ended by \protect\end{#1}}\@eha} + \@latex@error{\protect\begin + {\detokenize\expandafter{\@currenvir}}\@currenvline + \space ended by \protect\end{\detokenize{#1}}}\@eha} % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx b/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx index 6d7ec3ff60b..021edc644c3 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltexpl.dtx @@ -86,7 +86,7 @@ % \end{macrocode} % We only initialize these kernel hooks if they are not already % existing. Otherwise they would be set to \cs{@empty} on rollback -% which would be wrong because code that has been added to to them +% which would be wrong because code that has been added to them % may still have to be executed in the rollback situation . Instead % code that writes to them needs to handle the rollback as needed. % It is likely that we have to change that approach in the future, diff --git a/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx b/Master/texmf-dist/source/latex-dev/base/ltfilehook.dtx index 5d0acc8fdfb..000f4d8c2a2 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.0k} -\providecommand\ltfilehookdate{2021/05/25} +\providecommand\ltfilehookversion{v1.0l} +\providecommand\ltfilehookdate{2021/08/27} % \end{macrocode} % %<*driver> @@ -48,7 +48,7 @@ \vbox_unpack_drop:N \l__codedoc_macro_box \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \MacroFont % <----- without it the \ is in lmr10 if a link is made - \ + \ } } } \int_incr:N \l__codedoc_macro_int @@ -115,12 +115,12 @@ % \cs{usepackage}, etc. They are not called for files read using % internal low-level methods, such as \cs{@input} or \cs{openin}. % -% \begin{variable}{file/before,file/before/..., -% file/after/...,file/after, +% \begin{variable}{file/before,file/.../before, +% file/.../after,file/after, % } % These are: % \begin{description} -% \item[\texttt{file/before}, \texttt{file/before/\meta{file-name}}] +% \item[\texttt{file/before}, \texttt{file/\meta{file-name}/before}] % % These hooks are executed in that order just before the file is % loaded for reading. The code of the first hook is used @@ -128,7 +128,7 @@ % file with matching \meta{file-name} allowing you to specify % code that only applies to one file. % -% \item[\texttt{file/after/\meta{file-name}}, \texttt{file/after}] +% \item[\texttt{file/\meta{file-name}/after}, \texttt{file/after}] % % These hooks are after the file with name \meta{file-name} has % been fully consumed. The order is swapped (the specific one @@ -149,9 +149,9 @@ % \begin{tabbing} % mm\=mm\=mm\=mm\=\kill % \>\cs{UseHook}\marg{\hook{file/before}} \\ -% \>\cs{UseHook}\marg{\hook{file/before/\meta{file name}}} \\ +% \>\cs{UseHook}\marg{\hook{file/\meta{file name}/before}} \\ % \>\> \meta{file contents} \\ -% \>\cs{UseHook}\marg{\hook{file/after/\meta{file name}}} \\ +% \>\cs{UseHook}\marg{\hook{file/\meta{file name}/after}} \\ % \>\cs{UseHook}\marg{\hook{file/after}} % \end{tabbing} % @@ -172,8 +172,8 @@ % % When a file is input, the \meta{file name} is available in % \cs{CurrentFile}, which is then used when accessing the -% \hook{file/before/\meta{file name}} and -% \hook{file/after/\meta{file name}}. +% \hook{file/\meta{file name}/before} and +% \hook{file/\meta{file name}/after}. % % \begin{variable}{\CurrentFile} % The name of the file about to be read (or just finished) is @@ -216,7 +216,7 @@ % \cs{RequirePackage}, \cs{LoadPackageWithOptions}, etc.) offer the % hooks from section~\ref{sec:general-file-hooks} when they are % used to load a package or class file, e.g., -% \texttt{file/after/array.sty} would be called after the +% \texttt{file/array.sty/after} would be called after the % \pkg{array} package got loaded. But as packages and classes form as special group % of files, there are some additional hooks available that only % apply when a package or class is loaded. @@ -224,9 +224,9 @@ % % \begin{variable}{ % package/before,package/after, -% package/before/...,package/after/..., +% package/.../before,package/.../after, % class/before,class/after, -% class/before/...,class/after/..., +% class/.../before,class/.../after, % } % These are: % \begin{description} @@ -234,8 +234,8 @@ % % These hooks are called for each package being loaded. % -% \item[\texttt{package/before/\meta{name}}, -% \texttt{package/after/\meta{name}}] +% \item[\texttt{package/\meta{name}/before}, +% \texttt{package/\meta{name}/after}] % % These hooks are additionally called if the package name is % \meta{name} (without extension). @@ -244,7 +244,7 @@ % % These hooks are called for each class being loaded. % -% \item[\texttt{class/before/\meta{name}}, \texttt{class/after/\meta{name}}] +% \item[\texttt{class/\meta{name}/before}, \texttt{class/\meta{name}/after}] % % These hooks are additionally called if the class name is % \meta{name} (without extension). @@ -258,16 +258,16 @@ % \begin{tabbing} % mm\=mm\=mm\=mm\=\kill % \>\cs{UseHook}\marg{\hook{package/before}} \\ -% \>\cs{UseHook}\marg{\hook{package/before/\meta{package name}}} \\[5pt] +% \>\cs{UseHook}\marg{\hook{package/\meta{package name}/before}} \\[5pt] % \>\>\cs{UseHook}\marg{\hook{file/before}} \\ -% \>\>\cs{UseHook}\marg{\hook{file/before/\meta{package name}.sty}} \\ +% \>\>\cs{UseHook}\marg{\hook{file/\meta{package name}.sty/before}} \\ % \>\>\> \meta{package contents} \\ -% \>\>\cs{UseHook}\marg{\hook{file/after/\meta{package name}.sty}} \\ +% \>\>\cs{UseHook}\marg{\hook{file/\meta{package name}.sty/after}} \\ % \>\>\cs{UseHook}\marg{\hook{file/after}} \\[5pt] % \>\>\emph{code from \cs{AtEndOfPackage} if % used inside the package} \\[5pt] -% \>\cs{UseHook}\marg{\hook{package/after/\meta{package name}}} \\ -% \>\cs{UseHook}\marg{\hook{package/after}} +% \>\cs{UseHook}\marg{\hook{package/\meta{package name}/after}} \\ +% \>\cs{UseHook}\marg{\hook{package/after}} % \end{tabbing} % and similar for class file loading, except that \texttt{package/} % is replaced by \texttt{class/} and \cs{AtEndOfPackage} by @@ -276,6 +276,20 @@ % If a package or class is not loaded (or it was loaded before the % hooks were set) none of the hooks are executed! % +% All class or package hooks involving the name of the class or +% package are implemented as +% one-time hooks, whereas all other such hooks are normal hooks. +% This allows for the following use case +%\begin{verbatim} +% \AddToHook{package/varioref/after} +% { ... apply my customizations if the package gets +% loaded (or was loaded already) ... } +%\end{verbatim} +% without the need to first test if the package is already loaded. +% +% +% +% % \subsection{Hooks for \cs{include} files} % % To manage \cs{include} files, \LaTeX{} issues a \cs{clearpage} @@ -300,14 +314,14 @@ % is \enquote{\texttt{No file \meta{filename}.tex}}). % % -% \begin{variable}{include/before,include/before/..., -% include/end,include/end/..., -% include/after,include/after/..., +% \begin{variable}{include/before,include/.../before, +% include/end,include/.../end, +% include/after,include/.../after, % } % These are: % \begin{description} % -% \item[\texttt{include/before}, \texttt{include/before/\meta{name}}] +% \item[\texttt{include/before}, \texttt{include/\meta{name}/before}] % % These hooks are executed (in that order) after the initial % \cs{clearpage} and after \texttt{.aux} file is changed to use @@ -317,14 +331,14 @@ % file. % % -% \item[\texttt{include/end/\meta{name}}, \texttt{include/end}] +% \item[\texttt{include/\meta{name}/end}, \texttt{include/end}] % % These hooks are executed (in that order) after \LaTeX{} has % stopped reading from the \cs{include} file, but before it has % issued a \cs{clearpage} to output any deferred floats. % % -% \item[\texttt{include/after/\meta{name}}, \texttt{include/after}] +% \item[\texttt{include/\meta{name}/after}, \texttt{include/after}] % % These hooks are executed (in that order) after \LaTeX{} has % issued the \cs{clearpage} but before is has switched back @@ -341,6 +355,13 @@ % normally does nothing, but starts a new page if further material % got added this way.} % +% +% All \hook{include} hooks involving the name of the included file are implemented as +% one-time hooks (whereas all other such hooks are normal hooks). +% +% +% +% % \subsection{High-level interfaces for \LaTeX{}} % % We do not provide any additional wrappers around the hooks (like @@ -531,7 +552,7 @@ % The output of \cs{@@_file_parse_full_name:nN} is passed on to the % |#2|---a 3-argument macro that takes the \meta{path}, \meta{base}, % and \meta{ext} parts of the file name. -% +% % \begin{macrocode} \cs_new:Npn \@@_file_parse_full_name:nN #1 { @@ -591,6 +612,7 @@ % \changes{v1.0h}{2021/03/18} % {Define \cs{g_@@_input_file_seq} to avoid losing data when % rolling back.} +% \changes{v1.0l}{2021/08/27}{Internal message name changes} % \begin{macrocode} \tl_new:N \l_@@_internal_tl \seq_if_exist:NF \g_@@_input_file_seq @@ -608,7 +630,7 @@ \seq_gpop:NNTF \g_@@_input_file_seq \l_@@_internal_tl { \exp_after:wN \@@_file_pop_assign:nnnn \l_@@_internal_tl } { - \msg_error:nnn { kernel } { should-not-happen } + \msg_error:nnn { latex2e } { should-not-happen } { Tried~to~pop~from~an~empty~file~name~stack. } } } @@ -624,7 +646,7 @@ % \end{macro} % \end{macro} % \end{macro} -% +% % \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease @@ -683,7 +705,7 @@ %<latexrelease> { \use_none:n #1 \prg_do_nothing: } %<latexrelease> {#2} %<latexrelease> } -%<latexrelease>} +%<latexrelease>} %<latexrelease>\ExplSyntaxOff %<latexrelease> %<latexrelease>\EndIncludeInRelease @@ -697,16 +719,17 @@ % % \subsection{Declaring the file-related hooks} % -% All hooks starting with \texttt{file/} \texttt{include/}, -% \texttt{class/} or \texttt{package/} are generic and will be -% allocated if code is added to them. Thus there is no need to -% explicitly declare any hook in the code below. -% -% Furthermore, those named \texttt{.../after} or \texttt{.../end} are -% automatically declared as reversed hooks if filled with code, so this -% is also automatically taken care of. -% +% These hooks have names with three-parts that +% start with \hook{file/}, \hook{include/}, +% \hook{class/} or \hook{package/} and end with \hook{/before} or +% \hook{/after} (or \hook{/end} in the case of \hook{include/}). +% They are all generic hooks +% so will be declared only if code is added to them; +% this declaration is done for you automatically and, indeed, they should +% not be declared explicitly. % +% Those named \hook{.../after} and \texttt{include/.../end} +% are, when code is added, declared as reversed hooks. % % % \subsection{Patching \LaTeX{}'s \cs{InputIfFileExists} command} @@ -760,7 +783,7 @@ % can't rely on that still being true after the file has been % processed. Thus for using the name in the file hooks we need to % preserve the name and then restore it for the -% \texttt{file/after/...} hook. +% \texttt{file/.../after} hook. % % The hook always refers to the file requested by the user. The hook % is \emph{always} loaded for \cs{CurrentFile} which usually is the @@ -814,20 +837,27 @@ % The current file name is available in \cs{CurrentFile} so we use % that in the specific hook. % \begin{macrocode} - \UseHook{file/before/\CurrentFile}% + \UseHook{file/\CurrentFile/before}% \@@input #1% <- trailing space comes from \@filef@und }% % \end{macrocode} % And here, \cs{CurrentFile} is restored % (by \cs{@expl@@@filehook@file@pop@assign@@nnnn}) so we can use it once more. % \begin{macrocode} - \UseHook{file/after/\CurrentFile}% + \UseHook{file/\CurrentFile/after}% \UseHook{file/after}} \def\unqu@tefilef@und"#1" \@nil{#1} +% \end{macrocode} +% +% \changes{v1.0l}{2021/08/25}{Declare non-generic file hooks} +% Now declare the non-generic file hooks used above: +% \begin{macrocode} +\NewHook{file/before} +\NewReversedHook{file/after} %<latexrelease>\EndIncludeInRelease %</2ekernel|latexrelease> % \end{macrocode} -% +% % \changes{v0.9b} % {1993/12/04}{Macro added} % \changes{v0.9p} @@ -949,7 +979,7 @@ { \if_meaning:w #1 #2 .tex \else: \token_to_str:N #2 \fi: } % \end{macrocode} % \end{macro} -% +% % \begin{macro}[int]{\use_ii_iii:nnn} % A variant of \cs[no-index]{use_...} to discard the first of three % arguments. @@ -1085,7 +1115,7 @@ %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease % \end{macrocode} -% +% % \begin{macrocode} %<latexrelease>\IncludeInRelease{2020/10/01}% %<latexrelease> {\set@curr@file}{Setting current file name}% @@ -1108,7 +1138,7 @@ %<latexrelease> \endgroup} %<latexrelease>\EndIncludeInRelease % \end{macrocode} -% +% % \begin{macrocode} %<latexrelease>\IncludeInRelease{2019/10/01}% %<latexrelease> {\set@curr@file}{Setting current file name}% @@ -1124,7 +1154,7 @@ %<latexrelease>} %<latexrelease>\EndIncludeInRelease % \end{macrocode} -% +% % \begin{macrocode} %<latexrelease>\IncludeInRelease{0000/00/00}% %<latexrelease> {\set@curr@file}{Setting current file name}% @@ -1383,6 +1413,7 @@ % \@@_file_subst_cycle_error:NN, % \@@_file_subst_cycle_error:cN, % } +% \changes{v1.0l}{2021/08/27}{Use \cs{msg_...} not \cs{__kernel_msg_...}} % Showing this type of error expandably is tricky, as we have a very % limited amount of characters to show and a potentially large list. % As a work around, several errors are printed, each showing one step @@ -1390,7 +1421,7 @@ % \begin{macrocode} \cs_new:Npn \@@_file_subst_cycle_error:NN #1 #2 { - \__kernel_msg_expandable_error:nnff { kernel } { file-cycle } + \msg_expandable_error:nnff { latex2e } { file-cycle } {#1} { \use:c { @file-subst@ #1 } } \token_if_eq_meaning:NNF #1 #2 { \@@_file_subst_cycle_error:cN { @file-subst@ #1 } #2 } @@ -1400,7 +1431,7 @@ % % And the error message: % \begin{macrocode} -\__kernel_msg_new:nnn { kernel } { file-cycle } +\msg_new:nnn { latex2e } { file-cycle } { File~loop!~#1~replaced~by~#2... } % \end{macrocode} % \end{macro} @@ -1412,7 +1443,7 @@ %<latexrelease>\EndIncludeInRelease %<*2ekernel> % \end{macrocode} -% +% % % \begin{macrocode} %<@@=> @@ -1438,7 +1469,7 @@ \def\disable@package@load#1#2{% \global\@namedef{@pkg-disable@#1.\@pkgextension}{#2}} % \end{macrocode} -% +% % \begin{macrocode} \def\@disable@packageload@do#1#2{% \@ifundefined{@pkg-disable@#1}{#2}% @@ -1453,7 +1484,7 @@ \csname @pkg-disable@#1.\@pkgextension \endcsname \@undefined} % \end{macrocode} % -% +% % \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease @@ -1502,7 +1533,7 @@ %<latexrelease> {\@expl@@@filehook@if@no@extension@@nTF}{2e tmp interfaces}% \ExplSyntaxOn % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@if@no@extension@@nTF \__filehook_if_no_extension:nTF @@ -1512,7 +1543,7 @@ \cs_new_eq:NN \@expl@@@filehook@set@curr@file@@nNN \__filehook_set_curr_file:nNN % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@resolve@file@subst@@w \__filehook_resolve_file_subst:w @@ -1522,7 +1553,7 @@ \cs_new_eq:NN \@expl@@@filehook@normalize@file@name@@w \__filehook_normalize_file_name:w % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@if@file@replaced@@TF \__filehook_if_file_replaced:TF @@ -1537,23 +1568,23 @@ \cs_new_eq:NN \@expl@@@filehook@drop@extension@@N \__filehook_drop_extension:N % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@file@push@@ \__filehook_file_push: % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@file@pop@@ \__filehook_file_pop: % \end{macrocode} -% +% % \begin{macrocode} \cs_new_eq:NN \@expl@@@filehook@file@pop@assign@@nnnn \__filehook_file_pop_assign:nnnn % \end{macrocode} % \InternalDetectionOn -% +% % % \begin{macrocode} \ExplSyntaxOff @@ -1682,7 +1713,7 @@ %<*atveryend-ltx> \ProvidesPackage{atveryend-ltx} [2020/08/19 v1.0a - Emulation of the original atvery package^^Jwith kernel methods] + Emulation of the original atveryend package^^Jwith kernel methods] % \end{macrocode} % % @@ -1698,14 +1729,14 @@ % \begin{macrocode} \newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}} % \end{macrocode} -% +% % \begin{macrocode} \newcommand\AtVeryVeryEnd {\AddToHook{enddocument/end}} % \end{macrocode} % % \begin{macro}{\BeforeClearDocument} % This one is the only one we don't implement or rather don't have -% a dedicated hook in the code. +% a dedicated hook in the code. % \begin{macrocode} \ExplSyntaxOn \newcommand\BeforeClearDocument[1] @@ -1713,7 +1744,7 @@ \atveryend@DEPRECATED{BeforeClearDocument \tl_to_str:n{#1}} } % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Npn\atveryend@DEPRECATED #1 {\iow_term:x{======~DEPRECATED~USAGE~#1~==========}} @@ -1721,7 +1752,7 @@ % \end{macrocode} % \end{macro} % -% +% % \begin{macrocode} %</atveryend-ltx> % \end{macrocode} @@ -1735,4 +1766,3 @@ \endinput %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % - diff --git a/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx b/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx index bcaac582208..4dee83c4d6e 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfiles.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltfiles.dtx} - [2021/04/17 v1.2m LaTeX Kernel (File Handling)] + [2021/08/25 v1.2o LaTeX Kernel (File Handling)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfiles.dtx} @@ -850,16 +850,19 @@ % \end{macrocode} % Execute the \texttt{before} hooks just after we switched the % \texttt{.aux} file \ldots +% \changes{v1.2n}{2021/07/23}{Make include/name/before a one-time hook} +% \changes{v1.2o}{2021/08/25}{Standardise generic hook names (gh/648)} % \begin{macrocode} \UseHook{include/before}% - \UseHook{include/before/#1}% + \UseOneTimeHook{include/#1/before}% %----------------------------------------- \@input@{#1.tex}% %----------------------------------------- % \end{macrocode} % \ldots{} then \texttt{end} hooks \ldots +% \changes{v1.2n}{2021/07/23}{Make include/name/end a one-time hook} % \begin{macrocode} - \UseHook{include/end/#1}% + \UseOneTimeHook{include/#1/end}% \UseHook{include/end}% %----------------------------------------- \clearpage @@ -869,8 +872,9 @@ % followed by another \cs{clearpage} just in case new material got % added (after all we need to be in well defined state after the % \cs{include}). +% \changes{v1.2n}{2021/07/23}{Make include/name/after a one-time hook} % \begin{macrocode} - \UseHook{include/after/#1}% + \UseOneTimeHook{include/#1/after}% \UseHook{include/after}% \clearpage %----------------------------------------- @@ -889,6 +893,14 @@ \@nameuse{cp@#1}% \fi \let\@auxout\@mainaux} +% \end{macrocode} +% +% \changes{v1.2o}{2021/08/25}{Declare non-generic include hooks} +% Now declare the non-generic \hook{include} hooks used above: +% \begin{macrocode} +\NewHook{include/before} +\NewReversedHook{include/end} +\NewReversedHook{include/after} %<latexrelease>\EndIncludeInRelease %</2ekernel|latexrelease> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx b/Master/texmf-dist/source/latex-dev/base/ltfinal.dtx index 19f82934aa6..5d77fb2e834 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} - [2021/04/18 v2.2o LaTeX Kernel (Final Settings)] + [2021/09/06 v2.2q LaTeX Kernel (Final Settings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfinal.dtx} @@ -1074,9 +1074,11 @@ }} % \end{macrocode} % +% \changes{v2.2q}{2021/09/06}{Correctly upper and lowercase +% \cs{ij} and \cs{IJ} (gh/658)} % \begin{macrocode} \def\@uclclist{\oe\OE\o\O\ae\AE - \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH} + \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\ij\IJ\th\TH} % \end{macrocode} % The above code works, but has the nasty side-effect that if you % say something like: @@ -1244,6 +1246,38 @@ % \end{macro} % \end{macro} % +% \subsection{Prepare for supporting PDF management in backends} +% +% At the current point in time support for PDF management in +% backends is not part of \LaTeX{} core but provided by external +% packages. At some time in the future that work will be placed +% into the kernel but for now it is separate and has to be +% explicitly loaded in the document. +% +% There is a command \cs{IfPDFManagementActiveTF} in that code +% which checks if the PDF management code is activated, which can +% be used by packages to execute different code branches depending +% on the state. +% +% To make this also work properly if the external package is not +% loaded at all this command is already made available in the +% kernel (with a trivial definition) so that other packages can +% query the state in all circumstances. Once the PDF management +% support moves to the kernel this definition here will vanish +% again or rather will be replaced by a real test. +% +% +% \begin{macro}{\IfPDFManagementActiveTF} +% While the PDF management code is not loaded, the test will +% always return the false branch. Once this code is loaded, it +% is replaced by a real test (as then it is possible that the +% management code is activate or not activated). +% \changes{v2.2p}{2021/08/08}{Default definition added (gh/640)} +% \begin{macrocode} +\let \IfPDFManagementActiveTF \@secondoftwo +% \end{macrocode} +% \end{macro} +% % % % \subsection{Do some temporary work for pre-release} @@ -1253,7 +1287,7 @@ % \begin{macrocode} % \end{macrocode} % -% \subsection{Some last minute initializations \ldots} +% \subsection{Some last minute initializations \ldots} % % Load the first aid set of definitions for external packages that await updates. % \changes{v2.2j}{2020/09/26} diff --git a/Master/texmf-dist/source/latex-dev/base/ltfntcmd.dtx b/Master/texmf-dist/source/latex-dev/base/ltfntcmd.dtx index 5f70053a688..6c4ec4b3d16 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfntcmd.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfntcmd.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltfntcmd.dtx} - [2020/12/05 v3.4c LaTeX Kernel (Font commands)] + [2021/09/12 v3.5a LaTeX Kernel (Font commands)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfntcmd.dtx} @@ -466,9 +466,10 @@ % Is this the correct action in the `empty' case? It is efficient but % typographically it is, strictly, incorrect! % \changes{v3.3l}{1994/06/18}{Added check for empty text} +% \changes{v3.5a}{2021/09/12}{use \cs{unexpanded} to make \# safe} % \begin{macrocode} \def \text@command #1{% - \def \reserved@a {#1}% + \edef \reserved@a {\unexpanded{#1}}% \ifx \reserved@a \@empty \let \check@icl \@empty \let \check@icr \@empty diff --git a/Master/texmf-dist/source/latex-dev/base/ltfssini.dtx b/Master/texmf-dist/source/latex-dev/base/ltfssini.dtx index b06fc161b08..f817fdd8473 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfssini.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfssini.dtx @@ -36,7 +36,7 @@ % % \ProvidesFile{ltfssini.dtx} - [2021/04/26 v3.2h LaTeX Kernel (NFSS Initialisation)] + [2021/09/10 v3.2i LaTeX Kernel (NFSS Initialisation)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -207,7 +207,7 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2020/02/02}% +%<latexrelease>\IncludeInRelease{2021/11/15}% %<latexrelease> {\DeclareFontSeriesDefault}{Custom series}% % \end{macrocode} % @@ -280,6 +280,17 @@ % \begin{macrocode} \let\DeclareFontSeriesDefault\@undefined % for rollback \newcommand\DeclareFontSeriesDefault[3][]{% +% \end{macrocode} +% +% \changes{v3.2i}{2021/09/10}{Do delayed changes to \cs{bfdefault} or +% \cs{mddefault} first (gh/663)} +% \begin{macrocode} + \expand@font@defaults + \maybe@update@bfseries@defaults + \maybe@update@mdseries@defaults +% \end{macrocode} +% +% \begin{macrocode} \def\reserved@a{#1}% % \end{macrocode} % No optional argument: set up general default. @@ -333,7 +344,77 @@ % \end{macro} +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/02/02}% +%<latexrelease> {\DeclareFontSeriesDefault}{Custom series}% +%<latexrelease> +%<latexrelease>\let\DeclareFontSeriesDefault\@undefined % for rollback +%<latexrelease>\newcommand\DeclareFontSeriesDefault[3][]{% +%<latexrelease> \def\reserved@a{#1}% +%<latexrelease> \ifx\reserved@a\@empty +%<latexrelease> \ifcsname #2series\endcsname % supported are +%<latexrelease> % \[md/bf]default +%<latexrelease> \expandafter\def +%<latexrelease> \csname #2default\endcsname{#3\@empty}% +%<latexrelease> \expandafter\def +%<latexrelease> \csname #2default@previous\endcsname{#3\@empty}% +%<latexrelease> \else +%<latexrelease> \@latex@error{Wrong syntax for \string\DeclareFontSeriesDefault}% +%<latexrelease> {Mandatory first argument must be 'md' or 'bf'.} +%<latexrelease> \fi +%<latexrelease> \else +%<latexrelease> \ifcsname #2series@#1\endcsname % supported are +%<latexrelease> % \[md/bf]series@[rm/sf/tt] +%<latexrelease> \expandafter\edef +%<latexrelease> \csname #2series@#1\endcsname{#3}% +%<latexrelease> \expandafter\let +%<latexrelease> \csname #2series@#1@kernel\endcsname\@undefined +%<latexrelease> \else +%<latexrelease> \@latex@error{Wrong syntax for \string\DeclareFontSeriesDefault}% +%<latexrelease> {Optional argument must be 'rm', 'sf', or 'tt'. \MessageBreak +%<latexrelease> Mandatory first argument must be 'md' or 'bf'.} +%<latexrelease> \fi +%<latexrelease> \fi +%<latexrelease>} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\DeclareFontSeriesDefault}{Custom series}% +%<latexrelease> +%<latexrelease>\let\DeclareFontSeriesDefault\@undefined +%<latexrelease>\let\bfseries@rm\@undefined +%<latexrelease>\let\bfseries@sf\@undefined +%<latexrelease>\let\bfseries@tt\@undefined +%<latexrelease>\let\bfseries@rm@kernel\@undefined +%<latexrelease>\let\bfseries@sf@kernel\@undefined +%<latexrelease>\let\bfseries@tt@kernel\@undefined +%<latexrelease>\let\mdseries@rm\@undefined +%<latexrelease>\let\mdseries@sf\@undefined +%<latexrelease>\let\mdseries@tt\@undefined +%<latexrelease>\expandafter\let\csname ver@mweights.sty\endcsname\@undefined +%<latexrelease> +%<latexrelease>\let\@meta@family@list\@undefined +%<latexrelease>\let\prepare@family@series@update\@undefined +%<latexrelease>\let\update@series@target@value\@undefined +%<latexrelease> +% \end{macrocode} +% This is always called in \cs{document} so don't make it undefined. +% \begin{macrocode} +%<latexrelease>\let\init@series@setup\relax +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} + +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2020/02/02}% +%<latexrelease> {\mdseries@rm}{Custom series}% +% \end{macrocode} % \begin{macro}{\mdseries@rm} % \begin{macro}{\mdseries@sf} @@ -704,9 +785,8 @@ %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000/00/00}% -%<latexrelease> {\DeclareFontSeriesDefault}{Custom series}% +%<latexrelease> {\mdseries@rm}{Custom series}% %<latexrelease> -%<latexrelease>\let\DeclareFontSeriesDefault\@undefined %<latexrelease>\let\bfseries@rm\@undefined %<latexrelease>\let\bfseries@sf\@undefined %<latexrelease>\let\bfseries@tt\@undefined @@ -735,55 +815,11 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease>\IncludeInRelease{2021/11/15}% %<latexrelease> {\bfseries}{Custom series with hooks}% % \end{macrocode} -% \begin{macro}{\expand@font@defaults} -% \begin{macro}{\rm@def@ult} -% \begin{macro}{\sf@def@ult} -% \begin{macro}{\tt@def@ult} -% \begin{macro}{\md@def@ult} -% \begin{macro}{\bf@def@ult} -% -% The family specific defaults are fully expanded, i.e., they are -% defined via \cs{edef} inside \cs{DeclareFontSeriesDefault}. -% However, the overall defaults, e.g., \cs{bfdefault} may have been -% redefined by the user and thus may not be fully expanded. So to -% enable reliable comparison we make expanded versions of -% them. That we rerun each time. The alternative would be to only -% allow for changes before begin document. -% \begin{macrocode} -\def\expand@font@defaults{% - \edef\rmdef@ult{\rmdefault}% - \edef\sfdef@ult{\sfdefault}% - \edef\ttdef@ult{\ttdefault}% -% \end{macrocode} -% The series defaults may contain some surplus \texttt{m} that we -% need to drop here. -% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from \cs{bfdef@ult} -% and \cs{mddef@ult} (gh/291)} -% \begin{macrocode} - \series@maybe@drop@one@m\bfdefault\bfdef@ult - \series@maybe@drop@one@m\mddefault\mddef@ult -% \end{macrocode} -% Formats that set up parallel fonts, e.g., for Japanese, can use -% this hook to add additional code here. -% \changes{v3.1m}{2020/04/06}{Hook added (gh/306)} -% \changes{v3.2b}{2020/08/21}{Integration of new hook management interface} -% \begin{macrocode} - \UseHook{expand@font@defaults}% -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} - - % \begin{macro}{\bfseries} % This document command switches to the bold series. % \begin{macrocode} @@ -797,9 +833,35 @@ % \cs{ttdef@ult} and the select the correct family default in that case. % \changes{v3.1i}{2020/02/18}{Make the \cs{ifx} selection outside % of \cs{fontseries} argument so that it is not done several times} +% \changes{v3.2i}{2021/09/10}{Do delayed changes to \cs{bfdefault} in +% a separate macro for better reuse (gh/663)} % \begin{macrocode} \expand@font@defaults + \maybe@update@bfseries@defaults +% \end{macrocode} +% +% \begin{macrocode} + \ifx\f@family\rmdef@ult \fontseries\bfseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt +% \end{macrocode} +% If not \cs{bfdefault} is used. +% \begin{macrocode} + \else \fontseries\bfdefault + \fi\fi\fi % \end{macrocode} +% This hook in contrast is always executed. +% \begin{macrocode} + \UseHook{bfseries}% + \selectfont +} +% \end{macrocode} +% \end{macro} + + + +% \begin{macro}{\maybe@update@bfseries@defaults} +% % If \cs{bfdefault} and \cs{bfdefault@previous} are different then % the default got changed directly through the legacy interface % (i.e., via \cs{def} or \cs{renewcommand}. In that case we reset @@ -807,7 +869,10 @@ % the case before the new mechanism was introduced. % \changes{v3.1k}{2020/03/19}{Support legacy use of \cs{bfdefault} % and \cs{mddefault} (gh/306)} +% \changes{v3.2i}{2021/09/10}{Do delayed changes to \cs{bfdefault} in +% a separate macro for better reuse (gh/663)} % \begin{macrocode} +\def\maybe@update@bfseries@defaults{% \ifx\bfdefault\bfdefault@previous\else % \end{macrocode} % We add \cs{@empty} and then let \cs{bfdefault@previous} to @@ -835,28 +900,11 @@ % \begin{macrocode} \UseHook{bfseries/defaults}% \fi -% \end{macrocode} -% -% \begin{macrocode} - \ifx\f@family\rmdef@ult \fontseries\bfseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt -% \end{macrocode} -% If not \cs{bfdefault} is used. -% \begin{macrocode} - \else \fontseries\bfdefault - \fi\fi\fi -% \end{macrocode} -% This hook in contrast is always executed. -% \begin{macrocode} - \UseHook{bfseries}% - \selectfont } % \end{macrocode} % \end{macro} - % \begin{macro}{\mdseries} % This document command switches to the medium series. % \changes{v3.1i}{2020/02/18}{Make the \cs{ifx} selection outside @@ -865,10 +913,30 @@ % and \cs{mddefault} (gh/306)} % \changes{v3.2d}{2020/09/30}{\cs{mddefault@previous} not \cs{mdseries@previous} % (gh/395)} +% \changes{v3.2i}{2021/09/10}{Do delayed changes to \cs{mddefault} in +% a separate macro for better reuse (gh/663)} % \begin{macrocode} \DeclareRobustCommand\mdseries{% \not@math@alphabet\mdseries\relax \expand@font@defaults + \maybe@update@mdseries@defaults + \ifx\f@family\rmdef@ult \fontseries\mdseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt + \else \fontseries\mddefault + \fi\fi\fi + \UseHook{mdseries}% + \selectfont +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\maybe@update@mdseries@defaults} +% +% \changes{v3.2i}{2021/09/10}{Do delayed changes to \cs{mddefault} in +% a separate macro for better reuse (gh/663)} +% \begin{macrocode} +\def\maybe@update@mdseries@defaults{% \ifx\mddefault\mddefault@previous\else \expandafter\def\expandafter\mddefault\expandafter{\mddefault\@empty}% \let\mddefault@previous\mddefault @@ -884,17 +952,161 @@ % \begin{macrocode} \UseHook{mdseries/defaults}% \fi - \ifx\f@family\rmdef@ult \fontseries\mdseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt - \else \fontseries\mddefault - \fi\fi\fi - \UseHook{mdseries}% - \selectfont } % \end{macrocode} % \end{macro} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease> {\bfseries}{Custom series with hooks}% +%<latexrelease> +%<latexrelease>\let\maybe@update@bfseries@defaults\@undefined +%<latexrelease>\let\maybe@update@mdseries@defaults\@undefined +%<latexrelease> +%<latexrelease>\DeclareRobustCommand\bfseries{% +%<latexrelease> \not@math@alphabet\bfseries\mathbf +%<latexrelease> \expand@font@defaults +%<latexrelease> \ifx\bfdefault\bfdefault@previous\else +%<latexrelease> \expandafter\def\expandafter\bfdefault +%<latexrelease> \expandafter{\bfdefault\@empty}% +%<latexrelease> \let\bfdefault@previous\bfdefault +%<latexrelease> \let\bfseries@rm\bfdef@ult +%<latexrelease> \let\bfseries@sf\bfdef@ult +%<latexrelease> \let\bfseries@tt\bfdef@ult +%<latexrelease> \UseHook{bfseries/defaults}% +%<latexrelease> \fi +%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\bfseries@rm +%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf +%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt +%<latexrelease> \else \fontseries\bfdefault +%<latexrelease> \fi\fi\fi +%<latexrelease> \UseHook{bfseries}% +%<latexrelease> \selectfont +%<latexrelease>} +%<latexrelease> +%<latexrelease>\DeclareRobustCommand\mdseries{% +%<latexrelease> \not@math@alphabet\mdseries\relax +%<latexrelease> \expand@font@defaults +%<latexrelease> \ifx\mddefault\mddefault@previous\else +%<latexrelease> \expandafter\def\expandafter\mddefault\expandafter{\mddefault\@empty}% +%<latexrelease> \let\mddefault@previous\mddefault +%<latexrelease> \let\mdseries@rm\mddef@ult +%<latexrelease> \let\mdseries@sf\mddef@ult +%<latexrelease> \let\mdseries@tt\mddef@ult +%<latexrelease> \UseHook{mdseries/defaults}% +%<latexrelease> \fi +%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\mdseries@rm +%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf +%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt +%<latexrelease> \else \fontseries\mddefault +%<latexrelease> \fi\fi\fi +%<latexrelease> \UseHook{mdseries}% +%<latexrelease> \selectfont +%<latexrelease>} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/02/02}% +%<latexrelease> {\bfseries}{Custom series with hooks}% +%<latexrelease> +%<latexrelease> +%<latexrelease>\DeclareRobustCommand\bfseries{% +%<latexrelease> \not@math@alphabet\bfseries\mathbf +%<latexrelease> \expand@font@defaults +%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\bfseries@rm +%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf +%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt +%<latexrelease> \else \fontseries\bfdefault +%<latexrelease> \fi\fi\fi +%<latexrelease> \selectfont +%<latexrelease>} +%<latexrelease> +%<latexrelease>\DeclareRobustCommand\mdseries{% +%<latexrelease> \not@math@alphabet\mdseries\relax +%<latexrelease> \expand@font@defaults +%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\mdseries@rm +%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf +%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt +%<latexrelease> \else \fontseries\mddefault +%<latexrelease> \fi\fi\fi +%<latexrelease> \selectfont +%<latexrelease>} +%<latexrelease> +%<latexrelease> +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\bfseries}{Custom series with hooks}% +%<latexrelease> +%<latexrelease>\DeclareRobustCommand\bfseries +%<latexrelease> {\not@math@alphabet\bfseries\mathbf +%<latexrelease> \fontseries\bfdefault\selectfont} +%<latexrelease>\DeclareRobustCommand\mdseries +%<latexrelease> {\not@math@alphabet\mdseries\relax +%<latexrelease> \fontseries\mddefault\selectfont} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> + + + + +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease> {\expand@font@defaults}{Custom series with hooks}% +% \end{macrocode} + + + +% \begin{macro}{\expand@font@defaults} +% \begin{macro}{\rm@def@ult} +% \begin{macro}{\sf@def@ult} +% \begin{macro}{\tt@def@ult} +% \begin{macro}{\md@def@ult} +% \begin{macro}{\bf@def@ult} +% +% The family specific defaults are fully expanded, i.e., they are +% defined via \cs{edef} inside \cs{DeclareFontSeriesDefault}. +% However, the overall defaults, e.g., \cs{bfdefault} may have been +% redefined by the user and thus may not be fully expanded. So to +% enable reliable comparison we make expanded versions of +% them. That we rerun each time. The alternative would be to only +% allow for changes before begin document. +% \begin{macrocode} +\def\expand@font@defaults{% + \edef\rmdef@ult{\rmdefault}% + \edef\sfdef@ult{\sfdefault}% + \edef\ttdef@ult{\ttdefault}% +% \end{macrocode} +% The series defaults may contain some surplus \texttt{m} that we +% need to drop here. +% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from \cs{bfdef@ult} +% and \cs{mddef@ult} (gh/291)} +% \begin{macrocode} + \series@maybe@drop@one@m\bfdefault\bfdef@ult + \series@maybe@drop@one@m\mddefault\mddef@ult +% \end{macrocode} +% Formats that set up parallel fonts, e.g., for Japanese, can use +% this hook to add additional code here. +% \changes{v3.1m}{2020/04/06}{Hook added (gh/306)} +% \changes{v3.2b}{2020/08/21}{Integration of new hook management interface} +% \begin{macrocode} + \UseHook{expand@font@defaults}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} + + % \begin{macro}{\rmfamily} % Here are the document level commands for changing the main font @@ -1094,7 +1306,7 @@ %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{2020/02/02}% -%<latexrelease> {\bfseries}{Custom series with hooks}% +%<latexrelease> {\expand@font@defaults}{Custom series with hooks}% %<latexrelease> %<latexrelease>\def\expand@font@defaults{% %<latexrelease> \edef\rmdef@ult{\rmdefault}% @@ -1105,27 +1317,6 @@ %<latexrelease> \edef\famdef@ult{\familydefault}% %<latexrelease>} %<latexrelease> -%<latexrelease>\DeclareRobustCommand\bfseries{% -%<latexrelease> \not@math@alphabet\bfseries\mathbf -%<latexrelease> \expand@font@defaults -%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\bfseries@rm -%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf -%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt -%<latexrelease> \else \fontseries\bfdefault -%<latexrelease> \fi\fi\fi -%<latexrelease> \selectfont -%<latexrelease>} -%<latexrelease> -%<latexrelease>\DeclareRobustCommand\mdseries{% -%<latexrelease> \not@math@alphabet\mdseries\relax -%<latexrelease> \expand@font@defaults -%<latexrelease> \ifx\f@family\rmdef@ult \fontseries\mdseries@rm -%<latexrelease> \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf -%<latexrelease> \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt -%<latexrelease> \else \fontseries\mddefault -%<latexrelease> \fi\fi\fi -%<latexrelease> \selectfont -%<latexrelease>} %<latexrelease> %<latexrelease>\DeclareRobustCommand\rmfamily{% %<latexrelease> \not@math@alphabet\rmfamily\mathrm @@ -1152,7 +1343,7 @@ %<latexrelease> %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000/00/00}% -%<latexrelease> {\bfseries}{Custom series with hooks}% +%<latexrelease> {\expand@font@defaults}{Custom series with hooks}% %<latexrelease> %<latexrelease>\let\expand@font@defaults\@undefined %<latexrelease> diff --git a/Master/texmf-dist/source/latex-dev/base/ltfsstrc.dtx b/Master/texmf-dist/source/latex-dev/base/ltfsstrc.dtx index c6aec105ba5..f562a4fa907 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltfsstrc.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltfsstrc.dtx @@ -495,7 +495,7 @@ \delayed@f@adjustment % \end{macrocode} % We then check if the resulting cominbation is valid but for this -% we have to make sure the the appropiate \texttt{.fd} is loaded if +% we have to make sure that the appropiate \texttt{.fd} is loaded if % that hasn't happened so far. % \begin{macrocode} \maybe@load@fontshape diff --git a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx index 20e172a57f2..3969a2be567 100644 --- a/Master/texmf-dist/source/latex-dev/base/lthooks.dtx +++ b/Master/texmf-dist/source/latex-dev/base/lthooks.dtx @@ -31,8 +31,8 @@ %%% From File: lthooks.dtx % % \begin{macrocode} -\def\lthooksversion{v1.0n} -\def\lthooksdate{2021/05/26} +\def\lthooksversion{v1.0r} +\def\lthooksdate{2021/09/06} % \end{macrocode} % %<*driver> @@ -47,7 +47,7 @@ \vbox_unpack_drop:N \l__codedoc_macro_box \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \MacroFont % <----- without it the \ is in lmr10 if a link is made - \ + \ } } } \int_incr:N \l__codedoc_macro_int @@ -74,9 +74,9 @@ % \providecommand\pho[1]{\marginpar{\footnotesize PhO: #1}} % \providecommand\phoinline[1]{\begin{quote}\itshape\footnotesize PhO: #1\end{quote}} % -% % -% \title{The \texttt{lthooks} package\thanks{This package has version +% +% \title{\LaTeX{}'s hook management\thanks{This module has version % \lthooksversion\ dated \lthooksdate, \copyright\ \LaTeX\ % Project.}} % @@ -127,22 +127,18 @@ % % \subsubsection{Declaring hooks} % -% With a few exceptions, hooks have to be declared before they can -% be used. The exceptions are the generic hooks for commands, -% environments (i.e., executed at \cs{begin} and \cs{end}) and -% hooks run when loading files, e.g. before and after a package is -% loaded, etc. Their hook names depend on the command, -% environment or the -% file name and so declaring them beforehand is not practical. -% +% With a few exceptions, hooks have to be declared before they can +% be used. The exceptions are the generic hooks for commands and +% environments (executed at \cs{begin} and \cs{end}), and the +% hooks run when loading files (see section~\ref{sec:generic}). % % \begin{function}{\NewHook} % \begin{syntax} % \cs{NewHook} \Arg{hook} % \end{syntax} % Creates a new \meta{hook}. -% If this is a hook provided as part of a package it is suggested -% that the \meta{hook} name is always structured as follows: +% If this hook is declared within a package it is suggested +% that its name is always structured as follows: % \meta{package-name}\texttt{/}\meta{hook-name}. If necessary you % can further subdivide the name by adding more \texttt{/} parts. % If a hook name is already taken, an error is raised and the hook @@ -180,17 +176,19 @@ % \end{function} % % -% \subsubsection{Special declarations for hooks} +% \subsubsection{Special declarations for generic hooks} % % The declarations here should normally not be used. They are available % to provide support for special use cases mainly involving % generic command hooks. % -% \begin{function}{\DisableHook} +% \changes{v1.0p}{2021/08/20}{Documentation updates for generic hook commands (gh/638)} +% +% \begin{function}{\DisableGenericHook} % \begin{syntax} -% \cs{DisableHook} \Arg{hook} +% \cs{DisableGenericHook} \Arg{hook} % \end{syntax} -% After this declaration the \meta{hook} is no longer usable: Any +% After this declaration\footnotemark{} the \meta{hook} is no longer usable: Any % attempt to add further code to it will result in an error and any % use, e.g., via \cs{UseHook}, will simply do nothing. % @@ -201,37 +199,27 @@ % % The \meta{hook} can be specified using the dot-syntax to denote % the current package name. See section~\ref{sec:default-label}. -% \end{function} +% \end{function}\footnotetext{In the 2020/06 release this command was +% called \cs{DisableHook}, but that name was misleading as it +% shouldn't be used to disable non-generic hooks.} % % -% \begin{function}{\ProvideHook} +% \begin{function}{\ActivateGenericHook} % \begin{syntax} -% \cs{ProvideHook} \Arg{hook} +% \cs{ActivateGenericHook} \Arg{hook} % \end{syntax} -% Like \cs{NewHook} but does nothing if the hook was previously -% declared with \cs{NewHook}. This declaration should only be used -% in special situations, e.g., when command of another package -% need to be altered and it is is not clear if for that command a -% generic hook was already explicitly declared before. -% -% Normally \cs{NewHook} should be used instead. +% This declaration activates a generic hook provided by a package/class +% (e.g., one used in code with \cs{UseHook} or +% \cs{UseOneTimeHook}) without it being explicitly declared with +% \cs{NewHook}). +% This command undoes the effect of \cs{DisableGenericHook}. +% If the hook is already activated, this command does nothing. +% +% See section~\ref{sec:generic-hooks} for a discussion of when this +% declaration is appropriate. % \end{function} % -% \begin{function}{\ProvideReversedHook} -% \begin{syntax} -% \cs{ProvideReversedHook} \Arg{hook} -% \end{syntax} -% Like \cs{NewReversedHook} but does nothing if the hook was -% previously declared as a reversed hook. -% \end{function} % -% \begin{function}{\ProvideMirroredHookPair} -% \begin{syntax} -% \cs{ProvideMirroredHookPair} \Arg{hook-1} \Arg{hook-2} -% \end{syntax} -% A shorthand for -% \cs{ProvideHook}\Arg{hook-1}\cs{ProvideReversedHook}\Arg{hook-2}. -% \end{function} % % % @@ -272,12 +260,20 @@ % consumed and any further attempt to add to it will result in % executing the code to be added immediately. % -% \fmiinline{Maybe add an error version as well?} -% % The \meta{hook} \emph{cannot} be specified using the dot-syntax. % A leading |.| is treated literally. See % section~\ref{sec:default-label} for details. - +% +% Using \cs{UseOneTimeHook} several times with the same +% \Arg{hook} means that it only executes the first time it is used. +% For example, if it is used in a command that can be called several times +% then the hook executes during only the \emph{first} invocation of that +% command; this allows its use as an \enquote{initialization hook}. +% +% Mixing \cs{UseHook} and \cs{UseOneTimeHook} for the same +% \Arg{hook} should be avoided, but if this is done then neither will execute +% after the first \cs{UseOneTimeHook}. +% % \end{function} % % @@ -321,15 +317,19 @@ % When the optional argument \meta{label} is not provided, the % \meta{default label} is used (see section~\ref{sec:default-label}). % -% If the code for that \meta{label} wasn't yet added to the -% \meta{hook}, an order is set so that when some code attempts to add -% that label, the removal order takes action and the code is not -% added. +% If there is no code under the \meta{label} in the \meta{hook}, +% or if the \meta{hook} does not exist, a warning is issued when +% you attempt to \cs{RemoveFromHook}, and the command is ignored. +% \cs{RemoveFromHook} should be used only when you know exactly what +% labels are in a hook. Typically this will be when some code gets added to a hook +% by a package, then later this code is removed by that same package. +% If you want to prevent the execution of code from another +% package, use the |voids| rule instead (see section~\ref{sec:rules}). % % If the optional \meta{label} argument is \texttt{*}, then all code chunks are -% removed. This is rather dangerous as it drops code from other -% packages one may not know about and should therefore not by used -% by packages but only in document preambles! +% removed. This is rather dangerous as it may well drop code from other +% packages (that one may not know about); it should therefore not be used +% in packages but only in document preambles! % % The \meta{hook} and \meta{label} can be specified using the % dot-syntax to denote the current package name. @@ -378,14 +378,28 @@ % The code is executed after the normal hook code has finished and % it is executed only once, i.e. it is deleted after it was used. % -% Using the declaration is a global operation, i.e., the code is -% not lost, even if the declaration is used inside a group and the -% next invocation happens after the group. If the declaration is +% Using this declaration is a global operation, i.e., the code is +% not lost even if the declaration is used inside a group and the +% next invocation of the hook happens after the end of that group. +% If the declaration is % used several times before the hook is executed then all code is % executed in the order in which it was declared.\footnotemark % -% It is possible to nest declarations using the same hook (or -% different hooks), e.g., +% If this declaration is used with a one-time hook then the code +% is only ever used if the declaration comes before the hook’s +% invocation. This is because, in contrast +% to \cs{AddToHook}, the code in this declaration is not +% executed immediately in the case when the invocation of the hook +% has already happened---in other words, this code will truly execute +% only on the next invocation of the hook (and in the case of a +% one-time hook there is no such \enquote{next invocation}). +% This gives you a choice: should my code execute +% always, or should it execute only at the point where the +% one-time hook is used (and not at all if this is impossible)? For +% both of these possibilities there are use cases. +% +% It is possible to nest this declaration using the same hook (or +% different hooks): e.g., % \begin{quote} % \cs{AddToHookNext}\Arg{hook}\verb={=\meta{code-1}^^A % \cs{AddToHookNext}\Arg{hook}\Arg{code-2}\verb=}= @@ -404,6 +418,25 @@ % \end{function}\footnotetext{There is % no mechanism to reorder such code chunks (or delete them).} % +% +% +% \begin{function}{\ClearHookNext} +% \begin{syntax} +% \cs{ClearHookNext}\Arg{hook} +% \end{syntax} +% Normally \cs{AddToHookNext} is only used when you know precisely +% where it will apply and why you want some extra code at that +% point. However, there are a few use cases in which such a +% declaration needs to be canceled, for example, when +% discarding a page with \cs{DiscardShipoutBox} (but even then not +% always), and in such situations \cs{ClearHookNext} can be +% used. +% \end{function} +% +% +% +% +% % \subsubsection{Hook names and default labels} % \label{sec:default-label} % @@ -424,7 +457,7 @@ % % Except for \cs{UseHook}, \cs{UseOneTimeHook} and \cs{IfHookEmptyTF} % (and their \pkg{expl3} interfaces \cs{hook_use:n}, -% \cs{hook_use_once:n} and \cs{hook_if_empty:nTF}, all \meta{hook} +% \cs{hook_use_once:n} and \cs{hook_if_empty:nTF}), all \meta{hook} % and \meta{label} arguments are processed in the same way: first, % spaces are trimmed around the argument, then it is fully expanded % until only character tokens remain. If the full expansion of the @@ -458,7 +491,7 @@ % \AddToHook {./hook}[.]{code} % Same as \AddToHook{./hook}{code} % \AddToHook {./hook}[./sub]{code} % \DeclareHookRule{begindocument}{.}{before}{babel} -% \AddToHook {file/after/foo.tex}{code} +% \AddToHook {file/foo.tex/after}{code} % \end{verbatim} % are equivalent to: % \begin{verbatim} @@ -466,7 +499,7 @@ % \AddToHook {mypackage/hook}[mypackage]{code} % \AddToHook {mypackage/hook}[mypackage/sub]{code} % \DeclareHookRule{begindocument}{mypackage}{before}{babel} -% \AddToHook {file/after/foo.tex}{code} % unchanged +% \AddToHook {file/foo.tex/after}{code} % unchanged % \end{verbatim} % % The \meta{default label} is automatically set equal to the name of the @@ -534,7 +567,7 @@ % Packages that provide their own package-like interfaces % (Ti\textit{k}Z's \cs{usetikzlibrary}, for example) can use % \cs{PushDefaultHookLabel} and \cs{PopDefaultHookLabel} to set -% dedicated labels and emulate \cs{usepackage}-like hook behaviour +% dedicated labels and to emulate \cs{usepackage}-like hook behavior % within those contexts. % % The |top-level| label is treated differently, and is reserved to the @@ -588,6 +621,7 @@ % with that label from a package results in an error. % % \subsubsection{Defining relations between hook code} +% \label{sec:rules} % % The default assumption is that code added to hooks by different % packages are independent and the order in which they are executed is @@ -712,8 +746,8 @@ % \item exist and be non-empty; and % \item not exist (in which case emptiness doesn't apply); % \end{itemize} -% Hooks are a bit more complicated: -% a hook may exist or not, and either way it may or may not be empty. +% Hooks are a bit more complicated: +% a hook may exist or not, and independently it may or may not be empty. % This means that even a hook that doesn't exist may be non-empty and % it can also be disabled. % @@ -854,7 +888,7 @@ % \end{quote} % which means that the \meta{relation} applies to \meta{label-1} and % \meta{label-2}, in that order, as detailed in \cs{DeclareHookRule}. -% If the relation is \texttt{default} it means that that rule applies +% If the relation is \texttt{default} it means that this rule applies % to \meta{label-1} and \meta{label-2} in \emph{all} hooks, (unless % overridden by a non-default relation). % @@ -905,9 +939,9 @@ % % % -% \begin{function}{\hook_disable:n} +% \begin{function}{\hook_disable_generic:n} % \begin{syntax} -% \cs{hook_disable:n} \Arg{hook} +% \cs{hook_disable_generic:n} \Arg{hook} % \end{syntax} % Marks \Arg{hook} as disabled. Any further attempt to add code to % it or declare it, will result in an error and any call to @@ -921,34 +955,19 @@ % the current package name. See section~\ref{sec:default-label}. % \end{function} % -% \begin{function}{\hook_provide:n} +% \begin{function}{\hook_activate_generic:n} % \begin{syntax} -% \cs{hook_provide:n} \Arg{hook} +% \cs{hook_activate_generic:n} \Arg{hook} % \end{syntax} % Like \cs{hook_new:n} but does nothing if the hook was previously % declared with \cs{hook_new:n}. This declaration should only be used % in special situations, e.g., when a command of another package -% needs to be altered and it is is not clear if for that command a +% needs to be altered and it is not clear if for that command a % generic \hook{cmd} hook was already explicitly declared before. % % Normally \cs{hook_new:n} should be used instead. % \end{function} % -% \begin{function}{\hook_provide_reversed:n} -% \begin{syntax} -% \cs{hook_provide_reversed:n} \Arg{hook} -% \end{syntax} -% Like \cs{hook_new_reversed:n} but does nothing if the hook was -% previously declared as a reversed hook. -% \end{function} -% -% \begin{function}{\hook_provide_pair:nn} -% \begin{syntax} -% \cs{hook_provide_pair:nn} \Arg{hook-1} \Arg{hook-2} -% \end{syntax} -% A shorthand for -% \cs{hook_provide:n}\Arg{hook-1}\cs{hook_provide_reversed:n}\Arg{hook-2}. -% \end{function} % % % @@ -1013,6 +1032,15 @@ % \end{function} % % +% \begin{function} +% {\hook_gclear_next_code:n} +% \begin{syntax} +% \cs{hook_gclear_next_code:n} \Arg{hook} +% \end{syntax} +% Undo any earlier \cs{hook_gput_next_code:nn}. +% \end{function} +% +% % % \begin{function}{\hook_gremove_code:nn} % \begin{syntax} @@ -1020,10 +1048,9 @@ % \end{syntax} % Removes any code for \meta{hook} labeled \meta{label}. % -% If the code for that \meta{label} wasn't yet added to the -% \meta{hook}, an order is set so that when some code attempts to add -% that label, the removal order takes action and the code is not -% added. +% If there is no code under the \meta{label} in the \meta{hook}, +% or if the \meta{hook} does not exist, a warning is issued when +% you attempt to use \cs{hook_gremove_code:nn}, and the command is ignored. % % If the second argument is \texttt{*}, then all code chunks are % removed. This is rather dangerous as it drops code from other @@ -1138,7 +1165,7 @@ % which key-value pairs got added. However, that is only true if % nothing other than adding happens! % -% Suppose, or example, you want to replace the code chunk for +% Suppose, for example, you want to replace the code chunk for % \texttt{packageA}, e.g., %\begin{verbatim} % \RemoveFromHook{myhook}[packageA] @@ -1297,7 +1324,7 @@ % \cs{AtBeginDocument} which is why it is supported.} (all three % code chunks are executed one after another), but it makes little % sense with a normal hook, because with a normal hook the first time -% \verb=\UseHook{myhook}= is executed it would +% \verb=\UseHook{myhook}= is executed it would % \begin{itemize} % \item % execute \meta{code-1}, @@ -1315,6 +1342,70 @@ % % % +% \subsection{Generic hooks provided by packages} +% \label{sec:generic-hooks} +% +% \changes{v1.0p}{2021/08/20}{Section on generic hooks added (gh/638)} +% +% The hook management system also implements a category of hooks +% that are called \enquote{Generic Hooks}. Normally a hook has to +% be explicitly declared before it can be used in code. This +% ensures that different packages are not using the same hook name +% for unrelated purposes---something that would result in absolute +% chaos. However, there are a number of \enquote{standard} hooks +% where it is unreasonable to declare them beforehand, e.g, each +% and every command has (in theory) an associated \texttt{before} +% and \texttt{after} hook. In such cases, i.e., for command, +% environment or file hooks, they can be used simply by adding code +% to them with \cs{AddToHook}. For more specialized generic hooks, +% e.g., those provided by \pkg{babel}, you have to additionally +% enable them with \cs{ActivateGenericHook} as explained below. +% +% The generic hooks provided by \LaTeX{} are those for +% \hook{cmd}, +% \hook{env}, +% \hook{file}, +% \hook{include} +% \hook{package}, and +% \hook{class}, +% and all these are available out of the box: you only have to +% use \cs{AddToHook} to +% add code to them, but you don't have to add \cs{UseHook} or +% \cs{UseOneTimeHook} to your code, because this is already done for +% you (or, in the case of \hook{cmd} hooks, the command’s code is +% patched at \verb=\begin{document}=, if necessary). +% +% However, if you want to provide further generic hooks in your own +% code, the situation is slightly different. To do this you should +% use \cs{UseHook} or \cs{UseOneTimeHook}, but +% \emph{without declaring the hook} with \cs{NewHook}. As +% mentioned earlier, a call to \cs{UseHook} with an undeclared hook +% name does nothing. So as an additional setup step, you need to +% explicitly activate your generic hook. Note that a generic hook +% produced in this way is always a normal hook. +% +% For a truly generic hook, with a variable part in the hook name, +% such upfront activation would be difficult or impossible, because +% you typically do not know what kind of variable parts may come up +% in real documents. +% +% For example, \pkg{babel} may want to provide hooks such as +% \hook{babel/afterextras/\meta{language}}. Language support in +% \pkg{babel} is often done through external language +% packages. Thus doing the activation for all languages inside the +% core \pkg{babel} code is not a viable approach. Instead it needs +% to be done by each language package (or by the user who wants to +% use a particular hook). +% +% Because the hooks are not declared with \cs{NewHook} their names +% should be carefully chosen to ensure that they are (likely to be) +% unique. Best practice is to include the package or +% command name, as was done in the \pkg{babel} example above. +% +% Generic hooks defined in this way are always normal hooks (i.e., +% you can't implement reversed hooks this way). This is a +% deliberate limitation, because it speeds up the processessing +% conciderably. % % % \subsection{Private \LaTeX{} kernel hooks} @@ -1354,8 +1445,8 @@ % % \subsection{Legacy \LaTeXe{} interfaces} % -% \newcommand\onetimetext{% -% This is a one-time hook, so after it is executed, all further +% \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}).} % @@ -1363,7 +1454,7 @@ % add to them. They are listed here and are retained for backwards % compatibility. % -% With the new hook management several additional hooks have been added +% With the new hook management, several additional hooks have been added % to \LaTeX\ and more will follow. See the next section for what % is already available. % @@ -1374,7 +1465,7 @@ % \end{syntax} % If used without the optional argument \meta{label}, it works essentially % like before, i.e., it is adding \meta{code} to the hook -% \hook{begindocument} +% \hook{begindocument} % (which is executed inside \verb=\begin{document}=). % However, all code added this way is labeled with the label % \hook{top-level} (see section~\ref{sec:top-level}) @@ -1430,10 +1521,54 @@ % the processing. % % -% \subsection{\LaTeXe{} commands and environments augmented by -% hooks} -% -% \emph{intro to be written} +% \section{\LaTeXe{} commands and environments augmented by hooks} +% +% In this section we describe the standard hooks that are now +% offered by \LaTeX{}, or give pointers to other documents in which +% they are described. This section will grow over time (and +% perhaps eventually move to usrguide3). +% +% \subsection{Generic hooks} +% \label{sec:generic} +% +% As stated earlier, with the exception of generic hooks, all hooks must +% be declared with \cs{NewHook} before they can be used. +% All generic hooks have names of the form +% \enquote{\meta{type}/\meta{name}/\meta{position}}, where \meta{type} +% is from the predefined list shown below, and \meta{name} is the variable +% part whose meaning will depend on the \meta{type}. The last component, +% \meta{position}, has more complex possibilities: +% it can always be |before| or |after|; for |env| hooks, it can also be |begin| +% or |end|; and for |include| hooks it can also be |end|. Each specific +% hook is documented below, or in \texttt{ltcmdhooks-doc.pdf} or +% \texttt{ltfilehook-doc.pdf}. +% +% The generic hooks provided by \LaTeX{} belong to one of the six types: +% \begin{description} +% \item[env] Hooks executed before and after environments -- +% \meta{name} is the name of the environment, and available values +% for \meta{position} are |before|, |begin|, |end|, and |after|; +% \item[cmd] Hooks added to and executed before and after commands -- +% \meta{name} is the name of the command, and available values +% for \meta{position} are |before| and |after|; +% \item[file] Hooks executed before and after reading a file -- +% \meta{name} is the name of the file (with extension), and +% available values for \meta{position} are |before| and |after|; +% \item[package] Hooks executed before and after loading packages -- +% \meta{name} is the name of the package, and available values for +% \meta{position} are |before| and |after|; +% \item[class] Hooks executed before and after loading classes -- +% \meta{name} is the name of the class, and available values for +% \meta{position} are |before| and |after|; +% \item[include] Hooks executed before and after \cs{include}d files -- +% \meta{name} is the name of the included file (without the |.tex| +% extension), and available values for \meta{position} are |before|, +% |end|, and |after|. +% \end{description} +% +% Each of the hooks above are detailed in the following sections and +% in linked documentation. +% ^^A^^A^^A \pho{Wouldn't it be better to document all hooks here?} % % \subsubsection{Generic hooks for all environments} % @@ -1495,9 +1630,15 @@ % to add the outer hooks, etc. % % +% Largely for compatibility with existing packages, the following +% four commands are also available to set the environment hooks; but for +% new packages we recommend directly using the hook names and +% \cs{AddToHook}. +% +% % \begin{function}{\BeforeBeginEnvironment} % \begin{syntax} -% \cs{BeforeBeginEnvironment} \oarg{label} \Arg{code} +% \cs{BeforeBeginEnvironment} \oarg{label} \Arg{env} \Arg{code} % \end{syntax} % This declaration adds to the \hook{env/\meta{env}/before} hook % using the \meta{label}. If \meta{label} is not given, the @@ -1506,23 +1647,23 @@ % % \begin{function}{\AtBeginEnvironment} % \begin{syntax} -% \cs{AtBeginEnvironment} \oarg{label} \Arg{code} +% \cs{AtBeginEnvironment} \oarg{label} \Arg{env} \Arg{code} % \end{syntax} -% Like \cs{BeforeBeginEnvironment} but adds to the \hook{env/\meta{env}/begin} hook. +% This is like \cs{BeforeBeginEnvironment} but it adds to the \hook{env/\meta{env}/begin} hook. % \end{function} % % \begin{function}{\AtEndEnvironment} % \begin{syntax} -% \cs{AtEndEnvironment} \oarg{label} \Arg{code} +% \cs{AtEndEnvironment} \oarg{label} \Arg{env} \Arg{code} % \end{syntax} -% Like \cs{BeforeBeginEnvironment} but adds to the \hook{env/\meta{env}/end} hook. +% This is like \cs{BeforeBeginEnvironment} but it adds to the \hook{env/\meta{env}/end} hook. % \end{function} % % \begin{function}{\AfterEndEnvironment} % \begin{syntax} -% \cs{AfterEndEnvironment} \oarg{label} \Arg{code} +% \cs{AfterEndEnvironment} \oarg{label} \Arg{env} \Arg{code} % \end{syntax} -% Like \cs{BeforeBeginEnvironment} but adds to the \hook{env/\meta{env}/after} hook. +% This is like \cs{BeforeBeginEnvironment} but it adds to the \hook{env/\meta{env}/after} hook. % \end{function} % % @@ -1559,7 +1700,7 @@ % % % -% \subsubsection{Hooks provided by \cs{begin}\texttt{\{document\}}} +% \subsection{Hooks provided by \cs{begin}\texttt{\{document\}}} % \label{sec:begindocument-hooks} % % Until 2020 \cs{begin}\texttt{\{document\}} offered exactly one @@ -1618,7 +1759,7 @@ % % % -% \subsubsection{Hooks provided by \cs{end}\texttt{\{document\}}} +% \subsection{Hooks provided by \cs{end}\texttt{\{document\}}} % % \LaTeXe{} always provided \cs{AtEndDocument} to add code to the % execution of \verb=\end{document}= just in front of the code that @@ -1726,7 +1867,7 @@ % % % -% \subsubsection{Hooks provided by \cs{shipout} operations} +% \subsection{Hooks provided by \cs{shipout} operations} % \label{sec:shipout} % % There are several hooks and mechanisms added to \LaTeX{}'s @@ -1735,36 +1876,44 @@ % \texttt{ltshipout-code.pdf}. % % +% \subsection{Hooks provided for paragraphs} +% \label{sec:para} +% +% The paragraph processing has been augmented to include a number of +% internal and public hooks. These are documented in +% \texttt{ltpara-doc.pdf} or with code in +% \texttt{ltpara-code.pdf}. +% +% % -% \subsubsection{Hooks provided in NFSS commands} +% \subsection{Hooks provided in NFSS commands} % % In languages that need to support for more than one script in -% parallel (and thus several sets of fonts), e.g., Latin and -% Japanese fonts, NFSS font commands, such as \cs{sffamily}, need +% parallel (and thus several sets of fonts, e.g., supporting both Latin and +% Japanese fonts), NFSS font commands such as \cs{sffamily} need % to switch both the Latin family to ``Sans Serif'' and in addition % alter a second set of fonts. % -% To support this several NFSS have hooks in which such support can -% be added. +% To support this, several NFSS commands have hooks to which +% such support can be added. % \begin{description} % % \item[\hook{rmfamily}] % % After \cs{rmfamily} has done its initial checks and prepared a -% any font series update this hook is executed and only -% afterwards \cs{selectfont}. +% font series update, this hook is executed before \cs{selectfont}. % % \item[\hook{sffamily}] % -% Like the \hook{rmfamily} hook but for the \cs{sffamily} command. +% This is like the \hook{rmfamily} hook, but for the \cs{sffamily} command. % % \item[\hook{ttfamily}] % -% Like the \hook{rmfamily} hook but for the \cs{ttfamily} command. +% This is like the \hook{rmfamily} hook, but for the \cs{ttfamily} command. % % \item[\hook{normalfont}] % -% The \cs{normalfont} command resets font encoding family series +% The \cs{normalfont} command resets the font encoding, family, series % and shape to their document defaults. It then executes this % hook and finally calls \cs{selectfont}. % @@ -1779,21 +1928,36 @@ % % \item[\hook{bfseries/defaults}, \hook{bfseries}] % -% If the \cs{bfdefault} was explicitly changed by the user its +% If the \cs{bfdefault} was explicitly changed by the user, its % new value is used to set the bf series defaults for the meta -% families (rm/sf/tt) when \cs{bfseries} is called. In the -% \hook{bfseries/defaults} hook further adjustments can be made +% families (rm/sf/tt) when \cs{bfseries} is called. The +% \hook{bfseries/defaults} hook allows further adjustments to be made % in this case. This hook is only executed if such a change is -% detected. In contrast the \hook{bfseries} hook is always +% detected. In contrast, the \hook{bfseries} hook is always % executed just before \cs{selectfont} is called to change to the % new series. % % % \item[\hook{mdseries/defaults}, \hook{mdseries}] % -% These two hooks are like the previous ones but used in +% These two hooks are like the previous ones but they are in the % \cs{mdseries} command. % +% \item[\hook{selectfont}] +% +% This hook is executed inside \cs{selectfont}, after the current +% values for \textit{encoding}, \textit{family}, \textit{series}, +% \textit{shape}, and \textit{size} are evaluated and the new font +% is selected (and if necessary loaded). After the hook has +% executed, NFSS will still do any updates necessary for a new +% \textit{size} (such as changing the size of \cs{strut}) and any +% updates necessary to a change in \textit{encoding}. +% +% This hook is intended for use cases where, in parallel to a +% change in the main font, some other fonts need to be altered +% (e.g., in CJK processing where you may need to deal with several +% different alphabets). +% % \end{description} % % @@ -1859,7 +2023,7 @@ % % \begin{macro}[EXP]{\@@_str_compare:nn} % Private copy of \cs{__str_if_eq:nn} -% \InternalDetectionOff +% \InternalDetectionOff % \begin{macrocode} \cs_new_eq:NN \@@_str_compare:nn \__str_if_eq:nn % \end{macrocode} @@ -1892,13 +2056,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\g_@@_removal_list_prop} -% A token list to hold delayed removals. -% \begin{macrocode} -\tl_new:N \g_@@_removal_list_tl -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\l_@@_cur_hook_tl} % Stores the name of the hook currently being sorted. % \begin{macrocode} @@ -1916,13 +2073,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\g_@@_execute_immediately_prop} -% List of hooks that from no on should not longer receive code. -% \begin{macrocode} -\prop_new:N \g_@@_execute_immediately_prop -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\g_@@_used_prop} % All hooks that receive code (for use in debugging display). % \begin{macrocode} @@ -1963,6 +2113,13 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_clean_to_scan:w} +% Removes tokens until the next \cs{s_@@_mark}. +% \begin{macrocode} +\cs_new:Npn \@@_clean_to_scan:w #1 \s_@@_mark { } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_tl_set:Nn,\@@_tl_set:Nx, % \@@_tl_set:cn,\@@_tl_set:cx} % Private copies of a few \pkg{expl3} functions. \pkg{l3debug} will @@ -2055,7 +2212,7 @@ % \item[\cs{g_@@_\meta{hook}_code_prop}] A property list holding the code % for the hook in separate chunks. The keys are by default the % package names that add code to the hook, but it is possible -% for packages to define other keys. +% for packages to define other keys. % % \item[{\cs[no-index]{g_@@_\meta{hook}_rule_\meta{label1}\string|\meta{label2}_tl}}] % A token list holding the relation between \meta{label1} and @@ -2108,19 +2265,19 @@ % \label{sec:existence} % % A hook may be in different states of existence. Here we give an -% overview of internal commands to set up hooks and explain how the +% overview of the internal commands to set up hooks and explain how the % different states are distinguished. The actual implementation -% then follows in the next sections. +% then follows in subsequent sections. % -% One problem we have to solve is, that we need to be able to add +% One problem we have to solve is that we need to be able to add % code to hooks (e.g., with \cs{AddToHook}) even if that code has -% not been declared yet. For example, one package needs to write -% into a hook of another package, but that package ay not get -% loaded or only loaded later. Another problem most hooks require -% declaration but this is not the case for the generic hooks. +% not yet been declared. For example, one package needs to write +% into a hook of another package, but that package may not get +% loaded, or is loaded only later. Another problem is that most hooks, +% but not the generic hooks, require a declaration. % -% We therefore distinguish the following states for a hook and they -% are managed with four different tests: structure existence +% We therefore distinguish the following states for a hook, which +% are managed by four different tests: structure existence % (\cs{@@_if_structure_exist:nTF}), creation % (\cs{@@_if_usable:nTF}), declaration (\cs{@@_if_declared:nTF}) % and disabled or not (\cs{@@_if_disabled:nTF}) @@ -2151,12 +2308,12 @@ % \item [@@_if_disabled:nTF] returns |false|. % \end{itemize} % -% The allowed acctions are the same as in the \enquote{not +% The allowed actions are the same as in the \enquote{not % existing} state. % % \item[declared] % -% A hook is in this state it is not disabled and was explicity declared (e.g., +% A hook is in this state it is not disabled and was explicitly declared (e.g., % with \cs{NewHook}). In this case the four tests give the % following results: % \begin{itemize} @@ -2187,8 +2344,8 @@ % % \item[disabled] % -% A hook in any state is moved to this state when -% \cs{DisableHook} is used. This changes the tests to give the +% A generic hook in any state is moved to this state when +% \cs{DisableGenericHook} is used. This changes the tests to give the % following results: % \begin{itemize} % \item [@@_if_structure_exist:nTF] \emph{unchanged}. @@ -2197,7 +2354,7 @@ % \item [@@_if_disabled:nTF] returns |true|. % \end{itemize} % The structure test is unchanged (if the hook was unknown before it is -% false, otherwise true). The usable test returns false so that +% |false|, otherwise |true|). The usable test returns |false| so that % any \cs{UseHook} will bypass the hook from now on. The % declared test returns true so that any further \cs{NewHook} % generates an error and the disabled test returns true so that @@ -2240,8 +2397,8 @@ % \end{macrocode} % \end{macro} % -% -% +% +% % \begin{macro}{\@@_make_usable:n} % % This initializes all hook data structures for the hook but if @@ -2315,7 +2472,7 @@ % (\cs[no-index]{g_@@_\meta{hook}_code_prop}) and the |top-level| % and |next| token lists. A hook is initialized with % \cs{@@_init_structure:n} the first time anything is added to it. -% Inizializing a hook just with \cs{@@_init_structure:n} will not +% Initializing a hook just with \cs{@@_init_structure:n} will not % make it usable with \cs{hook_use:n}. % \begin{macrocode} \cs_new_protected:Npn \@@_init_structure:n #1 @@ -2407,7 +2564,9 @@ % % \subsubsection{Disabling and providing hooks} % -% \begin{macro}{\hook_disable:n} +% \changes{v1.0p}{2021/08/20}{Renames of generic hook commands (gh/638)} +% +% \begin{macro}{\hook_disable_generic:n} % \begin{macro}{\@@_disable:n} % \begin{macro}[pTF]{\@@_if_disabled:n} % @@ -2423,11 +2582,11 @@ % % \begin{macrocode} %<latexrelease>\IncludeInRelease{2021/06/01}% -%<latexrelease> {\hook_disable:n}{Disable~hooks} +%<latexrelease> {\hook_disable_generic:n}{Disable~hooks} % \end{macrocode} -% +% % \begin{macrocode} -\cs_new_protected:Npn \hook_disable:n #1 +\cs_new_protected:Npn \hook_disable_generic:n #1 { \@@_normalize_hook_args:Nn \@@_disable:n {#1} } \cs_new_protected:Npn \@@_disable:n #1 { @@ -2447,9 +2606,9 @@ % % \begin{macrocode} %<latexrelease>\IncludeInRelease{2020/10/01} -%<latexrelease> {\hook_disable:n}{Disable~hooks} +%<latexrelease> {\hook_disable_generic:n}{Disable~hooks} %<latexrelease> -%<latexrelease>\cs_new_protected:Npn \hook_disable:n #1 {} +%<latexrelease>\cs_new_protected:Npn \hook_disable_generic:n #1 {} %<latexrelease> %<latexrelease>\EndIncludeInRelease % \end{macrocode} @@ -2457,71 +2616,47 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\hook_provide:n} -% \begin{macro}{\hook_provide_reversed:n} -% \begin{macro}{\@@_provide:n} -% The \cs{hook_provide:n} declaration declares a new hook if it +% \begin{macro}{\hook_activate_generic:n} +% \begin{macro}{\@@_activate_generic:n} +% The \cs{hook_activate_generic:n} declaration declares a new hook if it % wasn't declared already, in which case it only checks that the % already existing hook is not a reversed hook. -% The \cs{hook_provide_reversed:n} does the same for reversed hooks. -% \hook{begindocument}. % \begin{macrocode} %<latexrelease>\IncludeInRelease{2021/06/01}% -%<latexrelease> {\hook_provide:n}{Providing~hooks} +%<latexrelease> {\hook_activate_generic:n}{Providing~hooks} % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \hook_provide:n #1 - { \@@_normalize_hook_args:Nn \@@_provide:nn {#1} { } } -\cs_new_protected:Npn \hook_provide_reversed:n #1 - { \@@_normalize_hook_args:Nn \@@_provide:nn {#1} { - } } +\cs_new_protected:Npn \hook_activate_generic:n #1 + { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} { } } % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \@@_provide:nn #1 #2 +\cs_new_protected:Npn \@@_activate_generic:nn #1 #2 { % \end{macrocode} -% If the hook to be provided was disabled we warn (for now --- this +% If the hook to be activated was disabled we warn (for now --- this % may change). % \begin{macrocode} \@@_if_disabled:nTF {#1} - { \msg_warning:nnn { hooks } { provide-disabled } {#1} } + { \msg_warning:nnn { hooks } { activate-disabled } {#1} } % \end{macrocode} -% Otherwise we check if it was already declared. +% Otherwise we check if the hook is not declared, and if it isn't, +% figure out if it's reversed or not, then declare it accordingly. % \begin{macrocode} { - \@@_if_declared:nTF {#1} - { -% \end{macrocode} -% Issue an error if we try to provide a a hook that is reversed and -% the already existing one is not (or vice versa). -% \begin{macrocode} - \str_if_eq:eeF { \tl_use:c { g_@@_#1_reversed_tl } } {#2} - { \msg_error:nnn { hooks } { provide-error } {#1} } - } -% \end{macrocode} -% If it wasn't declared, we declared as a normal or reversed hook -% as appropriate. -% \begin{macrocode} + \@@_if_declared:nF {#1} { \tl_new:c { g_@@_#1_declared_tl } \@@_make_usable:n {#1} - \tl_gset:cn { g_@@_#1_reversed_tl } {#2} + \tl_gset:cx { g_@@_#1_reversed_tl } + { \@@_if_generic_reversed:nT {#1} { - } } } } } % \end{macrocode} % \end{macro} % \end{macro} -% \end{macro} -% -% \begin{macro}{\hook_provide_pair:nn} -% A shorthand for providing a normal and a (matching) reversed hook in one go. -% \begin{macrocode} -\cs_new_protected:Npn \hook_provide_pair:nn #1#2 - { \hook_provide:n {#1} \hook_provide_reversed:n {#2} } -% \end{macrocode} -% \end{macro} % % \begin{macrocode} %<latexrelease>\EndIncludeInRelease @@ -2529,11 +2664,9 @@ % % \begin{macrocode} %<latexrelease>\IncludeInRelease{2020/10/01} -%<latexrelease> {\hook_provide:n}{Providing~hooks} +%<latexrelease> {\hook_activate_generic:n}{Providing~hooks} %<latexrelease> -%<latexrelease>\cs_new_protected:Npn \hook_provide_reversed:n #1 {} -%<latexrelease>\cs_new_protected:Npn \hook_provide:n #1 {} -%<latexrelease>\cs_new_protected:Npn \hook_provide_pair:nn #1#2 {} +%<latexrelease>\cs_new_protected:Npn \hook_activate_generic:n #1 {} %<latexrelease> %<latexrelease>\EndIncludeInRelease % \end{macrocode} @@ -2600,8 +2733,8 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_currname_or_default:} -% Uses \cs{g_@@_hook_curr_name_tl} if it is set, otherwise tries -% \cs{@currname}. If neither is set, raises an error and uses the +% This uses \cs{g_@@_hook_curr_name_tl} if it is set, otherwise it tries +% \cs{@currname}. If neither is set, it raises an error and uses the % fallback value \verb|label-missing|. % \begin{macrocode} \cs_new:Npn \@@_currname_or_default: @@ -2610,7 +2743,7 @@ { \tl_if_empty:NTF \@currname { - \msg_expandable_error:nnn { kernel } { should-not-happen } + \msg_expandable_error:nnn { latex2e } { should-not-happen } { Empty~default~label. } \@@_make_name:n { label-missing } } @@ -2622,7 +2755,7 @@ % \end{macro} % % \begin{macro}[EXP]{\@@_make_name:n,\@@_make_name:w} -% Provides a standard sanitization of a hook's name. +% This provides a standard sanitization of a hook's name. % It uses \cs{cs:w} to build a control sequence out of the hook name, % then uses \cs{cs_to_str:N} to get the string representation of that, % without the escape character. \cs{cs:w}-based expansion is used @@ -2646,7 +2779,7 @@ % \begin{macro}{\@@_normalize_hook_args:Nnn} % \begin{macro}{\@@_normalize_hook_rule_args:Nnnnn} % \begin{macro}{\@@_normalize_hook_args_aux:Nn} -% Standard route for normalising hook and label arguments. The main +% This is the standard route for normalizing hook and label arguments. The main % macro does the entire operation within a group so that csnames made % by \cs{@@_make_name:n} are wiped off before continuing. This means % that this function cannot be used for \cs{hook_use:n}! @@ -2689,16 +2822,151 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\@@_curr_name_push:n,\@@_curr_name_push_aux:n} +% \begin{macro}{\@@_curr_name_pop:} +% \begin{macro}{\@@_end_document_label_check:} +% The token list \cs{g_@@_hook_curr_name_tl} stores the name of the +% current package/file to be used as the default label in hooks. +% Providing a consistent interface is tricky because packages can +% be loaded within packages, and some packages may not use +% \cs{SetDefaultHookLabel} to change the default label (in which +% case \cs{@currname} is used). +% +% To pull that one off, we keep a stack that contains the default +% label for each level of input. The bottom of the stack contains the +% default label for the |top-level| (this stack should never go +% empty). If we're building the format, set the default label to be +% |top-level|: +% \begin{macrocode} +\tl_gset:Nn \g_@@_hook_curr_name_tl { top-level } +% \end{macrocode} +% +% Then, in case we're in \pkg{latexrelease} we push something on +% the stack to support roll forward. But in some rare cases, +% \pkg{latexrelease} may be loaded inside another package (notably +% \pkg{platexrelease}), so we'll first push the |top-level| entry: +% \changes{v1.0i}{2021/03/18} +% {Only add \texttt{top-level} if not already there.} +% \begin{macrocode} +%<latexrelease>\seq_if_empty:NT \g_@@_name_stack_seq +%<latexrelease> { \seq_gput_right:Nn \g_@@_name_stack_seq { top-level } } +% \end{macrocode} +% then we dissect the \cs{@currnamestack}, adding \cs{@currname} to +% the stack: +% \changes{v1.0f}{2020/11/24}{Support for roll forward (gh/434)} +% \begin{macrocode} +%<latexrelease>\cs_set_protected:Npn \@@_tmp:w #1 #2 #3 +%<latexrelease> { +%<latexrelease> \quark_if_recursion_tail_stop:n {#1} +%<latexrelease> \seq_gput_right:Nn \g_@@_name_stack_seq {#1} +%<latexrelease> \@@_tmp:w +%<latexrelease> } +%<latexrelease>\exp_after:wN \@@_tmp:w \@currnamestack +%<latexrelease> \q_recursion_tail \q_recursion_tail +%<latexrelease> \q_recursion_tail \q_recursion_stop +% \end{macrocode} +% and finally set the default label to be the \cs{@currname}: +% \changes{v1.0i}{2021/03/18} +% {Remove the (empty) \enquote{top-level} from \cs{@currnamestack}.} +% \begin{macrocode} +%<latexrelease>\tl_gset:Nx \g_@@_hook_curr_name_tl { \@currname } +%<latexrelease>\seq_gpop_right:NN \g_@@_name_stack_seq \l_@@_tmpa_tl +% \end{macrocode} +% +% Two commands keep track of the stack: when a file is input, +% \cs{@@_curr_name_push:n} pushes the current default label onto the +% stack and sets the new default label (all in one go): +% \begin{macrocode} +\cs_new_protected:Npn \@@_curr_name_push:n #1 + { \exp_args:Nx \@@_curr_name_push_aux:n { \@@_make_name:n {#1} } } +\cs_new_protected:Npn \@@_curr_name_push_aux:n #1 + { + \tl_if_blank:nTF {#1} + { \msg_error:nn { hooks } { no-default-label } } + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { PushDefaultHookLabel } {#1} + } + { + \seq_gpush:NV \g_@@_name_stack_seq \g_@@_hook_curr_name_tl + \tl_gset:Nn \g_@@_hook_curr_name_tl {#1} + } + } + } +% \end{macrocode} +% and when an input is over, the topmost item of the stack is popped, +% since that label will not be used again, and \cs{g_@@_hook_curr_name_tl} +% is updated to equal the now topmost item of the stack: +% \begin{macrocode} +\cs_new_protected:Npn \@@_curr_name_pop: + { + \seq_gpop:NNTF \g_@@_name_stack_seq \l_@@_return_tl + { \tl_gset_eq:NN \g_@@_hook_curr_name_tl \l_@@_return_tl } + { \msg_error:nn { hooks } { extra-pop-label } } + } +% \end{macrocode} +% +% At the end of the document we want to check if there was no +% \cs{@@_curr_name_push:n} without a matching \cs{@@_curr_name_pop:} +% (not a critical error, but it might indicate that something else is +% not quite right): +% \begin{macrocode} +\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage + { \@@_end_document_label_check: } +\cs_new_protected:Npn \@@_end_document_label_check: + { + \seq_gpop:NNT \g_@@_name_stack_seq \l_@@_return_tl + { + \msg_error:nnx { hooks } { missing-pop-label } + { \g_@@_hook_curr_name_tl } + \tl_gset_eq:NN \g_@@_hook_curr_name_tl \l_@@_return_tl + \@@_end_document_label_check: + } + } +% \end{macrocode} +% +% The token list \cs{g_@@_hook_curr_name_tl} is but a mirror of the +% top of the stack. % +% \begin{macro}{\@@_set_default_hook_label:n,\@@_set_default_label:n} +% Now define a wrapper that replaces the top of the stack with the +% argument, and updates \cs{g_@@_hook_curr_name_tl} accordingly. +% \begin{macrocode} +\cs_new_protected:Npn \@@_set_default_hook_label:n #1 + { + \seq_if_empty:NTF \g_@@_name_stack_seq + { + \msg_error:nnnnn { hooks } { set-top-level } + { for } { SetDefaultHookLabel } {#1} + } + { \exp_args:Nx \@@_set_default_label:n { \@@_make_name:n {#1} } } + } +\cs_new_protected:Npn \@@_set_default_label:n #1 + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { SetDefaultHookLabel } {#1} + } + { \tl_gset:Nn \g_@@_hook_curr_name_tl {#1} } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \subsection{Adding or removing hook code} % % \begin{macro}{\hook_gput_code:nnn} -% \begin{macro}{\@@_gput_code:nnn,\@@_gput_code:nxv,\@@_hook_gput_code_do:nnn} +% \begin{macro}{\@@_gput_code:nnn,\@@_hook_gput_code_do:nnn} % % With \cs{hook_gput_code:nnn}\Arg{hook}\Arg{label}\Arg{code} a % chunk of \meta{code} is added to an existing \meta{hook} labeled % with \meta{label}. +% \changes{v1.0o}{2021/07/22}{Do not queue removals (gh/625)} % \begin{macrocode} \cs_new_protected:Npn \hook_gput_code:nnn #1 #2 { \@@_normalize_hook_args:Nnn \@@_gput_code:nnn {#1} {#2} } @@ -2708,61 +2976,46 @@ \cs_new_protected:Npn \@@_gput_code:nnn #1 #2 #3 { % \end{macrocode} -% First check if the hook was used as a one-time hook: +% First check if the code should be executed immediately, rather than +% stored: +% \changes{v1.0r}{2021/09/06}{Use dedicated conditional (gh/606)} % \begin{macrocode} - \prop_if_in:NnTF \g_@@_execute_immediately_prop {#1} + \@@_if_execute_immediately:nTF {#1} {#3} { % \end{macrocode} -% Then check if the current \meta{hook}/\meta{label} pair was marked -% for removal, in which case \cs{@@_unmark_removal:nn} is used to -% remove that mark (once). This may happen when a package removes -% code from another package which was not yet loaded: the removal -% order is stored, and at this stage it is executed by not adding to -% the hook. -% \begin{macrocode} - \@@_if_marked_removal:nnTF {#1} {#2} - { \@@_unmark_removal:nn {#1} {#2} } - { -% \end{macrocode} -% If no removal is queued, we are free to add. Start by checking if -% the hook exists. +% Then check if the hook is usable. % \begin{macrocode} - \@@_if_usable:nTF {#1} + \@@_if_usable:nTF {#1} % \end{macrocode} % If so we simply add (or append) the new code to the property list % holding different chunks for the hook. At \verb=\begin{document}= % this is then sorted into a token list for fast execution. % \begin{macrocode} - { - \@@_hook_gput_code_do:nnn {#1} {#2} {#3} + { + \@@_hook_gput_code_do:nnn {#1} {#2} {#3} % \end{macrocode} % However, if there is an update within the document we need to alter % this execution code which is done by % \cs{@@_update_hook_code:n}. In the preamble this does nothing. % \begin{macrocode} - \@@_update_hook_code:n {#1} - } + \@@_update_hook_code:n {#1} + } % \end{macrocode} % -% If the hook does not exist, however, before giving up try to -% declare it as a generic hook, if its name matches one of the valid -% patterns. +% If the hook is not usable, before giving up, check if it's not +% disabled and otherwise try to declare it as a generic hook, if its +% name matches one of the valid patterns. % \begin{macrocode} - { - \@@_if_disabled:nTF {#1} - { \msg_error:nnn { hooks } { hook-disabled } {#1} } - { \@@_try_declaring_generic_hook:nnn {#1} {#2} {#3} } - } + { + \@@_if_disabled:nTF {#1} + { \msg_error:nnn { hooks } { hook-disabled } {#1} } + { \@@_try_declaring_generic_hook:nnn {#1} {#2} {#3} } } } } % \end{macrocode} % -% \begin{macrocode} -\cs_generate_variant:Nn \@@_gput_code:nnn { nxv } -% \end{macrocode} -% % This macro will unconditionally add a chunk of code to the given hook. % \begin{macrocode} \cs_new_protected:Npn \@@_hook_gput_code_do:nnn #1 #2 #3 @@ -2839,21 +3092,40 @@ % next-execution hooks does the same: it defers the code to % \cs{hook_gput_next_code:nn} if the generic hook was declared, or % to \cs{@@_gput_next_do:nn} otherwise. +% \changes{v1.0p}{2021/08/25}{Standardise generic hook names (gh/648)} % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_declaring_generic_hook:nnn} +%<latexrelease> {Standardise~generic~hook~names} \cs_new_protected:Npn \@@_try_declaring_generic_hook:nnn #1 { - \@@_try_declaring_generic_hook:nNNnn {#1} - \hook_gput_code:nnn \@@_gput_undeclared_hook:nnn + \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} + \hook_gput_code:nnn + \@@_gput_undeclared_hook:nnn + {#1} } \cs_new_protected:Npn \@@_try_declaring_generic_next_hook:nn #1 { - \@@_try_declaring_generic_hook:nNNnn {#1} - \hook_gput_next_code:nn \@@_gput_next_do:nn + \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} + \hook_gput_next_code:nn + \@@_gput_next_do:nn + {#1} } +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_try_declaring_generic_hook:nnn} +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook:nnn #1 +%<latexrelease> { +%<latexrelease> \@@_try_declaring_generic_hook:nNNnn {#1} +%<latexrelease> \hook_gput_code:nnn \@@_gput_undeclared_hook:nnn +%<latexrelease> } +%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_next_hook:nn #1 +%<latexrelease> { +%<latexrelease> \@@_try_declaring_generic_hook:nNNnn {#1} +%<latexrelease> \hook_gput_next_code:nn \@@_gput_next_do:nn +%<latexrelease> } % \end{macrocode} % \end{macro} % -% % \begin{macro}{\@@_try_declaring_generic_hook:nNNnn, % \@@_try_declaring_generic_hook_split:nNNnn} % @@ -2867,43 +3139,39 @@ % the function returns \meta{true} for a generic hook and \meta{false} % in other cases. % \begin{macrocode} -\cs_new_protected:Npn \@@_try_declaring_generic_hook:nNNnn #1 - { - \@@_if_file_hook:wTF #1 / / \s_@@_mark - { - \exp_args:Ne \@@_try_declaring_generic_hook_split:nNNnn - { \exp_args:Ne \@@_file_hook_normalize:n {#1} } - } - { \@@_try_declaring_generic_hook_split:nNNnn {#1} } - } +%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook:nNNnn #1 +%<latexrelease> { +%<latexrelease> \@@_if_file_hook:wTF #1 / \s_@@_mark {#1} +%<latexrelease> { +%<latexrelease> \exp_args:Ne \@@_try_declaring_generic_hook_split:nNNnn +%<latexrelease> { \exp_args:Ne \@@_file_hook_normalize:n {#1} } +%<latexrelease> } +%<latexrelease> { \@@_try_declaring_generic_hook_split:nNNnn {#1} } +%<latexrelease> } % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \@@_try_declaring_generic_hook_split:nNNnn #1 #2 #3 - { - \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} - { #2 } - { #3 } {#1} - } +%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook_split:nNNnn #1 #2 #3 +%<latexrelease> { +%<latexrelease> \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} +%<latexrelease> { #2 } +%<latexrelease> { #3 } {#1} +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % -% % \begin{macro}[TF]{\@@_try_declaring_generic_hook:wn} -% % \begin{macrocode} -%<latexrelease>\IncludeInRelease{2021/06/01}% -%<latexrelease> {\@@_try_declaring_generic_hook:wn}{Support~cmd~hooks} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_declaring_generic_hook:wn}% +%<latexrelease> {Standardise~generic~hook~names} \prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn #1 / #2 / #3 / #4 \scan_stop: #5 { TF } { - \tl_if_empty:nTF {#2} - { \prg_return_false: } + \@@_if_generic:nTF {#5} { - \prop_if_in:NnTF \c_@@_generics_prop {#1} + \@@_if_usable:nF {#5} { - \@@_if_usable:nF {#5} - { % \end{macrocode} % If the hook doesn't exist yet we check if it is a \texttt{cmd} % hook and if so we attempt patching the command in addition to @@ -2913,8 +3181,8 @@ % \cs{@@_patch_cmd_or_delay:Nnn} (defined in \texttt{ltcmdhooks}) % will generate an appropriate error message. % \begin{macrocode} - \str_if_eq:nnT {#1} { cmd } - { \@@_try_put_cmd_hook:n {#5} } + \str_if_eq:nnT {#1} { cmd } + { \@@_try_put_cmd_hook:n {#5} } % \end{macrocode} % % Declare the hook always even if it can't really be used (error @@ -2923,26 +3191,125 @@ % Here we use \cs{@@_make_usable:n}, so that a \cs{hook_new:n} is still % possible later. % \begin{macrocode} - \@@_make_usable:n {#5} - } - \prop_if_in:NnTF \c_@@_generics_reversed_ii_prop {#2} - { \tl_gset:cn { g_@@_#5_reversed_tl } { - } } - { - \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3} - { \tl_gset:cn { g_@@_#5_reversed_tl } { - } } - } - \prg_return_true: + \@@_make_usable:n {#5} + } + \@@_if_generic_reversed:nT {#5} + { \tl_gset:cn { g_@@_#5_reversed_tl } { - } } + \prg_return_true: + } + { +% \end{macrocode} +% +% Generic hooks are all named \meta{type}/\meta{name}/\meta{place}, +% where \meta{type} and \meta{place} are predefined +% (\cs{c_@@_generic_\meta{type}/./\meta{place}_tl}), and \meta{name} +% is the variable component. Older releases had some hooks with the +% \meta{name} in the third part, so the code below supports that +% syntax for a while, with a warning. +% +% The \cs{exp_after:wN} |...| \cs{exp:w} trick is there to remove the +% conditional structure inserted by +% \cs{@@_try_declaring_generic_hook:wnTF} and thus allow access to the +% tokens that follow it, as is needed to keep things going. +% +% When the deprecation cycle ends, the lines below should all be +% replaced by \cs{prg_return_false:}. +% \begin{macrocode} + \@@_if_deprecated_generic:nTF {#5} + { + \@@_deprecated_generic_warn:n {#5} + \exp_after:wN \@@_declare_deprecated_generic:NNn + \exp:w % \exp_end: } { \prg_return_false: } } } +% \end{macrocode} +% +% \begin{macro}{ +% \@@_deprecated_generic_warn:Nn, +% \@@_deprecated_generic_warn:Nw, +% } +% \cs{@@_deprecated_generic_warn:n} will issue a deprecation warning +% for a given hook, and mark that hook such that the warning will not +% be issued again (multiple warnings can be issued, but only once per +% hook). +% \begin{macrocode} +\cs_new_protected:Npn \@@_deprecated_generic_warn:n #1 + { \@@_deprecated_generic_warn:w #1 \s_@@_mark } +\cs_new_protected:Npn \@@_deprecated_generic_warn:w + #1 / #2 / #3 \s_@@_mark + { + \if_cs_exist:w @@~#1/#2/#3 \cs_end: \else: + \msg_warning:nnnnn { hooks } { generic-deprecated } {#1} {#2} {#3} + \fi: + \cs_gset_eq:cN { @@~#1/#2/#3 } \scan_stop: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \@@_do_deprecated_generic:Nn, +% \@@_do_deprecated_generic:Nw, +% \@@_declare_deprecated_generic:NNw, +% \@@_declare_deprecated_generic:NNw, +% } +% Now that the user has been told about the deprecation, we proceed by +% swapping \meta{name} and \meta{place} and adding the code to the +% correct hook. +% \begin{macrocode} +\cs_new_protected:Npn \@@_do_deprecated_generic:Nn #1 #2 + { \@@_do_deprecated_generic:Nw #1 #2 \s_@@_mark } +\cs_new_protected:Npn \@@_do_deprecated_generic:Nw #1 + #2 / #3 / #4 \s_@@_mark + { #1 { #2 / #4 / #3 } } +\cs_new_protected:Npn \@@_declare_deprecated_generic:NNn #1 #2 #3 + { \@@_declare_deprecated_generic:NNw #1 #2 #3 \s_@@_mark } +\cs_new_protected:Npn \@@_declare_deprecated_generic:NNw #1 #2 + #3 / #4 / #5 \s_@@_mark + { + \@@_try_declaring_generic_hook:wnTF #3 / #5 / #4 / \scan_stop: + { #3 / #5 / #4 } + #1 #2 { #3 / #5 / #4 } + } %<latexrelease>\EndIncludeInRelease % \end{macrocode} +% \end{macro} % % \begin{macrocode} -%<latexrelease>\IncludeInRelease{2020/10/01}% -%<latexrelease> {\@@_try_declaring_generic_hook:wn}{Support~cmd~hooks} -%<latexrelease> +%<latexrelease>\IncludeInRelease{2021/06/01}{\@@_try_declaring_generic_hook:wn} +%<latexrelease> {Support~cmd~hooks} +%<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn +%<latexrelease> #1 / #2 / #3 / #4 \scan_stop: #5 { TF } +%<latexrelease> { +%<latexrelease> \tl_if_empty:nTF {#2} +%<latexrelease> { \prg_return_false: } +%<latexrelease> { +%<latexrelease> \prop_if_in:NnTF \c_@@_generics_prop {#1} +%<latexrelease> { +%<latexrelease> \@@_if_usable:nF {#5} +%<latexrelease> { +%<latexrelease> \str_if_eq:nnT {#1} { cmd } +%<latexrelease> { \@@_try_put_cmd_hook:n {#5} } +%<latexrelease> \@@_make_usable:n {#5} +%<latexrelease> } +%<latexrelease> \prop_if_in:NnTF \c_@@_generics_reversed_ii_prop {#2} +%<latexrelease> { \tl_gset:cn { g_@@_#5_reversed_tl } { - } } +%<latexrelease> { +%<latexrelease> \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3} +%<latexrelease> { \tl_gset:cn { g_@@_#5_reversed_tl } { - } } +%<latexrelease> } +%<latexrelease> \prg_return_true: +%<latexrelease> } +%<latexrelease> { \prg_return_false: } +%<latexrelease> } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_try_declaring_generic_hook:wn}% +%<latexrelease> {Support~cmd~hooks} %<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn %<latexrelease> #1 / #2 / #3 / #4 \scan_stop: #5 { TF } %<latexrelease> { @@ -2968,77 +3335,107 @@ % \end{macrocode} % \end{macro} % +% % \begin{macro}[pTF]{\@@_if_file_hook:w} % \cs{@@_if_file_hook:wTF} checks if the argument is a valid % file-specific hook (not, for example, |file/before|, but -% |file/before/foo.tex|). If it is a file-specific hook, then it +% |file/foo.tex/before|). If it is a file-specific hook, then it % executes the \meta{true} branch, otherwise \meta{false}. -% -% A file-specific hook is \hook{file/\meta{position}/\meta{name}}. -% If any of these parts don't exist, it is a general file hook or not -% a file hook at all, so the conditional evaluates to \meta{false}. -% Otherwise, it checks that the first part is |file| and that the -% \meta{position} is in the \cs{c_@@_generics_file_prop}. -% -% A property list is used here to avoid having to worry with catcodes, -% because \pkg{expl3}'s file name parsing turns all characters into -% catcode-12 tokens, which might differ from hand-input letters. % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_if_file_hook:w}% +%<latexrelease> {Standardise~generic~hook~names} \prg_new_conditional:Npnn \@@_if_file_hook:w - #1 / #2 / #3 \s_@@_mark { TF } + #1 / #2 \s_@@_mark #3 { TF } { - \str_if_eq:nnTF {#1} { file } + \@@_if_generic:nTF {#3} { - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {#3} } - { \str_if_eq_p:nn {#3} { / } } + \str_if_eq:nnTF {#1} { file } + { \prg_return_true: } { \prg_return_false: } - { - \prop_if_in:NnTF \c_@@_generics_file_prop {#2} - { \prg_return_true: } - { \prg_return_false: } - } } { \prg_return_false: } } +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_if_file_hook:w}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\prg_new_conditional:Npnn \@@_if_file_hook:w +%<latexrelease> #1 / #2 / #3 \s_@@_mark { TF } +%<latexrelease> { +%<latexrelease> \str_if_eq:nnTF {#1} { file } +%<latexrelease> { +%<latexrelease> \bool_lazy_or:nnTF +%<latexrelease> { \tl_if_empty_p:n {#3} } +%<latexrelease> { \str_if_eq_p:nn {#3} { / } } +%<latexrelease> { \prg_return_false: } +%<latexrelease> { +%<latexrelease> \prop_if_in:NnTF \c_@@_generics_file_prop {#2} +%<latexrelease> { \prg_return_true: } +%<latexrelease> { \prg_return_false: } +%<latexrelease> } +%<latexrelease> } +%<latexrelease> { \prg_return_false: } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}[EXP]{\@@_file_hook_normalize:n} % \begin{macro}[EXP]{\@@_strip_double_slash:n,\@@_strip_double_slash:w} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_file_hook_normalize:n}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% % When a file-specific hook is found, before being declared it is % lightly normalized by \cs{@@_file_hook_normalize:n}. The current % implementation just replaces two consecutive slashes (|//|) by a % single one, to cope with simple cases where the user did something % like \verb|\def\input@path{{./mypath/}}|, in which case a hook would -% have to be \verb|\AddToHook{file/after/./mypath//file.tex}|. +% have to be \verb|\AddToHook{file/./mypath//file.tex/after}|. % \begin{macrocode} -\cs_new:Npn \@@_file_hook_normalize:n #1 - { \@@_strip_double_slash:n {#1} } -\cs_new:Npn \@@_strip_double_slash:n #1 - { \@@_strip_double_slash:w #1 // \s_@@_mark } +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_file_hook_normalize:n}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\cs_new:Npn \@@_file_hook_normalize:n #1 +%<latexrelease> { \@@_strip_double_slash:n {#1} } +%<latexrelease>\cs_new:Npn \@@_strip_double_slash:n #1 +%<latexrelease> { \@@_strip_double_slash:w #1 // \s_@@_mark } % \end{macrocode} % This function is always called after testing if the argument is a % file hook with \cs{@@_if_file_hook:wTF}, so we can assume it has -% three parts (it is either \verb|file/before/...| or -% \verb|file/after/...|), so we use \verb|#1/#2/#3 //| instead of just +% three parts (it is either \verb|file/.../before| or +% \verb|file/.../after|), so we use \verb|#1/#2/#3 //| instead of just % \verb|#1 //| to prevent losing a slash if the file name is empty. % \changes{v1.0h}{2021/01/07}{Assume hook name has at least three % nonempty parts (gh/464)} % \begin{macrocode} -\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3 // #4 \s_@@_mark - { - \tl_if_empty:nTF {#4} - { #1/#2/#3 } - { \@@_strip_double_slash:w #1/#2/#3 / #4 \s_@@_mark } - } +%<latexrelease>\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3 // #4 \s_@@_mark +%<latexrelease> { +%<latexrelease> \tl_if_empty:nTF {#4} +%<latexrelease> { #1/#2/#3 } +%<latexrelease> { \@@_strip_double_slash:w #1/#2/#3 / #4 \s_@@_mark } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}{\c_@@_generics_prop} -% Property list holding the generic names. We don't provide any user -% interface to this as this is meant to be static. +% \begin{macro}{ +% \c_@@_generic_cmd/./before_tl,\c_@@_generic_cmd/./after_tl, +% \c_@@_generic_env/./before_tl,\c_@@_generic_env/./after_tl, +% \c_@@_generic_file/./before_tl,\c_@@_generic_file/./after_tl, +% \c_@@_generic_package/./before_tl,\c_@@_generic_package/./after_tl, +% \c_@@_generic_class/./before_tl,\c_@@_generic_class/./after_tl, +% \c_@@_generic_include/./before_tl,\c_@@_generic_include/./after_tl, +% \c_@@_generic_env/./begin_tl,\c_@@_generic_env/./end_tl, +% \c_@@_generic_include/./end_tl +% } +% Token lists defining the possible generic hooks. We don't provide +% any user interface to this as this is meant to be static. % \begin{description} % \item[\texttt{cmd}] % The generic hooks used for commands. @@ -3048,28 +3445,65 @@ % The generic hooks used when loading a file % \end{description} % \begin{macrocode} -\prop_const_from_keyval:Nn \c_@@_generics_prop - {cmd=,env=,file=,package=,class=,include=} +%<latexrelease>\IncludeInRelease{2021/11/15}{\c_@@_generics_prop}% +%<latexrelease> {Standardise~generic~hook~names} +\clist_map_inline:nn { cmd , env , file , package , class , include } + { + \tl_const:cn { c_@@_generic_#1/./before_tl } { + } + \tl_const:cn { c_@@_generic_#1/./after_tl } { - } + } +\tl_const:cn { c_@@_generic_env/./begin_tl } { + } +\tl_const:cn { c_@@_generic_env/./end_tl } { + } +\tl_const:cn { c_@@_generic_include/./end_tl } { - } +% \end{macrocode} +% +% Deprecated generic hooks: +% \begin{macrocode} +\clist_map_inline:nn { file , package , class , include } + { + \tl_const:cn { c_@@_deprecated_#1/./before_tl } { } + \tl_const:cn { c_@@_deprecated_#1/./after_tl } { } + } +\tl_const:cn { c_@@_deprecated_include/./end_tl } { } +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}{\c_@@_generics_prop}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_prop +%<latexrelease> {cmd=,env=,file=,package=,class=,include=} +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\c_@@_generics_reversed_ii_prop, % \c_@@_generics_reversed_iii_prop, % \c_@@_generics_file_prop} -% Some of the generic hooks are supposed to use reverse ordering, these are -% the following (only the second or third sub-component is checked): +% The following generic hooks are supposed to use reverse ordering +% (the |ii| and |iii| names are kept for the deprecation cycle): % \begin{macrocode} -\prop_const_from_keyval:Nn \c_@@_generics_reversed_ii_prop {after=,end=} -\prop_const_from_keyval:Nn \c_@@_generics_reversed_iii_prop {after=} -\prop_const_from_keyval:Nn \c_@@_generics_file_prop {before=,after=} +%<latexrelease>\IncludeInRelease{2021/11/15}{\c_@@_generics_reversed_ii_prop}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}{\c_@@_generics_reversed_ii_prop}% +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_reversed_ii_prop {after=,end=} +%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_reversed_iii_prop {after=} +%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_file_prop {before=,after=} +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\hook_gremove_code:nn} % \begin{macro}{\@@_gremove_code:nn} -% +% % With \cs{hook_gremove_code:nn}\Arg{hook}\Arg{label} any code % for \meta{hook} stored under \meta{label} is removed. +% \changes{v1.0o}{2021/07/22}{Do not queue removals (gh/625)} % \begin{macrocode} \cs_new_protected:Npn \hook_gremove_code:nn #1 #2 { \@@_normalize_hook_args:Nnn \@@_gremove_code:nn {#1} {#2} } @@ -3101,27 +3535,13 @@ { % \end{macrocode} % If the label is |top-level| then clear the token list, as all code -% there is under the same label. Marked removal is not implemented -% for |top-level| because it is hard to reliably know that no code -% was added to \cs{@@_toplevel\textvisiblespace\meta{hook}} (granted that -% an empty code could be interpreted as that, but then it differs in -% behaviour from other labels, in which an empty chunk is still valid -% for removal). Besides, it doesn't make much (if any) sense for -% packages to remove |top-level| code. So here the chunk is just -% cleared unconditionally. +% there is under the same label. % \begin{macrocode} \str_if_eq:nnTF {#2} { top-level } { \@@_tl_gclear:c { @@_toplevel~#1 } } { -% \end{macrocode} -% Otherwise check if the label being removed exists in the code pool. -% If it does, just call \cs{@@_gremove_code_do:nn} to do the removal, -% otherwise mark it to be removed. -% \begin{macrocode} - \prop_get:cnNTF { g_@@_#1_code_prop } {#2} \l_@@_return_tl - { \@@_gremove_code_do:nn } - { \@@_mark_removal:nn } - {#1} {#2} + \prop_gpop:cnNF { g_@@_#1_code_prop } {#2} \l_@@_return_tl + { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } } } % \end{macrocode} @@ -3132,82 +3552,21 @@ } % \end{macrocode} % -% If the code pool for this hook doesn't exist it means that nothing -% tried to add to it before, so we just queue this removal order for -% later. -% \begin{macrocode} - { \@@_mark_removal:nn {#1} {#2} } - } -% \end{macrocode} -% -% \begin{macro}{\@@_gremove_code_do:nn} -% Remove code for a given label. -% \begin{macrocode} -\cs_new_protected:Npn \@@_gremove_code_do:nn #1 #2 - { \prop_gremove:cn { g_@@_#1_code_prop } {#2} } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\@@_mark_removal:nn} -% Marks \meta{label} (\verb=#2=) to be removed from \meta{hook} -% (\verb=#1=). The number of removals should be fairly small, and -% \cs{tl_gremove_once:Nx} is fairly efficient even for longer token -% lists, so we use a single global token list, rather than one for -% each hook. -% -% A hand-crafted token list is used here because property lists don't -% hold repeated items, so multiple usages of \cs{@@_mark_removal:nn} -% would be cancelled by a single \cs{@@_unmark_removal:nn}. -% \begin{macrocode} -\cs_new_protected:Npn \@@_mark_removal:nn #1 #2 - { - \tl_gput_right:Nx \g_@@_removal_list_tl - { \@@_removal_tl:nn {#1} {#2} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_unmark_removal:nn} -% Unmarks \meta{label} (\verb=#2=) to be removed from \meta{hook} -% (\verb=#1=). \cs{tl_gremove_once:Nx} is used rather than -% \cs{tl_gremove_all:Nx} so that two additions are needed to cancel -% two marked removals, rather than only one. +% If the code pool for this hook doesn't exist, show a warning: % \begin{macrocode} -\cs_new_protected:Npn \@@_unmark_removal:nn #1 #2 - { - \tl_gremove_once:Nx \g_@@_removal_list_tl - { \@@_removal_tl:nn {#1} {#2} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[TF]{\@@_if_marked_removal:nn} -% Checks if the \cs{g_@@_removal_list_tl} contains the current -% \meta{label} (\verb=#2=) and \meta{hook} (\verb=#1=). -% \begin{macrocode} -\prg_new_protected_conditional:Npnn \@@_if_marked_removal:nn #1 #2 { TF } - { - \exp_args:NNx \tl_if_in:NnTF \g_@@_removal_list_tl - { \@@_removal_tl:nn {#1} {#2} } - { \prg_return_true: } { \prg_return_false: } + { + \@@_if_deprecated_generic:nTF {#1} + { + \@@_deprecated_generic_warn:n {#1} + \@@_do_deprecated_generic:Nn \@@_gremove_code:nn {#1} {#2} + } + { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} } + } } % \end{macrocode} % \end{macro} -% -% \begin{macro}[rEXP]{\@@_removal_tl:nn} -% Builds a token list with \verb=#1= and \verb=#2= which can only be -% matched by \verb=#1= and \verb=#2=. The |&|$_4$ anchors a removal, -% so that \verb=#1= can't be mistaken by \verb=#2= and vice versa, and -% the two |$|$_3$ delimit the two arguments -% \begin{macrocode} -\cs_new:Npn \@@_removal_tl:nn #1 #2 - { & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ } -% \end{macrocode} % \end{macro} % -% % \begin{macro}{ % \g_@@_??_code_prop, % \@@~??, @@ -3263,6 +3622,13 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_gset_rule:nnnn #1#2#3#4 { + \@@_if_deprecated_generic:nT {#1} + { + \@@_deprecated_generic_warn:n {#1} + \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1} + {#2} {#3} {#4} + \exp_after:wN \use_none:nnnnnnnnn \use_none:n + } % \end{macrocode} % First we ensure the basic data structure of the hook exists: % \begin{macrocode} @@ -3399,12 +3765,12 @@ % |#1| is lexically greater, and \cs{use_iii:nn} otherwise. % \begin{macrocode} \cs_new:Npn \@@_if_label_case:nnnnn #1#2 - { - \cs:w use_ - \if_case:w \@@_str_compare:nn {#1} {#2} - i \or: ii \else: iii \fi: :nnn - \cs_end: - } + { + \cs:w use_ + \if_case:w \@@_str_compare:nn {#1} {#2} + i \or: ii \else: iii \fi: :nnn + \cs_end: + } % \end{macrocode} % \end{macro} % @@ -3440,7 +3806,7 @@ } % \end{macrocode} % If we are debugging we show results hook by hook for all hooks -% that have data. +% that have data. % \begin{macrocode} \@@_debug:n { \iow_term:x{^^JAll~ initialized~ (non-empty)~ hooks:} @@ -3492,7 +3858,7 @@ % \begin{macrocode} \@@_if_usable:nT {#1} { - \prop_if_empty:cTF {g_@@_#1_code_prop} + \prop_if_empty:cTF { g_@@_#1_code_prop } { \@@_tl_gset:co { @@~#1 } { @@ -3503,11 +3869,11 @@ { % \end{macrocode} % By default the algorithm sorts the code chunks and then saves the -% result in a token list for fast execution by adding the code one -% after another using \cs{tl_gput_right:NV}. When we sort code for +% result in a token list for fast execution; this is done by adding the code chunks +% one after another, using \cs{tl_gput_right:NV}. When we sort code for % a reversed hook, all we have to do is to add the code chunks in % the opposite order into the token list. So all we have to do -% in preparation is to change two definitions used later on. +% in preparation is to change two definitions that are used later on. % \begin{macrocode} \@@_if_reversed:nTF {#1} { \cs_set_eq:NN \@@_tl_gput:Nn \@@_tl_gput_left:Nn @@ -3518,8 +3884,9 @@ % % When sorting, some relations (namely \verb|voids|) need to % act destructively on the code property lists to remove code that -% shouldn't appear in the sorted hook token list, so we temporarily -% save the old code property list so that it can be restored later. +% shouldn't appear in the sorted hook token list, so we make a copy +% of the code property list that we can safely work on without +% changing the main one. % \begin{macrocode} \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop } \@@_initialize_single:ccn @@ -3606,8 +3973,8 @@ % alphanumeric labels. As usual Don's data structures are chosen in % a way that one can omit a lot of tests and I have mimicked that as % far as possible. The result is a restriction I do not test for at -% the moment: a label can't be equal to the number 0! \fmi{Needs -% checking for, just in case ... maybe} +% the moment: a label can't be equal to the number 0! +% \fmiinline{Needs checking for, just in case ... maybe} % % ^^A #1 <- \@@~#1 % ^^A #2 <- \g_@@_#1_labels_clist @@ -3626,11 +3993,11 @@ % \begin{macrocode} \tl_set:Nn \l_@@_cur_hook_tl {#3} % \end{macrocode} -% +% % We loop over the property list holding the code and record all -% labels listed there. Only rules for those labels are of interest +% the labels listed there. Only the rules for those labels are of interest % to us. While we are at it we count them (which gives us the $N$ -% in Knuth's algorithm. The prefix |label_| is added to the variables +% in Knuth's algorithm). The prefix |label_| is added to the variables % to ensure that labels named |front|, |rear|, |labels|, or |return| % don't interact with our code. % \begin{macrocode} @@ -3642,11 +4009,11 @@ \seq_clear_new:c { \@@_seq_csname:n {##1} } } % \end{macrocode} -% Steps T2 and T3: Sort the relevant rules into the data structure\ldots -% +% Steps T2 and T3: Here we sort the relevant rules into the data structure\ldots +% % This loop constitutes a square matrix of the labels in % \cs{l_@@_work_prop} in the -% vertical and the horizontal directions. However since the rule +% vertical and the horizontal directions. However, since the rule % $l_A\meta{rel}l_B$ is the same as $l_B\meta{rel}^{-1}l_A$ we can cut % the loop short at the diagonal of the matrix (\emph{i.e.}, when % both labels are equal), saving a good amount of time. The way the @@ -3668,12 +4035,12 @@ } } % \end{macrocode} -% Take a breath and take a look at the data structures that have +% Now take a breath, and look at the data structures that have % been set up: % \begin{macrocode} \@@_debug:n { \@@_debug_label_data:N \l_@@_work_prop } % \end{macrocode} -% +% % % Step T4: % \begin{macrocode} @@ -3689,13 +4056,13 @@ } \tl_set_eq:Nc \l_@@_front_tl { \@@_tl_csname:n { 0 } } % \end{macrocode} -% +% % \begin{macrocode} \@@_tl_gclear:N #1 \clist_gclear:N #2 % \end{macrocode} % -% The whole loop combines steps T5--T7: +% The whole loop gets combined in steps T5--T7: % \begin{macrocode} \bool_while_do:nn { ! \str_if_eq_p:Vn \l_@@_front_tl { 0 } } { @@ -3706,13 +4073,13 @@ \prop_get:NVN \l_@@_work_prop \l_@@_front_tl \l_@@_return_tl \exp_args:NNV \@@_tl_gput:Nn #1 \l_@@_return_tl % \end{macrocode} -% +% % \begin{macrocode} \@@_clist_gput:NV #2 \l_@@_front_tl \@@_debug:n{ \iow_term:x{Handled~ code~ for~ \l_@@_front_tl} } % \end{macrocode} % -% This is step T6 except that we don't use a pointer $P$ to move +% This is step T6, except that we don't use a pointer $P$ to move % through the successors, but instead use \verb=##1= of the mapping % function. % \begin{macrocode} @@ -3730,7 +4097,7 @@ } } % \end{macrocode} -% and step T7: +% and here is step T7: % \begin{macrocode} \tl_set_eq:Nc \l_@@_front_tl { \@@_tl_csname:n { \l_@@_front_tl } } @@ -3748,14 +4115,14 @@ % \end{macrocode} % % This is not really the information one needs in the error case -% but will do for now \ldots \fmi{improve output on a rainy day} +% but it will do for now \ldots \fmiinline{improve output on a rainy day} % \begin{macrocode} \@@_debug_label_data:N \l_@@_work_prop \iow_term:x{====================} } % \end{macrocode} -% After we have added all hook code to \verb=#1= we finish it off -% with adding extra code for the |top-level| (\verb=#2=) and for one +% After we have added all hook code to \verb=#1=, we finish it off +% by adding extra code for the |top-level| (\verb=#2=) and for one % time execution (\verb=#3=). These should normally be empty. The % |top-level| code is added with \cs{@@_tl_gput:Nn} as that might % change for a reversed hook (then |top-level| is the very first code @@ -3905,10 +4272,10 @@ % \begin{macro}{\@@_apply_rule_->:nnn,\@@_apply_rule_<-:nnn} % If we see \texttt{\detokenize{->}} we have to drop code for label % \verb=#3= and carry on. We could do a little better and drop -% everything for that label since it doesn't matter where we sort -% in the empty code. However that would complicate the algorithm a -% lot with little gain.\footnote{This also hase the advantage that -% the result of the sorting doesn't change which might otherwise +% everything for that label since it doesn't matter where we put +% such empty code. However that would complicate the algorithm a +% lot with little gain.\footnote{This also has the advantage that +% the result of the sorting doesn't change, as it might otherwise do % (for unrelated chunks) if we aren't careful.} So we still % unnecessarily try to sort it in and depending on the rules that % might result in a loop that is otherwise resolved. If that turns @@ -3916,8 +4283,8 @@ % % Here the code is removed from \cs{l_@@_cur_hook_tl} rather than % \verb=#3= because the latter may be \verb=??=, and the default -% hook doesn't store any code. Removing from \cs{l_@@_cur_hook_tl} -% makes default rules \verb=->= and \verb=<-= work properly. +% hook doesn't store any code. Removing it instead from \cs{l_@@_cur_hook_tl} +% makes the default rules \verb=->= and \verb=<-= work properly. % \begin{macrocode} \cs_new_protected:cpn { @@_apply_rule_->:nnn } #1#2#3 { @@ -3978,7 +4345,7 @@ % % % \begin{macro}{\@@_debug_label_data:N} -% +% % \begin{macrocode} \cs_new_protected:Npn \@@_debug_label_data:N #1 { \iow_term:x{Code~ labels~ for~ sorting:} @@ -4024,8 +4391,15 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_log:nN #1 #2 { + \@@_if_deprecated_generic:nT {#1} + { + \@@_deprecated_generic_warn:n {#1} + \@@_do_deprecated_generic:Nn \@@_log:nN {#1} #2 + \exp_after:wN \use_none:nnnnnnnnn \use_none:nnnnn + } \@@_preamble_hook:n {#1} - \@@_log_cmd:x { ^^J ->~The~hook~'#1': } + \@@_log_cmd:x + { ^^J ->~The~ \@@_if_generic:nT {#1} { generic~ } hook~'#1': } % \end{macrocode} % % \begin{macrocode} @@ -4234,16 +4608,14 @@ % % \begin{macro}{\@@_gput_next_code:nn, % \@@_gput_next_do:nn, -% \@@_gput_next_do:Nnn, -% \@@_clear_next:n} +% \@@_gput_next_do:Nnn} % \begin{macrocode} \cs_new_protected:Npn \@@_gput_next_code:nn #1 #2 { \@@_if_disabled:nTF {#1} { \msg_error:nnn { hooks } { hook-disabled } {#1} } { - \@@_init_structure:n {#1} - \@@_if_usable:nTF {#1} + \@@_if_structure_exist:nTF {#1} { \@@_gput_next_do:nn {#1} {#2} } { \@@_try_declaring_generic_next_hook:nn {#1} {#2} } } @@ -4275,13 +4647,21 @@ { \@@_tl_gset:Nn #1 { \@@_clear_next:n {#2} } } \@@_tl_gput_right:Nn #1 } -\cs_new_protected:Npn \@@_clear_next:n #1 - { \cs_gset_eq:cN { @@_next~#1 } \c_empty_tl } % \end{macrocode} % \end{macro} % % % +% \begin{macro}{\hook_gclear_next_code:n,\@@_clear_next:n} +% Discard anything set up for next invocation of the hook. +% \changes{v1.0o}{2021/07/27}{Macro made public} +% \begin{macrocode} +\cs_new_protected:Npn \hook_gclear_next_code:n #1 + { \@@_normalize_hook_args:Nn \@@_clear_next:n {#1} } +\cs_new_protected:Npn \@@_clear_next:n #1 + { \cs_gset_eq:cN { @@_next~#1 } \c_empty_tl } +% \end{macrocode} +% \end{macro} % % % @@ -4302,44 +4682,68 @@ % the preamble. \cs{@@_preamble_hook:n} initializes the hook in the % preamble, and is redefined to \cs{use_none:n} at |\begin{document}|. % -% Both versions do the same internally: check if the hook exist as -% given, and if so use it as quickly as possible. If it doesn't -% exist, the a call to \cs{@@_use:wn} checks for file hooks. +% Both versions do the same thing internally: they check that the hook exists as +% given, and if so they use it as quickly as possible. % % At |\begin{document}|, all hooks are initialized, and any change in % them causes an update, so \cs{hook_use:n} can be made expandable. % This one is better not protected so that it can expand into nothing % if containing no code. Also important in case of generic hooks that -% we do not generate a \cs[no-index]{relax} as a side effect of checking for a -% csname. In contrast to the \TeX{} low-level +% we do not generate a \cs[no-index]{relax} as a side effect of +% checking for a csname. In contrast to the \TeX{} low-level % \verb=\csname ...\endcsname= construct \cs{tl_if_exist:c} is % careful to avoid this. % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/11/15}{\hook_use:n} +%<latexrelease> {Standardise~generic~hook~names} \cs_new_protected:Npn \hook_use:n #1 { - \tl_if_exist:cTF { @@~#1 } + \tl_if_exist:cT { @@~#1 } { \@@_preamble_hook:n {#1} \cs:w @@~#1 \cs_end: } - { \@@_use:wn #1 / \s_@@_mark {#1} } } \cs_new:Npn \@@_use_initialized:n #1 { \if_cs_exist:w @@~#1 \cs_end: - \else: - \@@_use_undefined:w + \cs:w @@~#1 \exp_after:wN \cs_end: \fi: - \cs:w @@~#1 \@@_use_end: - } -\cs_new:Npn \@@_use_undefined:w #1 #2 @@~#3 \@@_use_end: - { - #1 % fi - \@@_use:wn #3 / \s_@@_mark {#3} } \cs_new_protected:Npn \@@_preamble_hook:n #1 { \@@_initialize_hook_code:n {#1} } -\cs_new_eq:NN \@@_use_end: \cs_end: +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}{\hook_use:n} +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\cs_new_protected:Npn \hook_use:n #1 +%<latexrelease> { +%<latexrelease> \tl_if_exist:cTF { @@~#1 } +%<latexrelease> { +%<latexrelease> \@@_preamble_hook:n {#1} +%<latexrelease> \cs:w @@~#1 \cs_end: +%<latexrelease> } +%<latexrelease> { \@@_use:wn #1 / \s_@@_mark {#1} } +%<latexrelease> } +%<latexrelease>\cs_new:Npn \@@_use_initialized:n #1 +%<latexrelease> { +%<latexrelease> \if_cs_exist:w @@~#1 \cs_end: +%<latexrelease> \else: +%<latexrelease> \@@_use_undefined:w +%<latexrelease> \fi: +%<latexrelease> \cs:w @@~#1 \@@_use_end: +%<latexrelease> } +%<latexrelease>\cs_new:Npn \@@_use_undefined:w #1 #2 @@~#3 \@@_use_end: +%<latexrelease> { +%<latexrelease> #1 % fi +%<latexrelease> \@@_use:wn #3 / \s_@@_mark {#3} +%<latexrelease> } +%<latexrelease>\cs_new_protected:Npn \@@_preamble_hook:n #1 +%<latexrelease> { \@@_initialize_hook_code:n {#1} } +%<latexrelease>\cs_new_eq:NN \@@_use_end: \cs_end: +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} @@ -4360,63 +4764,121 @@ % \cs{@@_if_usable_use:n} checks if the hook exist, and calls % \cs{@@_preamble_hook:n} if so, then uses the hook. % \begin{macrocode} -\cs_new:Npn \@@_use:wn #1 / #2 \s_@@_mark #3 - { - \str_if_eq:nnTF {#1} { file } - { \@@_try_file_hook:n {#3} } - { } % Hook doesn't exist - } +%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_use:wn} +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_use:wn} +%<latexrelease> {Standardise~generic~hook~names} +%<latexrelease>\cs_new:Npn \@@_use:wn #1 / #2 \s_@@_mark #3 +%<latexrelease> { +%<latexrelease> \str_if_eq:nnTF {#1} { file } +%<latexrelease> { \@@_try_file_hook:n {#3} } +%<latexrelease> { } % Hook doesn't exist +%<latexrelease> } % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \@@_try_file_hook:n #1 - { - \@@_if_file_hook:wTF #1 / / \s_@@_mark - { - \exp_args:Ne \@@_if_usable_use:n - { \exp_args:Ne \@@_file_hook_normalize:n {#1} } - } - { \@@_if_usable_use:n {#1} } % file/ generic hook (e.g. file/before) - } +%<latexrelease>\cs_new_protected:Npn \@@_try_file_hook:n #1 +%<latexrelease> { +%<latexrelease> \@@_if_file_hook:wTF #1 / \s_@@_mark {#1} +%<latexrelease> { +%<latexrelease> \exp_args:Ne \@@_if_usable_use:n +%<latexrelease> { \exp_args:Ne \@@_file_hook_normalize:n {#1} } +%<latexrelease> } +%<latexrelease> { \@@_if_usable_use:n {#1} } % file/ generic hook (e.g. file/before) +%<latexrelease> } % \end{macrocode} % % \begin{macrocode} -\cs_new_protected:Npn \@@_if_usable_use:n #1 - { - \tl_if_exist:cT { @@~#1 } - { - \@@_preamble_hook:n {#1} - \cs:w @@~#1 \cs_end: - } - } +%<latexrelease>\cs_new_protected:Npn \@@_if_usable_use:n #1 +%<latexrelease> { +%<latexrelease> \tl_if_exist:cT { @@~#1 } +%<latexrelease> { +%<latexrelease> \@@_preamble_hook:n {#1} +%<latexrelease> \cs:w @@~#1 \cs_end: +%<latexrelease> } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % -% \begin{macro}{\hook_use_once:n} -% For hooks that can and should be used only once we have a special -% use command that remembers the hook name in -% \cs{g_@@_execute_immediately_prop}. This has the effect that any -% further code added to the hook is executed immediately rather -% than stored in the hook. +% \begin{macro}{\hook_use_once:n} +% \begin{macro}{\@@_use_once:n} +% For hooks that can and should be used only once we have a special +% use command that further inhibits the hook from getting more code +% added to it. This has the effect that any +% further code added to the hook is executed immediately rather +% than stored in the hook. % -% The code needs some gymnastics to prevent space trimming from the -% hook name, since \cs{hook_use:n} and \cs{hook_use_once:n} are -% documented to not trim spaces. +% The code needs some gymnastics to prevent space trimming from the +% hook name, since \cs{hook_use:n} and \cs{hook_use_once:n} are +% documented to not trim spaces. % +% \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)} % \begin{macrocode} \cs_new_protected:Npn \hook_use_once:n #1 { - \tl_if_exist:cT { @@~#1 } + \@@_if_execute_immediately:nF {#1} + { \@@_normalize_hook_args:Nn \@@_use_once:n { \use:n {#1} } } + } +\cs_new_protected:Npn \@@_use_once:n #1 + { + \@@_preamble_hook:n {#1} + \@@_use_once_set:n {#1} + \@@_use_initialized:n {#1} + \@@_use_once_clear:n {#1} + } +% \end{macrocode} +% +% \begin{macro}{\@@_use_once_set:n} +% \begin{macro}{\@@_use_once_clear:n} +% \cs{@@_use_once_set:n} is used before the actual hook code is +% executed so that any usage of \cs{AddToHook} inside the hook causes +% the code to execute immediately. Setting +% \cs[no-index]{g_@@_\meta{hook}_reversed_tl} to |I| prevents further +% code from being added to the hook. \cs{@@_use_once_clear:n} then +% clears the hook so that any further call to \cs{hook_use:n} or +% \cs{hook_use_once:n} will expand to nothing. +% \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)} +% \begin{macrocode} +\cs_new_protected:Npn \@@_use_once_set:n #1 + { \@@_tl_gset:cn { g_@@_#1_reversed_tl } { I } } +\cs_new_protected:Npn \@@_use_once_clear:n #1 + { + \@@_tl_gclear:c { @@~#1 } + \@@_tl_gclear:c { @@_next~#1 } + \@@_tl_gclear:c { @@_toplevel~#1 } + \prop_gclear:c { g_@@_#1_code_prop } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}[pTF]{\@@_if_execute_immediately:n} +% To check whether the code being added should be executed immediately (that +% is, if the hook is a one-time hook), we check if it's usable (it +% can't be one-time if it was not already usable), then we check that +% \cs[no-index]{g_@@_\meta{hook}_reversed_tl} is |I|. The gymnastics +% around \cs{if:w} is there to allow the |reversed| token list to be +% empty. +% \changes{v1.0r}{2021/09/06}{Macro added (gh/606)} +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { F, TF } + { + \@@_if_usable:nTF {#1} { - \tl_set:Nn \l_@@_return_tl {#1} - \@@_normalize_hook_args:Nn \@@_use_once_store:n - { \l_@@_return_tl } - \hook_use:n {#1} + \exp_after:wN \@@_clean_to_scan:w + \if:w I \cs:w g_@@_#1_reversed_tl \cs_end: + \s_@@_mark \prg_return_true: + \else: + \s_@@_mark \prg_return_false: + \fi: } + { \prg_return_false: } } -\cs_new_protected:Npn \@@_use_once_store:n #1 - { \prop_gput:Nnn \g_@@_execute_immediately_prop {#1} { } } % \end{macrocode} % \end{macro} % @@ -4504,9 +4966,8 @@ } % \end{macrocode} % \end{macro} -% -% -% +% +% % \begin{macro}[pTF]{\@@_if_declared:n} % % Internal test to check if the hook was officially declared with @@ -4526,28 +4987,76 @@ % \begin{macrocode} \prg_new_conditional:Npnn \@@_if_reversed:n #1 { p , T , F , TF } { - \if_int_compare:w \cs:w g_@@_#1_reversed_tl \cs_end: 1 < 0 \exp_stop_f: + \exp_after:wN \@@_clean_to_scan:w + \if:w - \cs:w g_@@_#1_reversed_tl \cs_end: + \s_@@_mark \prg_return_true: + \else: + \s_@@_mark \prg_return_false: + \fi: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[pTF]{\@@_if_generic:n} +% \begin{macro}[pTF]{\@@_if_deprecated_generic:n} +% An internal conditional that checks if a name belongs to a generic +% hook. The deprecated version needs to check if |#3| is empty to +% avoid returning true on \hook{file/before}, for example. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_if_generic:n #1 { T, TF } + { \@@_if_generic:w #1 / / / \s_@@_mark } +\cs_new:Npn \@@_if_generic:w #1 / #2 / #3 / #4 \s_@@_mark + { + \cs_if_exist:cTF { c_@@_generic_#1/./#3_tl } + { \prg_return_true: } + { \prg_return_false: } + } +\prg_new_conditional:Npnn \@@_if_deprecated_generic:n #1 { T, TF } + { \@@_if_deprecated_generic:w #1 / / / \s_@@_mark } +\cs_new:Npn \@@_if_deprecated_generic:w #1 / #2 / #3 / #4 \s_@@_mark + { + \cs_if_exist:cTF { c_@@_deprecated_#1/./#2_tl } + { + \tl_if_empty:nTF {#3} + { \prg_return_false: } + { \prg_return_true: } + } + { \prg_return_false: } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[pTF]{\@@_if_generic_reversed:n} +% An internal conditional that checks if a name belongs to a generic +% reversed hook. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_if_generic_reversed:n #1 { T } + { \@@_if_generic_reversed:w #1 / / / \scan_stop: } +\cs_new:Npn \@@_if_generic_reversed:w #1 / #2 / #3 / #4 \scan_stop: + { + \if_charcode:w - \cs:w c_@@_generic_#1/./#3_tl \cs_end: \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} -% \end{macro} -% +% \end{macro} % % \subsection{Messages} % -% Hook errors are LaTeX kernel errors: +% Hook errors are LaTeX kernel errors: % \begin{macrocode} \prop_gput:Nnn \g_msg_module_type_prop { hooks } { LaTeX } % \end{macrocode} +% \changes{v1.0q}{2021/08/27}{Internal message name changes} % And so are kernel errors (this should move elsewhere eventually). % \begin{macrocode} -\prop_gput:Nnn \g_msg_module_type_prop { kernel } { LaTeX } -%\prop_gput:Nnn \g_msg_module_name_prop { kernel } { } % <-- currently not working +\prop_gput:Nnn \g_msg_module_type_prop { latex2e } { LaTeX } +\prop_gput:Nnn \g_msg_module_name_prop { latex2e } { kernel } % \end{macrocode} -% +% % \begin{macrocode} \msg_new:nnnn { hooks } { labels-incompatible } { @@ -4560,7 +5069,7 @@ { LaTeX~found~two~incompatible~labels~in~the~same~hook.~ This~indicates~an~incompatibility~between~packages. } % \end{macrocode} -% +% % \begin{macrocode} \msg_new:nnnn { hooks } { exists } { Hook~'#1'~ has~ already~ been~ declared. } @@ -4568,14 +5077,14 @@ name.\\ Please~ use~ a~ different~ name~ for~ your~ hook.} % \end{macrocode} -% +% % % \begin{macrocode} \msg_new:nnnn { hooks } { hook-disabled } { Cannot~add~code~to~disabled~hook~'#1'. } { The~hook~'#1'~you~tried~to~add~code~to~was~previously~disabled~ - with~\iow_char:N\\hook_disable:n~or~\iow_char:N\\DisableHook,~so~ + with~\iow_char:N\\hook_disable_generic:n~or~\iow_char:N\\DisableGenericHook,~so~ it~cannot~have~code~added~to~it. } % \end{macrocode} @@ -4601,7 +5110,7 @@ { Unknown~ relationship~ '#3'~ between~ labels~ '#2'~ and~ '#4'~ \str_if_eq:nnF {#1} {??} { ~in~hook~'#1' }. ~ - Perhaps~ a~ missspelling? + Perhaps~ a~ misspelling? } { The~ relation~ used~ not~ known~ to~ the~ system.~ Allowed~ values~ are~ @@ -4613,7 +5122,7 @@ 'unrelated'. } % \end{macrocode} -% +% % \begin{macrocode} \msg_new:nnnn { hooks } { misused-top-level } { @@ -4651,7 +5160,7 @@ % \end{macrocode} % % \begin{macrocode} -\msg_new:nnn { kernel } { should-not-happen } +\msg_new:nnn { latex2e } { should-not-happen } { This~should~not~happen.~#1 \\ Please~report~at~https://github.com/latex3/latex2e. @@ -4661,32 +5170,31 @@ % % % \begin{macrocode} -\msg_new:nnn { hooks } { provide-disabled } +\msg_new:nnn { hooks } { activate-disabled } { - Cannot~ provide~ hook~ '#1'~ because~ it~ is~ disabled! + Cannot~ activate~ hook~ '#1'~ because~ it~ is~ disabled! } % \end{macrocode} % % \begin{macrocode} -\msg_new:nnnn { hooks } { provide-error } +\msg_new:nnn { hooks } { cannot-remove } { - Hook~'#1'~ already~ declared~ as~ a~ - \@@_if_reversed:nTF {#1} { reversed } { normal }~ hook! + Cannot~remove~chunk~'#2'~from~hook~'#1'~because~ + \@@_if_structure_exist:nTF {#1} + { it~does~not~exist~in~that~hook. } + { the~hook~does~not~exist. } } +% \end{macrocode} +% +% \begin{macrocode} +\msg_new:nnn { hooks } { generic-deprecated } { - You~ attempted~ to~ provide~ the~ hook~'#1'~ as~ a~ - \@@_if_reversed:nTF {#1} { normal } { reversed }~ hook,~ but~ it~ - was~ already~ previously~ declared~ as~ a~ - \@@_if_reversed:nTF {#1} { reversed } { normal }~ hook.~ - A~ redeclaration~ is~ not~ possible. + Generic~hook~'#1/#2/#3'~is~deprecated. \\ + Use~hook~'#1/#3/#2'~instead. } % \end{macrocode} % % -% -% -% -% % \subsection{\LaTeXe{} package interface commands} % % @@ -4704,42 +5212,38 @@ % % \begin{macrocode} %<latexrelease>\IncludeInRelease{2021/06/01}% -%<latexrelease> {\hook_provide:n}{Providing~hooks} +%<latexrelease> {\hook_activate_generic:n}{Providing~hooks} % \end{macrocode} % -% \begin{macro}{\ProvideHook,\ProvideReversedHook,\ProvideMirroredHookPair} +% \begin{macro}{\ActivateGenericHook} % Providing new hooks \ldots % \changes{v1.0m}{2021/04/29}{Add \cs{ProvideHook} etc.} +% \changes{v1.0o}{2021/08/02}{Change name} % \begin{macrocode} -\NewDocumentCommand \ProvideHook { m }{ \hook_provide:n {#1} } -\NewDocumentCommand \ProvideReversedHook { m }{ \hook_provide_reversed:n {#1} } -\NewDocumentCommand \ProvideMirroredHookPair { mm }{ \hook_provide_pair:nn {#1}{#2} } +\NewDocumentCommand \ActivateGenericHook { m }{ \hook_activate_generic:n {#1} } % \end{macrocode} % \end{macro} % -% -% \begin{macro}{\DisableHook} -% Disabling a (generic) hook. +% \begin{macro}{\DisableGenericHook} +% Disabling a generic hook. +% \changes{v1.0o}{2021/08/02}{Change name} % \begin{macrocode} -\NewDocumentCommand \DisableHook { m }{ \hook_disable:n {#1} } +\NewDocumentCommand \DisableGenericHook { m }{ \hook_disable_generic:n {#1} } % \end{macrocode} % \end{macro} % % \begin{macrocode} %<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{2020/10/01} -%<latexrelease> {\hook_provide:n}{Providing~hooks} +%<latexrelease> {\hook_activate_generic:n}{Providing~hooks} %<latexrelease> -%<latexrelease>\def \ProvideHook#1{} -%<latexrelease>\def \ProvideReversedHook#1{} -%<latexrelease>\def \ProvideMirroredHookPair#1#2{} +%<latexrelease>\def \ActivateGenericHook#1{} %<latexrelease> %<latexrelease>\EndIncludeInRelease % \end{macrocode} % % % \begin{macro}{\AddToHook} -% % \begin{macrocode} \NewDocumentCommand \AddToHook { m o +m } { \hook_gput_code:nnn {#1} {#2} {#3} } @@ -4747,16 +5251,22 @@ % \end{macro} % % \begin{macro}{\AddToHookNext} -% % \begin{macrocode} \NewDocumentCommand \AddToHookNext { m +m } { \hook_gput_next_code:nn {#1} {#2} } % \end{macrocode} % \end{macro} % +% \begin{macro}{\ClearHookNext} +% \changes{v1.0o}{2021/07/27}{Macro added} +% \begin{macrocode} +\NewDocumentCommand \ClearHookNext { m } + { \hook_gclear_next_code:n {#1} } +% \end{macrocode} +% \end{macro} +% % % \begin{macro}{\RemoveFromHook} -% % \begin{macrocode} \NewDocumentCommand \RemoveFromHook { m o } { \hook_gremove_code:nn {#1} {#2} } @@ -4766,140 +5276,11 @@ % \begin{macro}{\SetDefaultHookLabel} % \begin{macro}{\PushDefaultHookLabel} % \begin{macro}{\PopDefaultHookLabel} -% -% \fmiinline{Docu task: At some point this code for this should be moved to the -% label section earlier and here we should keep only the interface commands.} -% -% \begin{macro}{\@@_curr_name_push:n,\@@_curr_name_push_aux:n} -% \begin{macro}{\@@_curr_name_pop:} -% \begin{macro}{\@@_end_document_label_check:} -% The token list \cs{g_@@_hook_curr_name_tl} stores the name of the -% current package/file to be used as label for hooks. -% Providing a consistent interface is tricky, because packages can -% be loaded within packages, and some packages may not use -% \cs{SetDefaultHookLabel} to change the default label (in which -% case \cs{@currname} is used). -% -% To pull that one off, we keep a stack that contains the default -% label for each level of input. The bottom of the stack contains the -% default label for the |top-level| (this stack should never go -% empty). If we're building the format, set the default label to be -% |top-level|: -% \begin{macrocode} -\tl_gset:Nn \g_@@_hook_curr_name_tl { top-level } -% \end{macrocode} -% -% Then, in case we're in \pkg{latexrelease} we push something on -% the stack to support roll forward. But in some rare cases, -% \pkg{latexrelease} may be loaded inside another package (notably -% \pkg{platexrelease}), so we'll first push the |top-level| entry: -% \changes{v1.0i}{2021/03/18} -% {Only add \texttt{top-level} if not already there.} -% \begin{macrocode} -%<latexrelease>\seq_if_empty:NT \g_@@_name_stack_seq -%<latexrelease> { \seq_gput_right:Nn \g_@@_name_stack_seq { top-level } } -% \end{macrocode} -% then we dissect the \cs{@currnamestack}, adding \cs{@currname} to -% the stack: -% \changes{v1.0f}{2020/11/24}{Support for roll forward (gh/434)} -% \begin{macrocode} -%<latexrelease>\cs_set_protected:Npn \@@_tmp:w #1 #2 #3 -%<latexrelease> { -%<latexrelease> \quark_if_recursion_tail_stop:n {#1} -%<latexrelease> \seq_gput_right:Nn \g_@@_name_stack_seq {#1} -%<latexrelease> \@@_tmp:w -%<latexrelease> } -%<latexrelease>\exp_after:wN \@@_tmp:w \@currnamestack -%<latexrelease> \q_recursion_tail \q_recursion_tail -%<latexrelease> \q_recursion_tail \q_recursion_stop -% \end{macrocode} -% and finally set the default label to be the \cs{@currname}: -% \changes{v1.0i}{2021/03/18} -% {Remove the (empty) \enquote{top-level} from \cs{@currnamestack}.} -% \begin{macrocode} -%<latexrelease>\tl_gset:Nx \g_@@_hook_curr_name_tl { \@currname } -%<latexrelease>\seq_gpop_right:NN \g_@@_name_stack_seq \l_@@_tmpa_tl -% \end{macrocode} -% -% Two commands keep track of the stack: when a file is input, -% \cs{@@_curr_name_push:n} pushes the current default label to the -% stack, and sets the new default label in one go: -% \begin{macrocode} -\cs_new_protected:Npn \@@_curr_name_push:n #1 - { \exp_args:Nx \@@_curr_name_push_aux:n { \@@_make_name:n {#1} } } -\cs_new_protected:Npn \@@_curr_name_push_aux:n #1 - { - \tl_if_blank:nTF {#1} - { \msg_error:nn { hooks } { no-default-label } } - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { PushDefaultHookLabel } {#1} - } - { - \seq_gpush:NV \g_@@_name_stack_seq \g_@@_hook_curr_name_tl - \tl_gset:Nn \g_@@_hook_curr_name_tl {#1} - } - } - } -% \end{macrocode} -% and when an input is over, the topmost item of the stack is popped, -% since the label will not be used again, and \cs{g_@@_hook_curr_name_tl} -% is updated to the now topmost item of the stack: -% \begin{macrocode} -\cs_new_protected:Npn \@@_curr_name_pop: - { - \seq_gpop:NNTF \g_@@_name_stack_seq \l_@@_return_tl - { \tl_gset_eq:NN \g_@@_hook_curr_name_tl \l_@@_return_tl } - { \msg_error:nn { hooks } { extra-pop-label } } - } -% \end{macrocode} -% -% At the end of the document we want to check if there was no -% \cs{@@_curr_name_push:n} without a matching \cs{@@_curr_name_pop:} -% (not a critical error, but it might indicate that something else is -% not quite right): -% \begin{macrocode} -\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage - { \@@_end_document_label_check: } -\cs_new_protected:Npn \@@_end_document_label_check: - { - \seq_gpop:NNT \g_@@_name_stack_seq \l_@@_return_tl - { - \msg_error:nnx { hooks } { missing-pop-label } - { \g_@@_hook_curr_name_tl } - \tl_gset_eq:NN \g_@@_hook_curr_name_tl \l_@@_return_tl - \@@_end_document_label_check: - } - } -% \end{macrocode} -% -% The token list \cs{g_@@_hook_curr_name_tl} is but a mirror of the top -% of the stack. -% % Now define a wrapper that replaces the top of the stack with the % argument, and updates \cs{g_@@_hook_curr_name_tl} accordingly. % \begin{macrocode} \NewDocumentCommand \SetDefaultHookLabel { m } - { - \seq_if_empty:NTF \g_@@_name_stack_seq - { - \msg_error:nnnnn { hooks } { set-top-level } - { for } { SetDefaultHookLabel } {#1} - } - { \exp_args:Nx \@@_set_default_label:n { \@@_make_name:n {#1} } } - } -\cs_new_protected:Npn \@@_set_default_label:n #1 - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { SetDefaultHookLabel } {#1} - } - { \tl_gset:Nn \g_@@_hook_curr_name_tl {#1} } - } -% \end{macrocode} + { \@@_set_default_hook_label:n {#1} } % % The label is only automatically updated with \cs{@onefilewithoptions} % (\cs{usepackage} and \cs{documentclass}), but some packages, like @@ -4907,7 +5288,7 @@ % \cs{usetikzlibrary} that are wrappers around \cs{input}, so they % inherit the default label currently in force (usually |top-level|, % but it may change if loaded in another package). To provide a -% package-like behaviour also for hooks in these files, we provide +% package-like behavior also for hooks in these files, we provide % high-level access to the default label stack. % \begin{macrocode} \NewDocumentCommand \PushDefaultHookLabel { m } @@ -4935,9 +5316,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % % % @@ -4961,7 +5339,7 @@ % \end{macro} % % \begin{macro}{\DebugHooksOn,\DebugHooksOff} -% +% % \begin{macrocode} \cs_new_protected:Npn \DebugHooksOn { \hook_debug_on: } \cs_new_protected:Npn \DebugHooksOff { \hook_debug_off: } @@ -4971,7 +5349,7 @@ % % % \begin{macro}{\DeclareHookRule} -% +% % \begin{macrocode} \NewDocumentCommand \DeclareHookRule { m m m m } { \hook_gset_rule:nnnn {#1}{#2}{#3}{#4} } @@ -5001,7 +5379,7 @@ % \begin{macro}[EXP]{\IfHookEmptyTF} % Here we avoid the overhead of \pkg{xparse}, since \cs{IfHookEmptyTF} % is used in \cs{end} (that is, every \LaTeX{} environment). As a -% further optimisation, use \cs{let} rather than \cs{def} to avoid one +% further optimization, use \cs{let} rather than \cs{def} to avoid one % expansion step. % \begin{macrocode} \cs_new_eq:NN \IfHookEmptyTF \hook_if_empty:nTF @@ -5025,6 +5403,111 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% \subsection{Deprecated that needs cleanup at some point} +% +% \changes{v1.0p}{2021/08/20}{Added deprecation warnings for +% old generic hook commands (gh/638)} +% +% \begin{macro}{ +% \hook_disable:n, +% \hook_provide:n, +% \hook_provide_reversed:n, +% \hook_provide_pair:nn, +% \@@_activate_generic_reversed:n, +% \@@_activate_generic_pair:nn, +% } +% Deprecated. +% \begin{macrocode} +\cs_new_protected:Npn \hook_disable:n + { + \@@_deprecated_warn:nn + { hook_disable:n } + { hook_disable_generic:n } + \hook_disable_generic:n + } +\cs_new_protected:Npn \hook_provide:n + { + \@@_deprecated_warn:nn + { hook_provide:n } + { hook_activate_generic:n } + \hook_activate_generic:n + } +\cs_new_protected:Npn \hook_provide_reversed:n + { + \@@_deprecated_warn:nn + { hook_provide_reversed:n } + { hook_activate_generic:n } + \@@_activate_generic_reversed:n + } +\cs_new_protected:Npn \hook_provide_pair:nn + { + \@@_deprecated_warn:nn + { hook_provide_pair:nn } + { hook_activate_generic:n } + \@@_activate_generic_pair:nn + } +\cs_new_protected:Npn \@@_activate_generic_reversed:n #1 + { \@@_normalize_hook_args:Nn \@@_activate_generic:nn {#1} { - } } +\cs_new_protected:Npn \@@_activate_generic_pair:nn #1#2 + { \hook_activate_generic:n {#1} \@@_activate_generic_reversed:n {#2} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ +% \DisableHook, +% \ProvideHook, +% \ProvideReversedHook, +% \ProvideMirroredHookPair, +% } +% Deprecated. +% \begin{macrocode} +\cs_new_protected:Npn \DisableHook + { + \@@_deprecated_warn:nn + { DisableHook } + { DisableGenericHook } + \hook_disable_generic:n + } +\cs_new_protected:Npn \ProvideHook + { + \@@_deprecated_warn:nn + { ProvideHook } + { ActivateGenericHook } + \hook_activate_generic:n + } +\cs_new_protected:Npn \ProvideReversedHook + { + \@@_deprecated_warn:nn + { ProvideReversedHook } + { ActivateGenericHook } + \@@_activate_generic_reversed:n + } +\cs_new_protected:Npn \ProvideMirroredHookPair + { + \@@_deprecated_warn:nn + { ProvideMirroredHookPair } + { ActivateGenericHook } + \@@_activate_generic_pair:nn + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_deprecated_warn:nn} +% Warns about a deprecation, telling what should be used instead. +% \begin{macrocode} +\cs_new_protected:Npn \@@_deprecated_warn:nn #1 #2 + { \msg_warning:nnnn { hooks } { deprecated } {#1} {#2} } +\msg_new:nnn { hooks } { deprecated } + { + Command~\iow_char:N\\#1~is~deprecated~and~will~be~removed~in~a~ + future~release. \\ \\ + Use~\iow_char:N\\#2~instead. + } +% \end{macrocode} +% \end{macro} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % % \subsection{Internal commands needed elsewhere} % @@ -5068,7 +5551,7 @@ %<latexrelease>\def \NewReversedHook#1{} %<latexrelease>\def \NewMirroredHookPair#1#2{} %<latexrelease> -%<latexrelease>\def \DisableHook #1{} +%<latexrelease>\def \DisableGenericHook #1{} %<latexrelease> %<latexrelease>\long\def\AddToHookNext#1#2{} %<latexrelease> @@ -5105,6 +5588,6 @@ % \Finale % % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx b/Master/texmf-dist/source/latex-dev/base/ltluatex.dtx index 3b9a3377312..2508f5a7cc2 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/04/18 v1.1t +[2021/08/11 v1.1u %</tex> %<plain> LuaTeX support for plain TeX (core) %<*tex> @@ -912,12 +912,14 @@ local luatexbase = luatexbase % \end{macro} % % Some Lua best practice: use local versions of functions where possible. +% \changes{v1.1u}{2021/08/11}{Define missing local function} % \begin{macrocode} local string_gsub = string.gsub local tex_count = tex.count local tex_setattribute = tex.setattribute local tex_setcount = tex.setcount local texio_write_nl = texio.write_nl +local flush_list = node.flush_list % \end{macrocode} % \changes{v1.0i}{2015/11/29}{Declare this as local before used in the module error definitions (PHG)} % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/base/ltoutenc.dtx b/Master/texmf-dist/source/latex-dev/base/ltoutenc.dtx index eb2ecd1e537..14518d2fb24 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltoutenc.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltoutenc.dtx @@ -44,7 +44,7 @@ %<*driver> % \fi \ProvidesFile{ltoutenc.dtx} - [2021/04/29 v2.0v LaTeX Kernel (font encodings)] + [2021/09/12 v2.0w LaTeX Kernel (font encodings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutenc.dtx} @@ -1783,12 +1783,14 @@ % {Added \cs{ij} and \cs{IJ} from babel. (pr/3771)} % The dutch language uses the letter `ij'. It is available in % \texttt{T1} encoded fonts, but not in the \texttt{OT1} encoded -% fonts. Therefor we fake it for the \texttt{OT1} encoding. +% fonts. Therefore we fake it for the \texttt{OT1} encoding. +% \changes{v2.0w}{2021/09/12}{Move zero skip between +% i and j for hyphenation (gh/658)} % \begin{macrocode} \DeclareTextCommand{\ij}{OT1}{% - \nobreak\hskip\z@skip i\kern-0.02em j\nobreak\hskip\z@skip} + \nobreak\hskip\z@skip i\kern-0.02em\nobreak\hskip\z@skip j} \DeclareTextCommand{\IJ}{OT1}{% - \nobreak\hskip\z@skip I\kern-0.02em J\nobreak\hskip\z@skip} + \nobreak\hskip\z@skip I\kern-0.02em\nobreak\hskip\z@skip J} % \end{macrocode} % In the OT1 encoding, \pounds~and \$ share a slot. % \changes{v1.9y}{2000/01/30}{Use \cs{hmode@bgroup} where applicable diff --git a/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx b/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx index b1b3a240965..78b0f2335f8 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltoutput.dtx @@ -30,14 +30,14 @@ %%% From File: ltoutput.dtx %<flafter>\ProvidesPackage{flafter} %<fltrace>\ProvidesPackage{fltrace} -%<flafter,fltrace> [2018/11/28 v1.4d +%<flafter,fltrace> [2021/07/31 v1.4e %<flafter> Standard LaTeX floats after reference (FMi)] %<fltrace> Tracing LaTeX floats algorithm (FMi)] % %<*driver> % \fi \ProvidesFile{ltoutput.dtx} - [2021/05/05 v1.4g LaTeX Kernel (Output Routine)] + [2021/09/03 v1.4h LaTeX Kernel (Output Routine)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutput.dtx} @@ -3945,10 +3945,69 @@ \fi \fi } +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% \begin{macro}{\ShowFloat} +% This command provides some information about the contenta of a +% float register. Float registers have internal names of the form +% \cs{bx@}\meta{Uppercase-letter(s)-or numbers} and you specify just this +% letter or letters as the argument, e.g., \verb=\ShowFloat{A}=. +% (There is not much error recovery if you specify something that +% isn't a float.) +% \changes{v1.4g}{2021/07/31}{Macro added} +% \changes{v1.4h}{2021/09/03}{Renamed, original name never distributed} +% \begin{macrocode} %</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\ShowFloat}{Show float register contents}% +\def\ShowFloat#1{\begingroup + \let \fl@trace \fl@tracemessage + \fl@trace{***Float #1 details:}% + \ifcsname bx@#1\endcsname + \expandafter\fl@ShowFloat\csname bx@#1\endcsname + \else + \fl@trace{Not a float!}% + \fi + \endgroup +} +\def\fl@ShowFloat#1{% + \fl@traceval{\count#1}% % this here should be interpreted on day + \fl@traceval{\ht#1}% + \fl@traceval{\dp#1}% + \fl@traceval{\wd#1}% + {\tracingonline1\showboxbreadth10\showboxdepth3\showbox#1}% +} +% \end{macrocode} +% Here are two definitions from \texttt{fltrace} that make the above +% code work: +% \begin{macrocode} +\def \fl@traceval #1{\fl@trace{\string #1 = \the #1}} +\def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\ShowFloat}{Show float register contents}% +%<latexrelease> +%<latexrelease>\let\ShowFloat\@undefined +%<latexrelease>\let\fl@ShowFloat\@undefined +%<latexrelease>\let\fl@traceval\@undefined +%<latexrelease>\let\fl@tracemessage\@undefined +%<latexrelease>\EndIncludeInRelease % \end{macrocode} % \end{macro} % +% +% +% % \subsubsection{Float control} % % This part implements controllable floats and other changes @@ -4025,6 +4084,16 @@ % wrong value.\footnote{This is a somewhat questionable design.} % \begin{macrocode} \begingroup +% \end{macrocode} +% When the user requests \cs{tracefloatvals} then they should show +% regardless of the tracing state, so locally we make sure that it +% is activated. +% \changes{v1.4e}{2021/07/31}{Enable display when doing \cs{tracefloatvals}} +% \begin{macrocode} + \tracefloats +% \end{macrocode} +% +% \begin{macrocode} \@dblfloatplacement \@floatplacement \fl@trace{***Float placement parameters:}% @@ -4052,6 +4121,7 @@ {trace float vals}% \def \tracefloatvals{% \begingroup + \tracefloats \@dblfloatplacement \@floatplacement \fl@trace{***Float placement parameters:}% @@ -4077,6 +4147,10 @@ } \EndIncludeInRelease % \end{macrocode} +% +% +% +% % We need to make sure that \texttt{fltrace} comes before % \texttt{flafter} to make the tracing work. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/base/ltpara.dtx b/Master/texmf-dist/source/latex-dev/base/ltpara.dtx index 5ab52a5e9bc..bc51e4688ff 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltpara.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltpara.dtx @@ -14,8 +14,8 @@ %%% From File: ltpara.dtx % % \begin{macrocode} -\def\ltparaversion{v1.0g} -\def\ltparadate{2021/05/27} +\def\ltparaversion{v1.0j} +\def\ltparadate{2021/09/18} % \end{macrocode} %<*driver> \documentclass{l3doc} @@ -468,7 +468,7 @@ % % The commands \cs{RawIndent} and \cs{RawNoindent} are not meant % for normal paragraph building (where the result is a textual -% paragraph in the the traditional meaning of the word), but for +% paragraph in the traditional meaning of the word), but for % special cases where \TeX{}'s low-level algorithm is used to % achieve special effects, but where the result is not a % \enquote{paragraph}. @@ -972,6 +972,30 @@ % above construct but two conditionals instead. Using low-level % \cs{if_mode...} conditions would be even faster but has the % danger to conflict with conditionals in the user hooks. +% +% If \cs{para_end:} is executed while \TeX{} is currently doing a +% low-level assignment the test for horizontal mode may get +% executed as part of the assignment. That is normally not an issue +% but we just found one case where it is: +%\begin{verbatim} +% \afterassignment\lst@vskip\@tempskipa \z@ \par +%\end{verbatim} +% If \TeX{} is in hmode while that assignment happens then the +% \cs{par} is seen in hmode (because in the above case the +% assignment isn't finished (one should have used \cs{z@skip} and +% the \cs{lst@vskip} will get inserted into the middle of the +% conditional. The \cs{lst@vskip} then changes to vmode and you get +% a surprising error about the \texttt{para/end} hook having +% changed modes even if you don't have any hook code because it is +% the instered \cs{lst@vskip} that is causing it. That happened +% when the output routines got started while a \texttt{lstlisting} +% environment (that redefines \cs{vskip} in this way) was +% active. This is really faulty coding, but we try to be proactive +% and guard the conditional so thatany scanning is stopped before it: +% \begin{macrocode} + \scan_stop: +% \end{macrocode} +% % \begin{macrocode} \mode_if_horizontal:TF { \mode_if_inner:F { @@ -1008,12 +1032,13 @@ \mode_if_horizontal:TF { % \end{macrocode} % The final action (before getting to the point where -% \cs{tex_par:D} is called) is to add a kern item so that the +% \cs{tex_par:D} is called) is to add a glue item so that the % primitive is prevented from removing glue (if there was some). If % we don't do this and the % horizontal list ended in several glue items we would end up with % removing two instead of just the last one, which would be wrong. -% We use a kern as that is minimally faster. +% We use glue (rather than a kern) as that will be removed by the primitive +% par. % % There is however one other \TeX{} optimization that hurts: in a % sequence like this \verb=$$ ... $$ \par= \TeX{} will be in @@ -1023,17 +1048,19 @@ % away. The space between \verb=$$= and \cs{par} got already % dropped during the display processing so the \cs{par} is not % removing any space and appending \cs{parfillskip}, instead it -% simply goes silently to vmode. Now if we would had added something (to +% simply goes silently to vmode. Now if we would have added something (to % prevent glue removal) that would look to \TeX{} like material % after the display and so we would end up with an empty paragraph % just containing \cs{parfillskip}. % -% We therefore check if the current hlist is empty -% (\cs{tex_lastnodetype:D} has the value \texttt{-1} and -% only if not we add our kern. +% We therefore check if the current hlist does end in glue +% (\cs{tex_lastnodetype:D} has the value \texttt{11}) and +% if so we add a zero-length guard skip which will be removed by the +% following \cs{tex_par:D}. +% \changes{v1.0i}{2021/09/18}{Use skip rather than kern as guard.} % \begin{macrocode} - \if_int_compare:w 0 < \tex_lastnodetype:D - \tex_kern:D \c_zero_dim + \if_int_compare:w 11 = \tex_lastnodetype:D + \tex_hskip:D \c_zero_dim \fi: % \end{macrocode} % To run the \hook{para/after} hook we first end the @@ -1054,7 +1081,7 @@ % Finally close out the nested conditionals. % \begin{macrocode} } - } + } % \end{macrocode} % % \begin{macrocode} @@ -1090,7 +1117,7 @@ \@@_handle_indent: \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_indent:D } % \end{macrocode} @@ -1103,7 +1130,7 @@ \tex_everypar:D { \g_@@_standard_everypar_tl } \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_noindent:D } % \end{macrocode} @@ -1161,7 +1188,7 @@ % The first argument is the hook name second the mode % it should have stayed in but didn't. % -% \begin{macrocode} +% \begin{macrocode} \msg_new:nnnn { hooks } { para-mode } { Illegal~mode~ change~ in~ hook~ 'para/#1'.\\ @@ -1175,10 +1202,11 @@ } % \end{macrocode} % +% \changes{v1.0i}{2021/08/27}{Internal message name changes} % And here is one used in the \enquote{raw} commands when they are -% used outside of vertical mode. +% used outside of vertical mode. % \begin{macrocode} -\msg_new:nnnn { kernel } { raw-para } +\msg_new:nnnn { latex2e } { raw-para } { Not~ in~ vertical~ mode. } @@ -1206,7 +1234,7 @@ %<latexrelease>\cs_set_eq:NN \par \tex_par:D %<latexrelease>\cs_set_eq:NN \@@par \tex_par:D %<latexrelease>\cs_set_eq:NN \endgraf \tex_par:D -%<latexrelease> +%<latexrelease> %<latexrelease>\EndModuleRelease \ExplSyntaxOff %</2ekernel|latexrelease> @@ -1220,4 +1248,3 @@ \endinput %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % - diff --git a/Master/texmf-dist/source/latex-dev/base/ltplain.dtx b/Master/texmf-dist/source/latex-dev/base/ltplain.dtx index e0fbcecf1b6..5fa70396794 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltplain.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltplain.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltplain.dtx} - [2021/04/18 v2.3f LaTeX Kernel (Plain TeX)] + [2021/07/16 v2.3g LaTeX Kernel (Plain TeX)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltplain.dtx} @@ -906,6 +906,7 @@ \finalhyphendemerits=5000 \adjdemerits=10000 % \end{macrocode} +% \begin{macrocode} % \looseness=0, cleared by TeX after each paragraph % \pausing=0 % \holdinginserts=0 @@ -915,9 +916,24 @@ % \tracingparagraphs=0 % \tracingpages=0 % \tracingoutput=0 +% \end{macrocode} +% In the past \LaTeX{} used the default value of \texttt{1} for +% \cs{tracinglostchars} because this was the best it could do. This +% way one would at least get a warning in the \texttt{.log} +% file. e-\TeX{} improved on that and supported a value of \texttt{2} +% to show the warning on the terminal, so we could have changed the +% default when we made the e-\TeX{} extensions required---however, +% we overlooked that oportunity. +% In 2021 this parameter was improved on again and now also accepts +% the value \texttt{3} +% (error on the terminal). This made us realize that we should +% change the default. Using \texttt{3} would really be the +% best, but for compatibility reasons we only use \texttt{2}. +% \changes{v2.3g}{2021/07/16}{Use 2 as default value for \cs{tracinglostchars}} % \begin{macrocode} -\tracinglostchars=1 +\tracinglostchars=2 % \end{macrocode} +% \begin{macrocode} % \tracingcommands=0 % \tracingrestores=0 % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/base/ltsect.dtx b/Master/texmf-dist/source/latex-dev/base/ltsect.dtx index 29ea142ba6c..67974c73874 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltsect.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltsect.dtx @@ -31,7 +31,7 @@ %%% From File: ltsect.dtx %<*driver> % \fi -\ProvidesFile{ltsect.dtx}[2020/12/05 v1.1e LaTeX Kernel (Sectioning)] +\ProvidesFile{ltsect.dtx}[2021/07/28 v1.1f LaTeX Kernel (Sectioning)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltsect.dtx} @@ -765,7 +765,7 @@ % The |\addcontentsline{|\meta{table}|}{|\meta{type}|}{|% % \meta{entry}|}| command allows the user to add % his/her own entry to a table of contents, etc. The command adds the -% entry |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}| +% entry |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}{}| % to the |.|\meta{table} file. % % This macro is implemented as an application of |\addtocontents|. @@ -833,7 +833,7 @@ % \end{macro} % % \begin{macro}{\contentsline} -% The |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}| +% The |\contentsline{|\meta{type}|}{|\meta{entry}|}{|\meta{page}|}{}| % macro produces a \meta{type} entry in a table of contents, etc. % It will appear in the |.toc| or other file. For example, % The entry for subsection 1.4.3 in the table of contents for @@ -848,10 +848,44 @@ % without expanding them. % % \begin{macrocode} -\def\contentsline#1{\csname l@#1\endcsname} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\contentsline}{Four arguments}% +% \end{macrocode} +% +% In the toc file \cs{contentsline} is followed by 4 arguments +% these days, but only the first 3 are used in the old +% interface. The fourth was by default empty and only used when +% \pkg{hyperref} was loaded. We now pick up all 4 arguments, save +% the last one away in \cs{@contentsline@destination} and then call +% the old interface. This is done to simplify the interface to +% \pkg{hyperref} and to prepare for future changes. +% \changes{v1.1f}{2021/07/28}{Pick up four arguments (gh/633)} +% \begin{macrocode} +\def\contentsline#1#2#3#4{\gdef\@contentsline@destination{#4}% + \csname l@#1\endcsname{#2}{#3}} +% \end{macrocode} +% Default definition. +% \begin{macrocode} +\let\@contentsline@destination\@empty +% \end{macrocode} +% +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\contentsline}{Four arguments}% +%<latexrelease> +%<latexrelease>\def\contentsline#1{\csname l@#1\endcsname} +%<latexrelease>\let\@contentsline@destination\@undefined +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % +% +% % |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|\meta{numwidth}% % |}{|\meta{title}|}{|\meta{page}|}|: % Macro to produce a table of contents line with the following diff --git a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx index 6e687ee4449..7f6555d18cf 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltshipout.dtx @@ -283,7 +283,7 @@ % includes the background and foreground material). % % \textbf{Note:} Just like \hook{shipout/before} this hook is -% not meant to be used for adding adding typeset material back +% not meant to be used for adding typeset material back % to the main vertical list---it might vanish or the % vertical spacing will be wrong! % diff --git a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx index 9ccd2bd02ef..3f2f119cb1b 100644 --- a/Master/texmf-dist/source/latex-dev/base/ltvers.dtx +++ b/Master/texmf-dist/source/latex-dev/base/ltvers.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltvers.dtx} - [2021/04/16 v1.1g LaTeX Kernel (Version Info)] + [2021/08/10 v1.1h LaTeX Kernel (Version Info)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltvers.dtx} @@ -115,7 +115,7 @@ {2021-11-15} %</2ekernel|latexrelease> %<*2ekernel> -\def\patch@level{-1} +\def\patch@level{-2} % \end{macrocode} % % \begin{macro}{\development@branch@name} @@ -230,6 +230,7 @@ % \changes{v1.0o}{2015/01/19}{Optional argument} % \changes{v1.0q}{2015/02/19}{Swap argument order} % \changes{v1.1f}{2021/03/18}{Add support for usage in \cs{NewModuleRelease}} +% \changes{v1.1h}{2021/08/10}{Add error to aid debugging} % % \begin{macrocode} %<*2ekernel|latexrelease> @@ -257,6 +258,15 @@ {\@IncludeInRelease{#1}[#1]}}} \def\finish@module@release#1#2#3{% \toks@{[#1] #3}% + \begingroup + \edef\x{\detokenize\expandafter{\new@modulename}}% + \edef\y{\detokenize{#2}}% + \expandafter\endgroup + \ifx\x\y \else + \@latex@error{\noexpand\IncludeInRelease dated #1 in a module is not + allowed.\MessageBreak Use a date at least equal to \new@moduledate + \space for complete rollback}\@ehd + \fi \ifnum\expandafter\@parse@version\new@moduledate//00\@nil >\expandafter\@parse@version\fmtversion//00\@nil \GenericInfo{}{Applying: \the\toks@}% diff --git a/Master/texmf-dist/source/latex-dev/base/tulm.fdd b/Master/texmf-dist/source/latex-dev/base/tulm.fdd index 5c1566a5bad..243cbe30cc7 100644 --- a/Master/texmf-dist/source/latex-dev/base/tulm.fdd +++ b/Master/texmf-dist/source/latex-dev/base/tulm.fdd @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 2016-2019 +% Copyright 2016-2021 % The LaTeX Project and any individual authors listed elsewhere % in this file. % @@ -30,7 +30,7 @@ %\iffalse This is a META comment % % File `cmfonts.fdd'. -% Copyright (C) 2016-2019 LaTeX Project +% Copyright (C) 2016-2021 LaTeX Project % % %<TUlmr>\ProvidesFile{tulmr.fd} @@ -42,7 +42,7 @@ %<*driver> \ProvidesFile{tulm.drv} %</driver> - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] % %<*driver> \documentclass{ltxdoc} @@ -63,6 +63,7 @@ %\fi % % \section{TUlmr} +% \changes{v1.8a}{2021/07/23}{Use OpenType font for TU/lmr/m/ui} % \begin{macrocode} %<*TUlmr> \DeclareFontFamily{TU}{lmr}{} @@ -93,7 +94,7 @@ \DeclareFontShape{TU}{lmr}{m}{sc}% {<-> \UnicodeFontFile{lmromancaps10-regular}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{m}{ui}% - {<-> ec-lmu10}{} + {<-> \UnicodeFontFile{lmromanunsl10-regular}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{m}{scsl}% {<-> \UnicodeFontFile{lmromancaps10-oblique}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{b}{n} diff --git a/Master/texmf-dist/source/latex-dev/base/utf8ienc.dtx b/Master/texmf-dist/source/latex-dev/base/utf8ienc.dtx index a517459441d..75990d1b036 100644 --- a/Master/texmf-dist/source/latex-dev/base/utf8ienc.dtx +++ b/Master/texmf-dist/source/latex-dev/base/utf8ienc.dtx @@ -216,7 +216,7 @@ %<+ts1> \ProvidesFile{ts1enc.dfu} %<+x2> \ProvidesFile{x2enc.dfu} %<+all> \ProvidesFile{utf8enc.dfu} -%<-utf8-2018> [2021/06/08 v1.2m UTF-8 support] +%<-utf8-2018> [2021/06/21 v1.2n UTF-8 support] % \end{macrocode} % % \begin{macrocode} @@ -1704,17 +1704,31 @@ %<all,t1>\DeclareUnicodeCharacter{1E03}{\.b} % \end{macrocode} % \changes{v1.2k}{2021/01/27}{Added various additional dot accents (gh/484)} +% \changes{v1.2n}{2021/06/21}{more extended latin entries for gh/593} % \begin{macrocode} %<all,t1>\DeclareUnicodeCharacter{1E0D}{\d d} +%<all,t1>\DeclareUnicodeCharacter{1E1E}{\.F} +%<all,t1>\DeclareUnicodeCharacter{1E1F}{\.f} %<all,t1>\DeclareUnicodeCharacter{1E25}{\d h} +%<all,t1>\DeclareUnicodeCharacter{1E30}{\@tabacckludge'K} +%<all,t1>\DeclareUnicodeCharacter{1E31}{\@tabacckludge'k} %<all,t1>\DeclareUnicodeCharacter{1E37}{\d l} +%<all,t1>\DeclareUnicodeCharacter{1E8E}{\.Y} +%<all,t1>\DeclareUnicodeCharacter{1E8F}{\.y} %<all,t1>\DeclareUnicodeCharacter{1E43}{\d m} %<all,t1>\DeclareUnicodeCharacter{1E45}{\.n} %<all,t1>\DeclareUnicodeCharacter{1E47}{\d n} %<all,t1>\DeclareUnicodeCharacter{1E5B}{\d r} %<all,t1>\DeclareUnicodeCharacter{1E63}{\d s} %<all,t1>\DeclareUnicodeCharacter{1E6D}{\d t} +%<all,t1>\DeclareUnicodeCharacter{1E90}{\^Z} +%<all,t1>\DeclareUnicodeCharacter{1E91}{\^z} %<all,t1>\DeclareUnicodeCharacter{1E9E}{\SS} +%<all,t1>\DeclareUnicodeCharacter{1EF2}{\@tabacckludge`Y} +%<all,t1>\DeclareUnicodeCharacter{1EF3}{\@tabacckludge`y} +% \end{macrocode} +% +% \begin{macrocode} %<all,x2,t2c,t2b,t2a,t1,utf8>\DeclareUnicodeCharacter{200C}{\textcompwordmark} % \end{macrocode} % \changes{v1.1s}{2016/02/28}{Add more hyphens and dashes} diff --git a/Master/texmf-dist/source/latex-dev/firstaid/latex2e-first-aid-for-external-files.dtx b/Master/texmf-dist/source/latex-dev/firstaid/latex2e-first-aid-for-external-files.dtx index 84ddacb269c..702dca02298 100644 --- a/Master/texmf-dist/source/latex-dev/firstaid/latex2e-first-aid-for-external-files.dtx +++ b/Master/texmf-dist/source/latex-dev/firstaid/latex2e-first-aid-for-external-files.dtx @@ -111,8 +111,8 @@ % \end{macrocode} % % \begin{macrocode} -\def\LaTeXFirstAidDate{2021/06/08} -\def\LaTeXFirstAidVersion{v1.0m} +\def\LaTeXFirstAidDate{2021/06/28} +\def\LaTeXFirstAidVersion{v1.0o} % \end{macrocode} % % \begin{macrocode} @@ -120,8 +120,8 @@ [\LaTeXFirstAidDate\space \LaTeXFirstAidVersion\space LaTeX kernel fixes to external files and packages] % \end{macrocode} - % - +% +% % \begin{macro}{\FirstAidNeededT} % This is a very simple help to ensure that we only apply first aid % to an unmodified package or class. It only works in the case the @@ -135,7 +135,13 @@ \ExplSyntaxOn \cs_new:Npn\FirstAidNeededT#1#2#3{ \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3} - { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!} } + { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J + \@spaces Expected:^^J + \@spaces\@spaces #3^^J + \@spaces but~ found:^^J + \@spaces\@spaces \use:c{ver@#1.#2}^^J + \@spaces so~ I'm~ assuming~ it~ got~ fixed. + } } \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} } \ExplSyntaxOff @@ -221,9 +227,9 @@ % % \begin{macrocode} \newcommand\AtBeginOfFile [2] - {\AddToHook{file/before/#1}{#2}} + {\AddToHook{file/#1/before}{#2}} \newcommand\AtEndOfFile [2] - {\AddToHook{file/after/#1}{#2}} + {\AddToHook{file/#1/after}{#2}} % \end{macrocode} % % Some commands offered a starred form @@ -232,8 +238,8 @@ {\IfBooleanTF{#1}% {\@ifpackageloaded{#2}% {#3}% - {\AddToHook{package/before/#2}{#3}}}% - {\AddToHook{package/before/#2}{#3}}% + {\AddToHook{package/#2/before}{#3}}}% + {\AddToHook{package/#2/before}{#3}}% } % \end{macrocode} % @@ -242,8 +248,8 @@ {\IfBooleanTF{#1}% {\@ifpackageloaded{#2}% {#3}% - {\AddToHook{package/after/#2}{#3}}}% - {\AddToHook{package/after/#2}{#3}}% + {\AddToHook{package/#2/after}{#3}}}% + {\AddToHook{package/#2/after}{#3}}% } % \end{macrocode} % @@ -254,25 +260,25 @@ {\IfBooleanTF{#1}% {\@ifclassloaded{#2}% {#3}% - {\AddToHook{class/before/#2}{#3}}}% - {\AddToHook{class/before/#2}{#3}}% + {\AddToHook{class/#2/before}{#3}}}% + {\AddToHook{class/#2/before}{#3}}% } \DeclareDocumentCommand \AtEndOfClassFile {smm} {\IfBooleanTF{#1}% {\@ifclassloaded{#2}% {#3}% - {\AddToHook{class/after/#2}{#3}}}% - {\AddToHook{class/after/#2}{#3}}% + {\AddToHook{class/#2/after}{#3}}}% + {\AddToHook{class/#2/after}{#3}}% } % \end{macrocode} % % \begin{macrocode} \newcommand\AtBeginOfIncludeFile [2] - {\AddToHook{include/before/#1}{#2}} + {\AddToHook{include/#1/before}{#2}} \newcommand\AtEndOfIncludeFile [2] - {\AddToHook{include/end/#1}{#2}} + {\AddToHook{include/#1/end}{#2}} \newcommand\AfterIncludeFile [2] - {\AddToHook{include/after/#1}{#2}} + {\AddToHook{include/#1/after}{#2}} % \end{macrocode} % % \begin{macrocode} @@ -296,7 +302,7 @@ % If the package gets updated one can easily take that out simply % through %\begin{verbatim} -% \RemoveFromHook{file/after/biditools.sty}[firstaid] +% \RemoveFromHook{file/biditools.sty/after}[firstaid] %\end{verbatim} % This makes it easy to test new bidi code while the first aid code % is still in the kernel. @@ -306,7 +312,7 @@ % \end{macrocode} % % \begin{macrocode} -\AddToHook{file/after/biditools.sty}[firstaid]{% +\AddToHook{file/biditools.sty/after}[firstaid]{% \FirstAidNeededT{biditools}{sty}% {2020/05/13 v2 Programming tools for bidi package}% {% @@ -341,7 +347,7 @@ % Again a case of a no longer correct \cs{endgroup} in document. % Here the fix is simply though. % \begin{macrocode} -\AddToHook{file/after/dinbrief.cls}[firstaid]{% +\AddToHook{file/dinbrief.cls/after}[firstaid]{% \FirstAidNeededT{dinbrief}{cls}{2000/03/02 LaTeX2e class}% {\AddToHook{env/document/begin}{\begingroup}}% } @@ -363,7 +369,7 @@ % % \begin{macrocode} \ExplSyntaxOn -\AddToHook{file/after/pgfpages.sty}[firstaid]{% +\AddToHook{file/pgfpages.sty/after}[firstaid]{% % \end{macrocode} % Undo overwriting \cs{shipout}: % \begin{macrocode} @@ -390,7 +396,7 @@ % % \begin{macrocode} \ExplSyntaxOn -\AddToHook{file/after/pgfmorepages.sty}[firstaid]{ +\AddToHook{file/pgfmorepages.sty/after}[firstaid]{ \cs_set_nopar:Npn \pgfhookintoshipout { \cs_set_eq:NN \pgfpages@originalshipout \tex_shipout:D \cs_set_eq:NN \tex_shipout:D \pgfpages@interceptshipout @@ -468,7 +474,7 @@ % \end{macrocode} % % \begin{macrocode} -\AddToHook{file/after/CJK.sty}[firstaid]{% +\AddToHook{file/CJK.sty/after}[firstaid]{% \FirstAidNeededT{CJK}{sty}% {2015/04/18 4.8.4}% {% @@ -493,20 +499,22 @@ % % A few classes unconditionally define \cs{footref}. Until that has % changed we provide some first aid to let them do this. +% +% --- This seems to be resolved now --- % % \begin{macrocode} -\AddToHook{file/after/scrkbase.sty}[firstaid]{% - \FirstAidNeededT{scrkbase}{sty}% - {2020/09/21 v3.32 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)}% - {\let\footref\@undefined} - } +%\AddToHook{file/scrkbase.sty/after}[firstaid]{% +% \FirstAidNeededT{scrkbase}{sty}% +% {2020/09/21 v3.32 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)}% +% {\let\footref\@undefined} +% } % \end{macrocode} % % \begin{macrocode} -\AddToHook{class/before/memoir}[firstaid]{% - % for version {2020/10/04 v3.7n configurable book, report, article document class}% - \let\footref\@undefined -} +%\AddToHook{class/memoir/before}[firstaid]{% +% % for version {2020/10/04 v3.7n configurable book, report, article document class}% +% \let\footref\@undefined +%} % \end{macrocode} % % @@ -528,7 +536,7 @@ % This firstaid therefore jumps over the problematical point by % pushing the count allocation to a safe value if necessary. % \begin{macrocode} -\AddToHook{file/after/bigfoot.sty}{% +\AddToHook{file/bigfoot.sty/after}{% \ifnum\count10<\insc@unt \global\count10=\insc@unt \fi @@ -548,7 +556,7 @@ % % % -% \subsection{\cs{ulem} first aid} +% \subsection{\pkg{ulem} first aid} % % In 2020 we fixed various kernel commands to accept \pkg{calc} % syntax. The \pkg{ulem} package redefines some internals and that @@ -558,14 +566,14 @@ % moment \pkg{ulem} gets adjusted. % % \begin{macrocode} -\AddToHook{file/after/ulem.sty}[firstaid]{% +\AddToHook{file/ulem.sty/after}[firstaid]{% \def\@hspace#1{\begingroup\setlength\skip@{#1}% \edef\x{\endgroup\hskip\the\skip@\relax}\x}% } % \end{macrocode} % % -% \subsection{\cs{varwidth} first aid} +% \subsection{\pkg{varwidth} first aid} % % The \pkg{varwidth} package does a lot of low-level paragraph % manipulation assuming traditional \TeX{} paragraphs. However, with @@ -577,13 +585,13 @@ % \cs{unskip}. % % \begin{macrocode} -\AddToHook{file/after/varwidth.sty}[firstaid]{% +\AddToHook{file/varwidth.sty/after}[firstaid]{% \FirstAidNeededT{varwidth}{sty}% {2009/03/30 ver 0.92; \space Variable-width minipages}% {% \def\@vwid@sift{% \skip@\lastskip\unskip - \unskip % <---- the first aid here + \ifdim\lastskip=\z@\unskip\fi % <---- the first aid here (not just unskip) \dimen@\lastkern\unkern \count@\lastpenalty\unpenalty \setbox\z@\lastbox @@ -618,6 +626,88 @@ % {Temporary fixes for the kernel \\ % (until the next patch-level release)} % +% This fixes GitHub issue 591. It is only needed in Lua\TeX\ and replaces just one +% instance of \cs{tex\_par:D} with the following version which removes +% other nodes in the current list first. +% \begin{macrocode} +\ExplSyntaxOn +\sys_if_engine_luatex:T + { + \newluafunction \g__para_end_empty_par_id_int + \exp_args:Nx \everyjob { + \exp_not:V \everyjob + \exp_not:N \lua_now:n { + local~texnest, flush_list, par_token = tex.nest, node.flush_list, token.create'tex_par:D'~ + lua.get_functions_table()[\int_use:N \g__para_end_empty_par_id_int] = function() + local~nest_level = texnest.top~ + local~cur_head = nest_level.head~ + flush_list(cur_head.next) + nest_level.tail, cur_head.next = cur_head, nil~ + token.put_next(par_token) + end + } + } + \protected \luadef \__para_end_empty_par: \g__para_end_empty_par_id_int + \group_begin: + \cs_set:Npn \__para_extract_everypar:w #1 \the \toks #2 \s_stop + { + \tl_gset:Nn \g__para_standard_everypar_tl { + \box_gset_to_last:N \g_para_indent_box + \group_begin: + \__para_end_empty_par: + \group_end: + \tex_everypar:D { \msg_error:nnnn { hooks }{ para-mode }{before}{vertical} } + \@kernel@before@para@before + \hook_use:n {para/before} + \group_begin: + \tex_everypar:D {} + \skip_zero:N \tex_parskip:D + \tex_noindent:D + \group_end: + \tex_everypar:D{\g__para_standard_everypar_tl} + \@kernel@before@para@begin + \hook_use:n {para/begin} + \if_mode_horizontal: \else: + \msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi: + \__para_handle_indent: + \the \toks #2 + } + } + \exp_last_unbraced:No \__para_extract_everypar:w \g__para_standard_everypar_tl \s_stop + \group_end: + } +\ExplSyntaxOff +% \end{macrocode} +% +% The next fixes Github issue 605 (by inserting a \cs{scan\_stop:} +% before doing the check for hmode). +% \begin{macrocode} +\ExplSyntaxOn +\cs_set_protected:Npn \para_end: { + \scan_stop: + \mode_if_horizontal:TF { + \mode_if_inner:F { + \tex_unskip:D + \hook_use:n{para/end} + \@kernel@after@para@end + \mode_if_horizontal:TF { + \if_int_compare:w 0 < \tex_lastnodetype:D + \tex_kern:D \c_zero_dim + \fi: + \tex_par:D + \hook_use:n{para/after} + \@kernel@after@para@after + } + { \msg_error:nnnn { hooks }{ para-mode }{end}{horizontal} } + } + } + \tex_par:D +} +\cs_set_eq:NN \par \para_end: +\cs_set_eq:NN \@@par \para_end: +\cs_set_eq:NN \endgraf \para_end: +\ExplSyntaxOff +% \end{macrocode} % % \begin{macrocode} %</kernel> diff --git a/Master/texmf-dist/source/latex-dev/graphics/graphicx.dtx b/Master/texmf-dist/source/latex-dev/graphics/graphicx.dtx index a2fc17e3936..29e0db5b12f 100644 --- a/Master/texmf-dist/source/latex-dev/graphics/graphicx.dtx +++ b/Master/texmf-dist/source/latex-dev/graphics/graphicx.dtx @@ -19,7 +19,7 @@ %<driver> \ProvidesFile{graphicx.drv} % \fi % \ProvidesFile{graphicx.dtx} - [2020/12/05 v1.2c Enhanced LaTeX Graphics (DPC,SPQR)] + [2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)] % % \iffalse %<*driver> @@ -565,6 +565,15 @@ % \end{macrocode} % \end{key} % +% \begin{key}{Gin}{alt} +% \changes{v1.2d}{2021/09/16 }{alt key gh/651} +% By default the |alt| key does nothing but may be used +% for alternative text for accessibility uses in extensions. +% \begin{macrocode} +\define@key{Gin}{alt}{} +% \end{macrocode} +% \end{key} +% % \begin{macro}{\Gin@boolkey} % Helper function for defining boolean valued functions. The order of % arguments allows |\lowercase| to only act on the user-supplied diff --git a/Master/texmf-dist/source/latex-dev/graphics/trig.dtx b/Master/texmf-dist/source/latex-dev/graphics/trig.dtx index 83e774ff20b..533f3b06482 100644 --- a/Master/texmf-dist/source/latex-dev/graphics/trig.dtx +++ b/Master/texmf-dist/source/latex-dev/graphics/trig.dtx @@ -19,7 +19,7 @@ %<driver> \ProvidesFile{trig.drv} % \fi % \ProvidesFile{trig.dtx} - [2016/01/03 v1.10 sin cos tan (DPC)] + [2021/08/11 v1.11 sin cos tan (DPC)] % % \iffalse %</!plain> @@ -86,13 +86,16 @@ %<*package> % \end{macrocode} % -% \begin{macro}{\nin@ty}\begin{macro}{\@clxx} -% \begin{macro}{\@lxxi}\begin{macro}{\@mmmmlxviii} +% \begin{macro}{\nin@ty} +% \begin{macro}{\@clxxx} +% \changes{v1.11}{2021/08/11}{180 is clxxx not clxx} +% \begin{macro}{\@lxxi} +% \begin{macro}{\@mmmmlxviii} % Some useful constants for converting between degrees and radians. % $$\frac{\pi}{180}\simeq\frac{355}{113\times180}=\frac{71}{4068}$$ % \begin{macrocode} \chardef\nin@ty=90 -\chardef\@clxx=180 +\chardef\@clxxx=180 \chardef\@lxxi=71 \mathchardef\@mmmmlxviii=4068 % \end{macrocode} @@ -217,7 +220,7 @@ % \begin{macrocode} \def\TG@reduce#1#2{% \dimen@#1#2\nin@ty\p@ - \advance\dimen@#2-\@clxx\p@ + \advance\dimen@#2-\@clxxx\p@ \dimen@-\dimen@ \TG@@sin} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex-dev/tools/array.dtx b/Master/texmf-dist/source/latex-dev/tools/array.dtx index 84376a486b3..eab451fccd0 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> [2021/04/20 v2.5e Tabular extension package (FMi)] +%<+package> [2021/07/12 v2.5f Tabular extension package (FMi)] % % \fi % @@ -2489,9 +2489,11 @@ % \begin{macro}{\endtabular*} % To end a \textsf{tabular} or \textsf{tabular$*$} environment we % call up =\endarray=, close the math mode and then the surrounding -% =\hbox=. +% =\hbox=. This math mode around the tabular should not be surrounded by +% any =\mathsurround= so we cancel that with =\m@th=. +% \changes{v2.5f}{2021/07/12}{Cancel any outside \cs{mathsurround} (gh/614)} % \begin{macrocode} -\def\endtabular{\endarray $\egroup} +\def\endtabular{\endarray\m@th $\egroup} \expandafter\let\csname endtabular*\endcsname=\endtabular % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex-dev/tools/longtable.dtx b/Master/texmf-dist/source/latex-dev/tools/longtable.dtx index 457891dac72..b66aef075eb 100644 --- a/Master/texmf-dist/source/latex-dev/tools/longtable.dtx +++ b/Master/texmf-dist/source/latex-dev/tools/longtable.dtx @@ -37,7 +37,7 @@ %<driver> \ProvidesFile{longtable.drv} % \fi % \ProvidesFile{longtable.dtx} - [2021-05-07 v4.16 Multi-page Table package (DPC)] + [2021-09-01 v4.17 Multi-page Table package (DPC)] % % \iffalse %<*driver> @@ -973,6 +973,9 @@ % \begin{macro}{\c@table} % \begin{macro}{\fnum@table} % \begin{macro}{\tablename} +% \begin{macro}{\ext@table} +% \changes{v4.17}{2021/09/01} +% {ensure \cs{ext@table} is defined gh/637} % If the "table" counter is not defined (eg in "letter" style), define % it. (Added in V3.06.) % \begin{macrocode} @@ -983,10 +986,14 @@ \ifx\tablename\undefined \def\tablename{Table} \fi +\ifx\ext@table\undefined + \def\ext@table{lot} +\fi % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\LT@out} % In a normal style, "longtable" uses the ".aux" file to record the @@ -1023,11 +1030,15 @@ % \subsection{The \env{longtable} environment} % % \begin{macro}{\longtable} +% \changes{v4.17}{2021/09/01} +% {\cs{@nobreakfalse} gh/173 \cs{ifnoskipsec} test for gh/131} % Called by "\begin{longtable}". This implementation does not work in % multiple column formats. "\par" added at V3.04. % \begin{macrocode} \def\longtable{% \par + \if@noskipsec\mbox{}\par\fi + \@nobreakfalse \ifx\multicols\@undefined \else \ifnum\col@number>\@ne diff --git a/Master/texmf-dist/source/latex-dev/tools/multicol.dtx b/Master/texmf-dist/source/latex-dev/tools/multicol.dtx index 1d16a01c158..25d4bc68db1 100644 --- a/Master/texmf-dist/source/latex-dev/tools/multicol.dtx +++ b/Master/texmf-dist/source/latex-dev/tools/multicol.dtx @@ -98,7 +98,7 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2019/12/09 v1.8y multicolumn formatting (FMi)] + [2021/07/06 v1.8z multicolumn formatting (FMi)] % % %% @@ -2281,7 +2281,7 @@ % |\@kludgeins| box will be the negation of the size by which the % page should be enlarged. If the star form of this command has % been used then we also need to shrink the resulting column. - +% % That local change will be reverted at the end of the output % routine So for the next page the original state will be % reestablished. However, in theory there is a possibility to sneak diff --git a/Master/texmf-dist/source/latex-dev/tools/varioref.dtx b/Master/texmf-dist/source/latex-dev/tools/varioref.dtx index eac06580e73..faf8b0383ce 100644 --- a/Master/texmf-dist/source/latex-dev/tools/varioref.dtx +++ b/Master/texmf-dist/source/latex-dev/tools/varioref.dtx @@ -40,7 +40,7 @@ %<package>\DeclareCurrentRelease{}{2019-10-01} %<package> %<package>\ProvidesPackage{varioref} -%<package> [2020/08/11 v1.6e package for extended references (FMi)] +%<package> [2021/07/07 v1.6f package for extended references (FMi)] % \fi % %% @@ -2413,9 +2413,11 @@ % and the page, thus defining the label this way. This means that % no label warning is generated for this label in case it is % undefined. +% \changes{v1.6f}{2021/07/07}{Use 3 additional (empty) arguments as +% default in case nameref is active} % \begin{macrocode} \def\vref@pagenum#1#2{% - \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}}}{}% + \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}{}{}{}}}{}% % \end{macrocode} % Extracting and saving the page number turned out to be a source of subtle % bugs. Initially it was done through an |\edef| with a bunch of diff --git a/Master/texmf-dist/tex/latex-dev/amsmath/amsmath.sty b/Master/texmf-dist/tex/latex-dev/amsmath/amsmath.sty index 196660228a9..0db74feb9a1 100644 --- a/Master/texmf-dist/tex/latex-dev/amsmath/amsmath.sty +++ b/Master/texmf-dist/tex/latex-dev/amsmath/amsmath.sty @@ -27,7 +27,7 @@ \providecommand\DeclareCurrentRelease[2]{} \DeclareRelease{}{2018-12-01}{amsmath-2018-12-01.sty} \DeclareCurrentRelease{}{2019-04-01} -\ProvidesPackage{amsmath}[2021/04/20 v2.17j AMS math features] +\ProvidesPackage{amsmath}[2021/08/28 v2.17k AMS math features] \edef\@temp{\catcode 96=\number\catcode 96 } \catcode\string `\`=12 \def\do#1{\catcode\number`#1=\number\catcode`#1} @@ -2901,6 +2901,7 @@ Cannot use `split' here;\MessageBreak trying to recover with `aligned'}% } \let\mathdisplay@pop\@empty \def\mathdisplay@@pop{\the\mathdisplay@stack} +\if@fleqn \renewenvironment{equation}{% \incr@eqnum \mathdisplay@push @@ -2911,6 +2912,18 @@ Cannot use `split' here;\MessageBreak trying to recover with `aligned'}% \mathdisplay@pop \ignorespacesafterend } +\else +\renewenvironment{equation}{% + \mathdisplay@push + \st@rredfalse \global\@eqnswtrue + \mathdisplay{equation}% + \incr@eqnum\mathopen{}% +}{% + \endmathdisplay{equation}% + \mathdisplay@pop + \ignorespacesafterend +} +\fi \newenvironment{equation*}{% \mathdisplay@push \st@rredtrue \global\@eqnswfalse diff --git a/Master/texmf-dist/tex/latex-dev/amsmath/amsopn.sty b/Master/texmf-dist/tex/latex-dev/amsmath/amsopn.sty index 2f6b69e7590..4e42accfa85 100644 --- a/Master/texmf-dist/tex/latex-dev/amsmath/amsopn.sty +++ b/Master/texmf-dist/tex/latex-dev/amsmath/amsopn.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [1994/12/01]% LaTeX date must December 1994 or later -\ProvidesPackage{amsopn}[2016/03/08 v2.02 operator names] +\ProvidesPackage{amsopn}[2021/08/26 v2.02 operator names] \def\nolimits@{\@ifnextchar\limits{\nolimits\@gobble}{\nolimits}} \begingroup \catcode`\"=12 \ifx\Umathcode\@undefined diff --git a/Master/texmf-dist/tex/latex-dev/amsmath/amstext.sty b/Master/texmf-dist/tex/latex-dev/amsmath/amstext.sty index 10efe0f7c7c..11c22895e71 100644 --- a/Master/texmf-dist/tex/latex-dev/amsmath/amstext.sty +++ b/Master/texmf-dist/tex/latex-dev/amsmath/amstext.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [1994/12/01]% LaTeX date must be December 1994 or later -\ProvidesPackage{amstext}[2000/06/29 v2.01 AMS text] +\ProvidesPackage{amstext}[2021/08/26 v2.01 AMS text] \RequirePackage{amsgen} \DeclareRobustCommand{\text}{% \ifmmode\expandafter\text@\else\expandafter\mbox\fi} diff --git a/Master/texmf-dist/tex/latex-dev/base/article.cls b/Master/texmf-dist/tex/latex-dev/base/article.cls index dcdec4055d7..5b41ddfbbdd 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} - [2021/02/12 v1.4n + [2021/09/11 v1.4n Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol 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 d2ef0cbd8d7..131fd98d9fd 100644 --- a/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty +++ b/Master/texmf-dist/tex/latex-dev/base/atveryend-ltx.sty @@ -42,11 +42,11 @@ %% 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.0k} -\providecommand\ltfilehookdate{2021/05/25} +\providecommand\ltfilehookversion{v1.0l} +\providecommand\ltfilehookdate{2021/08/27} \ProvidesPackage{atveryend-ltx} [2020/08/19 v1.0a - Emulation of the original atvery package^^Jwith kernel methods] + Emulation of the original atveryend package^^Jwith kernel methods] \newcommand\AfterLastShipout {\AddToHook{enddocument/afterlastpage}} \newcommand\AtVeryEndDocument {\AddToHook{enddocument/afteraux}} \newcommand\AtEndAfterFileList{\AddToHook{enddocument/info}} diff --git a/Master/texmf-dist/tex/latex-dev/base/bk10.clo b/Master/texmf-dist/tex/latex-dev/base/bk10.clo index 2c0f767465c..61467c423d7 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} - [2021/02/12 v1.4n + [2021/09/11 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 1159de85bde..4676a822495 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} - [2021/02/12 v1.4n + [2021/09/11 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 0f9c2b473a9..3363b912b39 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} - [2021/02/12 v1.4n + [2021/09/11 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 fb4d4b16a28..e073de5a533 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} - [2021/02/12 v1.4n + [2021/09/11 v1.4n Standard LaTeX document class] \newcommand\@ptsize{} \newif\if@restonecol diff --git a/Master/texmf-dist/tex/latex-dev/base/flafter.sty b/Master/texmf-dist/tex/latex-dev/base/flafter.sty index 951e5820aa6..8c0dfd4ef65 100644 --- a/Master/texmf-dist/tex/latex-dev/base/flafter.sty +++ b/Master/texmf-dist/tex/latex-dev/base/flafter.sty @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. %%% From File: ltoutput.dtx \ProvidesPackage{flafter} - [2018/11/28 v1.4d + [2021/07/31 v1.4e Standard LaTeX floats after reference (FMi)] \IncludeInRelease{2015/01/01}% {\@addtocurcol}{float order in 2-column}% diff --git a/Master/texmf-dist/tex/latex-dev/base/fltrace.sty b/Master/texmf-dist/tex/latex-dev/base/fltrace.sty index b40772e3498..6728661ef83 100644 --- a/Master/texmf-dist/tex/latex-dev/base/fltrace.sty +++ b/Master/texmf-dist/tex/latex-dev/base/fltrace.sty @@ -43,7 +43,7 @@ %% extension .ins) which are part of the distribution. %%% From File: ltoutput.dtx \ProvidesPackage{fltrace} - [2018/11/28 v1.4d + [2021/07/31 v1.4e Tracing LaTeX floats algorithm (FMi)] \def\onecolumn{% \clearpage @@ -937,6 +937,7 @@ {trace float vals}% \def \tracefloatvals{% \begingroup + \tracefloats \@dblfloatplacement \@floatplacement \fl@trace{***Float placement parameters:}% @@ -963,6 +964,7 @@ {trace float vals}% \def \tracefloatvals{% \begingroup + \tracefloats \@dblfloatplacement \@floatplacement \fl@trace{***Float placement parameters:}% diff --git a/Master/texmf-dist/tex/latex-dev/base/latex.ltx b/Master/texmf-dist/tex/latex-dev/base/latex.ltx index 1e98573d2e7..4580afeec0e 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latex.ltx +++ b/Master/texmf-dist/tex/latex-dev/base/latex.ltx @@ -512,7 +512,7 @@ \doublehyphendemerits=10000 \finalhyphendemerits=5000 \adjdemerits=10000 -\tracinglostchars=1 +\tracinglostchars=2 \ifx\directlua\@undefined % \tracingstacklevels=0 % added in 2021 \else @@ -692,7 +692,7 @@ \def\fmtname{LaTeX2e} \edef\fmtversion {2021-11-15} -\def\patch@level{-1} +\def\patch@level{-2} \edef\development@branch@name{develop \the\year-\the\month-\the\day} \iffalse \def\reserved@a#1/#2/#3\@nil{% @@ -770,6 +770,15 @@ {\@IncludeInRelease{#1}[#1]}}} \def\finish@module@release#1#2#3{% \toks@{[#1] #3}% + \begingroup + \edef\x{\detokenize\expandafter{\new@modulename}}% + \edef\y{\detokenize{#2}}% + \expandafter\endgroup + \ifx\x\y \else + \@latex@error{\noexpand\IncludeInRelease dated #1 in a module is not + allowed.\MessageBreak Use a date at least equal to \new@moduledate + \space for complete rollback}\@ehd + \fi \ifnum\expandafter\@parse@version\new@moduledate//00\@nil >\expandafter\@parse@version\fmtversion//00\@nil \GenericInfo{}{Applying: \the\toks@}% @@ -1672,8 +1681,8 @@ \xdef#1{\the\toks@}% \endgroup} %%% From File: ltcmd.dtx -\def\ltcmdversion{v1.0f} -\def\ltcmddate{2021-06-04} +\def\ltcmdversion{v1.0h} +\def\ltcmddate{2021-08-30} \message{document commands,} \ExplSyntaxOn \tl_new:N \l__cmd_arg_spec_tl @@ -1758,7 +1767,6 @@ #4 \__cmd_break_point:n {#2} } -\cs_generate_variant:Nn \__cmd_declare_cmd_internal:Nnnn { cnx } \cs_new_eq:NN \__cmd_break_point:n \use_none:n \cs_new_protected:Npn \__cmd_declare_cmd_code:Nnn { @@ -1861,15 +1869,8 @@ } \cs_new_protected:Npn \__cmd_declare_env_internal:nnnn #1#2#3#4 { - \__cmd_declare_cmd_internal:cnxn { environment~ #1 } {#2} - { - \cs_set_nopar:Npx \exp_not:c { environment~ #1 ~end~aux } - { - \exp_not:N \exp_not:N \exp_not:c { environment~ #1~end~aux~ } - \exp_not:n { \exp_not:o \l__cmd_args_tl } - } - \exp_not:n {#3} - } + \exp_args:Nc \__cmd_declare_cmd_internal:Nnnn { environment~ #1 } {#2} + {#3} { \cs_set_nopar:cpx { environment~ #1 ~end } { \exp_not:c { environment~ #1 ~end~aux } } @@ -1880,6 +1881,14 @@ \cs_set_eq:cc { end #1 } { environment~ #1 ~end } } } +\cs_new_protected:Npn \__cmd_set_environment_end:n #1 + { + \cs_set_nopar:cpx { environment~ #1 ~end~aux } + { + \exp_not:c { environment~ #1 ~end~aux~ } + \exp_not:o \l__cmd_args_tl + } + } \cs_new_protected:Npn \__cmd_start_env:nnnnn #1#2 { \conditionally@traceoff @@ -1907,7 +1916,10 @@ \tl_set:Nn \l__cmd_fn_code_tl {#2} \tl_set:Nn \l__cmd_defaults_tl {#5} \tl_set:Nn \l__cmd_process_all_tl {#6} - #4 \__cmd_run_code: + #4 + \bool_if:NT \l__cmd_environment_bool + { \exp_args:No \__cmd_set_environment_end:n \l__cmd_environment_str } + \__cmd_run_code: } \cs_generate_variant:Nn \__cmd_start_aux:NNnnnn { cc } \cs_new_protected:Npn \__cmd_run_code: @@ -2421,10 +2433,26 @@ { \__cmd_flush_m_args: \__cmd_add_default_E:nn {#1} {#2} + \use:x + { + \__cmd_replicate_processor:nn { \tl_count:n {#1} } + { \exp_not:o \l__cmd_process_one_tl } + } \__cmd_add_grabber:N E \tl_put_right:Nn \l__cmd_signature_tl { {#1} } \__cmd_prepare_signature:N } +\cs_new_protected:Npn \__cmd_replicate_processor:nn #1 #2 + { + \int_compare:nNnF {#1} > { 1 } { \use_none:nnn } + \tl_set:Nx \l__cmd_process_one_tl + { + \exp_not:n { \exp_not:n {#2} \if_false: { \fi: } } + \prg_replicate:nn { #1 - 2 } + { \exp_not:n { \exp_not:n { {#2} } } } + \exp_not:n { { \if_false: } \fi: \exp_not:n {#2} } + } + } \cs_new_protected:Npn \__cmd_add_type_m:w { \__cmd_add_default: @@ -2482,7 +2510,12 @@ \bool_set_false:N \l__cmd_long_bool \bool_set_false:N \l__cmd_obey_spaces_bool \tl_put_right:Nx \l__cmd_process_all_tl - { { \exp_not:o \l__cmd_process_one_tl } } + { + { + \if_charcode:w E #1 \use_i:nn \fi: + \exp_not:o \l__cmd_process_one_tl + } + } \tl_clear:N \l__cmd_process_one_tl } \cs_new_protected:Npn \__cmd_add_default:n #1 @@ -2624,6 +2657,319 @@ \cs_set_eq:NN #1 \__cmd_tmp:w \tl_set:Nn #2 {#1} } +\cs_new_protected:Npn \__cmd_copy:NN #1 #2 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \__cmd_cmd_type_cases:NnnnnF \exp_not:N #2 + { \__cmd_copy_command:nnNN } + { \__cmd_copy_expandable:nnNN } + { \__cmd_copy_environment:nnNN } + { \__cmd_copy_environment_end:nnNN } + { \__cmd_cant_copy:nwn { non-ltcmd } } + { \cs_to_str:N #1 } { \cs_to_str:N #2 } + \exp_not:N #1 \exp_not:N #2 + \exp_not:N \__cmd_break_point:n { \cs_to_str:N #2 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +\cs_new_protected:Npn \__cmd_set_eq_if_exist:NN #1 #2 + { \cs_if_exist:NTF #2 { \cs_set_eq:NN } { \use_none:nn } #1 #2 } +\cs_generate_variant:Nn \__cmd_set_eq_if_exist:NN { cc } +\cs_new_protected:Npn \__cmd_cant_copy:nwn #1 #2 \__cmd_break_point:n #3 + { \msg_error:nnnn { cmd } { copy-bug } {#1} {#3} } +\msg_new:nnn { cmd } { copy-bug } + { + Error~while~copying~command~\iow_char:N\\#2:\\ + \str_case:nn {#1} + { + { non-ltcmd } { Command~is~not~a~valid~ltcmd~command. } + { unknown-type } { Found~an~unknown~argument~type. } + { invalid-end } + { Target~command~is~not~named~\iow_char:N \\end<name>. } + } + } +\tl_gput_right:Nn \@declarecommandcopylisthook + { { \__kernel_cmd_if_xparse:NTF \__cmd_copy:NN } } +\cs_new_protected:Npn \__cmd_copy_command:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { #1 ~ code } { #2 ~ code } + \__cmd_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } + \cs_set_protected_nopar:Npx #3 + { \exp_after:wN \__cmd_copy_command:NnNNnnnn #4 {#1} } + } +\cs_new:Npn \__cmd_copy_command:NnNNnnnn #1 #2 #3 #4 #5 #6 #7 #8 + { + #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } \exp_not:c { #8 ~ code } + \exp_not:n { {#5} {#6} {#7} } + } +\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} + \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 + { + \exp_not:N #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } + \exp_not:c + { + #8 ~ + \str_if_eq:eeT + { \exp_not:c { #9 ~ \c_space_tl } } { \exp_not:N #4 } + { \c_space_tl } + } + \exp_not:c { #8 ~ code } + \str_if_eq:eeTF { \exp_not:N #6 } { ? } + { ? } + { \exp_not:c { #8 ~ defaults } } + { \exp_not:V \l__cmd_tmpa_tl } + } +\cs_new_protected:Npn \__cmd_copy_expandable_signature:NnNNNNnnn + #1 #2 #3 #4 #5 #6 #7 #8 #9 + { + \int_zero:N \l__cmd_current_arg_int + \tl_clear:N \l__cmd_tmpa_tl + \__cmd_copy_expandable:nnN {#8} {#9} #7 + \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \__cmd_copy_expandable:nnN #1 #2 #3 + { + \quark_if_recursion_tail_stop:n {#3} + \int_incr:N \l__cmd_current_arg_int + \exp_after:wN \__cmd_copy_parse_grabber:w \token_to_str:N #3 {#1} {#2} + } +\use:x + { + \cs_new_protected:Npn \exp_not:N \__cmd_copy_parse_grabber:w ##1 + \tl_to_str:n { expandable_grab_ } ##2 \tl_to_str:n { :w } + { + \tl_put_right:Nx \exp_not:N \l__cmd_tmpa_tl + { \exp_not:N \exp_not:c { __cmd_expandable_grab_##2:w } } + \exp_not:N \cs_if_exist_use:cF { __cmd_copy_grabber_##2:w } + { \__cmd_cant_copy:nwn { unknown-type } } + } + } +\cs_new_protected:Npn \__cmd_copy_grabber_D:w #1 #2 #3 #4 #5 + { + \tl_put_right:Nx \l__cmd_tmpa_tl + { + \exp_not:c { #1 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + \exp_not:n { #4 #5 } + } + \cs_set_eq:cc + { #1 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + { #2 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_protected:Npn \__cmd_copy_grabber_D_alt:w #1 #2 #3 #4 + { \__cmd_copy_grabber_D:w {#1} {#2} {#3} {#4} { } } +\cs_new_eq:NN \__cmd_copy_grabber_R:w \__cmd_copy_grabber_D:w +\cs_new_eq:NN \__cmd_copy_grabber_R_alt:w \__cmd_copy_grabber_D_alt:w +\cs_new_protected:Npn \__cmd_copy_grabber_E:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l__cmd_tmpa_tl { {#3} {#4} } + \int_add:Nn \l__cmd_current_arg_int { \tl_count:n {#4} - 1 } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_eq:NN \__cmd_copy_grabber_E_long:w \__cmd_copy_grabber_E:w +\cs_new_protected:Npn \__cmd_copy_grabber_t:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l__cmd_tmpa_tl { #3 #4 } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_protected:Npn \__cmd_copy_grabber_m:w { \__cmd_copy_expandable:nnN } +\cs_new_eq:NN \__cmd_copy_grabber_m_long:w \__cmd_copy_grabber_m:w +\cs_new_protected:Npn \__cmd_copy_environment:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { environment~ #1 ~ code } { environment~ #2 ~ code } + \__cmd_set_eq_if_exist:cc + { environment~ #1 ~ defaults } { environment~ #2 ~ defaults } + \cs_set_protected_nopar:cpx { environment~ #1 } + { \exp_after:wN \__cmd_copy_environment:Nnnnnnn #4 {#1} } + \cs_set_eq:cc {#1} { environment~ #1 } + } +\cs_new:Npn \__cmd_copy_environment:Nnnnnnn #1 #2 #3 #4 #5 #6 #7 + { #1 \exp_not:n { {#2} } {#7} \exp_not:n { {#4} {#5} {#6} } } +\cs_new_protected:Npn \__cmd_copy_environment_end:nnNN #1 #2 + { + \__cmd_check_end:Nn \l__cmd_tmpa_tl {#1} + \__cmd_check_end:Nn \l__cmd_tmpb_tl {#2} + \exp_args:Noo \__cmd_copy_environment_end_aux:nnNN + { \l__cmd_tmpa_tl } { \l__cmd_tmpb_tl } + } +\cs_new_protected:Npn \__cmd_copy_environment_end_aux:nnNN #1 #2 #3 #4 + { + \cs_set_nopar:cpx { environment~ #1 ~end } + { \exp_not:c { environment~ #1 ~end~aux } } + \cs_set_eq:cc + { environment~ #1 ~end~aux~ } { environment~ #2 ~end~aux~ } + \cs_set_eq:cc { end #1 } { environment~ #1 ~end } + } +\cs_new_protected:Npn \__cmd_check_end:Nn #1 #2 + { + \tl_set:Nx #1 { \__cmd_check_end:n {#2} } + \token_if_eq_meaning:NNT #1 \q_nil + { \__cmd_cant_copy:nwn { invalid-end } } + } +\cs_set_protected:Npn \__cmd_tmp:w #1 + { + \cs_new:Npn \__cmd_check_end:n ##1 + { + \exp_after:wN \__cmd_check_end:w \tl_to_str:n {##1} + #1 \q_mark #1 \q_stop + } + \cs_new:Npn \__cmd_check_end:w ##1 #1 ##2 #1 ##3 \q_stop + { \if_meaning:w ##2 \q_mark \exp_not:N \q_nil \else: ##2 \fi: } + } +\exp_args:No \__cmd_tmp:w { \tl_to_str:n { end } } +\cs_new_protected:Npn \__cmd_show:N #1 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \__cmd_cmd_type_cases:NnnnnF \exp_not:N #1 + { \__cmd_show_command:N } + { \__cmd_show_expandable:N } + { \__cmd_show_environment:N } + { \__cmd_show_environment_end:N } + { \__cmd_cant_copy:nwn { non-ltcmd } } + \exp_not:N #1 + \exp_not:N \__cmd_break_point:n { \cs_to_str:N #1 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +\cs_new_protected:Npn \__cmd_show_command:N #1 + { \exp_after:wN \__cmd_show_command:NnNNwN #1 \q__cmd #1 } +\cs_new_protected:Npn \__cmd_show_command:NnNNwN #1 #2 #3 #4 #5 \q__cmd #6 + { \__cmd_show_command_aux:nNNn { document~command } #6 #4 {#2} } +\cs_new_protected:Npn \__cmd_show_expandable:N #1 + { \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:nNNn { expandable~document~command } #8 #5 {#2} } +\cs_new_protected:Npn \__cmd_show_command_aux:nNNn #1 #2 #3 #4 + { + \__cmd_split_signature:n {#4} + \iow_term:x + { + > ~ \token_to_str:N #2 = #1: \iow_newline: + \tl_use:N \l__cmd_tmpa_tl + -> \cs_replacement_spec:N #3 . + } + } +\cs_new_protected:Npn \__cmd_show_environment:N #1 + { + \exp_after:wN \__cmd_show_environment:Nnnw #1 \q__cmd + \iow_term:x + { + > ~ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline: + -> \exp_args:Nc \cs_replacement_spec:N + { environment~ \cs_to_str:N #1 ~end~aux~ } . + } + } +\cs_new_protected:Npn \__cmd_show_environment:Nnnw #1 #2 #3 #4 \q__cmd + { + \use:x + { + \__cmd_show_command_aux:nNNn { document~environment } + { \exp_not:N \begin {#3} } + \exp_not:c { environment~ #3 ~ code } + {#2} + } + } +\cs_new_protected:Npn \__cmd_show_environment_end:N #1 + { + \exp_args:NNx \__cmd_check_end:Nn \l__cmd_tmpa_tl { \cs_to_str:N #1 } + \exp_args:Nc \__cmd_show_environment:N { \l__cmd_tmpa_tl } + } +\tl_gput_right:Nn \@showcommandlisthook + { { \__kernel_cmd_if_xparse:NTF \__cmd_show:N } } +\cs_new_protected:Npn \__cmd_split_signature:n #1 + { + \int_set:Nn \l__cmd_current_arg_int { 1 } + \tl_clear:N \l__cmd_tmpa_tl + \tl_clear:N \l__cmd_tmpb_tl + \__cmd_split_signature_loop:Nw #1 \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \__cmd_split_signature_loop:Nw #1 + { + \quark_if_recursion_tail_stop:N #1 + \tl_if_empty:NT \l__cmd_tmpb_tl { \__cmd_split_start_item: } + \tl_if_exist:cTF { c__cmd_show_type_#1_tl } + { + \use:c + { + __cmd_show_ + \if_case:w \tl_use:c { c__cmd_show_type_#1_tl } \exp_stop_f: + delim \or: delims \or: delims_opt \or: opt \or: + e \or: E \or: prefix \or: processor \fi: :Nw + } #1 + } + { \__cmd_split_end_item:n {#1} \__cmd_split_signature_loop:Nw } + } +\cs_set_protected:Npn \__cmd_tmp:w #1 #2 + { + \quark_if_nil:nF {#1} + { \tl_const:cn { c__cmd_show_type_#1_tl } {#2} \__cmd_tmp:w } + } +\__cmd_tmp:w t0 r1 d1 R2 D2 O3 e4 E5 +6 !6 >7 \q_nil \q_nil +\cs_new_protected:Npn \__cmd_show_delim:Nw #1 #2 + { \__cmd_split_end_item:n { #1 #2 } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_delims:Nw #1 #2 #3 + { \__cmd_split_end_item:n { #1 #2 #3 } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_delims_opt:Nw #1 #2 #3 #4 + { \__cmd_split_end_item:n { #1 #2 #3 {#4} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_opt:Nw #1 #2 + { \__cmd_split_end_item:n { #1 {#2} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_e:Nw #1 #2 + { + \tl_map_inline:nn {#2} + { + \__cmd_split_start_item: + \__cmd_split_end_item:n { #1 ##1 } + } + \__cmd_split_signature_loop:Nw + } +\cs_set_protected:Npn \__cmd_tmp:w #1 + { + \cs_new_protected:Npn \__cmd_show_E:Nw ##1 ##2 ##3 + { + \cs_set_protected:Npn \__cmd_tmp:w ####1 ####2 + { + \__cmd_split_start_item: + \__cmd_split_end_item:n { ##1 ####1 {####2} } + } + \__cmd_tl_mapthread_function:nnN {##2} + { ##3 {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} } \__cmd_tmp:w + \__cmd_split_signature_loop:Nw + } + } +\exp_args:NV \__cmd_tmp:w \c_novalue_tl +\cs_new_protected:Npn \__cmd_show_prefix:Nw #1 + { \__cmd_split_add_item:n {#1} \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_processor:Nw #1 #2 + { \__cmd_split_add_item:n { #1 {#2} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_split_start_item: + { + \tl_set:Nx \l__cmd_tmpb_tl + { ~ \c_space_tl \c_hash_str \int_use:N \l__cmd_current_arg_int : } + } +\cs_new_protected:Npn \__cmd_split_add_item:n #1 + { \tl_put_right:Nx \l__cmd_tmpb_tl { \tl_to_str:n {#1} } } +\cs_new_protected:Npn \__cmd_split_end_item:n #1 + { + \tl_put_right:Nx \l__cmd_tmpa_tl + { \l__cmd_tmpb_tl \tl_to_str:n {#1} \iow_newline: } + \tl_clear:N \l__cmd_tmpb_tl + \int_incr:N \l__cmd_current_arg_int + } \cs_new_protected:Npn \__cmd_grab_b:w { \__cmd_grab_b_aux:NNw \cs_set_protected_nopar:Npn \tl_trim_spaces:n } \cs_new_protected:Npn \__cmd_grab_b_long:w @@ -3473,23 +3819,40 @@ #1 {#2} {#4} \__cmd_tl_mapthread_loop:w #1#3 \q_mark } -\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 +\cs_new_protected:Npn \__cmd_cmd_type_cases:NnnnnF #1 #2 #3 #4 #5 #6 { - \exp_args:Nf \str_case_e:nnTF + \exp_args:Ne \str_case_e:nnF { \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 } { - \exp_last_unbraced:Nf \__cmd_cmd_if_xparse_aux:w - { \cs_replacement_spec:N #1 } ~ \q_stop + \token_if_macro:NT #1 + { + \exp_after:wN \exp_after:wN + \exp_after:wN \token_to_str:N + \exp_after:wN \use_i_delimit_by_q_stop:nw + #1 \scan_stop: \q_stop + } } } { - { \token_to_str:N \__cmd_start:nNNnnn } { } - { \token_to_str:N \__cmd_start_expandable:nNNNNn } { } - { \token_to_str:N \__cmd_start_env:nnnnn } { } + { \token_to_str:N \__cmd_start:nNNnnn } {#2} + { \token_to_str:N \__cmd_start_expandable:nNNNNn } {#3} + { \token_to_str:N \__cmd_start_env:nnnnn } {#4} + { + \exp_after:wN \token_to_str:N + \cs:w environment~ + \exp_last_unbraced:Ne \use_none:nnn + { \cs_to_str:N #1 } ~end~aux \cs_end: + } {#5} } + {#6} + } +\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 + { + \__cmd_cmd_type_cases:NnnnnF #1 + { } { } { } { } { \use_iii:nnn } + \use_i:nn } -\cs_new:Npn \__cmd_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1} \cs_new_protected:Npn \__cmd_peek_nonspace:NTF { \__cmd_peek_nonspace_aux:nNNTF { } \__cmd_peek_meaning:NTF } \cs_new_protected:Npn \__cmd_peek_nonspace_remove:NTF @@ -3584,6 +3947,13 @@ with~an~environment~that~already~has~a~definition. \\ \\ The~existing~definition~of~'#1'~will~not~be~altered. } +\msg_new:nnnn { cmd } { env-end-already-defined } + { End~of~environment~'#1'~already~defined. } + { + You~have~used~\NewDocumentEnvironment + with~an~environment~that~already~has~a~definition~for~'end#1'. \\ \\ + The~existing~definition~of~'#1'~will~not~be~altered. + } \msg_new:nnnn { cmd } { env-undefined } { Environment~'#1'~undefined. } { @@ -3834,7 +4204,11 @@ { \cs_if_exist:cTF {#1} { \msg_error:nnx { cmd } { env-already-defined } {#1} } - { \__cmd_declare_env:nnnn {#1} {#2} {#3} {#4} } + { + \cs_if_exist:cTF { end #1 } + { \msg_error:nnx { cmd } { env-end-already-defined } {#1} } + { \__cmd_declare_env:nnnn {#1} {#2} {#3} {#4} } + } } \cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4 { @@ -3931,9 +4305,8 @@ \ExplSyntaxOff %%% From File: lthooks.dtx -\def\lthooksversion{v1.0n} -\def\lthooksdate{2021/05/26} - +\def\lthooksversion{v1.0r} +\def\lthooksdate{2021/09/06} \ExplSyntaxOn \bool_new:N \g__hook_debug_bool \cs_new_eq:NN \__hook_debug:n \use_none:n @@ -3958,10 +4331,8 @@ \tl_new:N \l__hook_tmpa_tl \tl_new:N \l__hook_tmpb_tl \seq_new:N \g__hook_all_seq -\tl_new:N \g__hook_removal_list_tl \tl_new:N \l__hook_cur_hook_tl \prop_new:N \l__hook_work_prop -\prop_new:N \g__hook_execute_immediately_prop \prop_new:N \g__hook_used_prop \tl_new:N \g__hook_hook_curr_name_tl \seq_new:N \g__hook_name_stack_seq @@ -3970,6 +4341,7 @@ \cs_generate_variant:Nn \tl_show:n { x } \cs_generate_variant:Nn \tl_log:n { x } \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 @@ -4053,7 +4425,7 @@ } } } -\cs_new_protected:Npn \hook_disable:n #1 +\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 { @@ -4068,29 +4440,22 @@ { \prg_return_true: } { \prg_return_false: } } -\cs_new_protected:Npn \hook_provide:n #1 - { \__hook_normalize_hook_args:Nn \__hook_provide:nn {#1} { } } -\cs_new_protected:Npn \hook_provide_reversed:n #1 - { \__hook_normalize_hook_args:Nn \__hook_provide:nn {#1} { - } } -\cs_new_protected:Npn \__hook_provide:nn #1 #2 +\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 { \__hook_if_disabled:nTF {#1} - { \msg_warning:nnn { hooks } { provide-disabled } {#1} } + { \msg_warning:nnn { hooks } { activate-disabled } {#1} } { - \__hook_if_declared:nTF {#1} - { - \str_if_eq:eeF { \tl_use:c { g__hook_#1_reversed_tl } } {#2} - { \msg_error:nnn { hooks } { provide-error } {#1} } - } + \__hook_if_declared:nF {#1} { \tl_new:c { g__hook_#1_declared_tl } \__hook_make_usable:n {#1} - \tl_gset:cn { g__hook_#1_reversed_tl } {#2} + \tl_gset:cx { g__hook_#1_reversed_tl } + { \__hook_if_generic_reversed:nT {#1} { - } } } } } -\cs_new_protected:Npn \hook_provide_pair:nn #1#2 - { \hook_provide:n {#1} \hook_provide_reversed:n {#2} } \cs_new:Npn \__hook_parse_label_default:n #1 { \tl_if_novalue:nTF {#1} @@ -4129,7 +4494,7 @@ { \tl_if_empty:NTF \@currname { - \msg_expandable_error:nnn { kernel } { should-not-happen } + \msg_expandable_error:nnn { latex2e } { should-not-happen } { Empty~default~label. } \__hook_make_name:n { label-missing } } @@ -4176,30 +4541,80 @@ { \__hook_parse_label_default:n {#5} } } } +\tl_gset:Nn \g__hook_hook_curr_name_tl { top-level } +\cs_new_protected:Npn \__hook_curr_name_push:n #1 + { \exp_args:Nx \__hook_curr_name_push_aux:n { \__hook_make_name:n {#1} } } +\cs_new_protected:Npn \__hook_curr_name_push_aux:n #1 + { + \tl_if_blank:nTF {#1} + { \msg_error:nn { hooks } { no-default-label } } + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { PushDefaultHookLabel } {#1} + } + { + \seq_gpush:NV \g__hook_name_stack_seq \g__hook_hook_curr_name_tl + \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} + } + } + } +\cs_new_protected:Npn \__hook_curr_name_pop: + { + \seq_gpop:NNTF \g__hook_name_stack_seq \l__hook_return_tl + { \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl } + { \msg_error:nn { hooks } { extra-pop-label } } + } +\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage + { \__hook_end_document_label_check: } +\cs_new_protected:Npn \__hook_end_document_label_check: + { + \seq_gpop:NNT \g__hook_name_stack_seq \l__hook_return_tl + { + \msg_error:nnx { hooks } { missing-pop-label } + { \g__hook_hook_curr_name_tl } + \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl + \__hook_end_document_label_check: + } + } +\cs_new_protected:Npn \__hook_set_default_hook_label:n #1 + { + \seq_if_empty:NTF \g__hook_name_stack_seq + { + \msg_error:nnnnn { hooks } { set-top-level } + { for } { SetDefaultHookLabel } {#1} + } + { \exp_args:Nx \__hook_set_default_label:n { \__hook_make_name:n {#1} } } + } +\cs_new_protected:Npn \__hook_set_default_label:n #1 + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { SetDefaultHookLabel } {#1} + } + { \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 { - \prop_if_in:NnTF \g__hook_execute_immediately_prop {#1} + \__hook_if_execute_immediately:nTF {#1} {#3} { - \__hook_if_marked_removal:nnTF {#1} {#2} - { \__hook_unmark_removal:nn {#1} {#2} } + \__hook_if_usable:nTF {#1} { - \__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} } - } + \__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_generate_variant:Nn \__hook_gput_code:nnn { nxv } \cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 { \__hook_debug:n{\iow_term:x{****~ Add~ to~ @@ -4231,86 +4646,92 @@ } \cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 { - \__hook_try_declaring_generic_hook:nNNnn {#1} - \hook_gput_code:nnn \__hook_gput_undeclared_hook:nnn + \__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:nNNnn {#1} - \hook_gput_next_code:nn \__hook_gput_next_do:nn - } -\cs_new_protected:Npn \__hook_try_declaring_generic_hook:nNNnn #1 - { - \__hook_if_file_hook:wTF #1 / / \s__hook_mark - { - \exp_args:Ne \__hook_try_declaring_generic_hook_split:nNNnn - { \exp_args:Ne \__hook_file_hook_normalize:n {#1} } - } - { \__hook_try_declaring_generic_hook_split:nNNnn {#1} } - } -\cs_new_protected:Npn \__hook_try_declaring_generic_hook_split:nNNnn #1 #2 #3 - { \__hook_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1} - { #2 } - { #3 } {#1} + \hook_gput_next_code:nn + \__hook_gput_next_do:nn + {#1} } \prg_new_protected_conditional:Npnn \__hook_try_declaring_generic_hook:wn #1 / #2 / #3 / #4 \scan_stop: #5 { TF } { - \tl_if_empty:nTF {#2} - { \prg_return_false: } + \__hook_if_generic:nTF {#5} { - \prop_if_in:NnTF \c__hook_generics_prop {#1} + \__hook_if_usable:nF {#5} { - \__hook_if_usable:nF {#5} - { - \str_if_eq:nnT {#1} { cmd } - { \__hook_try_put_cmd_hook:n {#5} } - \__hook_make_usable:n {#5} - } - \prop_if_in:NnTF \c__hook_generics_reversed_ii_prop {#2} - { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } - { - \prop_if_in:NnT \c__hook_generics_reversed_iii_prop {#3} - { \tl_gset:cn { g__hook_#5_reversed_tl } { - } } - } - \prg_return_true: + \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: } } } +\cs_new_protected:Npn \__hook_deprecated_generic_warn:n #1 + { \__hook_deprecated_generic_warn:w #1 \s__hook_mark } +\cs_new_protected:Npn \__hook_deprecated_generic_warn:w + #1 / #2 / #3 \s__hook_mark + { + \if_cs_exist:w __hook~#1/#2/#3 \cs_end: \else: + \msg_warning:nnnnn { hooks } { generic-deprecated } {#1} {#2} {#3} + \fi: + \cs_gset_eq:cN { __hook~#1/#2/#3 } \scan_stop: + } +\cs_new_protected:Npn \__hook_do_deprecated_generic:Nn #1 #2 + { \__hook_do_deprecated_generic:Nw #1 #2 \s__hook_mark } +\cs_new_protected:Npn \__hook_do_deprecated_generic:Nw #1 + #2 / #3 / #4 \s__hook_mark + { #1 { #2 / #4 / #3 } } +\cs_new_protected:Npn \__hook_declare_deprecated_generic:NNn #1 #2 #3 + { \__hook_declare_deprecated_generic:NNw #1 #2 #3 \s__hook_mark } +\cs_new_protected:Npn \__hook_declare_deprecated_generic:NNw #1 #2 + #3 / #4 / #5 \s__hook_mark + { + \__hook_try_declaring_generic_hook:wnTF #3 / #5 / #4 / \scan_stop: + { #3 / #5 / #4 } + #1 #2 { #3 / #5 / #4 } + } \prg_new_conditional:Npnn \__hook_if_file_hook:w - #1 / #2 / #3 \s__hook_mark { TF } + #1 / #2 \s__hook_mark #3 { TF } { - \str_if_eq:nnTF {#1} { file } + \__hook_if_generic:nTF {#3} { - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {#3} } - { \str_if_eq_p:nn {#3} { / } } + \str_if_eq:nnTF {#1} { file } + { \prg_return_true: } { \prg_return_false: } - { - \prop_if_in:NnTF \c__hook_generics_file_prop {#2} - { \prg_return_true: } - { \prg_return_false: } - } } { \prg_return_false: } } -\cs_new:Npn \__hook_file_hook_normalize:n #1 - { \__hook_strip_double_slash:n {#1} } -\cs_new:Npn \__hook_strip_double_slash:n #1 - { \__hook_strip_double_slash:w #1 // \s__hook_mark } -\cs_new:Npn \__hook_strip_double_slash:w #1/#2/#3 // #4 \s__hook_mark - { - \tl_if_empty:nTF {#4} - { #1/#2/#3 } - { \__hook_strip_double_slash:w #1/#2/#3 / #4 \s__hook_mark } - } -\prop_const_from_keyval:Nn \c__hook_generics_prop - {cmd=,env=,file=,package=,class=,include=} -\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=} +\clist_map_inline:nn { cmd , env , file , package , class , include } + { + \tl_const:cn { c__hook_generic_#1/./before_tl } { + } + \tl_const:cn { c__hook_generic_#1/./after_tl } { - } + } +\tl_const:cn { c__hook_generic_env/./begin_tl } { + } +\tl_const:cn { c__hook_generic_env/./end_tl } { + } +\tl_const:cn { c__hook_generic_include/./end_tl } { - } +\clist_map_inline:nn { file , package , class , include } + { + \tl_const:cn { c__hook_deprecated_#1/./before_tl } { } + \tl_const:cn { c__hook_deprecated_#1/./after_tl } { } + } +\tl_const:cn { c__hook_deprecated_include/./end_tl } { } \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 @@ -4327,37 +4748,22 @@ \str_if_eq:nnTF {#2} { top-level } { \__hook_tl_gclear:c { __hook_toplevel~#1 } } { - \prop_get:cnNTF { g__hook_#1_code_prop } {#2} \l__hook_return_tl - { \__hook_gremove_code_do:nn } - { \__hook_mark_removal:nn } - {#1} {#2} + \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_mark_removal:nn {#1} {#2} } - } -\cs_new_protected:Npn \__hook_gremove_code_do:nn #1 #2 - { \prop_gremove:cn { g__hook_#1_code_prop } {#2} } -\cs_new_protected:Npn \__hook_mark_removal:nn #1 #2 - { - \tl_gput_right:Nx \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - } -\cs_new_protected:Npn \__hook_unmark_removal:nn #1 #2 - { - \tl_gremove_once:Nx \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - } -\prg_new_protected_conditional:Npnn \__hook_if_marked_removal:nn #1 #2 { TF } - { - \exp_args:NNx \tl_if_in:NnTF \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - { \prg_return_true: } { \prg_return_false: } + { + \__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} } + } } -\cs_new:Npn \__hook_removal_tl:nn #1 #2 - { & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ } \prop_new:c {g__hook_??_code_prop} \prop_new:c {__hook~??} \tl_new:c {g__hook_??_reversed_tl} @@ -4368,6 +4774,13 @@ } \cs_new_protected:Npn \__hook_gset_rule:nnnn #1#2#3#4 { + \__hook_if_deprecated_generic:nT {#1} + { + \__hook_deprecated_generic_warn:n {#1} + \__hook_do_deprecated_generic:Nn \__hook_gset_rule:nnnn {#1} + {#2} {#3} {#4} + \exp_after:wN \use_none:nnnnnnnnn \use_none:n + } \__hook_init_structure:n {#1} \__hook_rule_gclear:nnn {#1} {#2} {#4} \cs_if_exist_use:cTF { __hook_rule_#3_gset:nnn } @@ -4421,12 +4834,12 @@ \fi: } \cs_new:Npn \__hook_if_label_case:nnnnn #1#2 - { - \cs:w use_ - \if_case:w \__hook_str_compare:nn {#1} {#2} - i \or: ii \else: iii \fi: :nnn - \cs_end: - } + { + \cs:w use_ + \if_case:w \__hook_str_compare:nn {#1} {#2} + i \or: ii \else: iii \fi: :nnn + \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 @@ -4452,7 +4865,7 @@ \__hook_include_legacy_code_chunk:n {#1} \__hook_if_usable:nT {#1} { - \prop_if_empty:cTF {g__hook_#1_code_prop} + \prop_if_empty:cTF { g__hook_#1_code_prop } { \__hook_tl_gset:co { __hook~#1 } { @@ -4668,8 +5081,15 @@ { \__hook_log_cmd:x { >~\@spaces #1 } } \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~'#1': } + \__hook_log_cmd:x + { ^^J ->~The~ \__hook_if_generic:nT {#1} { generic~ } hook~'#1': } \__hook_if_usable:nF {#1} { \__hook_log_line:x { The~hook~is~not~declared. } } \__hook_if_disabled:nT {#1} @@ -4804,8 +5224,7 @@ \__hook_if_disabled:nTF {#1} { \msg_error:nnn { hooks } { hook-disabled } {#1} } { - \__hook_init_structure:n {#1} - \__hook_if_usable:nTF {#1} + \__hook_if_structure_exist:nTF {#1} { \__hook_gput_next_do:nn {#1} {#2} } { \__hook_try_declaring_generic_next_hook:nn {#1} {#2} } } @@ -4823,68 +5242,60 @@ { \__hook_tl_gset:Nn #1 { \__hook_clear_next:n {#2} } } \__hook_tl_gput_right:Nn #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 } \cs_new_protected:Npn \hook_use:n #1 { - \tl_if_exist:cTF { __hook~#1 } + \tl_if_exist:cT { __hook~#1 } { \__hook_preamble_hook:n {#1} \cs:w __hook~#1 \cs_end: } - { \__hook_use:wn #1 / \s__hook_mark {#1} } } \cs_new:Npn \__hook_use_initialized:n #1 { \if_cs_exist:w __hook~#1 \cs_end: - \else: - \__hook_use_undefined:w + \cs:w __hook~#1 \exp_after:wN \cs_end: \fi: - \cs:w __hook~#1 \__hook_use_end: - } -\cs_new:Npn \__hook_use_undefined:w #1 #2 __hook~#3 \__hook_use_end: - { - #1 % fi - \__hook_use:wn #3 / \s__hook_mark {#3} } \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:wn #1 / #2 \s__hook_mark #3 +\cs_new_protected:Npn \hook_use_once:n #1 { - \str_if_eq:nnTF {#1} { file } - { \__hook_try_file_hook:n {#3} } - { } % Hook doesn't exist + \__hook_if_execute_immediately:nF {#1} + { \__hook_normalize_hook_args:Nn \__hook_use_once:n { \use:n {#1} } } } -\cs_new_protected:Npn \__hook_try_file_hook:n #1 +\cs_new_protected:Npn \__hook_use_once:n #1 { - \__hook_if_file_hook:wTF #1 / / \s__hook_mark - { - \exp_args:Ne \__hook_if_usable_use:n - { \exp_args:Ne \__hook_file_hook_normalize:n {#1} } - } - { \__hook_if_usable_use:n {#1} } % file/ generic hook (e.g. file/before) + \__hook_preamble_hook:n {#1} + \__hook_use_once_set:n {#1} + \__hook_use_initialized:n {#1} + \__hook_use_once_clear:n {#1} } -\cs_new_protected:Npn \__hook_if_usable_use:n #1 +\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 { - \tl_if_exist:cT { __hook~#1 } - { - \__hook_preamble_hook:n {#1} - \cs:w __hook~#1 \cs_end: - } + \__hook_tl_gclear:c { __hook~#1 } + \__hook_tl_gclear:c { __hook_next~#1 } + \__hook_tl_gclear:c { __hook_toplevel~#1 } + \prop_gclear:c { g__hook_#1_code_prop } } -\cs_new_protected:Npn \hook_use_once:n #1 +\prg_new_conditional:Npnn \__hook_if_execute_immediately:n #1 { F, TF } { - \tl_if_exist:cT { __hook~#1 } + \__hook_if_usable:nTF {#1} { - \tl_set:Nn \l__hook_return_tl {#1} - \__hook_normalize_hook_args:Nn \__hook_use_once_store:n - { \l__hook_return_tl } - \hook_use:n {#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: + \fi: } + { \prg_return_false: } } -\cs_new_protected:Npn \__hook_use_once_store:n #1 - { \prop_gput:Nnn \g__hook_execute_immediately_prop {#1} { } } \prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } { @@ -4922,14 +5333,46 @@ } \prg_new_conditional:Npnn \__hook_if_reversed:n #1 { p , T , F , TF } { - \if_int_compare:w \cs:w g__hook_#1_reversed_tl \cs_end: 1 < 0 \exp_stop_f: + \exp_after:wN \__hook_clean_to_scan:w + \if:w - \cs:w g__hook_#1_reversed_tl \cs_end: + \s__hook_mark \prg_return_true: + \else: + \s__hook_mark \prg_return_false: + \fi: + } +\prg_new_conditional:Npnn \__hook_if_generic:n #1 { T, TF } + { \__hook_if_generic:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_generic:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist:cTF { c__hook_generic_#1/./#3_tl } + { \prg_return_true: } + { \prg_return_false: } + } +\prg_new_conditional:Npnn \__hook_if_deprecated_generic:n #1 { T, TF } + { \__hook_if_deprecated_generic:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_deprecated_generic:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist:cTF { c__hook_deprecated_#1/./#2_tl } + { + \tl_if_empty:nTF {#3} + { \prg_return_false: } + { \prg_return_true: } + } + { \prg_return_false: } + } +\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: + { + \if_charcode:w - \cs:w c__hook_generic_#1/./#3_tl \cs_end: \prg_return_true: \else: \prg_return_false: \fi: } \prop_gput:Nnn \g_msg_module_type_prop { hooks } { LaTeX } -\prop_gput:Nnn \g_msg_module_type_prop { kernel } { LaTeX } +\prop_gput:Nnn \g_msg_module_type_prop { latex2e } { LaTeX } +\prop_gput:Nnn \g_msg_module_name_prop { latex2e } { kernel } \msg_new:nnnn { hooks } { labels-incompatible } { Labels~'#1'~and~'#2'~are~incompatible @@ -4949,7 +5392,7 @@ { Cannot~add~code~to~disabled~hook~'#1'. } { The~hook~'#1'~you~tried~to~add~code~to~was~previously~disabled~ - with~\iow_char:N\\hook_disable:n~or~\iow_char:N\\DisableHook,~so~ + with~\iow_char:N\\hook_disable_generic:n~or~\iow_char:N\\DisableGenericHook,~so~ it~cannot~have~code~added~to~it. } \msg_new:nnn { hooks } { empty-label } @@ -4966,7 +5409,7 @@ { Unknown~ relationship~ '#3'~ between~ labels~ '#2'~ and~ '#4'~ \str_if_eq:nnF {#1} {??} { ~in~hook~'#1' }. ~ - Perhaps~ a~ missspelling? + Perhaps~ a~ misspelling? } { The~ relation~ used~ not~ known~ to~ the~ system.~ Allowed~ values~ are~ @@ -5004,95 +5447,42 @@ Missing~\iow_char:N \\PopDefaultHookLabel. \\ The~label~'#1'~was~pushed~but~never~popped.~Something~is~wrong. } -\msg_new:nnn { kernel } { should-not-happen } +\msg_new:nnn { latex2e } { should-not-happen } { This~should~not~happen.~#1 \\ Please~report~at~https://github.com/latex3/latex2e. } -\msg_new:nnn { hooks } { provide-disabled } +\msg_new:nnn { hooks } { activate-disabled } { - Cannot~ provide~ hook~ '#1'~ because~ it~ is~ disabled! + Cannot~ activate~ hook~ '#1'~ because~ it~ is~ disabled! } -\msg_new:nnnn { hooks } { provide-error } +\msg_new:nnn { hooks } { cannot-remove } { - Hook~'#1'~ already~ declared~ as~ a~ - \__hook_if_reversed:nTF {#1} { reversed } { normal }~ hook! + Cannot~remove~chunk~'#2'~from~hook~'#1'~because~ + \__hook_if_structure_exist:nTF {#1} + { it~does~not~exist~in~that~hook. } + { the~hook~does~not~exist. } } +\msg_new:nnn { hooks } { generic-deprecated } { - You~ attempted~ to~ provide~ the~ hook~'#1'~ as~ a~ - \__hook_if_reversed:nTF {#1} { normal } { reversed }~ hook,~ but~ it~ - was~ already~ previously~ declared~ as~ a~ - \__hook_if_reversed:nTF {#1} { reversed } { normal }~ hook.~ - A~ redeclaration~ is~ not~ possible. + 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 \ProvideHook { m }{ \hook_provide:n {#1} } -\NewDocumentCommand \ProvideReversedHook { m }{ \hook_provide_reversed:n {#1} } -\NewDocumentCommand \ProvideMirroredHookPair { mm }{ \hook_provide_pair:nn {#1}{#2} } -\NewDocumentCommand \DisableHook { m }{ \hook_disable:n {#1} } +\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 \AddToHookNext { m +m } { \hook_gput_next_code:nn {#1} {#2} } +\NewDocumentCommand \ClearHookNext { m } + { \hook_gclear_next_code:n {#1} } \NewDocumentCommand \RemoveFromHook { m o } { \hook_gremove_code:nn {#1} {#2} } -\tl_gset:Nn \g__hook_hook_curr_name_tl { top-level } -\cs_new_protected:Npn \__hook_curr_name_push:n #1 - { \exp_args:Nx \__hook_curr_name_push_aux:n { \__hook_make_name:n {#1} } } -\cs_new_protected:Npn \__hook_curr_name_push_aux:n #1 - { - \tl_if_blank:nTF {#1} - { \msg_error:nn { hooks } { no-default-label } } - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { PushDefaultHookLabel } {#1} - } - { - \seq_gpush:NV \g__hook_name_stack_seq \g__hook_hook_curr_name_tl - \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} - } - } - } -\cs_new_protected:Npn \__hook_curr_name_pop: - { - \seq_gpop:NNTF \g__hook_name_stack_seq \l__hook_return_tl - { \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl } - { \msg_error:nn { hooks } { extra-pop-label } } - } -\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage - { \__hook_end_document_label_check: } -\cs_new_protected:Npn \__hook_end_document_label_check: - { - \seq_gpop:NNT \g__hook_name_stack_seq \l__hook_return_tl - { - \msg_error:nnx { hooks } { missing-pop-label } - { \g__hook_hook_curr_name_tl } - \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl - \__hook_end_document_label_check: - } - } \NewDocumentCommand \SetDefaultHookLabel { m } - { - \seq_if_empty:NTF \g__hook_name_stack_seq - { - \msg_error:nnnnn { hooks } { set-top-level } - { for } { SetDefaultHookLabel } {#1} - } - { \exp_args:Nx \__hook_set_default_label:n { \__hook_make_name:n {#1} } } - } -\cs_new_protected:Npn \__hook_set_default_label:n #1 - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { SetDefaultHookLabel } {#1} - } - { \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} } - } + { \__hook_set_default_hook_label:n {#1} } \NewDocumentCommand \PushDefaultHookLabel { m } { \__hook_curr_name_push:n {#1} } \NewDocumentCommand \PopDefaultHookLabel { } @@ -5119,6 +5509,75 @@ \cs_new_eq:NN \IfHookEmptyTF \hook_if_empty:nTF \cs_new_eq:NN \IfHookExistsTF \__hook_if_usable:nTF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\cs_new_protected:Npn \hook_disable:n + { + \__hook_deprecated_warn:nn + { hook_disable:n } + { hook_disable_generic:n } + \hook_disable_generic:n + } +\cs_new_protected:Npn \hook_provide:n + { + \__hook_deprecated_warn:nn + { hook_provide:n } + { hook_activate_generic:n } + \hook_activate_generic:n + } +\cs_new_protected:Npn \hook_provide_reversed:n + { + \__hook_deprecated_warn:nn + { hook_provide_reversed:n } + { hook_activate_generic:n } + \__hook_activate_generic_reversed:n + } +\cs_new_protected:Npn \hook_provide_pair:nn + { + \__hook_deprecated_warn:nn + { hook_provide_pair:nn } + { hook_activate_generic:n } + \__hook_activate_generic_pair:nn + } +\cs_new_protected:Npn \__hook_activate_generic_reversed:n #1 + { \__hook_normalize_hook_args:Nn \__hook_activate_generic:nn {#1} { - } } +\cs_new_protected:Npn \__hook_activate_generic_pair:nn #1#2 + { \hook_activate_generic:n {#1} \__hook_activate_generic_reversed:n {#2} } +\cs_new_protected:Npn \DisableHook + { + \__hook_deprecated_warn:nn + { DisableHook } + { DisableGenericHook } + \hook_disable_generic:n + } +\cs_new_protected:Npn \ProvideHook + { + \__hook_deprecated_warn:nn + { ProvideHook } + { ActivateGenericHook } + \hook_activate_generic:n + } +\cs_new_protected:Npn \ProvideReversedHook + { + \__hook_deprecated_warn:nn + { ProvideReversedHook } + { ActivateGenericHook } + \__hook_activate_generic_reversed:n + } +\cs_new_protected:Npn \ProvideMirroredHookPair + { + \__hook_deprecated_warn:nn + { ProvideMirroredHookPair } + { ActivateGenericHook } + \__hook_activate_generic_pair:nn + } +\cs_new_protected:Npn \__hook_deprecated_warn:nn #1 #2 + { \msg_warning:nnnn { hooks } { deprecated } {#1} {#2} } +\msg_new:nnn { hooks } { deprecated } + { + Command~\iow_char:N\\#1~is~deprecated~and~will~be~removed~in~a~ + future~release. \\ \\ + Use~\iow_char:N\\#2~instead. + } +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \cs_new_eq:NN \@expl@@@initialize@all@@ \__hook_initialize_all: \cs_new_eq:NN \@expl@@@hook@curr@name@pop@@ @@ -5128,8 +5587,8 @@ %% File: ltcmdhooks.dtx (C) Copyright 2020-2021 %% Frank Mittelbach, Phelype Oleinik, LaTeX Team %%% From File: ltcmdhooks.dtx -\def\ltcmdhooksversion{v1.0b} -\def\ltcmdhooksdate{2021/05/26} +\def\ltcmdhooksversion{v1.0d} +\def\ltcmdhooksdate{2021/08/25} \ExplSyntaxOn \tl_new:N \g_hook_patch_action_list_tl \int_new:N \l__hook_patch_num_args_int @@ -5146,10 +5605,7 @@ #1 / #2 / #3 / #4 \s__hook_mark #5 { \__hook_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } } - \str_case:nnTF {#3} - { { before } { } { after } { } } - { \exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } - { \msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} } + \exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } \cs_new_protected:Npn \__hook_patch_cmd_or_delay:Nnn #1 #2 #3 { @@ -5237,10 +5693,17 @@ } \cs_new_protected:Npn \__hook_patch_DeclareRobustCommand:Nnn #1 { - \exp_args:Nc \@if@newcommand { \cs_to_str:N #1 ~ } - { \exp_args:Nc \__hook_patch_newcommand:Nnn } - { \exp_args:NNc \__hook_patch_expand_redefine:NNnn \c_false_bool } - { \cs_to_str:N #1 ~ } + \exp_args:Nc \__hook_patch_DeclareRobustCommand_aux:Nnn + { \cs_to_str:N #1 ~ } + } +\cs_new_protected:Npn \__hook_patch_DeclareRobustCommand_aux:Nnn #1 + { + \robust@command@chk@safe #1 + { \@if@newcommand #1 } + { \use_ii:nn } + { \__hook_patch_newcommand:Nnn } + { \__hook_patch_expand_redefine:NNnn \c_false_bool } + #1 } \cs_new_protected:Npn \__hook_patch_newcommand:Nnn #1 { @@ -5408,14 +5871,6 @@ \tl_rescan:nV { #4 \__hook_patch_required_catcodes: } \l__hook_tmpa_tl \cs_set_eq:NN #1 \kerneltmpDoNotUse } -\msg_new:nnnn { hooks } { wrong-cmd-hook } - { - Generic~hook~`cmd/#1/#2'~is~invalid. - } - { - You~tried~to~add~a~generic~hook~to~command~\iow_char:N \\#1,~but~`#2'~ - is~an~invalid~component.~Only~`before'~or~`after'~are~allowed. - } \msg_new:nnnn { hooks } { cant-patch } { Generic~hooks~cannot~be~added~to~'#1'. @@ -5616,6 +6071,22 @@ Type H <return> for immediate help.}% Class #1 Info: #2% }% } +\def\ClassNote#1#2{% + \GenericWarning{% + (#1) \space\space\@spaces\@spaces + }{% + Class #1 Info: #2% + }% +} +\def\ClassNoteNoLine#1#2{\ClassNote{#1}{#2\@gobble}} +\def\PackageNote#1#2{% + \GenericWarning{% + (#1) \@spaces\@spaces\@spaces + }{% + Package #1 Info: #2% + }% +} +\def\PackageNoteNoLine#1#2{\PackageNote{#1}{#2\@gobble}} \gdef\@latex@error#1#2{% \GenericError{% \space\space\space\@spaces\@spaces\@spaces @@ -5688,8 +6159,9 @@ Type H <return> for immediate help.}% \gdef\@nodocument{% \@latex@error{Missing \protect\begin{document}}\@ehd} \gdef\@badend#1{% - \@latex@error{\protect\begin{\@currenvir}\@currenvline - \space ended by \protect\end{#1}}\@eha} + \@latex@error{\protect\begin + {\detokenize\expandafter{\@currenvir}}\@currenvline + \space ended by \protect\end{\detokenize{#1}}}\@eha} \gdef\@badmath{% \@latex@error{Bad math environment delimiter}\@eha} \gdef\@toodeep{% @@ -5736,8 +6208,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.0g} -\def\ltparadate{2021/05/27} +\def\ltparaversion{v1.0j} +\def\ltparadate{2021/09/18} \ExplSyntaxOn @@ -5788,14 +6260,15 @@ Type H <return> for immediate help.}% \cs_set_eq:NN \IndentBox \g_para_indent_box \cs_set_eq:NN \OmitIndent \para_omit_indent: \cs_new_protected:Npn \para_end: { + \scan_stop: \mode_if_horizontal:TF { \mode_if_inner:F { \tex_unskip:D \hook_use:n{para/end} \@kernel@after@para@end \mode_if_horizontal:TF { - \if_int_compare:w 0 < \tex_lastnodetype:D - \tex_kern:D \c_zero_dim + \if_int_compare:w 11 = \tex_lastnodetype:D + \tex_hskip:D \c_zero_dim \fi: \tex_par:D \hook_use:n{para/after} @@ -5815,7 +6288,7 @@ Type H <return> for immediate help.}% \__para_handle_indent: \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_indent:D } \cs_new:Npn \para_raw_noindent: { @@ -5825,7 +6298,7 @@ Type H <return> for immediate help.}% \tex_everypar:D { \g__para_standard_everypar_tl } \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_noindent:D } \cs_new_eq:NN \para_raw_end: \tex_par:D @@ -5847,7 +6320,7 @@ Type H <return> for immediate help.}% in~ #2~ mode,~ but~ it~ didn't.~ Examine~ the~ hook~ code~ with~ \iow_char:N \\ShowHook~ to~ find~ the~ issue. } -\msg_new:nnnn { kernel } { raw-para } +\msg_new:nnnn { latex2e } { raw-para } { Not~ in~ vertical~ mode. } @@ -6255,12 +6728,12 @@ Type H <return> for immediate help.}% \fi \@filehook@set@CurrentFile \UseHook{include/before}% - \UseHook{include/before/#1}% + \UseOneTimeHook{include/#1/before}% \@input@{#1.tex}% - \UseHook{include/end/#1}% + \UseOneTimeHook{include/#1/end}% \UseHook{include/end}% \clearpage - \UseHook{include/after/#1}% + \UseOneTimeHook{include/#1/after}% \UseHook{include/after}% \clearpage \@writeckpt{#1}% @@ -6272,6 +6745,9 @@ Type H <return> for immediate help.}% \@nameuse{cp@#1}% \fi \let\@auxout\@mainaux} +\NewHook{include/before} +\NewReversedHook{include/end} +\NewReversedHook{include/after} \def\@writeckpt#1{% \if@filesw \immediate\write\@partaux{\string\@setckpt{#1}\@charlb}% @@ -6733,30 +7209,24 @@ Type H <return> for immediate help.}% \@ifundefined{c@#2}{\@nocounterr{#2}}% {% else both counter and within are defined #3}}} - -\def\counterwithout {\@ifstar\counterwithout@s\counterwithout@x} -\def\counterwithout@s#1#2{% - \@ifbothcounters{#1}{#2}{\@removefromreset{#1}{#2}}} -\def\counterwithout@x#1#2{% - \@ifbothcounters{#1}{#2}% - {\@removefromreset{#1}{#2}% - \expandafter - \gdef\csname the#1\expandafter\endcsname\expandafter - {\expandafter - \@arabic\csname c@#1\endcsname}}} - -\def\counterwithin{\@ifstar\counterwithin@s\counterwithin@x} -\def\counterwithin@s#1#2{% - \@ifbothcounters{#1}{#2}{\@addtoreset{#1}{#2}}} -\def\counterwithin@x#1#2{% - \@ifbothcounters{#1}{#2}% - {\@addtoreset{#1}{#2}% - \expandafter - \gdef\csname the#1\expandafter\endcsname\expandafter - {\csname the#2\expandafter\endcsname\expandafter - .\expandafter - \@arabic\csname c@#1\endcsname}}} - +\NewDocumentCommand \counterwithout {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@removefromreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\endcsname {#2{#3}}}% + }% +} +\NewDocumentCommand \counterwithin {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@addtoreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\expandafter\endcsname + \expandafter + {\csname the#4\endcsname .#2{#3}}}% + }% +} \def\arabic#1{\expandafter\@arabic\csname c@#1\endcsname} \def\roman#1{\expandafter\@roman\csname c@#1\endcsname} \def\Roman#1{\expandafter\@Roman\csname c@#1\endcsname} @@ -9128,6 +9598,9 @@ Type H <return> for immediate help.}% \fontshape\itdefault\selectfont} \let\DeclareFontSeriesDefault\@undefined % for rollback \newcommand\DeclareFontSeriesDefault[3][]{% + \expand@font@defaults + \maybe@update@bfseries@defaults + \maybe@update@mdseries@defaults \def\reserved@a{#1}% \ifx\reserved@a\@empty \ifcsname #2series\endcsname % supported are @@ -9155,6 +9628,8 @@ Type H <return> for immediate help.}% \fi } + + \def\bfseries@rm{bx} \def\bfseries@sf{bx} \def\bfseries@tt{bx} @@ -9235,18 +9710,20 @@ Type H <return> for immediate help.}% }% \expandafter\let\csname ver@mweights.sty\endcsname\fmtversion -\def\expand@font@defaults{% - \edef\rmdef@ult{\rmdefault}% - \edef\sfdef@ult{\sfdefault}% - \edef\ttdef@ult{\ttdefault}% - \series@maybe@drop@one@m\bfdefault\bfdef@ult - \series@maybe@drop@one@m\mddefault\mddef@ult - \UseHook{expand@font@defaults}% -} - \DeclareRobustCommand\bfseries{% \not@math@alphabet\bfseries\mathbf \expand@font@defaults + \maybe@update@bfseries@defaults + \ifx\f@family\rmdef@ult \fontseries\bfseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt + \else \fontseries\bfdefault + \fi\fi\fi + \UseHook{bfseries}% + \selectfont +} + +\def\maybe@update@bfseries@defaults{% \ifx\bfdefault\bfdefault@previous\else \expandafter\def\expandafter\bfdefault \expandafter{\bfdefault\@empty}% @@ -9256,18 +9733,22 @@ Type H <return> for immediate help.}% \let\bfseries@tt\bfdef@ult \UseHook{bfseries/defaults}% \fi - \ifx\f@family\rmdef@ult \fontseries\bfseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt - \else \fontseries\bfdefault - \fi\fi\fi - \UseHook{bfseries}% - \selectfont } \DeclareRobustCommand\mdseries{% \not@math@alphabet\mdseries\relax \expand@font@defaults + \maybe@update@mdseries@defaults + \ifx\f@family\rmdef@ult \fontseries\mdseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt + \else \fontseries\mddefault + \fi\fi\fi + \UseHook{mdseries}% + \selectfont +} + +\def\maybe@update@mdseries@defaults{% \ifx\mddefault\mddefault@previous\else \expandafter\def\expandafter\mddefault\expandafter{\mddefault\@empty}% \let\mddefault@previous\mddefault @@ -9276,13 +9757,17 @@ Type H <return> for immediate help.}% \let\mdseries@tt\mddef@ult \UseHook{mdseries/defaults}% \fi - \ifx\f@family\rmdef@ult \fontseries\mdseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt - \else \fontseries\mddefault - \fi\fi\fi - \UseHook{mdseries}% - \selectfont +} + + + +\def\expand@font@defaults{% + \edef\rmdef@ult{\rmdefault}% + \edef\sfdef@ult{\sfdefault}% + \edef\ttdef@ult{\ttdefault}% + \series@maybe@drop@one@m\bfdefault\bfdef@ult + \series@maybe@drop@one@m\mddefault\mddef@ult + \UseHook{expand@font@defaults}% } \DeclareRobustCommand\rmfamily{% @@ -9513,7 +9998,7 @@ Type H <return> for immediate help.}% \let \check@icl \@empty \let \check@icr \@empty \def \text@command #1{% - \def \reserved@a {#1}% + \edef \reserved@a {\unexpanded{#1}}% \ifx \reserved@a \@empty \let \check@icl \@empty \let \check@icr \@empty @@ -12291,7 +12776,9 @@ Type H <return> for immediate help.}% \protected@write\@auxout {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% {\string\@writefile{#1}{#2}}} -\def\contentsline#1{\csname l@#1\endcsname} +\def\contentsline#1#2#3#4{\gdef\@contentsline@destination{#4}% + \csname l@#1\endcsname{#2}{#3}} +\let\@contentsline@destination\@empty \def\@dottedtocline#1#2#3#4#5{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ @@ -12776,6 +13263,7 @@ Type H <return> for immediate help.}% \vfuzz\hfuzz} \overfullrule 0pt %%% From File: ltclass.dtx + \newif\if@compatibility \def\@documentclasshook{% \ifx\@normalsize\@undefined @@ -12784,18 +13272,14 @@ Type H <return> for immediate help.}% } \let\@declaredoptions\@empty \let\@classoptionslist\relax -\@onlypreamble\@classoptionslist \let\@raw@classoptionslist\relax \let\@unusedoptionlist\@empty -\@onlypreamble\@unusedoptionlist \let\CurrentOption\@empty \let\@currpath\@empty \let\@currname\@empty \global\let\@currext=\@empty \def\@clsextension{cls} \def\@pkgextension{sty} -\@onlypreamble\@clsextension -\@onlypreamble\@pkgextension \def\@pushfilename{% \@expl@push@filename@@ \xdef\@currnamestack{% @@ -12828,32 +13312,22 @@ Type H <return> for immediate help.}% \xdef\@kernel@currpathstack{#1}} \def\@ptionlist#1{% \@ifundefined{opt@#1}\@empty{\csname opt@#1\endcsname}} -\@onlypreamble\@ptionlist \def\@ifpackageloaded{\@ifl@aded\@pkgextension} \def\@ifclassloaded{\@ifl@aded\@clsextension} -\@onlypreamble\@ifpackageloaded -\@onlypreamble\@ifclassloaded \def\@ifl@aded#1#2{% \expandafter\ifx\csname ver@#2.#1\endcsname\relax \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi} -\@onlypreamble\@ifl@aded \def\@ifpackagelater{\@ifl@ter\@pkgextension} \def\@ifclasslater{\@ifl@ter\@clsextension} -\@onlypreamble\@ifpackagelater -\@onlypreamble\@ifclasslater \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater -\@onlypreamble\IfFormatAtLeastTF -\@onlypreamble\IfPackageAtLeastTF -\@onlypreamble\IfClassAtLeastTF \def\@ifl@ter#1#2{% \expandafter\@ifl@t@r \csname ver@#2.#1\endcsname} -\@onlypreamble\@ifl@ter \def\@ifl@t@r#1#2{% \ifnum\expandafter\@parse@version@#1//00\@nil<% \expandafter\@parse@version@#2//00\@nil @@ -12862,7 +13336,6 @@ Type H <return> for immediate help.}% \expandafter\@firstoftwo \fi} \def\@parse@version@#1{\@parse@version0#1} -\@onlypreamble\@ifl@t@r \def\@parse@version#1/#2/#3#4#5\@nil{% \@parse@version@dash#1-#2-#3#4\@nil } @@ -12870,11 +13343,8 @@ Type H <return> for immediate help.}% \if\relax#2\relax\else#1\fi#2#3#4 } \def\@ifpackagewith{\@if@ptions\@pkgextension} \def\@ifclasswith{\@if@ptions\@clsextension} -\@onlypreamble\@ifpackagewith -\@onlypreamble\@ifclasswith \def\@if@ptions#1#2{% \@expandtwoargs\@if@pti@ns{\@ptionlist{#2.#1}}} -\@onlypreamble\@if@ptions \def\@if@pti@ns#1#2{% \let\reserved@a\@firstoftwo \edef\reserved@b{\zap@space#2 \@empty}% @@ -12889,7 +13359,10 @@ Type H <return> for immediate help.}% \fi }% \reserved@a} -\@onlypreamble\@if@pti@ns +\let \IfPackageLoadedTF \@ifpackageloaded +\let \IfClassLoadedTF \@ifclassloaded +\let \IfPackageLoadedWithOptionsTF \@ifpackagewith +\let \IfClassLoadedWithOptionsTF \@ifclasswith \def\ProvidesPackage#1{% \xdef\@gtempa{#1}% \@expandtwoargs\@expl@str@if@eq@@nnTF @@ -13134,7 +13607,7 @@ Type H <return> for immediate help.}% \def\reserved@b##1,{% \ifx\@nnil##1\relax\else \ifx\@nnil##1\@nnil\else - \noexpand\@onefilewithoptions##1[{#2}][{#4}]% + \noexpand\@onefilewithoptions##1[{\unexpanded{#2}}][{#4}]% \noexpand\@pkgextension \fi \expandafter\reserved@b @@ -13234,11 +13707,11 @@ Type H <return> for immediate help.}% \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty \ifx\@currext\@pkgextension \UseHook{package/before}% - \UseHook{package/before/\@currname}% + \UseOneTimeHook{package/\@currname/before}% \else \ifx\@currext\@clsextension \UseHook{class/before}% - \UseHook{class/before/\@currname}% + \UseOneTimeHook{class/\@currname/before}% \fi \fi \InputIfFileExists{\@currpath\@currpkg@reqd}{}% @@ -13258,15 +13731,19 @@ Type H <return> for immediate help.}% \csname unprocessedoptions-\@currname.\@currext\endcsname \@undefined \ifx\@currext\@pkgextension - \UseHook{package/after/\@currname}% + \UseOneTimeHook{package/\@currname/after}% \UseHook{package/after}% \else \ifx\@currext\@clsextension - \UseHook{class/after/\@currname}% + \UseOneTimeHook{class/\@currname/after}% \UseHook{class/after}% \fi \fi}% \@ifl@aded\@currext\@currname{}{\reserved@a}} +\NewHook{package/before} +\NewHook{class/before} +\NewReversedHook{package/after} +\NewReversedHook{class/after} \let\@@fileswith@pti@ns\@fileswith@pti@ns \@onlypreamble\@@fileswith@pti@ns \def\@reset@ptions{% @@ -13664,8 +14141,8 @@ Type H <return> for immediate help.}% \fi } %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0k} -\providecommand\ltfilehookdate{2021/05/25} +\providecommand\ltfilehookversion{v1.0l} +\providecommand\ltfilehookdate{2021/08/27} \ExplSyntaxOn \tl_new:N \CurrentFile \tl_new:N \CurrentFilePath @@ -13718,7 +14195,7 @@ Type H <return> for immediate help.}% \seq_gpop:NNTF \g__filehook_input_file_seq \l__filehook_internal_tl { \exp_after:wN \__filehook_file_pop_assign:nnnn \l__filehook_internal_tl } { - \msg_error:nnn { kernel } { should-not-happen } + \msg_error:nnn { latex2e } { should-not-happen } { Tried~to~pop~from~an~empty~file~name~stack. } } } @@ -13754,12 +14231,14 @@ Type H <return> for immediate help.}% {\edef\reserved@a{\unqu@tefilef@und#1\@nil}% \@addtofilelist{\string@makeletter\reserved@a}% \UseHook{file/before}% - \UseHook{file/before/\CurrentFile}% + \UseHook{file/\CurrentFile/before}% \@@input #1% <- trailing space comes from \@filef@und }% - \UseHook{file/after/\CurrentFile}% + \UseHook{file/\CurrentFile/after}% \UseHook{file/after}} \def\unqu@tefilef@und"#1" \@nil{#1} +\NewHook{file/before} +\NewReversedHook{file/after} \ExplSyntaxOn \cs_new_protected:Npn \__filehook_subst_add:nn #1 #2 { @@ -13896,13 +14375,13 @@ Type H <return> for immediate help.}% \cs_generate_variant:Nn \__filehook_file_subst_loop:NN { cc } \cs_new:Npn \__filehook_file_subst_cycle_error:NN #1 #2 { - \__kernel_msg_expandable_error:nnff { kernel } { file-cycle } + \msg_expandable_error:nnff { latex2e } { file-cycle } {#1} { \use:c { @file-subst@ #1 } } \token_if_eq_meaning:NNF #1 #2 { \__filehook_file_subst_cycle_error:cN { @file-subst@ #1 } #2 } } \cs_generate_variant:Nn \__filehook_file_subst_cycle_error:NN { c } -\__kernel_msg_new:nnn { kernel } { file-cycle } +\msg_new:nnn { latex2e } { file-cycle } { File~loop!~#1~replaced~by~#2... } \ExplSyntaxOff \def\disable@package@load#1#2{% @@ -15244,6 +15723,25 @@ Type H <return> for immediate help.}% \fi \fi } +\def\ShowFloat#1{\begingroup + \let \fl@trace \fl@tracemessage + \fl@trace{***Float #1 details:}% + \ifcsname bx@#1\endcsname + \expandafter\fl@ShowFloat\csname bx@#1\endcsname + \else + \fl@trace{Not a float!}% + \fi + \endgroup +} +\def\fl@ShowFloat#1{% + \fl@traceval{\count#1}% % this here should be interpreted on day + \fl@traceval{\ht#1}% + \fl@traceval{\dp#1}% + \fl@traceval{\wd#1}% + {\tracingonline1\showboxbreadth10\showboxdepth3\showbox#1}% +} +\def \fl@traceval #1{\fl@trace{\string #1 = \the #1}} +\def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}} \def \suppressfloats {% \@ifnextchar [% \@flstop @@ -15767,7 +16265,7 @@ Type H <return> for immediate help.}% \reserved@a }} \def\@uclclist{\oe\OE\o\O\ae\AE - \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\th\TH} + \dh\DH\dj\DJ\l\L\ng\NG\ss\SS\ij\IJ\th\TH} \protected@edef\MakeUppercase#1{\MakeUppercase{#1}} \protected@edef\MakeLowercase#1{\MakeLowercase{#1}} \let\reserved@a\@filelist @@ -15788,6 +16286,7 @@ Type H <return> for immediate help.}% \endgroup} \let\@filelist\@gobble \def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}% +\let \IfPDFManagementActiveTF \@secondoftwo \@input{latex2e-first-aid-for-external-files.ltx} \makeatother \errorstopmode diff --git a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty index 4d79a1473b8..0e580141cd2 100644 --- a/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty +++ b/Master/texmf-dist/tex/latex-dev/base/latexrelease.sty @@ -92,6 +92,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %%% From File: ltclass.dtx + \def\@parse@version#1/#2/#3#4#5\@nil{% \@parse@version@dash#1-#2-#3#4\@nil } @@ -310,6 +311,15 @@ {\@IncludeInRelease{#1}[#1]}}} \def\finish@module@release#1#2#3{% \toks@{[#1] #3}% + \begingroup + \edef\x{\detokenize\expandafter{\new@modulename}}% + \edef\y{\detokenize{#2}}% + \expandafter\endgroup + \ifx\x\y \else + \@latex@error{\noexpand\IncludeInRelease dated #1 in a module is not + allowed.\MessageBreak Use a date at least equal to \new@moduledate + \space for complete rollback}\@ehd + \fi \ifnum\expandafter\@parse@version\new@moduledate//00\@nil >\expandafter\@parse@version\fmtversion//00\@nil \GenericInfo{}{Applying: \the\toks@}% @@ -1781,8 +1791,8 @@ of this package available from CTAN} \EndIncludeInRelease %%% From File: ltcmd.dtx -\def\ltcmdversion{v1.0f} -\def\ltcmddate{2021-06-04} +\def\ltcmdversion{v1.0h} +\def\ltcmddate{2021-08-30} \edef\@latexrelease@catcode@null{\the\catcode`\^^@ } \catcode`\^^@=12 \ExplSyntaxOn @@ -1870,7 +1880,6 @@ of this package available from CTAN} #4 \__cmd_break_point:n {#2} } -\cs_generate_variant:Nn \__cmd_declare_cmd_internal:Nnnn { cnx } \cs_new_eq:NN \__cmd_break_point:n \use_none:n \cs_new_protected:Npn \__cmd_declare_cmd_code:Nnn { @@ -1973,15 +1982,8 @@ of this package available from CTAN} } \cs_new_protected:Npn \__cmd_declare_env_internal:nnnn #1#2#3#4 { - \__cmd_declare_cmd_internal:cnxn { environment~ #1 } {#2} - { - \cs_set_nopar:Npx \exp_not:c { environment~ #1 ~end~aux } - { - \exp_not:N \exp_not:N \exp_not:c { environment~ #1~end~aux~ } - \exp_not:n { \exp_not:o \l__cmd_args_tl } - } - \exp_not:n {#3} - } + \exp_args:Nc \__cmd_declare_cmd_internal:Nnnn { environment~ #1 } {#2} + {#3} { \cs_set_nopar:cpx { environment~ #1 ~end } { \exp_not:c { environment~ #1 ~end~aux } } @@ -1992,6 +1994,14 @@ of this package available from CTAN} \cs_set_eq:cc { end #1 } { environment~ #1 ~end } } } +\cs_new_protected:Npn \__cmd_set_environment_end:n #1 + { + \cs_set_nopar:cpx { environment~ #1 ~end~aux } + { + \exp_not:c { environment~ #1 ~end~aux~ } + \exp_not:o \l__cmd_args_tl + } + } \cs_new_protected:Npn \__cmd_start_env:nnnnn #1#2 { \conditionally@traceoff @@ -2019,7 +2029,10 @@ of this package available from CTAN} \tl_set:Nn \l__cmd_fn_code_tl {#2} \tl_set:Nn \l__cmd_defaults_tl {#5} \tl_set:Nn \l__cmd_process_all_tl {#6} - #4 \__cmd_run_code: + #4 + \bool_if:NT \l__cmd_environment_bool + { \exp_args:No \__cmd_set_environment_end:n \l__cmd_environment_str } + \__cmd_run_code: } \cs_generate_variant:Nn \__cmd_start_aux:NNnnnn { cc } \cs_new_protected:Npn \__cmd_run_code: @@ -2533,10 +2546,26 @@ of this package available from CTAN} { \__cmd_flush_m_args: \__cmd_add_default_E:nn {#1} {#2} + \use:x + { + \__cmd_replicate_processor:nn { \tl_count:n {#1} } + { \exp_not:o \l__cmd_process_one_tl } + } \__cmd_add_grabber:N E \tl_put_right:Nn \l__cmd_signature_tl { {#1} } \__cmd_prepare_signature:N } +\cs_new_protected:Npn \__cmd_replicate_processor:nn #1 #2 + { + \int_compare:nNnF {#1} > { 1 } { \use_none:nnn } + \tl_set:Nx \l__cmd_process_one_tl + { + \exp_not:n { \exp_not:n {#2} \if_false: { \fi: } } + \prg_replicate:nn { #1 - 2 } + { \exp_not:n { \exp_not:n { {#2} } } } + \exp_not:n { { \if_false: } \fi: \exp_not:n {#2} } + } + } \cs_new_protected:Npn \__cmd_add_type_m:w { \__cmd_add_default: @@ -2594,7 +2623,12 @@ of this package available from CTAN} \bool_set_false:N \l__cmd_long_bool \bool_set_false:N \l__cmd_obey_spaces_bool \tl_put_right:Nx \l__cmd_process_all_tl - { { \exp_not:o \l__cmd_process_one_tl } } + { + { + \if_charcode:w E #1 \use_i:nn \fi: + \exp_not:o \l__cmd_process_one_tl + } + } \tl_clear:N \l__cmd_process_one_tl } \cs_new_protected:Npn \__cmd_add_default:n #1 @@ -2736,6 +2770,331 @@ of this package available from CTAN} \cs_set_eq:NN #1 \__cmd_tmp:w \tl_set:Nn #2 {#1} } +\IncludeInRelease{2021/11/15}{\__cmd_copy:NN}% + {Support~\NewCommandCopy~in~ltcmd} +\cs_new_protected:Npn \__cmd_copy:NN #1 #2 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \__cmd_cmd_type_cases:NnnnnF \exp_not:N #2 + { \__cmd_copy_command:nnNN } + { \__cmd_copy_expandable:nnNN } + { \__cmd_copy_environment:nnNN } + { \__cmd_copy_environment_end:nnNN } + { \__cmd_cant_copy:nwn { non-ltcmd } } + { \cs_to_str:N #1 } { \cs_to_str:N #2 } + \exp_not:N #1 \exp_not:N #2 + \exp_not:N \__cmd_break_point:n { \cs_to_str:N #2 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +\cs_new_protected:Npn \__cmd_set_eq_if_exist:NN #1 #2 + { \cs_if_exist:NTF #2 { \cs_set_eq:NN } { \use_none:nn } #1 #2 } +\cs_generate_variant:Nn \__cmd_set_eq_if_exist:NN { cc } +\cs_new_protected:Npn \__cmd_cant_copy:nwn #1 #2 \__cmd_break_point:n #3 + { \msg_error:nnnn { cmd } { copy-bug } {#1} {#3} } +\msg_new:nnn { cmd } { copy-bug } + { + Error~while~copying~command~\iow_char:N\\#2:\\ + \str_case:nn {#1} + { + { non-ltcmd } { Command~is~not~a~valid~ltcmd~command. } + { unknown-type } { Found~an~unknown~argument~type. } + { invalid-end } + { Target~command~is~not~named~\iow_char:N \\end<name>. } + } + } +\tl_gput_right:Nn \@declarecommandcopylisthook + { { \__kernel_cmd_if_xparse:NTF \__cmd_copy:NN } } +\cs_new_protected:Npn \__cmd_copy_command:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { #1 ~ code } { #2 ~ code } + \__cmd_set_eq_if_exist:cc { #1 ~ defaults } { #2 ~ defaults } + \cs_set_protected_nopar:Npx #3 + { \exp_after:wN \__cmd_copy_command:NnNNnnnn #4 {#1} } + } +\cs_new:Npn \__cmd_copy_command:NnNNnnnn #1 #2 #3 #4 #5 #6 #7 #8 + { + #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } \exp_not:c { #8 ~ code } + \exp_not:n { {#5} {#6} {#7} } + } +\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} + \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 + { + \exp_not:N #1 \exp_not:n { {#2} } + \exp_not:c { #8 ~ } + \exp_not:c + { + #8 ~ + \str_if_eq:eeT + { \exp_not:c { #9 ~ \c_space_tl } } { \exp_not:N #4 } + { \c_space_tl } + } + \exp_not:c { #8 ~ code } + \str_if_eq:eeTF { \exp_not:N #6 } { ? } + { ? } + { \exp_not:c { #8 ~ defaults } } + { \exp_not:V \l__cmd_tmpa_tl } + } +\cs_new_protected:Npn \__cmd_copy_expandable_signature:NnNNNNnnn + #1 #2 #3 #4 #5 #6 #7 #8 #9 + { + \int_zero:N \l__cmd_current_arg_int + \tl_clear:N \l__cmd_tmpa_tl + \__cmd_copy_expandable:nnN {#8} {#9} #7 + \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \__cmd_copy_expandable:nnN #1 #2 #3 + { + \quark_if_recursion_tail_stop:n {#3} + \int_incr:N \l__cmd_current_arg_int + \exp_after:wN \__cmd_copy_parse_grabber:w \token_to_str:N #3 {#1} {#2} + } +\use:x + { + \cs_new_protected:Npn \exp_not:N \__cmd_copy_parse_grabber:w ##1 + \tl_to_str:n { expandable_grab_ } ##2 \tl_to_str:n { :w } + { + \tl_put_right:Nx \exp_not:N \l__cmd_tmpa_tl + { \exp_not:N \exp_not:c { __cmd_expandable_grab_##2:w } } + \exp_not:N \cs_if_exist_use:cF { __cmd_copy_grabber_##2:w } + { \__cmd_cant_copy:nwn { unknown-type } } + } + } +\cs_new_protected:Npn \__cmd_copy_grabber_D:w #1 #2 #3 #4 #5 + { + \tl_put_right:Nx \l__cmd_tmpa_tl + { + \exp_not:c { #1 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + \exp_not:n { #4 #5 } + } + \cs_set_eq:cc + { #1 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + { #2 ~ (arg ~ \int_use:N \l__cmd_current_arg_int ) } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_protected:Npn \__cmd_copy_grabber_D_alt:w #1 #2 #3 #4 + { \__cmd_copy_grabber_D:w {#1} {#2} {#3} {#4} { } } +\cs_new_eq:NN \__cmd_copy_grabber_R:w \__cmd_copy_grabber_D:w +\cs_new_eq:NN \__cmd_copy_grabber_R_alt:w \__cmd_copy_grabber_D_alt:w +\cs_new_protected:Npn \__cmd_copy_grabber_E:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l__cmd_tmpa_tl { {#3} {#4} } + \int_add:Nn \l__cmd_current_arg_int { \tl_count:n {#4} - 1 } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_eq:NN \__cmd_copy_grabber_E_long:w \__cmd_copy_grabber_E:w +\cs_new_protected:Npn \__cmd_copy_grabber_t:w #1 #2 #3 #4 + { + \tl_put_right:Nn \l__cmd_tmpa_tl { #3 #4 } + \__cmd_copy_expandable:nnN {#1} {#2} + } +\cs_new_protected:Npn \__cmd_copy_grabber_m:w { \__cmd_copy_expandable:nnN } +\cs_new_eq:NN \__cmd_copy_grabber_m_long:w \__cmd_copy_grabber_m:w +\cs_new_protected:Npn \__cmd_copy_environment:nnNN #1 #2 #3 #4 + { + \cs_set_eq:cc { environment~ #1 ~ code } { environment~ #2 ~ code } + \__cmd_set_eq_if_exist:cc + { environment~ #1 ~ defaults } { environment~ #2 ~ defaults } + \cs_set_protected_nopar:cpx { environment~ #1 } + { \exp_after:wN \__cmd_copy_environment:Nnnnnnn #4 {#1} } + \cs_set_eq:cc {#1} { environment~ #1 } + } +\cs_new:Npn \__cmd_copy_environment:Nnnnnnn #1 #2 #3 #4 #5 #6 #7 + { #1 \exp_not:n { {#2} } {#7} \exp_not:n { {#4} {#5} {#6} } } +\cs_new_protected:Npn \__cmd_copy_environment_end:nnNN #1 #2 + { + \__cmd_check_end:Nn \l__cmd_tmpa_tl {#1} + \__cmd_check_end:Nn \l__cmd_tmpb_tl {#2} + \exp_args:Noo \__cmd_copy_environment_end_aux:nnNN + { \l__cmd_tmpa_tl } { \l__cmd_tmpb_tl } + } +\cs_new_protected:Npn \__cmd_copy_environment_end_aux:nnNN #1 #2 #3 #4 + { + \cs_set_nopar:cpx { environment~ #1 ~end } + { \exp_not:c { environment~ #1 ~end~aux } } + \cs_set_eq:cc + { environment~ #1 ~end~aux~ } { environment~ #2 ~end~aux~ } + \cs_set_eq:cc { end #1 } { environment~ #1 ~end } + } +\cs_new_protected:Npn \__cmd_check_end:Nn #1 #2 + { + \tl_set:Nx #1 { \__cmd_check_end:n {#2} } + \token_if_eq_meaning:NNT #1 \q_nil + { \__cmd_cant_copy:nwn { invalid-end } } + } +\cs_set_protected:Npn \__cmd_tmp:w #1 + { + \cs_new:Npn \__cmd_check_end:n ##1 + { + \exp_after:wN \__cmd_check_end:w \tl_to_str:n {##1} + #1 \q_mark #1 \q_stop + } + \cs_new:Npn \__cmd_check_end:w ##1 #1 ##2 #1 ##3 \q_stop + { \if_meaning:w ##2 \q_mark \exp_not:N \q_nil \else: ##2 \fi: } + } +\exp_args:No \__cmd_tmp:w { \tl_to_str:n { end } } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_copy:NN}% + {Support~\NewCommandCopy~in~ltcmd} +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__cmd_show:N}% + {Support~\ShowCommand~in~ltcmd} +\cs_new_protected:Npn \__cmd_show:N #1 + { + \use:x + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_not:N \__cmd_cmd_type_cases:NnnnnF \exp_not:N #1 + { \__cmd_show_command:N } + { \__cmd_show_expandable:N } + { \__cmd_show_environment:N } + { \__cmd_show_environment_end:N } + { \__cmd_cant_copy:nwn { non-ltcmd } } + \exp_not:N #1 + \exp_not:N \__cmd_break_point:n { \cs_to_str:N #1 } + \int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D } + } + } +\cs_new_protected:Npn \__cmd_show_command:N #1 + { \exp_after:wN \__cmd_show_command:NnNNwN #1 \q__cmd #1 } +\cs_new_protected:Npn \__cmd_show_command:NnNNwN #1 #2 #3 #4 #5 \q__cmd #6 + { \__cmd_show_command_aux:nNNn { document~command } #6 #4 {#2} } +\cs_new_protected:Npn \__cmd_show_expandable:N #1 + { \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:nNNn { expandable~document~command } #8 #5 {#2} } +\cs_new_protected:Npn \__cmd_show_command_aux:nNNn #1 #2 #3 #4 + { + \__cmd_split_signature:n {#4} + \iow_term:x + { + > ~ \token_to_str:N #2 = #1: \iow_newline: + \tl_use:N \l__cmd_tmpa_tl + -> \cs_replacement_spec:N #3 . + } + } +\cs_new_protected:Npn \__cmd_show_environment:N #1 + { + \exp_after:wN \__cmd_show_environment:Nnnw #1 \q__cmd + \iow_term:x + { + > ~ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline: + -> \exp_args:Nc \cs_replacement_spec:N + { environment~ \cs_to_str:N #1 ~end~aux~ } . + } + } +\cs_new_protected:Npn \__cmd_show_environment:Nnnw #1 #2 #3 #4 \q__cmd + { + \use:x + { + \__cmd_show_command_aux:nNNn { document~environment } + { \exp_not:N \begin {#3} } + \exp_not:c { environment~ #3 ~ code } + {#2} + } + } +\cs_new_protected:Npn \__cmd_show_environment_end:N #1 + { + \exp_args:NNx \__cmd_check_end:Nn \l__cmd_tmpa_tl { \cs_to_str:N #1 } + \exp_args:Nc \__cmd_show_environment:N { \l__cmd_tmpa_tl } + } +\tl_gput_right:Nn \@showcommandlisthook + { { \__kernel_cmd_if_xparse:NTF \__cmd_show:N } } +\cs_new_protected:Npn \__cmd_split_signature:n #1 + { + \int_set:Nn \l__cmd_current_arg_int { 1 } + \tl_clear:N \l__cmd_tmpa_tl + \tl_clear:N \l__cmd_tmpb_tl + \__cmd_split_signature_loop:Nw #1 \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \__cmd_split_signature_loop:Nw #1 + { + \quark_if_recursion_tail_stop:N #1 + \tl_if_empty:NT \l__cmd_tmpb_tl { \__cmd_split_start_item: } + \tl_if_exist:cTF { c__cmd_show_type_#1_tl } + { + \use:c + { + __cmd_show_ + \if_case:w \tl_use:c { c__cmd_show_type_#1_tl } \exp_stop_f: + delim \or: delims \or: delims_opt \or: opt \or: + e \or: E \or: prefix \or: processor \fi: :Nw + } #1 + } + { \__cmd_split_end_item:n {#1} \__cmd_split_signature_loop:Nw } + } +\cs_set_protected:Npn \__cmd_tmp:w #1 #2 + { + \quark_if_nil:nF {#1} + { \tl_const:cn { c__cmd_show_type_#1_tl } {#2} \__cmd_tmp:w } + } +\__cmd_tmp:w t0 r1 d1 R2 D2 O3 e4 E5 +6 !6 >7 \q_nil \q_nil +\cs_new_protected:Npn \__cmd_show_delim:Nw #1 #2 + { \__cmd_split_end_item:n { #1 #2 } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_delims:Nw #1 #2 #3 + { \__cmd_split_end_item:n { #1 #2 #3 } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_delims_opt:Nw #1 #2 #3 #4 + { \__cmd_split_end_item:n { #1 #2 #3 {#4} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_opt:Nw #1 #2 + { \__cmd_split_end_item:n { #1 {#2} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_e:Nw #1 #2 + { + \tl_map_inline:nn {#2} + { + \__cmd_split_start_item: + \__cmd_split_end_item:n { #1 ##1 } + } + \__cmd_split_signature_loop:Nw + } +\cs_set_protected:Npn \__cmd_tmp:w #1 + { + \cs_new_protected:Npn \__cmd_show_E:Nw ##1 ##2 ##3 + { + \cs_set_protected:Npn \__cmd_tmp:w ####1 ####2 + { + \__cmd_split_start_item: + \__cmd_split_end_item:n { ##1 ####1 {####2} } + } + \__cmd_tl_mapthread_function:nnN {##2} + { ##3 {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} {#1} } \__cmd_tmp:w + \__cmd_split_signature_loop:Nw + } + } +\exp_args:NV \__cmd_tmp:w \c_novalue_tl +\cs_new_protected:Npn \__cmd_show_prefix:Nw #1 + { \__cmd_split_add_item:n {#1} \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_show_processor:Nw #1 #2 + { \__cmd_split_add_item:n { #1 {#2} } \__cmd_split_signature_loop:Nw } +\cs_new_protected:Npn \__cmd_split_start_item: + { + \tl_set:Nx \l__cmd_tmpb_tl + { ~ \c_space_tl \c_hash_str \int_use:N \l__cmd_current_arg_int : } + } +\cs_new_protected:Npn \__cmd_split_add_item:n #1 + { \tl_put_right:Nx \l__cmd_tmpb_tl { \tl_to_str:n {#1} } } +\cs_new_protected:Npn \__cmd_split_end_item:n #1 + { + \tl_put_right:Nx \l__cmd_tmpa_tl + { \l__cmd_tmpb_tl \tl_to_str:n {#1} \iow_newline: } + \tl_clear:N \l__cmd_tmpb_tl + \int_incr:N \l__cmd_current_arg_int + } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__cmd_show:N}% + {Support~\ShowCommand~in~ltcmd} +\EndIncludeInRelease \cs_new_protected:Npn \__cmd_grab_b:w { \__cmd_grab_b_aux:NNw \cs_set_protected_nopar:Npn \tl_trim_spaces:n } \cs_new_protected:Npn \__cmd_grab_b_long:w @@ -3587,23 +3946,40 @@ of this package available from CTAN} #1 {#2} {#4} \__cmd_tl_mapthread_loop:w #1#3 \q_mark } -\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 +\cs_new_protected:Npn \__cmd_cmd_type_cases:NnnnnF #1 #2 #3 #4 #5 #6 { - \exp_args:Nf \str_case_e:nnTF + \exp_args:Ne \str_case_e:nnF { \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 } { - \exp_last_unbraced:Nf \__cmd_cmd_if_xparse_aux:w - { \cs_replacement_spec:N #1 } ~ \q_stop + \token_if_macro:NT #1 + { + \exp_after:wN \exp_after:wN + \exp_after:wN \token_to_str:N + \exp_after:wN \use_i_delimit_by_q_stop:nw + #1 \scan_stop: \q_stop + } } } { - { \token_to_str:N \__cmd_start:nNNnnn } { } - { \token_to_str:N \__cmd_start_expandable:nNNNNn } { } - { \token_to_str:N \__cmd_start_env:nnnnn } { } + { \token_to_str:N \__cmd_start:nNNnnn } {#2} + { \token_to_str:N \__cmd_start_expandable:nNNNNn } {#3} + { \token_to_str:N \__cmd_start_env:nnnnn } {#4} + { + \exp_after:wN \token_to_str:N + \cs:w environment~ + \exp_last_unbraced:Ne \use_none:nnn + { \cs_to_str:N #1 } ~end~aux \cs_end: + } {#5} } + {#6} + } +\cs_new_protected:Npn \__kernel_cmd_if_xparse:NTF #1 + { + \__cmd_cmd_type_cases:NnnnnF #1 + { } { } { } { } { \use_iii:nnn } + \use_i:nn } -\cs_new:Npn \__cmd_cmd_if_xparse_aux:w #1 ~ #2 \q_stop {#1} \cs_new_protected:Npn \__cmd_peek_nonspace:NTF { \__cmd_peek_nonspace_aux:nNNTF { } \__cmd_peek_meaning:NTF } \cs_new_protected:Npn \__cmd_peek_nonspace_remove:NTF @@ -3698,6 +4074,13 @@ of this package available from CTAN} with~an~environment~that~already~has~a~definition. \\ \\ The~existing~definition~of~'#1'~will~not~be~altered. } +\msg_new:nnnn { cmd } { env-end-already-defined } + { End~of~environment~'#1'~already~defined. } + { + You~have~used~\NewDocumentEnvironment + with~an~environment~that~already~has~a~definition~for~'end#1'. \\ \\ + The~existing~definition~of~'#1'~will~not~be~altered. + } \msg_new:nnnn { cmd } { env-undefined } { Environment~'#1'~undefined. } { @@ -3948,7 +4331,11 @@ of this package available from CTAN} { \cs_if_exist:cTF {#1} { \msg_error:nnx { cmd } { env-already-defined } {#1} } - { \__cmd_declare_env:nnnn {#1} {#2} {#3} {#4} } + { + \cs_if_exist:cTF { end #1 } + { \msg_error:nnx { cmd } { env-end-already-defined } {#1} } + { \__cmd_declare_env:nnnn {#1} {#2} {#3} {#4} } + } } \cs_new_protected:Npn \RenewDocumentEnvironment #1#2#3#4 { @@ -4054,9 +4441,8 @@ of this package available from CTAN} \catcode`\^^@=\@latexrelease@catcode@null\relax %%% From File: lthooks.dtx -\def\lthooksversion{v1.0n} -\def\lthooksdate{2021/05/26} - +\def\lthooksversion{v1.0r} +\def\lthooksdate{2021/09/06} \ExplSyntaxOn \NewModuleRelease{2020/10/01}{lthooks} {The~hook~management~system} @@ -4083,10 +4469,8 @@ of this package available from CTAN} \tl_new:N \l__hook_tmpa_tl \tl_new:N \l__hook_tmpb_tl \seq_new:N \g__hook_all_seq -\tl_new:N \g__hook_removal_list_tl \tl_new:N \l__hook_cur_hook_tl \prop_new:N \l__hook_work_prop -\prop_new:N \g__hook_execute_immediately_prop \prop_new:N \g__hook_used_prop \tl_new:N \g__hook_hook_curr_name_tl \seq_new:N \g__hook_name_stack_seq @@ -4095,6 +4479,7 @@ of this package available from CTAN} \cs_generate_variant:Nn \tl_show:n { x } \cs_generate_variant:Nn \tl_log:n { x } \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 @@ -4179,8 +4564,8 @@ of this package available from CTAN} } } \IncludeInRelease{2021/06/01}% - {\hook_disable:n}{Disable~hooks} -\cs_new_protected:Npn \hook_disable:n #1 + {\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 { @@ -4197,43 +4582,34 @@ of this package available from CTAN} } \EndIncludeInRelease \IncludeInRelease{2020/10/01} - {\hook_disable:n}{Disable~hooks} + {\hook_disable_generic:n}{Disable~hooks} -\cs_new_protected:Npn \hook_disable:n #1 {} +\cs_new_protected:Npn \hook_disable_generic:n #1 {} \EndIncludeInRelease \IncludeInRelease{2021/06/01}% - {\hook_provide:n}{Providing~hooks} -\cs_new_protected:Npn \hook_provide:n #1 - { \__hook_normalize_hook_args:Nn \__hook_provide:nn {#1} { } } -\cs_new_protected:Npn \hook_provide_reversed:n #1 - { \__hook_normalize_hook_args:Nn \__hook_provide:nn {#1} { - } } -\cs_new_protected:Npn \__hook_provide:nn #1 #2 + {\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 { \__hook_if_disabled:nTF {#1} - { \msg_warning:nnn { hooks } { provide-disabled } {#1} } + { \msg_warning:nnn { hooks } { activate-disabled } {#1} } { - \__hook_if_declared:nTF {#1} - { - \str_if_eq:eeF { \tl_use:c { g__hook_#1_reversed_tl } } {#2} - { \msg_error:nnn { hooks } { provide-error } {#1} } - } + \__hook_if_declared:nF {#1} { \tl_new:c { g__hook_#1_declared_tl } \__hook_make_usable:n {#1} - \tl_gset:cn { g__hook_#1_reversed_tl } {#2} + \tl_gset:cx { g__hook_#1_reversed_tl } + { \__hook_if_generic_reversed:nT {#1} { - } } } } } -\cs_new_protected:Npn \hook_provide_pair:nn #1#2 - { \hook_provide:n {#1} \hook_provide_reversed:n {#2} } \EndIncludeInRelease \IncludeInRelease{2020/10/01} - {\hook_provide:n}{Providing~hooks} + {\hook_activate_generic:n}{Providing~hooks} -\cs_new_protected:Npn \hook_provide_reversed:n #1 {} -\cs_new_protected:Npn \hook_provide:n #1 {} -\cs_new_protected:Npn \hook_provide_pair:nn #1#2 {} +\cs_new_protected:Npn \hook_activate_generic:n #1 {} \EndIncludeInRelease \cs_new:Npn \__hook_parse_label_default:n #1 @@ -4274,7 +4650,7 @@ of this package available from CTAN} { \tl_if_empty:NTF \@currname { - \msg_expandable_error:nnn { kernel } { should-not-happen } + \msg_expandable_error:nnn { latex2e } { should-not-happen } { Empty~default~label. } \__hook_make_name:n { label-missing } } @@ -4321,30 +4697,93 @@ of this package available from CTAN} { \__hook_parse_label_default:n {#5} } } } +\tl_gset:Nn \g__hook_hook_curr_name_tl { top-level } +\seq_if_empty:NT \g__hook_name_stack_seq + { \seq_gput_right:Nn \g__hook_name_stack_seq { top-level } } +\cs_set_protected:Npn \__hook_tmp:w #1 #2 #3 + { + \quark_if_recursion_tail_stop:n {#1} + \seq_gput_right:Nn \g__hook_name_stack_seq {#1} + \__hook_tmp:w + } +\exp_after:wN \__hook_tmp:w \@currnamestack + \q_recursion_tail \q_recursion_tail + \q_recursion_tail \q_recursion_stop +\tl_gset:Nx \g__hook_hook_curr_name_tl { \@currname } +\seq_gpop_right:NN \g__hook_name_stack_seq \l__hook_tmpa_tl +\cs_new_protected:Npn \__hook_curr_name_push:n #1 + { \exp_args:Nx \__hook_curr_name_push_aux:n { \__hook_make_name:n {#1} } } +\cs_new_protected:Npn \__hook_curr_name_push_aux:n #1 + { + \tl_if_blank:nTF {#1} + { \msg_error:nn { hooks } { no-default-label } } + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { PushDefaultHookLabel } {#1} + } + { + \seq_gpush:NV \g__hook_name_stack_seq \g__hook_hook_curr_name_tl + \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} + } + } + } +\cs_new_protected:Npn \__hook_curr_name_pop: + { + \seq_gpop:NNTF \g__hook_name_stack_seq \l__hook_return_tl + { \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl } + { \msg_error:nn { hooks } { extra-pop-label } } + } +\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage + { \__hook_end_document_label_check: } +\cs_new_protected:Npn \__hook_end_document_label_check: + { + \seq_gpop:NNT \g__hook_name_stack_seq \l__hook_return_tl + { + \msg_error:nnx { hooks } { missing-pop-label } + { \g__hook_hook_curr_name_tl } + \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl + \__hook_end_document_label_check: + } + } +\cs_new_protected:Npn \__hook_set_default_hook_label:n #1 + { + \seq_if_empty:NTF \g__hook_name_stack_seq + { + \msg_error:nnnnn { hooks } { set-top-level } + { for } { SetDefaultHookLabel } {#1} + } + { \exp_args:Nx \__hook_set_default_label:n { \__hook_make_name:n {#1} } } + } +\cs_new_protected:Npn \__hook_set_default_label:n #1 + { + \str_if_eq:nnTF {#1} { top-level } + { + \msg_error:nnnnn { hooks } { set-top-level } + { to } { SetDefaultHookLabel } {#1} + } + { \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 { - \prop_if_in:NnTF \g__hook_execute_immediately_prop {#1} + \__hook_if_execute_immediately:nTF {#1} {#3} { - \__hook_if_marked_removal:nnTF {#1} {#2} - { \__hook_unmark_removal:nn {#1} {#2} } + \__hook_if_usable:nTF {#1} { - \__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} } - } + \__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_generate_variant:Nn \__hook_gput_code:nnn { nxv } \cs_new_protected:Npn \__hook_hook_gput_code_do:nnn #1 #2 #3 { \__hook_debug:n{\iow_term:x{****~ Add~ to~ @@ -4374,6 +4813,25 @@ of this package available from CTAN} \__hook_init_structure:n {#1} \__hook_hook_gput_code_do:nnn {#1} {#2} {#3} } +\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 + { + \__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{2020/10/01}{\__hook_try_declaring_generic_hook:nnn} + {Standardise~generic~hook~names} \cs_new_protected:Npn \__hook_try_declaring_generic_hook:nnn #1 { \__hook_try_declaring_generic_hook:nNNnn {#1} @@ -4386,7 +4844,7 @@ of this package available from CTAN} } \cs_new_protected:Npn \__hook_try_declaring_generic_hook:nNNnn #1 { - \__hook_if_file_hook:wTF #1 / / \s__hook_mark + \__hook_if_file_hook:wTF #1 / \s__hook_mark {#1} { \exp_args:Ne \__hook_try_declaring_generic_hook_split:nNNnn { \exp_args:Ne \__hook_file_hook_normalize:n {#1} } @@ -4399,8 +4857,61 @@ of this package available from CTAN} { #2 } { #3 } {#1} } -\IncludeInRelease{2021/06/01}% - {\__hook_try_declaring_generic_hook:wn}{Support~cmd~hooks} +\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: } + } + } +\cs_new_protected:Npn \__hook_deprecated_generic_warn:n #1 + { \__hook_deprecated_generic_warn:w #1 \s__hook_mark } +\cs_new_protected:Npn \__hook_deprecated_generic_warn:w + #1 / #2 / #3 \s__hook_mark + { + \if_cs_exist:w __hook~#1/#2/#3 \cs_end: \else: + \msg_warning:nnnnn { hooks } { generic-deprecated } {#1} {#2} {#3} + \fi: + \cs_gset_eq:cN { __hook~#1/#2/#3 } \scan_stop: + } +\cs_new_protected:Npn \__hook_do_deprecated_generic:Nn #1 #2 + { \__hook_do_deprecated_generic:Nw #1 #2 \s__hook_mark } +\cs_new_protected:Npn \__hook_do_deprecated_generic:Nw #1 + #2 / #3 / #4 \s__hook_mark + { #1 { #2 / #4 / #3 } } +\cs_new_protected:Npn \__hook_declare_deprecated_generic:NNn #1 #2 #3 + { \__hook_declare_deprecated_generic:NNw #1 #2 #3 \s__hook_mark } +\cs_new_protected:Npn \__hook_declare_deprecated_generic:NNw #1 #2 + #3 / #4 / #5 \s__hook_mark + { + \__hook_try_declaring_generic_hook:wnTF #3 / #5 / #4 / \scan_stop: + { #3 / #5 / #4 } + #1 #2 { #3 / #5 / #4 } + } +\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 #1 / #2 / #3 / #4 \scan_stop: #5 { TF } { @@ -4427,9 +4938,8 @@ of this package available from CTAN} } } \EndIncludeInRelease -\IncludeInRelease{2020/10/01}% - {\__hook_try_declaring_generic_hook:wn}{Support~cmd~hooks} - +\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 } { @@ -4452,6 +4962,22 @@ of this package available from CTAN} } \EndIncludeInRelease +\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}% + {Standardise~generic~hook~names} \prg_new_conditional:Npnn \__hook_if_file_hook:w #1 / #2 / #3 \s__hook_mark { TF } { @@ -4469,6 +4995,12 @@ of this package available from CTAN} } { \prg_return_false: } } +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__hook_file_hook_normalize:n}% + {Standardise~generic~hook~names} +\EndIncludeInRelease +\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} } \cs_new:Npn \__hook_strip_double_slash:n #1 @@ -4479,11 +5011,38 @@ of this package available from CTAN} { #1/#2/#3 } { \__hook_strip_double_slash:w #1/#2/#3 / #4 \s__hook_mark } } +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\c__hook_generics_prop}% + {Standardise~generic~hook~names} +\clist_map_inline:nn { cmd , env , file , package , class , include } + { + \tl_const:cn { c__hook_generic_#1/./before_tl } { + } + \tl_const:cn { c__hook_generic_#1/./after_tl } { - } + } +\tl_const:cn { c__hook_generic_env/./begin_tl } { + } +\tl_const:cn { c__hook_generic_env/./end_tl } { + } +\tl_const:cn { c__hook_generic_include/./end_tl } { - } +\clist_map_inline:nn { file , package , class , include } + { + \tl_const:cn { c__hook_deprecated_#1/./before_tl } { } + \tl_const:cn { c__hook_deprecated_#1/./after_tl } { } + } +\tl_const:cn { c__hook_deprecated_include/./end_tl } { } +\EndIncludeInRelease +\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}% + {Standardise~generic~hook~names} +\EndIncludeInRelease +\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 \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 @@ -4500,37 +5059,22 @@ of this package available from CTAN} \str_if_eq:nnTF {#2} { top-level } { \__hook_tl_gclear:c { __hook_toplevel~#1 } } { - \prop_get:cnNTF { g__hook_#1_code_prop } {#2} \l__hook_return_tl - { \__hook_gremove_code_do:nn } - { \__hook_mark_removal:nn } - {#1} {#2} + \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_mark_removal:nn {#1} {#2} } - } -\cs_new_protected:Npn \__hook_gremove_code_do:nn #1 #2 - { \prop_gremove:cn { g__hook_#1_code_prop } {#2} } -\cs_new_protected:Npn \__hook_mark_removal:nn #1 #2 - { - \tl_gput_right:Nx \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - } -\cs_new_protected:Npn \__hook_unmark_removal:nn #1 #2 - { - \tl_gremove_once:Nx \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - } -\prg_new_protected_conditional:Npnn \__hook_if_marked_removal:nn #1 #2 { TF } - { - \exp_args:NNx \tl_if_in:NnTF \g__hook_removal_list_tl - { \__hook_removal_tl:nn {#1} {#2} } - { \prg_return_true: } { \prg_return_false: } + { + \__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} } + } } -\cs_new:Npn \__hook_removal_tl:nn #1 #2 - { & \tl_to_str:n {#2} $ \tl_to_str:n {#1} $ } \prop_new:c {g__hook_??_code_prop} \prop_new:c {__hook~??} \tl_new:c {g__hook_??_reversed_tl} @@ -4541,6 +5085,13 @@ of this package available from CTAN} } \cs_new_protected:Npn \__hook_gset_rule:nnnn #1#2#3#4 { + \__hook_if_deprecated_generic:nT {#1} + { + \__hook_deprecated_generic_warn:n {#1} + \__hook_do_deprecated_generic:Nn \__hook_gset_rule:nnnn {#1} + {#2} {#3} {#4} + \exp_after:wN \use_none:nnnnnnnnn \use_none:n + } \__hook_init_structure:n {#1} \__hook_rule_gclear:nnn {#1} {#2} {#4} \cs_if_exist_use:cTF { __hook_rule_#3_gset:nnn } @@ -4594,12 +5145,12 @@ of this package available from CTAN} \fi: } \cs_new:Npn \__hook_if_label_case:nnnnn #1#2 - { - \cs:w use_ - \if_case:w \__hook_str_compare:nn {#1} {#2} - i \or: ii \else: iii \fi: :nnn - \cs_end: - } + { + \cs:w use_ + \if_case:w \__hook_str_compare:nn {#1} {#2} + i \or: ii \else: iii \fi: :nnn + \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 @@ -4625,7 +5176,7 @@ of this package available from CTAN} \__hook_include_legacy_code_chunk:n {#1} \__hook_if_usable:nT {#1} { - \prop_if_empty:cTF {g__hook_#1_code_prop} + \prop_if_empty:cTF { g__hook_#1_code_prop } { \__hook_tl_gset:co { __hook~#1 } { @@ -4841,8 +5392,15 @@ of this package available from CTAN} { \__hook_log_cmd:x { >~\@spaces #1 } } \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~'#1': } + \__hook_log_cmd:x + { ^^J ->~The~ \__hook_if_generic:nT {#1} { generic~ } hook~'#1': } \__hook_if_usable:nF {#1} { \__hook_log_line:x { The~hook~is~not~declared. } } \__hook_if_disabled:nT {#1} @@ -4977,8 +5535,7 @@ of this package available from CTAN} \__hook_if_disabled:nTF {#1} { \msg_error:nnn { hooks } { hook-disabled } {#1} } { - \__hook_init_structure:n {#1} - \__hook_if_usable:nTF {#1} + \__hook_if_structure_exist:nTF {#1} { \__hook_gput_next_do:nn {#1} {#2} } { \__hook_try_declaring_generic_next_hook:nn {#1} {#2} } } @@ -4996,8 +5553,31 @@ of this package available from CTAN} { \__hook_tl_gset:Nn #1 { \__hook_clear_next:n {#2} } } \__hook_tl_gput_right:Nn #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 } +\IncludeInRelease{2021/11/15}{\hook_use:n} + {Standardise~generic~hook~names} +\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: + } + } +\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: + \fi: + } +\cs_new_protected:Npn \__hook_preamble_hook:n #1 + { \__hook_initialize_hook_code:n {#1} } +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\hook_use:n} + {Standardise~generic~hook~names} \cs_new_protected:Npn \hook_use:n #1 { \tl_if_exist:cTF { __hook~#1 } @@ -5023,6 +5603,12 @@ 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: +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{\__hook_use:wn} + {Standardise~generic~hook~names} +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}{\__hook_use:wn} + {Standardise~generic~hook~names} \cs_new:Npn \__hook_use:wn #1 / #2 \s__hook_mark #3 { \str_if_eq:nnTF {#1} { file } @@ -5031,7 +5617,7 @@ of this package available from CTAN} } \cs_new_protected:Npn \__hook_try_file_hook:n #1 { - \__hook_if_file_hook:wTF #1 / / \s__hook_mark + \__hook_if_file_hook:wTF #1 / \s__hook_mark {#1} { \exp_args:Ne \__hook_if_usable_use:n { \exp_args:Ne \__hook_file_hook_normalize:n {#1} } @@ -5046,18 +5632,41 @@ of this package available from CTAN} \cs:w __hook~#1 \cs_end: } } +\EndIncludeInRelease \cs_new_protected:Npn \hook_use_once:n #1 { - \tl_if_exist:cT { __hook~#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 + { + \__hook_preamble_hook:n {#1} + \__hook_use_once_set:n {#1} + \__hook_use_initialized:n {#1} + \__hook_use_once_clear:n {#1} + } +\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 } + \prop_gclear:c { g__hook_#1_code_prop } + } +\prg_new_conditional:Npnn \__hook_if_execute_immediately:n #1 { F, TF } + { + \__hook_if_usable:nTF {#1} { - \tl_set:Nn \l__hook_return_tl {#1} - \__hook_normalize_hook_args:Nn \__hook_use_once_store:n - { \l__hook_return_tl } - \hook_use:n {#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: + \fi: } + { \prg_return_false: } } -\cs_new_protected:Npn \__hook_use_once_store:n #1 - { \prop_gput:Nnn \g__hook_execute_immediately_prop {#1} { } } \prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF } { @@ -5095,14 +5704,46 @@ of this package available from CTAN} } \prg_new_conditional:Npnn \__hook_if_reversed:n #1 { p , T , F , TF } { - \if_int_compare:w \cs:w g__hook_#1_reversed_tl \cs_end: 1 < 0 \exp_stop_f: + \exp_after:wN \__hook_clean_to_scan:w + \if:w - \cs:w g__hook_#1_reversed_tl \cs_end: + \s__hook_mark \prg_return_true: + \else: + \s__hook_mark \prg_return_false: + \fi: + } +\prg_new_conditional:Npnn \__hook_if_generic:n #1 { T, TF } + { \__hook_if_generic:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_generic:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist:cTF { c__hook_generic_#1/./#3_tl } + { \prg_return_true: } + { \prg_return_false: } + } +\prg_new_conditional:Npnn \__hook_if_deprecated_generic:n #1 { T, TF } + { \__hook_if_deprecated_generic:w #1 / / / \s__hook_mark } +\cs_new:Npn \__hook_if_deprecated_generic:w #1 / #2 / #3 / #4 \s__hook_mark + { + \cs_if_exist:cTF { c__hook_deprecated_#1/./#2_tl } + { + \tl_if_empty:nTF {#3} + { \prg_return_false: } + { \prg_return_true: } + } + { \prg_return_false: } + } +\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: + { + \if_charcode:w - \cs:w c__hook_generic_#1/./#3_tl \cs_end: \prg_return_true: \else: \prg_return_false: \fi: } \prop_gput:Nnn \g_msg_module_type_prop { hooks } { LaTeX } -\prop_gput:Nnn \g_msg_module_type_prop { kernel } { LaTeX } +\prop_gput:Nnn \g_msg_module_type_prop { latex2e } { LaTeX } +\prop_gput:Nnn \g_msg_module_name_prop { latex2e } { kernel } \msg_new:nnnn { hooks } { labels-incompatible } { Labels~'#1'~and~'#2'~are~incompatible @@ -5122,7 +5763,7 @@ of this package available from CTAN} { Cannot~add~code~to~disabled~hook~'#1'. } { The~hook~'#1'~you~tried~to~add~code~to~was~previously~disabled~ - with~\iow_char:N\\hook_disable:n~or~\iow_char:N\\DisableHook,~so~ + with~\iow_char:N\\hook_disable_generic:n~or~\iow_char:N\\DisableGenericHook,~so~ it~cannot~have~code~added~to~it. } \msg_new:nnn { hooks } { empty-label } @@ -5139,7 +5780,7 @@ of this package available from CTAN} { Unknown~ relationship~ '#3'~ between~ labels~ '#2'~ and~ '#4'~ \str_if_eq:nnF {#1} {??} { ~in~hook~'#1' }. ~ - Perhaps~ a~ missspelling? + Perhaps~ a~ misspelling? } { The~ relation~ used~ not~ known~ to~ the~ system.~ Allowed~ values~ are~ @@ -5177,119 +5818,51 @@ of this package available from CTAN} Missing~\iow_char:N \\PopDefaultHookLabel. \\ The~label~'#1'~was~pushed~but~never~popped.~Something~is~wrong. } -\msg_new:nnn { kernel } { should-not-happen } +\msg_new:nnn { latex2e } { should-not-happen } { This~should~not~happen.~#1 \\ Please~report~at~https://github.com/latex3/latex2e. } -\msg_new:nnn { hooks } { provide-disabled } +\msg_new:nnn { hooks } { activate-disabled } { - Cannot~ provide~ hook~ '#1'~ because~ it~ is~ disabled! + Cannot~ activate~ hook~ '#1'~ because~ it~ is~ disabled! } -\msg_new:nnnn { hooks } { provide-error } +\msg_new:nnn { hooks } { cannot-remove } { - Hook~'#1'~ already~ declared~ as~ a~ - \__hook_if_reversed:nTF {#1} { reversed } { normal }~ hook! + Cannot~remove~chunk~'#2'~from~hook~'#1'~because~ + \__hook_if_structure_exist:nTF {#1} + { it~does~not~exist~in~that~hook. } + { the~hook~does~not~exist. } } +\msg_new:nnn { hooks } { generic-deprecated } { - You~ attempted~ to~ provide~ the~ hook~'#1'~ as~ a~ - \__hook_if_reversed:nTF {#1} { normal } { reversed }~ hook,~ but~ it~ - was~ already~ previously~ declared~ as~ a~ - \__hook_if_reversed:nTF {#1} { reversed } { normal }~ hook.~ - A~ redeclaration~ is~ not~ possible. + 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_provide:n}{Providing~hooks} -\NewDocumentCommand \ProvideHook { m }{ \hook_provide:n {#1} } -\NewDocumentCommand \ProvideReversedHook { m }{ \hook_provide_reversed:n {#1} } -\NewDocumentCommand \ProvideMirroredHookPair { mm }{ \hook_provide_pair:nn {#1}{#2} } -\NewDocumentCommand \DisableHook { m }{ \hook_disable:n {#1} } + {\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_provide:n}{Providing~hooks} + {\hook_activate_generic:n}{Providing~hooks} -\def \ProvideHook#1{} -\def \ProvideReversedHook#1{} -\def \ProvideMirroredHookPair#1#2{} +\def \ActivateGenericHook#1{} \EndIncludeInRelease \NewDocumentCommand \AddToHook { m o +m } { \hook_gput_code:nnn {#1} {#2} {#3} } \NewDocumentCommand \AddToHookNext { m +m } { \hook_gput_next_code:nn {#1} {#2} } +\NewDocumentCommand \ClearHookNext { m } + { \hook_gclear_next_code:n {#1} } \NewDocumentCommand \RemoveFromHook { m o } { \hook_gremove_code:nn {#1} {#2} } -\tl_gset:Nn \g__hook_hook_curr_name_tl { top-level } -\seq_if_empty:NT \g__hook_name_stack_seq - { \seq_gput_right:Nn \g__hook_name_stack_seq { top-level } } -\cs_set_protected:Npn \__hook_tmp:w #1 #2 #3 - { - \quark_if_recursion_tail_stop:n {#1} - \seq_gput_right:Nn \g__hook_name_stack_seq {#1} - \__hook_tmp:w - } -\exp_after:wN \__hook_tmp:w \@currnamestack - \q_recursion_tail \q_recursion_tail - \q_recursion_tail \q_recursion_stop -\tl_gset:Nx \g__hook_hook_curr_name_tl { \@currname } -\seq_gpop_right:NN \g__hook_name_stack_seq \l__hook_tmpa_tl -\cs_new_protected:Npn \__hook_curr_name_push:n #1 - { \exp_args:Nx \__hook_curr_name_push_aux:n { \__hook_make_name:n {#1} } } -\cs_new_protected:Npn \__hook_curr_name_push_aux:n #1 - { - \tl_if_blank:nTF {#1} - { \msg_error:nn { hooks } { no-default-label } } - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { PushDefaultHookLabel } {#1} - } - { - \seq_gpush:NV \g__hook_name_stack_seq \g__hook_hook_curr_name_tl - \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} - } - } - } -\cs_new_protected:Npn \__hook_curr_name_pop: - { - \seq_gpop:NNTF \g__hook_name_stack_seq \l__hook_return_tl - { \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl } - { \msg_error:nn { hooks } { extra-pop-label } } - } -\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage - { \__hook_end_document_label_check: } -\cs_new_protected:Npn \__hook_end_document_label_check: - { - \seq_gpop:NNT \g__hook_name_stack_seq \l__hook_return_tl - { - \msg_error:nnx { hooks } { missing-pop-label } - { \g__hook_hook_curr_name_tl } - \tl_gset_eq:NN \g__hook_hook_curr_name_tl \l__hook_return_tl - \__hook_end_document_label_check: - } - } \NewDocumentCommand \SetDefaultHookLabel { m } - { - \seq_if_empty:NTF \g__hook_name_stack_seq - { - \msg_error:nnnnn { hooks } { set-top-level } - { for } { SetDefaultHookLabel } {#1} - } - { \exp_args:Nx \__hook_set_default_label:n { \__hook_make_name:n {#1} } } - } -\cs_new_protected:Npn \__hook_set_default_label:n #1 - { - \str_if_eq:nnTF {#1} { top-level } - { - \msg_error:nnnnn { hooks } { set-top-level } - { to } { SetDefaultHookLabel } {#1} - } - { \tl_gset:Nn \g__hook_hook_curr_name_tl {#1} } - } + { \__hook_set_default_hook_label:n {#1} } \NewDocumentCommand \PushDefaultHookLabel { m } { \__hook_curr_name_push:n {#1} } \NewDocumentCommand \PopDefaultHookLabel { } @@ -5316,6 +5889,75 @@ of this package available from CTAN} \cs_new_eq:NN \IfHookEmptyTF \hook_if_empty:nTF \cs_new_eq:NN \IfHookExistsTF \__hook_if_usable:nTF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\cs_new_protected:Npn \hook_disable:n + { + \__hook_deprecated_warn:nn + { hook_disable:n } + { hook_disable_generic:n } + \hook_disable_generic:n + } +\cs_new_protected:Npn \hook_provide:n + { + \__hook_deprecated_warn:nn + { hook_provide:n } + { hook_activate_generic:n } + \hook_activate_generic:n + } +\cs_new_protected:Npn \hook_provide_reversed:n + { + \__hook_deprecated_warn:nn + { hook_provide_reversed:n } + { hook_activate_generic:n } + \__hook_activate_generic_reversed:n + } +\cs_new_protected:Npn \hook_provide_pair:nn + { + \__hook_deprecated_warn:nn + { hook_provide_pair:nn } + { hook_activate_generic:n } + \__hook_activate_generic_pair:nn + } +\cs_new_protected:Npn \__hook_activate_generic_reversed:n #1 + { \__hook_normalize_hook_args:Nn \__hook_activate_generic:nn {#1} { - } } +\cs_new_protected:Npn \__hook_activate_generic_pair:nn #1#2 + { \hook_activate_generic:n {#1} \__hook_activate_generic_reversed:n {#2} } +\cs_new_protected:Npn \DisableHook + { + \__hook_deprecated_warn:nn + { DisableHook } + { DisableGenericHook } + \hook_disable_generic:n + } +\cs_new_protected:Npn \ProvideHook + { + \__hook_deprecated_warn:nn + { ProvideHook } + { ActivateGenericHook } + \hook_activate_generic:n + } +\cs_new_protected:Npn \ProvideReversedHook + { + \__hook_deprecated_warn:nn + { ProvideReversedHook } + { ActivateGenericHook } + \__hook_activate_generic_reversed:n + } +\cs_new_protected:Npn \ProvideMirroredHookPair + { + \__hook_deprecated_warn:nn + { ProvideMirroredHookPair } + { ActivateGenericHook } + \__hook_activate_generic_pair:nn + } +\cs_new_protected:Npn \__hook_deprecated_warn:nn #1 #2 + { \msg_warning:nnnn { hooks } { deprecated } {#1} {#2} } +\msg_new:nnn { hooks } { deprecated } + { + Command~\iow_char:N\\#1~is~deprecated~and~will~be~removed~in~a~ + future~release. \\ \\ + Use~\iow_char:N\\#2~instead. + } +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \cs_new_eq:NN \@expl@@@initialize@all@@ \__hook_initialize_all: \cs_new_eq:NN \@expl@@@hook@curr@name@pop@@ @@ -5327,7 +5969,7 @@ of this package available from CTAN} \def \NewReversedHook#1{} \def \NewMirroredHookPair#1#2{} -\def \DisableHook #1{} +\def \DisableGenericHook #1{} \long\def\AddToHookNext#1#2{} @@ -5355,8 +5997,8 @@ of this package available from CTAN} %% File: ltcmdhooks.dtx (C) Copyright 2020-2021 %% Frank Mittelbach, Phelype Oleinik, LaTeX Team %%% From File: ltcmdhooks.dtx -\def\ltcmdhooksversion{v1.0b} -\def\ltcmdhooksdate{2021/05/26} +\def\ltcmdhooksversion{v1.0d} +\def\ltcmdhooksdate{2021/08/25} \ExplSyntaxOn \NewModuleRelease{2021/06/01}{ltcmdhooks} {The~hook~management~system~for~commands} @@ -5369,6 +6011,19 @@ of this package available from CTAN} \cs_new_protected:Npn \__hook_patch_debug:x #1 { \__hook_debug:n { \iow_term:x { [lthooks]~#1 } } } \cs_generate_variant:Nn \tl_rescan:nn { nV } +\IncludeInRelease{2021/11/15}{\__hook_try_put_cmd_hook:n}% + {Standardise~generic~hook~names} +\cs_new_protected:Npn \__hook_try_put_cmd_hook:n #1 + { \__hook_try_put_cmd_hook:w #1 / / / \s__hook_mark {#1} } +\cs_new_protected:Npn \__hook_try_put_cmd_hook:w + #1 / #2 / #3 / #4 \s__hook_mark #5 + { + \__hook_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } } + \exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3} + } +\EndIncludeInRelease +\IncludeInRelease{2021/06/01}{\__hook_try_put_cmd_hook:n}% + {Standardise~generic~hook~names} \cs_new_protected:Npn \__hook_try_put_cmd_hook:n #1 { \__hook_try_put_cmd_hook:w #1 / / / \s__hook_mark {#1} } \cs_new_protected:Npn \__hook_try_put_cmd_hook:w @@ -5380,6 +6035,7 @@ of this package available from CTAN} { \exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3} } { \msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} } } +\EndIncludeInRelease \cs_new_protected:Npn \__hook_patch_cmd_or_delay:Nnn #1 #2 #3 { \__hook_debug:n { \iow_term:n { ->~Add~generic~cmd~hook~for~#2~(#3). } } @@ -5466,10 +6122,17 @@ of this package available from CTAN} } \cs_new_protected:Npn \__hook_patch_DeclareRobustCommand:Nnn #1 { - \exp_args:Nc \@if@newcommand { \cs_to_str:N #1 ~ } - { \exp_args:Nc \__hook_patch_newcommand:Nnn } - { \exp_args:NNc \__hook_patch_expand_redefine:NNnn \c_false_bool } - { \cs_to_str:N #1 ~ } + \exp_args:Nc \__hook_patch_DeclareRobustCommand_aux:Nnn + { \cs_to_str:N #1 ~ } + } +\cs_new_protected:Npn \__hook_patch_DeclareRobustCommand_aux:Nnn #1 + { + \robust@command@chk@safe #1 + { \@if@newcommand #1 } + { \use_ii:nn } + { \__hook_patch_newcommand:Nnn } + { \__hook_patch_expand_redefine:NNnn \c_false_bool } + #1 } \cs_new_protected:Npn \__hook_patch_newcommand:Nnn #1 { @@ -5637,14 +6300,21 @@ of this package available from CTAN} \tl_rescan:nV { #4 \__hook_patch_required_catcodes: } \l__hook_tmpa_tl \cs_set_eq:NN #1 \kerneltmpDoNotUse } +\IncludeInRelease{2021/11/15}{wrong-cmd-hook}% + {Standardise~generic~hook~names} +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}{wrong-cmd-hook}% + {Standardise~generic~hook~names} \msg_new:nnnn { hooks } { wrong-cmd-hook } { Generic~hook~`cmd/#1/#2'~is~invalid. +% The~hook~should~be~`cmd/#1/before'~or~`cmd/#1/after'. } { You~tried~to~add~a~generic~hook~to~command~\iow_char:N \\#1,~but~`#2'~ is~an~invalid~component.~Only~`before'~or~`after'~are~allowed. } +\EndIncludeInRelease \msg_new:nnnn { hooks } { cant-patch } { Generic~hooks~cannot~be~added~to~'#1'. @@ -5674,6 +6344,29 @@ of this package available from CTAN} %%% From File: ltcntrl.dtx %%% From File: lterror.dtx \IncludeInRelease{2021/11/15}% + {\ClassNote}{Notes for classes/packages}% +\def\ClassNote#1#2{% + \GenericWarning{% + (#1) \space\space\@spaces\@spaces + }{% + Class #1 Info: #2% + }% +} +\def\ClassNoteNoLine#1#2{\ClassNote{#1}{#2\@gobble}} +\def\PackageNote#1#2{% + \GenericWarning{% + (#1) \@spaces\@spaces\@spaces + }{% + Package #1 Info: #2% + }% +} +\def\PackageNoteNoLine#1#2{\PackageNote{#1}{#2\@gobble}} +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\ClassNote}{Notes for classes/packages}% + +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}% {\@latex@note}{Display notes}% \def\@latex@note#1{% \GenericWarning{% @@ -5694,8 +6387,8 @@ of this package available from CTAN} %%% From File: ltpar.dtx %% File: ltpara.dtx (C) Copyright 2020-2021 %%% From File: ltpara.dtx -\def\ltparaversion{v1.0g} -\def\ltparadate{2021/05/27} +\def\ltparaversion{v1.0j} +\def\ltparadate{2021/09/18} \ExplSyntaxOn @@ -5748,14 +6441,15 @@ of this package available from CTAN} \cs_set_eq:NN \IndentBox \g_para_indent_box \cs_set_eq:NN \OmitIndent \para_omit_indent: \cs_new_protected:Npn \para_end: { + \scan_stop: \mode_if_horizontal:TF { \mode_if_inner:F { \tex_unskip:D \hook_use:n{para/end} \@kernel@after@para@end \mode_if_horizontal:TF { - \if_int_compare:w 0 < \tex_lastnodetype:D - \tex_kern:D \c_zero_dim + \if_int_compare:w 11 = \tex_lastnodetype:D + \tex_hskip:D \c_zero_dim \fi: \tex_par:D \hook_use:n{para/after} @@ -5775,7 +6469,7 @@ of this package available from CTAN} \__para_handle_indent: \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_indent:D } \cs_new:Npn \para_raw_noindent: { @@ -5785,7 +6479,7 @@ of this package available from CTAN} \tex_everypar:D { \g__para_standard_everypar_tl } \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_noindent:D } \cs_new_eq:NN \para_raw_end: \tex_par:D @@ -5807,7 +6501,7 @@ of this package available from CTAN} in~ #2~ mode,~ but~ it~ didn't.~ Examine~ the~ hook~ code~ with~ \iow_char:N \\ShowHook~ to~ find~ the~ issue. } -\msg_new:nnnn { kernel } { raw-para } +\msg_new:nnnn { latex2e } { raw-para } { Not~ in~ vertical~ mode. } @@ -6443,12 +7137,12 @@ of this package available from CTAN} \fi \@filehook@set@CurrentFile \UseHook{include/before}% - \UseHook{include/before/#1}% + \UseOneTimeHook{include/#1/before}% \@input@{#1.tex}% - \UseHook{include/end/#1}% + \UseOneTimeHook{include/#1/end}% \UseHook{include/end}% \clearpage - \UseHook{include/after/#1}% + \UseOneTimeHook{include/#1/after}% \UseHook{include/after}% \clearpage \@writeckpt{#1}% @@ -6460,6 +7154,9 @@ of this package available from CTAN} \@nameuse{cp@#1}% \fi \let\@auxout\@mainaux} +\NewHook{include/before} +\NewReversedHook{include/end} +\NewReversedHook{include/after} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% {\@include}{Spaces in file names}% @@ -6855,6 +7552,35 @@ of this package available from CTAN} \@ifundefined{c@#2}{\@nocounterr{#2}}% {% else both counter and within are defined #3}}} +\EndIncludeInRelease +\IncludeInRelease{0000-00-00} + {\@removefromreset}{Add interfaces}% +\let \@removefromreset \undefined +\let \@ifbothcounters \undefined +\EndIncludeInRelease +\IncludeInRelease{2021/11/15}% + {\counterwithout}{counter without/within}% +\NewDocumentCommand \counterwithout {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@removefromreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\endcsname {#2{#3}}}% + }% +} +\NewDocumentCommand \counterwithin {sO{\arabic}mm}{% + \@ifbothcounters{#3}{#4}{% + \@addtoreset{#3}{#4}% + \IfBooleanF #1% + {\expandafter + \gdef\csname the#3\expandafter\endcsname + \expandafter + {\csname the#4\endcsname .#2{#3}}}% + }% +} +\EndIncludeInRelease +\IncludeInRelease{2018-04-01} + {\counterwithout}{counter without/within}% \def\counterwithout {\@ifstar\counterwithout@s\counterwithout@x} \def\counterwithout@s#1#2{% @@ -6881,9 +7607,7 @@ of this package available from CTAN} \EndIncludeInRelease \IncludeInRelease{0000-00-00} - {\@removefromreset}{Add interfaces}% -\let \@removefromreset \undefined -\let \@ifbothcounters \undefined + {\counterwithout}{counter without/within}% \let \counterwithout \undefined \let \counterwithout@s \undefined \let \counterwithout@x \undefined @@ -6891,7 +7615,7 @@ of this package available from CTAN} \let \counterwithin@s \undefined \let \counterwithin@x \undefined \EndIncludeInRelease -\IncludeInRelease{2015/01/01}{\@fnsymbol}{Use \TexOrMath}% +\IncludeInRelease{2015/01/01}{\@fnsymbol}{Use \TextOrMath}% \def\@fnsymbol#1{% \ifcase#1\or \TextOrMath\textasteriskcentered *\or \TextOrMath \textdagger \dagger\or @@ -6905,7 +7629,7 @@ of this package available from CTAN} \@ctrerr \fi }% \EndIncludeInRelease -\IncludeInRelease{0000/00/00}{\@fnsymbol}{Use \TexOrMath}% +\IncludeInRelease{0000/00/00}{\@fnsymbol}{Use \TextOrMath}% \def\@fnsymbol#1{\ensuremath{% \ifcase#1\or *\or \dagger\or \ddagger\or \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger @@ -8330,8 +9054,44 @@ of this package available from CTAN} %%% From File: ltfssini.dtx %% Copyright (C) 1989-2001 Frank Mittelbach and Rainer Sch\"opf, %% all rights reserved. +\IncludeInRelease{2021/11/15}% + {\DeclareFontSeriesDefault}{Custom series}% +\let\DeclareFontSeriesDefault\@undefined % for rollback +\newcommand\DeclareFontSeriesDefault[3][]{% + \expand@font@defaults + \maybe@update@bfseries@defaults + \maybe@update@mdseries@defaults + \def\reserved@a{#1}% + \ifx\reserved@a\@empty + \ifcsname #2series\endcsname % supported are + % \[md/bf]default + \expandafter\def + \csname #2default\endcsname{#3\@empty}% + \expandafter\def + \csname #2default@previous\endcsname{#3\@empty}% + \else + \@latex@error{Wrong syntax for \string\DeclareFontSeriesDefault}% + {Mandatory first argument must be 'md' or 'bf'.} + \fi + \else + \ifcsname #2series@#1\endcsname % supported are + % \[md/bf]series@[rm/sf/tt] + \expandafter\edef + \csname #2series@#1\endcsname{#3}% + \expandafter\let + \csname #2series@#1@kernel\endcsname\@undefined + \else + \@latex@error{Wrong syntax for \string\DeclareFontSeriesDefault}% + {Optional argument must be 'rm', 'sf', or 'tt'. \MessageBreak + Mandatory first argument must be 'md' or 'bf'.} + \fi + \fi +} + +\EndIncludeInRelease \IncludeInRelease{2020/02/02}% {\DeclareFontSeriesDefault}{Custom series}% + \let\DeclareFontSeriesDefault\@undefined % for rollback \newcommand\DeclareFontSeriesDefault[3][]{% \def\reserved@a{#1}% @@ -8361,6 +9121,32 @@ of this package available from CTAN} \fi } +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\DeclareFontSeriesDefault}{Custom series}% + +\let\DeclareFontSeriesDefault\@undefined +\let\bfseries@rm\@undefined +\let\bfseries@sf\@undefined +\let\bfseries@tt\@undefined +\let\bfseries@rm@kernel\@undefined +\let\bfseries@sf@kernel\@undefined +\let\bfseries@tt@kernel\@undefined +\let\mdseries@rm\@undefined +\let\mdseries@sf\@undefined +\let\mdseries@tt\@undefined +\expandafter\let\csname ver@mweights.sty\endcsname\@undefined + +\let\@meta@family@list\@undefined +\let\prepare@family@series@update\@undefined +\let\update@series@target@value\@undefined + +\let\init@series@setup\relax + +\EndIncludeInRelease +\IncludeInRelease{2020/02/02}% + {\mdseries@rm}{Custom series}% + \def\bfseries@rm{bx} \def\bfseries@sf{bx} \def\bfseries@tt{bx} @@ -8442,9 +9228,8 @@ of this package available from CTAN} \expandafter\let\csname ver@mweights.sty\endcsname\fmtversion \EndIncludeInRelease \IncludeInRelease{0000/00/00}% - {\DeclareFontSeriesDefault}{Custom series}% + {\mdseries@rm}{Custom series}% -\let\DeclareFontSeriesDefault\@undefined \let\bfseries@rm\@undefined \let\bfseries@sf\@undefined \let\bfseries@tt\@undefined @@ -8463,18 +9248,65 @@ of this package available from CTAN} \let\init@series@setup\relax \EndIncludeInRelease -\IncludeInRelease{2020/10/01}% +\IncludeInRelease{2021/11/15}% {\bfseries}{Custom series with hooks}% -\def\expand@font@defaults{% - \edef\rmdef@ult{\rmdefault}% - \edef\sfdef@ult{\sfdefault}% - \edef\ttdef@ult{\ttdefault}% - \series@maybe@drop@one@m\bfdefault\bfdef@ult - \series@maybe@drop@one@m\mddefault\mddef@ult - \UseHook{expand@font@defaults}% +\DeclareRobustCommand\bfseries{% + \not@math@alphabet\bfseries\mathbf + \expand@font@defaults + \maybe@update@bfseries@defaults + \ifx\f@family\rmdef@ult \fontseries\bfseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt + \else \fontseries\bfdefault + \fi\fi\fi + \UseHook{bfseries}% + \selectfont } +\def\maybe@update@bfseries@defaults{% + \ifx\bfdefault\bfdefault@previous\else + \expandafter\def\expandafter\bfdefault + \expandafter{\bfdefault\@empty}% + \let\bfdefault@previous\bfdefault + \let\bfseries@rm\bfdef@ult + \let\bfseries@sf\bfdef@ult + \let\bfseries@tt\bfdef@ult + \UseHook{bfseries/defaults}% + \fi +} + +\DeclareRobustCommand\mdseries{% + \not@math@alphabet\mdseries\relax + \expand@font@defaults + \maybe@update@mdseries@defaults + \ifx\f@family\rmdef@ult \fontseries\mdseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt + \else \fontseries\mddefault + \fi\fi\fi + \UseHook{mdseries}% + \selectfont +} + +\def\maybe@update@mdseries@defaults{% + \ifx\mddefault\mddefault@previous\else + \expandafter\def\expandafter\mddefault\expandafter{\mddefault\@empty}% + \let\mddefault@previous\mddefault + \let\mdseries@rm\mddef@ult + \let\mdseries@sf\mddef@ult + \let\mdseries@tt\mddef@ult + \UseHook{mdseries/defaults}% + \fi +} + +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}% + {\bfseries}{Custom series with hooks}% + +\let\maybe@update@bfseries@defaults\@undefined +\let\maybe@update@mdseries@defaults\@undefined + \DeclareRobustCommand\bfseries{% \not@math@alphabet\bfseries\mathbf \expand@font@defaults @@ -8515,6 +9347,58 @@ of this package available from CTAN} \UseHook{mdseries}% \selectfont } +\EndIncludeInRelease +\IncludeInRelease{2020/02/02}% + {\bfseries}{Custom series with hooks}% + + +\DeclareRobustCommand\bfseries{% + \not@math@alphabet\bfseries\mathbf + \expand@font@defaults + \ifx\f@family\rmdef@ult \fontseries\bfseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt + \else \fontseries\bfdefault + \fi\fi\fi + \selectfont +} + +\DeclareRobustCommand\mdseries{% + \not@math@alphabet\mdseries\relax + \expand@font@defaults + \ifx\f@family\rmdef@ult \fontseries\mdseries@rm + \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf + \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt + \else \fontseries\mddefault + \fi\fi\fi + \selectfont +} + + + +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\bfseries}{Custom series with hooks}% + +\DeclareRobustCommand\bfseries + {\not@math@alphabet\bfseries\mathbf + \fontseries\bfdefault\selectfont} +\DeclareRobustCommand\mdseries + {\not@math@alphabet\mdseries\relax + \fontseries\mddefault\selectfont} + +\EndIncludeInRelease +\IncludeInRelease{2020/10/01}% + {\expand@font@defaults}{Custom series with hooks}% + +\def\expand@font@defaults{% + \edef\rmdef@ult{\rmdefault}% + \edef\sfdef@ult{\sfdefault}% + \edef\ttdef@ult{\ttdefault}% + \series@maybe@drop@one@m\bfdefault\bfdef@ult + \series@maybe@drop@one@m\mddefault\mddef@ult + \UseHook{expand@font@defaults}% +} \DeclareRobustCommand\rmfamily{% \not@math@alphabet\rmfamily\mathrm @@ -8546,7 +9430,7 @@ of this package available from CTAN} \let\@defaultfamilyhook\@empty %FMi sort out \EndIncludeInRelease \IncludeInRelease{2020/02/02}% - {\bfseries}{Custom series with hooks}% + {\expand@font@defaults}{Custom series with hooks}% \def\expand@font@defaults{% \edef\rmdef@ult{\rmdefault}% @@ -8557,27 +9441,6 @@ of this package available from CTAN} \edef\famdef@ult{\familydefault}% } -\DeclareRobustCommand\bfseries{% - \not@math@alphabet\bfseries\mathbf - \expand@font@defaults - \ifx\f@family\rmdef@ult \fontseries\bfseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\bfseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\bfseries@tt - \else \fontseries\bfdefault - \fi\fi\fi - \selectfont -} - -\DeclareRobustCommand\mdseries{% - \not@math@alphabet\mdseries\relax - \expand@font@defaults - \ifx\f@family\rmdef@ult \fontseries\mdseries@rm - \else\ifx\f@family\sfdef@ult \fontseries\mdseries@sf - \else\ifx\f@family\ttdef@ult \fontseries\mdseries@tt - \else \fontseries\mddefault - \fi\fi\fi - \selectfont -} \DeclareRobustCommand\rmfamily{% \not@math@alphabet\rmfamily\mathrm @@ -8601,7 +9464,7 @@ of this package available from CTAN} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% - {\bfseries}{Custom series with hooks}% + {\expand@font@defaults}{Custom series with hooks}% \let\expand@font@defaults\@undefined @@ -11238,6 +12101,18 @@ of this package available from CTAN} \def\addcontentsline#1#2#3{% \addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}}} \EndIncludeInRelease +\IncludeInRelease{2021/11/15}% + {\contentsline}{Four arguments}% +\def\contentsline#1#2#3#4{\gdef\@contentsline@destination{#4}% + \csname l@#1\endcsname{#2}{#3}} +\let\@contentsline@destination\@empty +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\contentsline}{Four arguments}% + +\def\contentsline#1{\csname l@#1\endcsname} +\let\@contentsline@destination\@undefined +\EndIncludeInRelease \IncludeInRelease{2018/12/01}% {\@dottedtocline}{Prevent protrusion}% \def\@dottedtocline#1#2#3#4#5{% @@ -11663,6 +12538,7 @@ of this package available from CTAN} \EndIncludeInRelease %%% From File: ltclass.dtx + \IncludeInRelease{2020/10/01}{\@currpath}% {Add \@currpath}% \let\@currpath\@empty @@ -11778,9 +12654,6 @@ of this package available from CTAN} \def\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \let\IfPackageAtLeastTF\@ifpackagelater \let\IfClassAtLeastTF\@ifclasslater -\@onlypreamble\IfFormatAtLeastTF -\@onlypreamble\IfPackageAtLeastTF -\@onlypreamble\IfClassAtLeastTF \EndIncludeInRelease \IncludeInRelease{0000/00/00}% {\IfFormatAtLeastTF}{Test format date}% @@ -11844,6 +12717,22 @@ of this package available from CTAN} }% \reserved@a} \EndIncludeInRelease +\IncludeInRelease{2021/11/15}% + {\IfPackageLoadedtTF}{Test package loading}% +\let \IfPackageLoadedTF \@ifpackageloaded +\let \IfClassLoadedTF \@ifclassloaded +\let \IfPackageLoadedWithOptionsTF \@ifpackagewith +\let \IfClassLoadedWithOptionsTF \@ifclasswith +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\IfPackageLoadedtTF}{Test package loading}% + +\let \IfPackageLoadedTF \@ifpackageloaded +\let \IfClassLoadedTF \@ifclassloaded +\let \IfPackageLoadedWithOptionsTF \@ifpackagewith +\let \IfClassLoadedWithOptionsTF \@ifclasswith + +\EndIncludeInRelease \IncludeInRelease{2020/10/01}% {\ProvidesPackage}{Check name with \strcmp}% \def\ProvidesPackage#1{% @@ -12130,7 +13019,7 @@ of this package available from CTAN} \def\reserved@b##1,{% \ifx\@nnil##1\relax\else \ifx\@nnil##1\@nnil\else - \noexpand\@onefilewithoptions##1[{#2}][{#4}]% + \noexpand\@onefilewithoptions##1[{\unexpanded{#2}}][{#4}]% \noexpand\@pkgextension \fi \expandafter\reserved@b @@ -12287,11 +13176,11 @@ of this package available from CTAN} \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty \ifx\@currext\@pkgextension \UseHook{package/before}% - \UseHook{package/before/\@currname}% + \UseOneTimeHook{package/\@currname/before}% \else \ifx\@currext\@clsextension \UseHook{class/before}% - \UseHook{class/before/\@currname}% + \UseOneTimeHook{class/\@currname/before}% \fi \fi \InputIfFileExists{\@currpath\@currpkg@reqd}{}% @@ -12311,15 +13200,19 @@ of this package available from CTAN} \csname unprocessedoptions-\@currname.\@currext\endcsname \@undefined \ifx\@currext\@pkgextension - \UseHook{package/after/\@currname}% + \UseOneTimeHook{package/\@currname/after}% \UseHook{package/after}% \else \ifx\@currext\@clsextension - \UseHook{class/after/\@currname}% + \UseOneTimeHook{class/\@currname/after}% \UseHook{class/after}% \fi \fi}% \@ifl@aded\@currext\@currname{}{\reserved@a}} +\NewHook{package/before} +\NewHook{class/before} +\NewReversedHook{package/after} +\NewReversedHook{class/after} \EndIncludeInRelease \IncludeInRelease{0000/00/00}% {\@onefilewithoptions}{Hooks and unused options issue}% @@ -12741,8 +13634,8 @@ of this package available from CTAN} \endgroup% \EndIncludeInRelease %%% From File: ltfilehook.dtx -\providecommand\ltfilehookversion{v1.0k} -\providecommand\ltfilehookdate{2021/05/25} +\providecommand\ltfilehookversion{v1.0l} +\providecommand\ltfilehookdate{2021/08/27} \IncludeInRelease{2020/10/01}% {\CurrentFile}{Hook management file}% \ExplSyntaxOn @@ -12809,7 +13702,7 @@ of this package available from CTAN} \seq_gpop:NNTF \g__filehook_input_file_seq \l__filehook_internal_tl { \exp_after:wN \__filehook_file_pop_assign:nnnn \l__filehook_internal_tl } { - \msg_error:nnn { kernel } { should-not-happen } + \msg_error:nnn { latex2e } { should-not-happen } { Tried~to~pop~from~an~empty~file~name~stack. } } } @@ -12900,12 +13793,14 @@ of this package available from CTAN} {\edef\reserved@a{\unqu@tefilef@und#1\@nil}% \@addtofilelist{\string@makeletter\reserved@a}% \UseHook{file/before}% - \UseHook{file/before/\CurrentFile}% + \UseHook{file/\CurrentFile/before}% \@@input #1% <- trailing space comes from \@filef@und }% - \UseHook{file/after/\CurrentFile}% + \UseHook{file/\CurrentFile/after}% \UseHook{file/after}} \def\unqu@tefilef@und"#1" \@nil{#1} +\NewHook{file/before} +\NewReversedHook{file/after} \EndIncludeInRelease \IncludeInRelease{2019/10/01}% {\InputIfFileExists}{Hook management (files)}% @@ -13126,13 +14021,13 @@ of this package available from CTAN} \cs_generate_variant:Nn \__filehook_file_subst_loop:NN { cc } \cs_new:Npn \__filehook_file_subst_cycle_error:NN #1 #2 { - \__kernel_msg_expandable_error:nnff { kernel } { file-cycle } + \msg_expandable_error:nnff { latex2e } { file-cycle } {#1} { \use:c { @file-subst@ #1 } } \token_if_eq_meaning:NNF #1 #2 { \__filehook_file_subst_cycle_error:cN { @file-subst@ #1 } #2 } } \cs_generate_variant:Nn \__filehook_file_subst_cycle_error:NN { c } -\__kernel_msg_new:nnn { kernel } { file-cycle } +\msg_new:nnn { latex2e } { file-cycle } { File~loop!~#1~replaced~by~#2... } \ExplSyntaxOff \EndIncludeInRelease @@ -14355,6 +15250,36 @@ of this package available from CTAN} \endgroup }% \EndIncludeInRelease +\IncludeInRelease{2021/11/15}% + {\ShowFloat}{Show float register contents}% +\def\ShowFloat#1{\begingroup + \let \fl@trace \fl@tracemessage + \fl@trace{***Float #1 details:}% + \ifcsname bx@#1\endcsname + \expandafter\fl@ShowFloat\csname bx@#1\endcsname + \else + \fl@trace{Not a float!}% + \fi + \endgroup +} +\def\fl@ShowFloat#1{% + \fl@traceval{\count#1}% % this here should be interpreted on day + \fl@traceval{\ht#1}% + \fl@traceval{\dp#1}% + \fl@traceval{\wd#1}% + {\tracingonline1\showboxbreadth10\showboxdepth3\showbox#1}% +} +\def \fl@traceval #1{\fl@trace{\string #1 = \the #1}} +\def \fl@tracemessage #1{{\let\@elt\@empty\typeout{LaTeX2e: #1}}} +\EndIncludeInRelease +\IncludeInRelease{0000/00/00}% + {\ShowFloat}{Show float register contents}% + +\let\ShowFloat\@undefined +\let\fl@ShowFloat\@undefined +\let\fl@traceval\@undefined +\let\fl@tracemessage\@undefined +\EndIncludeInRelease \IncludeInRelease{2017/01/01}% {\@makefcolumn}{negative height floats}% \def\@makefcolumn #1{% diff --git a/Master/texmf-dist/tex/latex-dev/base/lcyenc.dfu b/Master/texmf-dist/tex/latex-dev/base/lcyenc.dfu index 5c058731ed7..50dd6990de4 100644 --- a/Master/texmf-dist/tex/latex-dev/base/lcyenc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/lcyenc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{lcyenc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A4}{\textcurrency} \DeclareUnicodeCharacter{00AB}{\guillemotleft} \DeclareUnicodeCharacter{00BB}{\guillemotright} diff --git a/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua b/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua index 193514467b2..118a36a2745 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua +++ b/Master/texmf-dist/tex/latex-dev/base/ltluatex.lua @@ -48,6 +48,7 @@ local tex_count = tex.count local tex_setattribute = tex.setattribute local tex_setcount = tex.setcount local texio_write_nl = texio.write_nl +local flush_list = node.flush_list local luatexbase_warning local luatexbase_error local modules = modules or { } diff --git a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex index 90b6d2dfe7e..75e2d234aa4 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex +++ b/Master/texmf-dist/tex/latex-dev/base/ltluatex.tex @@ -47,7 +47,7 @@ #1#2[#3]{\endgroup\immediate\write-1{File: #1 #3}} \fi \ProvidesFile{ltluatex.tex}% -[2021/04/18 v1.1t +[2021/08/11 v1.1u LuaTeX support for plain TeX (core) ] \edef\etatcatcode{\the\catcode`\@} diff --git a/Master/texmf-dist/tex/latex-dev/base/ly1enc.dfu b/Master/texmf-dist/tex/latex-dev/base/ly1enc.dfu index 5cea84e7d57..3090b54dc8e 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ly1enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/ly1enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{ly1enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{00A1}{\textexclamdown} \DeclareUnicodeCharacter{00A2}{\textcent} diff --git a/Master/texmf-dist/tex/latex-dev/base/omsenc.dfu b/Master/texmf-dist/tex/latex-dev/base/omsenc.dfu index 7a3cab3a6c7..64f5fc546d7 100644 --- a/Master/texmf-dist/tex/latex-dev/base/omsenc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/omsenc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{omsenc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A7}{\textsection} \DeclareUnicodeCharacter{00B6}{\textparagraph} \DeclareUnicodeCharacter{00B7}{\textperiodcentered} diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1enc.def b/Master/texmf-dist/tex/latex-dev/base/ot1enc.def index 7ee4e30b0a8..f8aa170419f 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1enc.def +++ b/Master/texmf-dist/tex/latex-dev/base/ot1enc.def @@ -94,9 +94,9 @@ {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex% \rlap{\raise.67\dimen@\hbox{\char23}}A} \DeclareTextCommand{\ij}{OT1}{% - \nobreak\hskip\z@skip i\kern-0.02em j\nobreak\hskip\z@skip} + \nobreak\hskip\z@skip i\kern-0.02em\nobreak\hskip\z@skip j} \DeclareTextCommand{\IJ}{OT1}{% - \nobreak\hskip\z@skip I\kern-0.02em J\nobreak\hskip\z@skip} + \nobreak\hskip\z@skip I\kern-0.02em\nobreak\hskip\z@skip J} \DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup \ifdim \fontdimen\@ne\font >\z@ \slshape diff --git a/Master/texmf-dist/tex/latex-dev/base/ot1enc.dfu b/Master/texmf-dist/tex/latex-dev/base/ot1enc.dfu index 1be3e9f4a85..ae8a166bbfe 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot1enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/ot1enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{ot1enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{00A1}{\textexclamdown} \DeclareUnicodeCharacter{00A3}{\textsterling} diff --git a/Master/texmf-dist/tex/latex-dev/base/ot2enc.dfu b/Master/texmf-dist/tex/latex-dev/base/ot2enc.dfu index 57c450f40b8..9ba7e1a2f5e 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ot2enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/ot2enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{ot2enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00AB}{\guillemotleft} \DeclareUnicodeCharacter{00BB}{\guillemotright} \DeclareUnicodeCharacter{0131}{\i} diff --git a/Master/texmf-dist/tex/latex-dev/base/report.cls b/Master/texmf-dist/tex/latex-dev/base/report.cls index 73daababc50..3c6221ed6a1 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} - [2021/02/12 v1.4n + [2021/09/11 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 8e03dcfb069..ba08cc0a1da 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} - [2021/02/12 v1.4n + [2021/09/11 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 a261d777333..31b05c0c872 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} - [2021/02/12 v1.4n + [2021/09/11 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 8890acb340e..bc7051ed988 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} - [2021/02/12 v1.4n + [2021/09/11 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 968059fd6d7..a46772c3fcf 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.0k} -\providecommand\ltfilehookdate{2021/05/25} +\providecommand\ltfilehookversion{v1.0l} +\providecommand\ltfilehookdate{2021/08/27} \ProvidesExplPackage {structuredlog}{\ltfilehookdate}{\ltfilehookversion} {Structuring the TeX transcript file} diff --git a/Master/texmf-dist/tex/latex-dev/base/t1enc.dfu b/Master/texmf-dist/tex/latex-dev/base/t1enc.dfu index 050ad5eba4d..f1ff30c8a33 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t1enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/t1enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{t1enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{00A1}{\textexclamdown} \DeclareUnicodeCharacter{00A3}{\textsterling} @@ -262,15 +262,25 @@ \DeclareUnicodeCharacter{1E02}{\.B} \DeclareUnicodeCharacter{1E03}{\.b} \DeclareUnicodeCharacter{1E0D}{\d d} +\DeclareUnicodeCharacter{1E1E}{\.F} +\DeclareUnicodeCharacter{1E1F}{\.f} \DeclareUnicodeCharacter{1E25}{\d h} +\DeclareUnicodeCharacter{1E30}{\@tabacckludge'K} +\DeclareUnicodeCharacter{1E31}{\@tabacckludge'k} \DeclareUnicodeCharacter{1E37}{\d l} +\DeclareUnicodeCharacter{1E8E}{\.Y} +\DeclareUnicodeCharacter{1E8F}{\.y} \DeclareUnicodeCharacter{1E43}{\d m} \DeclareUnicodeCharacter{1E45}{\.n} \DeclareUnicodeCharacter{1E47}{\d n} \DeclareUnicodeCharacter{1E5B}{\d r} \DeclareUnicodeCharacter{1E63}{\d s} \DeclareUnicodeCharacter{1E6D}{\d t} +\DeclareUnicodeCharacter{1E90}{\^Z} +\DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E9E}{\SS} +\DeclareUnicodeCharacter{1EF2}{\@tabacckludge`Y} +\DeclareUnicodeCharacter{1EF3}{\@tabacckludge`y} \DeclareUnicodeCharacter{200C}{\textcompwordmark} \DeclareUnicodeCharacter{2010}{-} \DeclareUnicodeCharacter{2011}{\mbox{-}} diff --git a/Master/texmf-dist/tex/latex-dev/base/t2aenc.dfu b/Master/texmf-dist/tex/latex-dev/base/t2aenc.dfu index c4d7f734da6..d053792c02d 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t2aenc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/t2aenc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{t2aenc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A4}{\textcurrency} \DeclareUnicodeCharacter{00A7}{\textsection} \DeclareUnicodeCharacter{00AB}{\guillemotleft} diff --git a/Master/texmf-dist/tex/latex-dev/base/t2benc.dfu b/Master/texmf-dist/tex/latex-dev/base/t2benc.dfu index 800fd6d1cef..b0b8f4d8d04 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t2benc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/t2benc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{t2benc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A4}{\textcurrency} \DeclareUnicodeCharacter{00A7}{\textsection} \DeclareUnicodeCharacter{00AB}{\guillemotleft} diff --git a/Master/texmf-dist/tex/latex-dev/base/t2cenc.dfu b/Master/texmf-dist/tex/latex-dev/base/t2cenc.dfu index c6ef85d0a17..5d00592efef 100644 --- a/Master/texmf-dist/tex/latex-dev/base/t2cenc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/t2cenc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{t2cenc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A4}{\textcurrency} \DeclareUnicodeCharacter{00A7}{\textsection} \DeclareUnicodeCharacter{00AB}{\guillemotleft} diff --git a/Master/texmf-dist/tex/latex-dev/base/ts1enc.dfu b/Master/texmf-dist/tex/latex-dev/base/ts1enc.dfu index 7b208d706ca..48928a782c5 100644 --- a/Master/texmf-dist/tex/latex-dev/base/ts1enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/ts1enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{ts1enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A2}{\textcent} \DeclareUnicodeCharacter{00A3}{\textsterling} \DeclareUnicodeCharacter{00A4}{\textcurrency} diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmdh.fd b/Master/texmf-dist/tex/latex-dev/base/tulmdh.fd index a7a89870404..fb4c556193a 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmdh.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmdh.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmdh.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmdh}{}% \DeclareFontShape{TU}{lmdh}{m}{n} {<-> \UnicodeFontFile{lmromandunh10-regular}{\UnicodeFontTeXLigatures} diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmr.fd b/Master/texmf-dist/tex/latex-dev/base/tulmr.fd index ea6ff725291..ff9da4e6b75 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmr.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmr.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmr.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmr}{} \DeclareFontShape{TU}{lmr}{m}{n}% {<-5.5> \UnicodeFontFile{lmroman5-regular}{\UnicodeFontTeXLigatures} @@ -75,7 +75,7 @@ \DeclareFontShape{TU}{lmr}{m}{sc}% {<-> \UnicodeFontFile{lmromancaps10-regular}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{m}{ui}% - {<-> ec-lmu10}{} + {<-> \UnicodeFontFile{lmromanunsl10-regular}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{m}{scsl}% {<-> \UnicodeFontFile{lmromancaps10-oblique}{\UnicodeFontTeXLigatures}}{} \DeclareFontShape{TU}{lmr}{b}{n} diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmss.fd b/Master/texmf-dist/tex/latex-dev/base/tulmss.fd index 13cdb78cd71..4c943374dd0 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmss.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmss.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmss.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmss}{} \DeclareFontShape{TU}{lmss}{m}{n} {<-8.5> \UnicodeFontFile{lmsans8-regular}{\UnicodeFontTeXLigatures} diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmssq.fd b/Master/texmf-dist/tex/latex-dev/base/tulmssq.fd index a74bbbb905c..42fc0df3a06 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmssq.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmssq.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmssq.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmssq}{} \DeclareFontShape{TU}{lmssq}{m}{n} {<-> \UnicodeFontFile{lmsansquot8-regular}{\UnicodeFontTeXLigatures}}{} diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmtt.fd b/Master/texmf-dist/tex/latex-dev/base/tulmtt.fd index 89a005a23b6..b6d693d4c98 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmtt.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmtt}{% \hyphenchar \font\m@ne \fontdimen3\font\z@ diff --git a/Master/texmf-dist/tex/latex-dev/base/tulmvtt.fd b/Master/texmf-dist/tex/latex-dev/base/tulmvtt.fd index c4cb02ae7fe..cd21e05d488 100644 --- a/Master/texmf-dist/tex/latex-dev/base/tulmvtt.fd +++ b/Master/texmf-dist/tex/latex-dev/base/tulmvtt.fd @@ -46,7 +46,7 @@ %% making successful document exchange impossible. %% \ProvidesFile{tulmvtt.fd} - [2017/01/26 v1.8 Standard LaTeX font definitions for Latin Modern] + [2021/07/23 v1.8a Standard LaTeX font definitions for Latin Modern] \DeclareFontFamily{TU}{lmvtt}{} \ifx\lmtt@use@light@as@normal\@empty \DeclareFontShape{TU}{lmvtt}{sb}{n} diff --git a/Master/texmf-dist/tex/latex-dev/base/utf8.def b/Master/texmf-dist/tex/latex-dev/base/utf8.def index 3ff758560c2..fd3bfed819f 100644 --- a/Master/texmf-dist/tex/latex-dev/base/utf8.def +++ b/Master/texmf-dist/tex/latex-dev/base/utf8.def @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{utf8.def} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \ifx\ifincsname\@undefined % old e-pTeX or e-upTeX engines \input utf8-2018.def \expandafter\@firstofone diff --git a/Master/texmf-dist/tex/latex-dev/base/utf8enc.dfu b/Master/texmf-dist/tex/latex-dev/base/utf8enc.dfu index afd05d021fc..2833b449d9b 100644 --- a/Master/texmf-dist/tex/latex-dev/base/utf8enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/utf8enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{utf8enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A0}{\nobreakspace} \DeclareUnicodeCharacter{00A1}{\textexclamdown} \DeclareUnicodeCharacter{00A2}{\textcent} @@ -513,15 +513,25 @@ \DeclareUnicodeCharacter{1E02}{\.B} \DeclareUnicodeCharacter{1E03}{\.b} \DeclareUnicodeCharacter{1E0D}{\d d} +\DeclareUnicodeCharacter{1E1E}{\.F} +\DeclareUnicodeCharacter{1E1F}{\.f} \DeclareUnicodeCharacter{1E25}{\d h} +\DeclareUnicodeCharacter{1E30}{\@tabacckludge'K} +\DeclareUnicodeCharacter{1E31}{\@tabacckludge'k} \DeclareUnicodeCharacter{1E37}{\d l} +\DeclareUnicodeCharacter{1E8E}{\.Y} +\DeclareUnicodeCharacter{1E8F}{\.y} \DeclareUnicodeCharacter{1E43}{\d m} \DeclareUnicodeCharacter{1E45}{\.n} \DeclareUnicodeCharacter{1E47}{\d n} \DeclareUnicodeCharacter{1E5B}{\d r} \DeclareUnicodeCharacter{1E63}{\d s} \DeclareUnicodeCharacter{1E6D}{\d t} +\DeclareUnicodeCharacter{1E90}{\^Z} +\DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E9E}{\SS} +\DeclareUnicodeCharacter{1EF2}{\@tabacckludge`Y} +\DeclareUnicodeCharacter{1EF3}{\@tabacckludge`y} \DeclareUnicodeCharacter{200C}{\textcompwordmark} \DeclareUnicodeCharacter{2010}{-} \DeclareUnicodeCharacter{2011}{\mbox{-}} diff --git a/Master/texmf-dist/tex/latex-dev/base/x2enc.dfu b/Master/texmf-dist/tex/latex-dev/base/x2enc.dfu index 55885495064..85b68cbc274 100644 --- a/Master/texmf-dist/tex/latex-dev/base/x2enc.dfu +++ b/Master/texmf-dist/tex/latex-dev/base/x2enc.dfu @@ -42,7 +42,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. \ProvidesFile{x2enc.dfu} - [2021/06/08 v1.2m UTF-8 support] + [2021/06/21 v1.2n UTF-8 support] \DeclareUnicodeCharacter{00A4}{\textcurrency} \DeclareUnicodeCharacter{00A7}{\textsection} \DeclareUnicodeCharacter{00AB}{\guillemotleft} diff --git a/Master/texmf-dist/tex/latex-dev/firstaid/filehook-ltx.sty b/Master/texmf-dist/tex/latex-dev/firstaid/filehook-ltx.sty index 2c80f60003b..8ae26decc4f 100644 --- a/Master/texmf-dist/tex/latex-dev/firstaid/filehook-ltx.sty +++ b/Master/texmf-dist/tex/latex-dev/firstaid/filehook-ltx.sty @@ -53,43 +53,43 @@ \newcommand\AtEndOfClasses [1] {\AddToHook{class/after}{#1}} \newcommand\AtBeginOfFile [2] - {\AddToHook{file/before/#1}{#2}} + {\AddToHook{file/#1/before}{#2}} \newcommand\AtEndOfFile [2] - {\AddToHook{file/after/#1}{#2}} + {\AddToHook{file/#1/after}{#2}} \DeclareDocumentCommand \AtBeginOfPackageFile {smm} {\IfBooleanTF{#1}% {\@ifpackageloaded{#2}% {#3}% - {\AddToHook{package/before/#2}{#3}}}% - {\AddToHook{package/before/#2}{#3}}% + {\AddToHook{package/#2/before}{#3}}}% + {\AddToHook{package/#2/before}{#3}}% } \DeclareDocumentCommand \AtEndOfPackageFile {smm} {\IfBooleanTF{#1}% {\@ifpackageloaded{#2}% {#3}% - {\AddToHook{package/after/#2}{#3}}}% - {\AddToHook{package/after/#2}{#3}}% + {\AddToHook{package/#2/after}{#3}}}% + {\AddToHook{package/#2/after}{#3}}% } \DeclareDocumentCommand \AtBeginOfClassFile {smm} {\IfBooleanTF{#1}% {\@ifclassloaded{#2}% {#3}% - {\AddToHook{class/before/#2}{#3}}}% - {\AddToHook{class/before/#2}{#3}}% + {\AddToHook{class/#2/before}{#3}}}% + {\AddToHook{class/#2/before}{#3}}% } \DeclareDocumentCommand \AtEndOfClassFile {smm} {\IfBooleanTF{#1}% {\@ifclassloaded{#2}% {#3}% - {\AddToHook{class/after/#2}{#3}}}% - {\AddToHook{class/after/#2}{#3}}% + {\AddToHook{class/#2/after}{#3}}}% + {\AddToHook{class/#2/after}{#3}}% } \newcommand\AtBeginOfIncludeFile [2] - {\AddToHook{include/before/#1}{#2}} + {\AddToHook{include/#1/before}{#2}} \newcommand\AtEndOfIncludeFile [2] - {\AddToHook{include/end/#1}{#2}} + {\AddToHook{include/#1/end}{#2}} \newcommand\AfterIncludeFile [2] - {\AddToHook{include/after/#1}{#2}} + {\AddToHook{include/#1/after}{#2}} \endinput %% %% End of file `filehook-ltx.sty'. diff --git a/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx b/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx index e3d58b7a8ca..f4799c0581e 100644 --- a/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx +++ b/Master/texmf-dist/tex/latex-dev/firstaid/latex2e-first-aid-for-external-files.ltx @@ -34,21 +34,25 @@ %% %% The LaTeX Project and any individual authors listed elsewhere %% in this file. -\def\LaTeXFirstAidDate{2021/06/08} -\def\LaTeXFirstAidVersion{v1.0m} +\def\LaTeXFirstAidDate{2021/06/28} +\def\LaTeXFirstAidVersion{v1.0o} \ProvidesFile{latex2e-first-aid-for-external-files.ltx} [\LaTeXFirstAidDate\space \LaTeXFirstAidVersion\space LaTeX kernel fixes to external files and packages] - % - \ExplSyntaxOn \cs_new:Npn\FirstAidNeededT#1#2#3{ \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3} - { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!} } + { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J + \@spaces Expected:^^J + \@spaces\@spaces #3^^J + \@spaces but~ found:^^J + \@spaces\@spaces \use:c{ver@#1.#2}^^J + \@spaces so~ I'm~ assuming~ it~ got~ fixed. + } } \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} } \ExplSyntaxOff -\AddToHook{file/after/biditools.sty}[firstaid]{% +\AddToHook{file/biditools.sty/after}[firstaid]{% \FirstAidNeededT{biditools}{sty}% {2020/05/13 v2 Programming tools for bidi package}% {% @@ -62,19 +66,19 @@ \bidi@afterenddocumentchecklabelsrerunhook}% }% } -\AddToHook{file/after/dinbrief.cls}[firstaid]{% +\AddToHook{file/dinbrief.cls/after}[firstaid]{% \FirstAidNeededT{dinbrief}{cls}{2000/03/02 LaTeX2e class}% {\AddToHook{env/document/begin}{\begingroup}}% } \ExplSyntaxOn -\AddToHook{file/after/pgfpages.sty}[firstaid]{% +\AddToHook{file/pgfpages.sty/after}[firstaid]{% \cs_gset_eq:NN \shipout \pgfpages@originalshipout \cs_set_eq:NN \pgfpages@originalshipout \tex_shipout:D \cs_set_eq:NN \tex_shipout:D \pgfpages@interceptshipout } \ExplSyntaxOff \ExplSyntaxOn -\AddToHook{file/after/pgfmorepages.sty}[firstaid]{ +\AddToHook{file/pgfmorepages.sty/after}[firstaid]{ \cs_set_nopar:Npn \pgfhookintoshipout { \cs_set_eq:NN \pgfpages@originalshipout \tex_shipout:D \cs_set_eq:NN \tex_shipout:D \pgfpages@interceptshipout @@ -82,7 +86,7 @@ } \ExplSyntaxOff \DeclareCommandCopy\CJK@selectfont\selectfont -\AddToHook{file/after/CJK.sty}[firstaid]{% +\AddToHook{file/CJK.sty/after}[firstaid]{% \FirstAidNeededT{CJK}{sty}% {2015/04/18 4.8.4}% {% @@ -96,16 +100,7 @@ }% }% } -\AddToHook{file/after/scrkbase.sty}[firstaid]{% - \FirstAidNeededT{scrkbase}{sty}% - {2020/09/21 v3.32 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)}% - {\let\footref\@undefined} - } -\AddToHook{class/before/memoir}[firstaid]{% - % for version {2020/10/04 v3.7n configurable book, report, article document class}% - \let\footref\@undefined -} -\AddToHook{file/after/bigfoot.sty}{% +\AddToHook{file/bigfoot.sty/after}{% \ifnum\count10<\insc@unt \global\count10=\insc@unt \fi @@ -114,17 +109,17 @@ \expandafter\FN@allmarks\expandafter{\number\numexpr#1+\@ne}% \fi}% } -\AddToHook{file/after/ulem.sty}[firstaid]{% +\AddToHook{file/ulem.sty/after}[firstaid]{% \def\@hspace#1{\begingroup\setlength\skip@{#1}% \edef\x{\endgroup\hskip\the\skip@\relax}\x}% } -\AddToHook{file/after/varwidth.sty}[firstaid]{% +\AddToHook{file/varwidth.sty/after}[firstaid]{% \FirstAidNeededT{varwidth}{sty}% {2009/03/30 ver 0.92; \space Variable-width minipages}% {% \def\@vwid@sift{% \skip@\lastskip\unskip - \unskip % <---- the first aid here + \ifdim\lastskip=\z@\unskip\fi % <---- the first aid here (not just unskip) \dimen@\lastkern\unkern \count@\lastpenalty\unpenalty \setbox\z@\lastbox @@ -149,6 +144,78 @@ \@vwid@sift}% }% } +\ExplSyntaxOn +\sys_if_engine_luatex:T + { + \newluafunction \g__para_end_empty_par_id_int + \exp_args:Nx \everyjob { + \exp_not:V \everyjob + \exp_not:N \lua_now:n { + local~texnest, flush_list, par_token = tex.nest, node.flush_list, token.create'tex_par:D'~ + lua.get_functions_table()[\int_use:N \g__para_end_empty_par_id_int] = function() + local~nest_level = texnest.top~ + local~cur_head = nest_level.head~ + flush_list(cur_head.next) + nest_level.tail, cur_head.next = cur_head, nil~ + token.put_next(par_token) + end + } + } + \protected \luadef \__para_end_empty_par: \g__para_end_empty_par_id_int + \group_begin: + \cs_set:Npn \__para_extract_everypar:w #1 \the \toks #2 \s_stop + { + \tl_gset:Nn \g__para_standard_everypar_tl { + \box_gset_to_last:N \g_para_indent_box + \group_begin: + \__para_end_empty_par: + \group_end: + \tex_everypar:D { \msg_error:nnnn { hooks }{ para-mode }{before}{vertical} } + \@kernel@before@para@before + \hook_use:n {para/before} + \group_begin: + \tex_everypar:D {} + \skip_zero:N \tex_parskip:D + \tex_noindent:D + \group_end: + \tex_everypar:D{\g__para_standard_everypar_tl} + \@kernel@before@para@begin + \hook_use:n {para/begin} + \if_mode_horizontal: \else: + \msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi: + \__para_handle_indent: + \the \toks #2 + } + } + \exp_last_unbraced:No \__para_extract_everypar:w \g__para_standard_everypar_tl \s_stop + \group_end: + } +\ExplSyntaxOff +\ExplSyntaxOn +\cs_set_protected:Npn \para_end: { + \scan_stop: + \mode_if_horizontal:TF { + \mode_if_inner:F { + \tex_unskip:D + \hook_use:n{para/end} + \@kernel@after@para@end + \mode_if_horizontal:TF { + \if_int_compare:w 0 < \tex_lastnodetype:D + \tex_kern:D \c_zero_dim + \fi: + \tex_par:D + \hook_use:n{para/after} + \@kernel@after@para@after + } + { \msg_error:nnnn { hooks }{ para-mode }{end}{horizontal} } + } + } + \tex_par:D +} +\cs_set_eq:NN \par \para_end: +\cs_set_eq:NN \@@par \para_end: +\cs_set_eq:NN \endgraf \para_end: +\ExplSyntaxOff \endinput %% %% End of file `latex2e-first-aid-for-external-files.ltx'. diff --git a/Master/texmf-dist/tex/latex-dev/graphics/graphicx.sty b/Master/texmf-dist/tex/latex-dev/graphics/graphicx.sty index 0a259c8836f..e6c9418d7da 100644 --- a/Master/texmf-dist/tex/latex-dev/graphics/graphicx.sty +++ b/Master/texmf-dist/tex/latex-dev/graphics/graphicx.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{graphicx} - [2020/12/05 v1.2c Enhanced LaTeX Graphics (DPC,SPQR)] + [2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)] \DeclareOption{unknownkeysallowed} {\PassOptionsToPackage\CurrentOption{keyval}} \DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}} @@ -130,6 +130,7 @@ \def\Gin@pagebox@bleedbox{bleedbox}% \def\Gin@pagebox@trimbox{trimbox}% \def\Gin@pagebox@artbox{artbox}% +\define@key{Gin}{alt}{} \def\Gin@boolkey#1#2{% \csname Gin@#2\ifx\relax#1\relax true\else#1\fi\endcsname} \def\Gin@eresize{\height} diff --git a/Master/texmf-dist/tex/latex-dev/graphics/trig.sty b/Master/texmf-dist/tex/latex-dev/graphics/trig.sty index 1147ab46c79..dee83422ed1 100644 --- a/Master/texmf-dist/tex/latex-dev/graphics/trig.sty +++ b/Master/texmf-dist/tex/latex-dev/graphics/trig.sty @@ -23,9 +23,9 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{trig} - [2016/01/03 v1.10 sin cos tan (DPC)] + [2021/08/11 v1.11 sin cos tan (DPC)] \chardef\nin@ty=90 -\chardef\@clxx=180 +\chardef\@clxxx=180 \chardef\@lxxi=71 \mathchardef\@mmmmlxviii=4068 \chardef\@coeffz=72 @@ -66,7 +66,7 @@ \fi}} \def\TG@reduce#1#2{% \dimen@#1#2\nin@ty\p@ - \advance\dimen@#2-\@clxx\p@ + \advance\dimen@#2-\@clxxx\p@ \dimen@-\dimen@ \TG@@sin} \def\TG@@sin{% diff --git a/Master/texmf-dist/tex/latex-dev/tools/array.sty b/Master/texmf-dist/tex/latex-dev/tools/array.sty index 80b0241e965..6531037f2a9 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/array.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/array.sty @@ -46,7 +46,7 @@ \DeclareCurrentRelease{}{2020-10-01} \ProvidesPackage{array} - [2021/04/20 v2.5e Tabular extension package (FMi)] + [2021/07/12 v2.5f Tabular extension package (FMi)] %% \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}} @@ -222,7 +222,7 @@ \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup \let\d@llarend\endgroup \@tabarray} -\def\endtabular{\endarray $\egroup} +\def\endtabular{\endarray\m@th $\egroup} \expandafter\let\csname endtabular*\endcsname=\endtabular \let\@ampacol=\relax \let\@expast=\relax \let\@arrayclassiv=\relax \let\@arrayclassz=\relax diff --git a/Master/texmf-dist/tex/latex-dev/tools/longtable.sty b/Master/texmf-dist/tex/latex-dev/tools/longtable.sty index 7f8043b018a..b49be4c5603 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/longtable.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/longtable.sty @@ -43,7 +43,7 @@ \DeclareCurrentRelease{}{2020-02-07} \ProvidesPackage{longtable} - [2021-05-07 v4.16 Multi-page Table package (DPC)] + [2021-09-01 v4.17 Multi-page Table package (DPC)] \def\LT@err{\PackageError{longtable}} \def\LT@warn{\PackageWarning{longtable}} \def\LT@final@warn{% @@ -81,10 +81,15 @@ \ifx\tablename\undefined \def\tablename{Table} \fi +\ifx\ext@table\undefined + \def\ext@table{lot} +\fi \newtoks\LT@p@ftn \mathchardef\LT@end@pen=30000 \def\longtable{% \par + \if@noskipsec\mbox{}\par\fi + \@nobreakfalse \ifx\multicols\@undefined \else \ifnum\col@number>\@ne diff --git a/Master/texmf-dist/tex/latex-dev/tools/multicol.sty b/Master/texmf-dist/tex/latex-dev/tools/multicol.sty index c0de0fe6823..190943f1c83 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/multicol.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/multicol.sty @@ -107,7 +107,7 @@ \DeclareCurrentRelease{}{2018-04-01} \ProvidesPackage{multicol} - [2019/12/09 v1.8y multicolumn formatting (FMi)] + [2021/07/06 v1.8z multicolumn formatting (FMi)] %% \DeclareOption{twocolumn} {\PackageWarning{multicol}{May not work @@ -441,7 +441,6 @@ \ifvoid\footins \else \leave@mult@footins \fi - \ifvbox \@kludgeins \advance \dimen@ -\ht\@kludgeins \ifdim \wd\@kludgeins>\z@ diff --git a/Master/texmf-dist/tex/latex-dev/tools/varioref.sty b/Master/texmf-dist/tex/latex-dev/tools/varioref.sty index b3b21f897bd..bc8f2a2204c 100644 --- a/Master/texmf-dist/tex/latex-dev/tools/varioref.sty +++ b/Master/texmf-dist/tex/latex-dev/tools/varioref.sty @@ -52,7 +52,7 @@ \DeclareCurrentRelease{}{2019-10-01} \ProvidesPackage{varioref} - [2020/08/11 v1.6e package for extended references (FMi)] + [2021/07/07 v1.6f package for extended references (FMi)] %% @@ -932,7 +932,7 @@ \ref{#1} \reftextfaraway{#1}} \let\fullrefformat\fullrefdefaultformat \def\vref@pagenum#1#2{% - \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}}}{}% + \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}{}{}{}}}{}% \expandafter\expandafter\expandafter\vref@@pagenum \csname r@#2\endcsname{}{}\@nil#1% } diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index f2912a0b659..4bacafef3df 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -837,6 +837,8 @@ chomp (my $ctan_root = `tlpkginfo --ctan-root`); 'makecell', "&MAKEnosymlinks", 'makedtx', "&MAKEflatten", 'makeglossariesgui', "die 'skipping, extra java required'", + 'makeindex', "die 'skipping, binary'", + 'makeindexk', "die 'skipping, binary'", 'maketexwork', "die 'skipping, too old'", 'makor', "&MAKEbase", 'malayalam-latex', "die 'skipping, until asked for'",#language/malayalam |