diff options
author | Norbert Preining <norbert@preining.info> | 2021-11-13 03:01:22 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-11-13 03:01:22 +0000 |
commit | a4ccc84b5ea15905a51f24c56989a29267cfd949 (patch) | |
tree | dc685ede693ac3961a116e6ff8ec6ec2969afea2 /macros | |
parent | 3a8398961f2de022af86ec0fcf33eb093b8dce41 (diff) |
CTAN sync 202111130301
Diffstat (limited to 'macros')
388 files changed, 7216 insertions, 2995 deletions
diff --git a/macros/latex/base/README.md b/macros/latex/base/README.md index 068b770803..97b5f8d9f4 100644 --- a/macros/latex/base/README.md +++ b/macros/latex/base/README.md @@ -1,7 +1,7 @@ The LaTeX kernel ================ -Release 2021-06-01 patch level 1 +Release 2021-11-15 Overview -------- @@ -93,6 +93,6 @@ version 1.3c or later. ----- -<p>Copyright (C) 1989-2020 The LaTeX Project <br /> +<p>Copyright (C) 1989-2021 The LaTeX Project <br /> <a href="http://latex-project.org/">http://latex-project.org/</a> <br /> All rights reserved.</p> diff --git a/macros/latex/base/alltt.pdf b/macros/latex/base/alltt.pdf Binary files differindex 2cf330d918..3f56f678b2 100644 --- a/macros/latex/base/alltt.pdf +++ b/macros/latex/base/alltt.pdf diff --git a/macros/latex/base/cfgguide.pdf b/macros/latex/base/cfgguide.pdf Binary files differindex ba8ff9a11d..ac7c25e4fa 100644 --- a/macros/latex/base/cfgguide.pdf +++ b/macros/latex/base/cfgguide.pdf diff --git a/macros/latex/base/changes.txt b/macros/latex/base/changes.txt index 136554a658..d5d2b555d8 100644 --- a/macros/latex/base/changes.txt +++ b/macros/latex/base/changes.txt @@ -11,6 +11,262 @@ All changes above are only part of the development branch for the next release. ================================================================================ ######################### +# 2021-11-15 Release +######################### + +2021-10-20 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmdhooks.dtx (subsubsection{Patching by expansion and redefinition}): + Fix patching of commands that contain parameter tokens (gh/697) + +2021-10-19 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltpara.dtx (subsection{The error messages}): + Remove content from \tex_everypar:D (aka \everypar) on rollback. + Without it rollback is not functioning in all cases (gh/695). + +2021-10-16 David Carlisle <David.Carlisle@latex-project.org> + + * ltoutenc.dtx: guard spacefactor setting in accents gh/643 + +2021-10-15 Marcel Krüger <Marcel.Krueger@latex-project.org> + + * ltluatex.dtx: + Added missing callback process_charproc_data + +2021-10-14 David Carlisle <David.Carlisle@latex-project.org> + + * ltfiles.dtx: Warn if \include is used before \begin{document} + and do not try to write to the aux file (which is not open) gh/645 + +2021-10-14 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfloat.dtx (subsection{Footnotes}): + * ltboxes.dtx (section{\LaTeX\ Box commands}): + * ltmath.dtx (two places}): + Explicitly set \@currentcounter when not automatically done + through \refstepcounter (gh/687) + +2021-10-04 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * classes.dtx, doc.dtx, makeindx.dtx, preload.dtx, slides.dtx, array.dtx + Removed old references to latex.tex or latex.dtx (gh/685) + +2021-09-28 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmdhooks.dtx (subsection{Patching commands}): + Make patching of commands with generic cmd hooks a global operation (gh/674) + +2021-09-28 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx (subsection{Adding or removing hook code}): + Correct usage of older \@@_if_file_hook:wTF (gh/675). + +2021-09-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfssdcl.dtx (section{Interface Commands}): + Provide counter "localmathalphabets" to keep that many alphabets + from being permanently allocated after use. This allows + some flexibility if many math alphabets are needed but not needed + all in the same formula. (gh/676) + +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: + Normalize message texts + +2021-06-09 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfssbas.dtx (section{Macros for setting up the tables}): + Improve one warning message + +2021-06-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * utf8ienc.dtx: + Change errors to kernel errors + +2021-06-05 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltcmd.dtx, ltdefns.dtx, ltmiscen.dtx: + Normalize message texts + +######################### # 2021-06-01 PL1 Release ######################### diff --git a/macros/latex/base/classes.dtx b/macros/latex/base/classes.dtx index ffe04c620f..a13053b871 100644 --- a/macros/latex/base/classes.dtx +++ b/macros/latex/base/classes.dtx @@ -53,7 +53,7 @@ %<*driver> \ProvidesFile{classes.drv} %</driver> - [2021/02/12 v1.4n + [2021/10/04 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} @@ -1622,7 +1622,7 @@ % \label{sec:classes:pagestyle} % % The pagestyles \pstyle{empty} and \pstyle{plain} are defined in -% \file{latex.dtx}. +% the \LaTeX{} format. % % \begin{macro}{\ps@headings} % The definition of the page style \pstyle{headings} has to be @@ -1771,7 +1771,7 @@ % \begin{macro}{\title} % \begin{macro}{\author} % \begin{macro}{\date} -% These three macros are provided by \file{latex.dtx} to provide +% These three macros are provided by the \LaTeX{} format to provide % information about the title, author(s) and date of the document. % The information is stored away in internal control sequences. % It is the task of the |\maketitle| command to use the @@ -2056,7 +2056,7 @@ % Default initializations of |\...mark| commands. These commands % are used in the definition of the page styles (see % section~\ref{sec:classes:pagestyle}) Most of them are already defined by -% \file{latex.dtx}, so they are only shown here. +% the \LaTeX{} format, so they are only shown here. % % \begin{macrocode} %<!article>\newcommand*\chaptermark[1]{} @@ -2891,7 +2891,7 @@ % \begin{macro}{\theenumii} % \begin{macro}{\theenumiii} % \begin{macro}{\theenumiv} -% The counters are already defined in \file{latex.dtx}, but their +% The counters are already defined in the \LaTeX{} format, but their % representation is changed here. % % \begin{macrocode} @@ -2990,7 +2990,7 @@ % % \begin{environment}{description} % The description environment is defined here -- while the itemize -% and enumerate environments are defined in \file{latex.dtx}. +% and enumerate environments are defined in the \LaTeX{} format. % % \begin{macrocode} \newenvironment{description} @@ -3123,7 +3123,7 @@ % \subsubsection{Theorem} % % This document class does not define it's own theorem environments, -% the defaults, supplied by \file{latex.dtx} are available. +% the defaults, supplied by the \LaTeX{} format are available. % % \subsubsection{Titlepage} % @@ -3365,7 +3365,7 @@ % % \subsection{Floating objects} % -% The file \file{latex.dtx} only defines a number of tools with +% The \LaTeX{} format only defines a number of tools with % which floating objects can be defined. This is done in the % document class. It needs to define the following macros for each % floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} = @@ -3402,7 +3402,7 @@ % % The actual environment that implements a floating object such as % a figure is defined using the macros |\@float| and |\end@float|, -% which are defined in \file{latex.dtx}. +% which are defined in the \LaTeX{} format. % % An environment that implements a single-column floating object is % started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type @@ -4194,7 +4194,7 @@ % % \begin{macro}{\@biblabel} % The label for a |\bibitem[...]| command is produced by this -% macro. The default from \file{latex.dtx} is used. +% macro. The default from the \LaTeX{} format is used. % \begin{macrocode} % \renewcommand*{\@biblabel}[1]{[#1]\hfill} % \end{macrocode} @@ -4202,7 +4202,7 @@ % % \begin{macro}{\@cite} % The output of the |\cite| command is produced by this macro. The -% default from \file{latex.dtx} is used. +% default from the \LaTeX{} format is used. % \begin{macrocode} % \renewcommand*{\@cite}[1]{[#1]} % \end{macrocode} diff --git a/macros/latex/base/classes.pdf b/macros/latex/base/classes.pdf Binary files differindex e34944b8d2..adaecf462c 100644 --- a/macros/latex/base/classes.pdf +++ b/macros/latex/base/classes.pdf diff --git a/macros/latex/base/clsguide.pdf b/macros/latex/base/clsguide.pdf Binary files differindex e513014f2a..6182444b2c 100644 --- a/macros/latex/base/clsguide.pdf +++ b/macros/latex/base/clsguide.pdf diff --git a/macros/latex/base/cmfonts.pdf b/macros/latex/base/cmfonts.pdf Binary files differindex 1d9f729321..63261e227a 100644 --- a/macros/latex/base/cmfonts.pdf +++ b/macros/latex/base/cmfonts.pdf diff --git a/macros/latex/base/cyrguide.pdf b/macros/latex/base/cyrguide.pdf Binary files differindex 27ef9f40a7..3f7bf116de 100644 --- a/macros/latex/base/cyrguide.pdf +++ b/macros/latex/base/cyrguide.pdf diff --git a/macros/latex/base/doc.dtx b/macros/latex/base/doc.dtx index fb3412f21f..41bc073315 100644 --- a/macros/latex/base/doc.dtx +++ b/macros/latex/base/doc.dtx @@ -35,7 +35,7 @@ %<+package|shortvrb>\NeedsTeXFormat{LaTeX2e}[1994/12/01] %<+package> \ProvidesPackage{doc} %<+shortvrb>\ProvidesPackage{shortvrb} -%<+package|shortvrb> [2021/05/28 v2.1n +%<+package|shortvrb> [2021/10/04 v2.1n %<+package|shortvrb> Standard LaTeX documentation package (FMi)] %\catcode`\<=12 % @@ -885,7 +885,7 @@ % We provide macros for logos such as \Web, \AmSTeX, \BibTeX, % \SliTeX{} and \PlainTeX. Just type |\Web|, |\AmSTeX|, % |\BibTeX|, |\SliTeX| or |\PlainTeX|, respectively. -% \LaTeX{} and \TeX{} are already defined in \texttt{latex.tex}. +% \LaTeX{} and \TeX{} are already defined in the \LaTeX{} format. % % \DescribeMacro\meta % Another useful macro is |\meta| which has one argument and @@ -938,7 +938,8 @@ % argument and produces a verbatim listing of the file, indexing every % command as it goes along. This might be handy, if you want to learn % something about macros without enough documentation. I used this -% feature to cross-reference \texttt{latex.tex} getting a verbatim +% feature to cross-reference \texttt{latex.tex} (these days +% called \texttt{latex.ltx}) getting a verbatim % copy with about 15 pages index.\footnote{It took quite a long time % and the resulting \texttt{.idx} file was longer than the % \texttt{.dvi} file. Actually too long to be handled by the @@ -2031,7 +2032,7 @@ % \begin{macro}{\@verbatim} % Additionally we redefine the |\@verbatim| macro so that it % suppresses |%| characters at the beginning of the line. The -% first lines are copied literally from \texttt{latex.tex}. +% first lines are copied literally from the \LaTeX{} format. % \changes{v1.7i}{1992/07/12}{Added \cs{@@par} to clear possible % \cs{parshape}.} % \begin{macrocode} @@ -2055,7 +2056,7 @@ % \begin{macrocode} \check@percent}% % \end{macrocode} -% The rest is again copied literally from \texttt{latex.tex} (less +% The rest is again copied literally from the \LaTeX{} format (less % "\tt"). % \changes{v1.7a}{1992/02/26}{Removed redundant \cs{tt}.} % \changes{v1.8b}{1993/09/21}{Changed to conform to new LaTeX verbatim, diff --git a/macros/latex/base/doc.pdf b/macros/latex/base/doc.pdf Binary files differindex 6e3c9034ff..c8c9eeba4e 100644 --- a/macros/latex/base/doc.pdf +++ b/macros/latex/base/doc.pdf diff --git a/macros/latex/base/docstrip.pdf b/macros/latex/base/docstrip.pdf Binary files differindex 47d7bcc813..60bee83eb2 100644 --- a/macros/latex/base/docstrip.pdf +++ b/macros/latex/base/docstrip.pdf diff --git a/macros/latex/base/encguide.pdf b/macros/latex/base/encguide.pdf Binary files differindex 915660a533..05d4db135b 100644 --- a/macros/latex/base/encguide.pdf +++ b/macros/latex/base/encguide.pdf diff --git a/macros/latex/base/exscale.pdf b/macros/latex/base/exscale.pdf Binary files differindex 9f43ecd71c..89f633a071 100644 --- a/macros/latex/base/exscale.pdf +++ b/macros/latex/base/exscale.pdf diff --git a/macros/latex/base/fix-cm.pdf b/macros/latex/base/fix-cm.pdf Binary files differindex 6d59cfabbd..cef7b9cac0 100644 --- a/macros/latex/base/fix-cm.pdf +++ b/macros/latex/base/fix-cm.pdf diff --git a/macros/latex/base/fntguide.pdf b/macros/latex/base/fntguide.pdf Binary files differindex 8433cfcd6f..6abe040658 100644 --- a/macros/latex/base/fntguide.pdf +++ b/macros/latex/base/fntguide.pdf diff --git a/macros/latex/base/graphpap.pdf b/macros/latex/base/graphpap.pdf Binary files differindex 630a434262..5b40485a1f 100644 --- a/macros/latex/base/graphpap.pdf +++ b/macros/latex/base/graphpap.pdf diff --git a/macros/latex/base/ifthen.pdf b/macros/latex/base/ifthen.pdf Binary files differindex ed4013b206..0acb42f8f0 100644 --- a/macros/latex/base/ifthen.pdf +++ b/macros/latex/base/ifthen.pdf diff --git a/macros/latex/base/inputenc.pdf b/macros/latex/base/inputenc.pdf Binary files differindex 7fc129c057..fdff51d24a 100644 --- a/macros/latex/base/inputenc.pdf +++ b/macros/latex/base/inputenc.pdf diff --git a/macros/latex/base/manual.err b/macros/latex/base/lamport-manual.err index c6ea889ed3..1f72c34938 100644 --- a/macros/latex/base/manual.err +++ b/macros/latex/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/macros/latex/base/manual.pdf b/macros/latex/base/lamport-manual.pdf Binary files differindex 95060d768f..da984d3293 100644 --- a/macros/latex/base/manual.pdf +++ b/macros/latex/base/lamport-manual.pdf diff --git a/macros/latex/base/latexchanges.pdf b/macros/latex/base/latexchanges.pdf Binary files differindex 33a6eb4968..45b147bd55 100644 --- a/macros/latex/base/latexchanges.pdf +++ b/macros/latex/base/latexchanges.pdf diff --git a/macros/latex/base/latexrelease.pdf b/macros/latex/base/latexrelease.pdf Binary files differindex ed5d49acf3..ab7b3afa73 100644 --- a/macros/latex/base/latexrelease.pdf +++ b/macros/latex/base/latexrelease.pdf diff --git a/macros/latex/base/latexsym.pdf b/macros/latex/base/latexsym.pdf Binary files differindex a48a8d5f3f..078e8cfceb 100644 --- a/macros/latex/base/latexsym.pdf +++ b/macros/latex/base/latexsym.pdf diff --git a/macros/latex/base/lb2.err b/macros/latex/base/lb2.err index 767cc86a05..53148e2833 100644 --- a/macros/latex/base/lb2.err +++ b/macros/latex/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/macros/latex/base/lb2.pdf b/macros/latex/base/lb2.pdf Binary files differindex 35d5855625..a6764506d9 100644 --- a/macros/latex/base/lb2.pdf +++ b/macros/latex/base/lb2.pdf diff --git a/macros/latex/base/letter.pdf b/macros/latex/base/letter.pdf Binary files differindex 69d69ba664..74850426b6 100644 --- a/macros/latex/base/letter.pdf +++ b/macros/latex/base/letter.pdf diff --git a/macros/latex/base/lgc2.err b/macros/latex/base/lgc2.err index cbee8d6f35..96fd378fe9 100644 --- a/macros/latex/base/lgc2.err +++ b/macros/latex/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/macros/latex/base/lgc2.pdf b/macros/latex/base/lgc2.pdf Binary files differindex 6bacf43065..969e495850 100644 --- a/macros/latex/base/lgc2.pdf +++ b/macros/latex/base/lgc2.pdf diff --git a/macros/latex/base/lppl.pdf b/macros/latex/base/lppl.pdf Binary files differindex 982b75073c..6176dc8fea 100644 --- a/macros/latex/base/lppl.pdf +++ b/macros/latex/base/lppl.pdf diff --git a/macros/latex/base/ltboxes.dtx b/macros/latex/base/ltboxes.dtx index 8499d3ab8b..92d9228a8a 100644 --- a/macros/latex/base/ltboxes.dtx +++ b/macros/latex/base/ltboxes.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltboxes.dtx} - [2021/02/10 v1.4b LaTeX Kernel (Box Commands)] + [2021/10/14 v1.4c LaTeX Kernel (Box Commands)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltboxes.dtx} @@ -1137,10 +1137,12 @@ % {Color groups restored here.} % \changes{v1.4b}{2021/02/10} % {Explicitly run \cs{par} in support for paragraph tagging} +% \changes{v1.4c}{2021/10/14} +% {Explicitly set \cs{@currentcounter} (gh/687)} % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2021/06/01}% +%<latexrelease>\IncludeInRelease{2021/11/15}% %<latexrelease> {\@mpfootnotetext}{footnotetext tagging}% \long\def\@mpfootnotetext#1{% \global\setbox\@mpfootins\vbox{% @@ -1148,6 +1150,7 @@ \reset@font\footnotesize \hsize\columnwidth \@parboxrestore + \def\@currentcounter{mpfootnote}% \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup @@ -1158,6 +1161,24 @@ %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease % \end{macrocode} +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/06/01}% +%<latexrelease> {\@mpfootnotetext}{footnotetext tagging}% +%<latexrelease>\long\def\@mpfootnotetext#1{% +%<latexrelease> \global\setbox\@mpfootins\vbox{% +%<latexrelease> \unvbox\@mpfootins +%<latexrelease> \reset@font\footnotesize +%<latexrelease> \hsize\columnwidth +%<latexrelease> \@parboxrestore +%<latexrelease> \protected@edef\@currentlabel +%<latexrelease> {\csname p@mpfootnote\endcsname\@thefnmark}% +%<latexrelease> \color@begingroup +%<latexrelease> \@makefntext{% +%<latexrelease> \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% +%<latexrelease> \par +%<latexrelease> \color@endgroup}} +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} % % \begin{macrocode} %<latexrelease>\IncludeInRelease{0000/00/00}% diff --git a/macros/latex/base/ltclass.dtx b/macros/latex/base/ltclass.dtx index 2ab3081bf7..06e0f437af 100644 --- a/macros/latex/base/ltclass.dtx +++ b/macros/latex/base/ltclass.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltclass.dtx} - [2021/06/06 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}% @@ -2771,11 +2834,12 @@ % \end{macrocode} % % Lua\TeX\ has more writes (and 18 is safe here). +% \changes{v1.4b}{2021/06/09}{Use \cs{@latex@note@no@line} to display the information} % \begin{macrocode} \chardef\reserved@c\ifx\directlua\@undefined 15 \else 127 \fi% \openin\@inputcheck\q@curr@file \space % \ifeof\@inputcheck% - \@latex@warning@no@line% + \@latex@note@no@line% {Writing file `\@currdir\@curr@file'}% % \end{macrocode} % @@ -2789,9 +2853,10 @@ % % \changes{v1.0y}{1997/10/10} % {Use \cs{@gobbletwo}} +% \changes{v1.4b}{2021/06/09}{Use \cs{@latex@note@no@line} to display the information} % \begin{macrocode} \if@filesw% - \@latex@warning@no@line% + \@latex@note@no@line% {File `\@curr@file' already \filec@ntents@where.\MessageBreak% Not generating it from this source}% \let\write\@gobbletwo% diff --git a/macros/latex/base/ltcmd.dtx b/macros/latex/base/ltcmd.dtx index 806161d538..04be2abfbf 100644 --- a/macros/latex/base/ltcmd.dtx +++ b/macros/latex/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.0e} -\def\ltcmddate{2021-05-24} +\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} @@ -366,7 +365,7 @@ { \cs_if_exist:NTF #1 { - \msg_info:nnxx { cmd } { redefine-command } + \msg_info:nnxx { cmd } { redefine } { \token_to_str:N #1 } { \tl_to_str:n {#2} } } { @@ -400,7 +399,6 @@ #4 \@@_break_point:n {#2} } -\cs_generate_variant:Nn \@@_declare_cmd_internal:Nnnn { cnx } % \end{macrocode} % \end{macro} % \end{macro} @@ -536,11 +534,11 @@ { \tl_trim_spaces:o { \l_@@_environment_str } } \cs_if_exist:cTF { \l_@@_environment_str } { - \msg_info:nnxx { cmd } { redefine-environment } + \msg_info:nnxx { cmd } { redefine-env } { \l_@@_environment_str } { \tl_to_str:n {#2} } } { - \msg_info:nnxx { cmd } { define-environment } + \msg_info:nnxx { cmd } { define-env } { \l_@@_environment_str } { \tl_to_str:n {#2} } } \bool_set_false:N \l_@@_expandable_bool @@ -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} @@ -693,7 +695,7 @@ } \cs_new_protected:Npn \@@_defaults_error:w \q_recursion_stop { - \msg_error:nnx { cmd } { loop-in-defaults } + \msg_error:nnx { cmd } { default-loop } { \@@_environment_or_command: } } % \end{macrocode} @@ -821,7 +823,7 @@ \@@_end_expandable_defaults:nnnNNn {#1} { } {#1} #2#3 { } { } { } { } { } { } { } { } { } { } { - \msg_expandable_error:nnf { cmd } { loop-in-defaults } + \msg_expandable_error:nnf { cmd } { default-loop } { \exp_args:Nf \tl_trim_spaces:n { \token_to_str:N #4 } } \use_iv:nnnn } @@ -919,7 +921,7 @@ \q_recursion_tail \q_recursion_tail \q_recursion_tail \q_recursion_stop \int_compare:nNnT \l_@@_current_arg_int > 9 { - \msg_error:nnxx { cmd } { too-many-arguments } + \msg_error:nnxx { cmd } { too-many-args } { \@@_environment_or_command: } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -951,7 +953,7 @@ { \str_if_eq_p:nn {#1} { u } } } { - \msg_error:nnxx { cmd } { xparse-argument-type } + \msg_error:nnxx { cmd } { xparse-arg-type } { \@@_environment_or_command: } { \tl_to_str:n {#1} } } { @@ -1241,7 +1243,7 @@ { \use_none:n } } { - \msg_error:nnxxx { cmd } { forbidden-implicit-group-token } + \msg_error:nnxxx { cmd } { forbidden-group-token } { \@@_environment_or_command: } { \tl_to_str:n {#1} } { \token_if_eq_meaning:NNTF #1 \c_group_begin_token @@ -1261,7 +1263,7 @@ { \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnxx { cmd } { invalid-expandable-argument-type } + \msg_error:nnxx { cmd } { invalid-expandable-arg } { \iow_char:N \\ \l_@@_function_tl } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -1334,7 +1336,7 @@ { \bool_if:NT \l_@@_expandable_bool { - \msg_error:nnx { cmd } { inconsistent-long } + \msg_error:nnx { cmd } { long-short-mix } { \iow_char:N \\ \l_@@_function_tl } \@@_bad_def:wn } @@ -1356,7 +1358,7 @@ { \bool_if:NT \l_@@_some_obey_spaces_bool { - \msg_error:nnxx { cmd } { non-trailing-obey-spaces } + \msg_error:nnxx { cmd } { invalid-bang } { \@@_environment_or_command: } { \tl_to_str:n {#1} } \@@_bad_def:wn } @@ -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} @@ -2587,7 +3298,7 @@ \exp_after:wN \exp_after:wN \exp_after:wN \peek_meaning_remove:NTF \char_generate:nn { \tex_endlinechar:D } { 6 } { - \msg_error:nnxxx { cmd } { verbatim-newline } + \msg_error:nnxxx { cmd } { verbatim-nl } { \@@_environment_or_command: } { \tl_to_str:N \l_@@_v_arg_tl } { \tl_to_str:n {#1} } @@ -3115,7 +3826,7 @@ \ProcessedArgument \q_stop } - \msg_error:nnxxx { cmd } { split-excess-tokens } + \msg_error:nnxxx { cmd } { arg-split } { \tl_to_str:n {#3} } { \int_eval:n { #2 + 1 } } { \tl_to_str:n {#4} } } @@ -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 @@ -3504,94 +4237,98 @@ % \end{macro} % % Some messages intended as errors when defining commands/environments. +% \changes{v1.0f}{2021/06/04}{Normalize various error messages} % \begin{macrocode} \msg_new:nnnn { cmd } { arg-after-body } - { In~the~definition~of~#1,~b~(body)~argument~must~be~last. } + { Argument~type~'b'~must~be~last~in~#1. } { - The~'body'~argument~type~is~followed~by~'#2'~in~the~argument~ - specification~of~the~#1.~This~is~not~allowed. + The~'b'~argument~type~must~come~last~but~it~is~followed~ + by~'#2'~in~the~argument~specification.~This~is~not~allowed. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { bad-arg-spec } { Bad~argument~specification~'#2'~for~#1. } { - The~argument~specification~provided~was~not~valid:~ - one~or~more~mandatory~pieces~of~information~were~missing. + The~argument~specification~provided~is~not~valid:~ + one~or~more~mandatory~parts~are~missing. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { command-already-defined } - { Command~'#1'~already~defined! } +\msg_new:nnnn { cmd } { already-defined } + { Command~'#1'~already~defined. } { You~have~used~#2~ with~a~command~that~already~has~a~definition. \\ \\ The~existing~definition~of~'#1'~will~not~be~altered. } -\msg_new:nnnn { cmd } { command-not-yet-defined } - { Command ~'#1'~not~yet~defined! } +\msg_new:nnnn { cmd } { undefined } + { Command ~'#1'~undefined. } { You~have~used~#2~ with~a~command~that~was~never~defined. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { environment-already-defined } - { Environment~'#1'~already~defined! } +\msg_new:nnnn { cmd } { env-already-defined } + { Environment~'#1'~already~defined. } { You~have~used~\NewDocumentEnvironment with~an~environment~that~already~has~a~definition. \\ \\ The~existing~definition~of~'#1'~will~not~be~altered. } -\msg_new:nnnn { cmd } { environment-not-yet-defined } - { Environment~'#1'~not~yet~defined! } +\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. } { You~have~used~\RenewDocumentEnvironment with~an~environment~that~was~never~defined. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { expandable-ending-optional } - { - Argument~specification~'#2'~for~expandable~command~'#1'~ - ends~with~optional~argument. - } + { Bad~argument~specification~'#2'~for~#1. } { Expandable~commands~must~have~a~final~mandatory~argument~ (or~no~arguments~at~all).~You~cannot~have~a~terminal~optional~ argument~with~expandable~commands. } -\msg_new:nnnn { cmd } { inconsistent-long } - { Inconsistent~long~arguments~for~expandable~command~'#1'. } +\msg_new:nnnn { cmd } { long-short-mix } + { Invalid~argument~prefix~'+'~in~command~'#1'. } { The~arguments~for~an~expandable~command~must~not~involve~short~ - arguments~after~long~arguments.~You~have~tried~to~mix~the~two~types. + arguments~after~long~arguments.~You~have~tried~to~mix~the~two~types~ + when~defining~'#1'. } \msg_new:nnnn { cmd } { invalid-command-arg } - { Argument~type~'#2'~not~available~for~#1. } + { Invalid~argument~type~'#2'~in~#1. } { The~letter~'#2'~can~only~be~used~in~environment~argument~ - specifications,~not~for~commands. + specifications,~but~not~for~commands. \\ \\ - LaTeX~will~ignore~this~entire~definition. + LaTeX~will~ignore~the~entire~definition. } -\msg_new:nnnn { cmd } { invalid-expandable-argument-type } - { Argument~type~'#2'~not~available~for~expandable~command~'#1'. } +\msg_new:nnnn { cmd } { invalid-expandable-arg } + { Invalid~argument~type~'#2'~in~#1. } { The~letter~'#2'~specifies~an~argument~type~which~cannot~be~used~ in~an~expandable~command. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { invalid-after-optional-expandably } - { - Argument~type~'#2'~not~available~after~optional~argument~ - for~expandable~command~'#1'. - } + { Argument~'#2'~invalid~after~optional~arg~in~#1. } { The~letter~'#2'~specifies~an~argument~type~which~cannot~be~used~ in~an~expandable~command~after~an~optional~argument. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { non-trailing-obey-spaces } - { Prefix~'!'~used~before~mandatory~argument~'#2'~of~#1. } +\msg_new:nnnn { cmd } { invalid-bang } + { Invalid~argument~prefix~'!'~in~#1. } { - The~prefix~'!'~can~only~apply~to~trailing~optional~arguments. + The~prefix~'!'~is~only~allowed~for~trailing~optional~arguments.~ + You~tried~to~apply~it~to~'#2'. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { not-definable } @@ -3611,75 +4348,75 @@ \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { not-single-token } + { Argument~delimiter~'#2'~invalid~in~#1. } { - Argument~delimiter~'#2'~for~the~#1~should~be~ - a~single~non-space~token. - } - { - The~argument~specification~provided~was~not~valid:~in~a~place~ - where~a~single~token~is~required,~LaTeX~found~'#2'. + The~argument~specification~contains~ + \tl_if_empty:nTF{#2}{nothing}{'#2'}~ + in~a~place~ + where~a~single~token~is~required. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { forbidden-implicit-group-token } - { Argument~delimiter~'#2'~for~the~#1~is~not~allowed. } +\msg_new:nnnn { cmd } { forbidden-group-token } + { Argument~delimiter~'#2'~invalid~in~#1. } { - The~argument~specification~provided~was~not~valid:~the~implicit~ - #3-group~token~'#2'~is~not~allowed~as~an~argument~delimiter. + The~argument~specification~contains~the~implicit~ + #3-group~token~'#2'~which~is~not~allowed~as~an~argument~delimiter. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { processor-in-expandable } - { Argument~processor~'>{#2}'~cannot~be~used~for~the~expandable~command~'#1'. } + { Invalid~argument~prefix~'>'~in~command~'#1'. } { - The~argument~specification~for~#1~contains~a~processor~function:~ - this~is~only~supported~for~standard~robust~commands. + The~argument~specification~for~'#1'~contains~the~processor~function~'>{#2}'.~ + This~is~only~supported~for~robust~commands,~but~not~for~expandable~ones. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { too-many-arguments } - { Too~many~arguments~in~argument~specification~'#2'~of~#1. } +\msg_new:nnnn { cmd } { too-many-args } + { Too~many~arguments~for~#1. } { - The~argument~specification~provided~has~more~than~9~arguments.~ + The~argument~specification~'#2'~asks~for~more~than~9~arguments.~ This~cannot~be~implemented. \c_@@_ignore_def_tl } \msg_new:nnnn { cmd } { two-markers } - { Two~'#2'~apply~to~the~same~argument~in~argument~specification~of~#1. } + { Invalid~argument~prefix~'#2'~in~#1. } { - The~argument~specification~provided~has~two~markers~'#2'~applying~ - to~the~same~argument;~these~are~redundant. + The~argument~specification~provided~for~#1~has~two~'#2'~markers~applied~ + to~the~same~argument;~one~is~redundant. } -\msg_new:nnnn { cmd } { unknown-argument-type } - { Unknown~argument~type~'#2'~for~the~#1. } +\msg_new:nnnn { cmd } { unknown-argument-type } % should be unkown-arg-type but dep in xparse + { Invalid~argument~type~'#2'~in~#1. } { The~letter~'#2'~does~not~specify~a~known~argument~type. \c_@@_ignore_def_tl } -\msg_new:nnnn { cmd } { xparse-argument-type } - { Deprecated~argument~type~'#2'~for~the~#1~requires~xparse. } +\msg_new:nnnn { cmd } { xparse-arg-type } + { Invalid~argument~type~'#2'~in~#1~(requires~xparse). } { - The~letter~'#2'~specifies~a~known~argument~type~that~requires~ - the~xparse~package. + The~letter~'#2'~specifies~a~known~but~deprecated~argument~type.~ + If~you~really~need~it~you~have~to~load~the~xparse~package. \c_@@_ignore_def_tl } % \end{macrocode} % % Errors when using commands/environments. The \texttt{if-boolean} % message is always used in expandable errors. The -% \texttt{loop-in-defaults} and \texttt{missing-required} messages can +% \texttt{default-loop} and \texttt{missing-required} messages can % be expandable or not expandable. % \begin{macrocode} \msg_new:nnn { cmd } { if-boolean } - { Invalid~use~\iow_char:N\\IfBooleanTF~{#1} } -\msg_new:nnnn { cmd } { loop-in-defaults } - { Defaults~of~#1~have~circular~dependency. } + { Invalid~argument~{#1}~to~\iow_char:N\\IfBoolean... } +\msg_new:nnnn { cmd } { default-loop } + { Circular~dependency~in~defaults~of~#1. } { The~default~values~of~two~or~more~arguments~of~the~#1~ depend~on~each~other~in~a~way~that~cannot~be~resolved. } \msg_new:nnnn { cmd } { missing-required } - { Missing~required~argument~for~#1. } + { Required~argument~missing~for~#1. } { - The~current~#1~expects~an~argument~starting~with~'#2'.~ - LaTeX~did~not~find~it,~and~will~insert~a~default~value~to~be~processed. + The~#1~expects~one~of~its~arguments~to~start~with~'#2'.~ + LaTeX~did~not~find~this~argument~and~will~insert~a~default~value~ + for~further~processing. } \msg_new:nnnn { cmd } { non-xparse } { \str_uppercase:n #1~not~defined~using~xparse. } @@ -3687,12 +4424,12 @@ You~have~asked~for~the~argument~specification~for~the~#1,~ but~this~was~not~defined~using~xparse. } -\msg_new:nnnn { cmd } { split-excess-tokens } - { Too~many~'#1'~tokens~when~trying~to~split~argument. } +\msg_new:nnnn { cmd } { arg-split } + { Too~many~'#1'~separators~in~argument. } { LaTeX~was~asked~to~split~the~input~'#3'~ - at~each~occurrence~of~the~token~'#1',~up~to~a~maximum~of~#2~parts.~ - There~were~too~many~'#1'~tokens. + at~each~occurrence~of~the~separator~'#1'~into~#2~parts.~ + Too~many~separators~were~found. } \msg_new:nnnn { cmd } { unknown } { Unknown~document~#1. } @@ -3700,54 +4437,62 @@ You~have~asked~for~the~argument~specification~for~the~#1,~ but~it~is~not~defined. } -\msg_new:nnnn { cmd } { verbatim-newline } - { Verbatim~argument~of~#1~ended~by~end~of~line. } +\msg_new:nnnn { cmd } { verbatim-nl } + { Verbatim-like~#1~ended~by~end~of~line. } { The~verbatim~argument~of~the~#1~cannot~contain~more~than~one~line,~ but~the~end~ of~the~current~line~has~been~reached.~You~may~have~forgotten~the~ closing~delimiter. \\ \\ - LaTeX~will~ignore~'#2'. + LaTeX~will~ignore~'#2'~and~you~may~get~some~additional~ + (low-level)~errors. } \msg_new:nnnn { cmd } { verbatim-tokenized } - { The~verbatim~#1~cannot~be~used~inside~an~argument. } + { Verbatim-like~#1~illegal~in~argument. } { - The~#1~takes~a~verbatim~argument.~ - It~may~not~appear~within~the~argument~of~another~function.~ - It~received~an~illegal~token \tl_if_empty:nF {#3} { ~'#3' } . + The~#1~takes~a~verbatim~argument~and~should~therefore~normally~ + not~be~used~in~arguments~of~other~commands~or~environments.~ + LaTeX~found~an~illegal~token~ \tl_if_empty:nF {#3} { (#3)~ } + after~'#2'~and~will~drop~everything~up~to~this~point. \\ \\ - LaTeX~will~ignore~'#2'. + Expect~further~(low-level)~errors. } % \end{macrocode} % % Intended more for information. % \begin{macrocode} -\msg_new:nnn { cmd } { define-command } +\msg_new:nnn { cmd } { define-command } % should be just ``define'' but dep in xparse { Defining~command~#1~ with~sig.~'#2'~\msg_line_context:. } -\msg_new:nnn { cmd } { define-environment } +\msg_new:nnn { cmd } { define-env } { Defining~environment~'#1'~ with~sig.~'#2'~\msg_line_context:. } -\msg_new:nnn { cmd } { redefine-command } +\msg_new:nnn { cmd } { redefine } { Redefining~command~#1~ with~sig.~'#2'~\msg_line_context:. } -\msg_new:nnn { cmd } { redefine-environment } +\msg_new:nnn { cmd } { redefine-env } { Redefining~environment~'#1'~ with~sig.~'#2'~\msg_line_context:. } \msg_new:nnn { cmd } { optional-mandatory } { - Since~the~mandatory~argument~'#1'~has~the~same~delimiter~'#2'~ - as~a~previous~optional~argument,~it~will~not~be~possible~to~ - omit~all~optional~arguments~when~calling~this~command. + Optional~and~mandatory~argument~with~same~delimiter~'#2'. + \\ \\ + The~mandatory~argument~specified~with~ + '\str_case:nnF{#1}{ {R/r}{r'~or~'R} }{#1}'~has~the~ + same~delimiter~'#2'~as~an~earlier~optional~argument.~ + It~will~therefore~not~be~possible~to~omit~all~the~earlier~ + optional~arguments~when~calling~this~command. + \\ \\ + This~may~be~intentional,~but~then~it~might~be~a~mistake. } \msg_new:nnn { cmd } { unsupported-let } { @@ -3787,7 +4532,7 @@ { \cs_if_exist:NTF #1 { - \msg_error:nnxx { cmd } { command-already-defined } + \msg_error:nnxx { cmd } { already-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \NewDocumentCommand } } @@ -3801,7 +4546,7 @@ \cs_if_exist:NTF #1 { \@@_declare_cmd:Nnn #1 {#2} {#3} } { - \msg_error:nnxx { cmd } { command-not-yet-defined } + \msg_error:nnxx { cmd } { undefined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewDocumentCommand } } @@ -3824,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} @@ -3832,14 +4578,18 @@ \cs_new_protected:Npn \NewDocumentEnvironment #1#2#3#4 { \cs_if_exist:cTF {#1} - { \msg_error:nnx { cmd } { environment-already-defined } {#1} } - { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } + { \msg_error:nnx { cmd } { env-already-defined } {#1} } + { + \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 { \cs_if_exist:cTF {#1} { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } - { \msg_error:nnx { cmd } { environment-not-yet-defined } {#1} } + { \msg_error:nnx { cmd } { env-undefined } {#1} } } \cs_new_protected:Npn \ProvideDocumentEnvironment #1#2#3#4 { \cs_if_exist:cF {#1} { \@@_declare_env:nnnn {#1} {#2} {#3} {#4} } } @@ -3866,7 +4616,7 @@ { \cs_if_exist:NTF #1 { - \msg_error:nnxx { cmd } { command-already-defined } + \msg_error:nnxx { cmd } { already-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \NewExpandableDocumentCommand } } @@ -3880,7 +4630,7 @@ \cs_if_exist:NTF #1 { \@@_declare_expandable_cmd:Nnn #1 {#2} {#3} } { - \msg_error:nnxx { cmd } { command-not-yet-defined } + \msg_error:nnxx { cmd } { undefined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewExpandableDocumentCommand } } @@ -4032,3 +4782,4 @@ % \end{macrocode} % % \Finale + diff --git a/macros/latex/base/ltcmdhooks-code.pdf b/macros/latex/base/ltcmdhooks-code.pdf Binary files differindex 8517f0e4c2..3bec9254ba 100644 --- a/macros/latex/base/ltcmdhooks-code.pdf +++ b/macros/latex/base/ltcmdhooks-code.pdf diff --git a/macros/latex/base/ltcmdhooks-doc.pdf b/macros/latex/base/ltcmdhooks-doc.pdf Binary files differindex e162dce529..6f031bb990 100644 --- a/macros/latex/base/ltcmdhooks-doc.pdf +++ b/macros/latex/base/ltcmdhooks-doc.pdf diff --git a/macros/latex/base/ltcmdhooks.dtx b/macros/latex/base/ltcmdhooks.dtx index 40cd55e52c..208f7c3d22 100644 --- a/macros/latex/base/ltcmdhooks.dtx +++ b/macros/latex/base/ltcmdhooks.dtx @@ -13,21 +13,14 @@ % %%% From File: ltcmdhooks.dtx % -\def\ltcmdhooksversion{v1.0b} -\def\ltcmdhooksdate{2021/05/26} +\def\ltcmdhooksversion{v1.0f} +\def\ltcmdhooksdate{2021/10/20} % % % %<*driver> \documentclass{l3doc} %\usepackage{ltcmdhooks} -\makeatletter -\providecommand\footref[1]{% - \begingroup - \unrestored@protected@xdef\@thefnmark{\ref{#1}}% - \endgroup - \@footnotemark} -\makeatother \EnableCrossrefs \CodelineIndex \begin{document} @@ -360,19 +353,46 @@ % \end{macro} % % \begin{macro}{\l_@@_patch_prefixes_tl} -% \begin{macro}{\l_@@_patch_param_text_tl} -% \begin{macro}{\l_@@_patch_replacement_tl} +% \begin{macro}{\l_@@_param_text_tl} +% \begin{macro}{\l_@@_replace_text_tl} % The prefixes and parameters of the definition for the macro being % patched. % \begin{macrocode} \tl_new:N \l_@@_patch_prefixes_tl -\tl_new:N \l_@@_patch_param_text_tl -\tl_new:N \l_@@_patch_replacement_tl +\tl_new:N \l_@@_param_text_tl +\tl_new:N \l_@@_replace_text_tl % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % +% \begin{macro}{\c_@@_hash_tl} +% A constant token list that contains two parameter tokens. +% \begin{macrocode} +\tl_const:Nn \c_@@_hash_tl { # # } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_exp_not:NN} +% \begin{macro}{\@@_def_cmd:w} +% Two temporary macros that change depending on the macro being +% patched. +% \begin{macrocode} +\cs_new_eq:NN \@@_exp_not:NN ? +\cs_new_eq:NN \@@_def_cmd:w ? +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\q_@@_recursion_tail,\q_@@_recursion_stop} +% Internal quarks for recursion: they can't appear in any macro being +% patched. +% \begin{macrocode} +\quark_new:N \q_@@_recursion_tail +\quark_new:N \q_@@_recursion_stop +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\g_@@_delayed_patches_prop} % A list containing the patches delayed to |\begin{document}|, so that % patching is not attempted twice. @@ -400,24 +420,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 +632,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} @@ -639,13 +690,71 @@ % % % +% % \begin{macro}{\@@_patch_expand_redefine:NNnn} +% \begin{macro}{\@@_redefine_with_hooks:Nnnn} % \begin{macro}[EXP]{\@@_make_prefixes:w} % Now the real action begins. Here we have in |#1| a boolean -% indicating if the command has a |[|\ldots|]|-delimited argument, in -% |#2| the command control sequence, in |#3| the name of the command -% (note that |#1|${}\ne{}$|\csname#2\endcsname| at this point!), and -% in |#4| the hook position, either |before| or |after|. +% indicating if the command has a leading |[|\ldots|]|-delimited +% argument, in |#2| the command control sequence, in |#3| the name of +% the command (note that |#1|${}\ne{}$|\csname#2\endcsname| at this +% point!), and in |#4| the hook position, either |before| or |after|. +% +% \changes{v1.0f}{2021/10/20} +% {Correct patching by expansion+redefinition when the macro +% contains a parameter tokens (gh/697).} +% Patching with expansion+redefinition is trickier than it looks like +% at first glance. Suppose the simple definition: +% \begin{verbatim} +% \def\foo#1{#1##2} +% \end{verbatim} +% When defined, its \meta{replacement text} will be a token list +% containing: +% \begin{quote} +% \itshape +% out\_param |1|, mac\_param |#|, character |2| +% \end{quote} +% +% Then, after expanding \cs{foo}|{##1}| (here |##| denotes a single +% |#|$_6$) we end up with a token list with \textit{out\_param}~|1| +% replaced: +% \begin{quote} +% \itshape +% mac\_param |#|, character |1|, mac\_param |#|, character |2| +% \end{quote} +% that is, the definition would be: +% \begin{verbatim} +% \def\foo#1{#1#2} +% \end{verbatim} +% which obviously fails, because the original input in the definition +% was |##| but \TeX{} reduced that to a single parameter token |#|$_6$ +% when carrying out the definition. That leaves no room for a clever +% solution with (say) \cs{unexpanded}, because anything that would +% double the second |#|$_6$, would also (incorrectly) double the +% first, so there's not much to do other than a manual solution. +% +% There are three cases we can distinguish to make things hopefully +% faster on simpler cases: +% \begin{enumerate} +% \item a macro with no parameters; +% \item a macro with no parameter tokens in its definition; +% \item a macro with parameters \emph{and} parameter tokens. +% \end{enumerate} +% +% The first case is trivial: if the macro has no parameters, we can +% just use \cs{unexpanded} around it, and if there is a parameter +% token in it, it is handled correctly (the macro can be treated as a +% |tl| variable). +% +% The second case requires looking at the \meta{replacement text} of +% the macro to see if it has a parameter token in there. If it does +% not, then there is no worry, and the macro can be redefined normally +% (without \cs{unexpanded}). +% +% The third case, as usual, is the devious one. Here we'll have to +% loop through the definition token by token, and double every +% parameter token, so that this case can be handled like the previous +% one. % \begin{macrocode} \cs_new_protected:Npn \@@_patch_expand_redefine:NNnn #1 #2 #3 #4 { @@ -665,36 +774,93 @@ % \end{macrocode} % Now build two token lists: % \begin{description} -% \item[\cs{l_@@_patch_param_text_tl}] will contain the +% \item[\cs{l_@@_param_text_tl}] will contain the % \meta{parameter text} to be used when redefining the macro. It % should be identical to the \meta{parameter text} used when % originally defining that macro. -% \item[\cs{l_@@_patch_replacement_tl}] will contain braced pairs of -% |#|$_{12}$\meta{num} to feed to the macro when expanded. This -% token list as well as the previous will have the first item +% \item[\cs{l_@@_replace_text_tl}] will contain braced pairs of +% \cs{c_@@_hash_tl}\meta{num} to feed to the macro when expanded. +% This token list as well as the previous will have the first item % surrounded by |[|\ldots|]| in the case of an optional argument. % \end{description} +% +% The use of \cs{c_@@_hash_tl} here is to differentiate actual +% parameters in the macro from parameter tokens in the original +% definition of the macro. Later on, \cs{c_@@_hash_tl} is either +% replaced by actual parameter tokens, or expanded into them. % \begin{macrocode} \int_compare:nNnTF { \l_@@_patch_num_args_int } > { \c_zero_int } { - \tl_set:Nx \l_@@_patch_param_text_tl - { \bool_if:NTF #1 { [####1] } { ####1 } } - \tl_set:Nx \l_@@_patch_replacement_tl - { \bool_if:NTF #1 { [####1] } { {####1} } } +% \end{macrocode} +% We'll first check if the command has any parameter token in its +% definition (feeding it empty arguments), and set \cs{@@_exp_not:n} +% accordingly. \cs{@@_exp_not:n} will be used later to either leave +% \cs{c_@@_hash_tl} or expand it, and also to remember the result of +% \cs{@@_if_has_hash:nTF} to avoid testing twice (the test can be +% rather slow). +% \begin{macrocode} + \tl_set:Nx \l_@@_tmpa_tl { \bool_if:NTF #1 { [ ] } { { } } } \int_step_inline:nnn { 2 } { \l_@@_patch_num_args_int } + { \tl_put_right:Nn \l_@@_tmpa_tl { { } } } + \exp_args:NNo \exp_args:No \@@_if_has_hash:nTF + { \exp_after:wN #2 \l_@@_tmpa_tl } + { \cs_set_eq:NN \@@_exp_not:n \exp_not:n } + { \cs_set_eq:NN \@@_exp_not:n \use:n } + \cs_set_protected:Npn \@@_tmp:w ##1 ##2 { - \tl_put_right:Nn \l_@@_patch_param_text_tl { ## ####1 } - \tl_put_right:Nn \l_@@_patch_replacement_tl { { ## ####1 } } + ##1 \l_@@_param_text_tl { \use:n ##2 } + ##1 \l_@@_replace_text_tl { \@@_exp_not:n {##2} } } +% \end{macrocode} +% Here we'll conditionally add |[|\ldots|]| around the first +% parameter: +% \begin{macrocode} + \bool_if:NTF #1 + { \@@_tmp:w \tl_set:Nx { [ \c_@@_hash_tl 1 ] } } + { \@@_tmp:w \tl_set:Nx { { \c_@@_hash_tl 1 } } } +% \end{macrocode} +% Then, for every parameter from the second, just add it normally: +% \begin{macrocode} + \int_step_inline:nnn { 2 } { \l_@@_patch_num_args_int } + { \@@_tmp:w \tl_put_right:Nx { { \c_@@_hash_tl ##1 } } } +% \end{macrocode} +% Now, if the command has any parameter token in its definition +% (then \cs{@@_exp_not:n} is \cs{exp_not:n}), call +% \cs{@@_double_hashes:n} to double them, and replace every +% \cs{c_@@_hash_tl} by |#|: +% \begin{macrocode} + \tl_set:Nx \l_@@_replace_text_tl + { \exp_not:N #2 \exp_not:V \l_@@_replace_text_tl } + \tl_set:Nx \l_@@_replace_text_tl + { + \token_if_eq_meaning:NNTF \@@_exp_not:n \exp_not:n + { \exp_args:NNV \exp_args:No \@@_double_hashes:n } + { \exp_args:NV \exp_not:o } + \l_@@_replace_text_tl + } +% \end{macrocode} +% And now, set a few auxiliaries for the case that the macro has +% parameters, so it won't be passed through \cs{unexpanded} (twice): +% \begin{macrocode} + \cs_set_eq:NN \@@_def_cmd:w \tex_gdef:D + \cs_set_eq:NN \@@_exp_not:NN \prg_do_nothing: } { - \tl_clear:N \l_@@_patch_param_text_tl - \tl_clear:N \l_@@_patch_replacement_tl +% \end{macrocode} +% In the case the macro has no parameters, we'll treat it as a token +% list and things are much simpler (expansion control looks a bit +% complicated, but it's just a pair of \cs{exp_not:N} preventing +% another \cs{exp_not:n} from expanding): +% \begin{macrocode} + \tl_clear:N \l_@@_param_text_tl + \tl_set_eq:NN \l_@@_replace_text_tl #2 + \cs_set_eq:NN \@@_def_cmd:w \tex_xdef:D + \cs_set:Npn \@@_exp_not:NN ##1 { \exp_not:N ##1 \exp_not:N } } % \end{macrocode} -% Finally, before redefining, we need to also get the prefixes used -% when defining the command. Here we ensure that the \tn{escapechar} -% is printable, otherwise a macro defined with prefixes +% Before redefining, we need to also get the prefixes used when +% defining the command. Here we ensure that the \tn{escapechar} is +% printable, otherwise a macro defined with prefixes % |\protected \long| will have it \tn{meaning} printed as % |protectedlong|, making life unnecessarily complicated. Here the % \tn{escapechar} is changed to |/|, then we loop between pairs of @@ -709,34 +875,47 @@ { \exp_not:N \@@_make_prefixes:w \cs_prefix_spec:N #2 / / } } % \end{macrocode} -% Now that all the needed tools are ready, without further ado we'll -% redefine the command |#2|. The definition uses the prefixes -% gathered in \cs{l_@@_patch_prefixes_tl}, a primitive \cs{tex_def:D} -% to avoid adding extra prefixes, and the \meta{parameter text} from -% \cs{l_@@_patch_param_text_tl}. -% -% Then finally, in the body of the definition, we insert -% \hook{cmd/\#3/before} if |#4| is |before|, the code of the -% command expanded once grabbing the parameters in -% \cs{l_@@_patch_replacement_tl}, and \hook{cmd/\#3/after} if |#4| is -% |after|. +% Finally, call \cs{@@_redefine_with_hooks:Nnnn} with the macro being +% redefined in |#1|, then \cs{UseHook}|{cmd/<name>/before}| in |#2| or +% \cs{UseHook}|{cmd/<name>/after}| in |#3| (one is always empty), and +% in |#4| the \meta{replacement text} of the macro. % \begin{macrocode} \use:x { - \l_@@_patch_prefixes_tl \tex_def:D - \exp_not:N #2 \exp_not:V \l_@@_patch_param_text_tl - { - \str_if_eq:nnT {#4} { before } - { \exp_not:N \UseHook { cmd / #3 / #4 } } - \exp_args:No \exp_not:o - { \exp_after:wN #2 \l_@@_patch_replacement_tl } - \str_if_eq:nnT {#4} { after } - { \exp_not:N \UseHook { cmd / #3 / #4 } } - } + \@@_redefine_with_hooks:Nnnn \exp_not:N #2 + \str_if_eq:nnTF {#4} { after } + { \use_ii_i:nn } + { \use:nn } + { { \@@_exp_not:NN \exp_not:N \UseHook { cmd / #3 / #4 } } } + { { } } + { \@@_exp_not:NN \exp_not:V \l_@@_replace_text_tl } } } % \end{macrocode} % +% Now that all the needed tools are ready, without further ado we'll +% redefine the command. The definition uses the prefixes gathered in +% \cs{l_@@_patch_prefixes_tl}, a primitive \cs{@@_def_cmd:w} (which is +% \cs{tex_gdef:D} or \cs{tex_xdef:D}) to avoid adding extra prefixes, +% and the \meta{parameter text} from \cs{l_@@_param_text_tl}. +% +% Then finally, in the body of the definition, we insert |#2|, which +% is \hook{cmd/\#1/before} or empty, |#4| which is the +% \meta{replacement text}, and |#3| which is \hook{cmd/\#1/after} or +% empty. +% +% \changes{v1.0e}{2021/09/28} +% {Make patching of commands a global operation (gh/674)} +% \begin{macrocode} +\cs_new_protected:Npn \@@_redefine_with_hooks:Nnnn #1 #2 #3 #4 + { + \l_@@_patch_prefixes_tl + \exp_after:wN \@@_def_cmd:w + \exp_after:wN #1 \l_@@_param_text_tl + { #2 #4 #3 } + } +% \end{macrocode} +% % Here's the auxiliary that makes the prefix control sequences for the % redefinition. Each item has to be \cs{tl_trim_spaces:n}'d because % the last item (and not any other) has a trailing space. @@ -752,11 +931,125 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % +% Here are some auxiliaries for the contraption above. % +% \begin{macro}[pTF]{\@@_if_has_hash:n} +% \begin{macro}{\@@_if_has_hash:w,\@@_if_has_hash_check:w} +% \cs{@@_if_has_hash:nTF} searches the token list |#1| for a catcode~6 +% token, and if any is found, it returns |true|, and |false| +% otherwise. The searching doesn't care about preserving groups or +% spaces: we can ignore those safely (braces are removed) so that +% searching is as fast as possible. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_if_has_hash:n #1 { TF } + { \@@_if_has_hash:w #1 ## \s_@@_mark } +\cs_new:Npn \@@_if_has_hash:w #1 + { + \tl_if_single_token:nTF {#1} + { + \token_if_eq_catcode:NNTF ## #1 + { \@@_if_has_hash_check:w } + { \@@_if_has_hash:w } + } + { \@@_if_has_hash:w #1 } + } +\cs_new:Npn \@@_if_has_hash_check:w #1 \s_@@_mark + { \tl_if_empty:nTF {#1} { \prg_return_false: } { \prg_return_true: } } +% \end{macrocode} +% \end{macro} +% \end{macro} % % +% \begin{macro}[rEXP]{\@@_double_hashes:n} +% \begin{macro}[rEXP]{ +% \@@_double_hashes:w, +% \@@_double_hashes_output:N, +% \@@_double_hashes_stop:w, +% \@@_double_hashes_group:n, +% \@@_double_hashes_space:w, +% } +% \cs{@@_double_hashes:n} loops through the token list |#1| and +% duplicates any catcode~6 token, and expands tokens \cs{ifx}-equal to +% \cs{c_@@_hash_tl}, and leaves all other tokens \cs{notexpanded} with +% \cs{exp_not:N}. Unfortunately pairs of explicit catcode~1 and +% catcode~2 character tokens are normalised to |{|$_1$ and |}|$_1$ +% because it's not feasible to expandably detect the character code +% (\emph{maybe} it could be done using something along the lines of +% \url{https://tex.stackexchange.com/a/527538}, but it's far too much +% work for close to zero benefit). +% +% \cs{@@_double_hashes:w} is the tail-recursive loop macro, that tests +% which of the three types of item is in the head of the token list. +% \begin{macrocode} +\cs_new:Npn \@@_double_hashes:n #1 + { \@@_double_hashes:w #1 \q_@@_recursion_tail \q_@@_recursion_stop } +\cs_new:Npn \@@_double_hashes:w #1 \q_@@_recursion_stop + { + \tl_if_head_is_N_type:nTF {#1} + { \@@_double_hashes_output:N } + { + \tl_if_head_is_group:nTF {#1} + { \@@_double_hashes_group:n } + { \@@_double_hashes_space:w } + } + #1 \q_@@_recursion_stop + } +% \end{macrocode} +% +% \cs{@@_double_hashes_output:N} checks for the end of the token list, +% then checks if the token is \cs{c_@@_hash_tl}, and if so just leaves +% it. +% \begin{macrocode} +\cs_new:Npn \@@_double_hashes_output:N #1 + { + \if_meaning:w \q_@@_recursion_tail #1 + \@@_double_hashes_stop:w + \fi: + \if_meaning:w \c_@@_hash_tl #1 +% \end{macrocode} +% (this \cs{use_i:nnnn} uses \cs{fi:} and consumes \cs{use:n}, the +% whole \cs{if_catcode:w} block, and the \cs{exp_not:N}, leaving just +% |#1| which is \cs{c_@@_hash_tl}.) +% \begin{macrocode} + \use_i:nnnn + \fi: + \use:n + { +% \end{macrocode} +% If |#1| is not \cs{c_@@_hash_tl}, then check if its catcode is~6, +% and if so, leave it doubled in \cs{exp_not:n} and consume the +% following |\exp_not:N #1|. +% \begin{macrocode} + \if_catcode:w ## \exp_not:N #1 + \exp_after:wN \use_ii:nnnn + \fi: + \use_none:n + { \exp_not:n { #1 #1 } } + } +% \end{macrocode} +% If both previous tests returned |false|, then leave the token +% unexpanded and resume the loop. +% \begin{macrocode} + \exp_not:N #1 + \@@_double_hashes:w + } +\cs_new:Npn \@@_double_hashes_stop:w #1 \q_@@_recursion_stop { \fi: } +% \end{macrocode} +% +% Dealing with spaces and grouped tokens is trivial: +% \begin{macrocode} +\cs_new:Npn \@@_double_hashes_group:n #1 + { { \@@_double_hashes:n {#1} } \@@_double_hashes:w } +\exp_last_unbraced:NNo +\cs_new:Npn \@@_double_hashes_space:w \c_space_tl + { ~ \@@_double_hashes:w } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % % \subsubsection{Patching by retokenization} % @@ -1030,8 +1323,11 @@ % \end{macrocode} % And to close, copy the newly-defined command into the old name and % the patching is finally completed: +% +% \changes{v1.0e}{2021/09/28} +% {Make patching of commands a global operation (gh/674)} % \begin{macrocode} - \cs_set_eq:NN #1 \kerneltmpDoNotUse + \cs_gset_eq:NN #1 \kerneltmpDoNotUse } % \end{macrocode} % \end{macro} @@ -1039,15 +1335,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/macros/latex/base/ltcounts.dtx b/macros/latex/base/ltcounts.dtx index 445cac2f2e..39fb47728d 100644 --- a/macros/latex/base/ltcounts.dtx +++ b/macros/latex/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/macros/latex/base/ltdefns.dtx b/macros/latex/base/ltdefns.dtx index 4f39d922cc..6c85ca915d 100644 --- a/macros/latex/base/ltdefns.dtx +++ b/macros/latex/base/ltdefns.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltdefns.dtx} - [2021/05/27 v1.5p LaTeX Kernel (definition commands)] + [2021/06/04 v1.5q LaTeX Kernel (definition commands)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltdefns.dtx} @@ -1231,7 +1231,7 @@ \count@=\escapechar \escapechar=`\\ \@ifundefined{\expandafter\@gobble\string#1}{% - \@latex@error{Command `\string#1' is undefined!% + \@latex@error{Command `\string#1' undefined.% \MessageBreak There is nothing here to make robust}% \@eha }% diff --git a/macros/latex/base/lterror.dtx b/macros/latex/base/lterror.dtx index 7f480a0171..10d93a1dbd 100644 --- a/macros/latex/base/lterror.dtx +++ b/macros/latex/base/lterror.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{lterror.dtx} - [2019/08/30 v1.2q 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} @@ -446,6 +498,50 @@ Type H <return> for immediate help.}% % \end{macro} % \end{macro} % +% \begin{macro}{\@latex@note} +% \begin{macro}{\@latex@note@no@line} +% These are ``info'' messages that display on the terminal not +% just in the transcript. +% \changes{v1.2r}{2021/06/09}{Macros added} +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\@latex@note}{Display notes}% +\def\@latex@note#1{% + \GenericWarning{% + \@spaces\@spaces\@spaces + }{% + LaTeX Info: #1% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\def\@latex@note@no@line#1{% + \@latex@note{#1\@gobble}} +% \end{macrocode} +% +% We don't make them undefined but rather point to \cs{@latex@info} +% because that's what they replace. This way we can change +% \cs{@latex@info} elsewhere without the need to further rollback +% sections. +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\@latex@note}{Display notes}% +%<latexrelease> +%<latexrelease>\let\@latex@note\@latex@info +%<latexrelease>\let\@latex@note@no@line\@latex@info@no@line +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% +% \end{macro} +% \end{macro} +% +% % \begin{macro}{\c@errorcontextlines} % \changes{LaTeX2e}{1993/11/22}{Macro added} % |\errorcontextlines| as a \LaTeX\ counter, so that it may be @@ -591,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/macros/latex/base/ltexpl.dtx b/macros/latex/base/ltexpl.dtx index 6d7ec3ff60..021edc644c 100644 --- a/macros/latex/base/ltexpl.dtx +++ b/macros/latex/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/macros/latex/base/ltfilehook-code.pdf b/macros/latex/base/ltfilehook-code.pdf Binary files differindex 766dc944e9..877b2d92a5 100644 --- a/macros/latex/base/ltfilehook-code.pdf +++ b/macros/latex/base/ltfilehook-code.pdf diff --git a/macros/latex/base/ltfilehook-doc.pdf b/macros/latex/base/ltfilehook-doc.pdf Binary files differindex 05e9c8b03d..9130f20cea 100644 --- a/macros/latex/base/ltfilehook-doc.pdf +++ b/macros/latex/base/ltfilehook-doc.pdf diff --git a/macros/latex/base/ltfilehook.dtx b/macros/latex/base/ltfilehook.dtx index 5d0acc8fdf..000f4d8c2a 100644 --- a/macros/latex/base/ltfilehook.dtx +++ b/macros/latex/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/macros/latex/base/ltfiles.dtx b/macros/latex/base/ltfiles.dtx index bcaac58220..4c24716df6 100644 --- a/macros/latex/base/ltfiles.dtx +++ b/macros/latex/base/ltfiles.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltfiles.dtx} - [2021/04/17 v1.2m LaTeX Kernel (File Handling)] + [2021/10/14 v1.2p LaTeX Kernel (File Handling)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfiles.dtx} @@ -823,8 +823,16 @@ % % \changes{v1.2j}{2020/10/04}{Quotes around the aux file name removed, % they are not needed and upset BibTeX (gh/400)} +% \changes{v1.2p}{2021/10/14}{Warn about use in preamble} % \begin{macrocode} \def\@include#1 {% +% \end{macrocode} +% +% \begin{macrocode} +\ifx\@nodocument\relax +% \end{macrocode} +% +% \begin{macrocode} \clearpage \if@filesw \immediate\write\@mainaux{\string\@input{#1.aux}}% @@ -850,16 +858,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 +880,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 %----------------------------------------- @@ -888,7 +900,23 @@ \deadcycles\z@ \@nameuse{cp@#1}% \fi - \let\@auxout\@mainaux} + \let\@auxout\@mainaux +% \end{macrocode} +% +% \begin{macrocode} +\else +\@latex@warning{% + \noexpand\include should only be used after \string\begin{document}}% +\@input@{#1}% +\fi} +% \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/macros/latex/base/ltfinal.dtx b/macros/latex/base/ltfinal.dtx index 19f82934aa..40017a205a 100644 --- a/macros/latex/base/ltfinal.dtx +++ b/macros/latex/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,39 @@ % \end{macro} % \end{macro} % +% \subsection{Preparation for supporting PDF in backends} +% +% At the current point in time, basic support for PDF in +% backends is not part of \LaTeX{} core; it is 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. +% +% In that code there is a command \cs{IfPDFManagementActiveTF} +% which can be used by packages in order to execute different +% code depending on the whether this basic backend support is loaded. +% +% To make this also work properly when this external package is not +% loaded at all, we here add this command already in the +% kernel (with a trivial definition); thus any package can +% query this loading state in all circumstances. +% Once this basic PDF backend +% support gets moved to the kernel, this definition will vanish +% again from here or, rather, it will be replaced by a real test. +% +% \begin{macro}{\IfPDFManagementActiveTF} +% So long as the code for the basic backend support for PDF is not +% loaded, the test that is implicit here will +% always return the false branch. +% Once this code is loaded, this definition will get +% replaced by a real test (as it is then possible that the +% management code is either activated 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 +1288,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/macros/latex/base/ltfloat.dtx b/macros/latex/base/ltfloat.dtx index ed25db3ed1..ac3b641817 100644 --- a/macros/latex/base/ltfloat.dtx +++ b/macros/latex/base/ltfloat.dtx @@ -31,7 +31,7 @@ % %<*driver> % \fi -\ProvidesFile{ltfloat.dtx}[2021/03/03 v1.2f LaTeX Kernel (Floats)] +\ProvidesFile{ltfloat.dtx}[2021/10/14 v1.2g LaTeX Kernel (Floats)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfloat.dtx} @@ -1510,10 +1510,12 @@ % {Missing percent, again} % \changes{v1.2e}{2021/02/10}{Explicitly run \cs{par} at the end of footnote text % in preparation for paragraph hooks} +% \changes{v1.2g}{2021/10/14} +% {Explicitly set \cs{@currentcounter} (gh/687)} % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2021/06/01}% +%<latexrelease>\IncludeInRelease{2021/11/15}% %<latexrelease> {\@footnotetext}{footnotetext tagging}% \long\def\@footnotetext#1{\insert\footins{% \reset@font\footnotesize @@ -1521,6 +1523,7 @@ \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore + \def\@currentcounter{footnote}% \protected@edef\@currentlabel{% \csname p@footnote\endcsname\@thefnmark }% @@ -1534,6 +1537,26 @@ % \end{macrocode} % % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2021/06/01}% +%<latexrelease> {\@footnotetext}{footnotetext tagging}% +%<latexrelease>\long\def\@footnotetext#1{\insert\footins{% +%<latexrelease> \reset@font\footnotesize +%<latexrelease> \interlinepenalty\interfootnotelinepenalty +%<latexrelease> \splittopskip\footnotesep +%<latexrelease> \splitmaxdepth \dp\strutbox \floatingpenalty \@MM +%<latexrelease> \hsize\columnwidth \@parboxrestore +%<latexrelease> \protected@edef\@currentlabel{% +%<latexrelease> \csname p@footnote\endcsname\@thefnmark +%<latexrelease> }% +%<latexrelease> \color@begingroup +%<latexrelease> \@makefntext{% +%<latexrelease> \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% +%<latexrelease> \par +%<latexrelease> \color@endgroup}}% +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} %<latexrelease>\IncludeInRelease{0000/00/00}% %<latexrelease> {\@footnotetext}{footnotetext tagging}% %<latexrelease> diff --git a/macros/latex/base/ltfntcmd.dtx b/macros/latex/base/ltfntcmd.dtx index 5f70053a68..6c4ec4b3d1 100644 --- a/macros/latex/base/ltfntcmd.dtx +++ b/macros/latex/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/macros/latex/base/ltfssbas.dtx b/macros/latex/base/ltfssbas.dtx index df265d0b0f..1f30372d06 100644 --- a/macros/latex/base/ltfssbas.dtx +++ b/macros/latex/base/ltfssbas.dtx @@ -35,7 +35,7 @@ % % \ProvidesFile{ltfssbas.dtx} - [2021/04/26 v3.2i LaTeX Kernel (NFSS Basic Macros)] + [2021/06/09 v3.2j LaTeX Kernel (NFSS Basic Macros)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -280,11 +280,12 @@ % may have dropped an ``m''. If nothing has changes, % fine. Otherwise there was a wrong value which is now corrected in % \cs{reservedb} so we use that and also issue a warning. +% \changes{v3.2j}{2021/06/09}{Improve information message} % \begin{macrocode} \edef\reserved@a{#3}% \series@maybe@drop@one@m\reserved@a\reserved@b \ifx\reserved@a\reserved@b\else - \@latex@warning{Font shape declaration has incorrect series + \@latex@note{Font shape #1/#2/#3/#4 has incorrect series value `#3'.\MessageBreak It should not contain an `m'! Please correct it.\MessageBreak Found}% \fi diff --git a/macros/latex/base/ltfssdcl.dtx b/macros/latex/base/ltfssdcl.dtx index 9710d54382..4f2cabd613 100644 --- a/macros/latex/base/ltfssdcl.dtx +++ b/macros/latex/base/ltfssdcl.dtx @@ -36,7 +36,7 @@ % % \ProvidesFile{ltfssdcl.dtx} - [2021/02/15 v3.0w LaTeX Kernel (NFSS Declarative Interface)] + [2021/10/15 v3.0y LaTeX Kernel (NFSS Declarative Interface)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -454,25 +454,88 @@ % \end{macrocode} % \end{macro} % +% +% +% +% \begin{macro}{\c@localalphabets} +% \changes{v3.0x}{2021/09/26}{Counter added for (gh/676)} +% To avoid hitting the ``no more math fams available'' limit of 16, we +% keep a defined number of math alphabets flexible/local. If we have to +% allocate any of those we roll back the allocation after the +% formula has ended, so the next formula can use other alphabets in +% the slot(s). This makes the processing a bit slower if you are +% working at the limit, but that is better than dying with ``out of memory''. +% \begin{macrocode} +%</2ekernel> +%<latexrelease>\IncludeInRelease{2021/11/15} +%<latexrelease> {\document@select@group}{\document@select@group}% +%<*2ekernel|latexrelease> +% \end{macrocode} +% We don't really undo the declaration on rollback (as that would +% be hard to maintain), so rolling +% forward needs to check if the declaration was already made. +% \begin{macrocode} +\ifx\c@localmathalphabets\@undefined +% \end{macrocode} +% There is no need to have this counter as part of the include +% checkpoints, given that it makes little sense to alter its +% settings mid document. All we want is the ability to change it +% using the \cs{setcounter} interface. +% +% By default we keep two math fams flexible. +% \begin{macrocode} + \newcount\c@localmathalphabets + \setcounter{localmathalphabets}{2} +\fi +% \end{macrocode} +% \end{macro} +% +% +% +% +% % \begin{macro}{\document@select@group} -% We surround |\select@group| with braces so that functions using it -% can be used directly after |_| or |^|. -% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} -% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} +% The \cs{document@select@group} command is the version of +% \cs{select@group} (inside math versions) that is used in the +% document body to set up math alphabets (if used). +% % \changes{v3.0g}{1997/11/20} % {(DPC) inline use of \cs{stepcounter} (faster, and saves a csname % per math version as no reset list)} % \changes{v3.0q}{2015/03/18}{Introduce \cs{e@mathgroup@top}} % \begin{macrocode} -%</2ekernel> -%<latexrelease>\IncludeInRelease{2020/10/01} -%<latexrelease> {\document@select@group}{\document@select@group}% -%<*2ekernel|latexrelease> \def\document@select@group#1#2#3#4{% \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi {% \ifmmode +% \end{macrocode} +% We first check if there is still room for allocating another +% mathgroup. If there is, we check if it can be globally allocated +% or if we have reached the limit which is given by +% \cs{e@mathgroup@top} with \cs{c@localmathalphabets} subtracted. +% +% \changes{v3.0x}{2021/09/26}{Test if we should freeze the version (gh/676)} +% \begin{macrocode} \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top + \ifnum \numexpr\e@mathgroup@top-\c@localmathalphabets + >\csname c@mv@\math@version\endcsname + \else +% \end{macrocode} +% If we are past this point we freeze the current state of the math +% version so that we can return to it after the formula has +% ended. Of course, that should be done only once, so we check if +% \cs{mv@\meta{version}@frozen} already exists. +% \begin{macrocode} + \ifcsname mv@\math@version @frozen\endcsname \else +% \end{macrocode} +% We have to pass the current value of \cs{math@version} not the +% macro itself, because some of the processing is delayed to a +% point where the value may have changed again---not doing this +% caused a puzzling error in one setup. +% \begin{macrocode} + \expandafter\freeze@math@version\expandafter{\math@version}% + \fi + \fi \begingroup \escapechar\m@ne \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% @@ -486,16 +549,21 @@ \global\advance\csname c@mv@\math@version\endcsname\@ne \else \let#1\relax - \@latex@error{Too many math alphabets used - in version \math@version}% + \@latex@error{Too many math alphabets used in + version \math@version}% \@eha \fi % \end{macrocode} -% extra \cs{expandafter} to remove the \cs{expandafter} added below -% \changes{v3.0w}{2021/02/115}{fix for (gh/501)} +% Extra \cs{expandafter} to remove the \cs{expandafter} added below +% \changes{v3.0w}{2021/02/15}{fix for (gh/501)} % \begin{macrocode} \else \expandafter\expandafter\expandafter\non@alpherr\fi % \end{macrocode} +% We surround |\select@group| with braces so that functions using it +% can be used directly after |_| or |^|. +% \changes{v2.1p}{1994/12/10}{Surround with braces (add fourth arg)} +% \changes{v2.1q}{1995/04/02}{fix problem for pr/1275} +% % If the legacy interface is used, e.g., \verb=$\sf -1$= the math % alphabet \verb=#1= does not take an argument so we better do not % surround \verb=#4= with braces, because then we get @@ -507,8 +575,142 @@ \expandafter#1\ifx\math@bgroup\bgroup{#4}\else#4\fi }% } +% \end{macrocode} +% +% +% +% \begin{macro}{\freeze@math@version} +% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} +% This command stores the current state of the math version and sets +% things up to return to it after each formula from now on. We use +% L3 programming layer code to set it up. +% \begin{macrocode} +\ExplSyntaxOn +\cs_new_protected:Npn\freeze@math@version #1 { +% \end{macrocode} +% Save the current \cs{mv@\meta{version}} code and the number of +% allocated mathgroups inside. +% \begin{macrocode} + \@font@info{Freeze~ math~ alphabet~ allocation~ in~ version~ + #1.\MessageBreak + Allocated~math~groups:~\int_use:c{ c@mv@ #1 }~ + (local:~ \int_use:N\c@localmathalphabets) } + \cs_gset_eq:cc { mv@#1@frozen }{ mv@#1 } + \tl_gset:cx { g__nfss_frozen_mv_ #1 _tl }{ \int_use:c { c@mv@#1 } } +% \end{macrocode} +% Doing the reset the first time, we wait until we are out of +% math mode, so we use some recursive \cs{group_insert_after:N} for this +% before we execute \cs{mv@\meta{version}@reset}. +% \begin{macrocode} + \group_insert_after:N \__nfss_init_mv_freeze:N \exp_after:wN + \group_insert_after:N \cs:w mv@#1@reset \cs_end: +% \end{macrocode} +% The \cs{check@mathfonts} is called at the very beginning of each +% math formula, so it is a good way to hook in the resetting. +% Again that has to happen after the formula has ended, but we know +% because of the place where \cs{check@mathfonts} is used +% that a single \cs{aftergoup} is sufficient. +% \begin{macrocode} + \tl_gput_right:No \check@mathfonts + { + \exp_after:wN \group_insert_after:N \cs:w mv@#1@reset \cs_end: + } +% \end{macrocode} +% Here is the definition of \cs{mv@\meta{version}@reset}. If there +% has been no new math alphabet allocation, doing a reset would +% just cause a lot of unnecessary processing, so we do a quick +% check upfront for this. +% \begin{macrocode} + \cs_gset:cpn{mv@#1@reset} + { + \int_compare:nNnTF { \int_use:c{c@mv@#1} } > + { \tl_use:c{g__nfss_frozen_mv_ #1 _tl} } + { + \@font@info{Undo~ math~ alphabet~ allocation~ in~ version~ #1} +% \end{macrocode} +% If the undo is necessary, we restore the \cs{mv@\meta{version}} code. +% \begin{macrocode} + \cs_gset_eq:cc { mv@#1 }{ mv@#1@frozen } + \int_gset:cn { c@mv@#1 }{ \tl_use:c {g__nfss_frozen_mv_ #1 _tl} } +% \end{macrocode} +% But we also should undo changes to the math alphabet +% definitions. We therefore run this code with a modified +% definition for \cs{getanddefine@fonts} because there is no need +% to do anything to the symbol fonts that are permanently allocated. +% \begin{macrocode} + \group_begin: + \cs_set_eq:NN \getanddefine@fonts \use_none:nn + \use:c {mv@#1} + \group_end: + } + { +% \end{macrocode} +% If there was no change, we report that in the log (but this +% branch could go completely). +% \begin{macrocode} + \@font@info{No~ math~ alphabet~ change~ to~ frozen~ version~ #1} + } + } +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\__nfss_init_mv_freeze:N} +% \changes{v3.0x}{2021/09/26}{Macro added for (gh/676)} +% To do the initial freeze in a safe place, we check if we are in +% math mode and if so try again after the group has ended by pushing +% the command and its single token argument with two +% \cs{group_insert_after:N}s after the current group. If we are no longer in +% math mode we bypass the +% conditional and so the next token is our argument +% which is then finally executed. +% \begin{macrocode} +\cs_new_protected:Npn \__nfss_init_mv_freeze:N #1 {% + \mode_if_math:T { \group_insert_after:N \__nfss_init_mv_freeze:N + \group_insert_after:N } #1 +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01} +%<latexrelease> {\document@select@group}{\document@select@group}% +%<latexrelease> +%<latexrelease>\def\document@select@group#1#2#3#4{% +%<latexrelease> \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi +%<latexrelease> {% +%<latexrelease> \ifmmode +%<latexrelease> \ifnum\csname c@mv@\math@version\endcsname<\e@mathgroup@top +%<latexrelease> \begingroup +%<latexrelease> \escapechar\m@ne +%<latexrelease> \getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3% +%<latexrelease> \globaldefs\@ne \math@fonts +%<latexrelease> \endgroup +%<latexrelease> \expandafter\extract@alph@from@version +%<latexrelease> \csname mv@\math@version\expandafter\endcsname +%<latexrelease> \expandafter{\number\csname +%<latexrelease> c@mv@\math@version\endcsname}% +%<latexrelease> #1% +%<latexrelease> \global\advance\csname c@mv@\math@version\endcsname\@ne +%<latexrelease> \else +%<latexrelease> \let#1\relax +%<latexrelease> \@latex@error{Too many math alphabets used +%<latexrelease> in version \math@version}% +%<latexrelease> \@eha +%<latexrelease> \fi +%<latexrelease> \else \expandafter\expandafter\expandafter\non@alpherr\fi +%<latexrelease> \expandafter#1\ifx\math@bgroup\bgroup{#4}\else#4\fi +%<latexrelease> }% +%<latexrelease>} +%<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{2015/01/01} %<latexrelease> {\document@select@group}{\document@select@group}% %<latexrelease> @@ -653,9 +855,36 @@ % % \begin{macro}{\DeclareMathVersion} % \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\DeclareMathVersion}{local alphabets}% \def\DeclareMathVersion#1{% +% \end{macrocode} +% When declaring a new math version we need to instantiate an L3 +% variable that is used when we freeze the version, because too many +% alphabets got allocated. If we don't do this, L3 programming layer +% complains if it is run in checking mode. +% \changes{v3.0y}{2021/10/15}{Initialize variable for freezing +% math version (gh/676)} +% \begin{macrocode} + \@namedef{g__nfss_frozen_mv_#1_tl}{}% +% \end{macrocode} +% +% \begin{macrocode} \expandafter\new@mathversion\csname mv@#1\endcsname} \@onlypreamble\DeclareMathVersion +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\DeclareMathVersion}{local alphabets}% +%<latexrelease>\def\DeclareMathVersion#1{% +%<latexrelease> \expandafter\new@mathversion\csname mv@#1\endcsname} +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % diff --git a/macros/latex/base/ltfssini.dtx b/macros/latex/base/ltfssini.dtx index b06fc161b0..f817fdd847 100644 --- a/macros/latex/base/ltfssini.dtx +++ b/macros/latex/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/macros/latex/base/ltfsstrc.dtx b/macros/latex/base/ltfsstrc.dtx index c6aec105ba..f562a4fa90 100644 --- a/macros/latex/base/ltfsstrc.dtx +++ b/macros/latex/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/macros/latex/base/lthooks-code.pdf b/macros/latex/base/lthooks-code.pdf Binary files differindex abab75e73e..9bca7b107c 100644 --- a/macros/latex/base/lthooks-code.pdf +++ b/macros/latex/base/lthooks-code.pdf diff --git a/macros/latex/base/lthooks-doc.pdf b/macros/latex/base/lthooks-doc.pdf Binary files differindex fcefe27925..0e16c48d0e 100644 --- a/macros/latex/base/lthooks-doc.pdf +++ b/macros/latex/base/lthooks-doc.pdf diff --git a/macros/latex/base/lthooks.dtx b/macros/latex/base/lthooks.dtx index 20e172a57f..5b3d80e984 100644 --- a/macros/latex/base/lthooks.dtx +++ b/macros/latex/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.0s} +\def\lthooksdate{2021/09/28} % \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,20 @@ % 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 -% generic \hook{cmd} hook was already explicitly declared before. -% -% Normally \cs{hook_new:n} should be used instead. +% This is like \cs{hook_new:n} but it does nothing if the hook was previously +% declared with \cs{hook_new:n}. This declaration should be used +% only in special situations, e.g., when a command from another package +% needs to be altered and it is not clear whether a +% generic \hook{cmd} hook (for that command) has been previously +% explicitly declared. +% +% Normally \cs{hook_new:n} should be used instead of this. % \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 +1033,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 +1049,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 +1166,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 +1325,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 +1343,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 +1446,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 +1455,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 +1466,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 +1522,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 +1631,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 +1648,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 +1701,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 +1760,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 +1868,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 +1877,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 +1929,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 +2024,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 +2057,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 +2074,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 +2114,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 +2213,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 +2266,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 +2309,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 +2345,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 +2355,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 +2398,8 @@ % \end{macrocode} % \end{macro} % -% -% +% +% % \begin{macro}{\@@_make_usable:n} % % This initializes all hook data structures for the hook but if @@ -2315,7 +2473,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 +2565,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 +2583,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 +2607,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 +2617,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 +2665,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 +2734,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 +2744,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 +2756,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 +2780,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 +2823,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 +2977,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 +3093,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} % @@ -2866,44 +3139,43 @@ % component to see if we have to make a reversed hook. In either case % the function returns \meta{true} for a generic hook and \meta{false} % in other cases. +% +% \changes{v1.0s}{2021/09/28} +% {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/675)} % \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 +%<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 +3185,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 +3195,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 +3339,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 +3449,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 +3539,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 +3556,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 +3626,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 +3769,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 +3810,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 +3862,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 +3873,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 +3888,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 +3977,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 +3997,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 +4013,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 +4039,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 +4060,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 +4077,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 +4101,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 +4119,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 +4276,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 +4287,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 +4349,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 +4395,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 +4612,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 +4651,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 +4686,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 +4768,123 @@ % \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} % +% \changes{v1.0s}{2021/09/28} +% {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/675)} % \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 +%<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 +4972,8 @@ } % \end{macrocode} % \end{macro} -% -% -% +% +% % \begin{macro}[pTF]{\@@_if_declared:n} % % Internal test to check if the hook was officially declared with @@ -4526,28 +4993,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 +5075,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 +5083,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 +5116,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 +5128,7 @@ 'unrelated'. } % \end{macrocode} -% +% % \begin{macrocode} \msg_new:nnnn { hooks } { misused-top-level } { @@ -4651,7 +5166,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 +5176,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 +5218,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 +5257,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 +5282,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 +5294,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 +5322,6 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % % % @@ -4961,7 +5345,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 +5355,7 @@ % % % \begin{macro}{\DeclareHookRule} -% +% % \begin{macrocode} \NewDocumentCommand \DeclareHookRule { m m m m } { \hook_gset_rule:nnnn {#1}{#2}{#3}{#4} } @@ -5001,7 +5385,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 +5409,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 +5557,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 +5594,6 @@ % \Finale % % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/base/ltluatex.dtx b/macros/latex/base/ltluatex.dtx index 3b9a337731..258ac48297 100644 --- a/macros/latex/base/ltluatex.dtx +++ b/macros/latex/base/ltluatex.dtx @@ -28,7 +28,7 @@ \ProvidesFile{ltluatex.dtx} %</driver> %<*tex> -[2021/04/18 v1.1t +[2021/10/15 v1.1v %</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} @@ -1413,6 +1415,7 @@ local callbacktypes = callbacktypes or { % \changes{v1.1j}{2019/06/18}{font\_descriptor\_objnum\_provider added} % \changes{v1.1l}{2020/02/02}{glyph\_info added} % \changes{v1.1t}{2021/04/18}{input\_level\_string added} +% \changes{v1.1v}{2021/10/15}{provide\_charproc\_data added} % \begin{macrocode} define_font = exclusive, glyph_info = exclusive, @@ -1421,6 +1424,7 @@ local callbacktypes = callbacktypes or { make_extensible = exclusive, font_descriptor_objnum_provider = exclusive, input_level_string = exclusive, + provide_charproc_data = exclusive, % \end{macrocode} % \changes{v1.0m}{2016/02/11}{pdf\_stream\_filter\_callback removed} % \begin{macrocode} diff --git a/macros/latex/base/ltluatex.pdf b/macros/latex/base/ltluatex.pdf Binary files differindex ffada10343..4bd1fff217 100644 --- a/macros/latex/base/ltluatex.pdf +++ b/macros/latex/base/ltluatex.pdf diff --git a/macros/latex/base/ltmath.dtx b/macros/latex/base/ltmath.dtx index aadb96fb02..59e0d89a10 100644 --- a/macros/latex/base/ltmath.dtx +++ b/macros/latex/base/ltmath.dtx @@ -38,7 +38,7 @@ %<*driver> % \fi \ProvidesFile{ltmath.dtx} - [2021/04/20 v1.2i LaTeX Kernel (Math Setup)] + [2021/10/14 v1.2j LaTeX Kernel (Math Setup)] % \iffalse %</driver> % @@ -915,10 +915,13 @@ % whole display. Note that we can't use \cs{refstepcounter} as this % results in |\@currentlabel| getting restored at the wrong and % thus always writing the first label to the \texttt{.aux} file. +% \changes{v1.2j}{2021/10/14} +% {Explicitly set \cs{@currentcounter} (gh/687)} % \begin{macrocode} \def\eqnarray{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% + \def\@currentcounter{equation}% \global\@eqnswtrue \m@th \global\@eqcnt\z@ @@ -1231,10 +1234,13 @@ % % \begin{environment}{eqnarray} % The \textsf{eqnarray} environment +% \changes{v1.2j}{2021/10/14} +% {Explicitly set \cs{@currentcounter} (gh/687)} % \begin{macrocode} \renewenvironment{eqnarray}{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% + \def\@currentcounter{equation}% \global\@eqnswtrue\m@th \global\@eqcnt\z@ \tabskip\mathindent diff --git a/macros/latex/base/ltmiscen.dtx b/macros/latex/base/ltmiscen.dtx index 8bae3f9bfa..6cc58907a0 100644 --- a/macros/latex/base/ltmiscen.dtx +++ b/macros/latex/base/ltmiscen.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltmiscen.dtx} - [2021/02/08 v1.1y LaTeX Kernel (Misc. Environments)] + [2021/06/05 v1.1z LaTeX Kernel (Misc. Environments)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltmiscen.dtx} @@ -1471,12 +1471,13 @@ \def\@sverb#1{\if\noexpand#1 \expandafter\@sverb\else\@@sverb{#1}\fi} % \end{macrocode} % +% \changes{v1.1z}{2021/06/05}{Normalize error message} % \begin{macrocode} \def\@@sverb#1{% \catcode`#1\active \lccode`\~`#1% \gdef\verb@balance@group{\verb@egroup - \@latex@error{\noexpand\verb illegal in command argument}\@ehc}% + \@latex@error{\noexpand\verb illegal in argument}\@ehc}% \aftergroup\verb@balance@group \lowercase{\let~\verb@egroup}% % \end{macrocode} diff --git a/macros/latex/base/ltnews.pdf b/macros/latex/base/ltnews.pdf Binary files differindex c1cfc56d4f..c543d0e9e4 100644 --- a/macros/latex/base/ltnews.pdf +++ b/macros/latex/base/ltnews.pdf diff --git a/macros/latex/base/ltnews.tex b/macros/latex/base/ltnews.tex index fa44de670c..406787c5f0 100644 --- a/macros/latex/base/ltnews.tex +++ b/macros/latex/base/ltnews.tex @@ -38,9 +38,9 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltnews.tex}% - [2020/10/25 v1.4d Master file for ltnews*.tex (LaTeX Project)] + [2021/06/07 v1.4d Master file for ltnews*.tex (LaTeX Project)] -\providecommand*{\lastissue}{33} +\providecommand*{\lastissue}{34} \InputIfFileExists{ltnews-lastissue.cfg}{}{} diff --git a/macros/latex/base/ltnews01.pdf b/macros/latex/base/ltnews01.pdf Binary files differindex c8f2ae6501..146c7886dd 100644 --- a/macros/latex/base/ltnews01.pdf +++ b/macros/latex/base/ltnews01.pdf diff --git a/macros/latex/base/ltnews02.pdf b/macros/latex/base/ltnews02.pdf Binary files differindex f0364a00b8..a8e9aab403 100644 --- a/macros/latex/base/ltnews02.pdf +++ b/macros/latex/base/ltnews02.pdf diff --git a/macros/latex/base/ltnews02.tex b/macros/latex/base/ltnews02.tex index e1fa2909dc..dfc78e4843 100644 --- a/macros/latex/base/ltnews02.tex +++ b/macros/latex/base/ltnews02.tex @@ -38,6 +38,12 @@ \publicationyear{1994} \publicationissue{2} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -64,7 +70,7 @@ font selection} (\verb|fntguide.tex|) and our change log (\verb|changes.txt|) for more details. However, there are two important new packages available for \LaTeX: -\texttt{inputenc} and AMS-\LaTeX. +\pkg{inputenc} and AMS-\LaTeX. \section{Accented input} @@ -110,17 +116,17 @@ be upwardly compatible with the test version. It will be divided into two bundles: \begin{itemize} - \item the \verb|amsfonts| packages, which give access to + \item the \pkg{amsfonts} packages, which give access to hundreds of new mathematical symbols, and new math fonts such as blackboard bold and fraktur. - \item the \verb|amsmath| packages, which provide finer control over + \item the \pkg{amsmath} packages, which provide finer control over mathematical typesetting, such as multi-line subscripts, enhanced theorem and proof environments, and improved displayed equations, \end{itemize} - For compatibility with older documents, an \verb|amstex| package will be + For compatibility with older documents, an \pkg{amstex} package will be provided. \section{\LaTeX{} on the internet} diff --git a/macros/latex/base/ltnews03.pdf b/macros/latex/base/ltnews03.pdf Binary files differindex aed1773a52..0fa25151dc 100644 --- a/macros/latex/base/ltnews03.pdf +++ b/macros/latex/base/ltnews03.pdf diff --git a/macros/latex/base/ltnews03.tex b/macros/latex/base/ltnews03.tex index f000d66e4d..e555e12df4 100644 --- a/macros/latex/base/ltnews03.tex +++ b/macros/latex/base/ltnews03.tex @@ -38,6 +38,14 @@ \publicationyear{1995} \publicationissue{3} + +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + + \begin{document} \maketitle @@ -61,20 +69,20 @@ true! \section{Additional input encodings} In the last release of \LaTeX{} we distributed a test version of the -\texttt{inputenc} package which allows the use of input characters +\pkg{inputenc} package which allows the use of input characters other than just a--z and A--Z. The package has proved to be robust, so we are now distributing an expanded version. The new release comes with a number of input encodings: \begin{itemize} -\item \texttt{ascii} the standard encoding, -\item \texttt{latin1} the ISO Western European alphabet, -\item \texttt{latin2} the ISO Eastern European alphabet, -\item \texttt{cp437} the IBM codepage 437, -\item \texttt{cp850} the IBM codepage 850, and -\item \texttt{applemac} the Apple Macintosh encoding. +\item \option{ascii} the standard encoding, +\item \option{latin1} the ISO Western European alphabet, +\item \option{latin2} the ISO Eastern European alphabet, +\item \option{cp437} the IBM codepage 437, +\item \option{cp850} the IBM codepage 850, and +\item \option{applemac} the Apple Macintosh encoding. \end{itemize} -These can be used by specifying an option to the \texttt{inputenc} +These can be used by specifying an option to the \pkg{inputenc} package, for example: \begin{verbatim} \usepackage[latin1]{inputenc} @@ -95,10 +103,10 @@ memory, which is a 2.7\% reduction. We are currently experimenting with other ways of reducing the size of \LaTeX. For example, we are experimenting with an option to remove -the \texttt{picture} and \texttt{tabbing} environments from the +the \env{picture} and \env{tabbing} environments from the \LaTeX{} kernel, and to load them from a file the first time they are used. This should help \LaTeX{} to run on machines with limited -memory. See \texttt{autoload.txt} for details. +memory. See \file{autoload.txt} for details. \section{Distribution and modification} @@ -110,7 +118,7 @@ systems. The modification conditions are currently under discussion, and we would like to hear from anyone interested. Please read -\texttt{modguide.tex} for more information. +\file{modguide.tex} for more information. \section{AMS-\LaTeX\ full release} @@ -118,7 +126,7 @@ The AMS-\LaTeX\ packages were still in beta test in the December 1994 release of \LaTeX, and the full release came out in January 1995. AMS-\LaTeX\ is described in the \emph{User's Guide} -(\texttt{amsldoc.tex}) and in \emph{The \LaTeX{} Companion}. +(\file{amsldoc.tex}) and in \emph{The \LaTeX{} Companion}. \section{PostScript fonts} diff --git a/macros/latex/base/ltnews04.pdf b/macros/latex/base/ltnews04.pdf Binary files differindex bc27da8056..f0bd296e1c 100644 --- a/macros/latex/base/ltnews04.pdf +++ b/macros/latex/base/ltnews04.pdf diff --git a/macros/latex/base/ltnews04.tex b/macros/latex/base/ltnews04.tex index cbcf151f12..0a313664ba 100644 --- a/macros/latex/base/ltnews04.tex +++ b/macros/latex/base/ltnews04.tex @@ -39,6 +39,12 @@ \publicationyear{1995} \publicationissue{4} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -56,7 +62,7 @@ This issue accompanies the fourth release of \LaTeXe. The last release in June started a trend of \LaTeX\ becoming smaller, we are pleased to announce that this has continued with this release. In particular the experimental `autoload' version described in -\texttt{autoload.txt} is much smaller as more parts of \LaTeX\ are +\file{autoload.txt} is much smaller as more parts of \LaTeX\ are autoloaded. \section{New `concurrent' docstrip} @@ -80,7 +86,7 @@ This release of the dc fonts fixes many bugs (including the missing many other ways. It is strongly recommended that you upgrade as soon as possible if currently you are using the old dc fonts, release 1.1 or earlier. The new fonts are available from the CTAN archives, in -\texttt{tex-archive/fonts/dc}. +\file{tex-archive/fonts/dc}. The names of the font files are \emph{different}. This does not affect \LaTeX\ documents but \emph{does} affect the installation procedure as @@ -89,7 +95,7 @@ it assumes that you have the \emph{new} fonts, and will write suitable then, after unpacking the distribution, you \emph{must} \verb|latex olddc.ins| to produce `fd' files for the old dc fonts. This must be done \emph{before} the format is made. Running the test -document at \texttt{ltxcheck.tex} the end of the installation will +document at \file{ltxcheck.tex} the end of the installation will inform you if the wrong set of `fd' files has been installed. Note that this change does not affect the standard `OT1' Computer @@ -113,21 +119,21 @@ where you want the `base' class to be called with \emph{all} the options that were specified to the extension class. This is now provided by the new command \verb|\LoadClassWithOptions|. A similar command \verb|\RequirePackageWithOptions| is provided for package use. -More details of this feature are provided in \texttt{clsguide.tex} and -\texttt{ltclass.dtx}. +More details of this feature are provided in \file{clsguide.tex} and +\file{ltclass.dtx}. \section{More Input Encodings} -The experimental \texttt{inputenc} package allows a more natural style +The experimental \pkg{inputenc} package allows a more natural style of input of accented and other characters. Three new input encodings are now supported. \begin{itemize} -\item \texttt{ansinew} the Windows ansi encoding, +\item \option{ansinew} the Windows ansi encoding, as used in Microsoft Windows 3.x. -\item \texttt{cp437de} a variant of \texttt{cp437}, which uses \ss\ +\item \option{cp437de} a variant of \option{cp437}, which uses \ss\ rather than $\beta$ in the appropriate slot. -\item \texttt{next} the encoding used on Next computers. +\item \option{next} the encoding used on Next computers. \end{itemize} \section{Further information} diff --git a/macros/latex/base/ltnews05.pdf b/macros/latex/base/ltnews05.pdf Binary files differindex 5b64c085d3..7e8abef943 100644 --- a/macros/latex/base/ltnews05.pdf +++ b/macros/latex/base/ltnews05.pdf diff --git a/macros/latex/base/ltnews05.tex b/macros/latex/base/ltnews05.tex index f8d611808b..840f04fe72 100644 --- a/macros/latex/base/ltnews05.tex +++ b/macros/latex/base/ltnews05.tex @@ -40,6 +40,10 @@ \publicationyear{1996} \publicationissue{5} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} + \begin{document} \maketitle @@ -51,7 +55,7 @@ new standard \LaTeX{}, \LaTeXe. \section{Extra possibilities for section headings} Most \LaTeX\ sectioning commands are defined using \verb|\@startsection|. -For example, the \textsf{article} class defines: +For example, the \cls{article} class defines: \begin{small} \begin{verbatim} \newcommand\section{\@startsection @@ -75,13 +79,13 @@ produce uppercase headings. A package or class file could contain: \end{verbatim} \end{small} to produce section headings using uppercase medium weight text, rather -than the bold text used by \textsf{article}. Note that, like the font +than the bold text used by \cls{article}. Note that, like the font choice, the uppercasing applies only to the actual heading (including any automatically generated section number), not to the text as it may appear in the running head or table of contents. \section{The `openany' option in the `book' class} -The \textsf{openany} option allows chapter and similar openings to +The \option{openany} option allows chapter and similar openings to occur on left hand pages. Previously this option only affected \verb|\chapter| and \verb|\backmatter|. It now also affects \verb|\part|, \verb|\frontmatter| and \verb|\mainmatter|. @@ -89,7 +93,7 @@ occur on left hand pages. Previously this option only affected \section{More font (output) encodings} The font encoding name \texttt{T3} has been allocated to the encoding used in the new 256-character \textsc{IPA} fonts (for the phonetic -alphabet) produced by Rei Fukui. His package, \textsf{tipa}, +alphabet) produced by Rei Fukui. His package, \pkg{tipa}, gives access to these fonts and should soon be available. (The encoding named \texttt{OT3} is the 128-character encoding used in the \textsc{IPA} fonts produced by Washington State University.) @@ -97,11 +101,11 @@ encoding named \texttt{OT3} is the 128-character encoding used in the \section{More input encodings supported} -The \textsf{inputenc} package now supports the IBM codepage~852 used +The \pkg{inputenc} package now supports the IBM codepage~852 used in Eastern Europe, with the option~\texttt{[cp852]} contributed by Petr~Sojka. -Also, the \textsf{inputenc} package now activates most `control codes' +Also, the \pkg{inputenc} package now activates most `control codes' with \textsc{ascii} values below 32. Currently none of the encodings in the standard distribution makes use of these positions. @@ -135,7 +139,7 @@ following problems: \begin{itemize} \item - The \textsf{longtable} package now uses a modified algorithm, + The \pkg{longtable} package now uses a modified algorithm, contributed by David Kastrup, to align the `chunks' of a table. It is now unnecessary to edit the document to add \verb|\setlongtables| before the final run of \LaTeX. @@ -144,7 +148,7 @@ following problems: price of extra passes through \LaTeX). \item - The \textsf{dcolumn} package now has the extra possibility of + The \pkg{dcolumn} package now has the extra possibility of specifying the number of digits both \emph{before} and after the `decimal point'. This makes it easy to centre the column of numbers under a wide heading. diff --git a/macros/latex/base/ltnews06.pdf b/macros/latex/base/ltnews06.pdf Binary files differindex 340fa5f7d3..002d2d090e 100644 --- a/macros/latex/base/ltnews06.pdf +++ b/macros/latex/base/ltnews06.pdf diff --git a/macros/latex/base/ltnews06.tex b/macros/latex/base/ltnews06.tex index d0c5943b5e..52ecba9918 100644 --- a/macros/latex/base/ltnews06.tex +++ b/macros/latex/base/ltnews06.tex @@ -40,6 +40,12 @@ \publicationyear{1996} \publicationissue{6} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -50,12 +56,12 @@ new standard \LaTeX{}, \LaTeXe. \section{Mono-case file names} Previously \LaTeX\ has used some files with `mixed-case' file names -such as \texttt{T1cmr.fd} and \texttt{T1enc.def}. +such as \file{T1cmr.fd} and \file{T1enc.def}. These file names cause problems on some systems (in particular they are illegal on the ISO 9660 CDROM format) and so in this release all file names have been made lowercase (for example -\texttt{t1cmr.fd} and \texttt{t1enc.def}). +\file{t1cmr.fd} and \file{t1enc.def}). This change should \emph{not} affect any document. Within \LaTeX, encodings still have the usual uppercase names in uses such as @@ -68,17 +74,17 @@ should still work with this new release. The change \emph{does} affect the configuration files that may be used to make the \LaTeX\ format with initex. For example, the file -\texttt{fonttext.ltx} previously specified \verb|\input{T1cmr.fd}|. +\file{fonttext.ltx} previously specified \verb|\input{T1cmr.fd}|. It now has \verb|\input{t1cmr.fd}|. -If you use a local file \texttt{fonttext.cfg} +If you use a local file \file{fonttext.cfg} you will need to make similar changes, as \verb|\input{T1cmr.fd}| -will not work as \texttt{T1cmr.fd} is no longer in the distribution. +will not work as \file{T1cmr.fd} is no longer in the distribution. The files affected by this change all have names of the form \verb|*.fd| or \verb|*enc.def|. \section{Another input encoding} -Thanks to work by S\o ren Sandmann, the \textsf{inputenc} package now +Thanks to work by S\o ren Sandmann, the \pkg{inputenc} package now supports the IBM codepage~865 used in Scandinavia. \section{Better user-defined math display environments} @@ -109,15 +115,15 @@ you can use to avoid this problem; it should be inserted as shown here: \end{verbatim} \section{Docstrip improvements} -The \textsf{docstrip} program that is used to unpack the \LaTeX\ +The \pkg{docstrip} program that is used to unpack the \LaTeX\ sources has undergone further development. The new version should be able to process all old `batchfiles' but it allows a simpler syntax in new `batchfiles' (no need to define \verb|\def\batchfile{|\ldots). It also allows `target' directories to be specified when writing files. This directory support is disabled by default unless activated -in a local \texttt{docstrip.cfg} configuration file. -See \texttt{docstrip.dtx} for details. +in a local \file{docstrip.cfg} configuration file. +See \file{docstrip.dtx} for details. \section{AMS \LaTeX\ update} Since the last \LaTeX\ release in June, the American Mathematical @@ -137,11 +143,11 @@ This release of \LaTeX\ does \emph{not} default to these `ec' fonts as its T1 encoded fonts. By default it will use the `dc' fonts if the T1 encoding is requested. -As noted in \texttt{install.txt} you may run \TeX\ on the install file -\texttt{ec.ins} \emph{after} unpacking the base distribution but +As noted in \file{install.txt} you may run \TeX\ on the install file +\file{ec.ins} \emph{after} unpacking the base distribution but \emph{before} making the \LaTeX\ format. This will produce suitable `fd' files making \LaTeX\ (including, for the first time, the -\textsf{slides} class) use the `ec' fonts as the default T1 encoded +\cls{slides} class) use the `ec' fonts as the default T1 encoded font set. diff --git a/macros/latex/base/ltnews07.pdf b/macros/latex/base/ltnews07.pdf Binary files differindex ea90d97248..30fbfe756a 100644 --- a/macros/latex/base/ltnews07.pdf +++ b/macros/latex/base/ltnews07.pdf diff --git a/macros/latex/base/ltnews07.tex b/macros/latex/base/ltnews07.tex index 53b8b778f4..db3812e387 100644 --- a/macros/latex/base/ltnews07.tex +++ b/macros/latex/base/ltnews07.tex @@ -40,6 +40,12 @@ \publicationyear{1997} \publicationissue{7} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -48,30 +54,30 @@ As in the last release the base \LaTeX\ distribution contains three different sets of `fd' files for T1 encoded fonts. -In this release the default installation uses \texttt{ec.ins} +In this release the default installation uses \file{ec.ins} and so installs files suitable for the current `EC fonts' distribution. If you have still not updated to the EC fonts and are using the earlier test versions, known as DC then you should -unpack \texttt{newdc.ins} (for DC release 1.2 or later) or -\texttt{olddc.ins} (for the original releases of the DC fonts). -This should be done after unpacking \texttt{unpack.ins} but -before making the format by running ini\TeX{} on \texttt{latex.ltx}. -There are further details in \texttt{install.txt}. +unpack \file{newdc.ins} (for DC release 1.2 or later) or +\file{olddc.ins} (for the original releases of the DC fonts). +This should be done after unpacking \file{unpack.ins} but +before making the format by running ini\TeX{} on \file{latex.ltx}. +There are further details in \file{install.txt}. \section{T1 encoded Concrete fonts} The Metafont sources for T1 encoded `Concrete' fonts have been removed from the \textsf{mfnss} distribution as they were based on the now obsolete DC fonts release 1.1. Similarly the -\textsf{cmextra.ins} install file in the \textsf{base} distribution no +\file{cmextra.ins} install file in the \textsf{base} distribution no longer generates fd files for the `Concrete' fonts. To use these fonts in either T1 or OT1 encoding it is -recommended that you obtain Walter Schmidt's \textsf{ccfonts} package -and fonts from CTAN \texttt{macros/latex/contrib/supported/ccfonts}. +recommended that you obtain Walter Schmidt's \pkg{ccfonts} package +and fonts from CTAN \file{macros/latex/contrib/supported/ccfonts}. \section{Further input encodings} -Two more \textsf{inputenc} packages have been added: for latin5, +Two more \pkg{inputenc} packages have been added: for latin5, thanks to H. Turgut Uyar; and for latin3, thanks to J\"org Knappen. @@ -83,18 +89,18 @@ reported by Donald Arseneau, that punctuation in page headers has always (in all known \TeX\ formats) been potentially incorrect if the page break happens while a local setting of the space codes (for instance by the command \verb|\frenchspacing|) is in effect. A common -example of this happening in \LaTeX\ is in the \textsf{verbatim} +example of this happening in \LaTeX\ is in the \env{verbatim} environment. \section{Accessing Bold Math Symbols} -The \textsf{tools} distribution contains a new package, \textsf{bm}, +The \textsf{tools} distribution contains a new package, \pkg{bm}, which defines a command \verb|\bm| that allows individual bold symbols to be accessed within a math expression (in contrast to \verb|\boldmath| which makes whole math expressions default to bold -fonts). It is more general than the existing \textsf{amsbsy} package; +fonts). It is more general than the existing \pkg{amsbsy} package; however, to ease the translation of documents between these two -packages, \textsf{bm} makes \verb|\boldsymbol| an alias for +packages, \pkg{bm} makes \verb|\boldsymbol| an alias for \verb|\bm|. This package was previously made available from the `contrib' area of diff --git a/macros/latex/base/ltnews08.pdf b/macros/latex/base/ltnews08.pdf Binary files differindex 887378c785..6c52a398bf 100644 --- a/macros/latex/base/ltnews08.pdf +++ b/macros/latex/base/ltnews08.pdf diff --git a/macros/latex/base/ltnews08.tex b/macros/latex/base/ltnews08.tex index 5ea811267d..d79a1b1b74 100644 --- a/macros/latex/base/ltnews08.tex +++ b/macros/latex/base/ltnews08.tex @@ -40,13 +40,19 @@ \publicationyear{1997} \publicationissue{8} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle \section{New supported font encodings} -Two new font encodings are supported as options to the \textsf{fontenc} +Two new font encodings are supported as options to the \pkg{fontenc} package: \begin{description} \item [OT4] @@ -59,7 +65,7 @@ supported by the `tc' fonts, which match the T1 encoded `ec' text fonts. A subset of the glyphs in this encoding is supported by virtual fonts distributed with the PostScript font metrics on the \textsc{ctan} archives. (This is the `8c' encoding in Karl Berry's -fontname scheme.) The \textsf{textcomp} package provides access to +fontname scheme.) The \pkg{textcomp} package provides access to this encoding but here is a warning to current users of that package: some of the internal names for the characters have changed. \end{description} @@ -67,17 +73,17 @@ some of the internal names for the characters have changed. \section{New input encodings} -These additions to the \textsf{inputenc} package are -\texttt{decmulti} (the DEC Multinational +These additions to the \pkg{inputenc} package are +\option{decmulti} (the DEC Multinational Character Set, contributed by M.~Y.~Chartoire) -and \texttt{cp1250} (an MS-Windows encoding for Central and Eastern +and \option{cp1250} (an MS-Windows encoding for Central and Eastern Europe, contributed by Marcin Woli\'nski). There is also a -\texttt{cp1252} encoding that is identical to \texttt{ansinew}. +\option{cp1252} encoding that is identical to \option{ansinew}. \section{Tools} -The \textsf{calc} package (used in many examples in \emph{The \LaTeX\ +The \pkg{calc} package (used in many examples in \emph{The \LaTeX\ Companion}) has been contributed to this distribution by Kresten Krab Thorup and Frank Jensen. This is essentially the same as the version that has been available from the \textsc{ctan} archives for some time, @@ -91,10 +97,10 @@ example: \end{verbatim} There have also been some improvements to several other packages in -this collection. In particular, \textsf{bm} now works correctly with +this collection. In particular, \pkg{bm} now works correctly with constructions such as \verb|\bm{f'}| involving \texttt{'} or other characters which use \TeX's special ``\verb|\mathcode"8000|'' -feature. Also, \textsf{multicol} sets the length \verb|\columnwidth| +feature. Also, \pkg{multicol} sets the length \verb|\columnwidth| to an appropriate value; this enables it to work with classes that support two-column setting, e.g.,~the AMS classes. @@ -105,10 +111,10 @@ The special \verb|oztex.def| driver file has been removed, and Oz\TeX\ support has been merged with dvips, following advice from Andrew Trevorrow about Oz\TeX~3.x. -The \textsf{keyval} package has had some internal improvements: to +The \pkg{keyval} package has had some internal improvements: to use \LaTeX\ format error messages; and to avoid `\verb|#| doubling'. This latter change means that the \verb|command| key for the -\textsf{graphicx} version of \verb|\includegraphics| should now be used +\pkg{graphicx} version of \verb|\includegraphics| should now be used with one \verb|#| rather than two. For example, \verb|command = `gunzip #1|. Fortunately this key is almost never used in practice, so few if any documents should be affected by this change. @@ -129,7 +135,7 @@ this CTAN directory: The documentation of this material is as follows: individual package files provide outline, draft documentation; there is an article that gives an overview of the syntax and related concepts; there is a -\texttt{readme.txt} file containing a brief description of the +\file{readme.txt} file containing a brief description of the collection. All aspects of these packages are liable, indeed likely, to change. @@ -146,8 +152,5 @@ the following one line message: subscribe LATEX-L <<first-name>> <<second-name>> \end{verbatim} -% Revert to this if gets too full. -% See \texttt{modguide.tex} for -% information on how to subscribe to \texttt{LaTeX-L}. \end{document} diff --git a/macros/latex/base/ltnews09.pdf b/macros/latex/base/ltnews09.pdf Binary files differindex 33f021b62a..779c3b7a3b 100644 --- a/macros/latex/base/ltnews09.pdf +++ b/macros/latex/base/ltnews09.pdf diff --git a/macros/latex/base/ltnews09.tex b/macros/latex/base/ltnews09.tex index 0d959d9f92..2d56515ca0 100644 --- a/macros/latex/base/ltnews09.tex +++ b/macros/latex/base/ltnews09.tex @@ -40,6 +40,12 @@ \publicationyear{1998} \publicationissue{9} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -93,19 +99,19 @@ The old five-argument form is detected and will work as before. \section{Tools distribution} -The \texttt{multicol} package now supports the production of multiple +The \pkg{multicol} package now supports the production of multiple columns without balancing the last page. To get this effect use the -\texttt{multicols*} environment. +\env{multicols*} environment. -The \texttt{layout} package was partly recoded by Hideo Umeki to +The \pkg{layout} package was partly recoded by Hideo Umeki to display page layout effects in a better way. -As suggested by Donald Arseneau, the \texttt{calc} package was extended +As suggested by Donald Arseneau, the \pkg{calc} package was extended to support the new commands \verb|\widthof{<text>}|, \verb|\heightof{<text>}|, and \verb|\depthof{<text>}| within a -\texttt{calc}-expression. At the same time we modified a few kernel -commands so that \texttt{calc}-expressions can now be used in various -useful places such as the dimension arguments to the \texttt{tabular} +\pkg{calc}-expression. At the same time we modified a few kernel +commands so that \pkg{calc}-expressions can now be used in various +useful places such as the dimension arguments to the \env{tabular} environment and the \verb|\rule| command. For many other standard \LaTeX{} commands this was already possible. @@ -118,10 +124,10 @@ characters will soon be available. Test versions of the `LH' fonts for these Cyrillic encodings, based on the Computer Modern design, are available from CTAN archives in the -directory \texttt{fonts/cyrillic/lh-test}. The \LaTeX\ support files +directory \file{fonts/cyrillic/lh-test}. The \LaTeX\ support files (by Werner Lemberg and Vladimir Volovich) are also available from CTAN archives in\\ - \texttt{macros/latex/contrib/supported/t2} + \file{macros/latex/contrib/supported/t2} \section{Default docstrip header} @@ -135,7 +141,7 @@ We have changed the default version of this header so that it allows stripped files to be distributed in ready-to-run installations such as the \TeX{}Live CD\@. If you use the default header for distributing your files you should check that the new copyright text is acceptable -to you. The file \texttt{docstrip.dtx} explains how to produce your own +to you. The file \file{docstrip.dtx} explains how to produce your own header if you wish to do so. diff --git a/macros/latex/base/ltnews10.pdf b/macros/latex/base/ltnews10.pdf Binary files differindex d0dd192f03..514d1154bb 100644 --- a/macros/latex/base/ltnews10.pdf +++ b/macros/latex/base/ltnews10.pdf diff --git a/macros/latex/base/ltnews10.tex b/macros/latex/base/ltnews10.tex index bad9fda6ce..5ab159f0bb 100644 --- a/macros/latex/base/ltnews10.tex +++ b/macros/latex/base/ltnews10.tex @@ -40,6 +40,12 @@ \publicationyear{1998} \publicationissue{10} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -77,21 +83,21 @@ existence of \LaTeXe{} is a great miracle}. need not supply them). As a first small step towards this definition, we shall replace the - \texttt{latex/packages} subdirectory on \ctan{}. + \file{latex/packages} subdirectory on \ctan{}. This directory was a curious mixture of the important, such as the - \LaTeX{} \texttt{tools}, that any self-respecting \LaTeX{} + \LaTeX{} \textsf{tools}, that any self-respecting \LaTeX{} installation ought to have, and the esoteric or experimental. - The esoterica from \texttt{packages} will be moved to + The esoterica from \textsf{packages} will be moved to new locations, as follows: \begin{quote} - \texttt{expl3} to \texttt{latex/exptl/project}\\ - \texttt{mfnfss} to \texttt{latex/contrib/supported/mfnfss} + \textsf{expl3} to \file{latex/exptl/project}\\ + \textsf{mfnfss} to \file{latex/contrib/supported/mfnfss} \end{quote} - The subdirectory that replaces \texttt{packages} will be called - \texttt{latex/required}; all the other sub-directories of - \texttt{packages} will be moved there. + The subdirectory that replaces \textsf{packages} will be called + \file{latex/required}; all the other sub-directories of + \file{packages} will be moved there. \vspace{17pt} \pagebreak @@ -107,14 +113,14 @@ The web site is not yet fully functional but the old \LaTeX\ pages from Several people have requested an easy mechanism for the distribution of \LaTeX\ packages and other software ``under the same conditions as -\LaTeX''. The old \texttt{legal.txt} file was unsuitable as a general +\LaTeX''. The old \file{legal.txt} file was unsuitable as a general licence as it referred to specific \LaTeX\ authors, and to specific files. -Therefore, in this release \texttt{legal.txt} contains just the +Therefore, in this release \file{legal.txt} contains just the copyright notice and a reference to the new \emph{\LaTeX\ Project Public License} (LPPL) for the distribution and modification -conditions. The \texttt{tools}, \texttt{graphics}, and \texttt{mfnfss} +conditions. The \textsf{tools}, \textsf{graphics}, and \textsf{mfnfss} packages also now refer to this license in their distribution notices. \section{Support for Cyrillic encodings} @@ -130,11 +136,11 @@ encodings). This provides platform independent and sophisticated basic support for high-quality typesetting in various Cyrillic-based languages. -For further information see the file \texttt{cyrguide.tex}. +For further information see the file \file{cyrguide.tex}. \section{Tools distribution} -The \texttt{varioref} package has been extended to support textual +The \pkg{varioref} package has been extended to support textual page references to a range of objects: e.g.,~if \texttt{eq-first} and \texttt{eq-last} are the label names for the first and last equation in a sequence, then you can now write diff --git a/macros/latex/base/ltnews11.pdf b/macros/latex/base/ltnews11.pdf Binary files differindex 168dbd83c1..ffcb0c8041 100644 --- a/macros/latex/base/ltnews11.pdf +++ b/macros/latex/base/ltnews11.pdf diff --git a/macros/latex/base/ltnews12.pdf b/macros/latex/base/ltnews12.pdf Binary files differindex 48e85a5314..dfcfefd66e 100644 --- a/macros/latex/base/ltnews12.pdf +++ b/macros/latex/base/ltnews12.pdf diff --git a/macros/latex/base/ltnews12.tex b/macros/latex/base/ltnews12.tex index 7e3a73f508..62b08324b7 100644 --- a/macros/latex/base/ltnews12.tex +++ b/macros/latex/base/ltnews12.tex @@ -42,6 +42,12 @@ \providecommand{\acro}[1]{\textsc{\MakeLowercase{#1}}} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -100,9 +106,9 @@ the following parts can be downloaded. documentation. \item[template] Prototype implementation of the template interface - (needs parts of \texttt{xparse}). + (needs parts of \pkg{xparse}). - The file \texttt{template.dtx} in that directory has a large section + The file \file{template.dtx} in that directory has a large section of documentation at the front describing the commands in the interface and giving a `worked example' building up some templates for caption formatting. @@ -112,7 +118,7 @@ the following parts can be downloaded. \texttt{latex-l} list. \item[xfootnote] Working examples for generating footnotes, - etc. Needs \texttt{xparse} and \texttt{template}. + etc. Needs \pkg{xparse} and \pkg{template}. \end{description} All examples are organised in subdirectories and additionally diff --git a/macros/latex/base/ltnews13.pdf b/macros/latex/base/ltnews13.pdf Binary files differindex 876ad2db11..de86cd85d7 100644 --- a/macros/latex/base/ltnews13.pdf +++ b/macros/latex/base/ltnews13.pdf diff --git a/macros/latex/base/ltnews13.tex b/macros/latex/base/ltnews13.tex index 185a080e2b..08acf95df6 100644 --- a/macros/latex/base/ltnews13.tex +++ b/macros/latex/base/ltnews13.tex @@ -40,6 +40,11 @@ \publicationyear{2000} \publicationissue{13} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} \begin{document} @@ -78,7 +83,7 @@ to release patches as needed to fix significant bugs. \noindent The \PSNFSS{} material, which supports the use\latex{\\} of common PostScript fonts with \LaTeX{}, has been thoroughly updated. -Most noticeably, the \package{mathpple} package, which used to be +Most noticeably, the \pkg{mathpple} package, which used to be distributed separately, is now part of the basic \PSNFSS{} bundle; this package provides mathematical typesetting with the Palatino typeface family. In addition, numerous bugs and flaws have been fixed @@ -130,9 +135,9 @@ The files \file{diffs-m.txt}, \file{diffs-c.txt}, changes and address some common questions. The primary documentation files remain \file{amsldoc.tex}, for the -\package{amsmath} package, and \file{instr-l.tex}, for the AMS +\pkg{amsmath} package, and \file{instr-l.tex}, for the AMS document classes.\latex{\\} -The documentation for the \package{amsthm} package,\latex{\\} +The documentation for the \pkg{amsthm} package,\latex{\\} however, has been moved from \file{amsldoc.tex}\latex{\\} to a separate document \file{amsthdoc.tex}. @@ -140,10 +145,10 @@ to a separate document \file{amsthdoc.tex}. \vfill \end{latexonly} -\section{New input encoding \package{latin4}} +\section{New input encoding \texttt{latin4}} -The package \package{inputenc} has, thanks to Hana Skoumalov\'a, -been extended to cover the \package{latin4} input encoding; this +The package \pkg{inputenc} has, thanks to Hana Skoumalov\'a, +been extended to cover the \option{latin4} input encoding; this covers Baltic and Scandinavian languages as well as Greenland Inuit and Lappish. @@ -187,11 +192,11 @@ This directory has been extended to contain \item[galley] Prototype implementation of the interface\latex{\\} for manipulating vertical material in galleys. \item[xinitials] Prototype implementation of the interface\latex{\\} - for paragraph initials (needs the \texttt{galley} package. - \item[xtheorem] Contributed example using the \texttt{template} + for paragraph initials (needs the \pkg{galley} package. + \item[xtheorem] Contributed example using the \pkg{template} package to provide a designer interface for theorem environments. \item[xoutput] A prototype implementation of the new output routine - as described in the \texttt{xo-pfloat.pdf} paper. Expected + as described in the \file{xo-pfloat.pdf} paper. Expected availability: at or shortly after\latex{\\} the TUG\,2000 conference. \end{description} diff --git a/macros/latex/base/ltnews14.pdf b/macros/latex/base/ltnews14.pdf Binary files differindex d33d6974ed..f86e819046 100644 --- a/macros/latex/base/ltnews14.pdf +++ b/macros/latex/base/ltnews14.pdf diff --git a/macros/latex/base/ltnews14.tex b/macros/latex/base/ltnews14.tex index 836591019e..61c96c81ae 100644 --- a/macros/latex/base/ltnews14.tex +++ b/macros/latex/base/ltnews14.tex @@ -40,6 +40,11 @@ \publicationyear{2001} \publicationissue{14} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} \begin{document} @@ -69,14 +74,14 @@ available. You can read about its new features in One of the bugs that got fixed in this release deals with how labels are handled by \LaTeX{}. Because this part of the kernel is modified -by \textsf{babel}, the relevant changes need to be coordinated. -Therefore to use \textsf{Babel} with this release of \LaTeX{} you will -need to update your version of \textsf{babel} to at least 3.7. +by \pkg{babel}, the relevant changes need to be coordinated. +Therefore to use \pkg{Babel} with this release of \LaTeX{} you will +need to update your version of \pkg{babel} to at least 3.7. -\section{New input encoding \package{latin9}} +\section{New input encoding \option{latin9}} -The package \package{inputenc} has, thanks to Karsten Tinnefeld, been -extended to cover the \package{latin9} input encoding. The +The package \pkg{inputenc} has, thanks to Karsten Tinnefeld, been +extended to cover the \option{latin9} input encoding. The ISO-Latin~9 encoding is a useful modern replacement for ISO-Latin~1 that contains a few characters needed for French and Finnish. Of wider interest, it also contains the euro currency sign; this could be the @@ -87,11 +92,11 @@ Breton, Catalan, Danish, Dutch, English, Estonian, Faroese, Finnish, French, Frisian, Galician, German, Greenlandic, Icelandic, Irish Gaelic, Italian, Latin, Luxembourgish, Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish and Swedish.\\ -The characters added in \package{latin9} are (in \LaTeX{} notation):\\ +The characters added in \option{latin9} are (in \LaTeX{} notation):\\ \begin{small} \verb| \texteuro \v S \v s \v Z \v z \OE \oe \" Y | \end{small}\\ -They displace the following characters from \package{latin1}:\\ +They displace the following characters from \option{latin1}:\\ \begin{small} \verb| \textcurrency \textbrokenbar \"{} \'{} \c{} |\\ \verb| \textonequarter \textonehalf \textthreequarters | @@ -100,7 +105,7 @@ They displace the following characters from \package{latin1}:\\ \section{New tools} -The new package \package{trace} provides many commands to control +The new package \pkg{trace} provides many commands to control \LaTeX{}'s tracing and debugging output, including the excellent new information available with \eTeX{} such as the extremely useful tracing of local assignments. You will find it in the tools @@ -112,7 +117,7 @@ loading by NFSS (which can go on for pages if you are unlucky). It also offers \verb|\traceoff| to \ldots\ guess what! Full details are in the documented source file, \file{trace.dtx}. -In the base \package{ifthen} package we have added +In the base \pkg{ifthen} package we have added the uppercase synonyms \verb|\NOT| \verb|\AND| and \verb|\OR|. \section{New experimental code} @@ -157,11 +162,11 @@ This directory has been extended to contain the following. \item[galley] Prototype implementation of the interface\latex{\\} for manipulating vertical material in galleys. \item[xinitials] Prototype implementation of the interface\latex{\\} - for paragraph initials (needs the \texttt{galley} package). - \item[xtheorem] Contributed example using the \texttt{template} + for paragraph initials (needs the \pkg{galley} package). + \item[xtheorem] Contributed example using the \pkg{template} package to provide a designer interface for theorem environments. \item[xor] A prototype implementation of the new output routine - as described in the \texttt{xo-pfloat.pdf} paper. + as described in the \file{xo-pfloat.pdf} paper. \item[xfrontm] A prototype version of the new font matter interface. \end{description} diff --git a/macros/latex/base/ltnews15.pdf b/macros/latex/base/ltnews15.pdf Binary files differindex 4a42a39201..089373e062 100644 --- a/macros/latex/base/ltnews15.pdf +++ b/macros/latex/base/ltnews15.pdf diff --git a/macros/latex/base/ltnews15.tex b/macros/latex/base/ltnews15.tex index 4532111d98..e143d5f4dd 100644 --- a/macros/latex/base/ltnews15.tex +++ b/macros/latex/base/ltnews15.tex @@ -40,6 +40,12 @@ \publicationyear{2003} \publicationissue{15} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -87,14 +93,14 @@ The English has been corrected in \verb|\reftextbefore| (an incompatible change). There are other extensions such as \verb|\labelformat|, \verb|\Ref|, \verb|\Vref| and \verb|\vpagerefnum|. Some Dutch text has also been changed and two\newline -new options added: \package{slovak} and \package{slovene}. +new options added: \option{slovak} and \option{slovene}. \section{New and more robust commands} Many of the math mode commands for compound symbols have been made robust and a new robust command has been added: \verb|\nobreakdashes|. -This last is a low-level command, borrowed from the \package{amsmath} +This last is a low-level command, borrowed from the \pkg{amsmath} package, for use only before hyphens or dashes. It prevents the line break that is normally allowed\newline after the following sequence of dashes. @@ -102,20 +108,20 @@ after the following sequence of dashes. \section{Fixing font sizes} -The new \package{fix-cm} package, by Walter Schmidt, changes the CM font +The new \pkg{fix-cm} package, by Walter Schmidt, changes the CM font definition (\texttt{.fd}) files so that similar design sizes are used in both the \texttt{OT1} and \texttt{T1} encodings. \section{Font encodings} -A number of options have been added to the \package{textcomp} package, +A number of options have been added to the \pkg{textcomp} package, enabling only available glyphs to be used. Also, the `NFSS font families' are now divided into five different groups according to the subset of glyphs each provides from the full collection of symbols in the TS1 encoding. Given sufficient information about a font family -\package{textcomp} will use this in order to limit the\newline +\pkg{textcomp} will use this in order to limit the\newline typesetting to those glyphs that are available. Use of this mechanism has also enhanced \verb|\oldstylenums| @@ -124,7 +130,7 @@ to use the current font if possible. \section{Displaying font tables} -With the \package{nfssfont} package you can now +With the \pkg{nfssfont} package you can now specify the font to display by giving its `NFSS classification', rather than needing to know its external font file's name. It is also now possible to generate large collections of font @@ -133,25 +139,25 @@ tables in batch mode by providing a suitable input file. \section{New input encodings} -The \package{inputenc} package has been extended as follows: -\package{macce} input encoding +The \pkg{inputenc} package has been extended as follows: +\option{macce} input encoding (Apple Central European), -thanks to Radek Tryc and Marcin Wolinski; \package{cp1257}\newline +thanks to Radek Tryc and Marcin Wolinski; \option{cp1257}\newline for Baltic languages; \package{latin10}, thanks to Ionel Ciob\^{i}c\u{a}.\newline The euro symbol has by now been added to several encodings: -\package{ansinew}, \package{cp1250} -and \package{cp1252} (which also\newline -has another addition), whilst \package{cp858} -adds it to \package{cp850}. +\option{ansinew}, \option{cp1250} +and \option{cp1252} (which also\newline +has another addition), whilst \option{cp858} +adds it to \option{cp850}. \section{Unicode input} Partial, experimental support for text files that use the Unicode -encoding form UTF-8 is now provided by the option \package{utf8} for -the \package{inputenc} package. +encoding form UTF-8 is now provided by the option \option{utf8} for +the \pkg{inputenc} package. The only Unicode text file characters supported by the current version are those based on the most common inputs for glyphs from the small diff --git a/macros/latex/base/ltnews16.pdf b/macros/latex/base/ltnews16.pdf Binary files differindex 58f9416051..fadb984674 100644 --- a/macros/latex/base/ltnews16.pdf +++ b/macros/latex/base/ltnews16.pdf diff --git a/macros/latex/base/ltnews16.tex b/macros/latex/base/ltnews16.tex index 8f96ed197f..17f9cd094a 100644 --- a/macros/latex/base/ltnews16.tex +++ b/macros/latex/base/ltnews16.tex @@ -127,7 +127,7 @@ need to debug macros. \section{End of `autoload' support} As computer systems generally grow in capacity, requirements change -and so we believe that the \package{autoload} variant of \LaTeX{} is +and so we believe that the \texttt{autoload} variant of \LaTeX{} is no longer required. Thus, although the code remains it is no longer supported. We hope this does not cause any problems. diff --git a/macros/latex/base/ltnews17.pdf b/macros/latex/base/ltnews17.pdf Binary files differindex d73addf2fe..5d3a4f39b0 100644 --- a/macros/latex/base/ltnews17.pdf +++ b/macros/latex/base/ltnews17.pdf diff --git a/macros/latex/base/ltnews17.tex b/macros/latex/base/ltnews17.tex index f850f8d64c..614c5c7d63 100644 --- a/macros/latex/base/ltnews17.tex +++ b/macros/latex/base/ltnews17.tex @@ -41,6 +41,12 @@ \publicationyear{2005} \publicationissue{17} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -76,7 +82,7 @@ lists all the `encoding specific commands' (the LICR or \LaTeX{} Internal Character Representation) for characters supported by the encodings \texttt{OT1} and \texttt{T1}. -When the file \texttt{encguide.tex} is processed by \LaTeX{}, it will +When the file \file{encguide.tex} is processed by \LaTeX{}, it will attempt to typeset an encoding table for each encoding it describes. For this to be possible, \LaTeX{} must be able to find \texttt{.tfm} files for a representative example font for each encoding. If @@ -100,42 +106,42 @@ the same way as their text-mode counterparts. \section{Updates of required packages} -Several of the packages in the \package{tools} bundle have been updated +Several of the packages in the \textsf{tools} bundle have been updated for this release. -The \package{xspace} package has some new features. One is an +The \pkg{xspace} package has some new features. One is an interface for adding and removing the exceptions it knows about and another is that it works with active characters. These remove problems -of incompatibility with the \package{babel} system. +of incompatibility with the \pkg{babel} system. In \textit{\LaTeX\ News~16} we announced that some packages might begin to take advantage of \eTeX{} extensions on systems where these -are available: and the latest version of \package{xspace} does just -that. Note also that \package{fixltx2e} will make use of the +are available: and the latest version of \pkg{xspace} does just +that. Note also that \pkg{fixltx2e} will make use of the facilities in \eTeX{} whenever these are present (see below). -The \package{calc} package has also been given an update with a few +The \pkg{calc} package has also been given an update with a few extra commands. The commands \verb|\maxof| and \verb|\minof|, each with two brace-delimited arguments, provide the usual numeric $\max$ and $\min$ operations. The commands \verb|\settototalheight| and \verb|\totalheightof| work like \verb|\settoheight| and \verb|\heightof|. There are also some internal improvements to make -\package{calc} work with some more primitive \TeX\ constructs, such as +\pkg{calc} work with some more primitive \TeX\ constructs, such as \verb|\ifcase|. -The \package{varioref} package has acquired a few more default +The \pkg{varioref} package has acquired a few more default strings but there are still a number of languages for which good strings are still missing. -The \package{showkeys} package has also been updated slightly to work -with more recent developments in \package{varioref}. Also, it now +The \pkg{showkeys} package has also been updated slightly to work +with more recent developments in \pkg{varioref}. Also, it now provides an easy way to define the look of the printed labels with the command \verb|\showkeyslabelformat|. \section{Work on \LaTeX{} fixes} -The package known as \package{fixltx2e} has three new additions. A new +The package known as \pkg{fixltx2e} has three new additions. A new command \verb|\textsubscript| has been added as a complement to the command \verb|\textsuperscript| in the kernel. Secondly, a new form of \verb|\DeclareMathSizes| that allows all of its arguments to have a @@ -153,7 +159,7 @@ extensions if available; more specifically, when the \eTeX{} extensions are available, it does not destroy kerning between previous letters and the text to be typeset. The command is also used -internally in \package{fixltx2e} to resolve a problem with +internally in \pkg{fixltx2e} to resolve a problem with \verb|\fnsymbol|. Also, further work has been done on reimplementing @@ -162,14 +168,14 @@ places: we hope it is an improvement! \section{The graphics bundle} -The \package{graphics} bundle now supports the -\package{dvipdfmx} post-processor and Jonathan Kew's XE\TeX\ +The \textsf{graphics} bundle now supports the +\texttt{dvipdfmx} post-processor and Jonathan Kew's XE\TeX\ program. By support we mean that the graphics packages recognize the -new options \texttt{xetex} and \texttt{dvipdfmx} but we do not +new options \option{xetex} and \option{dvipdfmx} but we do not distribute the respective driver files. This leads elegantly to a description of the -new policy concerning such driver files in the \package{graphics} bundle. +new policy concerning such driver files in the \textsf{graphics} bundle. Most driver files for our graphics packages are maintained by the developers of the associated post-processor or \TeX\ programs. The teams developing these packages are working very hard: their rapid @@ -178,7 +184,7 @@ releases. It is therefore no longer practical for the \LaTeX\ Team to be responsible for distributing the latest versions of these driver files. -Therefore the installation files for \package{graphics} have been +Therefore the installation files for \pkg{graphics} have been split: there is now \file{graphics.ins} to install the package files and \file{graphics-drivers.ins} for the driver files (located in \file{drivers.dtx}). @@ -186,8 +192,8 @@ There is no need to install all those provided in the file \file{drivers.dtx}. Please also note that, as requested by the maintainers of -\package{PStricks}, we have removed the package \package{pstcol} as -current versions of \package{PSTricks} make it obsolete. +\textsf{PStricks}, we have removed the package \pkg{pstcol} as +current versions of \textsf{PSTricks} make it obsolete. %% \newpage @@ -197,12 +203,12 @@ current versions of \package{PSTricks} make it obsolete. \section{Future development} The title of this section is a little misleading as it actually -describes \emph{current} development. In 1998 the \package{expl3} +describes \emph{current} development. In 1998 the \textsf{expl3} bundle of packages was put on \ctan\ to demonstrate a possible \LaTeX3 programming environment. These packages have been lying dormant for some time while the \LaTeX\ Project Team were preoccupied by other things -such as developing the experimental packages \package{xor}, -\package{template}, etc., (and also writing that indispensable +such as developing the experimental packages \pkg{xor}, +\pkg{template}, etc., (and also writing that indispensable and encyclopaedic volume,\\ The \LaTeX{} Companion -- 2nd edition). @@ -215,12 +221,12 @@ two areas are central to this work. \item Extending the kernel code of \LaTeX3. \item Converting the experimental packages - such as \package{xor}, \package{template} to use the new + such as \pkg{xor}, \pkg{template} to use the new syntax internally. \end{itemize} Beware! Development of -\package{expl3} is happening so fast that the descriptions above might +\textsf{expl3} is happening so fast that the descriptions above might be out of date when you read this! If you wish to see what's going on then go to \url{http://www.latex-project.org/code.html} where you can download diff --git a/macros/latex/base/ltnews18.pdf b/macros/latex/base/ltnews18.pdf Binary files differindex f3e02f4dc2..ab2692a825 100644 --- a/macros/latex/base/ltnews18.pdf +++ b/macros/latex/base/ltnews18.pdf diff --git a/macros/latex/base/ltnews19.pdf b/macros/latex/base/ltnews19.pdf Binary files differindex f2af095915..f2301fde64 100644 --- a/macros/latex/base/ltnews19.pdf +++ b/macros/latex/base/ltnews19.pdf diff --git a/macros/latex/base/ltnews19.tex b/macros/latex/base/ltnews19.tex index 4d50b98c82..f733c41dd4 100644 --- a/macros/latex/base/ltnews19.tex +++ b/macros/latex/base/ltnews19.tex @@ -54,7 +54,7 @@ Just in time for \TeX\ Live 2009, this version is a maintenance release and introduces no new features. A number of small changes have been made to correct minor bugs in the kernel, slightly extend the Unicode support, and improve various -aspects of some of the \texttt{tools} packages. +aspects of some of the \textsf{tools} packages. \section{New code repository} diff --git a/macros/latex/base/ltnews20.pdf b/macros/latex/base/ltnews20.pdf Binary files differindex 668b674ff2..1705f7046b 100644 --- a/macros/latex/base/ltnews20.pdf +++ b/macros/latex/base/ltnews20.pdf diff --git a/macros/latex/base/ltnews20.tex b/macros/latex/base/ltnews20.tex index 44acd1ec3e..89d166b49c 100644 --- a/macros/latex/base/ltnews20.tex +++ b/macros/latex/base/ltnews20.tex @@ -41,6 +41,12 @@ \publicationissue{20} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -57,15 +63,32 @@ This situation has been rectified this year! \section{Continued development} -The \LaTeXe\ program is no longer being actively developed, as any non-negligible changes now could have dramatic backwards compatibility issues with old documents. Similarly, new features cannot be added to the kernel since any new documents written now would then be incompatible with legacy versions of \LaTeX. - -The situation on the package level is quite different though. While most of us have stopped developing packages for \LaTeXe{} there are many contributing developers that continue to enrich \LaTeXe{} by providing or extending add-on packages with new or better functionality. - -However, the \LaTeX\ team certainly recognises that there are improvements to be made to the kernel code; over the last few years we have been working on building, expanding, and solidifying the \textsf{expl3} programming layer for future \LaTeX\ development. We are using \textsf{expl3} to build new interfaces for package development and tools for document design. Progress here is continuing. +The \LaTeXe\ program is no longer being actively developed, as any +non-negligible changes now could have dramatic backwards compatibility +issues with old documents. Similarly, new features cannot be added to +the kernel since any new documents written now would then be +incompatible with legacy versions of \LaTeX. + +The situation on the package level is quite different though. While +most of us have stopped developing packages for \LaTeXe{} there are +many contributing developers that continue to enrich \LaTeXe{} by +providing or extending add-on packages with new or better +functionality. + +However, the \LaTeX\ team certainly recognises that there are +improvements to be made to the kernel code; over the last few years we +have been working on building, expanding, and solidifying the +\textsf{expl3} programming layer for future \LaTeX\ development. We +are using \textsf{expl3} to build new interfaces for package +development and tools for document design. Progress here is +continuing. \section{Release notes} -In addition to a few small documentation fixes, the following changes have been made to the \LaTeXe\ code; in accordance with the philosophy of minimising forwards and backwards compatibility problems, most of these will not be noticeable to the regular \LaTeX\ user. +In addition to a few small documentation fixes, the following changes +have been made to the \LaTeXe\ code; in accordance with the philosophy +of minimising forwards and backwards compatibility problems, most of +these will not be noticeable to the regular \LaTeX\ user. \paragraph{Font subsets covered by Latin Modern and \TeX\ Gyre} @@ -79,28 +102,32 @@ characters for high-quality multilingual typesetting.% } Information about their symbol coverage in the \verb|TS1| encoding is now included -in \texttt{textcomp}'s default font definitions. +in \pkg{textcomp}'s default font definitions. -% \paragraph{Private conditional switch in italic correction} -% negligible improvement/only useful to LaTeX programmers: not worth documenting I think? - -% \paragraph{Improve formatting in \texttt{doc} for filenames with some punctuation} -% negligible improvement, again? \paragraph{Redefinition of \cs{enddocument}} -Inside the definition of \verb=\end{document}= the \texttt{.aux} file is read back in to resolve cross-references and build the table of contents etc. From 2.09 days this was done using \verb=\input= without any surrounding braces which could lead to some issues in boundary cases, especially if \verb=\input= was redefined by some package. It was therefore changed to use \LaTeXe{}'s internal name for this function. As a result, packages that modify \verb=\enddocument= other than through the officially provided hooks may need to get updated. +Inside the definition of \verb=\end{document}= the \texttt{.aux} file +is read back in to resolve cross-references and build the table of +contents etc. From 2.09 days this was done using \verb=\input= without +any surrounding braces which could lead to some issues in boundary +cases, especially if \verb=\input= was redefined by some package. It +was therefore changed to use \LaTeXe{}'s internal name for this +function. As a result, packages that modify \verb=\enddocument= other +than through the officially provided hooks may need to get updated. -\paragraph{Small improvement with split footnotes in \texttt{ftnright}} +\paragraph{Small improvement with split footnotes in \pkg{ftnright}} -If in the first column there is more than a full column worth of footnote -material the material will be split resulting in footnotes out of -order. This issue is now at least detected and generates an error but the algorithm used by the package is -unable to gracefully handle it in an automated fashion (some alternatives for resolving the problem if it happens are given in the package documentation). +If in the first column there is more than a full column worth of +footnote material the material will be split resulting in footnotes +out of order. This issue is now at least detected and generates an +error but the algorithm used by the package is unable to gracefully +handle it in an automated fashion (some alternatives for resolving the +problem if it happens are given in the package documentation). -\paragraph{Improvement in \texttt{xspace} and font-switching} +\paragraph{Improvement in \file{xspace} and font-switching} -The \texttt{xspace} package provides the command \verb|\xspace| +The \file{xspace} package provides the command \verb|\xspace| which attempts to be clever about inserting spaces automatically after user-defined control sequences. An important bug fix has been made to this command to correct its @@ -116,27 +143,31 @@ would result in an extraneous space being inserted after `foo' in both cases; this has now been corrected. -\paragraph{RTL in \texttt{multicol}} +\paragraph{RTL in \file{multicol}} - The 1.7 release of \texttt{multicol} adds support for languages that are typeset - right-to-left. For those languages the order of the columns on the page - also needs to be reversed---something that wasn't possible in earlier releases. + The 1.7 release of \file{multicol} adds support for languages that + are typeset right-to-left. For those languages the order of the + columns on the page also needs to be reversed---something that wasn't + possible in earlier releases. The new feature is supported through the commands \verb|\RLmulticolcolumns| (switching to right-to-left typesetting) and \verb|\LRmulticolcolumns| (switching to left-to-right typesetting) the latter being the default. -\paragraph{Improve French \texttt{babel} interaction with \texttt{varioref}} - - Extracting and saving the page number turned out to be a source of subtle - bugs. Initially it was done through an \verb"\edef" with a bunch of -\verb"\expandafter" commands inside. This posed a problem if the page number - itself contained code which needed protection (e.g., pr/4080) so this got - changed in the last release to use \verb"\protected@edef". However, that in turn failed with Babel -(bug report/4093) if the label contained active characters, e.g., a ``:'' in French. So now -we use (after one failed attempt pr/4159) even more \verb"\expandafter" commands and \verb"\romannumeral" trickery to avoid any expansion other - than what is absolutely required---making the code in that space absolutely unreadable. +\paragraph{Improve French \file{babel} interaction with \file{varioref}} + + Extracting and saving the page number turned out to be a source of + subtle bugs. Initially it was done through an \verb"\edef" with a + bunch of \verb"\expandafter" commands inside. This posed a problem if + the page number itself contained code which needed protection (e.g., + pr/4080) so this got changed in the last release to use + \verb"\protected@edef". However, that in turn failed with Babel (bug + report/4093) if the label contained active characters, e.g., a ``:'' + in French. So now we use (after one failed attempt pr/4159) even more + \verb"\expandafter" commands and \verb"\romannumeral" trickery to + avoid any expansion other than what is absolutely required---making + the code in that space absolutely unreadable. \begin{verbatim} \expandafter\def\expandafter#1\expandafter{% \romannumeral @@ -148,6 +179,8 @@ we use (after one failed attempt pr/4159) even more \verb"\expandafter" commands \z@ \csname r@#2\endcsname\@nil}% \end{verbatim} -Code like this nicely demonstrates the limitations in the programming layer of \LaTeXe{} and the advantages that \textsf{expl3} will offer on this level. +Code like this nicely demonstrates the limitations in the programming +layer of \LaTeXe{} and the advantages that \textsf{expl3} will offer +on this level. \end{document} diff --git a/macros/latex/base/ltnews21.pdf b/macros/latex/base/ltnews21.pdf Binary files differindex 33c9574e85..fe3c7d4dc1 100644 --- a/macros/latex/base/ltnews21.pdf +++ b/macros/latex/base/ltnews21.pdf diff --git a/macros/latex/base/ltnews21.tex b/macros/latex/base/ltnews21.tex index 14de47c648..7b363447d9 100644 --- a/macros/latex/base/ltnews21.tex +++ b/macros/latex/base/ltnews21.tex @@ -41,6 +41,12 @@ \publicationissue{21} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -73,7 +79,7 @@ at:\\ \url{http://latex-project.org/cgi-bin/ltxbugs2html} \let\paragraph\subsubsection -\paragraph{\textsf{fixltx2e} updates} +\paragraph{\pkg{fixltx2e} updates} @@ -86,7 +92,7 @@ a particular misfeature. Thus changing the kernel code would break too many existing documents. The corrections for these types of bug have therefore been collected together -in a package that can be loaded only when needed; its name is \textsf{fixltx2e}. +in a package that can be loaded only when needed; its name is \pkg{fixltx2e}. For this release we made the following changes to this package: \begin{itemize} \item @@ -97,7 +103,7 @@ For this release we made the following changes to this package: \item \LaTeX's float handling algorithm can get out of sync if you mix single and double-column floats (as they are placed independently - of each other). This was corrected in \textsf{fixltx2e} a few years ago + of each other). This was corrected in \pkg{fixltx2e} a few years ago but the fix was not perfect as one situation using \verb=\enlargethispage= generated a low-level \TeX{} error. This behaviour of the package is now improved. @@ -106,12 +112,12 @@ For this release we made the following changes to this package: -\paragraph{New \textsf{fltrace} package} +\paragraph{New \pkg{fltrace} package} -For years the file \texttt{ltoutput.dtx} contained some hidden code to +For years the file \file{ltoutput.dtx} contained some hidden code to trace the detailed behaviour of the float placement algorithm of \LaTeX. Prompted by questions on StackExchange we now extract this -code into a new \textsf{fltrace} package. To see the float algorithm +code into a new \pkg{fltrace} package. To see the float algorithm in action (or to understand why it decides to place all your floats at the very end of the document) use \begin{verbatim} @@ -122,33 +128,33 @@ To stop tracing somewhere in the document use parameters use \verb=\tracefloatvals=. As the package is identical to the kernel code with tracing added, it may or may not work if you load any other package that manipulates that part of the kernel code. In such a -case your best bet is to load \textsf{fltrace} first. +case your best bet is to load \pkg{fltrace} first. -\paragraph{\textsf{inputenc} package updates} +\paragraph{\pkg{inputenc} package updates} -The \textsf{inputenc} package allows different input encodings for +The \pkg{inputenc} package allows different input encodings for \LaTeX\ documents to be specified including the important -\texttt{utf8} option used to specify the Unicode UTF-8 encoding. A +\option{utf8} option used to specify the Unicode UTF-8 encoding. A common mistake in documents has been to also include this option when using the Unicode-based \TeX\ engines \hologo{LuaTeX} and \hologo{XeTeX} producing strange errors as these engines natively deal with UTF-8 characters. If a document stored in an 8bit encoding is processed by -\hologo{pdfTeX}, it needs the \textsf{inputenc} package to work +\hologo{pdfTeX}, it needs the \pkg{inputenc} package to work correctly. However, if such a document is processed unchanged by \hologo{LuaTeX} or \hologo{XeTeX}, then accented characters may silently get dropped from the output. The package has been modified so that if used with \hologo{LuaTeX} or -\hologo{XeTeX}, then it just issues a warning if \texttt{utf8} or -\texttt{ascii} is specified, and stops with an error for any other +\hologo{XeTeX}, then it just issues a warning if \option{utf8} or +\option{ascii} is specified, and stops with an error for any other encoding requested. One further improvement has been made to the encoding definition files -(\texttt{.def}) used by \textsf{inputenc}: the catcode of \texttt{@} +(\texttt{.def}) used by \pkg{inputenc}: the catcode of \texttt{@} is now saved and restored when reading them instead of always using \verb=\makeatother= inside the files (latex/4192). @@ -163,9 +169,9 @@ started to provide individual \texttt{.ins} files for each of those packages that are likely to require updates outside a major \LaTeX{} release. -\paragraph{\textsf{multicol} updates} +\paragraph{\pkg{multicol} updates} -Version 1.8 of \textsf{multicol} implements some improvements/fixes +Version 1.8 of \pkg{multicol} implements some improvements/fixes and one extension. In the past the balancing algorithm enlarged the column height until it found a solution that satisfied all constraints. If there were insufficient break points then the final @@ -182,43 +188,43 @@ to allow the execution of code depending on the column in which the command is executed. See the documentation for details. Bug fixes: the new version fixes both a color leak that could happen -in certain situations and the problem that \texttt{multicols} could +in certain situations and the problem that \pkg{multicols} could mess up the positioning of \verb=\marginpar=s that followed the environment. -\paragraph{\textsf{tabularx} updates} +\paragraph{\pkg{tabularx} updates} The restrictions on embedding \verb|\tabularx| \verb|\endtabularx| into the definition of a new environment have been relaxed slightly. See the package documentation for details. -\paragraph{\textsf{showkeys} updates} +\paragraph{\pkg{showkeys} updates} -The \textsf{showkeys} package has been updated to fix problems if used +The \pkg{showkeys} package has been updated to fix problems if used at the start of list items, and to work if brace groups (\verb|{| and \verb|}|) are used in the optional argument of \verb|\cite|. (tools/4162, tools/4173) -\paragraph{\textsf{color} updates} +\paragraph{\pkg{color} updates} The \verb|\nopagecolor| command suggested by Heiko Oberdiek, -available for some years in the \textsf{pdftex} option, has been +available for some years in the \option{pdftex} option, has been added to the core package as suggested in graphics/3873. Currently this is supported in the driver files for \textsf{dvips} and \textsf{pdftex}. Patches to support other drivers are welcome. - \paragraph{\textsf{graphicx} updates} + \paragraph{\pkg{graphicx} updates} -The \textsf{graphicx} version of \verb|\rotatebox| now allows +The \pkg{graphicx} version of \verb|\rotatebox| now allows \verb|\par| (and blank lines) in values, to match the change made -to the \textsf{graphics} version some years ago. See graphics/4296. +to the \pkg{graphics} version some years ago. See graphics/4296. -\paragraph{\textsf{keyval} updates} +\paragraph{\pkg{keyval} updates} -All parsing used in the \textsf{keyval} package has been changed +All parsing used in the \pkg{keyval} package has been changed to allow \verb|\par| (and blank lines) in values. (A second change, to parsing of brace groups in a construct such as \texttt{key=\{\{\{value\}\}\}}, was reverted in v1.15.) diff --git a/macros/latex/base/ltnews22.pdf b/macros/latex/base/ltnews22.pdf Binary files differindex e0fab9a95a..4d1f2d5f7c 100644 --- a/macros/latex/base/ltnews22.pdf +++ b/macros/latex/base/ltnews22.pdf diff --git a/macros/latex/base/ltnews22.tex b/macros/latex/base/ltnews22.tex index e73fb4b7c4..7551616154 100644 --- a/macros/latex/base/ltnews22.tex +++ b/macros/latex/base/ltnews22.tex @@ -40,6 +40,12 @@ \publicationissue{22} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -49,29 +55,29 @@ \subsection{Introduction} For some years we have supplied bug fixes to the \LaTeXe\ kernel via the -\textsf{fixltx2e} package. This +\pkg{fixltx2e} package. This kept the kernel stable, but at the expense of meaning that most users did not benefit from bug fixes, and that some compromises which were made to save space in the machines of the time are still affecting most users today. In this release we have started a new update policy. All the fixes previously -available via \textsf{fixltx2e} are now enabled \emph{by default} in the +available via \pkg{fixltx2e} are now enabled \emph{by default} in the format, as are some further extensions for extended \TeX\ engines, \eTeX, \hologo{XeTeX} and \hologo{LuaTeX}. Compatibility and stability are still important considerations, and while most users will not notice these -improvements, or will want to benefit from them, a new \textsf{latexrelease} +improvements, or will want to benefit from them, a new \pkg{latexrelease} package is provided that will revert all the changes and re-instate the definitions from earlier releases. The package can also be used with older releases to effectively \emph{update} the kernel to be equivalent to this 2015 release. -A new document, \textsf{latexchanges}, is distributed with the release +A new document, \file{latexchanges}, is distributed with the release that documents all the changes to documented commands since the 2014 \LaTeX\ release, and will be updated in future releases if further changes have been made. -\subsection{The \textsf{latexrelease} package} +\subsection{The \pkg{latexrelease} package} As noted above a new package is available to manage differences between \LaTeX\ releases. If you wish to revert all changes back to the definitions as they @@ -86,21 +92,21 @@ against possible future changes, you may start your document \RequirePackage[2015/01/01]{latexrelease} \documentclass{article} \end{verbatim} -Then the version of \textsf{latexrelease} distributed with any future \LaTeX\ +Then the version of \pkg{latexrelease} distributed with any future \LaTeX\ release will revert any changes made in that format, and revert to the definitions as they where at the beginning of 2015. If you wish to share a document using the latest features with a user restricted to using an older -format, you may use the form above and make the \textsf{latexrelease} package +format, you may use the form above and make the \pkg{latexrelease} package available on the older installation. The package will then update the format definitions as needed to enable the older format to work as if dated on the date specified in the package option. \subsection{The \cs{IncludeInRelease} command} -The mechanism used in the \textsf{latexrelease} package is available for use in -package code. If in your \textsf{zzz} package you have +The mechanism used in the \pkg{latexrelease} package is available for use in +package code. If in your \pkg{zzz} package you have \begin{verbatim} \RequirePackage{latexrelease} \IncludeInRelease{2015/06/01} @@ -116,7 +122,7 @@ then in a document using a format dated 2015/06/01 or later, the ``new code'' will be used, and for documents being processed with an older format, the ``original'' code will be used. Note the format date here may be the original format date as shown at the start of every \LaTeX\ run, or a format date -specified as a package option to the \textsf{latexrelease} package. +specified as a package option to the \pkg{latexrelease} package. So if the document has \begin{verbatim} @@ -132,7 +138,7 @@ processed with the current format, as the format acts as if dated 2014/05/01. The new concept provides full backward and forward compatibility for the \LaTeX{} format, i.e., with the help of a current -\textsf{latexrelease} package the kernel can emulate all released +\pkg{latexrelease} package the kernel can emulate all released formats (starting with 2014/06/01\footnote{Patching an older format most likely works too, given that the changes in the past have been minimal, though this isn't guaranteed and hasn't been tested.}). @@ -155,10 +161,10 @@ help identifying what release tree to use to achieve perfect accuracy. \section{Updates to the kernel} -\subsection{Updates incorporated from \textsf{fixltx2e}} +\subsection{Updates incorporated from \pkg{fixltx2e}} -The detailed list of changes incorporated from \textsf{fixltx2e} is -available in the new \textsf{latexchanges} document that is +The detailed list of changes incorporated from \pkg{fixltx2e} is +available in the new \file{latexchanges} document that is distributed with this release. The main changes are that $2$-column floats are kept in sequence with one column floats, corrections are made to the \verb|\mark| system to ensure correct page headings in @@ -170,18 +176,18 @@ $2$-column documents, several additional commands are made robust. that allocated registers in the range $0$--$255$. Almost all distributions have for some years used \eTeX\ based formats (or \hologo{XeTeX} or \hologo{LuaTeX}) which have $2^{15}$ registers of each type ($2^{16}$ in the case of -\hologo{LuaTeX}). The \textsf{etex} package has been available to provided an +\hologo{LuaTeX}). The \pkg{etex} package has been available to provided an allocation mechanism for these extended registers but now the format will by default allocate in a range suitable for the engine being used. The new -allocation mechanism is different than the \textsf{etex} package mechanism, and +allocation mechanism is different than the \pkg{etex} package mechanism, and supports \hologo{LuaTeX}'s full range and an allocation mechanism for \LaTeX\ floats as described below. On \eTeX\ based engines, an additional command, \verb|\newmarks| is available -(as with the \textsf{etex} package) that allocates extended \eTeX\ marks, and +(as with the \pkg{etex} package) that allocates extended \eTeX\ marks, and similarly if \hologo{XeTeX} is detected a new command \verb|\newXeTeXintercharclass| is available, this is similar to the command -previously defined in the \texttt{xelatex.ini} file used to build the +previously defined in the \file{xelatex.ini} file used to build the \texttt{xelatex} format. \subsection{Additional \LaTeX{} float storage} @@ -189,7 +195,7 @@ previously defined in the \texttt{xelatex.ini} file used to build the \LaTeX's float placement algorithm needs to store floats (figures and tables) until it finds a suitable page to output them. It allocates $18$ registers for this storage, but this can often be insufficient. - The contributed \textsf{morefloats} package has + The contributed \pkg{morefloats} package has been available to extend this list; however, it also only allocates from the standard range $0$--$255$ so cannot take advantage of the extended registers. The new allocation mechanism in this release incorporates a new command @@ -203,11 +209,11 @@ make many more boxes available to hold floats. The kernel sources now detect the engine being used and adjust definitions accordingly, this reduces the need for the ``\texttt{.ini}'' files used to make -the formats to patch definitions defined in \texttt{latex.ltx}. +the formats to patch definitions defined in \file{latex.ltx}. As noted above the format now includes extended allocation routines. -The distribution includes a file \textsf{unicode-letters.def} derived from the +The distribution includes a file \file{unicode-letters.def} derived from the Unicode Consortium's Unicode Character Data files that details the upper and lower case transformation data for the full Unicode range. This is used to set the \verb|lccode| and \verb|uccode| values if a Unicode engine is being used, @@ -235,7 +241,7 @@ As well as updating the build system, the team have looked again at exactly what gets released to \textsc{ctan}. Taking inspiration from Heiko Oberdiek's \textsf{latex-tds} bundle, the PDF documentation provided now includes hyperlinks where appropriate. This has been done without modifying the sources -such that users without \textsf{hyperref} available can still typeset the +such that users without \pkg{hyperref} available can still typeset the documentation using only the core distribution. At the same time, the release now includes ready-to-install TDS-style zip files. This will be of principal interest to \TeX\ system maintainers, but end users with older machines who diff --git a/macros/latex/base/ltnews23.pdf b/macros/latex/base/ltnews23.pdf Binary files differindex 5ca33f4849..4ba74c87fd 100644 --- a/macros/latex/base/ltnews23.pdf +++ b/macros/latex/base/ltnews23.pdf diff --git a/macros/latex/base/ltnews23.tex b/macros/latex/base/ltnews23.tex index 36f8948e7d..99e9615074 100644 --- a/macros/latex/base/ltnews23.tex +++ b/macros/latex/base/ltnews23.tex @@ -54,6 +54,12 @@ \publicationissue{23} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -77,35 +83,35 @@ The main feature of this release is that by default it includes allocators for \hologo{LuaTeX}-provided features, such as Lua functions, bytecode registers, catcode tables and Lua callbacks. Previously these features have been provided by the contributed -\package{luatex} (Heiko Oberdiek) and \package{luatexbase} +\pkg{luatex} (Heiko Oberdiek) and \pkg{luatexbase} (\'{E}lie Roux, Manuel P\'{e}gouri\'{e}-Gonnard and Philipp Gesang) packages. However, just as -noted with the \package{etex} package in the previous release, it is +noted with the \pkg{etex} package in the previous release, it is better if allocation is handled by the format to avoid problems with conflicts between different allocation schemes, or definitions made before a package-defined allocation scheme is enabled. The facilities incorporated into the format with this release, and -described below, are closely modelled on the \package{luatexbase} +described below, are closely modelled on the \pkg{luatexbase} package and we thank the authors, and especially \'{E}lie Roux, for help in arranging this transition. The implementation of these \hologo{LuaTeX} features has been redesigned to match the allocation system introduced in the 2015/01/01 \LaTeX\ release, and there are some other differences from the previous -\package{luatexbase} package. However, as noted below, -\package{luatexbase} is being updated in line with this \LaTeX\ release +\pkg{luatexbase} package. However, as noted below, +\pkg{luatexbase} is being updated in line with this \LaTeX\ release to provide the previous interface as a wrapper around the new implementation, so we expect the majority of documents using -\package{luatexbase} to work without change. +\pkg{luatexbase} to work without change. \subsection{Names of \hologo{LuaTeX} primitive commands} The 2015/01/01 \LaTeX\ release for the first time initialised -\hologo{LuaTeX} in \textsf{latex.ltx} if \hologo{LuaTeX} is being +\hologo{LuaTeX} in \file{latex.ltx} if \hologo{LuaTeX} is being used. Following the convention used in the contributed -\textsf{lualatex.ini} file used to set up the format for earlier +\file{lualatex.ini} file used to set up the format for earlier releases, most \hologo{LuaTeX}-specific primitives were defined with names prefixed by \texttt{luatex}. This was designed to minimize name clashes but had the disadvantage that names did not match the @@ -136,7 +142,7 @@ then you can add: \end{verbatim} to your document. -Note the compatibility layer offered by the \package{luatexbase} package +Note the compatibility layer offered by the \pkg{luatexbase} package described below makes several commands available under both names. As always, this change can be reverted using:\\ @@ -147,8 +153,8 @@ at the start of the document. \subsection{\TeX\ commands for allocation in \hologo{LuaTeX}} For detailed descriptions of the new allocation commands see the -documented sources in \textsf{ltluatex.dtx} or chapter N of -\textsf{source2e}; however, the following new allocation commands are +documented sources in \file{ltluatex.dtx} or chapter N of +\file{source2e}; however, the following new allocation commands are defined by default in \hologo{LuaTeX}: \verb|\newattribute|, \verb|\newcatcodetable|, @@ -165,13 +171,13 @@ several catcode tables are predefined: \subsection{Predefined Lua functions} If used with \hologo{LuaTeX}, \LaTeX\ will initialise a Lua table, -\textsf{luatexbase}, with functions supporting allocation and also +\texttt{luatexbase}, with functions supporting allocation and also the registering of Lua callback functions. \subsection{Support for older releases and plain \TeX} The \hologo{LuaTeX} allocation functionality made available in this release is also available in plain \TeX\ and older \LaTeX\ releases -in the files \textsf{ltluatex.tex} and \textsf{ltluatex.lua} which may be +in the files \file{ltluatex.tex} and \file{ltluatex.lua} which may be used simply by including the \TeX\ file: \verb|\input{ltluatex}|. An alternative for old \LaTeX\ releases is to use:\\ \verb|\RequirePackage[2015/10/01]{latexrelease}|\\ @@ -181,21 +187,21 @@ which will update the kernel to the current release, including \subsection{Additional \hologo{LuaTeX} support packages} In addition to the base \LaTeX\ release two packages have been contributed to the \textsf{contrib} area on CTAN. The -\package{ctablestack} package offers some commands to help package -writers control the \hologo{LuaTeX} \textsf{catcodetable} -functionality, and the \package{luatexbase} package replaces the +\pkg{ctablestack} package offers some commands to help package +writers control the \hologo{LuaTeX} \texttt{catcodetable} +functionality, and the \pkg{luatexbase} package replaces the previously available package of the same name, providing a compatible -interface but implemented over the \package{ltluatex} code. +interface but implemented over the \pkg{ltluatex} code. \section{More Floats and Inserts} If \hologo{eTeX} is available, the number of registers allocated in the format to hold floats such as figures is increased from 18 to 52. The extended allocation system introduced in 2015/01/01 means that in -most cases it is no longer necessary to load the \package{etex} +most cases it is no longer necessary to load the \pkg{etex} package. Many classes and packages that previously loaded this package no longer do so. Unfortunately in some circumstances where a package -or class previously used the \package{etex} \verb|\reserveinserts| +or class previously used the \pkg{etex} \verb|\reserveinserts| command, it is possible for a document that previously worked to generate an error ``no room for a new insert''. In practice this error can always be avoided by declaring inserts earlier, before the @@ -213,7 +219,7 @@ insert allocations which is more than enough for practical documents \section{Updated Unicode data} -The file \textsf{unicode-letters.def} recording catcodes, upper and +The file \file{unicode-letters.def} recording catcodes, upper and lower case mappings and other properties for Unicode characters has been regenerated using the data files from Unicode~8.0.0. @@ -223,8 +229,8 @@ This is mainly used for the Romanian letters \textcommabelow{S}\textcommabelow{s}\textcommabelow{T}\textcommabelow{t}. This was requested in latex/4414 in the \LaTeX\ bug tracker. -\section{Extended \package{inputenc}} -The \texttt{utf8} option for \package{inputenc} has been extended to support +\section{Extended \pkg{inputenc}} +The \option{utf8} option for \pkg{inputenc} has been extended to support the letters s and t with comma accent, U+0218\,--\,U+021b. Similarly circumflex w and y U+0174\,--\,U+0177 are defined. Also U+00a0 and U+00ad are declared by default, and defined to be @@ -250,8 +256,8 @@ level. \section{Updates in tools} -The \package{multicol} package has been updated to fix the interaction +The \pkg{multicol} package has been updated to fix the interaction with ``here'' floats that land on the same page as the start or end of -a \textsf{multicols} environment. +a \env{multicols} environment. \end{document} diff --git a/macros/latex/base/ltnews24.pdf b/macros/latex/base/ltnews24.pdf Binary files differindex a2825f59f0..c82c5275fc 100644 --- a/macros/latex/base/ltnews24.pdf +++ b/macros/latex/base/ltnews24.pdf diff --git a/macros/latex/base/ltnews24.tex b/macros/latex/base/ltnews24.tex index 5dee993186..44cd76a060 100644 --- a/macros/latex/base/ltnews24.tex +++ b/macros/latex/base/ltnews24.tex @@ -67,6 +67,12 @@ \publicationissue{24} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -77,7 +83,7 @@ This release refines the \hologo{LuaTeX} support introduced in the 2015/10/01 release. A number of patches have been added to improve the -behavior of \package{ltluatex} (thanks largely to code review by Philipp Gesang). +behavior of \pkg{ltluatex} (thanks largely to code review by Philipp Gesang). The kernel code has been adjusted to allow for changes in \hologo{LuaTeX} v0.85--v0.88. Most notably, newer \hologo{LuaTeX} releases allow more than $16$ write streams and these are now @@ -94,10 +100,10 @@ files in this release but has required major changes to the \texttt{.ini} files used by \TeX{} Live and similar distributions to set up the format files. These changes in the \hologo{LuaTeX} engine will affect any packages using these back end commands (packages such -as \package{graphics}, \package{color}, \package{hyperref}, etc.). +as \pkg{graphics}, \pkg{color}, \pkg{hyperref}, etc.). Until all contributed packages are updated to the new syntax users may need to add aliases for the old \hologo{pdfTeX} commands. A new -\package{luapdftexalias} package has been contributed to CTAN (not part of the +\pkg{luapdftexalias} package has been contributed to CTAN (not part of the core \LaTeX\ release) that may be used for this purpose. See also the sections below for related changes in the @@ -118,7 +124,7 @@ a ready-to-use form as \verb|unicode-letters.def|. However, the relationship between the Unicode Consortium files and \TeX{} data structures is non-trivial and still being explored. As such, it is preferable to directly parse the original (\verb|.txt|) files at point of use. The team has therefore ``spun-out'' both -the data and the loading to a new generic package, \package{unicode-data}. This +the data and the loading to a new generic package, \pkg{unicode-data}. This package makes the original Unicode Consortium data files available in the \verb|texmf| tree (in \verb|tex/generic/unicode-data|) and provides generic loaders suitable for reading this data into the plain, \LaTeXe{}, and other, @@ -133,7 +139,7 @@ At present, the following data files are included in this new package: \item \verb|SpecialCasing.txt| \item \verb|UnicodeData.txt| \end{itemize} -These files are used either by \LaTeXe{} or by \package{expl3} +These files are used either by \LaTeXe{} or by \textsf{expl3} (i.e.~they represent the set currently required by the team). The Unicode Consortium provides various other data files and we would be happy to add these to the generic package, as it is intended to provide a single place @@ -155,8 +161,8 @@ to \verb|\XeTeXinterchartoks| and that no \verb|\XeTeXintercharclass| data is loaded into the format. The values which were previously inherited from the plain \hologo{XeTeX} setup files are \emph{not} suitable for properly typesetting East Asian text. There are third-party packages addressing this -area well, notably those in the \package{CTeX} bundle. Third-party packages -may need adjustment to load the data themselves; see the \textsf{unicode-data} +area well, notably those in the \textsf{CTeX} bundle. Third-party packages +may need adjustment to load the data themselves; see the \pkg{unicode-data} package for one possible loader. \section{More support for east European accents} @@ -174,7 +180,7 @@ required. In T1 encoding, the composite of \verb|\c| with \texttt{k}, \texttt{l declared to use the comma below accent rather than cedilla to match the conventional use of these letters. -The UTF-8 \texttt{inputenc} option \texttt{utf8} has been extended to +The UTF-8 \pkg{inputenc} option \option{utf8} has been extended to support all latin combinations that can be reasonably constructed with a (single) accent command an a base character for the T1 encoding so \textcommaabove{g}, \k{u} and similar characters may be directly input @@ -182,24 +188,24 @@ using UTF-8 encoding. \section{Changes in Graphics} -The changes in \hologo{LuaTeX}~v0.87 mean that the \package{color} and -\package{graphics} packages no longer share the \texttt{pdftex.def} file +The changes in \hologo{LuaTeX}~v0.87 mean that the \pkg{color} and +\pkg{graphics} packages no longer share the \file{pdftex.def} file between \hologo{LuaTeX} and \hologo{pdfTeX}. A separate file -\texttt{luatex.def} (distributed separately) has been produced, and -distributions are encouraged to modify \texttt{graphics.cfg} and -\texttt{color.cfg} configuration files to default to the \texttt{luatex} +\file{luatex.def} (distributed separately) has been produced, and +distributions are encouraged to modify \file{graphics.cfg} and +\file{color.cfg} configuration files to default to the \option{luatex} option if \hologo{LuaTeX}~v0.87 or later is being used. The team has contributed suitable \texttt{.cfg} files to CTAN to be used as models. -Normally it is best to let the local \texttt{graphics.cfg} +Normally it is best to let the local \file{graphics.cfg} automatically supply the right option depending on the \TeX\ engine -being used; however the \package{color} and \package{graphics} (and so -\package{graphicx}) packages have been extended to have an explicit -\texttt{luatex} option comparable to the existing \texttt{pdftex} and -\texttt{xetex} options. +being used; however the \pkg{color} and \pkg{graphics} (and so +\pkg{graphicx}) packages have been extended to have an explicit +\option{luatex} option comparable to the existing \option{pdftex} and +\option{xetex} options. -The \package{trig} package has been updated so that pre-computed values +The \pkg{trig} package has been updated so that pre-computed values such as $\sin(90)$ now expand to digits (\texttt{1} rather than the internal token \verb|\@one| in this case). This allows them to be used directly in PDF literal strings. @@ -208,7 +214,7 @@ directly in PDF literal strings. \hologo{LuaTeX} from version v0.87 no longer supports the \verb|\write18| syntax to access system commands. A new package -\package{shellesc} has been added to \textsf{tools} that defines a new +\pkg{shellesc} has been added to \textsf{tools} that defines a new command \verb|\ShellEscape| that may be used in all \TeX\ variants to provide a consistent access to system commands. The package also defines \verb|\write18| in \hologo{LuaTeX} so that it continues to access @@ -233,12 +239,12 @@ future releases. The default font setup in \LaTeXe{} at present is to use the \texttt{OT1} encoding. This assumes that hyphenation patterns have been read using appropriate codes: the \texttt{T1} encoding is assumed. The commonly-used -hyphenation patterns today, \package{hyph-utf8}, are set up in this +hyphenation patterns today, \texttt{hyph-utf8}, are set up in this way for $8$-bit engines (\hologo{pdfTeX}) but for Unicode engines use Unicode code points. This means that hyphenation will be incorrect with Unicode engines unless a Unicode font is loaded. This requires a concept of a Unicode font encoding, which is currently provided by -the \package{fontspec} package in two versions, \texttt{EU1} and +the \pkg{fontspec} package in two versions, \texttt{EU1} and \texttt{EU2}. The team is working to fully understand what is meant by a ``Unicode font encoding'', as unlike a classical \TeX{} encoding it is essentially impossible to know what glyphs will be provided diff --git a/macros/latex/base/ltnews25.pdf b/macros/latex/base/ltnews25.pdf Binary files differindex 23a025b3bf..406bc35019 100644 --- a/macros/latex/base/ltnews25.pdf +++ b/macros/latex/base/ltnews25.pdf diff --git a/macros/latex/base/ltnews25.tex b/macros/latex/base/ltnews25.tex index e1881018ba..735fda356e 100644 --- a/macros/latex/base/ltnews25.tex +++ b/macros/latex/base/ltnews25.tex @@ -41,6 +41,12 @@ \publicationissue{25} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -55,13 +61,13 @@ allocation mechanism has been updated to match the callbacks defined in Lua\TeX\ version 0.90. These changes have also required updates in \textsf{tools} -and \textsf{amsmath} as described below. +and \pkg{amsmath} as described below. This is the first release of \LaTeX\ for which the test suite reports no failures when used with Lua\TeX. \section{Documentation checksums} -The \package{doc} package has always provided two mechanisms that were +The \pkg{doc} package has always provided two mechanisms that were mainly intended to guard against file truncation or corruption when files were commonly distributed by email through unreliable mail gateways: a Character Table of the ASCII character set could be @@ -69,69 +75,69 @@ inserted (and checked) and a ``checksum'' (count of the number of backslashes in the code sections) could be checked. These features are not really needed with modern distribution mechanisms and can be a distraction when reading the source code and so have been removed. The -\package{doc} package has been updated so that if you use a +\pkg{doc} package has been updated so that if you use a \verb|\CheckSum| command then, as before, the number is checked; however, if you omit the command then no error or warning is given. -\section{Updates to \package{inputenc}} +\section{Updates to \pkg{inputenc}} -The UTF-8 support in \package{inputenc} has been further extended with +The UTF-8 support in \pkg{inputenc} has been further extended with support for non-breaking hyphens and more dashes. \section{Updates in Tools} -The \package{varioref} package has been updated with improved +The \pkg{varioref} package has been updated with improved documentation of multi\-lingual support, and avoiding unnecessary warnings in some cases with \verb|\reftextfaraway|. -The \package{tabularx} package's handling of \verb|\endtabularx| in +The \pkg{tabularx} package's handling of \verb|\endtabularx| in environment definitions has been fixed to again match its documentation. -The \package{bm} package has been updated as required by the changes +The \pkg{bm} package has been updated as required by the changes to \verb|\mathchardef| in Lua\TeX. \section{amsmath} -Since the launch of \LaTeXe\ in 1993, the \textsf{amsmath} bundle has +Since the launch of \LaTeXe\ in 1993, the \pkg{amsmath} bundle has been part of the \emph{required} packages in the core \LaTeX\ distribution, with bug reports handled by the \LaTeX\ bug database at \url{https://latex-project.org/bugs-upload.html}. -The \textsf{amsmath} packages and the \textsf{amscls} classes have +The \pkg{amsmath} packages and the \cls{amscls} classes have been maintained by the American Mathematical Society. With this release a new arrangement has been agreed between the American Mathematical Society and the \LaTeX3 project. The \LaTeX3 -project will take over maintenance of the \textsf{amsmath} bundle, +project will take over maintenance of the \pkg{amsmath} bundle, with the American Mathematical Society retaining maintenance of -\textsf{amscls}. +\cls{amscls}. The recommended installation of these files in the \TeX\ directory structure remains unchanged as \path|tex/latex/amsmath| and \path|tex/latex/amscls| respectively. -This release of \package{amsmath} includes several updates so that -\package{amsmath} does not generate errors when math is used with +This release of \pkg{amsmath} includes several updates so that +\pkg{amsmath} does not generate errors when math is used with Lua\TeX\ v0.87+, which has changes to \verb|\mathchardef| that are -incompatible with the previous version of \package{amsmath}. It also +incompatible with the previous version of \pkg{amsmath}. It also improves \verb|\dots| handling so that \verb|\long| macros are correctly handled (for example, \verb|\dots \Rightarrow| now uses centered dots), as well as commands expanding to character tokens (for example, \verb|\times \dots \times| will use centered dots with -\verb|\times| defined as in the \package{unicode-math} package). +\verb|\times| defined as in the \pkg{unicode-math} package). \section{Related updates} In addition to the updates in the core \LaTeX\ release, some files in the CTAN ``contrib'' area have also been updated. Notably there have -been further updates to the \textsf{unicode-data} files; also, the +been further updates to the \file{unicode-data} files; also, the files required to build plain and \LaTeX\ formats have now been -submitted to CTAN as \textsf{tex-ini-files}. The -addition of a new \texttt{luatex} option for \textsf{graphics}-related -packages (\textsf{luatex-def} on CTAN) has required updates to the +submitted to CTAN as \file{tex-ini-files}. The +addition of a new \option{luatex} option for \textsf{graphics}-related +packages (\file{luatex-def} on CTAN) has required updates to the configuration files to select a default option and these have similarly been uploaded to CTAN as -\textsf{graphics-cfg}. (Previously these files were maintained +\file{graphics-cfg}. (Previously these files were maintained directly in the \TeX\ Live repository, and were not available on CTAN.) \end{document} diff --git a/macros/latex/base/ltnews26.pdf b/macros/latex/base/ltnews26.pdf Binary files differindex c263551493..52e9f29f73 100644 --- a/macros/latex/base/ltnews26.pdf +++ b/macros/latex/base/ltnews26.pdf diff --git a/macros/latex/base/ltnews26.tex b/macros/latex/base/ltnews26.tex index e1ae85dda8..f0e7578b70 100644 --- a/macros/latex/base/ltnews26.tex +++ b/macros/latex/base/ltnews26.tex @@ -40,6 +40,12 @@ \publicationissue{26} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -82,32 +88,32 @@ is not really suitable, and is especially problematic with \hologo{XeLaTeX} as in the major distributions this is built with Unicode based hyphenation patterns in the format. In practice this has not been a major problem as documents use the contributed -\textsf{fontspec} package in order to switch to a +\pkg{fontspec} package in order to switch to a Unicode encoded font. In this release we are adding \texttt{TU} as a new supported encoding in addition to the previously supported encodings such as \texttt{OT1} and \texttt{T1}. This denotes a Unicode based font encoding. It is essentially the same as the \texttt{TU} encoding that has been on trial with the -experimental \texttt{tuenc} option to \textsf{fontspec} for the past +experimental \option{tuenc} option to \pkg{fontspec} for the past year. The \hologo{XeLaTeX} and \hologo{LuaLaTeX} formats will now default to \texttt{TU} encoding and \texttt{lmr} (Latin Modern) family. In the -case of \hologo{LuaLaTeX} the contributed \textsf{luaotfload} Lua +case of \hologo{LuaLaTeX} the contributed \texttt{luaotfload} Lua module will be loaded at the start of each run to enable the loading of OpenType fonts. -The \textsf{fontspec} package is being adjusted in a companion release +The \pkg{fontspec} package is being adjusted in a companion release to recognise the new encoding default arrangements. Note that in practice no font supports the full Unicode range, and so \texttt{TU} encoded fonts, unlike fonts specified for \texttt{T1}, may be expected to be incomplete in various ways. In the current release the file -\texttt{tuenc.def} that implements the \texttt{TU} encoding-specific commands +\file{tuenc.def} that implements the \texttt{TU} encoding-specific commands has made some basic assumptions for (for example) default handling of accent commands, and the set of command names is derived from the -command names used for the UTF-8 support in the \textsf{inputenc} package, +command names used for the UTF-8 support in the \pkg{inputenc} package, restricted roughly to the character ranges classically provided by the \texttt{T1} and \texttt{TS1} encodings, but is part of a longer term plan seen over recent releases to increase support for Unicode based \TeX\ engines @@ -130,54 +136,54 @@ document with \section{\cs{showhyphens} in \hologo{XeLaTeX}} Due to the way \hologo{XeLaTeX} interfaces to font libraries, the standard definition of \cs{showhyphens} does not work. A variant -definition has been available in the contributed \textsf{xltxtra} +definition has been available in the contributed \pkg{xltxtra} package, however a (slightly different) definition for \cs{showhyphens} is now included in \hologo{XeLaTeX} by default. As usual this change will be undone if an earlier -release is specified using the \textsf{latexrelease} package. +release is specified using the \pkg{latexrelease} package. -\section{The \textsf{fixltx2e} package} -As described in \LaTeX{} News~22, the \textsf{fixltx2e} package has become +\section{The \pkg{fixltx2e} package} +As described in \LaTeX{} News~22, the \pkg{fixltx2e} package has become obsolete with the new update policy. Since 2015 it has just made a warning and exited. In this release we have re-introduced all the code from the original fixes in the 2014 \LaTeX\ but guarded by \verb|\IncludeInRelease{2015/01/01}|. -So for current releases \textsf{fixltx2e} still just displays a warning +So for current releases \pkg{fixltx2e} still just displays a warning but for old releases, whether that is an old format, or a format with -the version date reset via the \textsf{latexrelease} package, the -fixes in the original \textsf{fixltx2e} will be applied. +the version date reset via the \pkg{latexrelease} package, the +fixes in the original \pkg{fixltx2e} will be applied. This improves the ability to run old documents in a way that is compatible with contemporary formats. If you have a 2014 document that used \verb|\usepackage{fixltx2e}| and you add \verb|\RequirePackage[2014/01/01]{latexrelease}| and process it with the -current format then \textsf{latexrelease} will undo most changes made -since 2014, but now when the document includes \textsf{fixltx2e} it +current format then \pkg{latexrelease} will undo most changes made +since 2014, but now when the document includes \pkg{fixltx2e} it will act like a 2014 version of the package and apply the code fixes, not just give a warning that the package is obsolete. -\section{The \textsf{latexbug} package} +\section{The \pkg{latexbug} package} As explained in more detail at the \LaTeX\ Project website\footnote{\url{https://www.latex-project.org/bugs/}} -a new package, \textsf{latexbug}, has been produced to help produce +a new package, \pkg{latexbug}, has been produced to help produce test files to accompany bug reports on the core \LaTeX\ distribution. This is being published separately to CTAN at the same time as this -release. By using the \textsf{latexbug} package you can easily check +release. By using the \pkg{latexbug} package you can easily check that the packages involved in the test are all part of the core release. The \LaTeX\ project cannot handle bug reports on contributed packages, which should be directed to the package maintainer as given in the package documentation. -\section{Updates to \textsf{amsmath}} -The \textsf{amsmath} package has two updates at this release. +\section{Updates to \pkg{amsmath}} +The \pkg{amsmath} package has two updates at this release. \begin{itemize} -\item The spacing to the left of the \texttt{aligned} and - \texttt{gathered} environments has been fixed: the spurious thin +\item The spacing to the left of the \env{aligned} and + \env{gathered} environments has been fixed: the spurious thin space is no longer added by default. Package options control this to revert to the original behaviour where required; see the - \textsf{amsldoc} guide for further details. + \file{amsldoc} guide for further details. \item The large delimiters around generalised fractions (for example in the \cs{binom} construct) did not work in previous releases if using \hologo{LuaTeX} or \hologo{XeTeX} with OpenType math fonts. This is @@ -193,34 +199,34 @@ The \textsf{amsmath} package has two updates at this release. \end{itemize} \section{Updates to \textsf{tools}} -The \textsf{array} package has been updated to fix a longstanding but +The \pkg{array} package has been updated to fix a longstanding but previously unreported issue with unwanted interactions between tables in the page head or foot and the body of the page, as reported in \href{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=tools/4488}{PR tools/4488}. -There is also an update to the \hologo{LuaTeX} support in \textsf{bm}. +There is also an update to the \hologo{LuaTeX} support in \pkg{bm}. \section{An addendum to the release changes in 2015: page breaks and vertical spacing} In 2015 we announced the introduction of the roll-back\slash roll-forward concept to manage bug fixes and additions to core \LaTeX{} in a manageable way. We also announced at that time -that we now incorporate all fixes from \textsf{fixltx2e} into the +that we now incorporate all fixes from \pkg{fixltx2e} into the kernel (as the old mechanism produced problems instead of improving the situation). Refer to -\href{https://www.latex-project.org/news/latex2e-news/ltnews22.pdf}{\texttt{ltnews22.pdf}} +\href{https://www.latex-project.org/news/latex2e-news/ltnews22.pdf}{\file{ltnews22.pdf}} for details. -One of the fixes from \textsf{fixltx2e} was for a glaring bug in +One of the fixes from \pkg{fixltx2e} was for a glaring bug in \cs{addvspace} that was originally detected in the mid-nineties and -back then added to the \textsf{fixltx2e} support package. In certain +back then added to the \pkg{fixltx2e} support package. In certain situations \cs{addvspace} would result in a page/column break below the baseline of the last line. As a result documents using \cs{flushbottom} would show a clear misalignment (even more prominent when typesetting in two-column mode). Starting with release 2015/01/01 this is now finally corrected already -in the kernel and not only in \textsf{fixltx2e}. In nearly all +in the kernel and not only in \pkg{fixltx2e}. In nearly all circumstances this will either make no difference to existing documents, or it will locally improve the visual appearance of that document without changing anything on other pages. However, by the diff --git a/macros/latex/base/ltnews27.pdf b/macros/latex/base/ltnews27.pdf Binary files differindex 09e47692ba..383a007860 100644 --- a/macros/latex/base/ltnews27.pdf +++ b/macros/latex/base/ltnews27.pdf diff --git a/macros/latex/base/ltnews27.tex b/macros/latex/base/ltnews27.tex index 3572b5e0b1..ba17d26e5e 100644 --- a/macros/latex/base/ltnews27.tex +++ b/macros/latex/base/ltnews27.tex @@ -40,6 +40,12 @@ \publicationissue{27} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -65,9 +71,9 @@ From this release, \LaTeX\ will accept ISO format date strings in the date argument of \verb|\ProvidesPackage|, \verb|\usepackage|, etc. Currently we recommend that you do not use this format in any packages that need to work with older \LaTeX\ releases; -the \textsf{latexrelease} package may be used with older releases to +the \pkg{latexrelease} package may be used with older releases to add this functionality. This change is handled in a special way by - \textsf{latexrelease}: The package always adds support for ISO dates + \pkg{latexrelease}: The package always adds support for ISO dates whatever format date is requested; this is required so that the necessary date comparisons may be made. @@ -92,10 +98,10 @@ verbatim environments use a \verb|\language| setting, The format ensures that a language has been allocated with this name. For most users this will in fact be no change as the standard -\textsf{babel} language has for a long time allocated a language with +\pkg{babel} language has for a long time allocated a language with this name. -In order that page breaks in \texttt{verbatim} do not influence the +In order that page breaks in \env{verbatim} do not influence the language used in the page head and foot, the format now normalises the language used in the output routine to a default language as described below. @@ -103,7 +109,7 @@ below. \section{Discretionary hyphenation} The \LaTeX\ definition of \verb|\-| has been adjusted so that it will insert the current font's \verb|\hyphenchar|, as would the -\TeX\ primitive. A comment in \textsf{source2e} has given +\TeX\ primitive. A comment in \file{source2e} has given this new definition since the first releases of \LaTeXe, and in this release we finally acted upon this comment. Previously \verb|\-| always inserted a \texttt{-} at a break point even if a different @@ -118,7 +124,7 @@ introduced; this is initialised to $-1$ but is set at handling of the default color, and is used in a similar way to normalise the settings for page head and foot as described above. Users should not normally need to set this explicitly but it is expected that -language packages such as \textsf{babel} may set this if the default +language packages such as \pkg{babel} may set this if the default behaviour is not suitable. \section{Line spacing in parboxes} @@ -129,7 +135,7 @@ lines of a paragraph that have ascenders or descenders could be set with \emph{closer} line spacing than lines without. This can easily happen if you use a \verb|\parbox| in an AMS alignment, as they use a relatively large value of \verb|\lineskiplimit|. -As usual, the \textsf{latexrelease} package may be used to +As usual, the \pkg{latexrelease} package may be used to force the older behavior. \end{document} diff --git a/macros/latex/base/ltnews28.pdf b/macros/latex/base/ltnews28.pdf Binary files differindex 292384aa4a..8178e03874 100644 --- a/macros/latex/base/ltnews28.pdf +++ b/macros/latex/base/ltnews28.pdf diff --git a/macros/latex/base/ltnews28.tex b/macros/latex/base/ltnews28.tex index 59b01ed4fc..03d4a04ae1 100644 --- a/macros/latex/base/ltnews28.tex +++ b/macros/latex/base/ltnews28.tex @@ -44,6 +44,12 @@ \publicationissue{28} +\providecommand\pkg[1]{\texttt{#1}} +\providecommand\cls[1]{\texttt{#1}} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} + \begin{document} \maketitle @@ -125,7 +131,7 @@ the early nineties that \LaTeXe{} (that was being developed to provide a \LaTeX{} version usable across the world) had to provide a solution to this issue. -The \LaTeXe{} answer was the introduction of the \package{inputenc} +The \LaTeXe{} answer was the introduction of the \pkg{inputenc} package~\cite{Mittelbach:Brno95} through which it is possible to provide support for multiple encodings. It also allows to correctly process a file written in one encoding on a computer using a different @@ -135,10 +141,10 @@ midway. Since the first release of \LaTeXe{} in 1994, \LaTeX{} documents that used any characters outside \acro{ascii} in the source (i.e. any characters in the range of 128--255) were supposed to load -\package{inputenc} and specify in which file encoding they were +\pkg{inputenc} and specify in which file encoding they were written and stored. % -If the \package{inputenc} package was not loaded then \LaTeX{} used a +If the \pkg{inputenc} package was not loaded then \LaTeX{} used a ``raw'' encoding which essentially took each byte from the input file and typeset the glyph that happened to be in that position in the current font---something that sometimes produces the right result but @@ -171,7 +177,7 @@ the same as the existing UTF-8 support from The \hologo{LuaTeX} and \hologo{XeTeX} engines always supported the UTF-8 encoding as their native (and only) input encoding, so with -these engines \package{inputenc} was always a no-op. +these engines \pkg{inputenc} was always a no-op. This means that with new documents one can assume UTF-8 input and it is no longer required to always specify @@ -186,14 +192,14 @@ For most existing documents this change will be transparent: \item documents using only \acro{ascii} in the input file and accessing accented characters via commands; \item documents that specified the encoding of their file via an - option to the \package{inputenc} package and then used 8-bit + option to the \pkg{inputenc} package and then used 8-bit characters in that encoding; \item documents that already had been stored in UTF-8 (whether or not - specifying this via \package{inputenc}). + specifying this via \pkg{inputenc}). \end{itemize} Only documents that have been stored in a legacy encoding and used accented letters from the keyboard \emph{without} loading -\package{inputenc} (relying on the similarities between the input used +\pkg{inputenc} (relying on the similarities between the input used and the T1 font encoding) are affected. These documents will now generate an error that they contain invalid @@ -215,12 +221,12 @@ Possible alternatives are reencoding the file to UTF-8 using a tool \verb= \usepackage[=\meta{encoding}\verb=]{inputenc}= \end{flushleft} to the preamble specifying the \meta{encoding} that fits the file -encoding. In many cases this will be \texttt{latin1} or -\texttt{cp1252}. For other encoding names and their meaning see the -\package{inputenc} documentation. +encoding. In many cases this will be \option{latin1} or +\option{cp1252}. For other encoding names and their meaning see the +\pkg{inputenc} documentation. As usual, this change may also be reverted via the more general -\package{latexrelease} package mechanism, by speciying a release date +\pkg{latexrelease} package mechanism, by speciying a release date earlier than this release. @@ -291,7 +297,7 @@ command being tested being defined if it was previously undefined may have to ad \verb|\let\|\meta{command}\verb|\relax|. -\section{Changes to packages in the tools category} +\section{Changes to packages in the \pkg{tools} category} \subsection{\LaTeX{} table columns with fixed widths} @@ -317,14 +323,14 @@ off-chance that code that hooked into internals of \pkg{multicol} needs adjustment. -\section{Changes to packages in the amsmath category} +\section{Changes to packages in the \pkg{amsmath} category} With this release of \LaTeX{} a few minor issues with \pkg{amsmath} have been corrected. \subsection{Updated user's guide} -Furthermore, \texttt{amsldoc.pdf}, the AMS user's +Furthermore, \file{amsldoc.pdf}, the AMS user's guide for the \pkg{amsmath} package~\cite{amsldoc}, has been updated from version~2.0 to~2.1 to incorporate changes and corrections made between 2016 and 2018. @@ -354,7 +360,7 @@ between 2016 and 2018. \url{https://www.latex-project.org/publications/} \bibitem{amsldoc} American Mathematical Society and The \LaTeX\ Project: - \emph{User's Guide for the \texttt{amsmath} package} (Version 2.1). + \emph{User's Guide for the \pkg{amsmath} package} (Version 2.1). April 2018. Available from \url{https://www.ctan.org} diff --git a/macros/latex/base/ltnews29.pdf b/macros/latex/base/ltnews29.pdf Binary files differindex 9e400b9d1b..260dc5eb9b 100644 --- a/macros/latex/base/ltnews29.pdf +++ b/macros/latex/base/ltnews29.pdf diff --git a/macros/latex/base/ltnews29.tex b/macros/latex/base/ltnews29.tex index a5732eada9..749b927218 100644 --- a/macros/latex/base/ltnews29.tex +++ b/macros/latex/base/ltnews29.tex @@ -61,7 +61,7 @@ \mbox{\small\slshape(\url{https://tex.stackexchange.com/#1})}\par} \let\cls\pkg -\newcommand\env[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse % only for TUB production @@ -438,7 +438,7 @@ out'' into the surrounding text. This has been corrected. % \githubissue{72} -\subsection{Support fragile commands in \texttt{array} or \texttt{tabular} column templates} +\subsection{Support fragile commands in \env{array} or \env{tabular} column templates} The preamble specifiers \texttt{p}, \texttt{m} and \texttt{b} each receives a user supplied argument: the width of the paragraph column. Normally @@ -451,7 +451,7 @@ been corrected. -\section{Changes to packages in the amsmath category} +\section{Changes to packages in the \pkg{amsmath} category} The changes in the kernel made for \cs{thinspace}, \cs{smash}, etc.\ (see above) have been reflected in the \pkg{amsmath} package diff --git a/macros/latex/base/ltnews30.pdf b/macros/latex/base/ltnews30.pdf Binary files differindex f341f62847..3529ae8374 100644 --- a/macros/latex/base/ltnews30.pdf +++ b/macros/latex/base/ltnews30.pdf diff --git a/macros/latex/base/ltnews30.tex b/macros/latex/base/ltnews30.tex index cfb67b0c68..74d7659512 100644 --- a/macros/latex/base/ltnews30.tex +++ b/macros/latex/base/ltnews30.tex @@ -283,7 +283,7 @@ in which you can specify that it is allowed to \option{overwrite} an already existing file; by default nothing is written if a file with the given name exists anywhere in the search tree. An alternative name for this -option is \texttt{force}. +option is \option{force}. Even then the environment will refuse to write to \cs{jobname}\texttt{.tex} to avoid clobbering its own input file. However, if you use a different extension on your input file you @@ -327,7 +327,7 @@ Doing this for \cs{begin} and \cs{end} was rather tricky as the standard mechanism with \cs{DeclareRobustCommand} doesn't work here, at least not for \cs{end} as that needs to expand during typesetting without generating a \cs{relax} (from the \cs{protect}). Such a token -would start a new row in table environments, such as \texttt{tabular}, +would start a new row in table environments, such as \env{tabular}, etc. Furthermore, some packages try to look into the definition of \cs{end} by expanding it several times. Thus expansion with \cs{expandafter} had to produce exactly the same result as before. But @@ -406,8 +406,8 @@ would work incorrectly, e.g., a construction such as \begin{verbatim} \InputIfFileExists{foo}{\input{bar}}{} \end{verbatim} -would not load the files \texttt{foo.tex} and \texttt{bar.tex} but -would load \texttt{bar.tex} twice. This has been corrected. +would not load the files \file{foo.tex} and \file{bar.tex} but +would load \file{bar.tex} twice. This has been corrected. \githubissue{109} @@ -477,7 +477,7 @@ The command has now changed to not produce such side effects. \subsection{\pkg{nfssfont}: Make font table generation the default action} -With the small file \texttt{nfssfont.tex} it is possible to produce +With the small file \file{nfssfont.tex} it is possible to produce font tables and other font tests in the style set up by Don Knuth. In nearly all cases @@ -512,7 +512,7 @@ regardless of \pkg{trace} being loaded or not. \subsection{\pkg{array}: Warn if primitive column specifiers are overwritten} With \cs{newcolumntype} it is possible to define your own column -specifiers for a \texttt{tabular} preamble; it is also possible to +specifiers for a \env{tabular} preamble; it is also possible to change existing ones. However, doing that for a primitive column specifier, such as \texttt{c}, is seldom a good idea, since then its functionality becomes unavailable. @@ -625,15 +625,15 @@ all the font families supported through the program \texttt{autoinst} are now producing the standard codes again. -\subsection{\LaTeX{} \texttt{base} and \texttt{doc} distribution reunited} +\subsection{\LaTeX{} \textsf{base} and \textsf{doc} distribution reunited} For a long time the \LaTeX{} distribution available from \CTAN{} was split into several parts to allow them to be uploaded or downloaded separately. As this is these days more confusing than helpful we have recombined the base part with the documentation part (as both are -anyway always updated together). Thus the package \texttt{latex-doc} +anyway always updated together). Thus the package \textsf{latex-doc} is no longer separately available from \CTAN{} but contained in the -\texttt{latex-base} distribution. +\textsf{latex-base} distribution. \begin{thebibliography}{9} diff --git a/macros/latex/base/ltnews31.pdf b/macros/latex/base/ltnews31.pdf Binary files differindex e5e3f75135..b9e9a122dc 100644 --- a/macros/latex/base/ltnews31.pdf +++ b/macros/latex/base/ltnews31.pdf diff --git a/macros/latex/base/ltnews31.tex b/macros/latex/base/ltnews31.tex index 61e8b00683..8bb6e638b5 100644 --- a/macros/latex/base/ltnews31.tex +++ b/macros/latex/base/ltnews31.tex @@ -43,6 +43,8 @@ \providecommand\meta[1]{$\langle$\textit{#1}$\rangle$} \providecommand\option[1]{\texttt{#1}} \providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} +\providecommand\pkg[1]{\texttt{#1}} \providecommand\XeTeX{\hologo{XeTeX}} @@ -251,7 +253,7 @@ The way that shapes combine with each other is not hardwired; it is customizable and extensible if there is ever a need for this. The mappings are defined through \cs{DeclareFontShapeChangeRule} and the -details for developers are documented in \texttt{source2e.pdf}. +details for developers are documented in \file{source2e.pdf}. The ideas for this interface extension have been pioneered in \pkg{fontspec} by Will Robertson for Unicode engines, and in @@ -318,7 +320,7 @@ premier league for font usage. The ways in which the different series values combine with each other is not hardwired but is again customizable and extensible. The mappings are defined through \cs{DeclareFontSeriesChangeRule} and the details for -developers are documented in \texttt{source2e.pdf}. +developers are documented in \file{source2e.pdf}. \subsection{Font series defaults per document family} @@ -457,18 +459,17 @@ With the text companion symbols as part of the kernel, it is normally no longer necessary to load the \pkg{textcomp} package, but for backwards compatibility this package will remain available. There is, however, one use case where it remains useful: if you load the package -with the option \texttt{error} or \texttt{warn} then substitutions +with the option \option{error} or \option{warn} then substitutions will change their behavior and result in a \LaTeX{} error or a \LaTeX{} warning (on the terminal), respectively. Without the package the substitution information only appears in the \texttt{.log} -file. If you use the option \texttt{quiet}, then even the information in +file. If you use the option \option{quiet}, then even the information in the transcript is suppressed (which is not really recommended). \subsection{New \texttt{alias} size function for use in \texttt{.fd} files} -% These are really called ``size functions'' in NFSS, a bit weird I know Most of the newer fonts supported in \TeX{} have been set up with the \texttt{autoinst} tool by Marc Penninga. In the past, this program @@ -565,7 +566,7 @@ has been corrected. This also involved a correction to \pkg{amsmath}. \githubissue{251} -\subsection{Allow more write streams with \texttt{filecontents} in \LuaTeX} +\subsection{Allow more write streams with \env{filecontents} in \LuaTeX} Most \TeX{} engines only support a maximum of sixteen concurrently open write streams, and when those have been used up, then @@ -576,7 +577,7 @@ also now be utilised. % \githubissue{238} -\subsection{Allow spaces in \texttt{filecontents} option list} +\subsection{Allow spaces in \env{filecontents} option list} Leaving spaces or newlines in the option list prevented the options from being correctly recognized. This\\ @@ -609,9 +610,9 @@ All of these are now robust. \section{Changes to packages in the \pkg{tools} category} -\subsection{Fixed column depth in boxed \texttt{multicols}} +\subsection{Fixed column depth in boxed \env{multicols}} -The \texttt{multicols} environment was setting \cs{maxdepth} when +The \env{multicols} environment was setting \cs{maxdepth} when splitting boxes; but, due to the way the internal interfaces of \LaTeX{} are designed, it should have used \cs{@maxdepth} instead. As a result, balanced boxed multicols sometimes ended up having different heights @@ -620,9 +621,9 @@ even if they had exactly the same content. \githubissue{190} -\subsection{Ensure that \texttt{multicols} does not lose text} +\subsection{Ensure that \env{multicols} does not lose text} -The \texttt{multicols} environment needs a set of consecutively numbered boxes to +The \env{multicols} environment needs a set of consecutively numbered boxes to collect column material. The way those got allocated could result in disaster if other packages allocated most boxes below box~255 (which \TeX{} always uses for the output page). In the original @@ -641,13 +642,13 @@ lower-numbered registers available. \subsection{Allow spaces in \cs{hhline} arguments} The \verb|\hhline| command, which allows the -specification of rule segments in \texttt{tabular} environments, now +specification of rule segments in \env{tabular} environments, now allows (but ignores) spaces between its tokens: so \verb|\hhline{: = : =}| is now allowed and is equivalent to \verb|\hhline{:=:=}|. This matches similar token arguments in \LaTeX{} such as the \verb|[h t p]| argument on floats. A similar change has been made to the extended \verb|\hhline| command in the -\texttt{colortbl} package. +\pkg{colortbl} package. % \githubissue{242} diff --git a/macros/latex/base/ltnews32.pdf b/macros/latex/base/ltnews32.pdf Binary files differindex 9f3d32cc3e..ea45c141a3 100644 --- a/macros/latex/base/ltnews32.pdf +++ b/macros/latex/base/ltnews32.pdf diff --git a/macros/latex/base/ltnews32.tex b/macros/latex/base/ltnews32.tex index c56537a203..01bc515db5 100644 --- a/macros/latex/base/ltnews32.tex +++ b/macros/latex/base/ltnews32.tex @@ -43,6 +43,7 @@ \providecommand\meta[1]{$\langle$\textrm{\itshape#1}$\rangle$} \providecommand\option[1]{\texttt{#1}} \providecommand\env[1]{\texttt{#1}} +\providecommand\file[1]{\texttt{#1}} \providecommand\Arg[1]{\texttt\{\meta{#1}\texttt\}} @@ -177,11 +178,11 @@ within the kernel that makes use of the \LaTeX3 functionality now available (if we discount \pkg{xparse} which has already been available for a long time as a separate package). -The file \texttt{lthooks.dtx} holds the core management code for hooks +The file \file{lthooks.dtx} holds the core management code for hooks and defines basic hooks for environments (as previously offered by -\pkg{etoolbox}), \texttt{ltshipout.dtx} provides kernel hooks into the +\pkg{etoolbox}), \file{ltshipout.dtx} provides kernel hooks into the shipout process (making packages like \pkg{atbegshi}, -etc., unnecessary) and the file \texttt{ltfilehook.dtx} holds +etc., unnecessary) and the file \file{ltfilehook.dtx} holds redefinitions for commands like \cs{input} or \cs{usepackage} so that they offer hooks in a similar fashion to what is provided by the \pkg{filehook} package. @@ -192,16 +193,16 @@ more thorough testing). For that reason the documentation isn't in its final form either and you have to read through three different documents: \begin{description} - \item[\texttt{lthooks-doc.pdf}] Core management interface and basic + \item[\file{lthooks-doc.pdf}] Core management interface and basic hooks for environments provided by the kernel. - \item[\texttt{ltshipout-doc.pdf}] Hooks accessible while a page is + \item[\file{ltshipout-doc.pdf}] Hooks accessible while a page is being shipped out. - \item[\texttt{ltfilehook-doc.pdf}] Hooks used when reading a file. + \item[\file{ltfilehook-doc.pdf}] Hooks used when reading a file. \end{description} For those who wish to also study the code, replace \texttt{-doc} with -\texttt{-code}, e.g., \texttt{lthooks-code.pdf}. All documents should +\texttt{-code}, e.g., \file{lthooks-code.pdf}. All documents should be accessible via \texttt{texdoc}, e.g., \begin{verbatim} texdoc lthooks-doc @@ -270,12 +271,12 @@ these commands. % \githubissue{152} -\subsection{Support \eTeX\ length expressions in \texttt{picture} coordinates} +\subsection{Support \eTeX\ length expressions in \env{picture} coordinates} Picture mode coordinates specified with \texttt{(\_,\_)} previously accepted multiples of \cs{unitlength}. They now also allow \eTeX\ length expressions (as used by the \cs{glueexpr} primitive although all uses -in \texttt{picture} mode are non-stretchy). +in \env{picture} mode are non-stretchy). So, valid uses include \verb|\put(2,2)| as previously, but now also uses such as\tubcommand\\ \verb|\put(\textwidth-5cm,0.4\textheight)|. @@ -321,7 +322,7 @@ been adjusted. \subsection{Spacing issues when using \cs{linethickness}} In some circumstances the use of \cs{linethickness} introduced a -spurious space that shifted objects in a \texttt{picture} environment +spurious space that shifted objects in a \env{picture} environment to the right. This has been corrected. % \githubissue{274} @@ -403,16 +404,16 @@ been fixed. \githubissue{22} -\subsection{Adjusting \texttt{fleqn}} +\subsection{Adjusting \option{fleqn}} In \pkg{amsmath} the \cs{mathindent} parameter used with the -\texttt{fleqn} design is a rubber length parameter allowing for setting +\option{fleqn} design is a rubber length parameter allowing for setting it to a value such as \texttt{1em minus 1em}, i.e., so that the normal indentation can be reduced in case of very wide math displays. This is now also supported by the \LaTeX{} standard classes. In addition a compressible space between formula and equation number -in the \texttt{equation} environment got added when the \texttt{fleqn} +in the \env{equation} environment got added when the \option{fleqn} option is used so that a very wide formula doesn't bump into the equation number. % @@ -561,7 +562,7 @@ code written in the L3 programming layer language. \subsection{Support vertical typesetting with \pkg{doc}} -The \texttt{macrocode} environment uses a \texttt{trivlist} internally +The \env{macrocode} environment uses a \env{trivlist} internally and as part of this sets up the \cs{@labels} box to contain some horizontal skips, but that box is never used. As a result this generates an issue in some circumstances if the typesetting direction @@ -603,7 +604,7 @@ now allowed. \subsection{Spacing commands moved from \pkg{amsmath} to the kernel} Originally \LaTeX{} only provided a small set of spacing commands for use in text and math; some of the commands like \cs{;} were -only supported in math mode. \texttt{amsmath} normalized and +only supported in math mode. \pkg{amsmath} normalized and provided all of them in text and math. This code has now been moved to the kernel so that it is generally available. \begin{center} @@ -690,9 +691,9 @@ by code parsing BoundingBox comments. The package now locally sets \githubissue{286} \subsection{Files with multiple parts} -Sometimes one has a graphics file, say, \texttt{file.svg}, and converts +Sometimes one has a graphics file, say, \file{file.svg}, and converts it to another format to include it in \LaTeX{} and ends up with a file -named \texttt{file.svg.png}. In previous releases, if the user did +named \file{file.svg.png}. In previous releases, if the user did \verb|\includegraphics{file.svg}|, an error would be raised and the graphics inclusion would fail due to the unknown \verb|.svg| extension. The \pkg{graphics} package now checks if the given extension is known, and if @@ -746,7 +747,7 @@ corrected. \subsection{\pkg{varioref}: Support Japanese as a language option} -The package now recognizes \texttt{japanese} as a language option. +The package now recognizes \option{japanese} as a language option. The extra complication is that for grammatical reasons \cs{vref}, \cs{Vref}, \cs{vrefrange} and \cs{fullref} need a structure different from all other languages currently supported. To accommodate this, @@ -778,9 +779,9 @@ were not at the same baseline. This has been corrected. % \githubissue{126} -\subsection{Fixes to \texttt{aligned} and \texttt{gathered}} +\subsection{Fixes to \env{aligned} and \env{gathered}} -The environments \texttt{aligned} and \texttt{gathered} have a +The environments \env{aligned} and \env{gathered} have a trailing optional argument to specify the vertical position of the environment with respect to the rest of the line. Allowed values are \texttt{t}, \texttt{b} and \texttt{c} but the code only tested for @@ -804,7 +805,7 @@ commands to define \cs{std@minus} and \subsection{Use Lua\TeX{} primitives where applicable} For a number of years \pkg{lualatex-math} patched \cs{frac}, -\cs{genfrac} and the \texttt{subarray} environment to make use of new +\cs{genfrac} and the \env{subarray} environment to make use of new lua\TeX{} primitives. This code has now been integrated into \pkg{amsmath}. diff --git a/macros/latex/base/ltnews33.pdf b/macros/latex/base/ltnews33.pdf Binary files differindex da3de0452d..d0add03ed8 100644 --- a/macros/latex/base/ltnews33.pdf +++ b/macros/latex/base/ltnews33.pdf diff --git a/macros/latex/base/ltnews33.tex b/macros/latex/base/ltnews33.tex index 899650c693..39af4f1b72 100644 --- a/macros/latex/base/ltnews33.tex +++ b/macros/latex/base/ltnews33.tex @@ -101,7 +101,7 @@ \@startsection {subsubsection}{2}{0pt}{1.5ex \@plus 1ex \@minus .2ex}% {-1em}{\@subheadingfont\colonize}% } -\newcommand\colonize[1]{#1:} +\providecommand\colonize[1]{#1:} \makeatother \let\finalvspace\vspace % for document layout fixes @@ -141,7 +141,7 @@ sections. Subsequent sections describe quite a number of recent smaller enhancements and fixes. As usual, more detail on individual changes -can be found in the \texttt{changes.txt} files in the distribution +can be found in the \file{changes.txt} files in the distribution and, of course, in the documented sources~\cite{33:source2e}. @@ -186,7 +186,7 @@ In practice, these new generic \hook{cmd} hooks, especially the \hook{cmd/.../after}, hooks may fail with commands that are too complex to be automatically patched, breaking if the hook contains any code. These restrictions are documented in -\texttt{ltcmdhooks-doc.pdf}. +\file{ltcmdhooks-doc.pdf}. % However, given that these hooks are mainly meant for developers who wish to provide better interoperability between different packages, @@ -354,7 +354,7 @@ may otherwise happen due to the order of declarations. \subsection{Improved copy\,\&\,paste for \pdfTeX{} documents} When compiling with \pdfTeX{}, additional information -(from the file \texttt{glyphtounicode.tex}) is now added automatically +(from the file \file{glyphtounicode.tex}) is now added automatically to the PDF file in order to improve copying from, and searching in, text. @@ -586,7 +586,7 @@ or symbol. This is now easily possible by placing a \cs{label} within the referenced \cs{footnote} and referencing this label by using the new command \cs{footref}. This means that footnote marks can be generated to refer to arbitrary footnotes (including those in -\texttt{minipage}s). +\env{minipage}s). This \cs{footref} command has previously been available, but only when using certain classes or the \pkg{footmisc} package. @@ -617,7 +617,7 @@ This change also fixed one anomaly present in the past: in a tabular preamble of the form \finalvspace*{-.3\baselineskip} \begin{quote} - \hspace*{-.15em}\verb={l=\texttt{\string>}\verb={raggedright}p{10cm}r}= % stupid class + \hspace*{-.15em}\verb={l=\texttt{\string>}\verb={\raggedright}p{10cm}r}= % stupid class \end{quote} \finalvspace*{-.3\baselineskip} a \cs{\textbackslash} in the second column would have the definition @@ -859,7 +859,7 @@ being loaded with \cs{includegraphics}. This has been fixed so that \subsection{\pkg{layout}: Added language options} -This package now recognizes \texttt{japanese} and \texttt{romanian} as +This package now recognizes \option{japanese} and \option{romanian} as language options. % \githubissue[s]{353 and 529} diff --git a/macros/latex/base/ltnews34.pdf b/macros/latex/base/ltnews34.pdf Binary files differnew file mode 100644 index 0000000000..a8f0d791fa --- /dev/null +++ b/macros/latex/base/ltnews34.pdf diff --git a/macros/latex/base/ltnews34.tex b/macros/latex/base/ltnews34.tex new file mode 100644 index 0000000000..badd25b97c --- /dev/null +++ b/macros/latex/base/ltnews34.tex @@ -0,0 +1,868 @@ +% \iffalse meta-comment +% +% Copyright 2019-2021 +% The LaTeX Project and any individual authors listed elsewhere +% in this file. +% +% This file is part of the LaTeX base system. +% -—————————————— +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% https://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008 or later. +% +% This file has the LPPL maintenance status "maintained". +% +% The list of all files belonging to the LaTeX base distribution is +% given in the file `manifest.txt'. See also `legal.txt' for additional +% information. +% +% The list of derived (unpacked) files belonging to the distribution +% and covered by LPPL is defined by the unpacking scripts (with +% extension .ins) which are part of the distribution. +% +% \fi +% Filename: ltnews34.tex +% +% This is issue 34 of LaTeX News. + +\NeedsTeXFormat{LaTeX2e}[2020-02-02] + +\documentclass{ltnews} + +%% Maybe needed only for Chris' inadequate system: +\providecommand\Dash {\unskip \textemdash} + +%% NOTE: Chris' preferred hyphens! +%%\showhyphens{parameters} +%% \hyphenation{because parameters parameter} + +\usepackage[T1]{fontenc} + +\usepackage{lmodern,url,hologo} + +\usepackage{csquotes} +\usepackage{multicol} + +\providecommand\hook[1]{\texttt{#1}} + +\providecommand\meta[1]{$\langle$\textrm{\itshape#1}$\rangle$} +\providecommand\option[1]{\texttt{#1}} +\providecommand\env[1]{\texttt{#1}} +\providecommand\Arg[1]{\texttt\{\meta{#1}\texttt\}} + + +\providecommand\eTeX{\hologo{eTeX}} +\providecommand\XeTeX{\hologo{XeTeX}} +\providecommand\LuaTeX{\hologo{LuaTeX}} +\providecommand\pdfTeX{\hologo{pdfTeX}} +\providecommand\MiKTeX{\hologo{MiKTeX}} +\providecommand\CTAN{\textsc{ctan}} +\providecommand\TL{\TeX\,Live} +\providecommand\githubissue[2][]{\ifhmode\unskip\fi + \quad\penalty500\strut\nobreak\hfill + \mbox{\small\slshape(% + \href{https://github.com/latex3/latex2e/issues/\getfirstgithubissue#2 \relax}% + {github issue#1 #2}% + )}% + \par\smallskip} +%% But Chris has to mostly disable \href for his TEXPAD app: +%% \def\href #1{} % Only For Chris' deficient TeX engine + +% simple solution right now (just link to the first issue if there are more) +\def\getfirstgithubissue#1 #2\relax{#1} + +\providecommand\sxissue[1]{\ifhmode\unskip\fi + \quad\penalty500\strut\nobreak\hfill + \mbox{\small\slshape(\url{https://tex.stackexchange.com/#1})}\par} + +\providecommand\gnatsissue[2]{\ifhmode\unskip\fi + \quad\penalty500\strut\nobreak\hfill + \mbox{\small\slshape(% + \href{https://www.latex-project.org/cgi-bin/ltxbugs2html?pr=#1\%2F\getfirstgithubissue#2 \relax}% + {gnats issue #1/#2}% + )}% + \par} + +\let\cls\pkg +\providecommand\env[1]{\texttt{#1}} +\providecommand\acro[1]{\textsc{#1}} + +\vbadness=1400 % accept slightly empty columns + + +\makeatletter +% maybe not the greatest design but normally we wouldn't have subsubsections +\renewcommand{\subsubsection}{% + \@startsection {subsubsection}{2}{0pt}{1.5ex \@plus 1ex \@minus .2ex}% + {-1em}{\@subheadingfont\colonize}% +} +\providecommand\colonize[1]{#1:} +\makeatother + +\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} + +\publicationissue{34} + +\begin{document} + +\tubcommand{\addtolength\textheight{4.2pc}} % only for TUB + +\maketitle +{\hyphenpenalty=10000 \spaceskip=3.33pt \hbadness=10000 \tableofcontents} + +\setlength\rightskip{0pt plus 3em} + + +\medskip + + +\section{Introduction} + + +This release of \LaTeX{} does not contain any major new modules, but +is focused around consolidation and improvements of the functionality +introduced in previous releases. In addition, various smaller +enhancements and bug fixes have been added to the kernel and the core +packages. + + +\section{Hook business} + +Since 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 this new functionality. One result +of this increased activity has been a +number of queries which show that some of the documentation was not +precise enough and that some clarifications were needed; these +deficiencies have now been addressed in the documentation. +% +The increased usage has also revealed +a small number of errors that we thought +should be corrected now, while the adoption rate is still relatively +small; the following problems have therefore been addressed in this release. + + +\subsection{Provide \cs{ActivateGenericHook}} + +The hook management system offers a number of generic hooks, i.e., +hooks whose names contain a variable component such as the name +of an environment. Predeclaring such hooks is not feasible, +so these hooks use a different mechanism: they are +implicitly available, springing into life the moment a package, or +the document preamble, adds any code to one by using \cs{AddToHook}. +% +The kernel offers such hooks for environments + (\texttt{env/...}) and commands (\texttt{cmd/...}), and also for files, + packages and classes (\texttt{file/...}, +\texttt{include/...}, \texttt{package/...}, \texttt{class/...}). + +It is also possible to offer such generic hooks in +packages if, for example, hooks are needed that depend on the +current language and therefore need the +language name as part of the hook name (but you probably +don't know beforehand all the necessary names). + +If you want to offer such generic hooks, you can now +do this by using +\cs{UseHook} or \cs{UseOneTimeHook} in your (package) code, but +\emph{without declaring the hook} with \cs{NewHook}. However, without +further work, a call to \cs{UseHook} with an undeclared hook name +will do +nothing; so, as an additional setup step, it is necessary to explicitly +activate the generic hook by using \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.} + +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 \hook{babel/\meta{language}/afterextras} +that enable a user +to add language specific declarations to these \enquote{extras}. One can then write +\begin{verbatim} + \ActivateGenericHook + {babel/ngerman/afterextras} + \AddToHook{babel/ngerman/afterextras} + {\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{Standardized names for the generic hooks} + +The initial set of generic hooks provided by the kernel had +two patterns of 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 the variable part was +supposed to go; and it also made the code more complicated and slower. + +The file-related hooks have therefore been renamed +so that the variable part of +the name is in the middle, as with all other hooks. +The changes are listed here: +\smallskip +\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} +\smallskip +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; +but 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{Some file hooks made one-time} + +Classes, packages and included files can only be loaded once in a +\LaTeX{} document. For this reason, the hooks that are specific to loading such +files have been made one-time hooks. Beside being more efficient, this +supports the following important use case +{\hfuzz=1pt \begin{verbatim} + \AddToHook{package/varioref/after} + {... apply when the package gets loaded, + or apply now (if it is already loaded) ...} +\end{verbatim} +} +\noindent +without the need to first test whether the package is already loaded. +% +\githubissue{623} + + +\subsection{Clearing extra hook code for the next invocation} + +There are a few use cases where it is 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 now provided. +% +\githubissue{565} + + + +\subsection{Cleaning up after \cs{UseOneTimeHook}} + +Some hooks are meant to be used only once in a document, and any +further attempt to add code to one of these will +cause 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 cases (such as the \hook{begindocument} hook) but it causes +trouble if the one-time hook was intended, for example, as an +initialization hook that is used just once (when a command is first +called) but is then ignored in further calls. + +This deficiency has been addressed, and now a one-time +hook will only be executed once, with +its code being removed after use to free up some memory. +% +\githubissue{565} + + +\subsection{\cs{RemoveFromHook} with a missing code label} + +In the first version of \cs{RemoveFromHook}, when the code label +to be removed didn't exist in the hook a ``removal order'' would be +queued; and then, the next time something tried to add that label to the hook, +this \cs{AddToHook} action would be cancelled by the removal order, so that no code +would be added that one time. This was so that, in principle, package loading +order wouldn't matter. +% +However, this implementation didn't work as +intended because, while two \cs{AddToHook} actions with a given label would be +removed by a single \cs{RemoveFromHook}, one \cs{RemoveFromHook} could +not cancel two \cs{AddToHook} actions for that label; this caused +confusion and also led to further problems. + +The implementation has now been changed, so that +\cs{RemoveFromHook} removes only code +labels that already exist in a hook: it will display a +warning if there is no such code label. + +Note that, whereas when working with a single package +you should use \cs{RemoveFromHook} to remove a code label, +when working with more than one package, the +\texttt{voids} relation should preferably be used. +% +This is best because this relation is non-destructive +(meaning that it can be reverted later by using another relation), +and it is also truly independent of package loading order. +% +\githubissue{625} + +\subsection{Patching commands with parameter tokens} + +In the last release, \LaTeX's hook mechanism was extended to add +support for hooking into commands using generic \hook{cmd} hooks +(see~\cite{34:ltnews33}). That version of the extension had a bug: the +patching of some commands that contained a parameter token +(normally \verb|#|) in +their definition would fail with a low-level \TeX{} error. This has now +been fixed so that patching now works for those commands as well. +% +\githubissue{697} + + + +\section{New or improved commands} + +\subsection{\cs{NewCommandCopy} and \cs{ShowCommand} extended} + +Since the 2020-10-01 release (see~\cite{34:ltnews32}), \LaTeX{} +has provided \cs{NewCommandCopy} to copy robust commands, +and \cs{ShowCommand} to show their definitions on the terminal. +% +In that same release, the \pkg{xparse} package was integrated +into the kernel (as \pkg{ltcmd}) to offer \cs{NewDocumentCommand}, etc. +% +However, the extended support for \cs{NewCommandCopy} and +\cs{ShowCommand} was not implemented in \pkg{ltcmd}. The present +\LaTeX{} release implements this support, so now commands +defined with \cs{NewDocumentCommand} and friends can also be copied, and their definitions +can be easily shown on the terminal without the need for ``\cs{csname} gymnastics''. +% +\githubissue{569} + + +\subsection{Undo math alphabet allocations if necessary} + +\TeX{}, or more exactly the 8-bit versions of \TeX, such as \pdfTeX{}, +have a hard limit of 16 on the number of different math font groups +(\cs{fam} or \cs{mathgroup}) that can be used in a single formula. For each symbol font +declared (by a package or in the preamble) an extra math group is allocated, +and the same happens for each math alphabet, (such as \cs{mathbf}) +once it +gets used anywhere in the document. Up to now, these math +alphabet allocations were permanent, even if they were +used only once; +the result was that in complex documents you +could easily run out of available math font groups. +The only remedy for this was to +define your own math version, which is a complicated and cumbersome process. + +This situation has now been improved by the introduction of a new counter +\texttt{localmathalphabets}: this counter governs how many of +the math group slots are assigned locally when a new math +alphabet (and a new math group) is needed. +% +Once the current formula is finished, every such further (local) +allocation is undone, giving you a fighting chance of being +able to use different new math alphabets in the next formula. + +The default value of \texttt{localmathalphabets} is 2, +but if you need more local alphabets because of the complexity of your +document, you can set this to a higher value such as 4 or 5. +Setting it even higher is possible, but this would seldom +be useful because many group slots will be taken up by +symbol fonts and such slots are always permanently allocated, +whether used or not. +% +\githubissue{676} + + +\subsection{New default value for \cs{tracinglostchars}} + +In 2021 all \TeX{} engines were enhanced so that \cs{tracinglostchars} +supported the value \texttt{3} to turn missing +characters into errors and not just warnings. +% +This engine change made us +realize that \LaTeX{} should set a better default value for this parameter +(previously, the warning was written only to the transcript file). +Using the now available value of \texttt{3} as the default +would be ideal, but for +compatibility reasons we have only increased it to \texttt{2} in the kernel. +% +However, we recommend setting \cs{tracinglostchars}\texttt{=3}, +in either a package or the +preamble of your documents: this is because having missing glyphs +in the output is definitely an error and should therefore be +flagged as such (to ensure that it gets proper attention). +Further reasons, related especially to Unicode engines, for making +this recommended change are explained later in this newsletter +(in connection with the misuse of text accents in math mode). + + + +\subsection{\cs{PackageNote} and \cs{ClassNote} added} + +\LaTeX{} offers these three commands: \cs{PackageError} to signal errors that +stop the processing; \cs{PackageWarning} to generate a warning message on the +terminal but continue with the processing; and \cs{PackageInfo} +to provide some information that is only written to the \texttt{.log} +file but not sent to the terminal. +% +What has not existed up to now is a way to provide +information on the terminal that identifies itself as coming from +a specific package but which does not claim to be a warning. +(Packages that wanted to write to the terminal used \cs{PackageWarning} +even though the information was not in fact a warning.) + +We have therefore now added \cs{PackageNote} (and the closely +related \cs{PackageNoteNoLine}); these identify +themselves as \enquote{informational}, but they still go to the terminal and +not only to the \texttt{.log} file. +% +Similar commands exist for classes and so there too we have +new commands: \cs{ClassNote} and \cs{ClassNoteNoLine}. +% +\githubissue{613} + + +\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 in +understanding 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 the contents of a float register, 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{New argument for \cs{counterwithin}/\texttt{without}} + +The commands \cs{counterwithout} and \cs{counterwithin} each now has +an additional optional argument, similar to that of the command + \cs{numberwithin} from \pkg{amsmath}, +for which these are now the preferred replacements. +This optional argument +specifies the format of the counter, such as \cs{roman}; +the default value is \cs{arabic}. + + +\subsection{Tests for package and class loading} + +To test whether a package has been 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 whether 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 one or more options in +the \meta{option-list} were +not specified when loading the package, or if the package +has never been loaded. +% +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, with \texttt{Package} replaced by +\texttt{Class} in the name, are provided. +% +\githubissue{621} + + +\subsection{Better handling for a misuse of \cs{include}} + +The command \cs{include} has by now been used quite often, but +erroneously, to input a variety of files in the preamble of the document +(before \verb|\begin{document}|). +% +Therefore \LaTeX\ now warns about such bad use of \cs{include}. +As a recovery action it will nevertheless input the specified file +if it exists (this is as before). Note, however, that this is now done +without any adjustments to the \texttt{.aux} file settings and +without running the \cs{include} file hooks (only the generic +file hooks from \cs{InputIfFileExists} are run). +% +\githubissue{645} + + + +\section{Code improvements} + + +\subsection{Use OpenType version of Latin Modern Upright Italic font} +When a Latin Modern font is used with the TU encoding under \XeTeX\ or \LuaTeX\ +and fontshape \texttt{ui} is requested, \LaTeX\ now uses the OpenType +version of the font instead of substituting the (T1-encoded) Type 1 version. + + +\subsection{Additional Extended Latin characters predefined} +More characters, such as \'k (U+1E131), are now pre-defined and +do not need a \verb|\DeclareUnicodeCharacter| declaration. +% +\githubissue{593} + + +\subsection{Check \cs{endfoo} in \cs{NewDocumentEnvironment}} + +The \cs{newenvironment} command has always checked that neither \cs{foo} nor +\cs{endfoo} exists before creating a \texttt{foo} environment. +In contrast (for historical reasons) the more recently introduced +command \cs{NewDocumentEnvironment} +checked only for \cs{foo}. +% +The behavior of \cs{NewDocumentEnvironment} now aligns with that +of \cs{newenvironment}, except that it gives distinct errors +concerning the existence of \cs{foo} and \cs{endfoo}. + + +\subsection{Improve the error + message \texttt{\textup{\cs{begin} ended by \textellipsis}}} + +In the past it was possible to get an error message along the lines +of ``\verb=\begin{foo} ended by \end{foo}=''. This could happen when the +environment name was partly hidden inside a macro. It happened because +the test was comparing the literal strings, whereas in the error message +these got fully expanded. +% +This has now been changed to show a more sensible error +message. +% +\githubissue{587} + + +\subsection{Pick up all arguments to \cs{contentsline}} + +A \cs{contentsline} command in the \texttt{.toc} file is always followed by +four arguments, the last one being empty except when using the +\pkg{hyperref} package. The \cs{contentsline} command itself only used the +first three arguments and it relied on the fourth being empty (and thus +doing no harm). +% +But this assumption is not always correct: e.g., if +you at first decide to load \pkg{hyperref} but then later you remove +this loading from the preamble. +% +So now all four arguments are picked up, with the +fourth being saved away so that it can be used by \pkg{hyperref}. +% +\githubissue{633} + + +\subsection{Allow dropping a math list in \LuaTeX\ callback} + +The \LuaTeX\ callbacks \texttt{pre\_mlist\_to\_hlist\_filter} +and \texttt{post\_mlist\_to\_hlist\_filter} no longer create an error when +the callback handler indicates removal of the entire math list. +% +\githubissue{644} + +\subsection{Extended label handling in package code} + +Since 2020, as noted in \LaTeX\ News 32~\cite{34:ltnews32}, \LaTeX\ has +recorded the name of the counter associated with the current label in +the internal command \cs{@currentcounter}. This facility (originally +from the \pkg{zref} package of Heiko Oberdiek) can be used to generate +prefixes such as \enquote{Figure} before the reference text, +as long as the counter is not counting different objects in a single sequence (e.g., lemmas and theorems). +% +In the most +common cases the current label is set by \cs{refstepcounter}, which +automatically stores the counter name; but some constructs (alignments +and footnotes) may need to store the current label directly and so for +these it is useful to update additionally \cs{@currentcounter} so as to +store this counter name. + +In this release both the footnote command in the kernel and +also some of the environments in the \pkg{amsmath} package +have been updated in this way. +% +We encourage the maintainers of any class or +package files that define \cs{@currentlabel} to also set +\cs{@currentcounter} at the same point. +% +\githubissue{300, 687} + + +\subsection{Better message if text accent used in math mode} + +Using text accents like \verb|\^| in math does not work +(and \TeX{} explicitly provides math accents such as \cs{hat} +for accessing such symbols in math mode). Therefore \LaTeX\ issued a +warning when such a wrongly placed accent was encountered +and this was often followed by a strange, and apparently +unrelated, low-level error. +% +This has now been changed so that the message from this +error is at least about accents, which we hope is less puzzling. + +Discussion of such warnings or errors reminds us to reinforce +here a recommendation from earlier in this newsletter, as part +of the item on the value of \cs{tracinglostchars}. +% +Using \TeX\ implementations from 2020 onwards, any warning that +concerns missing characters can be +converted to an error by setting \cs{tracinglostchars} to 3; we therefore +now recommend changing this setting to 3, especially for +Unicode engines where such missing characters are common (because +no font supports the full Unicode range). +% +\githubissue{643} + + +\section{Bug fixes} + +\subsection[Replicate argument processors for all + embellishments in command declarations] + {Replicate argument processors for all embellishments in command declarations} + +There was a bug in \pkg{ltcmd} (formerly \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 and thus leading to unpredictable +behavior. This bug has been fixed by applying the same argument +processors to all the embellishments in a set, so that 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 changing of \cs{ij} and \cs{IJ}} + + +The ligatures \enquote{\ij} and \enquote{\IJ}, as used in Dutch, +are available (for most \TeX{} fonts) only +when the commands \cs{ij} or +\cs{IJ} are used, or when you enter them as the Unicode 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 using the \texttt{OT1} encoding). +% +\githubissue{658} + + + +\subsection{Legacy font series default 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: +with this declaration you can alter the default for individual meta +font families by, for example, changing the bold setting only 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, this alters the setting +for all meta families in one go. This alteration cannot be done when the +\cs{renewcommand} happens and it 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} in +the meantime was overwritten; thus, these two approaches didn't +work well in combination. +There was a problem because older font packages +use the legacy method while newer ones use +\cs{DeclareFontSeriesDefault}. + +This has now been resolved by changing +\cs{DeclareFontSeriesDefault} to do any necessary resetting prior to +setting the new defaults. +% +\githubissue{663} + + +\subsection{Use of \texttt{\textup{\#}} in \cs{textbf} and similar commands} +Previously you could not use the macro parameter character \texttt{\#} +in inline functions +within the argument of \cs{texbf} or similar text font commands. +An internal definition is now guarded with \cs{unexpanded} +so that the use of \texttt{\#} here no longer generates an error. +% +\githubissue{665} + + + +\section{Changes to packages in the \pkg{amsmath} category} +\subsection{Improved compatibility with \pkg{hyperref}} + +This change in \pkg{amsmath} fixes a spacing problem caused by the +method used in \pkg{hyperref} to change the \env{equation} environment. +% +For simplicity, an explicit, low-level (hence possibly temporary) +patch has been added to \pkg{amsmath}: this consists +of an extra, empty (hence invisible) +\cs{mathopen} atom (with no mathematical meaning) at the start of the +environment's mathematical content. +% +\githubissue{652} + + + +\section{Changes to packages in the \pkg{graphics} category} + + +\subsection{\pkg{graphicx}:\ New key, for alt text} + +A new key, \texttt{alt}, has been added to \cs{includegraphics} to +support the addition of descriptive text that is important for +accessibility. This key is unused by default; it can be deployed by +extension packages and it will provide useful support for other future +possibilities. +% +\githubissue{651} + + +\section{Changes to packages in the \pkg{tools} category} + +\subsection{\pkg{array}: No \cs{mathsurround} around a \env{tabular}} + +A \env{tabular} environment is typeset (internally) as an \env{array} +environment with special settings, and it therefore uses (hidden) math mode. +Since it is not in fact a math formula, +no extra space from \cs{mathsuround} should be added +(the spacing around the \env{tabular} should not get changed). +% +Note that this bug has been present ``forever'', which shows that \cs{mathsurround} +is never used, or at least its use is never noticed. +At any rate, this bug has now finally been fixed. +% +\githubissue{614} + + +\subsection{\pkg{longtable}: Improvements after a section heading} +The \env{longtable} environment now sets the \cs{@nobreakfalse} flag +to correct the typesetting when a table immediately follows a heading. +Previously the spacing and indentation changes that are required +immediately after a section heading were incorrectly triggered +within the next paragraph (if any) +following the table. +% +A similar test for +\cs{if@noskipsec} has been added, so that a table is correctly placed after +a run-in heading rather than appearing before that heading. +% +\githubissue[s]{131 and 173} + + +\subsection{\pkg{multicol}: Better column break control} + +From version 1.9 onwards \cs{columnbreak} accepts an optional +argument (like \cs{pagebreak}) in which you can specify the +desirability of breaking the column after the current line: supported values are +\texttt{0} to \texttt{4}, with higher numbers indicating increased desirability. +This version also adds \cs{newcolumn}, +which forces a break but runs the column short (comparable to +\cs{newpage} for pages). +% +\githubissue{682} + + +\subsection{\pkg{varioref}: Improved handling of missing labels} + +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, this data structure changes to having five +arguments; this could cause low-level errors in some cases. +The code has therefore now been changed to avoid these errors. +% +\sxissue{603948} + + +\medskip + +\begin{thebibliography}{9} + +\fontsize{9.3}{11.3}\selectfont + +\bibitem{34:blueprint} Frank Mittelbach and Chris Rowley: + \emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\ + \url{https://latex-project.org/publications/indexbyyear/2020/} + +\bibitem{34:source2e} + \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} + +\bibitem{34:ltnews33} \LaTeX{} Project Team: + \emph{\LaTeXe{} news 33}.\\ + \url{https://latex-project.org/news/latex2e-news/ltnews33.pdf} + +\end{thebibliography} + + + +\end{document} + + diff --git a/macros/latex/base/ltoutenc.dtx b/macros/latex/base/ltoutenc.dtx index eb2ecd1e53..61ea381823 100644 --- a/macros/latex/base/ltoutenc.dtx +++ b/macros/latex/base/ltoutenc.dtx @@ -44,7 +44,7 @@ %<*driver> % \fi \ProvidesFile{ltoutenc.dtx} - [2021/04/29 v2.0v LaTeX Kernel (font encodings)] + [2021/10/16 v2.0x LaTeX Kernel (font encodings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutenc.dtx} @@ -199,7 +199,7 @@ % commands, such as accents. It also contains the code for some of % the encoding files, including |omlenc.def|, % |omsenc.def|, |t1enc.def| and |ot1enc.def| files, which define -% the |OLM|, +% the |OML|, % |OMS|, |T1| and |OT1| encodings, and the |fontenc| package % for selecting encodings. % @@ -845,10 +845,11 @@ % We also ignore \cs{ignorespaces} which has the same issue and may % show up as part of \cs{normalfont} if that is used. % \changes{v2.0m}{2019/12/18}{Avoid code that breaks \cs{accent}} +% \changes{v2.0x}{2021/10/16}{Dont set \cs{spacefactor in math mode gh/643}} % \begin{macrocode} \let\maybe@load@fontshape\relax \let\ignorespaces\relax - \accent#1 #2\egroup\spacefactor\accent@spacefactor} + \accent#1 #2\egroup\ifmmode\else\spacefactor\accent@spacefactor\fi} % \end{macrocode} % % @@ -1783,12 +1784,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/macros/latex/base/ltoutput.dtx b/macros/latex/base/ltoutput.dtx index b1b3a24096..78b0f2335f 100644 --- a/macros/latex/base/ltoutput.dtx +++ b/macros/latex/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/macros/latex/base/ltpara-code.pdf b/macros/latex/base/ltpara-code.pdf Binary files differindex 4f87f3b7c1..1531091f49 100644 --- a/macros/latex/base/ltpara-code.pdf +++ b/macros/latex/base/ltpara-code.pdf diff --git a/macros/latex/base/ltpara-doc.pdf b/macros/latex/base/ltpara-doc.pdf Binary files differindex 0c34ecea59..cf53ced8eb 100644 --- a/macros/latex/base/ltpara-doc.pdf +++ b/macros/latex/base/ltpara-doc.pdf diff --git a/macros/latex/base/ltpara.dtx b/macros/latex/base/ltpara.dtx index 5ab52a5e9b..a2da67198a 100644 --- a/macros/latex/base/ltpara.dtx +++ b/macros/latex/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.0k} +\def\ltparadate{2021/11/11} % \end{macrocode} %<*driver> \documentclass{l3doc} @@ -23,6 +23,7 @@ %\usepackage{ltpara} % Fixing footnotes in functions and variables: this should be in l3doc! + \newcommand\fixfootnote[2]{\footnotemark \AddToHookNext{env/#1/after}{\footnotetext{#2}}} \AddToHook{env/function/begin}{\def\footnote{\fixfootnote{function}}} @@ -122,8 +123,8 @@ % \verb=\hbox{a\par b}= is ignored, but \verb=$a\par b$= would complain. % % If this primitive ends the paragraph it does some special -% \enquote{end of horizontal list} processing, then calls \TeX{} paragraph -% builder that breaks the horizontal list into lines then these +% \enquote{end of horizontal list} processing, then calls \TeX{}’s paragraph +% builder; this breaks the horizontal list into lines and then these % lines are added as boxes to the enclosing vertical list and % \TeX{} returns to vertical mode. % @@ -133,13 +134,14 @@ % automatically changed to a \cs{par} command which is then % executed. The other possibility is that \TeX{} encounters a % command which is incompatible with horizontal processing, e.g., -% \cs{vskip} (a request for adding vertical space). In such case it +% \cs{vskip} (a request for adding vertical space). In such cases it % silently backs up, and inserts a \cs{par} in the hope that this -% gets it out of horizontal mode and makes the offending command +% gets it out of horizontal mode and makes the vertical command % acceptable. % The important point to note here is that \TeX{} really inserts -% the command \cs{par} which can be redefined. Thus, it may not have +% the command with the name \cs{par}, which can be redefined. +% Thus, it may not have % its original \enquote{primitive} meaning and therefore may not end the % horizontal list and call the paragraph builder. This approach % offers some flexibility but also allows you to easily produce a @@ -151,31 +153,30 @@ % then sees \cs{vskip} and inserts \cs{par} to end the % paragraph. But this now only runs \cs{relax} so nothing changes % and \cs{vskip} is read again, issues a \cs{par} which \ldots. In -% short, it takes a plain \TeX{} document with five tokens to run -% forever (as not even memory is consumed and therefore eventually +% short, it only takes a plain \TeX{} document with five tokens to run +% forever (since no memory is consumed and therefore eventually % exhausted). % -% There are no other ways than changing \cs{par} to gain control at +% There is no way other than changing \cs{par} to gain control at % the end of a paragraph, i.e., there is no token list like -% \cs{everypar} that is inserted, i.e., the only way to change the -% default behavior is to modify the action that \cs{par} executes +% \cs{everypar} that is inserted. Hence the only way to change the +% default behavior is to modify the action that \cs{par} executes, % with similar issues as outlined before: different processes need % to ensure that they do not overwrite their modifications or % worse, think that the \cs{par} in front of them is the engine % primitive while in fact it has already been changed by other % code. % -% % To make matters slightly worse there are a few places where % \TeX{} handles the situation differently (most likely for speed % reasons back when computers were much slower). If \TeX{} finds % itself in unrestricted horizontal mode at the end of building a -% vertical box (or an \cs{insert}, \cs{vadjust} or at the end of +% vertical box (for an \cs{insert}, \cs{vadjust} or % executing the output routine code), it will finish the horizontal % list not by issuing a \cs{par} command (which would be consistent -% with all other places, but by simply executing the primitive version -% of \cs{par} regardless of the definition that \cs{par} has at the -% time. +% with all other places) but by simply executing the primitive meaning +% of \cs{par}, regardless of the actual definition that \cs{par} +% has at the time. % % Thus, if you have carefully crafted a redefined \cs{par} to execute % some special actions at the end of a paragraph and you write @@ -183,27 +184,28 @@ %\begin{verbatim} % \vbox{Some paragraph ... text.} %\end{verbatim} -% you will find that your code has never run for the last paragraph +% you will find that your code does not get run for the last paragraph % in that box. \LaTeX{} avoids this problem, by making sure that -% all its boxes (such as \cs{parbox} or the \env{minipage} +% its boxes (such as \cs{parbox} or the \env{minipage} % environment, etc.) all internally add an explicit \cs{par} at the % end so that such code is run and \TeX{} finds itself in vertical % mode already without the need to start up the paragraph builder % internally. But, of course, this only works for boxes under direct -% control of the \LaTeX{} kernel, if some package uses low-level +% control of the \LaTeX{} kernel; if some package uses low-level % \cs{vbox}es without adding this precaution the \TeX{} % optimization kicks in and no special \cs{par} code is executed. % % And there is another optimization that is painful: if a paragraph % is interrupted by a mathematical display, e.g., \verb=\[...\]= in % \LaTeX{} or \verb=$$...$$= in plain \TeX{}, then \TeX{} will -% resume horizontal mode afterward, i.e., build a new horizontal -% list (without inserting an indentation box or \cs{everypar} at -% that point). However, if that list immediately ends with an +% resume horizontal mode afterward, i.e., it will start to build +% a new horizontal +% list without inserting an indentation box or \cs{everypar} at +% that point. However, if that list immediately ends with an % explicit or implicit \cs{par} then \TeX{} will simply throw away % this \enquote{null} paragraph and not do its usual \enquote{end -% of horizontal list} processing, so this special case need to be -% accounted for when introducing some extended processing. +% of horizontal list} processing, so this special case also needs to be +% accounted for when introducing any extended processing. % % % @@ -214,8 +216,8 @@ % the start and end of the paragraph processing. The public hooks % can be used by packages (or by the user in the preamble or % within the document) and using the hook mechanisms it is possible -% to reorder or arrange code from different packages in a way that -% it can safely coexist. +% to reorder or arrange code from different packages in such a way that +% these can safely coexist. % % To make that happen we have to make use of the basic % functionality that is offered by \TeX{}, e.g., we install @@ -248,7 +250,7 @@ % Fortunately, \LaTeX{} has already redefined \cs{par} for its own % purposes. As a result there aren't many packages that attempt to % change \cs{par}, because without a lot of extra care that would -% fail miserably. But bottom line, if you load a package that +% fail miserably. But the bottom line is that, if you load a package that % alters \cs{par} then the end of paragraph hooks are most likely % not executing while that redefinition is % active.\footnote{Similarly to the \cs{everypar} situation, the @@ -326,7 +328,7 @@ % % This hook is executed at the end of a paragraph when \TeX{} is % ready to return to vertical mode and after it has removed the -% last horizontal glue (but not kern) placed on the horizontal +% last horizontal glue (but not any kerns) placed on the horizontal % list. The code is still executed in horizontal mode so it is % possible to add further horizontal material at this point, but % it should not alter the mode (even a temporary exit from @@ -415,20 +417,20 @@ % \subsection{Altered and newly provided commands} % % \begin{function}{\par,\endgraf,\para_end:} -% An explicit request for ending a paragraph is known in plain -% \TeX{} under the name \cs{endgraf} where it simply calls the -% paragraph primitive (regardless of what \cs{par} may have as its -% current definition). In \LaTeX{} \cs{endgraf} with that behavior -% was also made available. +% An explicit request for ending a paragraph is provided in plain +% \TeX{} under the name \cs{endgraf}, which simply uses the +% primitive meaning (regardless of what \cs{par} may have as its +% current definition). In \LaTeX{} \cs{endgraf} (with that behavior) +% was originally also available. % % With the new paragraph handling in \LaTeX{}, ending a paragraph % means a bit more than just calling the engine's paragraph % builder: the process also has to add any hook code for the end of % a paragraph. Thus % \cs{endgraf} was changed to provide this additional functionality -% (and so by extension \cs{par} subject to its current meaning). +% (along with \cs{par} remaining subject to its current meaning). % -% The \pkg{expl3} name for the functionality is \cs{para_end:}. +% The \pkg{expl3} name for this functionality is \cs{para_end:}. % \end{function} % % \begin{quote} @@ -468,7 +470,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}. @@ -538,7 +540,7 @@ % sequence numbers. This is most easily done using \pkg{expl3} % functions, so we switch over. This is not a very general % implementation, just enough for what we need and a bit of -% \LaTeXe{} thrown in as well. When popping the result gets stored +% \LaTeXe{} thrown in as well. When popping, the result gets stored % in \cs{paracntvalue} and the \cs{ERROR} should never happen % because it means we have tried to pop from an empty stack. %\begin{verbatim} @@ -602,8 +604,8 @@ % % \subsubsection{Mark the first paragraph of each \env{itemize}} % -% The code for this is rather simple. We apply hook code that is -% executed only once inside a hook that is executed at the begin of +% The code for this is rather simple. We supply some code that is +% executed only once inside a hook at the start of % each \env{itemize}. We explicitly change the color back and % forth so that we don't introduce grouping around the paragraph. %\begin{verbatim} @@ -629,7 +631,7 @@ % \subsubsection{Glue items between paragraphs (found with \pkg{fancypar})} % % In the past \LaTeX{} placed two glue items between two -% consecutive paragraph, e.g., +% consecutive paragraphs, e.g., %\begin{verbatim} % text1 \par text2 \par %\end{verbatim} @@ -644,12 +646,12 @@ % \glue(\parskip) 0.0 % \glue(\baselineskip) 5.16669 %\end{verbatim} -% The reason is that we generate a \enquote{fake}'' paragraph to +% The reason is that we generate a \enquote{fake} paragraph to % gain control and safely add the early hooks, but this generates % an additional glue item. That item doesn't contribute anything -% vertically but ifsomebody writes code the unravels a constructed +% vertically but if somebody writes code that unravels a constructed % list using \cs{lastbox}, \cs{unskip} and \cs{unpenalty} then the -% code has to remove one additional glue item or else will fail. +% code has to remove one additional glue item or else it will fail. % % ^^A \subsubsection{} @@ -828,8 +830,8 @@ % % But if we have already replaced it by a token register then all % they do is to give that token register a new name. Thus our code -% in \cs{tex_everypar:D} would call \cs{everypar} (which is their -% now token register) and the code that they added ends up in our +% in \cs{tex_everypar:D} would call \cs{everypar} (which is now their +% token register) and the code that they added ends up in our % token register which is then never used at all. A bit mind % boggling I guess. % @@ -927,7 +929,7 @@ % \end{itemize} % % Unfortunately, \TeX{} has some (these days) unnecessary -% optimization: if a \cs{vbox} ends and \TeX{} is still in +% optimizations: if a \cs{vbox} ends and \TeX{} is still in % horizontal mode it simply exercises the paragraph builder instead % of issuing a \cs{par}. It is therefore necessary for \LaTeX{} to % ensure that this case doesn't happen and all boxes internally @@ -940,11 +942,11 @@ % \texttt{latex.ltx}. For this \LaTeXe{} code has the following % conventions: \cs{@@@@par} and \cs{endgraf} both refer to the % default meaning (in the past this was the initex primitive) while -% \cs{par} is the current meaning which may does something else. +% \cs{par} is the current meaning which maybe does something else. % % -% We are now going to change this default meaning to run -% \cs{para_end:} instead, which ultimately executes the initex +% We are now going to change this default meaning to instead run +% \cs{para_end:}, which ultimately executes the initex % primitive but additionally adds our hooks when appropriate. % This way the change is again transparent to the legacy \LaTeXe{} % code. @@ -953,110 +955,158 @@ % primitive and we achieve this by simply expanding it to the % primitive which is available to us as \cs{tex_par:D}. This way we % don't have to care about whether \TeX{} just does nothing (e.g., -% if in vertical mode already) or generate an error, etc. +% if in vertical mode already) or generates an error, etc. % \begin{macrocode} \cs_new_protected:Npn \para_end: { % \end{macrocode} % +% CCC Maybe needs more explanation. +% TEMP NOTE: What should happen if in outer hmode with an empty hlist? +% % The only case we care about is when we are in horizontal mode % (i.e., doing typesetting) and not also in inner mode (i.e., % making paragraphs and not building an \cs{hbox}. -% \begin{macrocode} +%\begin{verbatim} % \bool_lazy_and:nnT % { \mode_if_horizontal_p: } % { \bool_not_p:n { \mode_if_inner_p: } } % { ... -% \end{macrocode} +%\end{verbatim} % Since this is executed for each and every paragraph in a document -% we try to stay a fast as possible, So we are aren't using the +% we try to stay as fast as possible, so we do not use the % 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 may not be 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(!): it is +% the inserted \cs{lst@vskip} that is actually causing the change of +% mode.This is what 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 that any scanning is first stopped, thus: +% \begin{macrocode} + \scan_stop: +% \end{macrocode} +% % \begin{macrocode} \mode_if_horizontal:TF { \mode_if_inner:F { % \end{macrocode} % In that case the action of the primitive would be to remove the -% last glue (not kern) from the horizontal list constructed to form -% a paragraph then append the a penalty of 10000 and the -% \cs{parfillskip} at the end and pass the whole list to the -% paragraph builder which breaks it into lines and \TeX{} then +% last glue (but no kerns) from the horizontal list (constructed to form +% a paragraph) and then to append a penalty of 10000 and the +% \cs{parfillskip}; it then passes the whole list to the +% paragraph builder, which breaks it into lines and \TeX{} then % returns to vertical mode. % -% What we want to do instead is to add our hook code at the end of -% the horizontal list before that happens and the code is passed to -% the paragraph builder. If there was a glue item at the end then +% What we want to do is to add this hook code at the end of +% the horizontal list before any of the above happens. +% If there was a glue item at the end of the list then % it should get removed before the hook code gets added so we have -% to arrange for its removal ourselves. +% to arrange for this removal. +% +% As in other simular cases, it maybe best to add here +% a \cs{nobreak} in case the hook itself adds glue and thus +% creates a non-explicit and unwanted potential breakpoont. +% On the other hand (as has been argued) the code in the hook +% should perhaps have the responsibility for adding such a +% guard penalty in this casse. +% This needs further analysis and decisions (as in emails). +% +% In either case, good documentation of these hooks is essential, +% covering what the hook may or should provide and all +% such related considerations convernimg the content. % % There is not much point in checking if there was really a glue % item at the end of the horizontal list, instead we simply try to -% remove one using \cs{tex_unskip:D}, if there wasn't one this will +% remove one using \cs{tex_unskip:D}: if there wasn't one this will % do nothing. % \begin{macrocode} \tex_unskip:D % \end{macrocode} -% The we execute the public hook (which may add final typesetting -% material) followed by the kernel hook we need for adding tagging +% We then execute the public hook (which may add some final typeset +% material) followed by the kernel hook that we need for adding tagging % support. None of this is supposed to change the mode---at the % moment we make only a very simple test for this, more devious -% changes go unnoticed, but too bad, that will then probably -% badly backfire. +% changes go unnoticed, but too bad as they will then probably +% backfire badly. % \begin{macrocode} \hook_use:n{para/end} \@kernel@after@para@end \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 -% 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. +% \cs{tex_par:D} is called) is to add an extra glue item so that the +% primitive is prevented from removing intended glue +% (if there was some). If we don't do this and the +% horizontal list ends in several glue items we would end up removing +% two glue items instead of just the last one, which would be wrong. +% We use glue (rather than a kern) as that will be removed by the +% primitive. % % There is however one other \TeX{} optimization that hurts: in a -% sequence like this \verb=$$ ... $$ \par= \TeX{} will be in +% sequence like this \verb=$$ ... $$ \par= (with \cs{par} being the primitive) +% \TeX{} will be in % horizontal mode after the display, ready to receive further % paragraph text, but since the \cs{par} follows immediately there % is a ``null'' paragraph at the end and \TeX{} simply throws that -% away. The space between \verb=$$= and \cs{par} got already +% 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}. +% just containing a penalty and \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 % paragraph. This means that the \cs{tex_par:D} at the very end is % unnecessary but executing it there unnecessarily is better than -% having code that test for all the different mode possibilities. +% having code that tests for all the different mode possibilities. % \begin{macrocode} \tex_par:D \hook_use:n{para/after} \@kernel@after@para@after } % \end{macrocode} -% If we haven't been in horizontal mode then the earlier hook -% \hook{para/end} is at fault and we report that. +% If we were not horizontal mode (the F case from above) +% then the earlier hook +% \hook{para/end} must have been at fault, so we report that. % \begin{macrocode} { \msg_error:nnnn { hooks }{ para-mode }{end}{horizontal} } % \end{macrocode} % Finally close out the nested conditionals. % \begin{macrocode} } - } + } % \end{macrocode} -% +% And then we can use the primitive to truly end the paragraph. % \begin{macrocode} \tex_par:D } @@ -1090,7 +1140,7 @@ \@@_handle_indent: \the\everypar } } - { \msg_error:nn { kernel }{ raw-para } } + { \msg_error:nn { latex2e }{ raw-para } } \tex_indent:D } % \end{macrocode} @@ -1103,7 +1153,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} @@ -1133,10 +1183,11 @@ % \begin{macro}[int]{\@@par} % % Having the new default definition for \cs{par} we also have to -% set it up so that it gets used. This is needed in three places +% set it up so that it gets used. This involves three commands: % \cs{par}, \cs{@@par} (to which \LaTeX{} resets \cs{par} -% occasionally) and \cs{endgraf} which is another name for the +% occasionally) and \cs{endgraf}, which is another name for the % ``default'' action of \cs{par}. +% % \begin{macrocode} \cs_set_eq:NN \par \para_end: \cs_set_eq:NN \@@par \para_end: @@ -1161,7 +1212,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 +1226,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 +1258,17 @@ %<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> +% \end{macrocode} +% We also need to clean up the primitive ``everypar'' as that +% should no longer execute any code by default. And, of course, +% make \cs{everypar} become the primitive again. +% \changes{v1.0k}{2021/10/19}{Remove content from \cs{tex_everypar:D} +% on rollback} +% \begin{macrocode} +%<latexrelease>\tex_everypar:D {} +%<latexrelease>\cs_set_eq:NN \everypar \tex_everypar:D +%<latexrelease> %<latexrelease>\EndModuleRelease \ExplSyntaxOff %</2ekernel|latexrelease> @@ -1220,4 +1282,3 @@ \endinput %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % - diff --git a/macros/latex/base/ltplain.dtx b/macros/latex/base/ltplain.dtx index e0fbcecf1b..5fa7039679 100644 --- a/macros/latex/base/ltplain.dtx +++ b/macros/latex/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/macros/latex/base/ltsect.dtx b/macros/latex/base/ltsect.dtx index 29ea142ba6..67974c7387 100644 --- a/macros/latex/base/ltsect.dtx +++ b/macros/latex/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/macros/latex/base/ltshipout-code.pdf b/macros/latex/base/ltshipout-code.pdf Binary files differindex 41ebda8258..702172eca0 100644 --- a/macros/latex/base/ltshipout-code.pdf +++ b/macros/latex/base/ltshipout-code.pdf diff --git a/macros/latex/base/ltshipout-doc.pdf b/macros/latex/base/ltshipout-doc.pdf Binary files differindex 9a9c6e7d36..7205dde797 100644 --- a/macros/latex/base/ltshipout-doc.pdf +++ b/macros/latex/base/ltshipout-doc.pdf diff --git a/macros/latex/base/ltshipout.dtx b/macros/latex/base/ltshipout.dtx index f773cd23da..7f6555d18c 100644 --- a/macros/latex/base/ltshipout.dtx +++ b/macros/latex/base/ltshipout.dtx @@ -32,8 +32,8 @@ %%% From File: ltshipout.dtx % % \begin{macrocode} -\providecommand\ltshipoutversion{v1.0i} -\providecommand\ltshipoutdate{2021/03/17} +\providecommand\ltshipoutversion{v1.0j} +\providecommand\ltshipoutdate{2021/06/09} % \end{macrocode} % %<*driver> @@ -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! % @@ -867,7 +867,7 @@ % \begin{macrocode} \cs_new:Npn \@@_execute_main_cont:Nnnn #1#2#3#4 { \box_if_empty:NTF #1 - { \@latex@warning{Ignoring~ void~ shipout~ box} } + { \@latex@warning@no@line{ Ignoring~ void~ shipout~ box } } { % \end{macrocode} % Otherwise we assume that we will ship something and prepare for @@ -935,9 +935,8 @@ % practice way is to use the request mechanism. % \begin{macrocode} { \box_if_empty:NTF #1 - { \@latex@warning{ - Shipout~ box~ was~ voided~ by~ hook,\MessageBreak - ignoring~ shipout~ box } + { \@latex@warning@no@line { Ignoring~ void~ shipout~ box. + \MessageBreak The~ shipout~ box~ was~ voided~ by~ hook~ code } } % \end{macrocode} % Finally, if the box is still non-empty we are nearly ready to @@ -1183,9 +1182,8 @@ % \begin{macrocode} \cs_gset_eq:NN \@@_run_firstpage_hook: \prg_do_nothing: \cs_gset:Npn \@@_add_firstpage_material:Nn ##1 ##2 { - \@latex@warning{ - First~ page~ is~ already~ shipped~ out,~ ignoring\MessageBreak - \string##1 } + \@latex@warning{ First~ page~ is~ already~ shipped~ out,~ ignoring + \MessageBreak \string##1 } } } % \end{macrocode} diff --git a/macros/latex/base/ltvers.dtx b/macros/latex/base/ltvers.dtx index c8c3e618a5..9ce8d74cce 100644 --- a/macros/latex/base/ltvers.dtx +++ b/macros/latex/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} @@ -112,10 +112,10 @@ %</2ekernel> %<latexrelease>\edef\latexreleaseversion %<*2ekernel|latexrelease> - {2021-06-01} + {2021-11-15} %</2ekernel|latexrelease> %<*2ekernel> -\def\patch@level{1} +\def\patch@level{0} % \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/macros/latex/base/ltx3info.pdf b/macros/latex/base/ltx3info.pdf Binary files differindex 76c226fb9f..c5a068a97c 100644 --- a/macros/latex/base/ltx3info.pdf +++ b/macros/latex/base/ltx3info.pdf diff --git a/macros/latex/base/ltxdoc.pdf b/macros/latex/base/ltxdoc.pdf Binary files differindex bc3427d108..aec7d11871 100644 --- a/macros/latex/base/ltxdoc.pdf +++ b/macros/latex/base/ltxdoc.pdf diff --git a/macros/latex/base/makeindx.dtx b/macros/latex/base/makeindx.dtx index e8e48e60b0..9dc03a8431 100644 --- a/macros/latex/base/makeindx.dtx +++ b/macros/latex/base/makeindx.dtx @@ -121,7 +121,7 @@ % \begin{macrocode} %<makeidx>\ProvidesPackage{makeidx} %<showidx>\ProvidesPackage{showidx} - [2014/09/29 v1.0m Standard LaTeX package] + [2021/10/04 v1.0m Standard LaTeX package] % \end{macrocode} % % \subsection{Makeidx} @@ -261,7 +261,7 @@ % % \begin{macro}{\raggedbottom} % \begin{macro}{\flushbottom} -% The definition of these macros from \texttt{latex.dtx} is changed +% The definitions of these macros from the \LaTeX{} format are changed % here to add the execution of |\@mkidx| to |\@texttop|, which is % executed at the top of each page. % \begin{macrocode} diff --git a/macros/latex/base/makeindx.pdf b/macros/latex/base/makeindx.pdf Binary files differindex 8971d471dc..149d03be5a 100644 --- a/macros/latex/base/makeindx.pdf +++ b/macros/latex/base/makeindx.pdf diff --git a/macros/latex/base/manifest.txt b/macros/latex/base/manifest.txt index 65e6f80389..f6afcccce7 100644 --- a/macros/latex/base/manifest.txt +++ b/macros/latex/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/macros/latex/base/modguide.pdf b/macros/latex/base/modguide.pdf Binary files differindex ce83457378..d148372405 100644 --- a/macros/latex/base/modguide.pdf +++ b/macros/latex/base/modguide.pdf diff --git a/macros/latex/base/nfssfont.pdf b/macros/latex/base/nfssfont.pdf Binary files differindex 0349a1a41a..49270958e6 100644 --- a/macros/latex/base/nfssfont.pdf +++ b/macros/latex/base/nfssfont.pdf diff --git a/macros/latex/base/preload.dtx b/macros/latex/base/preload.dtx index b2ca24bce5..bf2bfebbfa 100644 --- a/macros/latex/base/preload.dtx +++ b/macros/latex/base/preload.dtx @@ -45,7 +45,7 @@ %<+tex> \ProvidesFile{preload.ltx} % \fi % \ProvidesFile{preload.dtx} - [2014/09/29 v2.1g LaTeX Kernel (Font Preloading)] + [2021/10/04 v2.1g LaTeX Kernel (Font Preloading)] % % % @@ -179,7 +179,7 @@ % We begin by loading the math extension font (cmex10) % and the \LaTeX{} line and circle fonts. % It is necessary to do this explicitly since these are -% used by \texttt{lplain.tex} and \texttt{latex.tex}. +% used by the \LaTeX{} format. % Since the internal font name contains |/| characters % and digits we construct the name via |\csname|. % These are the only fonts (!) that must be loaded in this file. diff --git a/macros/latex/base/proc.pdf b/macros/latex/base/proc.pdf Binary files differindex fbfaea3d88..dcf626fa4b 100644 --- a/macros/latex/base/proc.pdf +++ b/macros/latex/base/proc.pdf diff --git a/macros/latex/base/slides.dtx b/macros/latex/base/slides.dtx index 883e7d34f0..e63c1901d6 100644 --- a/macros/latex/base/slides.dtx +++ b/macros/latex/base/slides.dtx @@ -53,7 +53,7 @@ %<*driver> \ProvidesFile{slides.drv} %</driver> - [2020/11/23 v2.4b + [2021/10/04 v2.4b %<+class> Standard LaTeX document class] %<+cmd> SLiTeX definitions] % \end{macrocode} @@ -1342,7 +1342,7 @@ % % \begin{environment}{description} % The description environment is defined here -- while the itemize -% and enumerate environments are defined in \file{latex.dtx}. +% and enumerate environments are defined in the \LaTeX{} format. % % \begin{macrocode} \newenvironment{description}{\list{}{\labelwidth\z@ @@ -1373,7 +1373,7 @@ % \begin{macro}{\theenumii} % \begin{macro}{\theenumiii} % \begin{macro}{\theenumiv} -% The counters are already defined in \file{latex.dtx}, but their +% The counters are already defined in the \LaTeX{} format, but their % representation is changed here. % % \begin{macrocode} @@ -2349,7 +2349,7 @@ COLOR LAYER\\[.75in]% % % \changes{v2.2j}{1994/03/11}{Corrected \cs{@oval}, like previous % \changes{v2.4a}{2016/03/29}{Initialize in \cs{@oval}tests added for -% latex/4452} change to \file{latex.dtx}.} +% latex/4452} change to the \LaTeX{} format.} % \begin{macrocode} \def\line(#1,#2)#3{\if@visible\@xarg #1\relax \@yarg #2\relax \@linelen #3\unitlength diff --git a/macros/latex/base/slides.pdf b/macros/latex/base/slides.pdf Binary files differindex 7503d81cee..4351a8bbc5 100644 --- a/macros/latex/base/slides.pdf +++ b/macros/latex/base/slides.pdf diff --git a/macros/latex/base/slifonts.pdf b/macros/latex/base/slifonts.pdf Binary files differindex cb6a0707cf..b074c47fe2 100644 --- a/macros/latex/base/slifonts.pdf +++ b/macros/latex/base/slifonts.pdf diff --git a/macros/latex/base/source2e.pdf b/macros/latex/base/source2e.pdf Binary files differindex a9463d1499..ed540837b7 100644 --- a/macros/latex/base/source2e.pdf +++ b/macros/latex/base/source2e.pdf diff --git a/macros/latex/base/source2edoc.cls b/macros/latex/base/source2edoc.cls index ba6acf9f80..bef81d995d 100644 --- a/macros/latex/base/source2edoc.cls +++ b/macros/latex/base/source2edoc.cls @@ -61,6 +61,24 @@ \int_compare:nNnTF \@auxout = \@partaux { \@latexerr{\string\include\space cannot~be~nested}\@eha } { \@docinclude {#1} } % <--- braces needed! + \int_compare:nNnF { \tex_currentgrouplevel:D } = { 0 } + { + \int_compare:nNnT { \tex_interactionmode:D } = { 0 } + { \int_set:Nn \tex_interactionmode:D { 1 } } + \msg_fatal:nnn { source2edoc } { missing-endgroup } {#1} + } + } +\msg_new:nnn { source2edoc } { missing-endgroup } + { + \str_if_eq:VnTF \@currenvir { document } + { + There~are~\int_use:N \tex_currentgrouplevel:D + \c_space_tl unclosed~groups~in~#1.dtx. + } + { + The~\@currenvir \c_space_tl environment~on~line~\@currenvline + \c_space_tl doesn't~have~a~matching~\iow_char:N\\end{\@currenvir}. + } } \cs_gset:Npn \@docinclude #1 { diff --git a/macros/latex/base/syntonly.pdf b/macros/latex/base/syntonly.pdf Binary files differindex c2fc0478e5..11e7a17a15 100644 --- a/macros/latex/base/syntonly.pdf +++ b/macros/latex/base/syntonly.pdf diff --git a/macros/latex/base/tlc2.err b/macros/latex/base/tlc2.err index a361d1673a..46ba9ed845 100644 --- a/macros/latex/base/tlc2.err +++ b/macros/latex/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/macros/latex/base/tlc2.pdf b/macros/latex/base/tlc2.pdf Binary files differindex 7988ace822..5ca2bfae39 100644 --- a/macros/latex/base/tlc2.pdf +++ b/macros/latex/base/tlc2.pdf diff --git a/macros/latex/base/tulm.fdd b/macros/latex/base/tulm.fdd index 5c1566a5ba..243cbe30cc 100644 --- a/macros/latex/base/tulm.fdd +++ b/macros/latex/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/macros/latex/base/tulm.pdf b/macros/latex/base/tulm.pdf Binary files differindex 566e6b3d3d..1a7da810be 100644 --- a/macros/latex/base/tulm.pdf +++ b/macros/latex/base/tulm.pdf diff --git a/macros/latex/base/usrguide.pdf b/macros/latex/base/usrguide.pdf Binary files differindex b98ef34cc4..f77b1b021d 100644 --- a/macros/latex/base/usrguide.pdf +++ b/macros/latex/base/usrguide.pdf diff --git a/macros/latex/base/usrguide3.pdf b/macros/latex/base/usrguide3.pdf Binary files differindex 45ad8e891e..bd32957da5 100644 --- a/macros/latex/base/usrguide3.pdf +++ b/macros/latex/base/usrguide3.pdf diff --git a/macros/latex/base/usrguide3.tex b/macros/latex/base/usrguide3.tex index c378ac8592..82c1c06863 100644 --- a/macros/latex/base/usrguide3.tex +++ b/macros/latex/base/usrguide3.tex @@ -36,7 +36,7 @@ \author{\copyright~Copyright 2020-2021, \LaTeX\ Project Team.\\ All rights reserved.} -\date{2021-04-12} +\date{2021-06-11} \NewDocumentCommand\cs{m}{\texttt{\textbackslash\detokenize{#1}}} \NewDocumentCommand\marg{m}{\arg{#1}} @@ -235,9 +235,9 @@ defined. \end{decl} These commands work in the same way as \cs{NewDocumentCommand}, etc.\@, but create environments (\cs{begin}\arg{env} \ldots{} -\cs{end}\arg{environment}). Both the \meta{beg-code} and \meta{end-code} +\cs{end}\arg{env}). Both the \meta{beg-code} and \meta{end-code} may access the arguments as defined by \meta{arg spec}. The arguments will be -given following \cs{begin}\arg{environment}. +given following \cs{begin}\arg{env}. \subsection{Optional arguments} \label{sec:cmd:opt} @@ -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/macros/latex/base/utf8ienc.dtx b/macros/latex/base/utf8ienc.dtx index 79c725915c..75990d1b03 100644 --- a/macros/latex/base/utf8ienc.dtx +++ b/macros/latex/base/utf8ienc.dtx @@ -216,7 +216,7 @@ %<+ts1> \ProvidesFile{ts1enc.dfu} %<+x2> \ProvidesFile{x2enc.dfu} %<+all> \ProvidesFile{utf8enc.dfu} -%<-utf8-2018> [2021/01/27 v1.2l UTF-8 support for inputenc] +%<-utf8-2018> [2021/06/21 v1.2n UTF-8 support] % \end{macrocode} % % \begin{macrocode} @@ -443,14 +443,16 @@ % \changes{v1.1g}{2005/09/27}{Real spaces do not show up so use \cs{space}} % \changes{v1.1o}{2015/08/28}{Show Unicode number of character in hex} % \changes{v1.2a}{2018/03/24}{Error message improved for non-UTF-8 sequences}% +% \changes{v1.2m}{2021/06/08}{Normalize various error messages as kernel errors} % \begin{macrocode} \UTFviii@undefined@err{#1}% % \end{macrocode} % % \begin{macrocode} \else - \PackageError{inputenc}{Invalid UTF-8 byte sequence}% - \UTFviii@invalid@help + \@latex@error{Invalid UTF-8 byte sequence (\expandafter + \@gobblefour\string#1)}% + \UTFviii@invalid@help \fi % \end{macrocode} % @@ -468,8 +470,8 @@ % \changes{v1.2f}{2018/10/05}{Show invalid byte in hex}% % \begin{macrocode} \def\UTFviii@invalid@err#1{% - \PackageError{inputenc}{Invalid UTF-8 byte "\UTFviii@hexnumber{`#1}}% - \UTFviii@invalid@help} + \@latex@error{Invalid UTF-8 byte "\UTFviii@hexnumber{`#1}}% + \UTFviii@invalid@help} % \end{macrocode} % % \begin{macrocode} @@ -487,7 +489,7 @@ % \changes{v1.2a}{2018/03/24}{Macro added}% % \begin{macrocode} \def\UTFviii@undefined@err#1{% - \PackageError{inputenc}{Unicode character \expandafter + \@latex@error{Unicode character \expandafter \UTFviii@splitcsname\string#1\relax \MessageBreak not set up for use with LaTeX}% @@ -776,8 +778,7 @@ \ifnum\catcode\count@=13 \uccode`\~=\count@\uppercase{\def\UTFviii@tmp{\@empty\@empty~}}% \else - \PackageError{inputenc}% - {Cannot define non-active Unicode char value < 00A0}% + \@latex@error{Cannot define non-active Unicode char value < 00A0}% \@eha \def\UTFviii@tmp{\UTFviii@tmp}% \fi @@ -803,7 +804,7 @@ % past this error. % \begin{macrocode} \ifnum\count@>"10FFFF\relax - \PackageError{inputenc}% + \@latex@error {\UTFviii@hexnumber\count@\space too large for Unicode}% {Values between 0 and 10FFFF are permitted}% \fi @@ -1703,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} @@ -2083,8 +2098,7 @@ \ifnum\catcode\count@=13 \uccode`\~=\count@\uppercase{\def\UTFviii@tmp{\@empty\@empty~}}% \else - \PackageError{inputenc}% - {Cannot define non-active Unicode char value < 00A0}% + \PackageError{inputenc}{Cannot define non-active Unicode char value < 00A0}% \@eha \def\UTFviii@tmp{\UTFviii@tmp}% \fi diff --git a/macros/latex/base/utf8ienc.pdf b/macros/latex/base/utf8ienc.pdf Binary files differindex 7c78542a83..cf55abbe64 100644 --- a/macros/latex/base/utf8ienc.pdf +++ b/macros/latex/base/utf8ienc.pdf diff --git a/macros/latex/base/webcomp.err b/macros/latex/base/webcomp.err index 6a62e258c5..1b3b7a2475 100644 --- a/macros/latex/base/webcomp.err +++ b/macros/latex/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/macros/latex/base/webcomp.pdf b/macros/latex/base/webcomp.pdf Binary files differindex 9ddab59b30..6de191a7b6 100644 --- a/macros/latex/base/webcomp.pdf +++ b/macros/latex/base/webcomp.pdf diff --git a/macros/latex/contrib/bangorcsthesis/README b/macros/latex/contrib/bangorcsthesis/README index 49dd65ea09..78f3da354c 100644 --- a/macros/latex/contrib/bangorcsthesis/README +++ b/macros/latex/contrib/bangorcsthesis/README @@ -1,6 +1,6 @@ Bangor University Computer Science Department Thesis Document Class -Cameron Gray <c.gray@bangor.ac.uk> Octover 5, 2018 +Cameron Gray <c.gray@bangor.ac.uk> November 12, 2021 Abstract @@ -28,6 +28,8 @@ options to be specified, these dictate what type of thesis the document forms; [(msc⟩] - Master of Science (Taught courses) [(ba⟩] - [⟨Bachelor of Arts (Undergraduate courses) [(bsc⟩] - Bachelor of Science (Undergraduate courses) +[(beng)] - Bachelor of Engineering (Undergraduate course) +[(meng)] - Master of Engineering (Integrated masters) For example; an undergraduate dissertation for a Computer Science degree (a B.Sc. course) would start with a document class definition as follows:- diff --git a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.dtx b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.dtx index 603b47f221..c5234e4ed0 100644 --- a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.dtx +++ b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.dtx @@ -40,7 +40,7 @@ \end{document} %</driver> %\fi -%\CheckSum{608} +%\CheckSum{614} %\RecordChanges %\changes{v1.0}{2014/07/01}{Initial version.} %\changes{v1.0.1}{2014/09/01}{Repackaged to remove external logo file.} @@ -51,10 +51,11 @@ %\changes{v1.5.1}{2016/08/24}{Altered fancyfoot options to remove superflous warnings.} %\changes{v1.5.2}{2017/08/10}{Altered heading handling for the references section.} %\changes{v1.5.3}{2018/10/05}{Altered School and College names.} +%\changes{v1.5.4}{2021/11/12}{Added more Engineering degree types.} %\pagestyle{fancy} -%\title{Bangor University Computer Science Department\\ Thesis Document Class} +%\title{Bangor University Computer Science and Electronic Engineering Department\\ Thesis Document Class} %\author{Cameron Gray \texttt{<c.gray@bangor.ac.uk>}} -%\date{October 5, 2018} +%\date{November 12, 2021} %\maketitle % %\begin{abstract} @@ -84,6 +85,8 @@ %\oarg{msc} - Master of Science (Taught courses)\\ %\oarg{ba} - Bachelor of Arts (Undergraduate courses)\\ %\oarg{bsc} - Bachelor of Science (Undergraduate courses)\\ +%\oarg{beng} - Bachelor of Engineering (Undergraduate courses)\\ +%\oarg{meng} - Master of Engineering (Integrated Masters) % %For example; an undergraduate dissertation for a Computer Science degree %(a B.Sc. course) would start with a document class definition as follows:-\\ @@ -263,11 +266,11 @@ % \end{macrocode} %\fi % \begin{macrocode} -\def\version{1.5.3} +\def\version{1.5.4} \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{bangorcsthesis}[2018/10/04 \version C. Gray] +\ProvidesClass{bangorcsthesis}[2021/11/12 \version C. Gray] % Originally inspired by Clean Thesis % - http://cleanthesis.der-ric.de/ @@ -278,6 +281,7 @@ \FSCreate{supervisors}{} \def\supervisor#1{\FSPush{supervisors}{#1}} + \RequirePackage{ifthen} \RequirePackage{xkeyval} \RequirePackage[dvipsnames]{xcolor} @@ -296,9 +300,15 @@ \DeclareOption{ba}{ \newcommand{\degree}{Bachelor of Arts} } +\DeclareOption{beng}{ + \newcommand{\degree}{Bachelor of Engineering} +} \DeclareOption{msc}{ \newcommand{\degree}{Master of Science} } +\DeclareOption{meng}{ + \newcommand{\degree}{Moster of Engineering} +} \DeclareOption{mscres}{ \newcommand{\degree}{Master of Science by Research} } @@ -356,12 +366,12 @@ \ProcessOptions\relax \ifx\degree\undefined - \ClassError{bangorcsthesis}{A degree type option has not been defined; use ba,bsc,msc,mscres,mres,mphil or phd in the class options.} + \ClassError{bangorcsthesis}{A degree type option has not been defined; use ba,bsc,beng,meng,msc,mscres,mres,mphil or phd in the class options.} \fi \LoadClass[12pt]{report} - +\RequirePackage{tocloft} \if@nohyphen \tolerance=1 @@ -637,9 +647,6 @@ singlelinecheck=false % - no centred single-lined captions % the list of figures and the list of tables % % -% The tocloft package enables us to control the typographic design of the -% table of contents, list of figures and list of tables -\RequirePackage{tocloft} % % > adjusts the indention for figure and table entries (lof and lot) % -- \cftsetindents{entry}{indent}{numwidth} sets the entry's indent to diff --git a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.ins b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.ins index 8dbc7f3dfc..cc4664ec66 100644 --- a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.ins +++ b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.ins @@ -3,7 +3,7 @@ \preamble bangorcsthesis.dtx - Copyright 2014-16 Cameron Gray/Bangor University <c.gray@bangor.ac.uk> + Copyright 2014-21 Cameron Gray/Bangor University <c.gray@bangor.ac.uk> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.pdf b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.pdf Binary files differindex 02d95f1a71..c67e163222 100644 --- a/macros/latex/contrib/bangorcsthesis/bangorcsthesis.pdf +++ b/macros/latex/contrib/bangorcsthesis/bangorcsthesis.pdf diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 5ee1eadb0f..14c53c6608 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,7 +15,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/11/10}{1.40O} +\ProvidesExplClass{easybook}{2021/11/12}{1.40P} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -325,7 +325,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/11/10}{1.40O} +\ProvidesExplPackage{easybase}{2021/11/12}{1.40P} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -908,14 +908,12 @@ { plain,pifont,pifont*,pifont-sans,pifont-sans* } { \eb_fnmate_normal_label_set:nn {#1} { the@footnote } }, fnmark-num .value_required:n = true, - fnmark-num/unknown .code:n = - { \eb_fnmate_short_label_set:nn {#1} { the@footnote } }, + fnmark-num/unknown .code:n = \eb_fnmate_short_label_set:nn {#1} { the@footnote }, fntext-num .choices:nn = { plain,pifont,pifont*,pifont-sans,pifont-sans* } { \eb_fnmate_normal_label_set:nn {#1} { thefootnote } }, fntext-num .value_required:n = true, - fntext-num/unknown .code:n = - { \eb_fnmate_short_label_set:nn {#1} { thefootnote } }, + fntext-num/unknown .code:n = \eb_fnmate_short_label_set:nn {#1} { thefootnote }, fnmate-num .meta:n = { fntext-num = #1,fnmark-num = #1 }, fnmate-num .initial:n = plain, unknown .code:n = \eb_msg_unknown_option:n { hdrset } @@ -1837,8 +1835,7 @@ \newlist{eb@exercise@list}{enumerate}{2} \newlist{eb@eqcomp@list}{description}{1} \setlist[eb@outline@list]{label = outline,itemsep = 0.5ex plus .1ex} -\setlist[eb@exercise@list]{labelsep = 0.5em,nosep} -\setlist[eb@eqcomp@list]{labelsep = 0em,nosep} +\setlist[eb@eqcomp@list]{labelsep = 0em} \cs_new:Npn \setexerlist #1 { \setlist*[eb@exercise@list]{#1} } \cs_new:Npn \seteqcomplist #1 { \setlist*[eb@eqcomp@list]{#1} } \cs_new:Npn \setoutlinelist #1 { \setlist*[eb@outline@list]{#1} } @@ -2404,7 +2401,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/11/10}{1.40O} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/11/12}{1.40P} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 2871a82625..37b9add116 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index 54806dc5a6..cde1c710e8 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -20,8 +20,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK 使用手册, - version = v1.40O, - date = 2021/11/10, + version = v1.40P, + date = 2021/11/12, authors = 瞿毅, info = 排版简体中文学位论文和书籍, email = q1jx@foxmail.com, @@ -637,8 +637,8 @@ \label{subsec:page margins} 模块 \module*{geoset} 会将除了前两个附加的选项交给页面尺寸宏包 \pkg*{geometry} 处理,并且支持它的键值列表,预置的页面尺寸与 \cls*{Word} 的默认值接近。下面列举的仅是一小部分选项,其它选项可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。 \begin{options}\noitemsep - \keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default* - \keyval-{footruleskip}{页脚线间距}\Default* + \keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default*{1.5pt} + \keyval-{footruleskip}{页脚线间距}\Default*{0.3\cs*{normalbaselineskip}} \keyval*-{left}{页面左边距}\Default*{3.17cm} \keyval*-{top}{页面上边距}\Default*{2.54cm} \kvsplit{hmargin}{左边距,右边距} @@ -893,7 +893,7 @@ \environment*{description}[\oarg{键值列表}] 已为三种列表各自预置了三个级别,同种列表或不同种列表间的不同级别可相互嵌套,可以使用短编号的形式,带有星号的环境为行内列表。默认列表标签与标准文档类一致,下面举几个更改列表标签以及其它格式的例子: \begin{ctexexam} - \setlist{nosep} % 取消所有列表额外的垂直间距 + \setlist*{wide = 0em} % 取消所有列表的左边距 \begin{enumerate}[label = \arabic*(a),leftmargin = 1cm,resume] \begin{enumerate}[(1)] % 短编号形式 \begin{itemize}[label = \textbullet,labelsep = *] diff --git a/macros/latex/contrib/l3build/CHANGELOG.md b/macros/latex/contrib/l3build/CHANGELOG.md index f5be81a937..c6f67da4b2 100644 --- a/macros/latex/contrib/l3build/CHANGELOG.md +++ b/macros/latex/contrib/l3build/CHANGELOG.md @@ -7,6 +7,14 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-11-12] + +### Changed +- Documentation improvements + +### Fixed +- Allow config names ending with 'lua', as long as they don't end with '.lua' + ## [2021-08-28] ### Fixed @@ -509,7 +517,8 @@ this project uses date-based 'snapshot' version identifiers. - Rationalise short option names: removed `-d`, `-E`, `-r` - Target `cmdcheck`: specific to LaTeX kernel work -[Unreleased]: https://github.com/latex3/l3build/compare/2021-08-28...HEAD +[Unreleased]: https://github.com/latex3/l3build/compare/2021-11-12...HEAD +[2021-11-12]: https://github.com/latex3/l3build/compare/2021-08-28...2021-11-12 [2021-08-28]: https://github.com/latex3/l3build/compare/2021-08-27...2021-08-28 [2021-08-27]: https://github.com/latex3/l3build/compare/2021-05-06...2021-08-27 [2021-05-06]: https://github.com/latex3/l3build/compare/2021-05-05...2021-05-06 diff --git a/macros/latex/contrib/l3build/README.md b/macros/latex/contrib/l3build/README.md index 635693ae9f..f75e873dfd 100644 --- a/macros/latex/contrib/l3build/README.md +++ b/macros/latex/contrib/l3build/README.md @@ -1,7 +1,7 @@ l3build: a testing and building system for LaTeX ================================================= -Release 2021-08-28 +Release 2021-11-12 Overview -------- @@ -31,6 +31,6 @@ The LaTeX kernel is developed by [The LaTeX Project](https://latex-project.org). ----- -<p>Copyright (C) 2014-2020 The LaTeX Project <br /> +<p>Copyright (C) 2014-2021 The LaTeX Project <br /> <a href="http://latex-project.org/">http://latex-project.org/</a> <br /> All rights reserved.</p> diff --git a/macros/latex/contrib/l3build/l3build-arguments.lua b/macros/latex/contrib/l3build/l3build-arguments.lua index 8f62e8b433..470290db56 100644 --- a/macros/latex/contrib/l3build/l3build-arguments.lua +++ b/macros/latex/contrib/l3build/l3build-arguments.lua @@ -1,6 +1,6 @@ --[[ -File l3build-arguments.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-arguments.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -141,7 +141,7 @@ option_list = }, ["show-saves"] = { - desc = "If tests fail, show the l3build save invocation to regenerate the tests", + desc = "Show the invocation to update failing .tlg files", short = "S", type = "boolean" }, diff --git a/macros/latex/contrib/l3build/l3build-aux.lua b/macros/latex/contrib/l3build/l3build-aux.lua index 12fe704af4..42e7f6a53a 100644 --- a/macros/latex/contrib/l3build/l3build-aux.lua +++ b/macros/latex/contrib/l3build/l3build-aux.lua @@ -1,6 +1,6 @@ --[[ -File l3build-aux.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-aux.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua index f83dee4e44..3e8089970a 100644 --- a/macros/latex/contrib/l3build/l3build-check.lua +++ b/macros/latex/contrib/l3build/l3build-check.lua @@ -1,6 +1,6 @@ --[[ -File l3build-check.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-check.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -548,6 +548,7 @@ local function normalize_pdf(content) not match(line,"^%%%%Invocation") and not match(line,"^%%%%%+") then line = gsub(line,"%/ID( ?)%[<[^>]+><[^>]+>]","/ID%1[<ID-STRING><ID-STRING>]") + line = gsub(line,"%/ID( ?)%[(%b())%2%]","/ID%1[<ID-STRING><ID-STRING>]") new_content = new_content .. line .. os_newline end end diff --git a/macros/latex/contrib/l3build/l3build-clean.lua b/macros/latex/contrib/l3build/l3build-clean.lua index f548a392eb..226650b478 100644 --- a/macros/latex/contrib/l3build/l3build-clean.lua +++ b/macros/latex/contrib/l3build/l3build-clean.lua @@ -1,6 +1,6 @@ --[[ -File l3build-clean.lua Copyright (C) 2018,2020 The LaTeX Project +File l3build-clean.lua Copyright (C) 2018,2020,2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -77,4 +77,3 @@ function bundleclean() + rmdir(ctandir) + rmdir(tdsdir) end - diff --git a/macros/latex/contrib/l3build/l3build-ctan.lua b/macros/latex/contrib/l3build/l3build-ctan.lua index e5b3b7e8f8..1f5aa2bc90 100644 --- a/macros/latex/contrib/l3build/l3build-ctan.lua +++ b/macros/latex/contrib/l3build/l3build-ctan.lua @@ -1,6 +1,6 @@ --[[ -File l3build-ctan.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-ctan.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -160,4 +160,3 @@ function ctan() end return errorlevel end - diff --git a/macros/latex/contrib/l3build/l3build-file-functions.lua b/macros/latex/contrib/l3build/l3build-file-functions.lua index 53364bd301..1fc9e1d47a 100644 --- a/macros/latex/contrib/l3build/l3build-file-functions.lua +++ b/macros/latex/contrib/l3build/l3build-file-functions.lua @@ -1,6 +1,6 @@ --[[ -File l3build-file-functions.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-file-functions.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-help.lua b/macros/latex/contrib/l3build/l3build-help.lua index 6431ac547e..2e7d776a73 100644 --- a/macros/latex/contrib/l3build/l3build-help.lua +++ b/macros/latex/contrib/l3build/l3build-help.lua @@ -1,6 +1,6 @@ --[[ -File l3build-help.lua Copyright (C) 2018,2020 The LaTeX Project +File l3build-help.lua Copyright (C) 2018,2020,2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-install.lua b/macros/latex/contrib/l3build/l3build-install.lua index f4839fdca7..21257aad0d 100644 --- a/macros/latex/contrib/l3build/l3build-install.lua +++ b/macros/latex/contrib/l3build/l3build-install.lua @@ -1,6 +1,6 @@ --[[ -File l3build-install.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-install.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -234,11 +234,11 @@ function install_files(target,full,dry_run) typesetlist = create_file_list(docfiledir,typesetfiles,{sourcefiles}) sourcelist = create_file_list(sourcefiledir,sourcefiles, {bstfiles,installfiles,makeindexfiles,scriptfiles}) - + if dry_run then print("\nFor installation inside " .. target .. ":") - end - + end + errorlevel = create_install_map(sourcefiledir,"source",{sourcelist}) + create_install_map(docfiledir,"doc", {bibfiles,demofiles,docfiles,pdffiles,textfiles,typesetlist}) @@ -290,8 +290,8 @@ function install_files(target,full,dry_run) for _,v in ipairs(installmap) do errorlevel = cp(v.file,v.source,v.dest) if errorlevel ~= 0 then return errorlevel end - end - + end + return 0 end diff --git a/macros/latex/contrib/l3build/l3build-manifest-setup.lua b/macros/latex/contrib/l3build/l3build-manifest-setup.lua index 9fcf493729..f7051dac5c 100644 --- a/macros/latex/contrib/l3build/l3build-manifest-setup.lua +++ b/macros/latex/contrib/l3build/l3build-manifest-setup.lua @@ -1,6 +1,6 @@ --[[ -File l3build-manifest-setup.lua Copyright (C) 2018,2020 The LaTeX Project +File l3build-manifest-setup.lua Copyright (C) 2018,2020,2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-manifest.lua b/macros/latex/contrib/l3build/l3build-manifest.lua index f9b1c4e82e..8f3e5ef421 100644 --- a/macros/latex/contrib/l3build/l3build-manifest.lua +++ b/macros/latex/contrib/l3build/l3build-manifest.lua @@ -1,6 +1,6 @@ --[[ -File l3build-manifest.lua Copyright (C) 2018,2020 The LaTeX Project +File l3build-manifest.lua Copyright (C) 2018,2020,2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-stdmain.lua b/macros/latex/contrib/l3build/l3build-stdmain.lua index 80b5cc84be..4b6da6675e 100644 --- a/macros/latex/contrib/l3build/l3build-stdmain.lua +++ b/macros/latex/contrib/l3build/l3build-stdmain.lua @@ -1,6 +1,6 @@ --[[ -File l3build-stdmain.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-stdmain.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-tagging.lua b/macros/latex/contrib/l3build/l3build-tagging.lua index e255aba5cd..9f39650598 100644 --- a/macros/latex/contrib/l3build/l3build-tagging.lua +++ b/macros/latex/contrib/l3build/l3build-tagging.lua @@ -1,6 +1,6 @@ --[[ -File l3build-tagging.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-tagging.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-typesetting.lua b/macros/latex/contrib/l3build/l3build-typesetting.lua index 716648f7fd..4934c3f497 100644 --- a/macros/latex/contrib/l3build/l3build-typesetting.lua +++ b/macros/latex/contrib/l3build/l3build-typesetting.lua @@ -1,6 +1,6 @@ --[[ -File l3build-typesetting.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-typesetting.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-unpack.lua b/macros/latex/contrib/l3build/l3build-unpack.lua index 7ab21ee09d..a734d4c8ea 100644 --- a/macros/latex/contrib/l3build/l3build-unpack.lua +++ b/macros/latex/contrib/l3build/l3build-unpack.lua @@ -1,6 +1,6 @@ --[[ -File l3build-unpack.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-unpack.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build-upload.lua b/macros/latex/contrib/l3build/l3build-upload.lua index 47268f5b6a..be814ce5ae 100644 --- a/macros/latex/contrib/l3build/l3build-upload.lua +++ b/macros/latex/contrib/l3build/l3build-upload.lua @@ -1,6 +1,6 @@ --[[ -File l3build-upload.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-upload.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -145,9 +145,9 @@ function upload(tagnames) output(curlopt) write(ctan_post) close(curlopt) - + ctan_post=curlexe .. " --config " .. curloptfile - + if options["debug"] then ctan_post = ctan_post .. ' https://httpbin.org/post' @@ -254,7 +254,7 @@ function construct_ctan_post(uploadfile,debug) -- start building the curl command: -- commandline ctan_post = curlexe .. " " ctan_post="" - + -- build up the curl command field-by-field: -- field max desc mandatory multi diff --git a/macros/latex/contrib/l3build/l3build-variables.lua b/macros/latex/contrib/l3build/l3build-variables.lua index f1032004b6..9f2b25b8d2 100644 --- a/macros/latex/contrib/l3build/l3build-variables.lua +++ b/macros/latex/contrib/l3build/l3build-variables.lua @@ -1,6 +1,6 @@ --[[ -File l3build-variables.lua Copyright (C) 2018-2020 The LaTeX Project +File l3build-variables.lua Copyright (C) 2018-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this diff --git a/macros/latex/contrib/l3build/l3build.1 b/macros/latex/contrib/l3build/l3build.1 index 6c2f071a46..3faa8f04b1 100644 --- a/macros/latex/contrib/l3build/l3build.1 +++ b/macros/latex/contrib/l3build/l3build.1 @@ -1,4 +1,4 @@ -.TH l3build 1 "2021-08-28" +.TH l3build 1 "2021-11-12" .SH NAME l3build \- Checking and building packages .SH SYNOPSIS diff --git a/macros/latex/contrib/l3build/l3build.dtx b/macros/latex/contrib/l3build/l3build.dtx index 8d34055227..b0d5aab879 100644 --- a/macros/latex/contrib/l3build/l3build.dtx +++ b/macros/latex/contrib/l3build/l3build.dtx @@ -1,6 +1,6 @@ % \iffalse % -% File l3build.dtx (C) Copyright 2014-2020 The LaTeX Project +% File l3build.dtx (C) Copyright 2014-2021 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -236,7 +236,7 @@ % }^^A % } % -% \date{Released 2021-08-28} +% \date{Released 2021-11-12} % % \maketitle % \tableofcontents @@ -366,7 +366,7 @@ % \item |--first| Name of the first test to run % \item |--force| (|-f|) Force checks to run even if sanity % checks fail, \emph{e.g.}~when |--engine| is not given in -% \luavar{checkengines} +% \var{checkengines} % \item |--full| Instructs the \texttt{install} target to include the % \texttt{doc} and \texttt{source} trees % \item |--halt-on-error| (|-H|) Specifies that checks @@ -1087,7 +1087,7 @@ % % To allow complex set up for tests, a hook |checkinit_hook()| is available % to be executed once all standard set up is complete but before any tests -% are run. +% are run. This should return an integer value: $0$ indicates no error. % % \subsection{Additional test tasks} % @@ -1149,9 +1149,9 @@ % \subsection{Epoch setting} % % To produce predictable output when using dates, the test system offers the -% ability to set the epoch to a known value. The \luavar{epoch} variable may +% ability to set the epoch to a known value. The \var{epoch} variable may % be given as a raw value (a simple integer) or as a date in ISO format. -% The two flags \luavar{forcecheckepoch} and \luavar{forcedocepoch} then +% The two flags \var{forcecheckepoch} and \var{forcedocepoch} then % determine whether this is applied in testing and typesetting, respectively. % % The epoch may also be given as a command line option, |-E|, which again @@ -1309,7 +1309,7 @@ % \end{itemize} % % For more complex set ups, this can be customised using the -% \luavar{tdslocations} table. Each entry there should be a glob specifying the +% \var{tdslocations} table. Each entry there should be a glob specifying the % TDS position of a file or files. Any files not specified in the table % will use the standard locations above. For example, to place some files % in the generic tree, some in the plain \TeX{} tree and some in the \LaTeX{} @@ -1383,8 +1383,8 @@ % As part of the overall build process, \pkg{l3build} will create PDF % documentation as described earlier. The standard build process for PDFs % will attempt to run Biber, \BibTeX{} and MakeIndex as appropriate -% (the exact binaries used are defined by \luavar{biberexe}, \luavar{bibtexexe} -% and \luavar{makeindexexe}). However, there is no attempt to create an entire +% (the exact binaries used are defined by \var{biberexe}, \var{bibtexexe} +% and \var{makeindexexe}). However, there is no attempt to create an entire % PDF creation system in the style of \texttt{latexmk} or similar. % % For package authors who have more complex requirements than those covered @@ -1828,7 +1828,7 @@ % Rather than use this function, we recommend the replacement construct % \begin{verbatim} % io.popen(<cmd>,"w"):write(string.rep("y\n", 300)):close() -% \end{verbatim} +% \end{verbatim} % \end{variable} % % \subsection{Components of \texttt{l3build}} diff --git a/macros/latex/contrib/l3build/l3build.lua b/macros/latex/contrib/l3build/l3build.lua index 51b7a493e3..b48aa306f7 100755 --- a/macros/latex/contrib/l3build/l3build.lua +++ b/macros/latex/contrib/l3build/l3build.lua @@ -2,7 +2,7 @@ --[[ -File l3build.lua Copyright (C) 2014-2020 The LaTeX Project +File l3build.lua Copyright (C) 2014-2021 The LaTeX Project It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -25,7 +25,7 @@ for those people who are interested. --]] -- Version information -release_date = "2021-08-28" +release_date = "2021-11-12" -- File operations are aided by the LuaFileSystem module local lfs = require("lfs") @@ -201,7 +201,7 @@ end if #checkconfigs == 1 and checkconfigs[1] ~= "build" and (options["target"] == "check" or options["target"] == "save" or options["target"] == "clean") then - local config = "./" .. gsub(checkconfigs[1],".lua$","") .. ".lua" + local config = "./" .. gsub(checkconfigs[1],"%.lua$","") .. ".lua" if fileexists(config) then local savedtestfiledir = testfiledir dofile(config) diff --git a/macros/latex/contrib/l3build/l3build.pdf b/macros/latex/contrib/l3build/l3build.pdf Binary files differindex fe2778114f..7c23434947 100644 --- a/macros/latex/contrib/l3build/l3build.pdf +++ b/macros/latex/contrib/l3build/l3build.pdf diff --git a/macros/latex/contrib/l3experimental/CHANGELOG.md b/macros/latex/contrib/l3experimental/CHANGELOG.md index 4e557273ea..42e0fe6dc8 100644 --- a/macros/latex/contrib/l3experimental/CHANGELOG.md +++ b/macros/latex/contrib/l3experimental/CHANGELOG.md @@ -7,6 +7,11 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-11-12] + +### Added +- `\draw_point_intersect_line_circle:nnnnn` + ## [2021-08-27] ### Changed @@ -226,7 +231,8 @@ this project uses date-based 'snapshot' version identifiers. - New `l3color` module using `xcolor`-like expression syntax - New `l3draw` module, based on `pgf` layer of the TikZ system -[Unreleased]: https://github.com/latex3/latex3/compare/2021-08-27...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-11-12...HEAD +[2021-11-12]: https://github.com/latex3/latex3/compare/2021-08-27...2021-11-12 [2021-08-27]: https://github.com/latex3/latex3/compare/2021-08-04...2021-08-27 [2021-08-04]: https://github.com/latex3/latex3/compare/2021-07-12...2021-08-04 [2021-07-12]: https://github.com/latex3/latex3/compare/2021-05-27...2021-07-12 diff --git a/macros/latex/contrib/l3experimental/README.md b/macros/latex/contrib/l3experimental/README.md index 38eff7cf66..0a8c1f250d 100644 --- a/macros/latex/contrib/l3experimental/README.md +++ b/macros/latex/contrib/l3experimental/README.md @@ -1,7 +1,7 @@ Experimental LaTeX3 Concepts ============================ -Release 2021-08-27 +Release 2021-11-12 Overview -------- diff --git a/macros/latex/contrib/l3experimental/l3benchmark.dtx b/macros/latex/contrib/l3experimental/l3benchmark.dtx index d5ba6349ab..5a868d830e 100644 --- a/macros/latex/contrib/l3experimental/l3benchmark.dtx +++ b/macros/latex/contrib/l3experimental/l3benchmark.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -122,7 +122,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3benchmark}{2021-08-27}{} +\ProvidesExplPackage{l3benchmark}{2021-11-12}{} {L3 Experimental benchmarking} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3benchmark.pdf b/macros/latex/contrib/l3experimental/l3benchmark.pdf Binary files differindex 157e2cf3a7..55a39d0fc5 100644 --- a/macros/latex/contrib/l3experimental/l3benchmark.pdf +++ b/macros/latex/contrib/l3experimental/l3benchmark.pdf diff --git a/macros/latex/contrib/l3experimental/l3bitset.dtx b/macros/latex/contrib/l3experimental/l3bitset.dtx index 517cab5815..21a5f550b8 100644 --- a/macros/latex/contrib/l3experimental/l3bitset.dtx +++ b/macros/latex/contrib/l3experimental/l3bitset.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % \begin{documentation} @@ -264,7 +264,7 @@ %<@@=bitset> % \end{macrocode} % \begin{macrocode} -\ProvidesExplPackage{l3bitset}{2021-08-27}{} +\ProvidesExplPackage{l3bitset}{2021-11-12}{} {L3 Experimental bitset support} % \end{macrocode} % A bitset is a string variable. diff --git a/macros/latex/contrib/l3experimental/l3bitset.pdf b/macros/latex/contrib/l3experimental/l3bitset.pdf Binary files differindex 9b4fadc6ca..e46962b6fd 100644 --- a/macros/latex/contrib/l3experimental/l3bitset.pdf +++ b/macros/latex/contrib/l3experimental/l3bitset.pdf diff --git a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx index 817db2e90f..d3a474abda 100644 --- a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-code.pdf b/macros/latex/contrib/l3experimental/l3draw-code.pdf Binary files differindex ac7276ee1e..98b2d5625e 100644 --- a/macros/latex/contrib/l3experimental/l3draw-code.pdf +++ b/macros/latex/contrib/l3experimental/l3draw-code.pdf diff --git a/macros/latex/contrib/l3experimental/l3draw-layers.dtx b/macros/latex/contrib/l3experimental/l3draw-layers.dtx index bab6d5d014..8c8bcea84b 100644 --- a/macros/latex/contrib/l3experimental/l3draw-layers.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-layers.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-paths.dtx b/macros/latex/contrib/l3experimental/l3draw-paths.dtx index 9f49558bc2..ad09f0a605 100644 --- a/macros/latex/contrib/l3experimental/l3draw-paths.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-paths.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-points.dtx b/macros/latex/contrib/l3experimental/l3draw-points.dtx index 2e17871c40..82629b5053 100644 --- a/macros/latex/contrib/l3experimental/l3draw-points.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-points.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -477,6 +477,137 @@ % \end{macro} % \end{macro} % +% \begin{macro}[EXP]{\draw_point_intersect_line_circle:nnnnn} +% \begin{macro}[EXP]{\@@_point_intersect_line_circle_auxi:nnnnnnnn} +% \begin{macro}[EXP] +% { +% \@@_point_intersect_line_circle_auxii:nnnnnnnn, +% \@@_point_intersect_line_circle_auxii:fnnnnnnn, +% \@@_point_intersect_line_circle_auxiii:nnnnnnnn, +% \@@_point_intersect_line_circle_auxiii:fffnnnnn +% } +% \begin{macro}[EXP] +% { +% \@@_point_intersect_line_circle_auxiv:nnnnnnnn, +% \@@_point_intersect_line_circle_auxiv:ffnnnnnn +% } +% \begin{macro}[EXP] +% { +% \@@_point_intersect_line_circle_auxv:nnnnn, +% \@@_point_intersect_line_circle_auxv:fnnnn +% } +% The intersection points~$P_{1}$ and~$P_{2}$ between +% a line joining points $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$ +% and a circle with center $(x_{3}, y_{3})$ and radius~$r$. +% We use the intermediate +% values +% \begin{align*} +% a &= (x_{2} - x_{1})^{2} + (y_{2} - y_{1})^{2} \\ +% b &= 2 \times ((x_{2} - x_{1}) \times (x_{1} - x_{3}) + (y_{2} - y_{1}) \times (y_{1} - y_{3})) \\ +% c &= x_{3}^{2} + y_{3}^{2} + x_{1}^{2} + y_{1}^{2} +% - 2\times(x_{3} \times x_{1} + y_{3} \times y_{1}) - r^{2} \\ +% d &= b^{2} - 4\times a \times c \\ +% \mu_{1} &= \frac{-b + \sqrt{d}}{2 \times a}\\ +% \mu_{2} &= \frac{-b - \sqrt{d}}{2 \times a} +% \end{align*} +% in either +% \begin{align*} +% P_{1x} &= x_{1} + \mu_{1}\times (x_{2} - x_{1}) \\ +% P_{1y} &= y_{1} + \mu_{1}\times (y_{2} - y_{1}) +% \end{align*} +% or +% \begin{align*} +% P_{2x} &= x_{1} + \mu_{2}\times (x_{2} - x_{1}) \\ +% P_{2y} &= y_{1} + \mu_{2}\times (y_{2} - y_{1}) +% \end{align*} +% depending on which solution is required. The rest of the work is simply +% forcing the appropriate expansion and shuffling arguments. +% \begin{macrocode} +\cs_new:Npn \draw_point_intersect_line_circle:nnnnn #1#2#3#4#5 + { + \@@_point_process:nnnn + { \@@_point_intersect_line_circle_auxi:nnnnnnnn {#4} {#5} } + {#1} {#2} {#3} + } +\cs_new:Npn \@@_point_intersect_line_circle_auxi:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \@@_point_intersect_line_circle_auxii:fnnnnnnn + { \fp_eval:n {#1} } {#3} {#4} {#5} {#6} {#7} {#8} {#2} + } +% \end{macrocode} +% At this stage we have all of the information we need, fully expanded: +% \begin{enumerate}[label = \#\arabic*, font = \ttfamily] +% \item $r$ +% \item $x_{1}$ +% \item $y_{1}$ +% \item $x_{2}$ +% \item $y_{2}$ +% \item $x_{3}$ +% \item $y_{3}$ +% \item $n$ +% \end{enumerate} +% Once we evaluate $a$, $b$ and $c$, the co-ordinate $(x_{3},y_{3})$ +% and $r$ are no longer required: handy as we will need various +% intermediate values in the following. +% \begin{macrocode} +\cs_new:Npn \@@_point_intersect_line_circle_auxii:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \@@_point_intersect_line_circle_auxiii:fffnnnnn + { \fp_eval:n { (#4-#2)*(#4-#2)+(#5-#3)*(#5-#3) } } + { \fp_eval:n { 2*((#4-#2)*(#2-#6)+(#5-#3)*(#3-#7)) } } + { \fp_eval:n { (#6*#6+#7*#7)+(#2*#2+#3*#3)-(2*(#6*#2+#7*#3))-(#1*#1) } } + {#2} {#3} {#4} {#5} {#8} + } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxii:nnnnnnnn { f } +% \end{macrocode} +% then we can get $d = b^{2} - 4\times a \times c$ and the usage of $n$. +% \begin{macrocode} +\cs_new:Npn \@@_point_intersect_line_circle_auxiii:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \@@_point_intersect_line_circle_auxiv:ffnnnnnn + { \fp_eval:n { #2 * #2 - 4 * #1 * #3 } } + { \int_if_odd:nTF {#8} { 1 } { -1 } } + {#1} {#2} {#4} {#5} {#6} {#7} + } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiii:nnnnnnnn { fff } +% \end{macrocode} +% We now have all of the intermediate values we require, with one division +% carried out up-front to avoid doing this expensive step twice: +% \begin{enumerate}[label = \#\arabic*, font = \ttfamily] +% \item $a$ +% \item $b$ +% \item $c$ +% \item $d$ +% \item $\pm$(the usage of $n$) +% \item $x_{1}$ +% \item $y_{1}$ +% \item $x_{2}$ +% \item $y_{2}$ +% \end{enumerate} +% There are some final pre-calculations, +% $\mu = \frac{-b \pm \sqrt{d}}{2 \times a}$ +% then, we can yield a result. +% \begin{macrocode} +\cs_new:Npn \@@_point_intersect_line_circle_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \@@_point_intersect_line_circle_auxv:fnnnn + { \fp_eval:n { (-1 * #4 + #2 * sqrt(#1)) / (2 * #3) } } + {#5} {#6} {#7} {#8} + } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxiv:nnnnnnnn { ff } +\cs_new:Npn \@@_point_intersect_line_circle_auxv:nnnnn #1#2#3#4#5 + { + \draw_point:n + { #2 + #1 * (#4 - #2), #3 + #1 * (#5 - #3) } + } +\cs_generate_variant:Nn \@@_point_intersect_line_circle_auxv:nnnnn { f } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \subsection{Interpolation on a line (vector) or arc} % % \begin{macro}[EXP]{\draw_point_interpolate_line:nnn} diff --git a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx index 174764e29d..e20f31bf81 100644 --- a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx index c0e748f262..64aeec907d 100644 --- a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-state.dtx b/macros/latex/contrib/l3experimental/l3draw-state.dtx index 6158be04a3..fc08e1b510 100644 --- a/macros/latex/contrib/l3experimental/l3draw-state.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-state.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx index 5c25b61c35..82be9368a6 100644 --- a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw.dtx b/macros/latex/contrib/l3experimental/l3draw.dtx index bda53293c7..9fd88f8c7f 100644 --- a/macros/latex/contrib/l3experimental/l3draw.dtx +++ b/macros/latex/contrib/l3experimental/l3draw.dtx @@ -110,7 +110,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -528,6 +528,17 @@ % \pkg{pgf}, which has the two centers then the two radii. % \end{function} % +% \begin{function}[EXP]{\draw_point_intersect_line_circle:nnnnn} +% \begin{syntax} +% \cs{draw_point_intersect_line_circle:nnnnn} +% \Arg{point1} \Arg{point2} \Arg{center} \Arg{radius} \Arg{root} +% \end{syntax} +% Evaluates the point at the intersection of one line, joining +% \meta{point1} and \meta{point2}, and a circle with \meta{center} +% and \meta{radius}. If the lines and circle do not intersect and +% error will occur. +% \end{function} +% % \subsubsection{Interpolations} % % \begin{function}[EXP]{\draw_point_interpolate_line:nnn} @@ -1162,7 +1173,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3draw}{2021-08-27}{} +\ProvidesExplPackage{l3draw}{2021-11-12}{} {L3 Experimental core drawing support} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3draw.pdf b/macros/latex/contrib/l3experimental/l3draw.pdf Binary files differindex 42e86d08cc..63b74dc9fd 100644 --- a/macros/latex/contrib/l3experimental/l3draw.pdf +++ b/macros/latex/contrib/l3experimental/l3draw.pdf diff --git a/macros/latex/contrib/l3experimental/l3galley.dtx b/macros/latex/contrib/l3experimental/l3galley.dtx index 877e39b3da..7ce0c01784 100644 --- a/macros/latex/contrib/l3experimental/l3galley.dtx +++ b/macros/latex/contrib/l3experimental/l3galley.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -686,7 +686,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3galley}{2021-08-27}{} +\ProvidesExplPackage{l3galley}{2021-11-12}{} {L3 Experimental galley code} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3galley.pdf b/macros/latex/contrib/l3experimental/l3galley.pdf Binary files differindex 61a9667c91..8f756538d1 100644 --- a/macros/latex/contrib/l3experimental/l3galley.pdf +++ b/macros/latex/contrib/l3experimental/l3galley.pdf diff --git a/macros/latex/contrib/l3experimental/l3graphics.dtx b/macros/latex/contrib/l3experimental/l3graphics.dtx index a3691ae327..9b7860425c 100644 --- a/macros/latex/contrib/l3experimental/l3graphics.dtx +++ b/macros/latex/contrib/l3experimental/l3graphics.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -240,7 +240,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3graphics}{2021-08-27}{} +\ProvidesExplPackage{l3graphics}{2021-11-12}{} {L3 Experimental graphics inclusion support} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3graphics.pdf b/macros/latex/contrib/l3experimental/l3graphics.pdf Binary files differindex a920bded0a..845356b86c 100644 --- a/macros/latex/contrib/l3experimental/l3graphics.pdf +++ b/macros/latex/contrib/l3experimental/l3graphics.pdf diff --git a/macros/latex/contrib/l3experimental/l3opacity.dtx b/macros/latex/contrib/l3experimental/l3opacity.dtx index e2e518fffe..fcbfb83f0f 100644 --- a/macros/latex/contrib/l3experimental/l3opacity.dtx +++ b/macros/latex/contrib/l3experimental/l3opacity.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -97,7 +97,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3opacity}{2021-08-27}{} +\ProvidesExplPackage{l3opacity}{2021-11-12}{} {L3 Experimental opacity support} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3opacity.pdf b/macros/latex/contrib/l3experimental/l3opacity.pdf Binary files differindex cc30509499..16c5c6d756 100644 --- a/macros/latex/contrib/l3experimental/l3opacity.pdf +++ b/macros/latex/contrib/l3experimental/l3opacity.pdf diff --git a/macros/latex/contrib/l3experimental/l3str-format.dtx b/macros/latex/contrib/l3experimental/l3str-format.dtx index 5da80c3a74..0ecbb95c3f 100644 --- a/macros/latex/contrib/l3experimental/l3str-format.dtx +++ b/macros/latex/contrib/l3experimental/l3str-format.dtx @@ -48,7 +48,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -166,7 +166,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3str-format}{2021-08-27}{} +\ProvidesExplPackage{l3str-format}{2021-11-12}{} {L3 Experimental string formatting} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3str-format.pdf b/macros/latex/contrib/l3experimental/l3str-format.pdf Binary files differindex 07dc9eea04..1041b445b6 100644 --- a/macros/latex/contrib/l3experimental/l3str-format.pdf +++ b/macros/latex/contrib/l3experimental/l3str-format.pdf diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.dtx b/macros/latex/contrib/l3experimental/l3sys-shell.dtx index 3ba357ee7c..50424a6685 100644 --- a/macros/latex/contrib/l3experimental/l3sys-shell.dtx +++ b/macros/latex/contrib/l3experimental/l3sys-shell.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -151,7 +151,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3sys-shell}{2021-08-27}{} +\ProvidesExplPackage{l3sys-shell}{2021-11-12}{} {L3 Experimental system shell functions} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.pdf b/macros/latex/contrib/l3experimental/l3sys-shell.pdf Binary files differindex 41b79767a8..91ded20b12 100644 --- a/macros/latex/contrib/l3experimental/l3sys-shell.pdf +++ b/macros/latex/contrib/l3experimental/l3sys-shell.pdf diff --git a/macros/latex/contrib/l3experimental/xcoffins.dtx b/macros/latex/contrib/l3experimental/xcoffins.dtx index 61a6009c9e..f167302265 100644 --- a/macros/latex/contrib/l3experimental/xcoffins.dtx +++ b/macros/latex/contrib/l3experimental/xcoffins.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -672,7 +672,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xcoffins}{2021-08-27}{} +\ProvidesExplPackage{xcoffins}{2021-11-12}{} {L3 Experimental design level coffins} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/xcoffins.pdf b/macros/latex/contrib/l3experimental/xcoffins.pdf Binary files differindex ae301c7c8b..0902947178 100644 --- a/macros/latex/contrib/l3experimental/xcoffins.pdf +++ b/macros/latex/contrib/l3experimental/xcoffins.pdf diff --git a/macros/latex/contrib/l3experimental/xgalley.dtx b/macros/latex/contrib/l3experimental/xgalley.dtx index 64fafabdcb..659ddb2751 100644 --- a/macros/latex/contrib/l3experimental/xgalley.dtx +++ b/macros/latex/contrib/l3experimental/xgalley.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -731,7 +731,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xgalley}{2021-08-27}{} +\ProvidesExplPackage{xgalley}{2021-11-12}{} {L3 Experimental galley} \RequirePackage{xtemplate,l3galley} % \end{macrocode} diff --git a/macros/latex/contrib/l3experimental/xgalley.pdf b/macros/latex/contrib/l3experimental/xgalley.pdf Binary files differindex 2d685ddcca..a0ed251a18 100644 --- a/macros/latex/contrib/l3experimental/xgalley.pdf +++ b/macros/latex/contrib/l3experimental/xgalley.pdf diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md index 82782d208d..a889c04c8c 100644 --- a/macros/latex/contrib/l3kernel/CHANGELOG.md +++ b/macros/latex/contrib/l3kernel/CHANGELOG.md @@ -7,6 +7,19 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-11-12] + +### Fixed +- DeviceN colorspace conversions with alternative model RGB + +### Added +- `.str_set:N`, etc., key properties (issue #1007) +- `\bool_to_str:n` (issue #1010) + +### Changed +- `\prop_..._from_keyval:Nn` functions now support active comma or + equal sign (pull #1012) + ## [2021-10-18] ### Added @@ -971,7 +984,8 @@ this project uses date-based 'snapshot' version identifiers. - Step functions have been added for dim variables, e.g. `\dim_step_inline:nnnn` -[Unreleased]: https://github.com/latex3/latex3/compare/2021-10-18...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-11-12...HEAD +[2021-11-12]: https://github.com/latex3/latex3/compare/2021-10-18...2021-11-12 [2021-10-18]: https://github.com/latex3/latex3/compare/2021-10-17...2021-10-18 [2021-10-17]: https://github.com/latex3/latex3/compare/2021-10-12...2021-10-17 [2021-10-12]: https://github.com/latex3/latex3/compare/2021-08-27...2021-10-12 diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md index 0ceca4ca19..027c1c9636 100644 --- a/macros/latex/contrib/l3kernel/README.md +++ b/macros/latex/contrib/l3kernel/README.md @@ -1,7 +1,7 @@ LaTeX3 Programming Conventions ============================== -Release 2021-10-18 +Release 2021-11-12 Overview -------- diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx index 24246f1ace..01a2dbf0fb 100644 --- a/macros/latex/contrib/l3kernel/expl3.dtx +++ b/macros/latex/contrib/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2021-10-18}% +\def\ExplFileDate{2021-11-12}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf Binary files differindex 60e57d4148..92b32349e6 100644 --- a/macros/latex/contrib/l3kernel/expl3.pdf +++ b/macros/latex/contrib/l3kernel/expl3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf Binary files differindex 19980978f9..eee082fa60 100644 --- a/macros/latex/contrib/l3kernel/interface3.pdf +++ b/macros/latex/contrib/l3kernel/interface3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex index b2c52db293..f64cd3abbb 100644 --- a/macros/latex/contrib/l3kernel/interface3.tex +++ b/macros/latex/contrib/l3kernel/interface3.tex @@ -54,7 +54,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx index d54bc9a70a..5b810b393d 100644 --- a/macros/latex/contrib/l3kernel/l3basics.dtx +++ b/macros/latex/contrib/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1203,7 +1203,7 @@ % Tests whether the \meta{control sequence} is currently free to % be defined. This test is \texttt{false} if the % \meta{control sequence} currently exists (as defined by -% \cs{cs_if_exist:N}). +% \cs{cs_if_exist:NTF}). % \end{function} % % \subsection{Primitive conditionals} diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx index c0c676dd9f..7cf40957e7 100644 --- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx +++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx index 8e000f70f5..c71f489712 100644 --- a/macros/latex/contrib/l3kernel/l3box.dtx +++ b/macros/latex/contrib/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx index e0787f1a0e..ebfb71b81e 100644 --- a/macros/latex/contrib/l3kernel/l3candidates.dtx +++ b/macros/latex/contrib/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3cctab.dtx b/macros/latex/contrib/l3kernel/l3cctab.dtx index 0d53ada539..4669bcc875 100644 --- a/macros/latex/contrib/l3kernel/l3cctab.dtx +++ b/macros/latex/contrib/l3kernel/l3cctab.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -699,7 +699,7 @@ % % \subsection{Category code table conditionals} % -% \begin{macro}{\cctab_if_exist:N,\cctab_if_exist:c} +% \begin{macro}[pTF]{\cctab_if_exist:N,\cctab_if_exist:c} % Checks whether a \meta{cctab~var} is defined. % \begin{macrocode} \prg_new_eq_conditional:NNn \cctab_if_exist:N \cs_if_exist:N diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx index 8ca665469b..718c75d07a 100644 --- a/macros/latex/contrib/l3kernel/l3clist.dtx +++ b/macros/latex/contrib/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx index 1a47fa6b73..ca112398ab 100644 --- a/macros/latex/contrib/l3kernel/l3coffins.dtx +++ b/macros/latex/contrib/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3color.dtx b/macros/latex/contrib/l3kernel/l3color.dtx index cef2e7bef1..b3f10132d3 100644 --- a/macros/latex/contrib/l3kernel/l3color.dtx +++ b/macros/latex/contrib/l3kernel/l3color.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -654,20 +654,20 @@ \tl_set:Nx #4 { \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w } - { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop } + { \use:c { @@_convert_ #1 _ #2 :w } #3 \s_@@_stop } { \use:c { c_@@_fallback_ #2 _tl } } } } \cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV } -\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop +\cs_new:Npn \@@_convert_gray_rgb:w #1 \s_@@_stop { #1 ~ #1 ~ #1 } -\cs_new:Npn \@@_convert_gray_cmyk:w #1 ~ #2 \s_@@_stop +\cs_new:Npn \@@_convert_gray_cmyk:w #1 \s_@@_stop { 0 ~ 0 ~ 0 ~ \fp_eval:n { 1 - #1 } } % \end{macrocode} % These rather odd values are based on \textsc{ntsc} television: the set are % used for the |cmyk| conversion. % \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop +\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 \s_@@_stop { \fp_eval:n { 0.3 * #1 + 0.59 * #2 + 0.11 * #3 } } % \end{macrocode} % The conversion from |rgb| to |cmyk| is the most complex: a two-step @@ -677,7 +677,7 @@ % Moreover, as the likelihood of anyone using a non-unitary matrix here is % tiny, we simplify and treat those two concepts as no-ops. % \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop +\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 \s_@@_stop { \exp_args:Nf \@@_convert_rgb_cmyk:nnnn { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } } {#1} {#2} {#3} @@ -689,9 +689,9 @@ \fp_eval:n { min ( 1 , max ( 0 , 1 - #4 - #1 ) ) } \c_space_tl #1 } -\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop +\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop { \fp_eval:n { 1 - min ( 1 , 0.3 * #1 + 0.59 * #2 + 0.11 * #3 + #4 ) } } -\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop +\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop { \fp_eval:n { 1 - min ( 1 , #1 + #4 ) } \c_space_tl \fp_eval:n { 1 - min ( 1 , #2 + #4 ) } \c_space_tl @@ -1664,7 +1664,10 @@ { \fp_compare:nNnTF {#1} = { 0 } { 00 } - { \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } } + { + \fp_compare:nNnT { #1 * 255 } < { 16 } { 0 } + \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } + } } \cs_new_protected:cpn { @@_export_space-sep-rgb:Nw } #1#2 \s_@@_stop { \tl_set:Nn #1 {#2} } @@ -1930,7 +1933,7 @@ } \cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #4} ~ @@ -1945,7 +1948,7 @@ } \cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #4} ~ @@ -1959,16 +1962,16 @@ } \cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6 { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 \s_@@_stop { \fp_eval:n {##1 * #3} ~ \fp_eval:n {##1 * #3} ~ @@ -1982,11 +1985,11 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_model_convert:nnn #1#2#3 { - \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 \s_@@_stop { \exp_not:N \exp_args:NNe \exp_not:N \use:nn \exp_not:c { @@_convert_ #2 _ #3 :w } - { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 ~ ##2 \s_@@_stop } + { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 \s_@@_stop } \c_space_tl \exp_not:N \s_@@_stop } } @@ -2018,11 +2021,11 @@ \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl } { \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 } - \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 \s_@@_stop { 0 ~ 0 ~ 0 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 \s_@@_stop { 1 ~ 1 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop + \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 \s_@@_stop { 1 } } { @@ -2311,7 +2314,7 @@ \prop_get:NnN \g_@@_alternative_values_prop {##1} \l_@@_value_tl \exp_after:wN \@@_model_devicen_transform:w - \l_@@_value_tl , 0 , 0 , 0 \s_@@_stop {#1} {#2} + \l_@@_value_tl , 0 , 0 , 0 , \s_@@_stop {#1} {#2} } \tl_put_right:Nx \l_@@_internal_tl { @@ -2349,7 +2352,7 @@ { \@@_model_devicen_transform:nnn {#5} { 1 } {#1} } \cs_new_protected:cpn { @@_model_devicen_transform_3:nnnnn } #1#2#3#4#5 { - \clist_map_inline { #1 , #2 , #3 } + \clist_map_inline:nn { #1 , #2 , #3 } { \@@_model_devicen_transform:nnn {#5} { 3 } {##1} } } \cs_new_protected:cpn { @@_model_devicen_transform_4:nnnnn } #1#2#3#4#5 @@ -2407,8 +2410,9 @@ { \exp_not:c { @@_convert_devicen_ #2 : \prg_replicate:nn {#3} { n } w } \prg_replicate:nn {#3} { { 1 } } - ##1 \exp_not:N \s_@@_mark + ##1 ~ \exp_not:N \s_@@_mark \clist_map_function:nN {#4} \@@_model_devicen_convert:n + {} \exp_not:N \s_@@_stop } } @@ -2490,7 +2494,7 @@ \cs_new:Npn \@@_convert_devicen_rgb:nnnw #1#2#3#4 ~ #5 \s_@@_mark #6#7 \s_@@_stop { - \@@_convert_devicen_cmyk:nnnnnn {#4} {#1} {#2} {#3} #6 + \@@_convert_devicen_rgb:nnnnnnn {#4} {#1} {#2} {#3} #6 #5 \s_@@_mark #7 \s_@@_stop } \cs_new:Npn \@@_convert_devicen_rgb:nnnnnnn #1#2#3#4#5#6#7 diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx index cbc2ba0dd3..39c210f013 100644 --- a/macros/latex/contrib/l3kernel/l3debug.dtx +++ b/macros/latex/contrib/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx index 118446f74d..c4ac6b343f 100644 --- a/macros/latex/contrib/l3kernel/l3deprecation.dtx +++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx index f8ddfd6744..3926f4298b 100644 --- a/macros/latex/contrib/l3kernel/l3doc.dtx +++ b/macros/latex/contrib/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % \tableofcontents % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx index 77b11bec37..56d569dc86 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.dtx +++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf Binary files differindex 62968c5aa0..2a9399305e 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.pdf +++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx index de04809b76..ff7dafb094 100644 --- a/macros/latex/contrib/l3kernel/l3expan.dtx +++ b/macros/latex/contrib/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx index e2c608cdfc..59322d5c92 100644 --- a/macros/latex/contrib/l3kernel/l3file.dtx +++ b/macros/latex/contrib/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -876,8 +876,8 @@ % \cs{file_if_exist_input:nF} \Arg{file name} \Arg{false code} % \end{syntax} % Searches for \meta{file name} using the current \TeX{} search -% path and the additional paths controlled by -% \cs{file_path_include:n}. If found then +% path and the additional paths included in \cs{l_file_search_path_seq}. +% If found then % reads in the file as additional \LaTeX{} source as described for % \cs{file_input:n}, otherwise inserts the \meta{false code}. % Note that these functions do not raise diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx index 7a6712d474..86e6f65a9b 100644 --- a/macros/latex/contrib/l3kernel/l3flag.dtx +++ b/macros/latex/contrib/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx index 357481da6b..18ed230b7f 100644 --- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx index e735876dd4..edae5678c2 100644 --- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx index bb869cd5ca..759a6e1c92 100644 --- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx index b113e024f7..0ae265ad82 100644 --- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx index f5f58acbe6..89769f7ad8 100644 --- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1000,8 +1000,7 @@ \cs_new:Npn \@@_pow_normal_o:ww \s_@@ \@@_chk:w 1 #1#2#3; \s_@@ \@@_chk:w #4#5 { - \if_int_compare:w \@@_str_if_eq:nn { #2 #3 } - { 1 {1000} {0000} {0000} {0000} } = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { #2 #3 } { 1 {1000} {0000} {0000} {0000} } \if_int_compare:w #4 #1 = 32 \exp_stop_f: \exp_after:wN \@@_case_return_ii_o:ww \fi: diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx index 820faac536..ee1a7dfbed 100644 --- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx index 254983bcad..64f25bcd70 100644 --- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx index c07bbc130f..e2648f74fa 100644 --- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1755,9 +1755,7 @@ { \if_catcode:w \scan_stop: \exp_not:N #1 \if_meaning:w \scan_stop: #1 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@ } { \exp_not:N #1 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@ } { \exp_not:N #1 } 0 \msg_expandable_error:nnn { fp } { after-e } { floating~point~ } @@ -1769,9 +1767,7 @@ \prg_return_false: \fi: \else: - \if_int_compare:w - \@@_str_if_eq:nn { \int_value:w #1 } { \tex_the:D #1 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \int_value:w #1 } { \tex_the:D #1 } \int_value:w #1 \else: 0 @@ -2263,9 +2259,7 @@ \cs_new:Npn \@@_parse_infix:NN #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN \else: @@ -2315,9 +2309,7 @@ \cs_new:Npn \@@_parse_infix_after_paren:NN #1 #2 { \if_catcode:w \scan_stop: \exp_not:N #2 - \if_int_compare:w - \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } - = \c_zero_int + \if:w 0 \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 } \exp_after:wN \exp_after:wN \exp_after:wN \@@_parse_infix_mark:NNN \else: diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx index 8defd82e8a..2edef81d72 100644 --- a/macros/latex/contrib/l3kernel/l3fp-random.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx index 4669afeff6..f261a87690 100644 --- a/macros/latex/contrib/l3kernel/l3fp-round.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx index d12dfb5e9f..41736a6c92 100644 --- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx index e7147443b1..4ae3c33f4b 100644 --- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx index eef38c230f..ed3468a076 100644 --- a/macros/latex/contrib/l3kernel/l3fp.dtx +++ b/macros/latex/contrib/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx index 9646b84a94..5afd5f774a 100644 --- a/macros/latex/contrib/l3kernel/l3fparray.dtx +++ b/macros/latex/contrib/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx index 1e5ded3b6b..749de68557 100644 --- a/macros/latex/contrib/l3kernel/l3int.dtx +++ b/macros/latex/contrib/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx index 13ba3a394c..3d95e6e04b 100644 --- a/macros/latex/contrib/l3kernel/l3intarray.dtx +++ b/macros/latex/contrib/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx index bdc195d0a1..e9da0d7e8c 100644 --- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx +++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx index e85bbc1d97..355de420bd 100644 --- a/macros/latex/contrib/l3kernel/l3keys.dtx +++ b/macros/latex/contrib/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -178,10 +178,10 @@ % \begin{function}[updated = 2013-07-08] % {.bool_set:N, .bool_set:c, .bool_gset:N, .bool_gset:c} % \begin{syntax} -% \meta{key} .bool_set:N = \meta{boolean} +% \meta{key} .bool_set:N = \meta{boolean variable} % \end{syntax} -% Defines \meta{key} to set \meta{boolean} to \meta{value} (which -% must be either \texttt{true} or \texttt{false}). If the variable +% Defines \meta{key} to set \meta{boolean variable} to \meta{value} (which +% must be either \enquote{\texttt{true}} or \enquote{\texttt{false}}). If the variable % does not exist, it will be created globally at the point that % the key is set up. % \end{function} @@ -192,12 +192,12 @@ % .bool_gset_inverse:N, .bool_gset_inverse:c % } % \begin{syntax} -% \meta{key} .bool_set_inverse:N = \meta{boolean} +% \meta{key} .bool_set_inverse:N = \meta{boolean variable} % \end{syntax} -% Defines \meta{key} to set \meta{boolean} to the logical -% inverse of \meta{value} (which must be either \texttt{true} or -% \texttt{false}). -% If the \meta{boolean} does not exist, it will be created globally +% Defines \meta{key} to set \meta{boolean variable} to the logical +% inverse of \meta{value} (which must be either \enquote{\texttt{true}} or +% \enquote{\texttt{false}}). +% If the \meta{boolean variable} does not exist, it will be created globally % at the point that the key is set up. % \end{function} % @@ -435,6 +435,27 @@ % require a value at point-of-use unless a default is set. % \end{function} % +% \begin{function}[added = 2021-10-30] +% {.str_set:N, .str_set:c, .str_gset:N, .str_gset:c} +% \begin{syntax} +% \meta{key} .str_set:N = \meta{string variable} +% \end{syntax} +% Defines \meta{key} to set \meta{string variable} to \meta{value}. +% If the variable does not exist, it is created globally +% at the point that the key is set up. +% \end{function} +% +% \begin{function}[added = 2021-10-30] +% {.str_set_x:N, .str_set_x:c, .str_gset_x:N, .str_gset_x:c} +% \begin{syntax} +% \meta{key} .str_set_x:N = \meta{string variable} +% \end{syntax} +% Defines \meta{key} to set \meta{string variable} to \meta{value}, +% which will be subjected to an \texttt{x}-type expansion +% (\emph{i.e.}~using \cs{str_set:Nx}). If the variable does not exist, +% it is created globally at the point that the key is set up. +% \end{function} +% % \begin{function}{.tl_set:N, .tl_set:c, .tl_gset:N, .tl_gset:c} % \begin{syntax} % \meta{key} .tl_set:N = \meta{token list variable} @@ -467,7 +488,7 @@ % \end{syntax} % Specifies that \meta{key} cannot receive a \meta{value} when used. % If a \meta{value} is given then an error will be issued. Setting -% the property \texttt{false} cancels the restriction. +% the property \enquote{\texttt{false}} cancels the restriction. % \end{function} % % \begin{function}[added = 2015-07-14]{.value_required:n} @@ -476,7 +497,7 @@ % \end{syntax} % Specifies that \meta{key} must receive a \meta{value} when used. % If a \meta{value} is not given then an error will be issued. Setting -% the property \texttt{false} cancels the restriction. +% the property \enquote{\texttt{false}} cancels the restriction. % \end{function} % % \section{Sub-dividing keys} @@ -1001,6 +1022,16 @@ % \end{macrocode} % \end{variable} % +% \begin{variable}{\l__kernel_keyval_allow_blank_keys_bool} +% The general behavior of the \pkg{l3keys} module is to throw an error on +% blank key names. However to support the usage of \cs{keyval_parse:nnn} in +% the \pkg{l3prop} module we allow this error to be switched off temporarily +% and just ignore blank names. +% \begin{macrocode} +\bool_new:N \l__kernel_keyval_allow_blank_keys_bool +% \end{macrocode} +% \end{variable} +% % This temporary macro will be used since some of the definitions will need an % active comma or equals sign. Inside of this macro |#1| will be the active % comma and |#2| will be the active equals sign. @@ -1343,9 +1374,11 @@ % \begin{macrocode} \cs_new:Npn \@@_blank_true:w \s_@@_mark \s_@@_stop \@@_trim:nN #1 \@@_key:nn { \@@_loop_other:nnw } -\cs_new:Npn \@@_blank_key_error:w #1 \@@_loop_other:nnw +\cs_new:Npn \@@_blank_key_error:w \s_@@_mark \s_@@_stop #1 \@@_loop_other:nnw { - \msg_expandable_error:nn { keyval } { blank-key-name } + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { #1 } + { \msg_expandable_error:nn { keyval } { blank-key-name } } \@@_loop_other:nnw } % \end{macrocode} @@ -2052,7 +2085,7 @@ } { \msg_error:nnx { keys } - { property-boolean-values-only } + { boolean-values-only } { .value_ #1 :n } } } @@ -2398,6 +2431,34 @@ % \end{macro} % \end{macro} % +% \begin{macro}{.str_set:N, .str_set:c} +% \begin{macro}{.str_gset:N, .str_gset:c} +% \begin{macro}{.str_set_x:N, .str_set_x:c} +% \begin{macro}{.str_gset_x:N, .str_gset_x:c} +% Setting a variable is very easy: just pass the data along. +% \begin{macrocode} +\cs_new_protected:cpn { \c_@@_props_root_str .str_set:N } #1 + { \@@_variable_set:NnnN #1 { str } { } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set:c } #1 + { \@@_variable_set:cnnN {#1} { str } { } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set_x:N } #1 + { \@@_variable_set:NnnN #1 { str } { } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_set_x:c } #1 + { \@@_variable_set:cnnN {#1} { str } { } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset:N } #1 + { \@@_variable_set:NnnN #1 { str } { g } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset:c } #1 + { \@@_variable_set:cnnN {#1} { str } { g } n } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset_x:N } #1 + { \@@_variable_set:NnnN #1 { str } { g } x } +\cs_new_protected:cpn { \c_@@_props_root_str .str_gset_x:c } #1 + { \@@_variable_set:cnnN {#1} { str } { g } x } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{.tl_set:N, .tl_set:c} % \begin{macro}{.tl_gset:N, .tl_gset:c} % \begin{macro}{.tl_set_x:N, .tl_set_x:c} diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx index 29872a655f..c04f318fad 100644 --- a/macros/latex/contrib/l3kernel/l3legacy.dtx +++ b/macros/latex/contrib/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx index f95ddecc82..ac63d0f89a 100644 --- a/macros/latex/contrib/l3kernel/l3luatex.dtx +++ b/macros/latex/contrib/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx index 722f902e29..5804d528ca 100644 --- a/macros/latex/contrib/l3kernel/l3msg.dtx +++ b/macros/latex/contrib/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -1979,7 +1979,7 @@ \msg_new:nnn { prg } { negative-replication } { Negative~argument~for~\iow_char:N\\prg_replicate:nn. } \msg_new:nnn { prop } { prop-keyval } - { Missing/extra~'='~in~'#1'~(in~'..._keyval:Nn') } + { Missing~'='~in~'#1'~(in~'..._keyval:Nn') } \msg_new:nnn { kernel } { unknown-comparison } { Relation~'#1'~not~among~=,<,>,==,!=,<=,>=. } \msg_new:nnn { kernel } { zero-step } diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx index 9a34a74d24..2f3c8460ca 100644 --- a/macros/latex/contrib/l3kernel/l3names.dtx +++ b/macros/latex/contrib/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf Binary files differindex aea97df6cd..e1c52b5cc3 100644 --- a/macros/latex/contrib/l3kernel/l3news.pdf +++ b/macros/latex/contrib/l3kernel/l3news.pdf diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf Binary files differindex 8ca02b765d..1b6dc0fbe3 100644 --- a/macros/latex/contrib/l3kernel/l3news01.pdf +++ b/macros/latex/contrib/l3kernel/l3news01.pdf diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf Binary files differindex d4f88d8113..28c7194858 100644 --- a/macros/latex/contrib/l3kernel/l3news02.pdf +++ b/macros/latex/contrib/l3kernel/l3news02.pdf diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf Binary files differindex 6ff2937537..a52b994d20 100644 --- a/macros/latex/contrib/l3kernel/l3news03.pdf +++ b/macros/latex/contrib/l3kernel/l3news03.pdf diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf Binary files differindex 42b13884be..dcaa766fd7 100644 --- a/macros/latex/contrib/l3kernel/l3news04.pdf +++ b/macros/latex/contrib/l3kernel/l3news04.pdf diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf Binary files differindex 87426871bc..5110b7df1a 100644 --- a/macros/latex/contrib/l3kernel/l3news05.pdf +++ b/macros/latex/contrib/l3kernel/l3news05.pdf diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf Binary files differindex 825152e720..7f5bd08342 100644 --- a/macros/latex/contrib/l3kernel/l3news06.pdf +++ b/macros/latex/contrib/l3kernel/l3news06.pdf diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf Binary files differindex 3309098d71..57e35fbd7c 100644 --- a/macros/latex/contrib/l3kernel/l3news07.pdf +++ b/macros/latex/contrib/l3kernel/l3news07.pdf diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf Binary files differindex beed982815..28c0de51a5 100644 --- a/macros/latex/contrib/l3kernel/l3news08.pdf +++ b/macros/latex/contrib/l3kernel/l3news08.pdf diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf Binary files differindex 4e7870ec4e..571f491b28 100644 --- a/macros/latex/contrib/l3kernel/l3news09.pdf +++ b/macros/latex/contrib/l3kernel/l3news09.pdf diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf Binary files differindex 6c12559b81..d0239237a2 100644 --- a/macros/latex/contrib/l3kernel/l3news10.pdf +++ b/macros/latex/contrib/l3kernel/l3news10.pdf diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf Binary files differindex 36b254b236..e5cc04782c 100644 --- a/macros/latex/contrib/l3kernel/l3news11.pdf +++ b/macros/latex/contrib/l3kernel/l3news11.pdf diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf Binary files differindex b199276937..b619536016 100644 --- a/macros/latex/contrib/l3kernel/l3news12.pdf +++ b/macros/latex/contrib/l3kernel/l3news12.pdf diff --git a/macros/latex/contrib/l3kernel/l3pdf.dtx b/macros/latex/contrib/l3kernel/l3pdf.dtx index 0ccb6817f1..8a4b70eb16 100644 --- a/macros/latex/contrib/l3kernel/l3pdf.dtx +++ b/macros/latex/contrib/l3kernel/l3pdf.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf Binary files differindex cdaa3fe63b..06fe96aef0 100644 --- a/macros/latex/contrib/l3kernel/l3prefixes.pdf +++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx index ae119af206..4a91ce9a8a 100644 --- a/macros/latex/contrib/l3kernel/l3prg.dtx +++ b/macros/latex/contrib/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -313,6 +313,16 @@ % based on this result. % \end{function} % +% \begin{function}[EXP, added = 2021-11-01]{\bool_to_str:N, \bool_to_str:c, \bool_to_str:n} +% \begin{syntax} +% \cs{bool_to_str:N} \meta{boolean} +% \cs{bool_to_str:n} \meta{boolean expression} +% \end{syntax} +% Expands to the letters \texttt{true} or \texttt{false} depending on +% the logical truth of the \meta{boolean} or \meta{boolean +% expression}. +% \end{function} +% % \begin{function}[added = 2012-02-09, updated = 2021-04-29]{\bool_show:N, \bool_show:c} % \begin{syntax} % \cs{bool_show:N} \meta{boolean} @@ -961,20 +971,24 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[EXP]{\bool_to_str:N, \bool_to_str:c, \bool_to_str:n} +% Expands to \texttt{true} or \texttt{false} with category code letter. +% \begin{macrocode} +\cs_new:Npn \bool_to_str:N #1 { \bool_if:NTF #1 { true } { false } } +\cs_generate_variant:Nn \bool_to_str:N { c } +\cs_new:Npn \bool_to_str:n #1 { \bool_if:nTF {#1} { true } { false } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\bool_show:n, \bool_log:n} -% \begin{macro}{\@@_to_str:n} -% Show the truth value of the boolean, as \texttt{true} or -% \texttt{false}. +% Show the truth value of the boolean. % \begin{macrocode} \cs_new_protected:Npn \bool_show:n - { \msg_show_eval:Nn \@@_to_str:n } + { \msg_show_eval:Nn \bool_to_str:n } \cs_new_protected:Npn \bool_log:n - { \msg_log_eval:Nn \@@_to_str:n } -\cs_new:Npn \@@_to_str:n #1 - { \bool_if:nTF {#1} { true } { false } } + { \msg_log_eval:Nn \bool_to_str:n } % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{\bool_show:N, \bool_show:c, \bool_log:N, \bool_log:c, \@@_show:NN} % Show the truth value of the boolean, as \texttt{true} or diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx index df20a5c02c..ca6f9a3467 100644 --- a/macros/latex/contrib/l3kernel/l3prop.dtx +++ b/macros/latex/contrib/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -52,10 +52,10 @@ % \LaTeX3 implements a \enquote{property list} data type, which contain % an unordered list of entries each of which consists of a \meta{key} and % an associated \meta{value}. The \meta{key} and \meta{value} may both -% be any \meta{balanced text}, but the \meta{key} is processed using -% \cs{tl_to_str:n}, meaning that category codes are ignored. It is -% possible to map functions to property lists such that the function is -% applied to every key--value pair within the list. +% be any \meta{balanced text}, the \meta{key} is processed using +% \cs{tl_to_str:n}, meaning that category codes are ignored. It is possible to +% map functions to property lists such that the function is applied to every +% key--value pair within the list. % % Each entry in a property list must have a unique \meta{key}: if an entry is % added to a property list which already contains the \meta{key} then the new @@ -111,7 +111,7 @@ % \meta{property list_2}. % \end{function} % -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] +% \begin{function}[added = 2017-11-28, updated = 2021-11-07] % { % \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn, % \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn, @@ -131,9 +131,11 @@ % group then a set of outer braces is removed. This enables both the % \meta{key} and the \meta{value} to contain spaces, commas or equal % signs. The \meta{key} is then processed by \cs{tl_to_str:n}. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % -% \begin{function}[added = 2017-11-28, updated = 2019-08-25] +% \begin{function}[added = 2017-11-28, updated = 2021-11-07] % {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn} % \begin{syntax} % \cs{prop_const_from_keyval:Nn} \meta{prop~var} @@ -147,6 +149,8 @@ % contain key--value pairs given in the second argument, processed in % the way described for \cs{prop_set_from_keyval:Nn}. If duplicate % keys appear only the last of the values is kept. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % % \section{Adding and updating property list entries} @@ -205,7 +209,7 @@ % last value, namely the value in \meta{prop~var_3} is kept. % \end{function} % -% \begin{function}[added = 2021-05-16] +% \begin{function}[added = 2021-05-16, updated = 2021-11-07] % { % \prop_put_from_keyval:Nn, \prop_put_from_keyval:cn, % \prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn, @@ -230,6 +234,8 @@ % \cs{prop_concat:NNN}. In particular, the \meta{keys} and % \meta{values} are space-trimmed and unbraced as described in % \cs{prop_set_from_keyval:Nn}. +% This function correctly detects the |=| and |,| signs provided they +% have the standard category code~$12$ or they are active. % \end{function} % % \section{Recovering values from property lists} @@ -793,7 +799,7 @@ \cs_new_protected:Npn \@@_concat:NNNN #1#2#3#4 { \prop_set_eq:NN \l_@@_internal_prop #3 - \prop_map_tokens:Nn #4 { \prop_put:Nnn \l_@@_internal_prop } + \prop_map_inline:Nn #4 { \prop_put:Nnn \l_@@_internal_prop {##1} {##2} } #1 #2 \l_@@_internal_prop } % \end{macrocode} @@ -804,16 +810,7 @@ % \begin{macro}{\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn} % \begin{macro}{\prop_put_from_keyval:Nn, \prop_put_from_keyval:cn} % \begin{macro}{\prop_gput_from_keyval:Nn, \prop_gput_from_keyval:cn} -% \begin{macro} -% { -% \@@_from_keyval:n, -% \@@_from_keyval_loop:w, -% \@@_from_keyval_split:Nw, -% \@@_from_keyval_key:n, -% \@@_from_keyval_key:w, -% \@@_from_keyval_value:n, -% \@@_from_keyval_value:w -% } +% \begin{macro}{\@@_missing_eq:n} % To avoid tracking throughout the loop the variable name and whether % the assignment is local/global, do everything in a scratch variable % and empty it afterwards to avoid wasting memory. Loop through items @@ -832,80 +829,48 @@ % output one key--value pair for the property list; otherwise complain % about a missing or extra~|=|. % \begin{macrocode} -\cs_new_protected:Npn \prop_set_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_set_from_keyval:Nn #1 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} - \prop_set_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \prop_clear:N #1 + \prop_put_from_keyval:Nn #1 } \cs_generate_variant:Nn \prop_set_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_gset_from_keyval:Nn #1 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} - \prop_gset_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \prop_gclear:N #1 + \prop_gput_from_keyval:Nn #1 } \cs_generate_variant:Nn \prop_gset_from_keyval:Nn { c } \cs_new_protected:Npn \prop_const_from_keyval:Nn #1#2 { - \prop_clear:N \l_@@_internal_prop - \@@_from_keyval:n {#2} + \prop_set_from_keyval:Nn \l_@@_internal_prop {#2} \tl_const:Nx #1 { \exp_not:o \l_@@_internal_prop } \prop_clear:N \l_@@_internal_prop } \cs_generate_variant:Nn \prop_const_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_put_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_put_from_keyval:Nn { - \prop_set_eq:NN \l_@@_internal_prop #1 - \@@_from_keyval:n {#2} - \prop_set_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { \@@_keyval_parse:NNNn \c_true_bool } + { \@@_keyval_parse:NNNn \c_false_bool } + \prop_put:Nnn } \cs_generate_variant:Nn \prop_put_from_keyval:Nn { c } -\cs_new_protected:Npn \prop_gput_from_keyval:Nn #1#2 +\cs_new_protected:Npn \prop_gput_from_keyval:Nn { - \prop_set_eq:NN \l_@@_internal_prop #1 - \@@_from_keyval:n {#2} - \prop_gset_eq:NN #1 \l_@@_internal_prop - \prop_clear:N \l_@@_internal_prop + \bool_if:NTF \l__kernel_keyval_allow_blank_keys_bool + { \@@_keyval_parse:NNNn \c_true_bool } + { \@@_keyval_parse:NNNn \c_false_bool } + \prop_gput:Nnn } \cs_generate_variant:Nn \prop_gput_from_keyval:Nn { c } -\cs_new_protected:Npn \@@_from_keyval:n #1 - { - \@@_from_keyval_loop:w \prg_do_nothing: #1 , - \q_@@_recursion_tail , \q_@@_recursion_stop - } -\cs_new_protected:Npn \@@_from_keyval_loop:w #1 , - { - \@@_if_recursion_tail_stop:o {#1} - \@@_from_keyval_split:Nw \@@_from_keyval_key:n - #1 = = \s_@@_stop {#1} - \@@_from_keyval_loop:w \prg_do_nothing: - } -\cs_new_protected:Npn \@@_from_keyval_split:Nw #1#2 = - { \tl_trim_spaces_apply:oN {#2} #1 } -\cs_new_protected:Npn \@@_from_keyval_key:n #1 - { \@@_from_keyval_key:w #1 \s_@@_mark } -\cs_new_protected:Npn \@@_from_keyval_key:w #1 \s_@@_mark #2 \s_@@_stop +\cs_new_protected:Npn \@@_missing_eq:n + { \msg_error:nnn { prop } { prop-keyval } } +\cs_new_protected:Npn \@@_keyval_parse:NNNn #1#2#3#4 { - \@@_from_keyval_split:Nw \@@_from_keyval_value:n - \prg_do_nothing: #2 \s_@@_stop {#1} - } -\cs_new_protected:Npn \@@_from_keyval_value:n #1 - { \@@_from_keyval_value:w #1 \s_@@_mark } -\cs_new_protected:Npn \@@_from_keyval_value:w #1 \s_@@_mark #2 \s_@@_stop #3#4 - { - \tl_if_single:nTF {#2} - { \prop_put:Nnn \l_@@_internal_prop {#3} {#1} } - { - \tl_if_empty:nF { #3 #1 #2 } - { - \msg_error:nnx { prop } { prop-keyval } - { \exp_not:o {#4} } - } - } + \bool_set_eq:NN \l__kernel_keyval_allow_blank_keys_bool \c_true_bool + \keyval_parse:nnn \@@_missing_eq:n { #2 #3 } {#4} + \bool_set_eq:NN \l__kernel_keyval_allow_blank_keys_bool #1 } % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx index a2d1080356..907bd9453e 100644 --- a/macros/latex/contrib/l3kernel/l3quark.dtx +++ b/macros/latex/contrib/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx index db1ddee245..ac70e76eea 100644 --- a/macros/latex/contrib/l3kernel/l3regex.dtx +++ b/macros/latex/contrib/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -83,11 +83,12 @@ % % If a regular expression is to be used several times, % it can be compiled once, and stored in a regex -% variable using \cs{regex_const:Nn}. For example, +% variable using \cs{regex_set:Nn}. For example, % \begin{verbatim} -% \regex_const:Nn \c_foo_regex { \c{begin} \cB. (\c[^BE].*) \cE. } +% \regex_new:N \l_foo_regex +% \regex_set:Nn \l_foo_regex { \c{begin} \cB. (\c[^BE].*) \cE. } % \end{verbatim} -% stores in \cs[no-index]{c_foo_regex} a regular expression which matches the +% stores in \cs[no-index]{l_foo_regex} a regular expression which matches the % starting marker for an environment: \cs[no-index]{begin}, followed by a % begin-group token (|\cB.|), then any number of tokens which are % neither begin-group nor end-group character tokens (|\c[^BE].*|), @@ -164,7 +165,7 @@ % |\A|, |\B|, \ldots{} have special meanings; % \item non-alphanumeric printable ascii characters can (and should) % always be escaped: many of them have special meanings (\emph{e.g.}, -% use |\(|, |\)|, |\?|, |\.|); +% use |\(|, |\)|, |\?|, |\.|, |\^|); % \item spaces should always be escaped (even in character % classes); % \item any other character may be escaped or not, without any @@ -335,11 +336,14 @@ % \meta{regex}, anchored at the beginning and end, so that |\c{begin}| % matches exactly \cs[no-index]{begin}, and nothing else. % \item[\\cX] Applies to the next object, which can be a character, -% character property, class, or group, and forces this object to -% only match tokens with category |X| (any of |CBEMTPUDSLOA|. For -% instance, |\cL[A-Z\d]| matches uppercase letters and digits of -% category code letter, |\cC.| matches any control sequence, and -% |\cO(abc)| matches |abc| where each character has category other. +% escape character sequence such as |\x{0A}|, character class, or +% group, and forces this object to only match tokens with category +% |X| (any of |CBEMTPUDSLOA|. For instance, |\cL[A-Z\d]| matches +% uppercase letters and digits of category code letter, |\cC.| +% matches any control sequence, and |\cO(abc)| matches |abc| where +% each character has category other.\footnote{This last example also +% captures \enquote{\texttt{abc}} as a regex group; to avoid this +% use a non-capturing group \texttt{\textbackslash cO(?:abc)}.} % \item[{\\c[XYZ]}] Applies to the next object, and forces it to only % match tokens with category |X|, |Y|, or |Z| (each being any of % |CBEMTPUDSLOA|). For instance, |\c[LSO](..)| matches two tokens of @@ -531,21 +535,27 @@ % \meta{regex~var} is initially such that it never matches. % \end{function} % -% \begin{function}[added = 2017-05-26] -% {\regex_set:Nn, \regex_gset:Nn, \regex_const:Nn} +% \begin{function}[added = 2017-05-26]{\regex_set:Nn, \regex_gset:Nn} % \begin{syntax} % \cs{regex_set:Nn} \meta{regex~var} \Arg{regex} % \end{syntax} -% Stores a compiled version of the \meta{regular expression} -% in the \meta{regex~var}. For instance, this function can be used -% as +% Stores a compiled version of the \meta{regular expression} in the +% \meta{regex~var}. The assignment is local for \cs{regex_set:Nn} and +% global for \cs{regex_gset:Nn}. For instance, this function can be +% used as % \begin{verbatim} % \regex_new:N \l_my_regex % \regex_set:Nn \l_my_regex { my\ (simple\ )? reg(ex|ular\ expression) } % \end{verbatim} -% The assignment is local for \cs{regex_set:Nn} and global for -% \cs{regex_gset:Nn}. Use \cs{regex_const:Nn} for compiled expressions -% which never change. +% \end{function} +% +% \begin{function}[added = 2017-05-26]{\regex_const:Nn} +% \begin{syntax} +% \cs{regex_const:Nn} \meta{regex~var} \Arg{regex} +% \end{syntax} +% Creates a new constant \meta{regex~var} or raises an error if the name +% is already taken. The value of the \meta{regex~var} is set +% globally to the compiled version of the \meta{regular expression}. % \end{function} % % \begin{function}[added = 2021-04-26, updated = 2021-04-29] @@ -722,7 +732,7 @@ % locally to \meta{tl~var}. % \end{function} % -% \section{Constants and variables} +% \section{Scratch regular expressions} % % \begin{variable}[added = 2017-12-11]{\l_tmpa_regex, \l_tmpb_regex} % Scratch regex for local assignment. These are never used by diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx index 5585aa3ddb..5420a6df3e 100644 --- a/macros/latex/contrib/l3kernel/l3seq.dtx +++ b/macros/latex/contrib/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx index 1556f14ed8..ef814af3f9 100644 --- a/macros/latex/contrib/l3kernel/l3skip.dtx +++ b/macros/latex/contrib/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx index 8261afa088..6315417c35 100644 --- a/macros/latex/contrib/l3kernel/l3sort.dtx +++ b/macros/latex/contrib/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx index 72c260cdc0..edc2dd3cf5 100644 --- a/macros/latex/contrib/l3kernel/l3str-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx index e84e2162a2..40fd7437f0 100644 --- a/macros/latex/contrib/l3kernel/l3str.dtx +++ b/macros/latex/contrib/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -95,7 +95,7 @@ % appropriately. % \end{itemize} % -% \section{Building strings} +% \section{Creating and initialising string variables} % % \begin{function}[added = 2015-09-18]{\str_new:N, \str_new:c} % \begin{syntax} @@ -164,6 +164,16 @@ % this function does not convert their contents to a string. % \end{function} % +% \begin{function}[EXP, pTF, added = 2015-09-18] +% {\str_if_exist:N, \str_if_exist:c} +% \begin{syntax} +% \cs{str_if_exist_p:N} \meta{str~var} +% \cs{str_if_exist:NTF} \meta{str~var} \Arg{true code} \Arg{false code} +% \end{syntax} +% Tests whether the \meta{str~var} is currently defined. This does not +% check that the \meta{str~var} really is a string. +% \end{function} +% % \section{Adding data to string variables} % % \begin{function}[added = 2015-09-18, updated = 2018-07-28] @@ -210,84 +220,8 @@ % var} are not automatically converted to a string. % \end{function} % -% \section{Modifying string variables} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_replace_once:Nnn, \str_replace_once:cnn, -% \str_greplace_once:Nnn, \str_greplace_once:cnn -% } -% \begin{syntax} -% \cs{str_replace_once:Nnn} \meta{str~var} \Arg{old} \Arg{new} -% \end{syntax} -% Converts the \meta{old} and \meta{new} token lists to strings, then -% replaces the first (leftmost) occurrence of \meta{old string} in the -% \meta{str~var} with \meta{new string}. -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_replace_all:Nnn, \str_replace_all:cnn, -% \str_greplace_all:Nnn, \str_greplace_all:cnn -% } -% \begin{syntax} -% \cs{str_replace_all:Nnn} \meta{str~var} \Arg{old} \Arg{new} -% \end{syntax} -% Converts the \meta{old} and \meta{new} token lists to strings, then -% replaces all occurrences of \meta{old string} in the -% \meta{str~var} with \meta{new string}. -% As this function -% operates from left to right, the pattern \meta{old string} -% may remain after the replacement (see \cs{str_remove_all:Nn} -% for an example). -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_remove_once:Nn, \str_remove_once:cn, -% \str_gremove_once:Nn, \str_gremove_once:cn -% } -% \begin{syntax} -% \cs{str_remove_once:Nn} \meta{str~var} \Arg{token list} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then -% removes the first (leftmost) occurrence of \meta{string} from the -% \meta{str~var}. -% \end{function} -% -% \begin{function}[added = 2017-10-08] -% { -% \str_remove_all:Nn, \str_remove_all:cn, -% \str_gremove_all:Nn, \str_gremove_all:cn -% } -% \begin{syntax} -% \cs{str_remove_all:Nn} \meta{str~var} \Arg{token list} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then -% removes all occurrences of \meta{string} from the -% \meta{str~var}. -% As this function -% operates from left to right, the pattern \meta{string} -% may remain after the removal, for instance, -% \begin{quote} -% \cs{str_set:Nn} \cs{l_tmpa_str} |{abbccd}| -% \cs{str_remove_all:Nn} \cs{l_tmpa_str} |{bc}| -% \end{quote} -% results in \cs{l_tmpa_str} containing \texttt{abcd}. -% \end{function} -% % \section{String conditionals} % -% \begin{function}[EXP, pTF, added = 2015-09-18] -% {\str_if_exist:N, \str_if_exist:c} -% \begin{syntax} -% \cs{str_if_exist_p:N} \meta{str~var} -% \cs{str_if_exist:NTF} \meta{str~var} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests whether the \meta{str~var} is currently defined. This does not -% check that the \meta{str~var} really is a string. -% \end{function} -% % \begin{function}[EXP,pTF, added = 2015-09-18] % {\str_if_empty:N, \str_if_empty:c} % \begin{syntax} @@ -459,6 +393,19 @@ % receives the \meta{character} as |#1|. % \end{function} % +% \begin{function}[rEXP, added = 2021-05-05] +% {\str_map_tokens:nn, \str_map_tokens:Nn, \str_map_tokens:cn} +% \begin{syntax} +% \cs{str_map_tokens:nn} \Arg{token list} \Arg{code} +% \cs{str_map_tokens:Nn} \meta{str~var} \Arg{code} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then applies +% \meta{code} to every \meta{character} in the \meta{string} including +% spaces. The \meta{code} receives each character as a trailing brace +% group. This is equivalent to \cs{str_map_function:nN} if the +% \meta{code} consists of a single function. +% \end{function} +% % \begin{function}[added = 2017-11-14] % {\str_map_variable:nNn, \str_map_variable:NNn, \str_map_variable:cNn} % \begin{syntax} @@ -475,19 +422,6 @@ % \meta{string} is empty. See also \cs{str_map_inline:Nn}. % \end{function} % -% \begin{function}[rEXP, added = 2021-05-05] -% {\str_map_tokens:nn, \str_map_tokens:Nn, \str_map_tokens:cn} -% \begin{syntax} -% \cs{str_map_tokens:nn} \Arg{token list} \Arg{code} -% \cs{str_map_tokens:Nn} \meta{str~var} \Arg{code} -% \end{syntax} -% Converts the \meta{token list} to a \meta{string} then applies -% \meta{code} to every \meta{character} in the \meta{string} including -% spaces. The \meta{code} receives each character as a trailing brace -% group. This is equivalent to \cs{str_map_function:nN} if the -% \meta{code} consists of a single function. -% \end{function} -% % \begin{function}[added = 2017-10-08, rEXP]{\str_map_break:} % \begin{syntax} % \cs{str_map_break:} @@ -698,6 +632,72 @@ % instances of |bcde|. % ^^A\end{function} % +% \section{Modifying string variables} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_replace_once:Nnn, \str_replace_once:cnn, +% \str_greplace_once:Nnn, \str_greplace_once:cnn +% } +% \begin{syntax} +% \cs{str_replace_once:Nnn} \meta{str~var} \Arg{old} \Arg{new} +% \end{syntax} +% Converts the \meta{old} and \meta{new} token lists to strings, then +% replaces the first (leftmost) occurrence of \meta{old string} in the +% \meta{str~var} with \meta{new string}. +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_replace_all:Nnn, \str_replace_all:cnn, +% \str_greplace_all:Nnn, \str_greplace_all:cnn +% } +% \begin{syntax} +% \cs{str_replace_all:Nnn} \meta{str~var} \Arg{old} \Arg{new} +% \end{syntax} +% Converts the \meta{old} and \meta{new} token lists to strings, then +% replaces all occurrences of \meta{old string} in the +% \meta{str~var} with \meta{new string}. +% As this function +% operates from left to right, the pattern \meta{old string} +% may remain after the replacement (see \cs{str_remove_all:Nn} +% for an example). +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_remove_once:Nn, \str_remove_once:cn, +% \str_gremove_once:Nn, \str_gremove_once:cn +% } +% \begin{syntax} +% \cs{str_remove_once:Nn} \meta{str~var} \Arg{token list} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then +% removes the first (leftmost) occurrence of \meta{string} from the +% \meta{str~var}. +% \end{function} +% +% \begin{function}[added = 2017-10-08] +% { +% \str_remove_all:Nn, \str_remove_all:cn, +% \str_gremove_all:Nn, \str_gremove_all:cn +% } +% \begin{syntax} +% \cs{str_remove_all:Nn} \meta{str~var} \Arg{token list} +% \end{syntax} +% Converts the \meta{token list} to a \meta{string} then +% removes all occurrences of \meta{string} from the +% \meta{str~var}. +% As this function +% operates from left to right, the pattern \meta{string} +% may remain after the removal, for instance, +% \begin{quote} +% \cs{str_set:Nn} \cs{l_tmpa_str} |{abbccd}| +% \cs{str_remove_all:Nn} \cs{l_tmpa_str} |{bc}| +% \end{quote} +% results in \cs{l_tmpa_str} containing \texttt{abcd}. +% \end{function} +% % \section{String manipulation} % % \begin{function}[EXP, added = 2019-11-26] @@ -1163,22 +1163,23 @@ % \str_if_eq:ee % } % Modern engines provide a direct way of comparing two token lists, -% but returning a number. This set of conditionals therefore make life -% a bit clearer. The \texttt{nn} and \texttt{xx} versions are created -% directly as this is most efficient. +% but returning a number. This set of conditionals therefore makes life +% a bit clearer. The \texttt{nn} and \texttt{ee} versions are created +% directly as this is most efficient. Since \cs{@@_if_eq:nn} will expand to +% |0| as an explicit character with category 12 if the two lists match (and +% either |-1| or |1| if they don't) we can use \cs{if:w} here which is faster +% than using \cs{if_int_compare:w}. % \begin{macrocode} \prg_new_conditional:Npnn \str_if_eq:nn #1#2 { p , T , F , TF } { - \if_int_compare:w - \@@_if_eq:nn { \exp_not:n {#1} } { \exp_not:n {#2} } - = \c_zero_int + \if:w 0 \@@_if_eq:nn { \exp_not:n {#1} } { \exp_not:n {#2} } \prg_return_true: \else: \prg_return_false: \fi: } \prg_generate_conditional_variant:Nnn \str_if_eq:nn { V , v , o , nV , no , VV , nv } { p , T , F , TF } \prg_new_conditional:Npnn \str_if_eq:ee #1#2 { p , T , F , TF } { - \if_int_compare:w \@@_if_eq:nn {#1} {#2} = \c_zero_int + \if:w 0 \@@_if_eq:nn {#1} {#2} \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} @@ -1186,14 +1187,13 @@ % % \begin{macro}[EXP, pTF] % {\str_if_eq:NN, \str_if_eq:Nc, \str_if_eq:cN, \str_if_eq:cc} -% Note that \cs{str_if_eq:NN} is different from -% \cs{tl_if_eq:NN} because it needs to ignore category codes. +% Note that \cs{str_if_eq:NNTF} is different from +% \cs{tl_if_eq:NNTF} because it needs to ignore category codes. % \begin{macrocode} \prg_new_conditional:Npnn \str_if_eq:NN #1#2 { p , TF , T , F } { - \if_int_compare:w - \@@_if_eq:nn { \tl_to_str:N #1 } { \tl_to_str:N #2 } - = \c_zero_int \prg_return_true: \else: \prg_return_false: \fi: + \if:w 0 \@@_if_eq:nn { \tl_to_str:N #1 } { \tl_to_str:N #2 } + \prg_return_true: \else: \prg_return_false: \fi: } \prg_generate_conditional_variant:Nnn \str_if_eq:NN { c , Nc , cc } { T , F , TF , p } diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf Binary files differindex 4589d6a2d2..e8ec9a0b73 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.pdf +++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex index 3b3ec1b3bf..07f8105824 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.tex +++ b/macros/latex/contrib/l3kernel/l3styleguide.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \begin{document} diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf Binary files differindex 55d08cee70..c0043ad4b1 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex index 882304511f..035b9117fc 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx index 6aab0ca25f..39b091d7df 100644 --- a/macros/latex/contrib/l3kernel/l3sys.dtx +++ b/macros/latex/contrib/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf Binary files differindex 51c0c6d52c..33d947829f 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf +++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex index 8e289903b6..88221a01da 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.tex +++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx index 4647339a81..d27bae37d2 100644 --- a/macros/latex/contrib/l3kernel/l3text-case.dtx +++ b/macros/latex/contrib/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx index 5655cc757c..f1ad3be0fc 100644 --- a/macros/latex/contrib/l3kernel/l3text-purify.dtx +++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx index defd0585f4..0fa054ccee 100644 --- a/macros/latex/contrib/l3kernel/l3text.dtx +++ b/macros/latex/contrib/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx index 84d740e6df..70522a9aac 100644 --- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx +++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx index 13625c2542..bda39b5cf0 100644 --- a/macros/latex/contrib/l3kernel/l3tl.dtx +++ b/macros/latex/contrib/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -205,159 +205,6 @@ % \meta{tl~var}. % \end{function} % -% \section{Modifying token list variables} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_replace_once:Nnn, \tl_replace_once:cnn, -% \tl_greplace_once:Nnn, \tl_greplace_once:cnn -% } -% \begin{syntax} -% \cs{tl_replace_once:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} -% \end{syntax} -% Replaces the first (leftmost) occurrence of \meta{old tokens} in the -% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} -% cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_replace_all:Nnn, \tl_replace_all:cnn, -% \tl_greplace_all:Nnn, \tl_greplace_all:cnn -% } -% \begin{syntax} -% \cs{tl_replace_all:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} -% \end{syntax} -% Replaces all occurrences of \meta{old tokens} in the -% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} -% cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% As this function -% operates from left to right, the pattern \meta{old tokens} -% may remain after the replacement (see \cs{tl_remove_all:Nn} -% for an example). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_remove_once:Nn, \tl_remove_once:cn, -% \tl_gremove_once:Nn, \tl_gremove_once:cn -% } -% \begin{syntax} -% \cs{tl_remove_once:Nn} \meta{tl~var} \Arg{tokens} -% \end{syntax} -% Removes the first (leftmost) occurrence of \meta{tokens} from the -% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% \end{function} -% -% \begin{function}[updated = 2011-08-11] -% { -% \tl_remove_all:Nn, \tl_remove_all:cn, -% \tl_gremove_all:Nn, \tl_gremove_all:cn -% } -% \begin{syntax} -% \cs{tl_remove_all:Nn} \meta{tl~var} \Arg{tokens} -% \end{syntax} -% Removes all occurrences of \meta{tokens} from the -% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| -% (more precisely, explicit character tokens with category code $1$ -% (begin-group) or $2$ (end-group), and tokens with category code $6$). -% As this function -% operates from left to right, the pattern \meta{tokens} -% may remain after the removal, for instance, -% \begin{quote} -% \cs{tl_set:Nn} \cs{l_tmpa_tl} |{abbccd}| -% \cs{tl_remove_all:Nn} \cs{l_tmpa_tl} |{bc}| -% \end{quote} -% results in \cs{l_tmpa_tl} containing \texttt{abcd}. -% \end{function} -% -% \section{Reassigning token list category codes} -% -% These functions allow the rescanning of tokens: re-apply \TeX{}'s -% tokenization process to apply category codes different from those -% in force when the tokens were absorbed. Whilst this functionality is -% supported, it is often preferable to find alternative approaches -% to achieving outcomes rather than rescanning tokens (for example -% construction of token lists token-by-token with intervening category -% code changes or using \cs{char_generate:nn}). -% -% \begin{function}[updated = 2015-08-11] -% { -% \tl_set_rescan:Nnn, \tl_set_rescan:Nno, \tl_set_rescan:Nnx, -% \tl_set_rescan:cnn, \tl_set_rescan:cno, \tl_set_rescan:cnx, -% \tl_gset_rescan:Nnn, \tl_gset_rescan:Nno, \tl_gset_rescan:Nnx, -% \tl_gset_rescan:cnn, \tl_gset_rescan:cno, \tl_gset_rescan:cnx -% } -% \begin{syntax} -% \cs{tl_set_rescan:Nnn} \meta{tl~var} \Arg{setup} \Arg{tokens} -% \end{syntax} -% Sets \meta{tl~var} to contain \meta{tokens}, applying the category -% code r\'{e}gime specified in the \meta{setup} before carrying out -% the assignment. (Category codes applied to tokens not explicitly covered -% by the \meta{setup} are those in force at the point of use of -% \cs{tl_set_rescan:Nnn}.) -% This allows the \meta{tl~var} to contain material -% with category codes other than those that apply when \meta{tokens} -% are absorbed. The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes, -% such as uses of \cs{cctab_select:N}, -% are relevant. See also \cs{tl_rescan:nn}. -% \begin{texnote} -% The \meta{tokens} are first turned into a string (using -% \cs{tl_to_str:n}). If the string contains one or more characters -% with character code \tn{newlinechar} (set equal to -% \tn{endlinechar} unless that is equal to $32$, before the user -% \meta{setup}), then it is split into lines at these characters, -% then read as if reading multiple lines from a file, ignoring -% spaces (catcode $10$) at the beginning and spaces and tabs -% (character code $32$ or $9$) at the end of every line. -% Otherwise, spaces (and tabs) are retained at both ends of the -% single-line string, as if it appeared in the middle of a line -% read from a file. -% \end{texnote} -% \end{function} -% -% \begin{function}[updated = 2015-08-11]{\tl_rescan:nn} -% \begin{syntax} -% \cs{tl_rescan:nn} \Arg{setup} \Arg{tokens} -% \end{syntax} -% Rescans \meta{tokens} applying the category code r\'{e}gime -% specified in the \meta{setup}, and leaves the resulting tokens in -% the input stream. (Category codes applied to tokens not explicitly covered -% by the \meta{setup} are those in force at the point of use of -% \cs{tl_rescan:nn}.) -% The \meta{setup} is run within a group and may -% contain any valid input, although only changes in category codes, -% such as uses of \cs{cctab_select:N}, -% are relevant. See also \cs{tl_set_rescan:Nnn}, which is more -% robust than using \cs{tl_set:Nn} in the \meta{tokens} argument of -% \cs{tl_rescan:nn}. -% \begin{texnote} -% The \meta{tokens} are first turned into a string (using -% \cs{tl_to_str:n}). If the string contains one or more characters -% with character code \tn{newlinechar} (set equal to -% \tn{endlinechar} unless that is equal to $32$, before the user -% \meta{setup}), then it is split into lines at these characters, -% then read as if reading multiple lines from a file, ignoring -% spaces (catcode $10$) at the beginning and spaces and tabs -% (character code $32$ or $9$) at the end of every line. -% Otherwise, spaces (and tabs) are retained at both ends of the -% single-line string, as if it appeared in the middle of a line -% read from a file. -% -% Contrarily to the \tn{scantokens} primitive, \cs{tl_rescan:nn} -% tokenizes the whole string in the same category code regime rather -% than one token at a time, so that directives such as \tn{verb} -% that rely on changing category codes will not function properly. -% \end{texnote} -% \end{function} -% % \section{Token list conditionals} % % \begin{function}[EXP,pTF, updated = 2019-09-04] @@ -473,7 +320,7 @@ % \cs{tl_if_single_p:N} \meta{tl~var} % \cs{tl_if_single:NTF} \meta{tl~var} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the content of the \meta{tl~var} consists of a single item, +% Tests if the content of the \meta{tl~var} consists of a single \meta{item}, % \emph{i.e.}~is a single normal token (neither an explicit space % character nor a begin-group character) or a single brace group, % surrounded by optional spaces on both sides. In other words, such a @@ -485,7 +332,7 @@ % \cs{tl_if_single_p:n} \Arg{token list} % \cs{tl_if_single:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Tests if the \meta{token list} has exactly one item, \emph{i.e.}~is +% Tests if the \meta{token list} has exactly one \meta{item}, \emph{i.e.}~is % a single normal token (neither an explicit space character nor a % begin-group character) or a single brace group, surrounded by % optional spaces on both sides. In other words, such a token list has @@ -498,7 +345,7 @@ % \cs{tl_if_single_token:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if the token list consists of exactly one token, \emph{i.e.}~is -% either a single space character or a single \enquote{normal} token. +% either a single space character or a single normal token. % Token groups (|{|\ldots|}|) are not single tokens. % \end{function} % @@ -526,152 +373,93 @@ % available. % \end{function} % -% \section{Mapping over token lists} +% \subsection{Testing the first token} % -% All mappings are done at the current group level, \emph{i.e.}~any -% local assignments made by the \meta{function} or \meta{code} discussed -% below remain in effect after the loop. -% -% \begin{function}[updated = 2012-06-29, rEXP] -% {\tl_map_function:NN, \tl_map_function:cN} -% \begin{syntax} -% \cs{tl_map_function:NN} \meta{tl~var} \meta{function} -% \end{syntax} -% Applies \meta{function} to every \meta{item} in the \meta{tl~var}. -% The \meta{function} receives one argument for each iteration. -% This may be a number of tokens if the \meta{item} was stored within -% braces. Hence the \meta{function} should anticipate receiving -% \texttt{n}-type arguments. See also \cs{tl_map_function:nN}. -% \end{function} -% -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_function:nN} -% \begin{syntax} -% \cs{tl_map_function:nN} \Arg{token list} \meta{function} -% \end{syntax} -% Applies \meta{function} to every \meta{item} in the \meta{token list}, -% The \meta{function} receives one argument for each iteration. -% This may be a number of tokens if the \meta{item} was stored within -% braces. Hence the \meta{function} should anticipate receiving -% \texttt{n}-type arguments. See also \cs{tl_map_function:NN}. -% \end{function} -% -% \begin{function}[updated = 2012-06-29] -% {\tl_map_inline:Nn, \tl_map_inline:cn} +% \begin{function}[updated = 2012-07-09, EXP, pTF] +% {\tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:oN} % \begin{syntax} -% \cs{tl_map_inline:Nn} \meta{tl~var} \Arg{inline function} +% \cs{tl_if_head_eq_catcode_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_catcode:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Applies the \meta{inline function} to every \meta{item} stored within the -% \meta{tl~var}. The \meta{inline function} should consist of code which -% receives the \meta{item} as |#1|. See also \cs{tl_map_function:NN}. +% Tests if the first \meta{token} in the \meta{token list} has the +% same category code as the \meta{test token}. In the case where the +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[updated = 2012-06-29]{\tl_map_inline:nn} +% \begin{function}[updated = 2012-07-09, EXP, pTF] +% {\tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:fN} % \begin{syntax} -% \cs{tl_map_inline:nn} \Arg{token list} \Arg{inline function} +% \cs{tl_if_head_eq_charcode_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_charcode:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Applies the \meta{inline function} to every \meta{item} stored within the -% \meta{token list}. The \meta{inline function} should consist of code which -% receives the \meta{item} as |#1|. See also \cs{tl_map_function:nN}. +% Tests if the first \meta{token} in the \meta{token list} has the +% same character code as the \meta{test token}. In the case where the +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[rEXP, added = 2019-09-02] -% {\tl_map_tokens:Nn, \tl_map_tokens:cn, \tl_map_tokens:nn} +% \begin{function}[updated = 2012-07-09, EXP, pTF]{\tl_if_head_eq_meaning:nN} % \begin{syntax} -% \cs{tl_map_tokens:Nn} \meta{tl~var} \Arg{code} -% \cs{tl_map_tokens:nn} \Arg{tokens} \Arg{code} +% \cs{tl_if_head_eq_meaning_p:nN} \Arg{token list} \meta{test token} +% \cs{tl_if_head_eq_meaning:nNTF} \Arg{token list} \meta{test token} +% ~~\Arg{true code} \Arg{false code} % \end{syntax} -% Analogue of \cs{tl_map_function:NN} which maps several tokens -% instead of a single function. The \meta{code} receives each item in -% the \meta{tl~var} or in \meta{tokens} as a trailing brace group. For -% instance, -% \begin{verbatim} -% \tl_map_tokens:Nn \l_my_tl { \prg_replicate:nn { 2 } } -% \end{verbatim} -% expands to twice each item in the \meta{tl~var}: for each item in -% \cs[no-index]{l_my_tl} the function \cs{prg_replicate:nn} receives |2| and -% \meta{item} as its two arguments. The function -% \cs{tl_map_inline:Nn} is typically faster but is not expandable. +% Tests if the first \meta{token} in the \meta{token list} has the +% same meaning as the \meta{test token}. In the case where +% \meta{token list} is empty, the test is always \texttt{false}. % \end{function} % -% \begin{function}[updated = 2012-06-29] -% {\tl_map_variable:NNn, \tl_map_variable:cNn} +% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_group:n} % \begin{syntax} -% \cs{tl_map_variable:NNn} \meta{tl~var} \meta{variable} \Arg{code} +% \cs{tl_if_head_is_group_p:n} \Arg{token list} +% \cs{tl_if_head_is_group:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Stores each \meta{item} of the \meta{tl~var} in turn in the (token -% list) \meta{variable} and applies the \meta{code}. The \meta{code} -% will usually make use of the \meta{variable}, but this is not -% enforced. The assignments to the \meta{variable} are local. Its -% value after the loop is the last \meta{item} in the \meta{tl~var}, -% or its original value if the \meta{tl~var} is blank. See also -% \cs{tl_map_inline:Nn}. +% Tests if the first \meta{token} in the \meta{token list} +% is an explicit begin-group character (with category code~$1$ +% and any character code), in other words, if the \meta{token list} +% starts with a brace group. In particular, the test is \texttt{false} +% if the \meta{token list} starts with an implicit token such as +% \cs{c_group_begin_token}, or if it is empty. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29]{\tl_map_variable:nNn} +% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_N_type:n} % \begin{syntax} -% \cs{tl_map_variable:nNn} \Arg{token list} \meta{variable} \Arg{code} +% \cs{tl_if_head_is_N_type_p:n} \Arg{token list} +% \cs{tl_if_head_is_N_type:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Stores each \meta{item} of the \meta{token list} in turn in the -% (token list) \meta{variable} and applies the \meta{code}. The -% \meta{code} will usually make use of the \meta{variable}, but this -% is not enforced. The assignments to the \meta{variable} are local. -% Its value after the loop is the last \meta{item} in the -% \meta{tl~var}, or its original value if the \meta{tl~var} is blank. -% See also \cs{tl_map_inline:nn}. +% Tests if the first \meta{token} in the \meta{token list} +% is a normal \texttt{N}-type argument. In other words, +% it is neither an explicit space character +% (explicit token with character code~$32$ and category code~$10$) +% nor an explicit begin-group character +% (with category code~1 and any character code). An empty +% argument yields \texttt{false}, as it does not have a normal +% first token. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:} +% \begin{function}[updated = 2012-07-08, EXP, pTF]{\tl_if_head_is_space:n} % \begin{syntax} -% \cs{tl_map_break:} +% \cs{tl_if_head_is_space_p:n} \Arg{token list} +% \cs{tl_if_head_is_space:nTF} \Arg{token list} \Arg{true code} \Arg{false code} % \end{syntax} -% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all -% entries in the \meta{token list variable} have been processed. This -% normally takes place within a conditional statement, for example -% \begin{verbatim} -% \tl_map_inline:Nn \l_my_tl -% { -% \str_if_eq:nnT { #1 } { bingo } { \tl_map_break: } -% % Do something useful -% } -% \end{verbatim} -% See also \cs{tl_map_break:n}. -% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low -% level \TeX{} errors. -% \begin{texnote} -% When the mapping is broken, additional tokens may be inserted -% before the \meta{tokens} are -% inserted into the input stream. -% This depends on the design of the mapping function. -% \end{texnote} +% Tests if the first \meta{token} in the \meta{token list} +% is an explicit space character +% (explicit token with character code~$12$ and category code~$10$). +% In particular, the test is \texttt{false} if the \meta{token list} +% starts with an implicit token such as \cs{c_space_token}, or if it +% is empty. +% This function is useful to implement actions on token lists on +% a token by token basis. % \end{function} % -% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:n} -% \begin{syntax} -% \cs{tl_map_break:n} \Arg{code} -% \end{syntax} -% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all -% entries in the \meta{token list variable} have been processed, inserting -% the \meta{code} after the mapping has ended. This -% normally takes place within a conditional statement, for example -% \begin{verbatim} -% \tl_map_inline:Nn \l_my_tl -% { -% \str_if_eq:nnT { #1 } { bingo } -% { \tl_map_break:n { <code> } } -% % Do something useful -% } -% \end{verbatim} -% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low -% level \TeX{} errors. -% \begin{texnote} -% When the mapping is broken, additional tokens may be inserted -% before the \meta{code} is -% inserted into the input stream. -% This depends on the design of the mapping function. -% \end{texnote} -% \end{function} +% \section{Working with token lists as a whole} % -% \section{Using token lists} +% \subsection{Using token lists} % % \begin{function}[EXP]{\tl_to_str:n, \tl_to_str:V} % \begin{syntax} @@ -733,7 +521,7 @@ % a \meta{tl~var} directly without an accessor function. % \end{function} % -% \section{Working with the content of token lists} +% \subsection{Counting and reversing token lists} % % \begin{function}[added = 2012-05-13, EXP] % {\tl_count:n, \tl_count:V, \tl_count:o} @@ -752,7 +540,7 @@ % \begin{syntax} % \cs{tl_count:N} \meta{tl~var} % \end{syntax} -% Counts the number of token groups in the \meta{tl~var} +% Counts the number of \meta{items} in the \meta{tl~var} % and leaves this information in the input stream. Unbraced tokens % count as one element as do each token group (|{|\ldots|}|). This % process ignores any unprotected spaces within the \meta{tl~var}. @@ -867,36 +655,194 @@ % \emph{resets} the content of the variable. % \end{function} % -% \begin{function}[added = 2017-02-06] -% {\tl_sort:Nn, \tl_sort:cn, \tl_gsort:Nn, \tl_gsort:cn} +% \subsection{Viewing token lists} +% +% \begin{function}[updated = 2021-04-29]{\tl_show:N, \tl_show:c} % \begin{syntax} -% \cs{tl_sort:Nn} \meta{tl var} \Arg{comparison code} +% \cs{tl_show:N} \meta{tl~var} % \end{syntax} -% Sorts the items in the \meta{tl var} according to the -% \meta{comparison code}, and assigns the result to -% \meta{tl var}. The details of sorting comparison are -% described in Section~\ref{sec:l3sort:mech}. +% Displays the content of the \meta{tl~var} on the terminal. +% \begin{texnote} +% This is similar to the \TeX{} primitive \tn{show}, wrapped to a +% fixed number of characters per line. +% \end{texnote} % \end{function} % -% \begin{function}[added = 2017-02-06, EXP]{\tl_sort:nN} +% \begin{function}[updated = 2015-08-07]{\tl_show:n} % \begin{syntax} -% \cs{tl_sort:nN} \Arg{token list} \meta{conditional} +% \cs{tl_show:n} \Arg{token list} % \end{syntax} -% Sorts the items in the \meta{token list}, using the -% \meta{conditional} to compare items, and leaves the result in the -% input stream. The \meta{conditional} should have signature |:nnTF|, -% and return \texttt{true} if the two items being compared should be -% left in the same order, and \texttt{false} if the items should be -% swapped. The details of sorting comparison are -% described in Section~\ref{sec:l3sort:mech}. +% Displays the \meta{token list} on the terminal. % \begin{texnote} -% The result is returned within \cs{exp_not:n}, which means that the -% token list does not expand further when appearing in an -% \texttt{x}-type or \texttt{e}-type argument expansion. +% This is similar to the \eTeX{} primitive \tn{showtokens}, wrapped +% to a fixed number of characters per line. +% \end{texnote} +% \end{function} +% +% \begin{function}[added = 2014-08-22, updated = 2021-04-29]{\tl_log:N, \tl_log:c} +% \begin{syntax} +% \cs{tl_log:N} \meta{tl~var} +% \end{syntax} +% Writes the content of the \meta{tl~var} in the log file. See also +% \cs{tl_show:N} which displays the result in the terminal. +% \end{function} +% +% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\tl_log:n} +% \begin{syntax} +% \cs{tl_log:n} \Arg{token list} +% \end{syntax} +% Writes the \meta{token list} in the log file. See also +% \cs{tl_show:n} which displays the result in the terminal. +% \end{function} +% +% \section{Manipulating items in token lists} +% +% \subsection{Mapping over token lists} +% +% All mappings are done at the current group level, \emph{i.e.}~any +% local assignments made by the \meta{function} or \meta{code} discussed +% below remain in effect after the loop. +% +% \begin{function}[updated = 2012-06-29, rEXP] +% {\tl_map_function:NN, \tl_map_function:cN} +% \begin{syntax} +% \cs{tl_map_function:NN} \meta{tl~var} \meta{function} +% \end{syntax} +% Applies \meta{function} to every \meta{item} in the \meta{tl~var}. +% The \meta{function} receives one argument for each iteration. +% This may be a number of tokens if the \meta{item} was stored within +% braces. Hence the \meta{function} should anticipate receiving +% \texttt{n}-type arguments. See also \cs{tl_map_function:nN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_function:nN} +% \begin{syntax} +% \cs{tl_map_function:nN} \Arg{token list} \meta{function} +% \end{syntax} +% Applies \meta{function} to every \meta{item} in the \meta{token list}, +% The \meta{function} receives one argument for each iteration. +% This may be a number of tokens if the \meta{item} was stored within +% braces. Hence the \meta{function} should anticipate receiving +% \texttt{n}-type arguments. See also \cs{tl_map_function:NN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29] +% {\tl_map_inline:Nn, \tl_map_inline:cn} +% \begin{syntax} +% \cs{tl_map_inline:Nn} \meta{tl~var} \Arg{inline function} +% \end{syntax} +% Applies the \meta{inline function} to every \meta{item} stored within the +% \meta{tl~var}. The \meta{inline function} should consist of code which +% receives the \meta{item} as |#1|. See also \cs{tl_map_function:NN}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29]{\tl_map_inline:nn} +% \begin{syntax} +% \cs{tl_map_inline:nn} \Arg{token list} \Arg{inline function} +% \end{syntax} +% Applies the \meta{inline function} to every \meta{item} stored within the +% \meta{token list}. The \meta{inline function} should consist of code which +% receives the \meta{item} as |#1|. See also \cs{tl_map_function:nN}. +% \end{function} +% +% \begin{function}[rEXP, added = 2019-09-02] +% {\tl_map_tokens:Nn, \tl_map_tokens:cn, \tl_map_tokens:nn} +% \begin{syntax} +% \cs{tl_map_tokens:Nn} \meta{tl~var} \Arg{code} +% \cs{tl_map_tokens:nn} \Arg{tokens} \Arg{code} +% \end{syntax} +% Analogue of \cs{tl_map_function:NN} which maps several tokens +% instead of a single function. The \meta{code} receives each \meta{item} in +% the \meta{tl~var} or in \meta{tokens} as a trailing brace group. For +% instance, +% \begin{verbatim} +% \tl_map_tokens:Nn \l_my_tl { \prg_replicate:nn { 2 } } +% \end{verbatim} +% expands to twice each \meta{item} in the \meta{tl~var}: for each \meta{item} in +% \cs[no-index]{l_my_tl} the function \cs{prg_replicate:nn} receives |2| and +% \meta{item} as its two arguments. The function +% \cs{tl_map_inline:Nn} is typically faster but is not expandable. +% \end{function} +% +% \begin{function}[updated = 2012-06-29] +% {\tl_map_variable:NNn, \tl_map_variable:cNn} +% \begin{syntax} +% \cs{tl_map_variable:NNn} \meta{tl~var} \meta{variable} \Arg{code} +% \end{syntax} +% Stores each \meta{item} of the \meta{tl~var} in turn in the (token +% list) \meta{variable} and applies the \meta{code}. The \meta{code} +% will usually make use of the \meta{variable}, but this is not +% enforced. The assignments to the \meta{variable} are local. Its +% value after the loop is the last \meta{item} in the \meta{tl~var}, +% or its original value if the \meta{tl~var} is blank. See also +% \cs{tl_map_inline:Nn}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29]{\tl_map_variable:nNn} +% \begin{syntax} +% \cs{tl_map_variable:nNn} \Arg{token list} \meta{variable} \Arg{code} +% \end{syntax} +% Stores each \meta{item} of the \meta{token list} in turn in the +% (token list) \meta{variable} and applies the \meta{code}. The +% \meta{code} will usually make use of the \meta{variable}, but this +% is not enforced. The assignments to the \meta{variable} are local. +% Its value after the loop is the last \meta{item} in the +% \meta{tl~var}, or its original value if the \meta{tl~var} is blank. +% See also \cs{tl_map_inline:nn}. +% \end{function} +% +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:} +% \begin{syntax} +% \cs{tl_map_break:} +% \end{syntax} +% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all +% entries in the \meta{token list variable} have been processed. This +% normally takes place within a conditional statement, for example +% \begin{verbatim} +% \tl_map_inline:Nn \l_my_tl +% { +% \str_if_eq:nnT { #1 } { bingo } { \tl_map_break: } +% % Do something useful +% } +% \end{verbatim} +% See also \cs{tl_map_break:n}. +% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low +% level \TeX{} errors. +% \begin{texnote} +% When the mapping is broken, additional tokens may be inserted +% before the \meta{tokens} are +% inserted into the input stream. +% This depends on the design of the mapping function. % \end{texnote} % \end{function} % -% \section{The first token from a token list} +% \begin{function}[updated = 2012-06-29, rEXP]{\tl_map_break:n} +% \begin{syntax} +% \cs{tl_map_break:n} \Arg{code} +% \end{syntax} +% Used to terminate a \cs[no-index]{tl_map_\ldots} function before all +% entries in the \meta{token list variable} have been processed, inserting +% the \meta{code} after the mapping has ended. This +% normally takes place within a conditional statement, for example +% \begin{verbatim} +% \tl_map_inline:Nn \l_my_tl +% { +% \str_if_eq:nnT { #1 } { bingo } +% { \tl_map_break:n { <code> } } +% % Do something useful +% } +% \end{verbatim} +% Use outside of a \cs[no-index]{tl_map_\ldots} scenario leads to low +% level \TeX{} errors. +% \begin{texnote} +% When the mapping is broken, additional tokens may be inserted +% before the \meta{code} is +% inserted into the input stream. +% This depends on the design of the mapping function. +% \end{texnote} +% \end{function} +% +% \subsection{Head and tail of token lists} % % Functions which deal with either only the very first item (balanced % text or single normal token) in a token list, or the remaining tokens. @@ -979,89 +925,7 @@ % \end{texnote} % \end{function} % -% \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_catcode:nN, \tl_if_head_eq_catcode:oN} -% \begin{syntax} -% \cs{tl_if_head_eq_catcode_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_catcode:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same category code as the \meta{test token}. In the case where the -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[updated = 2012-07-09, EXP, pTF] -% {\tl_if_head_eq_charcode:nN, \tl_if_head_eq_charcode:fN} -% \begin{syntax} -% \cs{tl_if_head_eq_charcode_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_charcode:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same character code as the \meta{test token}. In the case where the -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[updated = 2012-07-09, EXP, pTF]{\tl_if_head_eq_meaning:nN} -% \begin{syntax} -% \cs{tl_if_head_eq_meaning_p:nN} \Arg{token list} \meta{test token} -% \cs{tl_if_head_eq_meaning:nNTF} \Arg{token list} \meta{test token} -% ~~\Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} has the -% same meaning as the \meta{test token}. In the case where -% \meta{token list} is empty, the test is always \texttt{false}. -% \end{function} -% -% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_group:n} -% \begin{syntax} -% \cs{tl_if_head_is_group_p:n} \Arg{token list} -% \cs{tl_if_head_is_group:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is an explicit begin-group character (with category code~$1$ -% and any character code), in other words, if the \meta{token list} -% starts with a brace group. In particular, the test is \texttt{false} -% if the \meta{token list} starts with an implicit token such as -% \cs{c_group_begin_token}, or if it is empty. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \begin{function}[added = 2012-07-08, EXP, pTF]{\tl_if_head_is_N_type:n} -% \begin{syntax} -% \cs{tl_if_head_is_N_type_p:n} \Arg{token list} -% \cs{tl_if_head_is_N_type:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is a normal \texttt{N}-type argument. In other words, -% it is neither an explicit space character -% (explicit token with character code~$32$ and category code~$10$) -% nor an explicit begin-group character -% (with category code~1 and any character code). An empty -% argument yields \texttt{false}, as it does not have a \enquote{normal} -% first token. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \begin{function}[updated = 2012-07-08, EXP, pTF]{\tl_if_head_is_space:n} -% \begin{syntax} -% \cs{tl_if_head_is_space_p:n} \Arg{token list} -% \cs{tl_if_head_is_space:nTF} \Arg{token list} \Arg{true code} \Arg{false code} -% \end{syntax} -% Tests if the first \meta{token} in the \meta{token list} -% is an explicit space character -% (explicit token with character code~$12$ and category code~$10$). -% In particular, the test is \texttt{false} if the \meta{token list} -% starts with an implicit token such as \cs{c_space_token}, or if it -% is empty. -% This function is useful to implement actions on token lists on -% a token by token basis. -% \end{function} -% -% \section{Using a single item} +% \subsection{Items and ranges in token lists} % % \begin{function}[added = 2014-07-17, EXP] % {\tl_item:nn, \tl_item:Nn, \tl_item:cn} @@ -1172,44 +1036,190 @@ % \end{texnote} % \end{function} % -% \section{Viewing token lists} +% \subsection{Sorting token lists} % -% \begin{function}[updated = 2021-04-29]{\tl_show:N, \tl_show:c} +% \begin{function}[added = 2017-02-06] +% {\tl_sort:Nn, \tl_sort:cn, \tl_gsort:Nn, \tl_gsort:cn} % \begin{syntax} -% \cs{tl_show:N} \meta{tl~var} +% \cs{tl_sort:Nn} \meta{tl var} \Arg{comparison code} % \end{syntax} -% Displays the content of the \meta{tl~var} on the terminal. -% \begin{texnote} -% This is similar to the \TeX{} primitive \tn{show}, wrapped to a -% fixed number of characters per line. -% \end{texnote} +% Sorts the items in the \meta{tl var} according to the +% \meta{comparison code}, and assigns the result to +% \meta{tl var}. The details of sorting comparison are +% described in Section~\ref{sec:l3sort:mech}. % \end{function} % -% \begin{function}[updated = 2015-08-07]{\tl_show:n} +% \begin{function}[added = 2017-02-06, EXP]{\tl_sort:nN} % \begin{syntax} -% \cs{tl_show:n} \Arg{token list} +% \cs{tl_sort:nN} \Arg{token list} \meta{conditional} % \end{syntax} -% Displays the \meta{token list} on the terminal. +% Sorts the items in the \meta{token list}, using the +% \meta{conditional} to compare items, and leaves the result in the +% input stream. The \meta{conditional} should have signature |:nnTF|, +% and return \texttt{true} if the two items being compared should be +% left in the same order, and \texttt{false} if the items should be +% swapped. The details of sorting comparison are +% described in Section~\ref{sec:l3sort:mech}. % \begin{texnote} -% This is similar to the \eTeX{} primitive \tn{showtokens}, wrapped -% to a fixed number of characters per line. +% The result is returned within \cs{exp_not:n}, which means that the +% token list does not expand further when appearing in an +% \texttt{x}-type or \texttt{e}-type argument expansion. % \end{texnote} % \end{function} % -% \begin{function}[added = 2014-08-22, updated = 2021-04-29]{\tl_log:N, \tl_log:c} +% \section{Manipulating tokens in token lists} +% +% \subsection{Replacing tokens} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_replace_once:Nnn, \tl_replace_once:cnn, +% \tl_greplace_once:Nnn, \tl_greplace_once:cnn +% } % \begin{syntax} -% \cs{tl_log:N} \meta{tl~var} +% \cs{tl_replace_once:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} % \end{syntax} -% Writes the content of the \meta{tl~var} in the log file. See also -% \cs{tl_show:N} which displays the result in the terminal. +% Replaces the first (leftmost) occurrence of \meta{old tokens} in the +% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} +% cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). % \end{function} % -% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\tl_log:n} +% \begin{function}[updated = 2011-08-11] +% { +% \tl_replace_all:Nnn, \tl_replace_all:cnn, +% \tl_greplace_all:Nnn, \tl_greplace_all:cnn +% } % \begin{syntax} -% \cs{tl_log:n} \Arg{token list} +% \cs{tl_replace_all:Nnn} \meta{tl~var} \Arg{old tokens} \Arg{new tokens} % \end{syntax} -% Writes the \meta{token list} in the log file. See also -% \cs{tl_show:n} which displays the result in the terminal. +% Replaces all occurrences of \meta{old tokens} in the +% \meta{tl~var} with \meta{new tokens}. \meta{Old tokens} +% cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% As this function +% operates from left to right, the pattern \meta{old tokens} +% may remain after the replacement (see \cs{tl_remove_all:Nn} +% for an example). +% \end{function} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_remove_once:Nn, \tl_remove_once:cn, +% \tl_gremove_once:Nn, \tl_gremove_once:cn +% } +% \begin{syntax} +% \cs{tl_remove_once:Nn} \meta{tl~var} \Arg{tokens} +% \end{syntax} +% Removes the first (leftmost) occurrence of \meta{tokens} from the +% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% \end{function} +% +% \begin{function}[updated = 2011-08-11] +% { +% \tl_remove_all:Nn, \tl_remove_all:cn, +% \tl_gremove_all:Nn, \tl_gremove_all:cn +% } +% \begin{syntax} +% \cs{tl_remove_all:Nn} \meta{tl~var} \Arg{tokens} +% \end{syntax} +% Removes all occurrences of \meta{tokens} from the +% \meta{tl~var}. \meta{Tokens} cannot contain |{|, |}| or |#| +% (more precisely, explicit character tokens with category code $1$ +% (begin-group) or $2$ (end-group), and tokens with category code $6$). +% As this function +% operates from left to right, the pattern \meta{tokens} +% may remain after the removal, for instance, +% \begin{quote} +% \cs{tl_set:Nn} \cs{l_tmpa_tl} |{abbccd}| +% \cs{tl_remove_all:Nn} \cs{l_tmpa_tl} |{bc}| +% \end{quote} +% results in \cs{l_tmpa_tl} containing \texttt{abcd}. +% \end{function} +% +% \subsection{Reassigning category codes} +% +% These functions allow the rescanning of tokens: re-apply \TeX{}'s +% tokenization process to apply category codes different from those +% in force when the tokens were absorbed. Whilst this functionality is +% supported, it is often preferable to find alternative approaches +% to achieving outcomes rather than rescanning tokens (for example +% construction of token lists token-by-token with intervening category +% code changes or using \cs{char_generate:nn}). +% +% \begin{function}[updated = 2015-08-11] +% { +% \tl_set_rescan:Nnn, \tl_set_rescan:Nno, \tl_set_rescan:Nnx, +% \tl_set_rescan:cnn, \tl_set_rescan:cno, \tl_set_rescan:cnx, +% \tl_gset_rescan:Nnn, \tl_gset_rescan:Nno, \tl_gset_rescan:Nnx, +% \tl_gset_rescan:cnn, \tl_gset_rescan:cno, \tl_gset_rescan:cnx +% } +% \begin{syntax} +% \cs{tl_set_rescan:Nnn} \meta{tl~var} \Arg{setup} \Arg{tokens} +% \end{syntax} +% Sets \meta{tl~var} to contain \meta{tokens}, applying the category +% code r\'{e}gime specified in the \meta{setup} before carrying out +% the assignment. (Category codes applied to tokens not explicitly covered +% by the \meta{setup} are those in force at the point of use of +% \cs{tl_set_rescan:Nnn}.) +% This allows the \meta{tl~var} to contain material +% with category codes other than those that apply when \meta{tokens} +% are absorbed. The \meta{setup} is run within a group and may +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, +% are relevant. See also \cs{tl_rescan:nn}. +% \begin{texnote} +% The \meta{tokens} are first turned into a string (using +% \cs{tl_to_str:n}). If the string contains one or more characters +% with character code \tn{newlinechar} (set equal to +% \tn{endlinechar} unless that is equal to $32$, before the user +% \meta{setup}), then it is split into lines at these characters, +% then read as if reading multiple lines from a file, ignoring +% spaces (catcode $10$) at the beginning and spaces and tabs +% (character code $32$ or $9$) at the end of every line. +% Otherwise, spaces (and tabs) are retained at both ends of the +% single-line string, as if it appeared in the middle of a line +% read from a file. +% \end{texnote} +% \end{function} +% +% \begin{function}[updated = 2015-08-11]{\tl_rescan:nn} +% \begin{syntax} +% \cs{tl_rescan:nn} \Arg{setup} \Arg{tokens} +% \end{syntax} +% Rescans \meta{tokens} applying the category code r\'{e}gime +% specified in the \meta{setup}, and leaves the resulting tokens in +% the input stream. (Category codes applied to tokens not explicitly covered +% by the \meta{setup} are those in force at the point of use of +% \cs{tl_rescan:nn}.) +% The \meta{setup} is run within a group and may +% contain any valid input, although only changes in category codes, +% such as uses of \cs{cctab_select:N}, +% are relevant. See also \cs{tl_set_rescan:Nnn}, which is more +% robust than using \cs{tl_set:Nn} in the \meta{tokens} argument of +% \cs{tl_rescan:nn}. +% \begin{texnote} +% The \meta{tokens} are first turned into a string (using +% \cs{tl_to_str:n}). If the string contains one or more characters +% with character code \tn{newlinechar} (set equal to +% \tn{endlinechar} unless that is equal to $32$, before the user +% \meta{setup}), then it is split into lines at these characters, +% then read as if reading multiple lines from a file, ignoring +% spaces (catcode $10$) at the beginning and spaces and tabs +% (character code $32$ or $9$) at the end of every line. +% Otherwise, spaces (and tabs) are retained at both ends of the +% single-line string, as if it appeared in the middle of a line +% read from a file. +% +% Contrarily to the \tn{scantokens} primitive, \cs{tl_rescan:nn} +% tokenizes the whole string in the same category code regime rather +% than one token at a time, so that directives such as \tn{verb} +% that rely on changing category codes will not function properly. +% \end{texnote} % \end{function} % % \section{Constant token lists} @@ -1442,7 +1452,7 @@ % By using \cs{exp_not:n} token list variables can contain |#| tokens, % which makes the token list registers provided by \TeX{} % more or less redundant. The \cs{tl_set:No} version is done -% \enquote{by hand} as it is used quite a lot. +% by hand as it is used quite a lot. % \begin{macrocode} \cs_new_protected:Npn \tl_set:Nn #1#2 { \__kernel_tl_set:Nx #1 { \__kernel_exp_not:w {#2} } } @@ -2289,7 +2299,7 @@ % The \cs{if_false:} constructions are a faster way to do % \cs{group_align_safe_begin:} and \cs{group_align_safe_end:}. % The \cs{scan_stop:} ensures that \texttt{f}-expanding -% \cs{tl_if_in:nn} does not lead to unbalanced braces. +% \cs{tl_if_in:nnTF} does not lead to unbalanced braces. % \begin{macrocode} \prg_new_protected_conditional:Npnn \tl_if_in:nn #1#2 { T , F , TF } { @@ -2335,7 +2345,7 @@ % \end{macro} % % \begin{macro}[EXP,pTF]{\tl_if_single:N} -% Expand the token list and feed it to \cs{tl_if_single:n}. +% Expand the token list and feed it to \cs{tl_if_single:nTF}. % \begin{macrocode} \cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n } \cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT } diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx index 33960f4ec0..527ce36e08 100644 --- a/macros/latex/contrib/l3kernel/l3token.dtx +++ b/macros/latex/contrib/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % @@ -541,7 +541,7 @@ % \begin{function}[EXP,pTF]{\token_if_parameter:N} % \begin{syntax} % \cs{token_if_parameter_p:N} \meta{token} \\ -% \cs{token_if_alignment:NTF} \meta{token} \Arg{true code} \Arg{false code} +% \cs{token_if_parameter:NTF} \meta{token} \Arg{true code} \Arg{false code} % \end{syntax} % Tests if \meta{token} has the category code of a macro parameter token % (|#| when normal \TeX{} category codes are in force). diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx index 38f142f04f..5aa2987d19 100644 --- a/macros/latex/contrib/l3kernel/l3unicode.dtx +++ b/macros/latex/contrib/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-10-18} +% \date{Released 2021-11-12} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf Binary files differindex 9884bf29d1..8d919c1a26 100644 --- a/macros/latex/contrib/l3kernel/source3.pdf +++ b/macros/latex/contrib/l3kernel/source3.pdf diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex index 7910459271..56c5f487d7 100644 --- a/macros/latex/contrib/l3kernel/source3.tex +++ b/macros/latex/contrib/l3kernel/source3.tex @@ -53,7 +53,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-10-18} +\date{Released 2021-11-12} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3packages/CHANGELOG.md b/macros/latex/contrib/l3packages/CHANGELOG.md index 9b7487dc51..a5a54eeed0 100644 --- a/macros/latex/contrib/l3packages/CHANGELOG.md +++ b/macros/latex/contrib/l3packages/CHANGELOG.md @@ -7,6 +7,11 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-11-12] + +### Added +- Added `\NewCommandCopy` support for deprecated argument types. + ## [2021-08-27] ### Changed @@ -159,7 +164,8 @@ this project uses date-based 'snapshot' version identifiers. - Switch to ISO date format - Improve cross-module use of internal functions -[Unreleased]: https://github.com/latex3/latex3/compare/2021-08-27...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-11-12...HEAD +[2021-11-12]: https://github.com/latex3/latex3/compare/2021-08-27...2021-11-12 [2021-08-27]: https://github.com/latex3/latex3/compare/2021-08-04...2021-08-27 [2021-08-04]: https://github.com/latex3/latex3/compare/2021-06-18...2021-08-04 [2021-06-18]: https://github.com/latex3/latex3/compare/2021-06-01...2021-06-18 diff --git a/macros/latex/contrib/l3packages/README.md b/macros/latex/contrib/l3packages/README.md index d20f9f83be..d71cfcc584 100644 --- a/macros/latex/contrib/l3packages/README.md +++ b/macros/latex/contrib/l3packages/README.md @@ -1,7 +1,7 @@ LaTeX3 High-Level Concepts ========================== -Release 2021-08-27 +Release 2021-11-12 Overview -------- diff --git a/macros/latex/contrib/l3packages/l3keys2e.dtx b/macros/latex/contrib/l3packages/l3keys2e.dtx index f10eb7e8ce..6aeaba3229 100644 --- a/macros/latex/contrib/l3packages/l3keys2e.dtx +++ b/macros/latex/contrib/l3packages/l3keys2e.dtx @@ -62,7 +62,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -139,7 +139,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3keys2e}{2021-08-27}{} +\ProvidesExplPackage{l3keys2e}{2021-11-12}{} {LaTeX2e option processing using LaTeX3 keys} % \end{macrocode} % diff --git a/macros/latex/contrib/l3packages/l3keys2e.pdf b/macros/latex/contrib/l3packages/l3keys2e.pdf Binary files differindex 587e3201c2..8cece1c69c 100644 --- a/macros/latex/contrib/l3packages/l3keys2e.pdf +++ b/macros/latex/contrib/l3packages/l3keys2e.pdf diff --git a/macros/latex/contrib/l3packages/xfp.dtx b/macros/latex/contrib/l3packages/xfp.dtx index cef3891fe2..c3ba90bb14 100644 --- a/macros/latex/contrib/l3packages/xfp.dtx +++ b/macros/latex/contrib/l3packages/xfp.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -166,7 +166,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfp}{2021-08-27}{} +\ProvidesExplPackage{xfp}{2021-11-12}{} {L3 Floating point unit} % \end{macrocode} % diff --git a/macros/latex/contrib/l3packages/xfp.pdf b/macros/latex/contrib/l3packages/xfp.pdf Binary files differindex cd5a23f601..0e0dc875b7 100644 --- a/macros/latex/contrib/l3packages/xfp.pdf +++ b/macros/latex/contrib/l3packages/xfp.pdf diff --git a/macros/latex/contrib/l3packages/xfrac.dtx b/macros/latex/contrib/l3packages/xfrac.dtx index 2840b4318a..efe75c161a 100644 --- a/macros/latex/contrib/l3packages/xfrac.dtx +++ b/macros/latex/contrib/l3packages/xfrac.dtx @@ -65,7 +65,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -535,7 +535,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xfrac}{2021-08-27}{} +\ProvidesExplPackage{xfrac}{2021-11-12}{} {L3 Experimental split-level fractions} % \end{macrocode} % diff --git a/macros/latex/contrib/l3packages/xfrac.pdf b/macros/latex/contrib/l3packages/xfrac.pdf Binary files differindex 2895df4613..b5b461116e 100644 --- a/macros/latex/contrib/l3packages/xfrac.pdf +++ b/macros/latex/contrib/l3packages/xfrac.pdf diff --git a/macros/latex/contrib/l3packages/xparse.dtx b/macros/latex/contrib/l3packages/xparse.dtx index fd4b615e15..f601bd9c5f 100644 --- a/macros/latex/contrib/l3packages/xparse.dtx +++ b/macros/latex/contrib/l3packages/xparse.dtx @@ -67,7 +67,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -1064,7 +1064,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xparse}{2021-08-27}{} +\ProvidesExplPackage{xparse}{2021-11-12}{} {L3 Experimental document command parser} % \end{macrocode} % @@ -1249,6 +1249,39 @@ % \end{macrocode} % \end{macro} % +% \subsection{Copying a command and its internal structure} +% +% The apparatus for copying commands is almost entirely in |ltcmd.dtx|, +% preloaded in the \LaTeXe{} kernel. The missing parts, regarding +% copying the deprecated argument types |G|, |l| and |u| boil down to +% copying the expandable grabber for |u|. +% +% \begin{macro}{\@@_copy_grabber_u:w} +% An expandable |u|-type uses a dedicated grabber just like a +% |D|-type, except that both its delimiter tokens are omitted, so to +% copy that we just copy a |D|-type and leave the last two arguments +% empty: +% \begin{macrocode} +\cs_new_protected:Npn \@@_copy_grabber_u:w #1 #2 #3 + { \@@_copy_grabber_D:w {#1} {#2} {#3} { } { } } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Showing the definition of a command} +% +% \begin{macro}{\c_@@_show_type_u_tl,\c_@@_show_type_G_tl} +% Same as for copying, only small bits are missing here. Namely, two +% token lists that tell the \pkg{ltcmd} mechanism how to deal with the +% argument types defined here. Both |G| and |u| are classified +% as~|3|: commands that take a default value. That's not really true +% for~|u|, but it's a close enough approximation to get the output we +% want. +% \begin{macrocode} +\tl_const:Nn \c_@@_show_type_u_tl { 3 } +\tl_const:Nn \c_@@_show_type_G_tl { 3 } +% \end{macrocode} +% \end{macro} +% % \subsection{Grabbing arguments} % % \begin{macro}{\@@_grab_G:w} diff --git a/macros/latex/contrib/l3packages/xparse.pdf b/macros/latex/contrib/l3packages/xparse.pdf Binary files differindex 139e90a873..f7075f0b22 100644 --- a/macros/latex/contrib/l3packages/xparse.pdf +++ b/macros/latex/contrib/l3packages/xparse.pdf diff --git a/macros/latex/contrib/l3packages/xtemplate.dtx b/macros/latex/contrib/l3packages/xtemplate.dtx index 9c038494f3..8dfe79ec34 100644 --- a/macros/latex/contrib/l3packages/xtemplate.dtx +++ b/macros/latex/contrib/l3packages/xtemplate.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-08-27} +% \date{Released 2021-11-12} % % \maketitle % @@ -682,7 +682,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xtemplate}{2021-08-27}{} +\ProvidesExplPackage{xtemplate}{2021-11-12}{} {L3 Experimental prototype document functions} % \end{macrocode} % @@ -1280,7 +1280,7 @@ \seq_put_right:No \l_@@_key_order_seq \l_@@_key_name_tl \str_if_eq:onT \l_@@_keytype_tl { choice } { - \clist_if_in:NnT \l_@@_keytype_arg_tl { unknown } + \exp_args:No \clist_if_in:nnT \l_@@_keytype_arg_tl { unknown } { \msg_error:nn { xtemplate } { choice-unknown-reserved } } } } @@ -1446,95 +1446,50 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_store_value_code:n} -% \begin{macro}{\@@_store_value_choice:n} -% \begin{macro}{\@@_store_value_commalist:n} -% \begin{macro}{\@@_store_value_function:n} -% \begin{macro}{\@@_store_value_instance:n} -% \begin{macro}{\@@_store_value_real:n} -% \begin{macro}{\@@_store_value_tokenlist:n} +% \begin{macro}{\@@_store_value_code:n, \@@_store_value_choice:n, +% \@@_store_value_function:n, \@@_store_value_instance:n} % With no need to worry about delayed evaluation, these keytypes all % just store the input directly. % \begin{macrocode} \cs_new_protected:Npn \@@_store_value_code:n #1 { \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} } \cs_new_eq:NN \@@_store_value_choice:n \@@_store_value_code:n -\cs_new_eq:NN \@@_store_value_commalist:n \@@_store_value_code:n \cs_new_eq:NN \@@_store_value_function:n \@@_store_value_code:n \cs_new_eq:NN \@@_store_value_instance:n \@@_store_value_code:n -\cs_new_eq:NN \@@_store_value_real:n \@@_store_value_code:n -\cs_new_eq:NN \@@_store_value_tokenlist:n \@@_store_value_code:n % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % -% \begin{macro}{\@@_store_value_integer:n} -% \begin{macro}{\@@_store_value_length:n} -% \begin{macro}{\@@_store_value_muskip:n} -% \begin{macro}{\@@_store_value_skip:n} -% Storing the value of a number is in all cases more or less the same. -% If evaluation is taking place now, assignment is made to a scratch -% variable, and this result is then stored. On the other hand, if -% evaluation is delayed the current data is simply stored \enquote{as is}. +% \begin{macro}{\@@_store_value_aux:Nn, \@@_store_value_integer:n, +% \@@_store_value_length:n, \@@_store_value_muskip:n, +% \@@_store_value_real:n, \@@_store_value_skip:n, +% \@@_store_value_tokenlist:n, \@@_store_value_commalist:n} +% Storing values in \cs{l_@@_values_prop} is in most cases the same. +% If evaluation is taking place now, one \texttt{x}-expands an +% evaluation function and the result is then stored. On the other +% hand, if evaluation is delayed the current data is simply stored +% \enquote{as is}. % \begin{macrocode} -\cs_new_protected:Npn \@@_store_value_integer:n #1 - { - \@@_if_eval_now:nTF {#1} - { - \int_set:Nn \l_@@_tmp_int {#1} - \prop_put:NVV \l_@@_values_prop \l_@@_key_name_int - \l_@@_tmp_int - } - { - \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} - } - } -\cs_new_protected:Npn \@@_store_value_length:n #1 - { - \@@_if_eval_now:nTF {#1} - { - \dim_set:Nn \l_@@_tmp_dim {#1} - \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl - \l_@@_tmp_dim - } - { - \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} - } - } -\cs_new_protected:Npn \@@_store_value_muskip:n #1 - { - \@@_if_eval_now:nTF {#1} - { - \muskip_set:Nn \l_@@_tmp_muskip {#1} - \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl - \l_@@_tmp_muskip - } - { - \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} - } - } -\cs_new_protected:Npn \@@_store_value_skip:n #1 +\cs_new_protected:Npn \@@_store_value_aux:Nn #1#2 { - \@@_if_eval_now:nTF {#1} - { - \skip_set:Nn \l_@@_tmp_skip {#1} - \prop_put:NVV \l_@@_values_prop \l_@@_key_name_tl - \l_@@_tmp_skip - } - { - \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#1} - } + \@@_if_eval_now:nTF {#2} + { \prop_put:NVx \l_@@_values_prop \l_@@_key_name_tl { #1 {#2} } } + { \prop_put:Non \l_@@_values_prop \l_@@_key_name_tl {#2} } } +\cs_new_protected:Npn \@@_store_value_integer:n + { \@@_store_value_aux:Nn \int_eval:n } +\cs_new_protected:Npn \@@_store_value_length:n + { \@@_store_value_aux:Nn \dim_eval:n } +\cs_new_protected:Npn \@@_store_value_muskip:n + { \@@_store_value_aux:Nn \muskip_eval:n } +\cs_new_protected:Npn \@@_store_value_real:n + { \@@_store_value_aux:Nn \fp_eval:n } +\cs_new_protected:Npn \@@_store_value_skip:n + { \@@_store_value_aux:Nn \skip_eval:n } +\cs_new_protected:Npn \@@_store_value_tokenlist:n + { \@@_store_value_aux:Nn \use:n } +\cs_new_eq:NN \@@_store_value_commalist:n \@@_store_value_tokenlist:n % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % % \subsection{Implementation part of template declaration} % @@ -1713,7 +1668,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_implement_choices:n #1 { - \clist_set_eq:NN \l_@@_tmp_clist \l_@@_keytype_arg_tl + \clist_set:No \l_@@_tmp_clist { \l_@@_keytype_arg_tl } \prop_put:Non \l_@@_vars_prop \l_@@_key_name_tl { } \keyval_parse:NNn \@@_implement_choice_elt:n \@@_implement_choice_elt:nn diff --git a/macros/latex/contrib/l3packages/xtemplate.pdf b/macros/latex/contrib/l3packages/xtemplate.pdf Binary files differindex dd14606df0..10bea564f7 100644 --- a/macros/latex/contrib/l3packages/xtemplate.pdf +++ b/macros/latex/contrib/l3packages/xtemplate.pdf diff --git a/macros/latex/required/amsmath/README.md b/macros/latex/required/amsmath/README.md index fad5c87465..f7c700994c 100644 --- a/macros/latex/required/amsmath/README.md +++ b/macros/latex/required/amsmath/README.md @@ -1,7 +1,7 @@ The amsmath bundle for LaTeX ============================ -Release 2021-06-01 +Release 2021-11-15 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: @@ -39,7 +39,7 @@ Additional documentation files include: which are included in the collection. All of these can be accessed easily with most distributions by entering `texdoc` *filename* at the -command line, or via [TeXdoc Online](http://texdoc.net). +command line, or via [TeXdoc Online](https://texdoc.org). Change logs ----------- @@ -61,7 +61,7 @@ In particular, to check that you are really seeing a bug, please write a short, self-contained document that shows the problem. This should include the `latexbug` package, which will warn if your test file is not suitable for one or the other reason. See the [CONTRIBUTING -guide](https://github.com/latex3/latex2e/blob/master/CONTRIBUTING.md) +guide](https://github.com/latex3/latex2e/blob/main/CONTRIBUTING.md) for further details, or if you need to obtain the `latexbug` package. If the bug turns out to be with third-party software then please @@ -78,4 +78,3 @@ version 1.3c or later. <p>Copyright (C) 2001-2004, 2007, 2008, 2010, 2011, 2013 American Mathematical Society. <br /> <p>Copyright (C) 2016-2021 The LaTeX Project and American Mathematical Society. <br /> - diff --git a/macros/latex/required/amsmath/amsbsy.pdf b/macros/latex/required/amsmath/amsbsy.pdf Binary files differindex 87298e6b74..50882b2530 100644 --- a/macros/latex/required/amsmath/amsbsy.pdf +++ b/macros/latex/required/amsmath/amsbsy.pdf diff --git a/macros/latex/required/amsmath/amscd.pdf b/macros/latex/required/amsmath/amscd.pdf Binary files differindex 769bb0ae41..f1182d6c20 100644 --- a/macros/latex/required/amsmath/amscd.pdf +++ b/macros/latex/required/amsmath/amscd.pdf diff --git a/macros/latex/required/amsmath/amsgen.pdf b/macros/latex/required/amsmath/amsgen.pdf Binary files differindex f39d348b26..7f7d05c81f 100644 --- a/macros/latex/required/amsmath/amsgen.pdf +++ b/macros/latex/required/amsmath/amsgen.pdf diff --git a/macros/latex/required/amsmath/amsldoc.pdf b/macros/latex/required/amsmath/amsldoc.pdf Binary files differindex d1d5a1b729..b3cbac1118 100644 --- a/macros/latex/required/amsmath/amsldoc.pdf +++ b/macros/latex/required/amsmath/amsldoc.pdf diff --git a/macros/latex/required/amsmath/amsldoc.tex b/macros/latex/required/amsmath/amsldoc.tex index 26ea6cf808..97294772e7 100644 --- a/macros/latex/required/amsmath/amsldoc.tex +++ b/macros/latex/required/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/macros/latex/required/amsmath/amsmath.dtx b/macros/latex/required/amsmath/amsmath.dtx index 8857861101..a5cf333e79 100644 --- a/macros/latex/required/amsmath/amsmath.dtx +++ b/macros/latex/required/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/10/15 v2.17l 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}}{% @@ -3010,7 +3012,13 @@ ill-advised in LaTeX.% % the \cs{maketag@@} macro above. % \begin{macrocode} \let\df@tag\@empty -\def\make@df@tag{\@ifstar\make@df@tag@@\make@df@tag@@@} +\def\make@df@tag{% +% \end{macrocode} +% We set \cs{@currentcounter} here so that it applies to both branches. +%\changes{v2.17l}{2021/10/15}{Explicitly set \cs{@currentcounter} (gh/687)} +% \begin{macrocode} + \def\@currentcounter{equation}% + \@ifstar\make@df@tag@@\make@df@tag@@@} % \end{macrocode} % \cs{make@df@tag} sets \cs{@currentlabel} and defines % \cs{df@tag} appropriately. @@ -6500,8 +6508,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 +6529,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/macros/latex/required/amsmath/amsmath.pdf b/macros/latex/required/amsmath/amsmath.pdf Binary files differindex bf6facd4ae..1212097e79 100644 --- a/macros/latex/required/amsmath/amsmath.pdf +++ b/macros/latex/required/amsmath/amsmath.pdf diff --git a/macros/latex/required/amsmath/amsopn.dtx b/macros/latex/required/amsmath/amsopn.dtx index a71c13d6c8..03df1a116b 100644 --- a/macros/latex/required/amsmath/amsopn.dtx +++ b/macros/latex/required/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/macros/latex/required/amsmath/amsopn.pdf b/macros/latex/required/amsmath/amsopn.pdf Binary files differindex 93967d67d9..0c6ae29bc2 100644 --- a/macros/latex/required/amsmath/amsopn.pdf +++ b/macros/latex/required/amsmath/amsopn.pdf diff --git a/macros/latex/required/amsmath/amstext.dtx b/macros/latex/required/amsmath/amstext.dtx index d6475561fb..88cc837f03 100644 --- a/macros/latex/required/amsmath/amstext.dtx +++ b/macros/latex/required/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/macros/latex/required/amsmath/amstext.pdf b/macros/latex/required/amsmath/amstext.pdf Binary files differindex 96bdf23de3..afaa124a10 100644 --- a/macros/latex/required/amsmath/amstext.pdf +++ b/macros/latex/required/amsmath/amstext.pdf diff --git a/macros/latex/required/amsmath/amsxtra.pdf b/macros/latex/required/amsmath/amsxtra.pdf Binary files differindex 52412bd2bf..7c694e14b2 100644 --- a/macros/latex/required/amsmath/amsxtra.pdf +++ b/macros/latex/required/amsmath/amsxtra.pdf diff --git a/macros/latex/required/amsmath/changes.txt b/macros/latex/required/amsmath/changes.txt index 63bea7e727..3f3c36bf79 100644 --- a/macros/latex/required/amsmath/changes.txt +++ b/macros/latex/required/amsmath/changes.txt @@ -3,6 +3,20 @@ All changes above are only part of the development branch for the next release. ================================================================================ ######################### +# 2021-11-15 Release +######################### + +2021-10-15 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * amsmath.dtx (subsection{Implementing tags and labels}): + Explicitly set \@currentcounter (gh/687) + +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 (gh/652) + +######################### # 2021-06-01 Release ######################### diff --git a/macros/latex/required/amsmath/subeqn.pdf b/macros/latex/required/amsmath/subeqn.pdf Binary files differindex 8d303240df..c016df16b8 100644 --- a/macros/latex/required/amsmath/subeqn.pdf +++ b/macros/latex/required/amsmath/subeqn.pdf diff --git a/macros/latex/required/amsmath/technote.pdf b/macros/latex/required/amsmath/technote.pdf Binary files differindex 92bf94d6aa..7027cfd8df 100644 --- a/macros/latex/required/amsmath/technote.pdf +++ b/macros/latex/required/amsmath/technote.pdf diff --git a/macros/latex/required/amsmath/testmath.pdf b/macros/latex/required/amsmath/testmath.pdf Binary files differindex b08715bb87..7fc3601faf 100644 --- a/macros/latex/required/amsmath/testmath.pdf +++ b/macros/latex/required/amsmath/testmath.pdf diff --git a/macros/latex/required/firstaid/changes.txt b/macros/latex/required/firstaid/changes.txt index f84c9dbc5b..6f8268c6b6 100644 --- a/macros/latex/required/firstaid/changes.txt +++ b/macros/latex/required/firstaid/changes.txt @@ -1,3 +1,13 @@ +2021-11-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * latex2e-first-aid-for-external-files.dtx: + Drop first aid no longer needed. + +2021-10-22 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * latex2e-first-aid-for-external-files.dtx (subsection{The \pkg{CJK} package first aid}): + With its 2021/10/26 release the firstaid for CJK is no longer needed. + 2021-06-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * latex2e-first-aid-for-external-files.dtx: diff --git a/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx index b15a63d7ec..fb8d340137 100644 --- a/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx +++ b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.dtx @@ -111,8 +111,8 @@ % \end{macrocode} % % \begin{macrocode} -\def\LaTeXFirstAidDate{2021/06/28} -\def\LaTeXFirstAidVersion{v1.0o} +\def\LaTeXFirstAidDate{2021/11/11} +\def\LaTeXFirstAidVersion{v1.0q} % \end{macrocode} % % \begin{macrocode} @@ -227,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 @@ -238,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} % @@ -248,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} % @@ -260,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} @@ -302,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. @@ -312,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}% {% @@ -347,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}}% } @@ -369,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} @@ -396,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 @@ -455,69 +455,10 @@ % % % -% -% -% \subsection{The \pkg{CJK} package first aid} -% % \begin{macrocode} %<*kernel> % \end{macrocode} % -% The package redefines \cs{selectfont} to add some code but -% otherwise uses the old definition. So we make a copy of the -% newer kernel definition and restore it after the package got -% loaded. The extra code that the package needs can go into the -% newly provided hook instead. -% -% \begin{macrocode} -\DeclareCommandCopy\CJK@selectfont\selectfont -% \end{macrocode} -% -% \begin{macrocode} -\AddToHook{file/after/CJK.sty}[firstaid]{% - \FirstAidNeededT{CJK}{sty}% - {2015/04/18 4.8.4}% - {% - \DeclareCommandCopy\selectfont\CJK@selectfont -% \end{macrocode} -% -% \begin{macrocode} - \AddToHook{selectfont}[CJK]{% - \expandafter\ifx\csname CJK@\curr@fontshape\endcsname \relax - \else - \CJK@bold@false - \csname CJK@\curr@fontshape\endcsname - \fi - }% - }% -} -% \end{macrocode} -% -% -% -% \subsection{\cs{footref} first aid} -% -% 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} -% } -% \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 -%} -% \end{macrocode} -% -% % % % @@ -536,7 +477,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 @@ -566,7 +507,7 @@ % 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}% } @@ -585,7 +526,7 @@ % \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}% {% @@ -679,35 +620,6 @@ \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/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.pdf b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.pdf Binary files differindex 5b395e4e10..d505fa379b 100644 --- a/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.pdf +++ b/macros/latex/required/firstaid/latex2e-first-aid-for-external-files.pdf diff --git a/macros/latex/required/graphics/README.md b/macros/latex/required/graphics/README.md index ea03424181..896ce7366a 100644 --- a/macros/latex/required/graphics/README.md +++ b/macros/latex/required/graphics/README.md @@ -1,7 +1,7 @@ The LaTeX `graphics` bundle =========================== -Release 2021-06-01 +Release 2021-11-15 Overview -------- @@ -40,7 +40,7 @@ In particular, to check that you are really seeing a bug, please write a short, self-contained document that shows the problem. This should include the `latexbug` package, which will warn if your test file is not suitable for one or the other reason. See the [CONTRIBUTING -guide](https://github.com/latex3/latex2e/blob/master/CONTRIBUTING.md) +guide](https://github.com/latex3/latex2e/blob/main/CONTRIBUTING.md) for further details, or if you need to obtain the `latexbug` package. If the bug turns out to be with third-party software then please diff --git a/macros/latex/required/graphics/changes.txt b/macros/latex/required/graphics/changes.txt index 0616e3b692..374cbd1c6b 100644 --- a/macros/latex/required/graphics/changes.txt +++ b/macros/latex/required/graphics/changes.txt @@ -9,7 +9,29 @@ All changes above are only part of the development branch for the next release. ================================================================================ ######################### -# 2021-16-01 Release +# 2021-11-15 Release +######################### + +2021-09-27 David Carlisle <David.Carlisle@latex-project.org> + + * color.dtx: use \@backslashchar color rather than \string\color to + generate internal csnames, to avoid relying on the current setting + of \escapechar + +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 + +######################### +# 2021-06-01 Release ######################### 2021-03-04 Phelype Oleinik <phelype.oleinik@latex-project.org> diff --git a/macros/latex/required/graphics/color.dtx b/macros/latex/required/graphics/color.dtx index 2dfbb238da..9418a12477 100644 --- a/macros/latex/required/graphics/color.dtx +++ b/macros/latex/required/graphics/color.dtx @@ -21,7 +21,7 @@ %<driver> \ProvidesFile{color.drv} % \fi % \ProvidesFile{color.dtx} - [2020/02/24 v1.2b Standard LaTeX Color (DPC)] + [2021/10/11 v1.3b Standard LaTeX Color (DPC)] % % \iffalse %<*driver> @@ -78,6 +78,9 @@ % fixed values whilst this file is being read. % \changes{v0.3b}{1994/09/14} % {Save and restore catcodes} +% \changes{v1.3a}{2021/09/27} +% {Use \cs{@backslashchar} in preference to \cs{string} gh/659} +% % \begin{macrocode} \edef\Gin@codes{% \catcode`\noexpand\^^A\the\catcode`\^^A\relax @@ -185,9 +188,11 @@ % \begin{option}{dvipdfm} % \changes{v1.0h}{1999/01/13} % {dvipdfm added} -% Mark Wick's dvipdfm driver. +% \changes{v1.3b}{2021/10/11} +% {make dvipdfm an alias for dvipdfmx} +% Mark Wick's dvipdfm driver (now merged with xdvipdfmx). % \begin{macrocode} -\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}} +\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfmx.def}} % \end{macrocode} % \end{option} % @@ -375,7 +380,7 @@ % \begin{macrocode} \DeclareOption{usenames}{% \def\c@lor@usename#1{% - \expandafter\color@named\csname\string\color @#1\endcsname{#1}}} + \expandafter\color@named\csname\@backslashchar color @#1\endcsname{#1}}} % \end{macrocode} % \end{option} % @@ -432,10 +437,10 @@ % Finally call |\set@color| to effect the colour change. % \begin{macrocode} \def\@declaredcolor#1{% - \@ifundefined{\string\color @#1}% + \@ifundefined{\@backslashchar color @#1}% {\c@lor@error{`#1'}}% {\expandafter\let\expandafter\current@color - \csname\string\color @#1\endcsname + \csname\@backslashchar color @#1\endcsname \set@color}% \ignorespaces} % \end{macrocode} @@ -506,7 +511,7 @@ % \begin{macrocode} \protected\def\nopagecolor{% \@ifundefined{no@page@color}{% - \PackageInfo{color}{\string\nopagecolor\space is not supported}% + \PackageInfo{color}{\@backslashchar nopagecolor\space is not supported}% }{% \no@page@color }% @@ -545,10 +550,10 @@ \protected\def\definecolor#1#2#3{% \@ifundefined{color@#2}% {\c@lor@error{model `#2'}}% - {\@ifundefined{\string\color @#1}{}% + {\@ifundefined{\@backslashchar color @#1}{}% {\PackageInfo{color}{Redefining color #1}}% \csname color@#2\expandafter\endcsname - \csname\string\color @#1\endcsname{#3}}} + \csname\@backslashchar color @#1\endcsname{#3}}} % \end{macrocode} % \end{macro} % diff --git a/macros/latex/required/graphics/color.pdf b/macros/latex/required/graphics/color.pdf Binary files differindex db66628b7b..f8c3c65aa4 100644 --- a/macros/latex/required/graphics/color.pdf +++ b/macros/latex/required/graphics/color.pdf diff --git a/macros/latex/required/graphics/drivers.pdf b/macros/latex/required/graphics/drivers.pdf Binary files differindex cfe44a2d42..6e4154e751 100644 --- a/macros/latex/required/graphics/drivers.pdf +++ b/macros/latex/required/graphics/drivers.pdf diff --git a/macros/latex/required/graphics/epsfig.pdf b/macros/latex/required/graphics/epsfig.pdf Binary files differindex 04130ff11d..7fca183869 100644 --- a/macros/latex/required/graphics/epsfig.pdf +++ b/macros/latex/required/graphics/epsfig.pdf diff --git a/macros/latex/required/graphics/graphics.dtx b/macros/latex/required/graphics/graphics.dtx index 0c5c9e88ec..cec35559ef 100644 --- a/macros/latex/required/graphics/graphics.dtx +++ b/macros/latex/required/graphics/graphics.dtx @@ -616,7 +616,7 @@ % \end{macrocode} % \end{option} % -% \begin{option}{luatex} +% \begin{option}{dvisvgm} % \changes{v1.0r}{2016/05/09} % {dvisvgm added} % dvisvgm driver. diff --git a/macros/latex/required/graphics/graphics.pdf b/macros/latex/required/graphics/graphics.pdf Binary files differindex a04eeda406..17c7d7e936 100644 --- a/macros/latex/required/graphics/graphics.pdf +++ b/macros/latex/required/graphics/graphics.pdf diff --git a/macros/latex/required/graphics/graphicx.dtx b/macros/latex/required/graphics/graphicx.dtx index a2fc17e393..29e0db5b12 100644 --- a/macros/latex/required/graphics/graphicx.dtx +++ b/macros/latex/required/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/macros/latex/required/graphics/graphicx.pdf b/macros/latex/required/graphics/graphicx.pdf Binary files differindex 3ad1c02d20..a7ffe13078 100644 --- a/macros/latex/required/graphics/graphicx.pdf +++ b/macros/latex/required/graphics/graphicx.pdf diff --git a/macros/latex/required/graphics/grfguide.pdf b/macros/latex/required/graphics/grfguide.pdf Binary files differindex 06f2deb274..fddd2595da 100644 --- a/macros/latex/required/graphics/grfguide.pdf +++ b/macros/latex/required/graphics/grfguide.pdf diff --git a/macros/latex/required/graphics/keyval.pdf b/macros/latex/required/graphics/keyval.pdf Binary files differindex 6cd93d9352..f57d32807f 100644 --- a/macros/latex/required/graphics/keyval.pdf +++ b/macros/latex/required/graphics/keyval.pdf diff --git a/macros/latex/required/graphics/lscape.pdf b/macros/latex/required/graphics/lscape.pdf Binary files differindex 94b8061126..1e0dabceed 100644 --- a/macros/latex/required/graphics/lscape.pdf +++ b/macros/latex/required/graphics/lscape.pdf diff --git a/macros/latex/required/graphics/rotating.pdf b/macros/latex/required/graphics/rotating.pdf Binary files differindex c95ead1465..de222fd290 100644 --- a/macros/latex/required/graphics/rotating.pdf +++ b/macros/latex/required/graphics/rotating.pdf diff --git a/macros/latex/required/graphics/rotex.pdf b/macros/latex/required/graphics/rotex.pdf Binary files differindex 789f1f0fde..b8edcb0a6e 100644 --- a/macros/latex/required/graphics/rotex.pdf +++ b/macros/latex/required/graphics/rotex.pdf diff --git a/macros/latex/required/graphics/trig.dtx b/macros/latex/required/graphics/trig.dtx index 83e774ff20..533f3b0648 100644 --- a/macros/latex/required/graphics/trig.dtx +++ b/macros/latex/required/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/macros/latex/required/graphics/trig.pdf b/macros/latex/required/graphics/trig.pdf Binary files differindex 8ad4700d52..14627b628d 100644 --- a/macros/latex/required/graphics/trig.pdf +++ b/macros/latex/required/graphics/trig.pdf diff --git a/macros/latex/required/tools/README.md b/macros/latex/required/tools/README.md index 067b0240bd..cad662ebb1 100644 --- a/macros/latex/required/tools/README.md +++ b/macros/latex/required/tools/README.md @@ -1,7 +1,7 @@ The LaTeX `tools` bundle ======================== -Release 2021-06-01 +Release 2021-11-15 Overview -------- @@ -30,7 +30,7 @@ In particular, to check that you are really seeing a bug, please write a short, self-contained document that shows the problem. This should include the `latexbug` package, which will warn if your test file is not suitable for one or the other reason. See the [CONTRIBUTING -guide](https://github.com/latex3/latex2e/blob/master/CONTRIBUTING.md) +guide](https://github.com/latex3/latex2e/blob/main/CONTRIBUTING.md) for further details, or if you need to obtain the `latexbug` package. If the bug turns out to be with third-party software then please @@ -51,4 +51,4 @@ of the package. ----- -<p>Copyright (C) 1993-2020 The LaTeX Project <br /> +<p>Copyright (C) 1993-2021 The LaTeX Project <br /> diff --git a/macros/latex/required/tools/afterpage.pdf b/macros/latex/required/tools/afterpage.pdf Binary files differindex 2bb917ba26..305337ebc1 100644 --- a/macros/latex/required/tools/afterpage.pdf +++ b/macros/latex/required/tools/afterpage.pdf diff --git a/macros/latex/required/tools/array.dtx b/macros/latex/required/tools/array.dtx index 84376a486b..ba88aba7c2 100644 --- a/macros/latex/required/tools/array.dtx +++ b/macros/latex/required/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/10/04 v2.5f Tabular extension package (FMi)] % % \fi % @@ -927,12 +927,12 @@ % \textsf{token} is stored in the % \textsf{count} register =\@lastchclass=. % All of the mentioned registers are already allocated in -% \texttt{latex.tex}, +% the \LaTeX{} format, % which is the reason why the following three lines of code are % commented out. % Later throughout the text I will not mention it again explicitly % whenever I use a =%= sign. These parts are already defined in -% \texttt{latex.tex}. +% the \LaTeX{} format. % \begin{macrocode} % \newcount \@chclass % \newcount \@chnum @@ -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/macros/latex/required/tools/array.pdf b/macros/latex/required/tools/array.pdf Binary files differindex c5ea42a298..b53441748b 100644 --- a/macros/latex/required/tools/array.pdf +++ b/macros/latex/required/tools/array.pdf diff --git a/macros/latex/required/tools/bm.pdf b/macros/latex/required/tools/bm.pdf Binary files differindex c3d1a80244..676814876a 100644 --- a/macros/latex/required/tools/bm.pdf +++ b/macros/latex/required/tools/bm.pdf diff --git a/macros/latex/required/tools/calc.pdf b/macros/latex/required/tools/calc.pdf Binary files differindex f0ed081c36..27edf27493 100644 --- a/macros/latex/required/tools/calc.pdf +++ b/macros/latex/required/tools/calc.pdf diff --git a/macros/latex/required/tools/changes.txt b/macros/latex/required/tools/changes.txt index 17278e4a54..43464f8b24 100644 --- a/macros/latex/required/tools/changes.txt +++ b/macros/latex/required/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 @@ -11,13 +10,55 @@ All changes above are only part of the development branch for the next release. ================================================================================ ######################### +# 2021-11-15 Release +######################### + +2021-10-28 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * multicol.dtx (subsection{Manual column breaking} \label{sec:colbreak}): + Corrected and error message text (gh/703) + +2021-10-22 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * multicol.dtx: + swap names of \mult@gfirstbox and \mult@firstbox because wrong (gh/701) + drop one unnecessary box allocation (gh701) + +2021-10-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * multicol.dtx: + Added optional argument to \columnbreak and implemented \newcolumn (gh/682) + +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. + +######################### # 2021-06-01 Release ######################### 2021-05-07 David Carlisle <David.Carlisle@latex-project.org> * longtable.dtx: write lists of tables entry to the file with - extension \ext@table, not force .lot github/561 + extension \ext@table, not force .lot (github/561) 2021-04-25 David Carlisle <David.Carlisle@latex-project.org> diff --git a/macros/latex/required/tools/dcolumn.pdf b/macros/latex/required/tools/dcolumn.pdf Binary files differindex b69a082391..8b5ed07f9e 100644 --- a/macros/latex/required/tools/dcolumn.pdf +++ b/macros/latex/required/tools/dcolumn.pdf diff --git a/macros/latex/required/tools/delarray.pdf b/macros/latex/required/tools/delarray.pdf Binary files differindex c096ed8494..e166deaf34 100644 --- a/macros/latex/required/tools/delarray.pdf +++ b/macros/latex/required/tools/delarray.pdf diff --git a/macros/latex/required/tools/enumerate.pdf b/macros/latex/required/tools/enumerate.pdf Binary files differindex c8c7bb1556..f9c8f07850 100644 --- a/macros/latex/required/tools/enumerate.pdf +++ b/macros/latex/required/tools/enumerate.pdf diff --git a/macros/latex/required/tools/fileerr.pdf b/macros/latex/required/tools/fileerr.pdf Binary files differindex ab3c63916b..3ae0da8810 100644 --- a/macros/latex/required/tools/fileerr.pdf +++ b/macros/latex/required/tools/fileerr.pdf diff --git a/macros/latex/required/tools/fontsmpl.pdf b/macros/latex/required/tools/fontsmpl.pdf Binary files differindex 6b906b2d7e..5a4123dfc5 100644 --- a/macros/latex/required/tools/fontsmpl.pdf +++ b/macros/latex/required/tools/fontsmpl.pdf diff --git a/macros/latex/required/tools/ftnright.pdf b/macros/latex/required/tools/ftnright.pdf Binary files differindex 55441d9c42..e98cb88633 100644 --- a/macros/latex/required/tools/ftnright.pdf +++ b/macros/latex/required/tools/ftnright.pdf diff --git a/macros/latex/required/tools/hhline.pdf b/macros/latex/required/tools/hhline.pdf Binary files differindex 641d12e5d6..188fd037f7 100644 --- a/macros/latex/required/tools/hhline.pdf +++ b/macros/latex/required/tools/hhline.pdf diff --git a/macros/latex/required/tools/indentfirst.pdf b/macros/latex/required/tools/indentfirst.pdf Binary files differindex 9659e54bd2..f6460af970 100644 --- a/macros/latex/required/tools/indentfirst.pdf +++ b/macros/latex/required/tools/indentfirst.pdf diff --git a/macros/latex/required/tools/layout.pdf b/macros/latex/required/tools/layout.pdf Binary files differindex fc54c114b4..153ffc0a8a 100644 --- a/macros/latex/required/tools/layout.pdf +++ b/macros/latex/required/tools/layout.pdf diff --git a/macros/latex/required/tools/longtable.dtx b/macros/latex/required/tools/longtable.dtx index 457891dac7..b66aef075e 100644 --- a/macros/latex/required/tools/longtable.dtx +++ b/macros/latex/required/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/macros/latex/required/tools/longtable.pdf b/macros/latex/required/tools/longtable.pdf Binary files differindex dbc366a8dd..77ab8c2bbc 100644 --- a/macros/latex/required/tools/longtable.pdf +++ b/macros/latex/required/tools/longtable.pdf diff --git a/macros/latex/required/tools/multicol.dtx b/macros/latex/required/tools/multicol.dtx index 1d16a01c15..8d868357da 100644 --- a/macros/latex/required/tools/multicol.dtx +++ b/macros/latex/required/tools/multicol.dtx @@ -98,7 +98,7 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2019/12/09 v1.8y multicolumn formatting (FMi)] + [2021/10/28 v1.9b multicolumn formatting (FMi)] % % %% @@ -115,6 +115,8 @@ % \changes{v1.0f}{1989/07/11}{Changed \cs{z@} to 0pt in redefinition of % description.} % \changes{v1.1a}{1989/09/20}{\cs{multicolssep} changed to \cs{multicolsep}.} +% \changes{v1.9b}{2021/10/22}{Swap names \cs{mult@gfirstbox} +% and \cs{mult@firstbox} (gh/701)} % % \def\description{\list{}{\labelwidth 0pt \leftmargin\descriptionmargin % \itemindent-\leftmargin \let\makelabel\descriptionlabel}} @@ -564,6 +566,14 @@ % forced into the second column (resulting in some white % space between paragraphs in the first column). % +% From version 1.9 onwards \cs{columnbreak} accepts an optional +% argument (just like \cs{pagebreak}) in which you can specify the +% desirability to break the column at that point: supported values are +% \texttt{0} (slightly desirable) to \texttt{4} (forced). +% This version also adds \cs{newcolumn} +% which forces a column break but runs the column short (comparable to +% \cs{newpage}). +% % \subsection{Floats inside a \mc{} environment} % % Within the \mc{} environment the usual star float commands are @@ -727,7 +737,7 @@ % When it finishes it must return the individual columns in boxes % suitable for further processing with |\page@sofar|. This means % that the left column should be stored in box register -% |\mult@gfirstbox|, the next +% |\mult@firstbox|, the next % in register |\mult@firstbox|${}+2$, \ldots, % only the last one as an exception in % register |\mult@grightbox|. Furthermore it has to set up @@ -981,7 +991,8 @@ % \changes{v1.8x}{2019/10/15}{Use \cs{@maxdepth} not \cs{maxdepth} (gh/190)} % \begin{macrocode} \let\mc@gridwarn\maxdimen -\DeclareOption{grid}{\def\mc@gridwarn{\@maxdepth}} +\DeclareOption{grid} + {\def\mc@gridwarn{\@maxdepth}} % \end{macrocode} % % \changes{v1.8e}{2014/04/23}{Support \cs{docolaction}} @@ -1071,7 +1082,8 @@ % \changes{v1.6e}{2004/02/14}{Avoid self-referencing definition of % \cs{@footnotetext} (pr/3618)}. % \begin{macrocode} - \ifx\@footnotetext\mult@footnotetext\else + \ifx\@footnotetext\mult@footnotetext + \else \let\orig@footnotetext\@footnotetext \let\@footnotetext\mult@footnotetext \fi @@ -1512,10 +1524,13 @@ \def\clearpage{% \ifx\@deferlist\@empty\else \PackageError{multicol}% - {Deferred floats not cleared}% - {A \string\clearpage\space inside multicols acts like - \string\newpage\space and doesn't clear floats.\MessageBreak - Move it before the multicols environment if you need it.}% + {Deferred floats not cleared}% + {A \string\clearpage\space inside + multicols acts like + \string\newpage\space and doesn't + clear floats.\MessageBreak + Move it before the multicols + environment if you need it.}% \fi \newpage}% % \end{macrocode} @@ -1701,7 +1716,8 @@ % for later. % \changes{v1.8r}{2018/01/28}{Macro added} % \begin{macrocode} -\mathchardef\@Mvi=10006 % 10005 is \columnbreak +\mathchardef\@Mvi=10006 % 10005 is + % \columnbreak % \end{macrocode} % \end{macro} % @@ -1724,7 +1740,8 @@ % \changes{v1.8c}{2013/11/03}{Add \cs{color@endgroup} to prevent color leak} % \changes{v1.8f}{2014/06/19}{Discard spaces before adding \cs{color@endgroup}} % \begin{macrocode} - \remove@discardable@items\color@endgroup\egroup + \remove@discardable@items + \color@endgroup\egroup % \end{macrocode} % Now we call |\balance@columns| the routine that balances material % stored in the box |\mult@box|. @@ -1754,7 +1771,7 @@ {Restore kept marks to\MessageBreak first: \meaning\kept@firstmark \MessageBreak bot\space\space: - \meaning\kept@botmark }% + \meaning\kept@botmark }% %</marktrace> % \end{macrocode} % This finishes the code for the ``boxed'' case. @@ -2203,7 +2220,7 @@ % \changes{v1.8x}{2019/10/15}{Use \cs{@maxdepth} not \cs{maxdepth} (gh/190)} % \begin{macrocode} \def\vfilmaxdepth{\vskip \z@ \@plus .0001fil - \@minus \@maxdepth} + \@minus \@maxdepth} % \end{macrocode} % \end{macro} % @@ -2281,7 +2298,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 @@ -2308,7 +2325,7 @@ % 4,\ldots\ (plus offset). % \changes{v1.5a}{1992/11/04}{New box mechanism} % \begin{macrocode} - \process@cols\mult@gfirstbox{% + \process@cols\mult@firstbox{% \setbox\count@ \vsplit\@cclv to\dimen@ % \end{macrocode} @@ -2335,7 +2352,8 @@ \setbox\count@ \vbox to\dimen@ {\unvbox\count@ - \ifshr@nking\vfilmaxdepth\fi}% + \ifshr@nking + \vfilmaxdepth\fi}% }% % \end{macrocode} % Then the last column follows. @@ -2615,7 +2633,8 @@ % \changes{v1.8r}{2018/01/28}{Handling end of env through special penalty} % \begin{macrocode} \ifnum\outputpenalty = -\@Mvi - \mult@info\@ne{End penalty of multicols seen}% + \mult@info\@ne{End penalty of + multicols seen}% % \end{macrocode} % If we are at this point then we have to run the balancing code % (which was previously its own output routine). First we pretend @@ -2626,7 +2645,9 @@ % in a better way; basically it is like this, because of the older % code was using different ORs and I simply reused most of it. % \begin{macrocode} - \outputpenalty\@M % pretend we had a natural forced break + \outputpenalty\@M % pretend we had + % a natural + % forced break \balance@columns@out \else % \end{macrocode} @@ -2647,7 +2668,8 @@ % this is possible with |\xdef|.) % \changes{v1.2a}{1990/02/05}{Float boxes freed.} % \begin{macrocode} - \xdef\@freelist{\@freelist\@currlist}% + \xdef\@freelist{\@freelist + \@currlist}% \gdef\@currlist{}% \fi \fi @@ -2822,8 +2844,9 @@ % |\enlargethispage| command. % \changes{v1.8a}{2011/12/20}{Support for \cs{enlargethispage}} % \begin{macrocode} - \ifvbox\@kludgeins\insert\@kludgeins - {\unvbox\@kludgeins}\fi + \ifvbox\@kludgeins + \insert\@kludgeins + {\unvbox\@kludgeins}\fi % \end{macrocode} % Then we |\unvbox| the |\partial@page| (which may be void if we % are not processing the first page of this \mc{} environment. @@ -2833,7 +2856,8 @@ % Then we return the first and bottom mark and the gathered % material to the main vertical list. % \begin{macrocode} - \return@nonemptymark{first}\kept@firstmark + \return@nonemptymark{first}% + \kept@firstmark \return@nonemptymark{bot}\kept@botmark \page@sofar % \end{macrocode} @@ -2960,12 +2984,14 @@ % \changes{v1.8w}{2019/03/01}{Provide minrows counter for balancing} % \begin{macrocode} \@tempdima\dimexpr - \topskip +\c@minrows\baselineskip-\baselineskip\relax + \topskip +\c@minrows\baselineskip + -\baselineskip\relax \ifnum\dimen@<\@tempdima \mult@info\@ne {Start value \the\dimen@ \space -> - \the\@tempdima \space (corrected for minrows)}% + \the\@tempdima \space + (corrected for minrows)}% \dimen@\@tempdima \fi % \end{macrocode} @@ -3057,7 +3083,7 @@ % untouched so that we can start over again if this trial was % unsuccessful. % \begin{macrocode} - {\process@cols\mult@firstbox{% + {\process@cols\mult@gfirstbox{% \global\setbox\count@ \vsplit\mult@grightbox to\dimen@ % \end{macrocode} @@ -3111,19 +3137,19 @@ \global\setbox\mult@grightbox \vbox{\unvbox\mult@grightbox}% % \end{macrocode} -% We also save a copy |\mult@firstbox| at its ``natural'' size +% We also save a copy |\mult@gfirstbox| at its ``natural'' size % for later use. % \begin{macrocode} \setbox\mult@nat@firstbox - \vbox{\unvcopy\mult@firstbox}% + \vbox{\unvcopy\mult@gfirstbox}% % \end{macrocode} % After |\process@cols| has done its job we have the following % situation: % \begin{center} % \begin{tabular}{r@{$\:\:\longleftarrow\:\:$}l} % box |\mult@rightbox| & all material \\ -% box |\mult@gfirstbox| & first column \\ -% box |\mult@gfirstbox|${}+2$ & second column \\ +% box |\mult@firstbox| & first column \\ +% box |\mult@firstbox|${}+2$ & second column \\ % \multicolumn{1}{c}{$\vdots$} & % \multicolumn{1}{c}{$\vdots$} \\ % box |\mult@grightbox| & last column @@ -3144,10 +3170,10 @@ % to later columns but it is actually producing incorrect results % (overprinting of text) in boundary cases, so since version v1.5q % |\raggedcolumns| means allows for all columns to run slightly short. -% \changes{v1.5q}{1998/01/19}{Do not reset \cs{mult@firstbox} (pr2739)} +% \changes{v1.5q}{1998/01/19}{Do not reset \cs{mult@gfirstbox} (pr2739)} % \begin{macrocode} % \ifshr@nking -% \global\setbox\mult@firstbox +% \global\setbox\mult@gfirstbox % \copy\mult@nat@firstbox % \fi % \end{macrocode} @@ -3465,8 +3491,11 @@ % allocating after 255. This is all done quite low-level by looking % directly at the values of the allocation counters. % \changes{v1.8y}{2019/12/09}{Allow for 20 columns (gh/237)} +% \changes{v1.9b}{2021/10/22}{Drop one unnecessary box allocation (gh/701)} % \begin{macrocode} -\ifnum\numexpr \count20-\count14-1<41 % = 2 * 20 + 1 +\ifnum\numexpr + \count20-\count14-1<40 + % this is = 2 * 20 \count14=\@cclv \fi % \end{macrocode} @@ -3474,8 +3503,8 @@ % \begin{macrocode} \newbox\mult@rightbox \newbox\mult@grightbox -\newbox\mult@gfirstbox \newbox\mult@firstbox +\newbox\mult@gfirstbox \newbox\@tempa\newbox\@tempa \newbox\@tempa\newbox\@tempa \newbox\@tempa\newbox\@tempa @@ -3494,7 +3523,6 @@ \newbox\@tempa\newbox\@tempa \newbox\@tempa\newbox\@tempa \newbox\@tempa\newbox\@tempa -\newbox\@tempa \let\@tempa\relax % \end{macrocode} % \end{macro} @@ -4071,34 +4099,66 @@ % % \begin{macro}{\columnbreak} % \changes{v1.5u}{1999/05/25}{Macro added} +% \changes{v1.9a}{2021/10/08}{Added optional argument for conditional break} +% \changes{v1.9b}{2021/10/28}{Corrected error message text (gh/703)} % |\columnbreak| is modeled after |\pagebreak| except that we % generate a penalty -10005. % \begin{macrocode} \mathchardef\@Mv=10005 -\def\columnbreak{% +\newcommand\columnbreak[1][4]{% % \end{macrocode} % We have to ensure that it is only used within a \mc{} % environment since if that penalty would be seen by the unmodified % \LaTeX{} output routine strange things would happen. % \begin{macrocode} - \ifnum\col@number<\tw@ - \PackageError{multicol}% - {\noexpand\columnbreak outside multicols}% - {This command can only be used within - a multicols or multicols* environment.}% - \else - \ifvmode - \penalty -\@Mv\relax - \else - \@bsphack - \vadjust{\penalty -\@Mv\relax}% - \@esphack - \fi - \fi} + \ifnum\col@number<\tw@ + \PackageError{multicol}% + {\noexpand\columnbreak outside multicols}% + {This command can only be used within + a multicols or multicols* environment.}% + \else +% \end{macrocode} +% Increasingly lower penalty based on argument value. This is like +% \cs{pagebreak} but we use other penalty values are the \LaTeX{} +% defaults aree rather pointless for pagination. +% \begin{macrocode} + \edef\mc@break@pen + {-\ifcase#1\@m\or 3333\or 6666\or 9999\else\@Mv\fi\relax}% + \ifvmode + \penalty \mc@break@pen + \else + \@bsphack + \vadjust{\penalty \mc@break@pen}% + \@esphack + \fi + \fi} % \end{macrocode} % \end{macro} % % +% +% \begin{macro}{\newcolumn} +% \changes{v1.9a}{2021/10/08}{Macro added} +% This is modeled after \cs{newpage} but for column breaks. +% \begin{macrocode} +\newcommand\newcolumn{% + \ifnum\col@number<\tw@ + \PackageError{multicol}% + {\noexpand\newcolumn outside multicols}% + {This command can only be used within + a multicols or multicols* environment.}% + \else + \ifvmode + \nobreak\vfill\penalty -\@Mv\relax + \else + \@bsphack + \vadjust{\nobreak\vfill\kern\z@\penalty -\@Mv\relax}% + \@esphack + \fi + \fi} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\colbreak@box} % \changes{v1.5u}{1999/05/25}{Macro added} % Need a box to collect the galley up to the column break. @@ -4128,7 +4188,7 @@ % \end{macrocode} % We loop through the columns with |\process@cols| % \begin{macrocode} - \process@cols\mult@gfirstbox{% + \process@cols\mult@firstbox{% % \end{macrocode} % If the depth of the current box is larger than the maximum found % so far in |\dimen2| we update that register for later use. @@ -4151,7 +4211,7 @@ \@width\columnseprule}\hss}% % \end{macrocode} % As you will have noticed, we started with box register -% |\mult@gfirstbox| (i.e.\ +% |\mult@firstbox| (i.e.\ % the left column). So this time |\count@| looped through 2, % 4,\ldots\ (plus the appropriate offset). % Finally we add box |\mult@rightbox| and we are done. @@ -4193,7 +4253,7 @@ % First step is to put all rules in the right place (without adding % the comes which are instead represented by a space of |\hsize|. % \begin{macrocode} - \process@cols\mult@gfirstbox{% + \process@cols\mult@firstbox{% \hskip\hsize \hss{\columnseprulecolor\vrule \@width\columnseprule}\hss @@ -4211,7 +4271,7 @@ % column using the same approach until we are done with all but the % final column. % \begin{macrocode} - \process@cols\mult@gfirstbox{% + \process@cols\mult@firstbox{% \ifdim\dp\count@>\dimen\tw@ \global\dimen\tw@\dp\count@ \fi \hskip-\hsize diff --git a/macros/latex/required/tools/multicol.pdf b/macros/latex/required/tools/multicol.pdf Binary files differindex 19e4298c49..28fca20e96 100644 --- a/macros/latex/required/tools/multicol.pdf +++ b/macros/latex/required/tools/multicol.pdf diff --git a/macros/latex/required/tools/rawfonts.pdf b/macros/latex/required/tools/rawfonts.pdf Binary files differindex 5ec9a2b676..7f9906149f 100644 --- a/macros/latex/required/tools/rawfonts.pdf +++ b/macros/latex/required/tools/rawfonts.pdf diff --git a/macros/latex/required/tools/shellesc.pdf b/macros/latex/required/tools/shellesc.pdf Binary files differindex 9e3afa7d1f..c67ea825d4 100644 --- a/macros/latex/required/tools/shellesc.pdf +++ b/macros/latex/required/tools/shellesc.pdf diff --git a/macros/latex/required/tools/showkeys.pdf b/macros/latex/required/tools/showkeys.pdf Binary files differindex ca357ddd60..96b4c88ab0 100644 --- a/macros/latex/required/tools/showkeys.pdf +++ b/macros/latex/required/tools/showkeys.pdf diff --git a/macros/latex/required/tools/somedefs.pdf b/macros/latex/required/tools/somedefs.pdf Binary files differindex d91089c965..7599f073cd 100644 --- a/macros/latex/required/tools/somedefs.pdf +++ b/macros/latex/required/tools/somedefs.pdf diff --git a/macros/latex/required/tools/tabularx.pdf b/macros/latex/required/tools/tabularx.pdf Binary files differindex cd211f42ac..f07adf175a 100644 --- a/macros/latex/required/tools/tabularx.pdf +++ b/macros/latex/required/tools/tabularx.pdf diff --git a/macros/latex/required/tools/theorem.pdf b/macros/latex/required/tools/theorem.pdf Binary files differindex 38872c8c4a..767812d4af 100644 --- a/macros/latex/required/tools/theorem.pdf +++ b/macros/latex/required/tools/theorem.pdf diff --git a/macros/latex/required/tools/tools-overview.pdf b/macros/latex/required/tools/tools-overview.pdf Binary files differindex 7ff1cd7737..b52db51d7d 100644 --- a/macros/latex/required/tools/tools-overview.pdf +++ b/macros/latex/required/tools/tools-overview.pdf diff --git a/macros/latex/required/tools/trace.pdf b/macros/latex/required/tools/trace.pdf Binary files differindex dd8fb347bc..8e407516eb 100644 --- a/macros/latex/required/tools/trace.pdf +++ b/macros/latex/required/tools/trace.pdf diff --git a/macros/latex/required/tools/varioref.dtx b/macros/latex/required/tools/varioref.dtx index eac06580e7..faf8b0383c 100644 --- a/macros/latex/required/tools/varioref.dtx +++ b/macros/latex/required/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/macros/latex/required/tools/varioref.pdf b/macros/latex/required/tools/varioref.pdf Binary files differindex 679d3523cd..e1a3f52c5f 100644 --- a/macros/latex/required/tools/varioref.pdf +++ b/macros/latex/required/tools/varioref.pdf diff --git a/macros/latex/required/tools/verbatim.pdf b/macros/latex/required/tools/verbatim.pdf Binary files differindex e7acd481c2..6c1dd55c35 100644 --- a/macros/latex/required/tools/verbatim.pdf +++ b/macros/latex/required/tools/verbatim.pdf diff --git a/macros/latex/required/tools/xr.pdf b/macros/latex/required/tools/xr.pdf Binary files differindex 0a6f890663..b48bceadb4 100644 --- a/macros/latex/required/tools/xr.pdf +++ b/macros/latex/required/tools/xr.pdf diff --git a/macros/latex/required/tools/xspace.pdf b/macros/latex/required/tools/xspace.pdf Binary files differindex eacfb53a6f..e562c76f96 100644 --- a/macros/latex/required/tools/xspace.pdf +++ b/macros/latex/required/tools/xspace.pdf |