From a63295fa3795e0009efddf7966c3356a2a346897 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Thu, 25 May 2023 09:45:21 +0200 Subject: [PATCH 01/12] revert to two arguments for \l@XXX --- .../latex-lab-toc-kernel-changes.dtx | 98 ++++++++++++------- 1 file changed, 61 insertions(+), 37 deletions(-) diff --git a/required/latex-lab/latex-lab-toc-kernel-changes.dtx b/required/latex-lab/latex-lab-toc-kernel-changes.dtx index d9e1ed842..d082f2bd0 100644 --- a/required/latex-lab/latex-lab-toc-kernel-changes.dtx +++ b/required/latex-lab/latex-lab-toc-kernel-changes.dtx @@ -167,8 +167,8 @@ \def\contentsline#1#2#3#4% {% \@contentsline@cfgpoint@before{#1}{#2}{#3}{#4}% - %\gdef\@contentsline@destination{#4}% - \csname l@#1\endcsname{#2}{#3}{#4}% + \gdef\@contentsline@destination{#4}% + \csname l@#1\endcsname{#2}{#3}% \@contentsline@cfgpoint@after{#1}{#2}{#3}{#4}% } % \end{macrocode} @@ -246,7 +246,7 @@ % \begin{macrocode} \def\@dottedtocline@cfgpoint@leaders#1{#1} -\def\@dottedtocline#1#2#3#4#5#6{% +\def\@dottedtocline#1#2#3#4#5{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip @@ -255,9 +255,9 @@ \leavevmode \@tempdima #3\relax \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip - \UseHookWithArguments{contentsline/text/before}{4}{#1}{#4}{#5}{#6}% + \UseHookWithArguments{contentsline/text/before}{4}{#1}{#4}{#5}{\@contentsline@destination}% \csname contentsline@text@#1@format\endcsname{#4}% - \UseHookWithArguments{contentsline/text/after}{4}{#1}{#4}{#5}{#6}% + \UseHookWithArguments{contentsline/text/after}{4}{#1}{#4}{#5}{\@contentsline@destination}% \nobreak \@dottedtocline@cfgpoint@leaders{% \leaders\hbox{$\m@th @@ -265,9 +265,9 @@ mu$}\hfill}% \nobreak \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor - \UseHookWithArguments{contentsline/page/before}{4}{#1}{#4}{#5}{#6}% + \UseHookWithArguments{contentsline/page/before}{4}{#1}{#4}{#5}{\@contentsline@destination}% #5% - \UseHookWithArguments{contentsline/page/after}{4}{#1}{#4}{#5}{#6}% + \UseHookWithArguments{contentsline/page/after}{4}{#1}{#4}{#5}{\@contentsline@destination}% \kern-\p@\kern\p@}% \par}% \fi} @@ -292,7 +292,7 @@ % \begin{macrocode} \AddToHook{class/article/after} { - \renewcommand*\l@part[3]{% as in contentsline: content, page, target + \renewcommand*\l@part[2]{% as in contentsline: content, page \ifnum \c@tocdepth >-2\relax \addpenalty\@secpenalty \addvspace{2.25em \@plus\p@}% @@ -302,19 +302,23 @@ \parfillskip -\@pnumwidth {\leavevmode \large \bfseries - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \csname contentsline@text@-1@format\endcsname{#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \hfil \hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \kern-\p@\kern\p@}}\par \nobreak \endgroup \fi} -\renewcommand*\l@section[3]{% +\renewcommand*\l@section[2]{% \ifnum \c@tocdepth >\z@ \addpenalty\@secpenalty \addvspace{1.0em \@plus\p@}% @@ -325,21 +329,25 @@ \leavevmode \bfseries \advance\leftskip\@tempdima \hskip -\leftskip - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@section}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@section}{#1}{#2}{\@contentsline@destination}% \csname contentsline@text@1@format\endcsname{#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@section}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@section}{#1}{#2}{\@contentsline@destination}% \nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@section}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@section}{#1}{#2}{\@contentsline@destination}% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@section}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@section}{#1}{#2}{\@contentsline@destination}% \kern-\p@\kern\p@}\par \endgroup \fi} } \AddToHook{class/report/after} { - \renewcommand*\l@part[3]{% + \renewcommand*\l@part[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty{-\@highpenalty}% \addvspace{2.25em \@plus\p@}% @@ -349,19 +357,23 @@ \parfillskip -\@pnumwidth {\leavevmode \large \bfseries - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \csname contentsline@text@-1@format\endcsname{#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \hfil \hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@part}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}% \kern-\p@\kern\p@}}\par \nobreak \endgroup \fi} - \renewcommand*\l@chapter[3]{% + \renewcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \vskip 1.0em \@plus\p@ @@ -372,15 +384,19 @@ \leavevmode \bfseries \advance\leftskip\@tempdima \hskip -\leftskip - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% \csname contentsline@text@0@format\endcsname {#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% \nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@chapter}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}%% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@chapter}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}%% \kern-\p@\kern\p@}\par \penalty\@highpenalty \endgroup @@ -388,7 +404,7 @@ } \AddToHook{class/book/after} { - \renewcommand*\l@part[3]{% + \renewcommand*\l@part[2]{% \ifnum \c@tocdepth >-2\relax \addpenalty{-\@highpenalty}% \addvspace{2.25em \@plus\p@}% @@ -398,19 +414,23 @@ \parfillskip -\@pnumwidth {\leavevmode \large \bfseries - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@part}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}%% \csname contentsline@text@-1@format\endcsname{#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@part}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}%% \hfil \hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@part}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}%% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@part}{#1}{#2}{#3}%% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@part}{#1}{#2}{\@contentsline@destination}%% \kern-\p@\kern\p@}}\par \nobreak \endgroup \fi} - \renewcommand*\l@chapter[3]{% + \renewcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \vskip 1.0em \@plus\p@ @@ -421,15 +441,19 @@ \leavevmode \bfseries \advance\leftskip\@tempdima \hskip -\leftskip - \UseHookWithArguments{contentsline/text/before}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/before}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% \csname contentsline@text@0@format\endcsname {#1}% - \UseHookWithArguments{contentsline/text/after}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/text/after}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% \nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss - \UseHookWithArguments{contentsline/page/before}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/before}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% #2% - \UseHookWithArguments{contentsline/page/after}{4}{\toclevel@chapter}{#1}{#2}{#3}% + \UseHookWithArguments{contentsline/page/after}{4} + {\toclevel@chapter}{#1}{#2}{\@contentsline@destination}% \kern-\p@\kern\p@}\par \penalty\@highpenalty \endgroup From 3ab16f4c54b1f01523f9c8df0a0a190dfd902705 Mon Sep 17 00:00:00 2001 From: Yukai Chou Date: Thu, 25 May 2023 21:27:52 +0800 Subject: [PATCH 02/12] Generate simpler variant for \cs_generate_from_arg_count:NNnn It's first n-arg already accepts an . --- base/ltcmd.dtx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx index 5f019cdc2..9fe3b9043 100644 --- a/base/ltcmd.dtx +++ b/base/ltcmd.dtx @@ -738,10 +738,10 @@ \int_zero:N \l_@@_current_arg_int \@@_tl_mapthread_function:NNN \l_@@_args_tl \l_@@_defaults_tl \@@_defaults_def:nn - \cs_generate_from_arg_count:NNVo \@@_tmp:w \cs_set:Npn + \cs_generate_from_arg_count:NNno \@@_tmp:w \cs_set:Npn \l_@@_current_arg_int \l_@@_tmpa_tl } -\cs_generate_variant:Nn \cs_generate_from_arg_count:NNnn { NNVo } +\cs_generate_variant:Nn \cs_generate_from_arg_count:NNnn { NNno } \cs_new_protected:Npn \@@_defaults_def:nn { \int_incr:N \l_@@_current_arg_int From eaaa2e4f9a0a106924a65fcf0b03e57f644bf41c Mon Sep 17 00:00:00 2001 From: Yukai Chou Date: Thu, 25 May 2023 21:29:42 +0800 Subject: [PATCH 03/12] update date --- base/ltcmd.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx index 9fe3b9043..c2e9cbf56 100644 --- a/base/ltcmd.dtx +++ b/base/ltcmd.dtx @@ -35,7 +35,7 @@ % % \begin{macrocode} \def\ltcmdversion{v1.1d} -\def\ltcmddate{2023-04-13} +\def\ltcmddate{2023-05-25} % \end{macrocode} % %<*driver> From 5f7c96de16d6e3da8ae3337dcec43ca8c924bb42 Mon Sep 17 00:00:00 2001 From: Yukai Chou Date: Fri, 26 May 2023 00:50:30 +0800 Subject: [PATCH 04/12] update version, add change entries --- base/changes.txt | 6 ++++++ base/ltcmd.dtx | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/base/changes.txt b/base/changes.txt index 790f9a5ad..db9c0e3e2 100644 --- a/base/changes.txt +++ b/base/changes.txt @@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ================================================================================ +2023-05-26 Yukai Chou + + * ltcmd.dtx (subsection{Structure of \pkg{xparse} commands}): + Use simpler 'NNno' variant instead of 'NNVo' for + \cs_generate_from_arg_count:NNnn + 2023-05-22 Joseph Wright * usrguide.tex diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx index c2e9cbf56..d6322ff3e 100644 --- a/base/ltcmd.dtx +++ b/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.1d} -\def\ltcmddate{2023-05-25} +\def\ltcmdversion{v1.1e} +\def\ltcmddate{2023-05-26} % \end{macrocode} % %<*driver> @@ -725,6 +725,9 @@ { \@@_environment_or_command: } } % \end{macrocode} +% +% \changes{v1.1e}{2023/05/26} +% {Use simpler variant \cs{cs_generate_from_arg_count:NNno}} % To construct \cs{@@_tmp:w}, first go through the arguments % found and the corresponding defaults, building a token list with % |{#|\meta{arg number}|}| for arguments found in the input (whose From cd862e7f72f7ce1e827b91235f1b3f9bdc20d14a Mon Sep 17 00:00:00 2001 From: Frank Mittelbach Date: Thu, 25 May 2023 23:20:49 +0200 Subject: [PATCH 05/12] minor updates to tlc3.err --- base/doc/tlc3.err | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/base/doc/tlc3.err b/base/doc/tlc3.err index f790c6d79..26d7905a0 100644 --- a/base/doc/tlc3.err +++ b/base/doc/tlc3.err @@ -1,4 +1,4 @@ -\newcommand\erratafiledate{2023-05-16} +\newcommand\erratafiledate{2023-05-25} \def\comando#1{\texttt{\string#1}} @@ -20,7 +20,7 @@ \begin{filecontents}{ttcterrata.cls} %% %% Copyright (C) 1997-2021 Frank Mittelbach -%% This class file is licenced under LPPL latest version; +%% This class file is licensed under LPPL latest version; %% see https://www.latex-project.org/lppl % % @@ -391,7 +391,7 @@ content differs from that of the printed version: there is only a single font matter, a single bibliography, and a single index, whereas in the printed books these are separated out. However, all versions share the main matter (down to the page numbering) so most of the errata applies to -all versions, but to a few only to the digital and others only to the +all versions, but a few only to the digital and some only to the printed version. Thus, we end up with three separate lists. @@ -410,7 +410,7 @@ printed version. Thus, we end up with three separate lists. \section*{Errata for the print version (not applicable to the digital version)} The printed books differ from the digital version in that the -biligraphy is split across both volumes (with a few repeats) and that +bibliography is split across both volumes (with a few repeats) and that the font matter of each volume has its own table of contents and list of figures and tables. Therefore these parts have different page numbers and you will see similar errata entries for both print and @@ -430,7 +430,7 @@ formulas \> \u{F}ormulas documents \> \u{D}ocuments \erroronpage{I-xvii}{chapter head}{FMi}{2023/04/04}{s} -beyond \> \u{B}yond +beyond \> \u{B}eyond \erroronpage{I-xx\ldots I-xxi}{}{FMi}{2023/04/04}{s} Dot leaders have been changed on all sections. @@ -457,7 +457,7 @@ Add: Vancouver, 1999 Publishing \> Publishing\u{,} \erroronpage{I-790}{[122], l.1}{kb/bb}{2023/04/04}{s} -In \u{ACM editor} ``Proceedings \> In ``PODC'01: Proceedings +In \u{ACM editor} ``Proceedings \> In ``\u{PODC'01: }Proceedings \erroronpage{I-790}{[122], l.1}{kb/bb}{2023/04/04}{s} In \u{Unicode Consortium, editor} \> In @@ -480,7 +480,7 @@ formulas \> \u{F}ormulas documents \> \u{D}ocuments \erroronpage{II-xxi}{chapter head}{FMi}{2023/04/04}{s} -beyond \> \u{B}yond +beyond \> \u{B}eyond @@ -716,7 +716,7 @@ Paragraph moved to page 141. \\ Already corrected in the digital version. \erroronpage{II-141}{}{FMi}{2023/04/04}{s} -One paragraph added moved over from page 144. +One paragraph moved over from page 140. \\ Already corrected in the digital version. \erroronpage{II-144}{para 2, l.-3}{FMi}{2023/04/04}{s} From dd3e572eed7d5b15772203c404b4e50652a40028 Mon Sep 17 00:00:00 2001 From: Frank Mittelbach Date: Fri, 26 May 2023 11:24:35 +0200 Subject: [PATCH 06/12] minor editorial updates to ltnews37 by bb --- base/doc/ltnews37.tex | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/base/doc/ltnews37.tex b/base/doc/ltnews37.tex index 5b2a55dda..9cbf7f298 100644 --- a/base/doc/ltnews37.tex +++ b/base/doc/ltnews37.tex @@ -178,7 +178,7 @@ \section{New functionality offered as part of the A prototype for math tagging (including support for the \pkg{amsmath} environments) is already available, but it is mainly intended for experimentation and feedback and the resulting tagging is by no means -the way we envision it to be eventually. If you like to try it out use +the way we envision it to be eventually. If you would like to try it out use the following line: \begin{verbatim} \DocumentMetadata{testphase={phase-III,math}} @@ -187,8 +187,8 @@ \section{New functionality offered as part of the packages that redefine the \texttt{\$} (which then may lead to strange errors) and that packages that use math mode for non-mathematical constructs may result in surprising output as far as tagging is -concerned. Feedback on which packages fail with the code in one or the -other way would be appreciated. +concerned. Feedback on which packages fail with the code in one or +another way would be appreciated. The \texttt{latex-lab} bundle contains various (still untagged) documentation files about the new code that can @@ -250,14 +250,14 @@ \subsection{Extending hooks to take arguments} The commands \cs{NewReversedHookWithArguments}, \cs {NewMirroredHookPairWithArguments}, \cs {AddToHookNextWithArguments}, \cs{UseOneTimeHookWithArguments}, and -the \pkg{expl3} conterparts of the commands discussed in this section +the \pkg{expl3} counterparts of the commands discussed in this section were also added. The complete documentation can be found in the \pkg{lthooks} documentation \cite{37:lthooks-doc}. \subsubsection{Generic \texttt{cmd} hooks with arguments} Along with the possibility to pass arguments to a regular hook as -discussed above, generic \hook{cmd} hooks now can access the arguments +discussed above, generic \hook{cmd} hooks can now access the arguments of the command they are patched into using the interface described in the previous section. @@ -384,7 +384,7 @@ \subsection{Extension of the \cs{label} command} Previously, in standard \LaTeX{}, the \cs{label} command wrote a \cs{newlabel} declaration into the \texttt{.aux} file and stored two values in -second argument of this \cs{newlabel} command: +the second argument of this \cs{newlabel} command: \cs{@currentlabel}, which normally contains the state of the current counter and \cs{thepage} for the current page number. @@ -396,7 +396,7 @@ \subsection{Extension of the \cs{label} command} active link. The fifth argument was only used if external references were loaded with the \pkg{xr-hyper} package. -Starting with this release, the number of values stored in \cs{newlabel} have been unified. +Starting with this release, the number of values stored in \cs{newlabel} has been unified. \cs{label} now writes a \cs{newlabel} command that always contains five values in the second argument (each in a brace group): \cs{@currentlabel}, \cs{thepage}, \cs{@currentlabelname}, @@ -549,7 +549,7 @@ \subsection{Incompatibility between \pkg{doc} and \pkg{unicode-math}} The \pkg{unicode-math} package alters the catcode of \verb=|= but does not adjust its value for use in \pkg{doc}, with the result that -\enquote{or} module, i.e., $\langle A | B \rangle$ are displayed in a +\enquote{or} modules, i.e., $\langle A | B \rangle$ are displayed in a strange way. This is now fixed with some firstaid code that will eventually be moved into \pkg{unicode-math}. % @@ -594,7 +594,7 @@ \subsection{Improve spacing at top of \env{minipages}} With the new paragraph handling introduced in 2021 it is now finally possible to detect and avoid this problem and apply appropriate -counter measures so that from now on the spacing will be always +counter measures so that from now on the spacing will always be correct. % \githubissue{989} @@ -656,7 +656,7 @@ \subsection{Updates to the guides} When \LaTeXe{} was released, the team provided documentation for both document authors and package/class developers in the two files \texttt{usrguide} and \texttt{clsguide}. Over time, the team have augmented these documents as new -methods have been added to the kernel. However, they retained there structure +methods have been added to the kernel. However, they retained their structure as starting from familiarity with \LaTeX{}~2.09. This meant that for new users, there was material which is no longer relevant, and less clarity than desirable in what approaches are recommended today. @@ -671,7 +671,7 @@ \subsection{Updates to the guides} \subsection{Displaying the exact release dates for \LaTeX{}} In some situations it is necessary to find out the exact release dates -for older version of the \LaTeX{} format, for example, when you need +for older versions of the \LaTeX{} format, for example, when you need to use different code in a package depending on the availability of a certain feature and you therefore want to use \cs{IfFormatAtLeastTF}\texttt\{\meta{date}\texttt\} or the @@ -686,7 +686,7 @@ \subsection{Displaying the exact release dates for \LaTeX{}} The big problem is to know the exact \meta{date} to put into such commands and in the past that was not that easy to find. You could have -looked in the the file \file{changes.txt}, but that is hidden somewhere +looked in the file \file{changes.txt}, but that is hidden somewhere in your installation and if you try \verb*/texdoc -l changes.txt/ you get more than thirty results and the %* right file is by no means the first. @@ -722,7 +722,7 @@ \subsection{Fresh from the press: \enquote{The \LaTeX{} Companion, third edition successfully navigate the \LaTeX{} ecosystem and efficiently produce beautiful documents. -Since the publication of the last edition (2004) a lot has happened in +Since the publication of the last edition (2004), a lot has happened in the \LaTeX{} world and thus a complete rewrite was necessary. All chapters have been thoroughly revised and in many cases largely extended to describe new important functionality and features. More @@ -744,10 +744,12 @@ \subsection{Fresh from the press: \enquote{The \LaTeX{} Companion, third edition \end{quote} The edition is also available as an eBook (Parts I and II combined) -consisting of PDF and ePub format without DRM. Finally, the publisher +consisting of PDF and ePub format without DRM\@. Finally, the publisher offers the combination of the printed books and the digital versions at a very attractive price not available anywhere else. +%% bb -- add reference to TUGboat review here + %\section{Changes to packages in the \pkg{amsmath} category} From a7187bb5911000ab67d89cc6da78e9e558479f32 Mon Sep 17 00:00:00 2001 From: Frank Mittelbach Date: Fri, 26 May 2023 12:00:44 +0200 Subject: [PATCH 07/12] update some documentation around "samepage"; it is still (reluctantly) supported after all [ci skip] --- base/ltoutput.dtx | 8 +------- base/ltspace.dtx | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/base/ltoutput.dtx b/base/ltoutput.dtx index 29024dd4d..18388b1cc 100644 --- a/base/ltoutput.dtx +++ b/base/ltoutput.dtx @@ -37,7 +37,7 @@ %<*driver> % \fi \ProvidesFile{ltoutput.dtx} - [2022/08/20 v1.4j LaTeX Kernel (Output Routine)] + [2023/05/26 v1.4j LaTeX Kernel (Output Routine)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutput.dtx} @@ -3005,9 +3005,6 @@ % % There is also an |\addpenalty\interlinepenalty| above. % -% Since in 2e |\samepage| is no longer supported, these could be -% removed. -% % Although it is best to use |\addvspace| in case two h floats come % together, this makes other spacing more difficult to adjust; whereas % if a user specifies two h floats together then they can more easily @@ -3227,9 +3224,6 @@ % % There is also an |\addpenalty\interlinepenalty| above. % -% Since in 2e |\samepage| is no longer supported, these could be -% removed. -% % Although it is best to use |\addvspace| in case two h floats come % together, this makes other spacing more difficult to adjust; whereas % if a user specifies two h floats together then they can more easily diff --git a/base/ltspace.dtx b/base/ltspace.dtx index 1dbfefc7b..a77314b1b 100644 --- a/base/ltspace.dtx +++ b/base/ltspace.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltspace.dtx} - [2023/03/22 v1.3p LaTeX Kernel (spacing)] + [2023/05/26 v1.3p LaTeX Kernel (spacing)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltspace.dtx} @@ -94,6 +94,7 @@ % inhibits page breaking most places by setting the % following penalties to 10000:\\ % |\interlinepenalty|\\ +% |\predisplaypenalty|\\ % |\postdisplaypenalty|\\ % |\interdisplaylinepenalty|\\ % |\@beginparpenalty|\\ From fe1989708132e3d13591b9639df5aefce2947b1b Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 27 May 2023 11:52:38 +0200 Subject: [PATCH 08/12] update documentmetadata descriptions --- required/latex-lab/documentmetadata-support.dtx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/required/latex-lab/documentmetadata-support.dtx b/required/latex-lab/documentmetadata-support.dtx index eb99fbd3a..467ea28fe 100644 --- a/required/latex-lab/documentmetadata-support.dtx +++ b/required/latex-lab/documentmetadata-support.dtx @@ -132,7 +132,9 @@ % it is also possible to use the values % |X-4|, |X-4p|, |X-5g|, |X-5n|, |X-5pg|, |X-6|, |X-6n|, |X-6p|, |UA-1| for % a PDF/X and PDF/UA standard. These keys currently set \emph{only} the relevant -% XMP-metadata. +% XMP-metadata. In version 0.95z support for |UA-2| has been added but +% note that |UA-2| hasn't been released yet. It should be used only together +% with pdf version 2.0. % % |pdfstandard| can be used more than once to set overlapping standards, e.g:\\ % |pdfstandard=A-2b,pdfstandard=X-4,pdfstandard=UA-1| @@ -159,11 +161,18 @@ % |\tagpdfsetup{activate,interwordspace}|. This phase % is frozen. % \item[\texttt{phase-II}] -% This is the current development phase. -% Currently it differs from \texttt{phase-I} only in one point: It will +% It differs from \texttt{phase-I} only in one point: It will % additionally activate tagging of paragraphs with % |\tagpdfsetup{paratagging}|. In the upcoming months it will % also enable automatic tagging of other basic document elements. +% \item[\texttt{phase-III}] +% This is the current development phase. +% It differs from \texttt{phase-II} \emph{a lot}: It will +% load new code for the tagging of lists, sectioning commands, +% table of contents and similar lists, graphics, minipages and floats. +% As it redefines many internals it is restricted to the use of +% standard classes (article, report, and book) +% and it supports only a limited number of add-on package. % \item[\texttt{new-or-1}] This patches a few commands related % to the output routine. The patches are needed for the tagging % of paragraphs, for the tagging of header and footer and From 853fbde6eb2677d03f6cc7eddc80f11326e29818 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 27 May 2023 11:53:22 +0200 Subject: [PATCH 09/12] typo --- required/latex-lab/latex-lab-sec.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/required/latex-lab/latex-lab-sec.dtx b/required/latex-lab/latex-lab-sec.dtx index 62a8d4c9b..f34fbd898 100644 --- a/required/latex-lab/latex-lab-sec.dtx +++ b/required/latex-lab/latex-lab-sec.dtx @@ -593,7 +593,7 @@ % % \subsection{Sectioning commands based on \cs{@startsection}} % -% The tagging of relies again on the para tagging: +% The tagging relies again on the para tagging: % we simply exchange the tag name by the one given as \#1. % This assumes that a tag with the name of the sectioning type is defined. % We don't try to pass the title, this will be done together with From 8302dfb0947c92b8d17f99b5f1e2d38da26dec95 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 27 May 2023 12:02:17 +0200 Subject: [PATCH 10/12] update docu for debug key --- required/latex-lab/documentmetadata-support.dtx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/required/latex-lab/documentmetadata-support.dtx b/required/latex-lab/documentmetadata-support.dtx index 467ea28fe..065f9b2cf 100644 --- a/required/latex-lab/documentmetadata-support.dtx +++ b/required/latex-lab/documentmetadata-support.dtx @@ -197,6 +197,10 @@ % \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches % related to them. More information can be found in the documentation of % \pkg{pdfmanagement-firstaid}. +% \item[\texttt{xmp-export}] This will export the XMP-metadata to a file \verb+\jobname.xmpi+. +% with \texttt{debug=\{xmp-export=filename\}} the file name can be changed. +% More information can be found in the documentation of \pkg{l3pdfmeta} of the \pkg{pdfmanagement-testphase} +% bundle. % \end{description} % \end{description} % From d2ebeef2f51b9c5d0095b3cfd83c4004e0df881d Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 27 May 2023 16:48:05 +0200 Subject: [PATCH 11/12] add bib code really to phase-III --- required/latex-lab/latex-lab-testphase.dtx | 3 ++- required/latex-lab/testfiles-bib/bib-003.lvt | 2 +- required/latex-lab/testfiles-bib/bib-004.lvt | 2 +- required/latex-lab/testfiles-bib/bib-005.pvt | 2 +- required/latex-lab/testfiles-bib/bib-006.pvt | 2 +- required/latex-lab/testfiles-bib/bib-007-natbib.pvt | 2 +- required/latex-lab/testfiles-bib/bib-008-natbib.pvt | 2 +- required/latex-lab/testfiles-bib/bib-009.pvt | 2 +- required/latex-lab/testfiles-bib/bib-010-natbib.pvt | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/required/latex-lab/latex-lab-testphase.dtx b/required/latex-lab/latex-lab-testphase.dtx index a2fb65ef4..16821c5ce 100644 --- a/required/latex-lab/latex-lab-testphase.dtx +++ b/required/latex-lab/latex-lab-testphase.dtx @@ -88,7 +88,8 @@ \RequirePackage{latex-lab-testphase-toc} \RequirePackage{latex-lab-testphase-minipage} \RequirePackage{latex-lab-testphase-graphic} -\RequirePackage{latex-lab-testphase-float} +\RequirePackage{latex-lab-testphase-float} +\RequirePackage{latex-lab-testphase-bib} % % \end{macrocode} % diff --git a/required/latex-lab/testfiles-bib/bib-003.lvt b/required/latex-lab/testfiles-bib/bib-003.lvt index e2083a2c6..72d074046 100644 --- a/required/latex-lab/testfiles-bib/bib-003.lvt +++ b/required/latex-lab/testfiles-bib/bib-003.lvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-004.lvt b/required/latex-lab/testfiles-bib/bib-004.lvt index 3e693c5f8..2eef601cf 100644 --- a/required/latex-lab/testfiles-bib/bib-004.lvt +++ b/required/latex-lab/testfiles-bib/bib-004.lvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-005.pvt b/required/latex-lab/testfiles-bib/bib-005.pvt index 2c8aea3cb..a2aa4b5c8 100644 --- a/required/latex-lab/testfiles-bib/bib-005.pvt +++ b/required/latex-lab/testfiles-bib/bib-005.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-006.pvt b/required/latex-lab/testfiles-bib/bib-006.pvt index c10961709..35b014b5f 100644 --- a/required/latex-lab/testfiles-bib/bib-006.pvt +++ b/required/latex-lab/testfiles-bib/bib-006.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-007-natbib.pvt b/required/latex-lab/testfiles-bib/bib-007-natbib.pvt index 21e5f7723..08925e560 100644 --- a/required/latex-lab/testfiles-bib/bib-007-natbib.pvt +++ b/required/latex-lab/testfiles-bib/bib-007-natbib.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-008-natbib.pvt b/required/latex-lab/testfiles-bib/bib-008-natbib.pvt index 209ae2ee1..d004f321f 100644 --- a/required/latex-lab/testfiles-bib/bib-008-natbib.pvt +++ b/required/latex-lab/testfiles-bib/bib-008-natbib.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-009.pvt b/required/latex-lab/testfiles-bib/bib-009.pvt index 8dc3cc7f4..729bdb5ce 100644 --- a/required/latex-lab/testfiles-bib/bib-009.pvt +++ b/required/latex-lab/testfiles-bib/bib-009.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} diff --git a/required/latex-lab/testfiles-bib/bib-010-natbib.pvt b/required/latex-lab/testfiles-bib/bib-010-natbib.pvt index f9fb7ac9b..d33b823e1 100644 --- a/required/latex-lab/testfiles-bib/bib-010-natbib.pvt +++ b/required/latex-lab/testfiles-bib/bib-010-natbib.pvt @@ -1,5 +1,5 @@ % with tagging ... -\DocumentMetadata{uncompress,testphase=phase-III,testphase=bib} +\DocumentMetadata{uncompress,testphase=phase-III} \input{regression-test} \documentclass[]{article} \usepackage[ngerman]{babel} From f84c15c92cf57dcc4441b01c90167dcef9b5e7ed Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Sat, 27 May 2023 17:08:46 +0200 Subject: [PATCH 12/12] use hooks with arguments, WIP --- required/latex-lab/latex-lab-bib.dtx | 169 ++++++++++----------------- 1 file changed, 60 insertions(+), 109 deletions(-) diff --git a/required/latex-lab/latex-lab-bib.dtx b/required/latex-lab/latex-lab-bib.dtx index 20332d1c9..92db93997 100644 --- a/required/latex-lab/latex-lab-bib.dtx +++ b/required/latex-lab/latex-lab-bib.dtx @@ -119,27 +119,26 @@ % \end{variable} %\subsection{Handling the bibliography} -% \begin{macro}{\lbibitem} +% \begin{macro}{\@lbibitem} % The item command if an optional argument is use. % % We only prepend some code. -% If we had already generic hooks with arguments -% we could probably use them \ldots % \begin{macrocode} -\def\@lbibitem[#1]#2{% +\AddToHookWithArguments{cmd/@lbibitem/before} + { % \end{macrocode} % we store the target name for the following code. -% \begin{macrocode} - \tl_set:Nx\l_@@_bib_target_tl{cite.#2\@extra@b@citeb} +% \begin{macrocode} + \tl_set:Nx\l_@@_bib_target_tl{cite.#2\@extra@b@citeb} % \end{macrocode} % The target is added at the begin of the paragraph. -% \begin{macrocode} - \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}} - \item[\@biblabel{#1}\hfill]\if@filesw - {\let\protect\noexpand - \immediate - \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} -% \end{macrocode} +% \begin{macrocode} + \AddToHookNext{para/begin} + { + \makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}} + } + } +% \end{macrocode} % we make a copy to be able to reinstate the definition. This is e.g. % currently needed with hyperref. % \begin{macrocode} @@ -148,15 +147,26 @@ % \end{macro} % % \begin{macro}{\@bibitem} -% Similar for bibitem. +% Similar for \cs{@bibitem}. % TODO: If hyperref is loaded we will get a second target from the refstepcounter, % but this is ignored for now. % \begin{macrocode} -\def\@bibitem#1{ - \tl_set:Nx\l_@@_bib_target_tl{cite.#1\@extra@b@citeb}% - \AddToHookNext{para/begin}{\makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}}} - \item\if@filesw \immediate\write\@auxout - {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} +\AddToHookWithArguments{cmd/@bibitem/before} + { +% \end{macrocode} +% we store the target name for the following code. +% \begin{macrocode} + \tl_set:Nx\l_@@_bib_target_tl{cite.#1\@extra@b@citeb} +% \end{macrocode} +% The target is added at the begin of the paragraph. +% \begin{macrocode} + \AddToHookNext{para/begin} + { + \makebox[0pt][r]{\MakeLinkTarget*{\l_@@_bib_target_tl}\hspace{\leftmargin}} + } + } +% \end{macrocode} +% \begin{macrocode} \let\@kernel@copy@bibitem\@bibitem % \end{macrocode} % \end{macro} @@ -176,7 +186,7 @@ % structure. Even if it looks a bit odd it is now used for many years and so % hopefully compatible with various packages. But differently to hyperref we use % the new hooks with arguments. -% TODO: consider name. Perhaps use the generic names? +% TODO: consider hook name. Perhaps use the generic names? % \begin{macrocode} \NewMirroredHookPairWithArguments{bibcite/before}{bibcite/after}{2} \def\bibcite#1#2{% @@ -189,7 +199,8 @@ \let\@kernel@copy@bibcite\bibcite % \end{macrocode} % Now we add the tagging structure. -% TODO: the ref key should expand its argument directly! +% TODO: with the next tagpdf version it should no longer be +% needed to exand the ref key. % \begin{macrocode} \AddToHookWithArguments{bibcite/before} { @@ -211,7 +222,7 @@ { % \end{macrocode} % the next hyperref will allow to suppress the bib patches, but with older -% versions we muss reinstated them. +% versions we reinstate them. % \begin{macrocode} \@ifpackagelater{hyperref}{2023-05-01}{} { @@ -225,105 +236,45 @@ } % \end{macrocode} % -% \subsection{Natbib support} -% natbib offers various hooks that can be used. The main problem is -% to coordinate with the hyperref use of the same hooks. -% We also have to add something at the begin of \cs{@lbibitem}. -% As generic hooks with arguments aren't available yet, we have to copy the definition +% \subsection{Natbib and biblatex support} +% When hyperref is loaded, both natbib and biblatex use \cs{hyper@natlinkstart} +% and \cs{hyper@natlinkend} to handle the links. We can use the generic hooks to +% add the tagging code (and the link code from hyperref). +% If hyperref is not loaded we need to ensure that a target is created nevertheless +% and we need to activate in biblatex the tagging code. % % \begin{macrocode} -\AddToHook{package/natbib/after} - { - \def\hyper@natanchorstart#1{\MakeLinkTarget*{#1}} - \def\@lbibitem[#1]#2{% - \tl_set:Nx\l__tag_bib_target_tl{cite.#2\@extra@b@citeb} - \if\relax\@extra@b@citeb\relax\else - \@ifundefined{br@#2\@extra@b@citeb}{}{% - \@namedef{br@#2}{\@nameuse{br@#2\@extra@b@citeb}}% - }% - \fi - \@ifundefined{b@#2\@extra@b@citeb}{% - \def\NAT@num{}% - }{% - \NAT@parse{#2}% - }% - \def\NAT@tmp{#1}% - \expandafter\let\expandafter\bibitemOpen\csname NAT@b@open@#2\endcsname - \expandafter\let\expandafter\bibitemShut\csname NAT@b@shut@#2\endcsname - \@ifnum{\NAT@merge>\@ne}{% - \NAT@bibitem@first@sw{% - \@firstoftwo - }{% - \@ifundefined{NAT@b*@#2}{% - \@firstoftwo - }{% - \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% - \@secondoftwo - }% - }% - }{% - \@firstoftwo - }% - {% - \global\advance\c@NAT@ctr\@ne - \@ifx{\NAT@tmp\@empty}{\@firstoftwo}{% - \@secondoftwo - }% - {% - \expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}% - \global\NAT@stdbsttrue - }{}% - \bibitem@fin - \item[\hfil\NAT@anchor{#2}{\NAT@num}]% - \global\let\NAT@bibitem@first@sw\@secondoftwo - \NAT@bibitem@init - }% - {% - \NAT@anchor{#2}{}% - \NAT@bibitem@cont - \bibitem@fin - }% - \@ifx{\NAT@tmp\@empty}{% - \NAT@wrout{\the\c@NAT@ctr}{}{}{}{#2}% - }{% - \expandafter\NAT@ifcmd\NAT@tmp(@)(@)\@nil{#2}% - }% - }% -% \end{macrocode} -% we redefine the hook to use latex hooks. -% \begin{macrocode} - \NewMirroredHookPairWithArguments{natbib/linkstart}{natbib/linkend}{1} - \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} - \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} - \AddToHookWithArguments{natbib/linkstart} - { - \leavevmode - \tag_mc_end_push: - \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} - \tagmcbegin{} - } - \AddToHook{natbib/linkend} - { - \tag_mc_end: - \tagstructend - \tag_mc_begin_pop:n{} - } - } +\newcommand\hyper@natlinkstart[1]{} +\newcommand\hyper@natlinkend{} +\AddToHookWithArguments{cmd/hyper@natlinkstart/before} + { + \leavevmode + \tag_mc_end_push: + \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \tagmcbegin{} + } +\AddToHook{cmd/hyper@natlinkend/after} + { + \tag_mc_end: + \tagstructend + \tag_mc_begin_pop:n{} + } % \end{macrocode} -% if hyperref is loaded we have to repeat the definition +% if hyperref is loaded we have to revert is definition of the natbib hooks +% and add his code. TODO: allow to suppress the natbib code in hyperref. % % \begin{macrocode} \AddToHook{package/hyperref/after} { - \renewcommand\hyper@natlinkstart[1]{\UseHookWithArguments{natbib/linkstart}{1}{#1}} - \renewcommand\hyper@natlinkend{\UseHookWithArguments{natbib/linkend}{1}{}} - \AddToHookWithArguments{natbib/linkstart} + \renewcommand\hyper@natlinkstart[1]{} + \renewcommand\hyper@natlinkend{} + \AddToHookWithArguments{cmd/hyper@natlinkstart/before} { \Hy@backout{#1}% \hyper@linkstart{cite}{cite.#1}% \def\hyper@nat@current{#1} } - \AddToHook{natbib/linkend} + \AddToHook{cmd/hyper@natlinkend/after} { \hyper@linkend }