diff options
author | Norbert Preining <norbert@preining.info> | 2024-06-03 03:02:26 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-06-03 03:02:26 +0000 |
commit | e83ddb0c0c40cddccb9e35b6a1f83b3a70fc2b3d (patch) | |
tree | ee8ec365464694362978c23540a534e20c29592c /macros/latex/required/tools | |
parent | d751a6e51be81d6c1ba797cd91d4079e7e2e407b (diff) |
CTAN sync 202406030302
Diffstat (limited to 'macros/latex/required/tools')
75 files changed, 2347 insertions, 256 deletions
diff --git a/macros/latex/required/tools/README.md b/macros/latex/required/tools/README.md index f08c378fff..6413c06b37 100644 --- a/macros/latex/required/tools/README.md +++ b/macros/latex/required/tools/README.md @@ -1,7 +1,7 @@ The LaTeX `tools` bundle ======================== -Release 2023-11-01c +Release 2024-06-01 patch level 0 Overview -------- diff --git a/macros/latex/required/tools/afterpage.dtx b/macros/latex/required/tools/afterpage.dtx index 518b70761d..72df39402c 100644 --- a/macros/latex/required/tools/afterpage.dtx +++ b/macros/latex/required/tools/afterpage.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/afterpage.ins b/macros/latex/required/tools/afterpage.ins index 6fec5edc6f..17792ddfa1 100644 --- a/macros/latex/required/tools/afterpage.ins +++ b/macros/latex/required/tools/afterpage.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/afterpage.pdf b/macros/latex/required/tools/afterpage.pdf Binary files differindex 3782fae988..ef7a17844e 100644 --- a/macros/latex/required/tools/afterpage.pdf +++ b/macros/latex/required/tools/afterpage.pdf diff --git a/macros/latex/required/tools/array-2016-10-06.sty b/macros/latex/required/tools/array-2016-10-06.sty index f079fd4975..ced72d2913 100644 --- a/macros/latex/required/tools/array-2016-10-06.sty +++ b/macros/latex/required/tools/array-2016-10-06.sty @@ -1,5 +1,7 @@ %% -%% This is an old release of `array.sty', +%% This is an old release of `array.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== %% %% Copyright 1993-2016 %% The LaTeX Project and any individual authors listed elsewhere diff --git a/macros/latex/required/tools/array-2020-02-10.sty b/macros/latex/required/tools/array-2020-02-10.sty index 1243f25f74..5acd9c727e 100644 --- a/macros/latex/required/tools/array-2020-02-10.sty +++ b/macros/latex/required/tools/array-2020-02-10.sty @@ -1,4 +1,8 @@ %% +%% This is an old release of `array.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% %% This is file `array.sty', %% generated with the docstrip utility. %% @@ -38,11 +42,6 @@ %% Package `array' to use with LaTeX 2e %% Copyright (C) 1989-1998 Frank Mittelbach, all rights reserved. \NeedsTeXFormat{LaTeX2e}[1995/06/01] -\providecommand\DeclareRelease[3]{} -\providecommand\DeclareCurrentRelease[2]{} - -\DeclareRelease{}{2016-10-06}{array-2016-10-06.sty} -\DeclareCurrentRelease{}{2019-10-01} \ProvidesPackage{array} [2020/02/10 v2.4m Tabular extension package (FMi)] diff --git a/macros/latex/required/tools/array-2023-11-01.sty b/macros/latex/required/tools/array-2023-11-01.sty new file mode 100644 index 0000000000..b5267cffd2 --- /dev/null +++ b/macros/latex/required/tools/array-2023-11-01.sty @@ -0,0 +1,373 @@ +%% +%% This is an old release of `array.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% +%% This is file `array.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% array.dtx (with options: `package,ncols') +%% +%% This is a generated file. +%% +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at https://latex-project.org/bugs/ +%% (but please observe conditions on bug reports sent to that address!) +%% +%% +%% Copyright (C) 1993-2023 +%% The LaTeX Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'. +%% -------------------------------------------------------------------------- +%% +%% 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 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle' +%% without such generated files. +%% +%% The list of all files belonging to the LaTeX `Tools Bundle' is +%% given in the file `manifest.txt'. +%% +%% Package `array' to use with LaTeX 2e +%% Copyright (C) 1989-1998 Frank Mittelbach, all rights reserved. +\NeedsTeXFormat{LaTeX2e}[1995/06/01] + +\ProvidesPackage{array} + [2023/10/16 v2.5g Tabular extension package (FMi)] +%% + +\def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}} +\def\@testpach{\@chclass + \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else + \ifnum \@lastchclass=7 5 \else + \ifnum \@lastchclass=8 \tw@ \else + \ifnum \@lastchclass=9 \thr@@ + \else \z@ + \ifnum \@lastchclass = 10 \else + \edef\@nextchar{\expandafter\string\@nextchar}% + \@chnum + \if \@nextchar c\z@ \else + \if \@nextchar l\@ne \else + \if \@nextchar r\tw@ \else + \z@ \@chclass + \if\@nextchar |\@ne \else + \if \@nextchar !6 \else + \if \@nextchar @7 \else + \if \@nextchar <8 \else + \if \@nextchar >9 \else + 10 + \@chnum + \if \@nextchar m\thr@@\else + \if \@nextchar p4 \else + \if \@nextchar b5 \else + \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi + \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} +\def\@xexpast#1*#2#3#4\@@{% + \@tempcnta #2 + \toks@={#1}\@temptokena={#3}% + \let\the@toksz\relax \let\the@toks\relax + \def\@tempa{\the@toksz}% + \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do + {\edef\@tempa{\@tempa\the@toks}\advance \@tempcnta \m@ne}% + \let \@tempb \@xexpast \else + \let \@tempb \@xexnoop \fi + \def\the@toksz{\the\toks@}\def\the@toks{\the\@temptokena}% + \edef\@tempa{\@tempa}% + \expandafter \@tempb \@tempa #4\@@} +\def\prepnext@tok{\advance \count@ \@ne + \toks\count@{}} +\def\save@decl{\toks\count@ \expandafter{\@nextchar}} +\def\insert@column{% + \the@toks \the \@tempcnta + \ignorespaces \@sharp \unskip + \the@toks \the \count@ \relax} +\newdimen\col@sep +\def\@acol{\@addtopreamble{\hskip\col@sep}} +\def\@classx{% + \ifcase \@lastchclass + \@acolampacol \or + \@addamp \@acol \or + \@acolampacol \or + \or + \@acol \@firstampfalse \or + \@addamp + \fi} +\def\@classz{\@classx + \@tempcnta \count@ + \prepnext@tok + \@addtopreamble{\ifcase \@chnum + \hfil + \hskip1sp% + \d@llarbegin + \insert@column + \d@llarend \do@row@strut \hfil \or + \hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \hfil \or + \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \or + \setbox\ar@mcellbox\vbox + \@startpbox{\@nextchar}\insert@column \@endpbox + \ar@align@mcell + \do@row@strut \or + \vtop \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut \or + \vbox \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut + \fi}\prepnext@tok} + +\newbox\ar@mcellbox +\def\ar@align@mcell{% + \ifdim \ht\ar@mcellbox > \ht\strutbox + \begingroup + \dimen@\ht\ar@mcellbox + \advance\dimen@-\ht\@arstrutbox + \advance\dimen@\baselineskip + \lower.5\dimen@\box\ar@mcellbox + \endgroup + \else % assume one line and align at baseline + \box\ar@mcellbox + \fi} + +\def\@arrayrule{\@addtopreamble \vline} +\def\@classvii{\ifnum \@lastchclass = \thr@@ + \@preamerr \thr@@ \fi} +\def\@classvi{\ifcase \@lastchclass + \@acol \or + \@addtopreamble{\hskip \doublerulesep}\or + \@acol \or + \@classvii + \fi} +\def\@classii{\advance \count@ \m@ne + \save@decl\prepnext@tok} +\def\@classi{\@classvi + \ifcase \@chnum \@arrayrule \or + \@classv \fi} +\def\@startpbox#1{\bgroup + \color@begingroup + \setlength\hsize{#1}\@arrayparboxrestore + \everypar{% + \vrule \@height \ht\@arstrutbox \@width \z@ + \everypar{}}% + } +\def\@endpbox{\@finalstrut\@arstrutbox \par \color@endgroup \egroup\hfil} +\def\@array[#1]#2{% + \@tempdima \ht \strutbox + \advance \@tempdima by\extrarowheight + \setbox \@arstrutbox \hbox{\vrule + \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \strutbox + \@width \z@}% + \begingroup + \@mkpream{#2}% + \xdef\@preamble{\noexpand \ialign \@halignto + \bgroup \@arstrut \@preamble + \tabskip \z@ \cr}% + \endgroup + \@arrayleft + \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi + \bgroup + \let \@sharp ##\let \protect \relax + \lineskip \z@ + \baselineskip \z@ + \m@th + \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} +\def\arraybackslash{\let\\\tabularnewline} +\newdimen \extrarowheight +\extrarowheight=0pt +\def\@arstrut{\unhcopy\@arstrutbox} +\protected\def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi + \@ifstar \@xarraycr \@xarraycr} +\def\@xarraycr{\@ifnextchar [% + \@argarraycr {\ifnum 0=`{}\fi\cr}} +\def\@argarraycr[#1]{\ifnum0=`{}\fi\ifdim #1>\z@ + \expandafter\@xargarraycr\else + \expandafter\@yargarraycr\fi{#1}} +\def\@xargarraycr#1{\unskip\gdef\do@row@strut + {\@tempdima #1\advance\@tempdima \dp\@arstrutbox + \vrule \@depth\@tempdima \@width\z@\global\let\do@row@strut\relax}% + \ifnum\@multicnt >\z@ \do@row@strut \fi + \cr} +\let\do@row@strut\relax +\long\def\multicolumn#1#2#3{% + \multispan{#1}\begingroup + \def\@addamp{\if@firstamp \@firstampfalse \else + \@preamerr 5\fi}% + \@mkpream{#2}\@addtopreamble\@empty + \endgroup + \def\@sharp{#3}% + \@arstrut \@preamble + \null + \ignorespaces} +\let\d@llarbegin\begingroup +\let\d@llarend\endgroup +\def\array{\col@sep\arraycolsep + \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\def\@halignto{}% + \@tabarray} +\def\tabular{\def\@halignto{}\@tabular} +\expandafter\def\csname tabular*\endcsname#1{% + \setlength\dimen@{#1}% + \edef\@halignto{to\the\dimen@}\@tabular} +\def\@tabular{% + \leavevmode + \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup + \let\d@llarend\endgroup + \@tabarray} +\def\endtabular{\endarray\m@th $\egroup} +\expandafter\let\csname endtabular*\endcsname=\endtabular +\let\@ampacol=\relax \let\@expast=\relax +\let\@arrayclassiv=\relax \let\@arrayclassz=\relax +\let\@tabclassiv=\relax \let\@tabclassz=\relax +\let\@arrayacol=\relax \let\@tabacol=\relax +\let\@tabularcr=\relax \let\@@endpbox=\relax +\let\@argtabularcr=\relax \let\@xtabularcr=\relax +\def\@preamerr#1{\def\@tempd{{..} at wrong position: }% + \PackageError{array}{% + \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0 + Missing arg: token ignored\or %1 + Empty preamble: `l' used\or %2 + >\@tempd token ignored\or %3 + <\@tempd changed to !{..}\or %4 + Only one column-spec. allowed.\fi}\@ehc} %5 +\def\newcolumntype#1{% + \edef\NC@char{\string#1}% + \@ifundefined{NC@find@\NC@char}% + {\@tfor\next:=<>clrmbp@!|\do + {% + \if\expandafter\noexpand\next\NC@char + \PackageWarning{array}% + {Redefining primitive column \NC@char}\fi}% + \NC@list\expandafter{\the\NC@list\NC@do#1}}% + {\PackageWarning{array}{Column \NC@char\space is already defined}}% + \@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}% + \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}} +\def\newcol@#1[#2]#3{\expandafter\@reargdef + \csname NC@rewrite@#1\endcsname[#2]{\NC@find#3}} +\def\NC@#1{% + \@temptokena\expandafter{\the\@temptokena#1}\futurelet\next\NC@ifend} +\def\NC@ifend{% + \ifx\next\relax + \else\@tempswatrue\expandafter\NC@rewrite\fi} +\def\NC@do#1{% + \expandafter\let\expandafter\NC@rewrite + \csname NC@rewrite@\string#1\endcsname + \expandafter\let\expandafter\NC@find + \csname NC@find@\string#1\endcsname + \expandafter\@temptokena\expandafter{\expandafter}% + \expandafter\NC@find\the\@temptokena#1\relax} +\def\showcols{{\def\NC@do##1{\let\NC@do\NC@show}\the\NC@list}} +\def\NC@show#1{% + \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip + \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}} +\def\NC@strip#1:#2->#3 #4\@@{#2 -> #4} +\newtoks\NC@list +\newcolumntype{*}[2]{} +\long\@namedef{NC@rewrite@*}#1#2{% + \count@#1\relax + \loop + \ifnum\count@>\z@ + \advance\count@\m@ne + \@temptokena\expandafter{\the\@temptokena#2}% + \repeat + \NC@find} +\let\@xexpast\relax +\let\@xexnoop\relax +\def\save@decl{\toks \count@ = \expandafter\expandafter\expandafter + {\expandafter\@nextchar\the\toks\count@}} +\def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue + \let\@sharp\relax + \def\@startpbox##1{\unexpanded\expandafter{\expandafter + \@startpbox\expandafter{##1}}}\let\@endpbox\relax + \let\do@row@strut\relax + \let\ar@align@mcell\relax + \@temptokena{#1}\@tempswatrue + \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}% + \count@\m@ne + \let\the@toks\relax + \prepnext@tok + \expandafter \@tfor \expandafter \@nextchar + \expandafter :\expandafter =\the\@temptokena \do + {\@testpach + \ifcase \@chclass \@classz \or \@classi \or \@classii + \or \save@decl \or \or \@classv \or \@classvi + \or \@classvii \or \@classviii + \or \@classx + \or \@classx \fi + \@lastchclass\@chclass}% + \ifcase\@lastchclass + \@acol \or + \or + \@acol \or + \@preamerr \thr@@ \or + \@preamerr \tw@ \@addtopreamble\@sharp \or + \or + \else \@preamerr \@ne \fi + \def\the@toks{\the\toks}} +\let\@classix\relax +\def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else + \@preamerr 4\@chclass 6 \@classvi \fi\fi} +\def\@classv{\save@decl + \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@ + \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}% + \prepnext@tok} +\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}% + \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi} +\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}} +\let\@@array\@array +\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}} +\let\@arrayleft\@empty +\let\@arrayright\@empty +\newlength{\extratabsurround} +\setlength{\extratabsurround}{2pt} +\newlength{\backup@length} +\newcommand{\firsthline}{% + \multicolumn1{@{}c@{}}{% + \global\backup@length\ht\@arstrutbox + \global\advance\backup@length\dp\@arstrutbox + \global\advance\backup@length\arrayrulewidth + \raise\extratabsurround\copy\@arstrutbox + \kern-1sp% + }\\[-\backup@length]\hline +} +\newcommand{\lasthline}{\hline\multicolumn1{@{}c@{}}{% + \global\backup@length2\ht\@arstrutbox + \global\advance\backup@length2\dp\@arstrutbox + \global\advance\backup@length\arrayrulewidth + }\\[-\backup@length]% + \multicolumn1{@{}c@{}}{% + \lower\extratabsurround\copy\@arstrutbox + \kern-1sp% + }% +} +\CheckCommand*\@xhline{\ifx\reserved@a\hline + \vskip\doublerulesep + \vskip-\arrayrulewidth + \fi + \ifnum0=`{\fi}} +\renewcommand*\@xhline{\ifx\reserved@a\hline + \vskip\doublerulesep + \fi + \ifnum0=`{\fi}} + +\newsavebox\ar@cellbox +\newcolumntype{w}[2]{% + >{\begin{lrbox}\ar@cellbox\d@llarbegin}% + c% + <{\d@llarend \end{lrbox}% + \makebox[#2][#1]{\unhbox\ar@cellbox}}} + +\newcolumntype{W}[2] + {>{\begin{lrbox}\ar@cellbox\d@llarbegin}% + c% + <{\d@llarend\end{lrbox}% + \let\hss\hfil + \makebox[#2][#1]{\unhbox\ar@cellbox}}} +\endinput +%% +%% End of file `array.sty'. diff --git a/macros/latex/required/tools/array.dtx b/macros/latex/required/tools/array.dtx index 6e4e34ea26..e77ef0a3bf 100644 --- a/macros/latex/required/tools/array.dtx +++ b/macros/latex/required/tools/array.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -25,15 +25,21 @@ %% Package `array' to use with LaTeX 2e %% Copyright (C) 1989-1998 Frank Mittelbach, all rights reserved. %<+package>\NeedsTeXFormat{LaTeX2e}[1995/06/01] -%<+package>\providecommand\DeclareRelease[3]{} -%<+package>\providecommand\DeclareCurrentRelease[2]{} %<+package> +% For anything before 2016-10-06 we load the 2016 version and hope for the best: +%<+package>\DeclareRelease{}{1994-06-01}{array-2016-10-06.sty} +% %<+package>\DeclareRelease{}{2016-10-06}{array-2016-10-06.sty} %<+package>\DeclareRelease{v2.4}{2020-02-10}{array-2020-02-10.sty} -%<+package>\DeclareCurrentRelease{}{2020-10-01} +%<+package>\DeclareRelease{v2.5}{2023-11-01}{array-2023-11-01.sty} +%<+package>\DeclareCurrentRelease{}{2024-06-01} %<+package> +% \end{macrocode} +% Current version needs a new kernel. +% \begin{macrocode} +%<+package>\NeedsTeXFormat{LaTeX2e}[2024/06/01] %<+package>\ProvidesPackage{array} -%<+package> [2023/10/16 v2.5g Tabular extension package (FMi)] +%<+package> [2024/05/23 v2.6c Tabular extension package (FMi)] % % \fi % @@ -177,6 +183,18 @@ % \DoNotIndex{\xdef} % \DoNotIndex{\z@} % +% +% \providecommand\env[1]{\texttt{#1}} +% +% \providecommand\hook[1]{\texttt{#1\DescribeHook[noprint]{#1}}} +% \providecommand\socket[1]{\texttt{#1\DescribeSocket[noprint]{#1}}} +% \providecommand\plug[1]{\texttt{#1\DescribePlug[noprint]{#1}}} +% +% \NewDocElement[printtype=\textit{socket},idxtype=socket,idxgroup=Sockets]{Socket}{socketdecl} +% \NewDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl} +% \NewDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl} +% +% % \GetFileInfo{array.sty} % % \title{A new implementation of \LaTeX's \textsf{tabular} @@ -195,6 +213,8 @@ % \MaintainedByLaTeXTeam{tools} % \maketitle % +% +% % \MakeShortVerb{\=} % % \begin{abstract} @@ -750,12 +770,29 @@ % \end{itemize} % % +% \section{Support for tagged PDF} % -% \changes{v2.2b}{1994/02/04}{Removed interactive prompt} +% With version 2.6a the package is made tagging aware, which means that +% it will automatically produce tagged tables (necessary, for example, for +% accessibility) if tagging is requested via \cs{DocumentMetadata}. % -% \MaybeStop{ +% More granular control, e.g., explicitly deciding which cells are +% header cells, etc., is currently under development, but syntax for +% this will not appear in this package. Instead it will become +% available across all tabular-generating packages and then +% automatically apply here as well. +% +% Enabling \LaTeX{} to automatically produce tagged PDF is a long-term +% project and this is a tiny step in this puzzle. For more information +% on the project and already available functionality, see +% \url{https://latex-project.org/publications/indexbytopic/pdf} and +% \url{https://github.com/latex3/tagging-project}. % % +% +% \changes{v2.2b}{1994/02/04}{Removed interactive prompt} +% +% \MaybeStop{ % \begin{thebibliography}{1} % \bibitem{bk:GMS94} \textsc{M.~Goossens}, \textsc{F.~Mittelbach} % and \textsc{A.~Samarin}. @@ -772,7 +809,6 @@ % \newblock % Addison-Wesley, Reading, Massachusetts, 1986. % \end{thebibliography} -% % } ^^A end of \MaybeStop % % @@ -786,8 +822,49 @@ % \texttt{docstrip} program. % \begin{macrocode} %<*driver> -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\documentclass{ltxdoc} +\NeedsTeXFormat{LaTeX2e}[2024/06/01] +% \end{macrocode} +% +% We switched from \cls{ltxdoc} to \cls{l3doc} to get support for +% code written in the L3 programming layer. The first is that we +% are currently missing \cs{MaintainedByLaTeXTeam}, so we have to +% provide that for now. +% \begin{macrocode} +\documentclass{l3doc} + +% currently missing in l3doc +\makeatletter +\def\MaintainedBy#1{\gdef\@maintainedby{#1}} +\let\@maintainedby\@empty +\def\MaintainedByLaTeXTeam#1{% +{\gdef\@maintainedby{% +This file is maintained by the \LaTeX{} Project team.\\% +Bug reports can be opened (category \texttt{#1}) at\\% +\url{https://latex-project.org/bugs.html}.}}} +\def\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \par}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \ifx\@maintainedby\@empty + \else + \vskip 1em% + \fbox{\fbox{\begin{tabular}{@{}l@{}}\@maintainedby\end{tabular}}}% + \fi + \end{center}% + \par + \vskip 1.5em} +\makeatother % undo the default is not used: @@ -817,6 +894,29 @@ % \end{macrocode} % % +% \section{A note on the updates done December 2023} +% +% We introduced support for tagged PDf and at the same time we added +% code to determine row and column numbers for each cell in +% preparation for supporting formatting or type specifications for individual +% cells (or group of cells) from the outside, e.g., \enquote{rows 1, +% 2, and 10 are header rows} (syntax to be decided). +% +% This new code is already written with L3 programming layer conventions +% while most of the legay code is still as it was before. This make the code +% currently somewhat clattered, unfortunately. Eventually this will all move to L3 +% programming layer but this will take time. +% +% +% \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn +% \end{macrocode} +% +% +% +% +% % \section{The construction of the preamble} % % \DeleteShortVerb{\"} @@ -972,6 +1072,7 @@ % =\@chclass= and =\@chnum=. % \changes{v2.0f}{1992/02/29}{Argument removed since implicitly known} % \begin{macrocode} +\ExplSyntaxOff \def\@testpach{\@chclass % \end{macrocode} % First we deal with the cases in which the \textsf{token} @@ -981,7 +1082,7 @@ \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else \ifnum \@lastchclass=7 5 \else \ifnum \@lastchclass=8 \tw@ \else - \ifnum \@lastchclass=9 \thr@@ + \ifnum \@lastchclass=9 \thr@@@@ % \end{macrocode} % Otherwise we will assume that the \textsf{token} belongs to the % class $0$ @@ -1032,7 +1133,7 @@ % \begin{macrocode} 10 \@chnum - \if \@nextchar m\thr@@\else + \if \@nextchar m\thr@@@@ \else \if \@nextchar p4 \else \if \@nextchar b5 \else % \end{macrocode} @@ -1042,6 +1143,7 @@ % \begin{macrocode} \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} +\ExplSyntaxOn % \end{macrocode} % \end{macro} % @@ -1062,10 +1164,10 @@ % they are in explicit braces, as in =@{*}=. % % This macro is called via -% =\@xexpast=\meta{preamble}=*0x\@@=. +% =\@xexpast=\meta{preamble}=*0x\@@@@=. % The $*$--expression =*0x= is being used to terminate the % recursion, -% as we shall see later, and =\@@= serves as an argument +% as we shall see later, and =\@@@@= serves as an argument % delimiter. =\@xexpast= has four arguments. The first % one is the part of the % user preamble before the first $*$--expression while the second @@ -1074,7 +1176,7 @@ % above). % The fourth argument is the rest of the preamble. % \begin{macrocode} -\def\@xexpast#1*#2#3#4\@@{% +\def\@xexpast#1*#2#3#4\@@@@{% % \end{macrocode} % The number of copies of \textit{String} (=#2=) that are to be % produced will be saved in a \textsf{count} register. @@ -1111,7 +1213,7 @@ % \end{macrocode} % If \textit{N\/} was greater than zero we prepare for another call % of =\@xexpast=. Otherwise we assume we have reached the end of -% the user preamble, because we had appended =*0x\@@= when we first +% the user preamble, because we had appended =*0x\@@@@= when we first % called =\@xexpast=. In other words: if the user inserts % =*{0}{..}= in his preamble, \LaTeX\ ignores the rest of it. % \begin{macrocode} @@ -1133,7 +1235,7 @@ % $*$--expression is handled, or to the macro =\@xexnoop=, % which only ends the recursion by deleting its argument. % \begin{macrocode} - \expandafter \@tempb \@tempa #4\@@} + \expandafter \@tempb \@tempa #4\@@@@} % \end{macrocode} % \end{macro} % \end{macro} @@ -1142,10 +1244,10 @@ % \begin{macro}{\@xexnoop} % So the first big problem is solved. Now it is easy to % specify =\@xexnoop=. -% Its argument is delimited by =\@@= and it simply expands to +% Its argument is delimited by =\@@@@= and it simply expands to % nothing. % \begin{macrocode} -% \def\@xexnoop#1\@@{} +% \def\@xexnoop#1\@@@@{} % \end{macrocode} % \end{macro} % @@ -1270,11 +1372,19 @@ % % \begin{macro}{\insert@column} % \begin{macro}{\@sharp} +% \begin{macro}{\textonly@unskip} % We now define the macro =\insert@column= which will do % this work for us. % \begin{macrocode} \def\insert@column{% % \end{macrocode} +% +% For tagging we insert as special socket, that adds the necessary +% PDF tag at the beginning of the cell if tagging is enabled. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/cell/begin}% +% \end{macrocode} % Here, we assume that the \textsf{count} register % =\@tempcnta= has saved the value $=\count@= - 1$. % \begin{macrocode} @@ -1291,8 +1401,9 @@ % \changes{v2.0e}{1991/02/07}{Added \{\} around \cs{@sharp} for new ftsel} % \changes{v2.0h}{1992/06/22}{Removed \{\} again in favour of % \cs{d@llarbegin}} +% \changes{v2.6b}{2024/04/08}{Do not \cs{unskip} if in math mode (gh/1323)} % \begin{macrocode} - \ignorespaces \@sharp \unskip + \ignorespaces \@sharp \textonly@unskip % \end{macrocode} % Then the second \textsf{token} register follows whose number should % be saved in =\count@=. @@ -1302,12 +1413,42 @@ % \changes{v2.0c}{1990/08/14}{\cs{relax} added to avoid problem % \cs{the}\cs{toks0}\cs{the}\cs{toks1}.} % \begin{macrocode} - \the@toks \the \count@ \relax} + \the@toks \the \count@ \relax % \end{macrocode} +% +% And another socket for tagging that adds the necessary closing tag +% if enabled. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/cell/end}% +} +% \end{macrocode} +% Do the unskip only if we are in hmode: +% \changes{v2.6b}{2024/04/08}{Do not \cs{unskip} if in math mode (gh/1323)} +% \begin{macrocode} +\protected\def\textonly@unskip{\ifhmode\unskip\fi} +% \end{macrocode} +% \end{macro} % \end{macro} % \end{macro} % % +% \begin{macro}{\insert@pcolumn} +% Handling pcolumn-cells needs slightly different handling when +% doing tagging. Rather than changing the plugs in +% \cs{insert@column} back and forth, we simply use a different +% version of \cs{insert@column} that has its own sockets. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} +\def\insert@pcolumn{% + \UseTaggingSocket{tbl/pcell/begin}% + \the@toks \the \@tempcnta + \ignorespaces \@sharp \unskip + \the@toks \the \count@ \relax + \UseTaggingSocket{tbl/pcell/end}% +} +% \end{macrocode} +% \end{macro} % % % \subsection{The separation of columns} @@ -1321,11 +1462,24 @@ % =\@addamp=, the macro that inserts the =&=. % \begin{macrocode} % \newif \@iffirstamp -% \def\@addamp{\if@firstamp \@firstampfalse -% \else \@addtopreamble &\fi} +\def\@addamp { + \if@firstamp + \@firstampfalse + \else +% \end{macrocode} +% If we are after the first column we have to insert a \verb=&= and +% also update the cell data. +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \edef\@preamble{\@preamble & + \noexpand\tbl_update_cell_data: } + \fi +} % \end{macrocode} % \end{macro} % +% +% % \begin{macro}{\@acol} % \begin{macro}{\@acolampacol} % \begin{macro}{\col@sep} @@ -1393,7 +1547,7 @@ % command =\@xexpast=. As we already know, this command saves % its result in the macro =\@tempa=. % \begin{macrocode} -% \@xexpast #1*0x\@@ +% \@xexpast #1*0x\@@@@ % \end{macrocode} % Afterwards we initialize all registers and macros, that we need % for the build-up of the preamble. @@ -1477,7 +1631,7 @@ % \texttt{r}, \texttt{p},\texttt{m} or \texttt{b}. We report an % error and ignore the declaration given by ={..}=. % \begin{macrocode} -% \@preamerr \thr@@ \or +% \@preamerr \thr@@@@ \or % \end{macrocode} % If =\@lastchclass= is $4$ the user preamble has been empty. % To continue, we insert a =#= in the preamble. @@ -1671,18 +1825,17 @@ \setbox\ar@mcellbox\vbox % \end{macrocode} % The part of the templates which is the same in all three cases -% (\texttt{p}, \texttt{m} and \texttt{b}) -% is built by the macros =\@startpbox= and -% =\@endpbox=. =\@startpbox= has an argument: -% the width of the column which is stored in the current -% \textsf{token} (i.e.\ =\@nextchar=). -% Between these two macros we find the well known -% =\insert@column=. -% The strut is places after the box +% (\texttt{p}, \texttt{m} and \texttt{b}) is built by the macros +% =\@startpbox= and =\@endpbox=. =\@startpbox= has an argument: the +% width of the column which is stored in the current \textsf{token} +% (i.e.\ =\@nextchar=). Between these two macros we find the well +% known =\insert@column= or rather the variant for tagging: +% \cs{insert@pcolumn}. The strut is placed after the box. % \changes{v2.4e}{2016/10/07}{Fixing SX68732} % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}} +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} % \begin{macrocode} - \@startpbox{\@nextchar}\insert@column \@endpbox + \@startpbox{\@nextchar}\insert@pcolumn \@endpbox \ar@align@mcell \do@row@strut \or % \end{macrocode} @@ -1690,9 +1843,10 @@ % same way though we do not need the =$= characters because we use % =\vtop= or =\vbox=. % \changes{v2.4e}{2016/10/07}{Fixing SX68732} +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} % \begin{macrocode} - \vtop \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut \or - \vbox \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut + \vtop \@startpbox{\@nextchar}\insert@pcolumn \@endpbox\do@row@strut \or + \vbox \@startpbox{\@nextchar}\insert@pcolumn \@endpbox\do@row@strut % \end{macrocode} % Other values for =\@chnum= are impossible. Therefore we % end the arguments to =\@addtopreamble= and =\ifcase=. @@ -1783,8 +1937,8 @@ % So the declarations defined by the first =>{...}= % are ignored. % \begin{macrocode} -%\def\@classix{\ifnum \@lastchclass = \thr@@ -% \@preamerr \thr@@ \fi +%\def\@classix{\ifnum \@lastchclass = \thr@@@@ +% \@preamerr \thr@@@@ \fi % \end{macrocode} % Furthermore, we call up =\@class10= because afterwards always a % new column is started by \texttt{c}, \texttt{l}, \texttt{r}, @@ -1836,14 +1990,14 @@ % We only check if the last \textsf{token} was of class $3$ which is % forbidden. % \begin{macrocode} -\def\@classvii{\ifnum \@lastchclass = \thr@@ +\def\@classvii{\ifnum \@lastchclass = \thr@@@@ % \end{macrocode} % If this is true we output an error message and % ignore the declarations stored % by the last =>{...}=, because these are overwritten % by the argument of \texttt{@}. % \begin{macrocode} - \@preamerr \thr@@ \fi} + \@preamerr \thr@@@@ \fi} % \end{macrocode} % \end{macro} % @@ -2032,7 +2186,7 @@ % second one describes the wanted preamble, % e.g.\ it has the form =|c|c|c|=. % \begin{macrocode} -\def\@array[#1]#2{% +\def\@array[#1]#2{ % \end{macrocode} % First we define a \textsf{strut} whose size basically corresponds % to a normal \textsf{strut} multiplied by the factor @@ -2051,6 +2205,14 @@ \@depth \arraystretch \dp \strutbox \@width \z@}% % \end{macrocode} +% The total number of table columns of the current table is +% determined in \cs{tbl_count_table_cols:} but this is called in +% a group, so local settings do not survive. Thus, to save away the +% outer value of \cs{g_@@_table_cols_tl} we do it before the group. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \tbl_save_outer_table_cols: +% \end{macrocode} % Then we open a group, in which the user preamble is evaluated by % the macro =\@mkpream=. As we know this must happen locally. % This macro creates a preamble for a =\halign= and saves @@ -2059,6 +2221,11 @@ \begingroup \@mkpream{#2}% % \end{macrocode} +% Figure out how many columns this table has: +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_count_table_cols: +% \end{macrocode} % We again redefine =\@preamble= so that a call up of =\@preamble= % now starts the =\halign=. Thus also the arguments of \texttt{>}, % \texttt{<}, \texttt{@} and \texttt{!}, saved in the @@ -2085,13 +2252,38 @@ % unsupported redefinition of a \TeX{} primitive for the moment (as people rely % on that experimental code). % \begin{macrocode} - \xdef\@preamble{\noexpand \ialign \@halignto - \bgroup \@arstrut \@preamble - \tabskip \z@ \cr}% + \xdef\@preamble{ +% \end{macrocode} +% \cs{ialign} in the original definition is replaced by +% \cs{ar@ialign} defined below. This does what \cs{ialign} does but +% additionally handles the tagging structure for the whole table if necessary. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \noexpand \ar@ialign + \@halignto + \bgroup \@arstrut % \end{macrocode} % What we have not explained yet is the macro =\@halignto= % that was just used. Depending on its replacement text the % =\halign= becomes a =\halign= \texttt{to} \meta{dimen}. +% +% Next, a tagging support socket is inserted adding the start row tag. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/row/begin} +% \end{macrocode} +% At the start of the preamble for the first column we call +% \cs{tbl_init_cell_data_for_row:} to initialize the cell index data. In +% later columns this data is updated via \cs{tbl_update_cell_data:}. +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_init_cell_data_for_row: +% \end{macrocode} +% +% \begin{macrocode} + \@preamble + \tabskip \z@ \cr} +% \end{macrocode} % Now we close the group again. Thus % =\@startpbox= and =\@endpbox= as well as all % \textsf{token} registers get their former meaning back. @@ -2128,12 +2320,16 @@ % around every column in the \textsf{array}--environment % the parameter =\mathsurround= should % also be set to \textsf{0pt}. This prevents additional space between -% the rows. The -% \PlainTeX--macro =\m@th= does this. +% the rows. % \begin{macrocode} \lineskip \z@ \baselineskip \z@ - \m@th +% \end{macrocode} +% Don't use \cs{m@th} here as that signals to the math taggingg +% code that this is fake math that should not be tagged. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \mathsurround \z@ % \end{macrocode} % Beside, we have to assign a special meaning (which we still have % to specify) to the line separator =\\=. We also have to @@ -2144,10 +2340,61 @@ % start the wanted =\halign=. % \changes{1994/12/08}{v2.3b}{add \cs{tabularnewline}} % \begin{macrocode} - \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble} + \let\\\@arraycr \let\tabularnewline\\\let\par\@empty +% \end{macrocode} +% Another socket for tagging. TODO: what about \cs{arrayleft} above? +% \begin{macrocode} + \UseTaggingSocket{tbl/init} +% \end{macrocode} +% +% \begin{macrocode} + \@preamble +} % \end{macrocode} % \end{macro} % +% +% +% \begin{macro}{\ar@ialign} +% A new command that replaces \cs{ialign} used previously. \cs{everycr} is +% also applied to the \cs{cr} ending the preamble so we have to +% program around that. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} +\def\ar@ialign{% +% \end{macrocode} +% Before starting a table we have to initialize the variables +% holding row and column information for cells. We also have +% locally store the information related to the current cell (if we +% are already inside a table) so that we can restore it once the +% inner table is finished. +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_init_cell_data_for_table: +% \end{macrocode} +% +% \begin{macrocode} + \everycr{% + \noalign{% +% \end{macrocode} +% If this \cs{cr} was at the end of a real row (e.g., not at the +% end of the table preamble) we have add a row end tag. +% \begin{macrocode} + \tbl_if_row_was_started:T { \UseTaggingSocket{tbl/row/end} } +% \end{macrocode} +% The we prepare for the next row. +% \begin{macrocode} + \tbl_update_cell_data_for_next_row: + }% + }% + \tabskip\z@skip\halign} +% \end{macrocode} +% \end{macro} +% +% +% +% +% % \begin{macro}{\arraybackslash} % \changes{v2.4a}{2003/12/17}{(DPC) Macro added (from tabularx)} % Restore =\\= for use in array and tabular environment (after @@ -2182,7 +2429,27 @@ % \begin{macro}{\@arraycr} % In the macro =\@array= the line separator =\\= is % =\let= to the command =\@arraycr=. -% Its definition starts with a special brace which I have directly +% \changes{v2.3c}{1995/04/23}{Avoid adding an ord atom in math} +% \changes{v2.5e}{2021/04/20}{Use \cs{protected} for \cs{\bslash} variant (gh/548)} +% \begin{macrocode} +\protected\def\@arraycr { +% \end{macrocode} +% Add code that figures out if the current table row is incomplete +% (not enough \verb=&=s). It can then do extra actions, such as +% inserting missing cell tags. +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_count_missing_cells:n {@arraycr} +% \end{macrocode} +% TODO: maybe this is also the right place to add a socket that +% could be used to actually enter missing cells instead of just +% adding tagging structures for them later. This would be optional +% but in many cases it would be the right thing to do (for example +% if tables contain vertical lines or similar visual structures +% that require fully specified rows. +% +% +% We then start a special brace which I have directly % copied from the original definition. It is % necessary, because the =\futurlet= in =\@ifnextchar= % might @@ -2198,10 +2465,8 @@ % =\halign= while we are looking for a =*= or =[=. % For further information see % \cite[Appendix D]{bk:knuth}. -% \changes{v2.3c}{1995/04/23}{Avoid adding an ord atom in math} -% \changes{v2.5e}{2021/04/20}{Use \cs{protected} for \cs{\bslash} variant (gh/548)} % \begin{macrocode} -\protected\def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi + \iffalse{\fi\ifnum 0=`}\fi % \end{macrocode} % Then we test whether the user is using the star form and ignore % a possible star (I also disagree with this procedure, because a @@ -2210,6 +2475,11 @@ \@ifstar \@xarraycr \@xarraycr} % \end{macrocode} % \end{macro} + + + + + % % \begin{macro}{\@xarraycr} % In the command =\@xarraycr= we test if an optional argument @@ -2301,6 +2571,7 @@ % the result column and the actual column entry. % \changes{v2.3j}{1998/01/29}{Command made \cs{long} to match % kernel change for pr/2180} +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} % \begin{macrocode} \long\def\multicolumn#1#2#3{% % \end{macrocode} @@ -2310,6 +2581,16 @@ % \begin{macrocode} \multispan{#1}\begingroup % \end{macrocode} +% For tagging support we have to solve two problems: +% \cs{multicolumn} must handle the row begin if it is used there, +% and it must save the numbers of cells it spans so that we can add +% a suitable ColSpan attribute. We do this in the next macro +% (which in turn calls the \texttt{tbl/row/begin} socket, if +% necessary). +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_update_multicolumn_cell_data:n {#1} +% \end{macrocode} % Since a =\multicolumn= should only describe the format of a % result column, we redefine =\@addamp= in such a way that one gets % an error message if one uses more than one \texttt{c}, @@ -2336,6 +2617,12 @@ % \begin{macrocode} \endgroup % \end{macrocode} +% Now we update the colspan attribute. This needs setting after +% the group as it is hidden inside the plug in \cs{insert@column}. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/colspan}{#1}% +% \end{macrocode} % In the special situation of =\multicolumn= =\@preamble= % is not needed as preamble for a =\halign= but it is directly % inserted into our table. Thus instead of =\sharp= @@ -2458,6 +2745,12 @@ % \begin{macrocode} \leavevmode % \end{macrocode} +% Now that we know we are in hmode we can add the start tag for the +% whole table. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/hmode/begin}% +% \end{macrocode} % It should be taken into consideration that the macro =\@array= % must be called in math mode. Therefore we open a \textsf{box}, % insert a =$= and then assign the correct values to =\col@sep= and @@ -2486,11 +2779,41 @@ % =\@array=. To save \textsf{token} space we then redefine % =\@preamble= % because its replacement text isn't longer needed. +% +% To handle cell indexes, we do not use \cs{crcr} but a variant +% that also handles missing cells as necessary. +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} % \begin{macrocode} -%\def\endarray{\crcr \egroup \egroup \gdef\@preamble{}} +\def\endarray { + \tbl_crcr:n{endarray} \egroup + \UseTaggingSocket{tbl/finalize} +% \end{macrocode} +% +% If tables are nested into another then it is necessary to +% restore information about the cell the inner table started +% in. Otherwise, the cell index data structures reflect the +% status in the outer table as they +% are globally manipulated. We restore in all cases even if we are +% not in a nesting situation as that makes the code simpler (and +% probably faster). +% +% \cs{endtabular} and \cs{endtabular*} inherit from \cs{endarray} +% so we only need to change that. \texttt{tabularx} uses a similar method. +% \changes{v2.6a}{2023/12/11}{Managing cell indexes} +% \begin{macrocode} + \tbl_restore_outer_cell_data: +% \end{macrocode} +% +% \begin{macrocode} + \egroup + \@arrayright \gdef\@preamble{}% +} % \end{macrocode} % \end{macro} % +% +% +% % \begin{macro}{\endtabular} % \begin{macro}{\endtabular*} % To end a \textsf{tabular} or \textsf{tabular$*$} environment we @@ -2499,7 +2822,13 @@ % 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\m@th $\egroup} +\def\endtabular{\endarray\m@th $\egroup +% \end{macrocode} +% +% \changes{v2.6a}{2023/12/11}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/hmode/end}% +} \expandafter\let\csname endtabular*\endcsname=\endtabular % \end{macrocode} % \end{macro} @@ -2518,7 +2847,7 @@ \let\@arrayclassiv=\relax \let\@arrayclassz=\relax \let\@tabclassiv=\relax \let\@tabclassz=\relax \let\@arrayacol=\relax \let\@tabacol=\relax -\let\@tabularcr=\relax \let\@@endpbox=\relax +\let\@tabularcr=\relax \let\@@@@endpbox=\relax \let\@argtabularcr=\relax \let\@xtabularcr=\relax % \end{macrocode} % @@ -2576,6 +2905,7 @@ % to define letters, to be used in the same way as the primitive % column specifiers, `c' `p' etc. % \begin{macrocode} +\ExplSyntaxOff % this is really oldstyle using \@tfor := \def\newcolumntype#1{% % \end{macrocode} % "\NC@char" was added in V2.01 so that active characters, like "@" in @@ -2615,6 +2945,7 @@ % If an optional argument was not given, give a default argument of 0. % \begin{macrocode} \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}} +\ExplSyntaxOn % \end{macrocode} % \end{macro} % \begin{macro}{\newcol@} @@ -2710,16 +3041,18 @@ % produced and then "\typeout" the required string. % \begin{macrocode} \def\NC@show#1{% - \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip - \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}} + \typeout{Column~ #1\expandafter\expandafter\expandafter\NC@strip + \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@@@}} % \end{macrocode} % \end{macro} % \begin{macro}{\NC@strip} % Delimit the arguments to "\NC@strip" with `\texttt{:}', `\texttt{->}', -% a space, and "\@@" to pull out the required parts of the output from +% a space, and "\@@@@" to pull out the required parts of the output from % "\meaning". % \begin{macrocode} -\def\NC@strip#1:#2->#3 #4\@@{#2 -> #4} +\ExplSyntaxOff +\def\NC@strip#1:#2->#3 #4\@@@@{#2 -> #4} +\ExplSyntaxOn % \end{macrocode} % \end{macro} % \begin{macro}{\NC@list} @@ -2807,6 +3140,7 @@ % \changes{v2.4e}{2016/10/07}{Fixing SX68732} % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}} % \begin{macrocode} +\ExplSyntaxOff % really oldstyle using \@tfor := \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue \let\@sharp\relax % \end{macrocode} @@ -2869,11 +3203,12 @@ \@acol \or \or \@acol \or - \@preamerr \thr@@ \or + \@preamerr \thr@@@@ \or \@preamerr \tw@ \@addtopreamble\@sharp \or \or \else \@preamerr \@ne \fi \def\the@toks{\the\toks}} +\ExplSyntaxOn % \end{macrocode} % \end{macro} % @@ -2908,7 +3243,7 @@ % \texttt{array.sty} 2.0h. % \begin{macrocode} \def\@classv{\save@decl - \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@ + \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@@@@ \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}% \prepnext@tok} % \end{macrocode} @@ -2920,7 +3255,7 @@ % second "\extracolsep", there is no point in the user entering two of % these commands anyway, so this is not really a restriction. % \begin{macrocode} -\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}% +\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@@@@{\def\@tempa{#2}% \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi} %</ncols> % \end{macrocode} @@ -2936,28 +3271,27 @@ % % \begin{macro}{\@tabarray} % This macro tests for an optional bracket and then calls up -% "\@@array" or "\@@array[c]" (as default). +% "\@@@@array" or "\@@@@array[c]" (as default). % \begin{macrocode} %<*package> -\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}} +\def\@tabarray{\@ifnextchar[{\@@@@array}{\@@@@array[c]}} % \end{macrocode} % \end{macro} -% \begin{macro}{\@@array} +% \begin{macro}{\@@@@array} % This macro tests could then test an optional delimiter before the % left brace of the main preamble argument. Here in the main package % it simply is let to be "\@array". % \begin{macrocode} -\let\@@array\@array +\let\@@@@array\@array % \end{macrocode} % \end{macro} % -% \begin{macro}{\endarray} +% \begin{macro}{\@arrrayleft} % \begin{macro}{\@arrayright} % We have to declare the hook we put into "\@array" above. -% A similar hook `"\@arrayright"' will be inserted into the +% A similar hook \cs{@arrayright} will be inserted into the % "\endarray" to gain control. Both defaults to empty. % \begin{macrocode} -\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}} \let\@arrayleft\@empty \let\@arrayright\@empty % \end{macrocode} @@ -3182,6 +3516,14 @@ % \end{macro} % % +% +% +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% % \PrintIndex % \PrintChanges % diff --git a/macros/latex/required/tools/array.pdf b/macros/latex/required/tools/array.pdf Binary files differindex 085cb2321a..fd71de4045 100644 --- a/macros/latex/required/tools/array.pdf +++ b/macros/latex/required/tools/array.pdf diff --git a/macros/latex/required/tools/bm.dtx b/macros/latex/required/tools/bm.dtx index a608c6aeb5..d7d6eb54ee 100644 --- a/macros/latex/required/tools/bm.dtx +++ b/macros/latex/required/tools/bm.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -22,7 +22,7 @@ % \fi % % \iffalse -%% Copyright 1996 1997 1998 1999 2002 2003 2004 2016 2017 2019 2021 2022 +%% Copyright 1996 1997 1998 1999 2002 2003 2004 2016 2017 2019 2021 2022 2023 %% David Carlisle Frank Mittelbach %% %% Development of this package was commissioned by Y&Y Inc. @@ -36,7 +36,7 @@ %<driver>\ProvidesFile{bm.drv} % \fi % \ProvidesFile{bm.dtx} - [2023/07/08 v1.2f Bold Symbol Support (DPC/FMi)] + [2023/12/19 v1.2f Bold Symbol Support (DPC/FMi)] % % \iffalse %<*driver> @@ -178,14 +178,14 @@ % spacing). So the third example produces identical output to the first % (but \TeX\ takes more time producing it). % -% In the fourth example the |\mathrm{\bm{g}}| is essentially +% In the fourth example the |\mathrm{\bm{{g}}}| is essentially % equivalent to |\mathrm{\mbox{\boldmath$g$}}|. Currently math alphabet % settings are not passed down to `nested' math lists, and so in this % example, the |\mathrm| has no effect, and a bold math italic $\bm g$ % is obtained. % % Similarly the last example is equivalent to -% |$\mbox{\boldmath$\mathrm{g}$}}| and so in this case, one obtains a +% |$\mbox{\boldmath$\mathrm{g}$}$| and so in this case, one obtains a % bold roman \textbf{g}. % % \subsection{Delimiters} diff --git a/macros/latex/required/tools/bm.ins b/macros/latex/required/tools/bm.ins index a7424a0e67..c0c8125d10 100644 --- a/macros/latex/required/tools/bm.ins +++ b/macros/latex/required/tools/bm.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/bm.pdf b/macros/latex/required/tools/bm.pdf Binary files differindex 47bef9fc86..96e7864915 100644 --- a/macros/latex/required/tools/bm.pdf +++ b/macros/latex/required/tools/bm.pdf diff --git a/macros/latex/required/tools/calc.dtx b/macros/latex/required/tools/calc.dtx index 2c4cecbf03..154c6ba26a 100644 --- a/macros/latex/required/tools/calc.dtx +++ b/macros/latex/required/tools/calc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/calc.pdf b/macros/latex/required/tools/calc.pdf Binary files differindex 203c0032f6..bc73b49ab5 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 0ced77d568..afd942a4e7 100644 --- a/macros/latex/required/tools/changes.txt +++ b/macros/latex/required/tools/changes.txt @@ -10,13 +10,80 @@ All changes above are only part of the development branch for the next release. ================================================================================ ######################### +# 2023-11-01 Release +######################### + +2024-05-23 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * array.dtx: + * longtable.dtx: + * multicol.dtx: + * showkeys.dtx: + * varioref.dtx: + Do not error with "suspicous date" when rolling back to + early years of LaTeX2e (gh/1336) + +2024-05-09 Yukai Chou <muzimuzhi@gmail.com> + + * amsmath.dtx: + Fix typo in comment, \Umathcar -> \Umathchar (gh/1343) + +2024-04-10 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + + * xr.dtx: + Merged in the code from xr-hyper. This extends xr to properly support + targets and links and also adds support for properties (gh/1180). + +2024-04-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * array.dtx (section{The insertion of declarations): + Do not \unskip if in math mode, this way explicit spaces at the + end of the math cell remain as it is with array env in core LaTeX (gh/1323) + +2024-03-13 David Carlisle <David.Carlisle@latex-project.org> + + * l3sys-query.dtx + New package, providing a document interface to the l3sys-query Lua script. + +2024-01-22 Lars Madsen <daleif@math.au.dk> + + * verbatim.dtx: added TAB marking support to \verbatiminput* (gh/1245) + +2023-12-16 David Carlisle <David.Carlisle@latex-project.org> + + * showkeys.dtx: avoid adding extra box to \@labels gh/1123 + +2023-12-16 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * longtable.dtx: + Support for tagged PDF + Manage and provide cell indexes + +2023-12-12 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * array.dtx: + Support for tagged PDF + Manage and provide cell indexes + +2023-12-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * tabularx.dtx: + Require newer LaTeX kernel (that supports tagging) + Suspend any tagging while doing trial typesetting + +2023-11-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * multicol.dtx (subsection{Maintaining the mark registers}]): + Get rid of forced breaks for mark extraction (gh/1130) + +######################### # 2023-11-01c Release ######################### 2023-11-06 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * verbatim.dtx (subsection{Preliminaries}): - Update code so that that \verb does not show visible spaces (gh/1160) + Update code so that \verb does not show visible spaces (gh/1160) ######################### # 2023-11-01b Release diff --git a/macros/latex/required/tools/dcolumn.dtx b/macros/latex/required/tools/dcolumn.dtx index c8ddaf4ce6..feb3096cce 100644 --- a/macros/latex/required/tools/dcolumn.dtx +++ b/macros/latex/required/tools/dcolumn.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/dcolumn.pdf b/macros/latex/required/tools/dcolumn.pdf Binary files differindex 95ad0bd449..bf7018beec 100644 --- a/macros/latex/required/tools/dcolumn.pdf +++ b/macros/latex/required/tools/dcolumn.pdf diff --git a/macros/latex/required/tools/delarray.dtx b/macros/latex/required/tools/delarray.dtx index 86a1a6203f..61d40b5c74 100644 --- a/macros/latex/required/tools/delarray.dtx +++ b/macros/latex/required/tools/delarray.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/delarray.pdf b/macros/latex/required/tools/delarray.pdf Binary files differindex dee83d0727..9a8d864bed 100644 --- a/macros/latex/required/tools/delarray.pdf +++ b/macros/latex/required/tools/delarray.pdf diff --git a/macros/latex/required/tools/enumerate.dtx b/macros/latex/required/tools/enumerate.dtx index 2818a73a09..c3889a9157 100644 --- a/macros/latex/required/tools/enumerate.dtx +++ b/macros/latex/required/tools/enumerate.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/enumerate.pdf b/macros/latex/required/tools/enumerate.pdf Binary files differindex 3cfae0299a..b83f030d7c 100644 --- a/macros/latex/required/tools/enumerate.pdf +++ b/macros/latex/required/tools/enumerate.pdf diff --git a/macros/latex/required/tools/fileerr.dtx b/macros/latex/required/tools/fileerr.dtx index eef222bb6e..0e8eeb1ffb 100644 --- a/macros/latex/required/tools/fileerr.dtx +++ b/macros/latex/required/tools/fileerr.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/fileerr.pdf b/macros/latex/required/tools/fileerr.pdf Binary files differindex c9ead205ae..664b3c49b7 100644 --- a/macros/latex/required/tools/fileerr.pdf +++ b/macros/latex/required/tools/fileerr.pdf diff --git a/macros/latex/required/tools/fontsmpl.dtx b/macros/latex/required/tools/fontsmpl.dtx index 525065cde5..6e9835e20e 100644 --- a/macros/latex/required/tools/fontsmpl.dtx +++ b/macros/latex/required/tools/fontsmpl.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/fontsmpl.pdf b/macros/latex/required/tools/fontsmpl.pdf Binary files differindex 400fc3cdb4..ba164a7eb0 100644 --- a/macros/latex/required/tools/fontsmpl.pdf +++ b/macros/latex/required/tools/fontsmpl.pdf diff --git a/macros/latex/required/tools/ftnright.dtx b/macros/latex/required/tools/ftnright.dtx index 663fa304a9..a3826376db 100644 --- a/macros/latex/required/tools/ftnright.dtx +++ b/macros/latex/required/tools/ftnright.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/ftnright.pdf b/macros/latex/required/tools/ftnright.pdf Binary files differindex b1ed43548d..12a83de3db 100644 --- a/macros/latex/required/tools/ftnright.pdf +++ b/macros/latex/required/tools/ftnright.pdf diff --git a/macros/latex/required/tools/hhline.dtx b/macros/latex/required/tools/hhline.dtx index 49ac1ae208..b2d833d965 100644 --- a/macros/latex/required/tools/hhline.dtx +++ b/macros/latex/required/tools/hhline.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/hhline.pdf b/macros/latex/required/tools/hhline.pdf Binary files differindex 9d389f0c7f..488b653aab 100644 --- a/macros/latex/required/tools/hhline.pdf +++ b/macros/latex/required/tools/hhline.pdf diff --git a/macros/latex/required/tools/indentfirst.dtx b/macros/latex/required/tools/indentfirst.dtx index 2314db1c70..9bbe1871e1 100644 --- a/macros/latex/required/tools/indentfirst.dtx +++ b/macros/latex/required/tools/indentfirst.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/indentfirst.pdf b/macros/latex/required/tools/indentfirst.pdf Binary files differindex 2aa538c345..b484dd82c9 100644 --- a/macros/latex/required/tools/indentfirst.pdf +++ b/macros/latex/required/tools/indentfirst.pdf diff --git a/macros/latex/required/tools/l3sys-query.dtx b/macros/latex/required/tools/l3sys-query.dtx new file mode 100644 index 0000000000..3cba5da4a6 --- /dev/null +++ b/macros/latex/required/tools/l3sys-query.dtx @@ -0,0 +1,545 @@ +% \iffalse +%% Source File: l3sys-query.dtx +%% Copyright (C) 2024 +%% +%% The LaTeX Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file may be distributed under the terms of the LPPL. +%% See README for details. +% +%<*dtx> + \ProvidesFile{l3sys-query.dtx} +%</dtx> +%<package>\ProvidesPackage{l3sys-query} +%<driver> \ProvidesFile{l3sys-query.drv} +% \fi +% \ProvidesFile{l3sys-query.dtx} + [2024-03-28 v1.0a LaTeX2e interface for l3sys file queries] +% +% \iffalse +%<*driver> +\documentclass{l3doc}%{ltxdoc} +\begin{document} +\DocInput{l3sys-query.dtx} +\end{document} +%</driver> +% \fi +% +% \GetFileInfo{l3sys-query.dtx} +% +% \title{\LaTeX\ document interface to the \pkg{l3sys-query} script: +% System queries for LaTeX using Lua\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{\LaTeX\ project} +% \date{\filedate} +% +% +% \maketitle +% +% \tableofcontents +% +% \section{Introduction} +% +% \TeX{} engines provide only very limited access to information about the system +% they are used on: using primitives, one can for example get the size of a single +% file, but not a list of files in a given location. For most documents, this is +% not an issue as they are self-contained. However, for cases where +% \enquote{dynamic} construction of parts of a document is needed based on file +% lists or other system-dependent data, methods to obtain this from (restricted) +% shell escape are desirable. +% +% Security considerations mean that directly querying the system shell is +% problematic for general use. Instead, \emph{restricted} shell escape may be used +% to get many details, provided a suitable tool is available to provide the +% information in a platform-neutral and security-conscious way. The Java program +% \texttt{texosquery}, written by Nicola Talbot, has been available for a number +% of years to provide this facility. As well as file system insight, +% \texttt{texosquery} also provides for example locale data and other system +% information. However, the requirement for Java means that the script is not +% automatically usable when a \TeX{} system is installed. +% +% The \LaTeX{} team have therefore provided a Lua-based script, +% \texttt{l3sys-query}, which conforms to the security requirements of \TeX{} Live +% using Lua to obtain the system information. This means that it can be used +% \enquote{out of the box} across platforms. The facilities provided by +% \texttt{l3sys-query} are more limited than \texttt{texosquery}, partly as some +% information is available in modern \TeX{} systems using primitives, and partly +% as the aim of \texttt{l3sys-query} is to provide information where there are +% defined use cases. Requests for additional data interfaces are welcome. +% +% This package provides a document level \textit{Key-Value} interface +% to The \texttt{l3sys-query} functionality, although as a convenience +% it also summarizes the documentation for the L3 programming +% interface layer (prvided by the \pkg{l3sys} module of +% \pkg{l3kernel}, and of the command line Lua script +% \texttt{l3sys-query} which is distributed separately and provides +% the underlying functionality. +% +% +% +% \section{The document level key-value interface\label{sec:kv}} +% +% This provides an interface to \texttt{l3sys-query} based on +% \pkg{l3keys} that allows the options to be specified and checked +% individually. Internally the supplied key values are used to build +% up the arguments to the commands described above in the L3 +% programming layer commands described in section~\ref{sec:expl3} +% +% Results containing path separators \emph{always} +% use~|/|, irrespective of the platform in use. +% +% +% \begin{function} +% {\QueryWorkingDirectory} +% \begin{syntax} +% \cs{QueryWorkingDirectory} \Arg{result cmd} +% \end{syntax} +% Defines supplied command \meta{result cmd} to hold +% the absolute path to the current working directory of the +% \TeX\ system. +% This is the directory (folder) from which \TeX\ was started, so usually +% the location of the main document file. +% \end{function} +% +% \begin{function} +% {\QueryFiles, \QueryFilesTF} +% \begin{syntax} +% \cs{QueryFiles} \oarg{options} \Arg{spec} \Arg{function} +% \cs{QueryFilesTF} \oarg{options} \Arg{spec} \Arg{function} \Arg{pre code} \Arg{empty list code} +% \end{syntax} +% This generates a file list based on the \meta{spec} and \meta{options}. +% The command then applies \meta{function} to each item in the sequence of filenames. +% The \meta{function} should be a macro body which will be passed the file path as |#1|. +% +% The TF version executes the T (\meta{pre code}) argument before iterating over the list +% and the F (\meta{empty list code}) argument if the list is empty. +% \end{function} +% +% Note that this interface in mapping directly over the sequence of +% filenames does not allow some uses which are provided by the +% programming interface described in the following section, which allows +% the sequence to be manipulated before being used. +% +% The defined keys map very closely to the options of the +% \texttt{l3sys-query} command which is described in +% section~\ref{sec:lua}. +% +% \begin{itemize} +% \item +% The keys \texttt{recursive}, \texttt{ignore-case}, \texttt{reverse}, \texttt{pattern} +% take no values and map directly to the command line options of the same name. +% +% \item +% The key \texttt{sort} accepts the values \texttt{date} and \texttt{name}. +% +% \item +% The key \texttt{type} accepts \texttt{d} or \texttt{f}. +% +% \item +% The key \texttt{exclude} accepts a glob (or Lua pattern) matching +% files to be excluded. The package arranges that the quoting of the +% argument is automatically added if unrestricted shell escape is +% enabled. +% +% \end{itemize} +% +% Within the main \meta{spec} argument, and the value of the \texttt{exclude} key, +% the following characters may need special handling. +% |~| may be used (which \texttt{kpathsea} uses to denote the users home directory). +% |\%|, or at the top level |%|, may be used to produce a literal |%| +% which may be especially useful if the \texttt{pattern} key is used +% as \% is the escape character in Lua patterns. +% +% \subsection{Examples\label{sec:examples2e}} +% +% \begin{itemize} +% \item +% Include every |png| file in the current directory. +% \begin{verbatim} +% \QueryFiles{*.png}{\includegraphics{#1}\par} +% \end{verbatim} +% +% \item +% Input every \TeX\ file with a filename matching \texttt{chapter[0-9].tex}. +% \begin{verbatim} +% \QueryFiles[pattern]{chapter%d.*%.tex}{\input{#1}} +% \end{verbatim} +% \end{itemize} +% +% \section{The L3 programming layer interface\label{sec:expl3}} +% +% \begin{function} +% {\sys_get_query:nN, \sys_get_query:nnN, \sys_get_query:nnnN} +% \begin{syntax} +% \cs{sys_get_query:nN} \Arg{cmd} \Arg{tl var} +% \cs{sys_get_query:nnN} \Arg{cmd} \Arg{spec} \Arg{tl var} +% \cs{sys_get_query:nnnN} \Arg{cmd} \Arg{options} \Arg{spec} \Arg{tl var} +% \end{syntax} +% Sets the \meta{tl var} to the information returned by the +% \texttt{l3sys-query} \meta{cmd}, potentially supplying the \meta{options} +% and \meta{spec} to the query call. The valid \meta{cmd} names are at present +% \begin{itemize} +% \item \texttt{pwd} Returns the absolute path to the current working directory +% \item \texttt{ls} Returns a directory listing, using the \meta{spec} to +% select files and applying the \meta{options} if given +% \end{itemize} +% The \meta{spec} should be a file glob and will automatically be passed to +% the script without shell expansion. +% \end{function} +% +% \begin{function} +% {\sys_split_query:nN, \sys_split_query:nnN, \sys_split_query:nnnN} +% \begin{syntax} +% \cs{sys_split_query:nN} \Arg{cmd} \Arg{seq} +% \cs{sys_split_query:nnN} \Arg{cmd} \Arg{spec} \Arg{seq} +% \cs{sys_split_query:nnnN} \Arg{cmd} \Arg{options} \Arg{spec} \Arg{seq} +% \end{syntax} +% Works as described for \cs{sys_get_query:nnnN}, but sets the \meta{seq} +% to contain one entry for each line returned by \texttt{l3sys-query}. +% \end{function} +% +% \section{The \texttt{l3sys-query} Lua script\label{sec:lua}} +% \subsection{The command line interface} +% +% The command line interface to +% \begin{center} +% \ttfamily +% l3sys-query \meta{cmd} [\meta{option(s)}] [\meta{args}] +% \end{center} +% where \texttt{\meta{cmd}} can be one of the following: +% \begin{itemize}[noitemsep]\ttfamily +% \item ls +% \item ls \meta{args} +% \item pwd +% \end{itemize} +% The \meta{cmd} are described below. The result of the \meta{cmd} will be printed +% to the terminal in an interactive run; in normal usage, this will be piped to +% the calling \TeX{} process. Results containing path separators \emph{always} +% use~|/|, irrespective of the platform in use. +% +% As well as these targets, the script recognizes the options +% \begin{itemize} +% \item |--exclude| Specification for directory entries to exclude +% \item |--ignore-case| Ignores case when sorting directory listings +% \item |--pattern| (|-p|) Treat the \meta{args} as Lua patterns rather +% than converting from wildcards +% \item |--recursive| (|-r|) Enables recursive searching during directory +% listings +% \item |--reverse| Causes sorting to go from highest to lowest rather +% than lowest to highest +% \item |--sort| Sets the method used to sort entries returned by |ls| +% \item |--type| Selects the type of entry returned by |ls| +% \end{itemize} +% The action of these options on the appropriate \meta{cmd(s)} is detailed below. +% +% \subsubsection{\texttt{ls [\meta{args}]}} +% +% Lists the contents of one or more directories, in a manner somewhat reminiscent +% of the Unix command |ls| or the Windows command |dir|. The exact nature of the +% output will depend on the \meta{args}, if given, along with the prevailing +% options. Note that the options names are inspired by ideas from the Unix +% commands |ls| and |find| as well as the Windows command |dir|: they therefore do +% not map directly to those of any one of the command line tools that they +% somewhat mirror. +% +% When no \meta{args} are given, all entries in the current directory will be +% listed, one per line in the output. This will include both files and +% subdirectories. Each entry will include a path relative to the current +% directory: for files \emph{in} the current directory, this will be |./|. The +% order of results will be determined by the underlying operating system process: +% unless requested \emph{via} an option, no sorting takes place. +% +% As standard, the \meta{args} are treated as a file/path name potentially +% including |?| and |*| as wildcards, for example |*.png| or |file?.txt|. +% \begin{verbatim} +% l3sys-query ls '*.png' +% \end{verbatim} +% Some care is needed in preventing expansion of such wildcards by the shell or +% \texttt{texlua} process: these are detailed in Section~\ref{sec:wildcard}. In +% this section, |'| is used to indicate a character being used to suppress +% expansion: this is for example normal on macOS and Linux. +% +% Removal of entries from the listing can be achieved using the |--exclude| +% option, which should be given with a \meta{xarg}, for example +% \begin{verbatim} +% l3sys-query ls --exclude '*.bak' 'graphics/*' +% \end{verbatim} +% Directory entries starting |.| are traditionally hidden on Linux and macOS +% systems: these \enquote{dot} entries are excluded from the output of +% \texttt{l3sys-query}. The entries |.| and |..| for the current and parent +% directory are also excluded from the results returned by \texttt{l3sys-query} as +% they can always be assumed. +% +% For more complex matching, the \meta{args} can be treated as a Lua pattern using +% the |--pattern| (|-p|) option; this also applies to the \meta{xarg} argument to +% the |--exclude| option. For example, the equivalent to wildcard |*.png| could be +% obtained using +% \begin{verbatim} +% l3sys-query ls --pattern '^.*%.png$' +% \end{verbatim} +% +% The results returned by |ls| can be sorted using the |--sort| option. This can +% be set to |none| (use the order from the file system: the default), |name| (sort +% by file name) or |date| (sort by date last modified). The sorting order can be +% reversed using |--reverse|. Sorting normally takes account of case: this can be +% suppressed with the |--ignore-case| option. +% +% The listing can be filtered based on the type of entry using the |--type| +% option. This takes a string argument, one of |d| (directory) or |f| (file). +% +% As standard, only the path specified as part of the \meta{args} is queried. +% However, if the |--recursive| (|-r|) option is set, the query is applied within +% all subdirectories. Subdirectories starting with~|.| (macOS and Linux hidden) +% are excluded from recursion. +% +% For security reasons, only paths within the current working directory can be +% queried, thus for example |graphics/*.png| will list all |png| files in the +% |graphics| subdirectory, but |../graphics/*.png| will yield no output. +% +% \subsubsection{\texttt{pwd}} +% +% Returns the current working directory from which \texttt{l3sys-query} is run. +% From within a \TeX{} run, this will (usually) be the directory containing the +% main file, assuming a command such as +% \begin{verbatim} +% pdflatex main.tex +% \end{verbatim} +% The \texttt{pwd} command is unaffected by any options. +% +% \subsection{Spaces in arguments} +% +% Since \texttt{l3sys-query} is intended primarily for use with restricted shell +% escape calls from \TeX{} processes, handling of spaces is unusual. It is not +% possible to quote spaces in such a call, so for example whilst +% \begin{verbatim} +% l3sys-query ls "foo *" +% \end{verbatim} +% does work from the command prompt to find all files with names starting +% \verb*|foo |, it would not work \emph{via} restricted shell escape. To +% circumvent this, \texttt{l3sys-query} will collect all command line arguments +% after any \meta{options}, and combine these as a space-separated \meta{args}, +% for example allowing +% \begin{verbatim} +% l3sys-query ls foo '*' +% \end{verbatim} +% to achieve the same result as the first example. The result is that the +% \meta{args} will only every be interpreted by \texttt{l3sys-query} as a single +% argument. It also means that spaces cannot be used at the start or end of the +% argument, nor can multiple spaces appear between non-space arguments. +% +% \subsection{Wildcard expansion handling\label{sec:wildcard}} +% +% The handling of wildcards needs some further comment for those using +% \texttt{l3sys-query} from the command line: the \pkg{expl3} interface described +% in Section~\ref{sec:expl3} handles this aspect automatically for the user. +% +% On macOS and Linux, the shell normally expands globs, which include the +% wildcards |*| and |?|, before passing arguments to the appropriate command. +% This can be suppressed by surrounding the argument with |'| characters, hence +% the formulation +% \begin{verbatim} +% l3sys-query ls '*.png' +% \end{verbatim} +% earlier. +% +% On Windows, the shell does no expansion, and thus arguments are passed as-is to +% the relevant command. As such, |'| has no special meaning here. However, to +% allow quoting of wildcards from the shell in a platform-neutral manner, +% \texttt{l3sys-query} will strip exactly one set of |'| characters around each +% argument before further processing. +% +% It is not possible to use |"| quotes at all in the argument passed to +% \texttt{l3sys-query} from \TeX{}, as the \TeX{} system removes all |"| in +% |\input| while handling space quoting. +% +% Restricted shell escape prevents shell expansion of wildcards entirely. On +% non-Windows systems, it does this by ensuring that each argument is |'| quoted +% to ensure further expansion. Thus a \TeX{} call such as +% \begin{verbatim} +% \input|"l3sys-query ls '*.png'" +% \end{verbatim} +% will work if |--shell-escape| is used as the argument is passed directly to the +% shell, but in restricted shell escape will give an error such as: +% \begin{verbatim} +% ! I can't find file `"|l3sys-query ls '*.png'"'. +% \end{verbatim} +% The \LaTeX{} interfaces described above adjust the quoting used depending on the +% |shell-escape| status. +% +% +% \MaybeStop{} +% +% \section{The \LaTeXe\ package implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOn +%<@@=queryfiles> +% \end{macrocode} +% +% The package should eventually work in restricted shell escape but will do +% nothing useful if the process was started with |--no-shell-escape|. +% \begin{macrocode} +\sys_if_shell:F{ + \PackageWarningNoLine{l3sys-query} + {Shell ~Escape ~is ~disabled.\MessageBreak All ~queries ~will ~return ~empty ~results} + } +% \end{macrocode} +% +% \subsection{\cs{QueryWorkingDirectory}} +% |\QueryWorkingDirectory| is a direct call to the |pwd| command provided by \texttt{l3sys-query}. +% \begin{macrocode} +\NewDocumentCommand\QueryWorkingDirectory {m} { + \sys_get_query:nN {pwd} #1 +} +% \end{macrocode} +% +% \subsection{\cs{QueryFiles} and \cs{QueryFilesTF}} +% +% The declarations of these commands are done in two steps to allow catcode chanes +% before the arguments are read. This allows the use of |%| and |^^| in patterns +% at least if the command is not nested in another command argument. (|\%| may be used +% to generate |%| in all cases). +% +% Variables for saving the current definition of |\%| and |~|. +% \begin{macrocode} +\tl_new:N\l_query_percent_tl +\tl_new:N\l_query_tilde_tl +% \end{macrocode} +% +% Allow |%| and |^^| at the top level. +% \begin{macrocode} +\NewDocumentCommand\QueryFiles {} { + \group_begin: + \char_set_catcode_other:N \% + \char_set_catcode_other:N \^ + \QueryFiles_inner + } +% \end{macrocode} +% +% \begin{macrocode} +\char_set_catcode_active:N \~ +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand\QueryFiles_inner {O{}m}{ + \group_end: + \tl_set:Nn\l_tmpa_tl{} + \cs_set_eq:NN \l_query_percent_tl \% + \cs_set_eq:NN \% \c_percent_str + \cs_set_eq:NN \l_query_tilde_tl ~ + \cs_set_eq:NN ~ \c_tilde_str + \keys_set:nn{QueryFiles}{#1} + \exp_args:NnV\sys_split_query:nnnN {ls} \l_tmpa_tl {#2} \l_tmpa_seq + \cs_set_eq:NN \% \l_query_percent_tl + \cs_set_eq:NN ~ \l_query_tilde_tl + \seq_map_inline:Nn\l_tmpa_seq +} +% \end{macrocode} +% +% This duplicates rather than shares code so as to read the function +% and TF arguments with normal catcode regime. +% (This could probably be optimised.) +% \begin{macrocode} +\NewDocumentCommand\QueryFilesTF {} { + \group_begin: + \char_set_catcode_other:N \% + \QueryFilesTF_inner + } +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand\QueryFilesTF_inner {O{}m}{ + \group_end: + \tl_set:Nn\l_tmpa_tl{} + \cs_set_eq:NN \l_query_percent_tl \% + \cs_set_eq:NN \% \c_percent_str + \cs_set_eq:NN \l_query_tilde_tl ~ + \cs_set_eq:NN ~ \c_tilde_str + \keys_set:nn{QueryFiles}{#1} + \exp_args:NnV\sys_split_query:nnnN {ls} \l_tmpa_tl {#2} \l_tmpa_seq + \cs_set_eq:NN \% \l_query_percent_tl + \cs_set_eq:NN ~ \l_query_tilde_tl + \seq_if_empty:NTF \l_tmpa_seq \use_iii:nnn \__queryfiles_aux:nnn +} +% \end{macrocode} +% +% \begin{macrocode} +\char_set_catcode_space:N \~ +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Npn \__queryfiles_aux:nnn #1#2#3 { + #2 + \seq_map_inline:Nn\l_tmpa_seq {#1} + } +% \end{macrocode} +% +% Defining the keys. Most take no value and simply add a \texttt{l3sys-query} \texttt{-{}-} +% option to the command linebeing constructed. +% \begin{macrocode} +\keys_define:nn {QueryFiles} { +% \end{macrocode} +% +% \begin{macrocode} +recursive .code:n =\tl_put_right:Nn \l_tmpa_tl {--recursive ~ } , +recursive .value_forbidden:n = true , +% \end{macrocode} +% +% \begin{macrocode} +ignore-case .code:n =\tl_put_right:Nn \l_tmpa_tl {--ignore-case ~ } , +ignore-case .value_forbidden:n = true , +% \end{macrocode} +% +% \begin{macrocode} +reverse .code:n =\tl_put_right:Nn \l_tmpa_tl {--reverse ~ } , +reverse .value_forbidden:n = true , +% \end{macrocode} +% +% \begin{macrocode} +exclude .code:n =\tl_put_right:Ne \l_tmpa_tl { + --exclude ~ + \sys_if_shell_restricted:F' + \exp_not:n{#1} + \sys_if_shell_restricted:F' + ~ } , +exclude .value_required:n = true , +% \end{macrocode} +% +% The |type| key checks the supplied value is valid |d| for directories +% or |f| for files The default behaviour lists both. +% \begin{macrocode} +type .choices:nn = {d,f} + {\tl_put_right:Nn \l_tmpa_tl {--type ~ #1 ~ }} , +% \end{macrocode} +% +% The |sort| key checks the supplied value is valid |date| or |name|. +% \begin{macrocode} +sort .choices:nn = {date,name} +{\tl_put_right:Nn \l_tmpa_tl {--sort ~ #1 ~ }} , +% \end{macrocode} +% +% \begin{macrocode} +pattern .code:n =\tl_put_right:Nn \l_tmpa_tl {--pattern ~ } , +pattern .value_forbidden:n = true , +% \end{macrocode} +% +% \begin{macrocode} +} +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% +% \begin{macrocode} +%</package> +% \end{macrocode} +% +% \Finale +% diff --git a/macros/latex/required/tools/l3sys-query.ins b/macros/latex/required/tools/l3sys-query.ins new file mode 100644 index 0000000000..163eec0058 --- /dev/null +++ b/macros/latex/required/tools/l3sys-query.ins @@ -0,0 +1,76 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright (C) 1993-2024 +%% The LaTeX Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file is part of the Standard LaTeX `Tools Bundle'. +%% ------------------------------------------------------- +%% +%% 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 2005/12/01 or later. +%% +%% As this file contains legal notices, it is NOT PERMITTED to modify +%% this file in any way that the legal information placed into +%% generated files is changed (i.e., the files generated when the +%% original file is executed). This restriction does not apply if +%% (parts of) the content is reused in a different WORK producing its +%% own generated files. +%% +%% The list of all files belonging to the `Tools Bundle' is +%% given in the file `manifest.txt'. +%% +%% +%% --------------- start of docstrip commands ------------------ +%% +\input docstrip + +\keepsilent + +\usedir{tex/latex/tools} + +\preamble + +This is a generated file. + +The source is maintained by the LaTeX Project team and bug +reports for it can be opened at https://latex-project.org/bugs/ +(but please observe conditions on bug reports sent to that address!) + +Copyright (C) 1993-2024 +The LaTeX Project and any individual authors listed elsewhere +in this file. + +This file was generated from file(s) of the Standard LaTeX `Tools Bundle'. +-------------------------------------------------------------------------- + +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 2005/12/01 or later. + +This file may only be distributed together with a copy of the LaTeX +`Tools Bundle'. You may however distribute the LaTeX `Tools Bundle' +without such generated files. + +The list of all files belonging to the LaTeX `Tools Bundle' is +given in the file `manifest.txt'. + +\endpreamble + +\keepsilent + +\generate{\file{l3sys-query.sty}{\from{l3sys-query.dtx}{package}}} + +\endbatchfile diff --git a/macros/latex/required/tools/l3sys-query.pdf b/macros/latex/required/tools/l3sys-query.pdf Binary files differnew file mode 100644 index 0000000000..5ec3ca9511 --- /dev/null +++ b/macros/latex/required/tools/l3sys-query.pdf diff --git a/macros/latex/required/tools/layout.dtx b/macros/latex/required/tools/layout.dtx index 2798bd4f60..a2fc87a6a5 100644 --- a/macros/latex/required/tools/layout.dtx +++ b/macros/latex/required/tools/layout.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/layout.pdf b/macros/latex/required/tools/layout.pdf Binary files differindex 30ba99447f..634b7320a4 100644 --- a/macros/latex/required/tools/layout.pdf +++ b/macros/latex/required/tools/layout.pdf diff --git a/macros/latex/required/tools/longtable-2020-01-07.sty b/macros/latex/required/tools/longtable-2020-01-07.sty index f79c691e10..fc7c3f4290 100644 --- a/macros/latex/required/tools/longtable-2020-01-07.sty +++ b/macros/latex/required/tools/longtable-2020-01-07.sty @@ -1,4 +1,8 @@ %% +%% This is an old release of `longtable.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% %% This is file `longtable.sty', %% generated with the docstrip utility. %% diff --git a/macros/latex/required/tools/longtable.dtx b/macros/latex/required/tools/longtable.dtx index 2a61ab0c87..cc3a939e7a 100644 --- a/macros/latex/required/tools/longtable.dtx +++ b/macros/latex/required/tools/longtable.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -27,8 +27,9 @@ \ProvidesFile{longtable.dtx} %</dtx> %<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01] -%<package>\providecommand\DeclareRelease[3]{} -%<package>\providecommand\DeclareCurrentRelease[2]{} +%<package> +% Try the 2020 version for any rollback before that date: +%<package>\DeclareRelease{}{1994-06-01}{longtable-2020-01-07.sty} %<package> %<package>\DeclareRelease{v4.13}{2020-01-02}{longtable-2020-01-07.sty} %<package>\DeclareCurrentRelease{}{2020-02-07} @@ -37,7 +38,7 @@ %<driver> \ProvidesFile{longtable.drv} % \fi % \ProvidesFile{longtable.dtx} - [2023-11-01 v4.19 Multi-page Table package (DPC)] + [2024-04-26 v4.20 Multi-page Table package (DPC)] % % \iffalse %<*driver> @@ -1048,6 +1049,14 @@ \if@twocolumn \LT@err{longtable not in 1-column mode}\@ehc \fi +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/vmode/begin}% +% \end{macrocode} +% +% \begin{macrocode} \begingroup % \end{macrocode} % Check for an optional argument. @@ -1056,7 +1065,14 @@ % \end{macrocode} % \end{macro} % +% +% % \begin{macro}{\LT@array} +% \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn +% \end{macrocode} +% % Start setting the alignment. % Based on "\@array" from the \LaTeX\ kernel % and the \package{array} package. @@ -1066,7 +1082,43 @@ % so that "\caption" works correctly. % \begin{macrocode} \def\LT@array[#1]#2{% - \refstepcounter{table}\stepcounter{LT@tables}% +% \end{macrocode} +% +% With respect to tagging we have a complicated situation with +% longtable. When at the begin the \cs{endhead}, +% \cs{endfirsthead}, \cs{endfoot} and \cs{endlastfoot} are used to +% setup head and foot they create each a structure subtree with one or +% more rows. From these structures we want to keep at most two (head +% and foot) and move the foot to the end of the table. When the head +% and foot boxes are (re)inserted on following pages we want to mark +% them up as artifact with the exception of the head at the begin and +% the foot box at the end. +% +% TODO: When a line is killed the structure subtree is there already +% too and must be removed. If hard to do, then maybe at first warn if the +% construction is used. +% +% \cs{LT@array} is executed in a group, so we can disable para-tagging here. +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/init} + \@kernel@refstepcounter{table}\stepcounter{LT@tables} +% \end{macrocode} +% The target is created rather late and a \cs{label} can come earlier, +% so we have to define \cs{@currentHref} explicitly. We can't currently +% assume that \cs{theHtable} is defined always. +% \begin{macrocode} + \tl_gset:Ne \@currentHref {table.\cs_if_exist_use:N\theHtable} +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_gzero_row_count: +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/longtable/init} % \end{macrocode} % Set up the glue around the table if an optional argument given. % \begin{macrocode} @@ -1101,17 +1153,18 @@ % here so that you can load the \package{array} package before or after % \package{longtable}. % \begin{macrocode} - \let\LT@@tabarray\@tabarray - \let\LT@@hl\hline + \let\LT@@@@tabarray\@tabarray + \let\LT@@@@hl\hline \def\@tabarray{% - \let\hline\LT@@hl + \let\hline\LT@@@@hl % \end{macrocode} %\begin{verbatim} % \let\multicolumn\LT@mcol %\end{verbatim} % \begin{macrocode} - \LT@@tabarray}% - \let\\\LT@tabularcr\let\tabularnewline\\% + \LT@@@@tabarray}% + \let\\\LT@tabularcr + \let\tabularnewline\\% \def\newpage{\noalign{\break}}% % \end{macrocode} % \changes{v4.05}{1996/11/12} @@ -1128,8 +1181,8 @@ % \end{macrocode} % % \changes{v4.08}{1998/01/20} -% {Move \cs{@endpbox} definition earlier and define \cs{@@endpbox} -% and \cs{@@startpbox} for non-array case. tools/2736} +% {Move \cs{@endpbox} definition earlier and define \cs{@@@@endpbox} +% and \cs{@@@@startpbox} for non-array case. tools/2736} % \begin{macrocode} \let\@endpbox\LT@endpbox % \end{macrocode} @@ -1142,8 +1195,8 @@ \let\@acol\@tabacol \let\@classz\@tabclassz \let\@classiv\@tabclassiv \def\@startpbox{\vtop\LT@startpbox}% - \let\@@startpbox\@startpbox - \let\@@endpbox\@endpbox + \let\@@@@startpbox\@startpbox + \let\@@@@endpbox\@endpbox \let\LT@LL@FM@cr\@tabularcr \else % \end{macrocode} @@ -1172,6 +1225,11 @@ \begingroup \@mkpream{#2}% % \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_count_table_cols: +% \end{macrocode} % We need to rename "\@preamble" here as F.M.'s scheme uses % "\global", and we may need to nest "\@mkpream", eg for % "\multicolumn" @@ -1180,6 +1238,11 @@ % \begin{macrocode} \xdef\LT@bchunk{% % \end{macrocode} +% We aren't inside any row when a chunk starts. +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_inbetween_rows: +% \end{macrocode} % \changes{v4.00}{1996/04/08} % {(DK) Increment Chunk counter} % \begin{macrocode} @@ -1205,7 +1268,21 @@ % \begin{macrocode} \tabskip\LTleft \noexpand\halign to\hsize\bgroup % \tabskip\LTleft\halign to\hsize\bgroup - \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}% + \tabskip\z@ \@arstrut +% \end{macrocode} +% Insert the tagging socket to start the row and initialize the cell +% data for the row. +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/row/begin}% +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_init_cell_data_for_row: +% \end{macrocode} +% \begin{macrocode} + \@preamble \tabskip\LTright \cr}% \endgroup % \end{macrocode} % Find out how many columns we have (store in "\LT@cols"). @@ -1220,11 +1297,57 @@ % A few more internal commands for \env{longtable}. % \begin{macrocode} \m@th\let\par\@empty - \everycr{}\lineskip\z@\baselineskip\z@ +% \end{macrocode} +% Tagging socket and conditional +% \begin{macrocode} + \everycr{% + \noalign{% +% \end{macrocode} +% In \pkg{longtable} we have a bunch of extra \cs{cr}s that are +% executed whenever a chunk ends. In that case they should not +% increment the main row counter, sigh. +% +% TODO: At the moment this tracing still exposes the internal row counter! +% \begin{macrocode} + \@@_trace:n {--longtable-->~chunk~row:~ \the\LT@rows \space + row:~ \the\g_@@_row_int \space + column:~ \the\g_@@_col_int + } +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \tbl_if_row_was_started:T + { + \UseTaggingSocket{tbl/row/end} +% \end{macrocode} +% The next setting prevents any of the additional \cs{cr}s at the end of the +% chunk to add another /TR. Then once we really start a new chunk +% it gets incremented so\ldots +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_inbetween_rows: + } +% \end{macrocode} +% And for the same reason such \cs{cr}s should not increment the +% main row counter (but it has to be incremented after the preamble +% of a chunk), so here we test against \cs{LT@rows} which is +% \cs{LTchunksize} at the end of a chunk. +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \int_compare:nNnT \LT@rows < \LTchunksize + { \tbl_gincr_row_count: } % next is row about to start + }% + }% +% \end{macrocode} +% \begin{macrocode} + \lineskip\z@\baselineskip\z@ % \end{macrocode} % Start the first chunk. % \begin{macrocode} \LT@bchunk} +\ExplSyntaxOff +%<@@=> % \end{macrocode} % \end{macro} % @@ -1251,6 +1374,11 @@ % force the page-breaker to wake up. The second "\endgraf" is there so % that "\pagetotal" is updated and so takes "\LTpre" into account. % \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn +% \end{macrocode} +% +% \begin{macrocode} \def\LT@start{% \let\LT@start\endgraf \endgraf\penalty\z@\vskip\LTpre\endgraf @@ -1334,7 +1462,7 @@ % \changes{v3.14}{1995/05/02} % {Set \cs{@colroom}, for tools/1584} % \begin{macrocode} - \global\@colroom\@colht + \global\@colroom\@colht % \end{macrocode} % If the foot is non empty, reduce the "\vsize" and "\@colroom" % accordingly. @@ -1342,24 +1470,46 @@ % {Rearrange vertical space tests for tools/3512 (floats on same page)} % \begin{macrocode} \ifvoid\LT@foot\else -% \advance\vsize-\ht\LT@foot \global\advance\vsize-\ht\LT@foot \global\advance\@colroom-\ht\LT@foot \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ \maxdepth\z@ \fi % \end{macrocode} +% +% \begin{macrocode} + \MakeLinkTarget{table} +% \end{macrocode} % Put the table head on the page, and then switch to the new output % routine. % \changes{v4.11}{2004/02/01} % {\cs{nobreak}, for tools/3484} % \begin{macrocode} \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/longtable/head} +% \end{macrocode} +% +% \begin{macrocode} \output{\LT@output}} +\ExplSyntaxOff +%<@@=> % \end{macrocode} % \end{macro} % +% +% +% % \begin{macro}{\endlongtable} +% +% \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn +% \end{macrocode} +% % Called by "\end{longtable}". % \begin{macrocode} \def\endlongtable{% @@ -1370,11 +1520,23 @@ % been shortened, or the table numbering has gone awry). In that case % we at least start collecting valid new information with the last % chunk of this table, by removing the width constraint. +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \tbl_crcr:n {endlongtable} +% \end{macrocode} +% % \changes{v4.01}{1996/04/11} % {(DPC) use \cs{noalign} to sneak in \cs{LT@entry@chop}} % \begin{macrocode} - \crcr \noalign{% +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/longtable/finalize} +% \end{macrocode} +% +% \begin{macrocode} \let\LT@entry\LT@entry@chop \xdef\LT@save@row{\LT@save@row}}% \LT@echunk @@ -1414,10 +1576,10 @@ % \changes{v4.04}{1996/05/24} % {Use \cs{LT@final@warn}} % \begin{macrocode} - \ifx\LT@save@row\LT@@save@row + \ifx\LT@save@row\LT@@@@save@row \else - \LT@warn{Column \@width s have changed\MessageBreak - in table \thetable}% + \LT@warn{Column~ widths~ have~ changed\MessageBreak + in~ table~ \thetable}% \LT@final@warn \fi % \end{macrocode} @@ -1449,7 +1611,15 @@ % \end{macrocode} % Footnotes. As done in the \package{multicol} package. % \begin{macrocode} - \ifvoid\footins\else\insert\footins{}\fi} + \ifvoid\footins\else\insert\footins{}\fi +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/vmode/end}% +} +\ExplSyntaxOff +%<@@=> % \end{macrocode} % \end{macro} % @@ -1518,6 +1688,10 @@ \protected\def\LT@tabularcr{% \relax\iffalse{\fi\ifnum0=`}\fi \@ifstar +% \end{macrocode} +% TODO: as we replace crcr later in one case, we probably have to +% implement some further logic there! +% \begin{macrocode} {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr \LT@t@bularcr}% {\LT@t@bularcr}} @@ -1544,8 +1718,13 @@ % \end{macrocode} % \end{macro} % +% +% +% % \begin{macro}{\LT@t@bularcr} % \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn \def\LT@t@bularcr{% % \end{macrocode} % Increment the counter, and do \env{tabular}'s "\\" or finish the @@ -1555,6 +1734,13 @@ % \begin{macrocode} \global\advance\LT@rows\@ne \ifnum\LT@rows=\LTchunksize +% \end{macrocode} +% At the end of the chunk \verb=\\= is doing something special and +% so we lose \verb=\tbl_count_missing_cells:n=. Below is about the +% right place to add it do this code branch. +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_count_missing_cells:n {echunk} \gdef\LT@setprevdepth{% \prevdepth\z@ \global\let\LT@setprevdepth\relax}% @@ -1563,6 +1749,8 @@ \ifnum0=`{}\fi \expandafter\LT@LL@FM@cr \fi} +\ExplSyntaxOff +%<@@=> % \end{macrocode} % \end{macro} % @@ -1943,7 +2131,9 @@ % This code is based on "\cline". Two copies of the line are produced, % as described above. % \begin{macrocode} -\def\LT@@hline{% +%<@@=tbl> +\ExplSyntaxOn +\def\LT@@@@hline{% \ifx\@let@token\hline \global\let\@gtempa\@gobble \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% @@ -1954,11 +2144,25 @@ \ifnum0=`{\fi}% \multispan\LT@cols \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr - \noalign{\LT@sep}% +% \end{macrocode} +% Don't update the row counter, or rather undo the update done in \cs{everycr}: +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \noalign{ + \tbl_gdecr_row_count: + \LT@sep} \multispan\LT@cols \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr - \noalign{\penalty\@M}% +% \end{macrocode} +% Same here. +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \noalign{ + \tbl_gdecr_row_count: + \penalty\@M} \@gtempa} +\ExplSyntaxOff +%<@@=> % \end{macrocode} % \end{macro} % @@ -2049,13 +2253,15 @@ % \begin{macro}{\LT@output} % Actually this is not so bad, with FM leading the way. % \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn \def\LT@output{% \ifnum\outputpenalty <-\@Mi \ifnum\outputpenalty > -\LT@end@pen % \end{macrocode} % If this was a float or a marginpar we complain. % \begin{macrocode} - \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \LT@err{floats~ and~ marginpars~ not~ allowed~ in~ a~ longtable}\@ehc \else % \end{macrocode} % We have reached the end of the table, on the scroll at least, @@ -2103,6 +2309,13 @@ % \begin{macrocode} \unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi % \end{macrocode} +% Handle foot box when tagging: +% +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/longtable/foot} +% \end{macrocode} +% % End of "\ifnum\outputpenalty > -\LT@end@pen". % \begin{macrocode} \fi @@ -2114,6 +2327,15 @@ % If we have not reached the end of the table, % \begin{macrocode} \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% +% \end{macrocode} +% +% Handle foot box when tagging: +% \changes{v4.19}{2023/12/16}{Support for tagged PDF} +% \begin{macrocode} + \UseTaggingSocket{tbl/longtable/foot} +% \end{macrocode} +% +% \begin{macrocode} \@makecol \@outputpage % \end{macrocode} @@ -2133,8 +2355,15 @@ % \begin{macrocode} \fi} % \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOff +%<@@=> +% \end{macrocode} % \end{macro} % +% +% % \subsection{Commands for the table head and foot} % % \begin{macro}{\LT@end@hd@ft} @@ -2142,20 +2371,86 @@ % box specified by "#1". Issue an error if the table has already % started. Then start a new chunk. % \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn \def\LT@end@hd@ft#1{% +% \end{macrocode} +% +% This command is used to store the head and foot boxes. +% We need to retrieve and store the row so that we can clean +% up the structure in the finalize code. +% +% To handle missing columns in the header we need this: +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_if_row_was_started:TF + { +% \end{macrocode} +% TODO: This is exposing internal counters, so it should be encapsulated +% in some interface command (but I'm not sure what that should be +% called, so not done yet. +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_count_missing_cells:n {head/foot} + \int_step_inline:nn + { \LT@rows + 1 } + { + \seq_gput_left:ce + {g_@@_\cs_to_str:N #1 _rows_seq } + { \int_eval:n {\g_@@_row_int + 1 - ##1 } } + } +% \end{macrocode} +% We also have to set the chunk rows to its max value before +% calling \cs{LTechunk} so that we don't get extra increments of +% the main row counter due to \cs{everycr}. +% \begin{macrocode} + \int_gset:Nn \LT@rows { \LTchunksize } + } +% \end{macrocode} + +% If we are still in column zero then we had an empty \cs{endhead} +% and so making any assignment, etc., would start a row --- something we don't want. +% To get out of this trap we run \cs{crcr} (which would normally +% come inside \cs{LT@echunk}. That will then trigger \cs{everycr} +% and update row counter unnecessarily, but now we have a defined state, so +% we can use \cs{noalign} to undo that. +% We also change \cs{LT@rows} so that further \cs{cr}s do not do +% any harm (as explained above. +% +% The \cs{crcr} inside \cs{LT@echunk} will be bypassed in that case +% as we have just executed a \cs{crcr} and are still in scanning modus for +% \cs{omit} or \cs{noalign}. +% \begin{macrocode} + { + \crcr + \noalign{ +% \end{macrocode} +% +% \changes{v4.19}{2023/12/16}{Managing cell indexes} +% \begin{macrocode} + \tbl_gdecr_row_count: % undo the increment + \int_gset:Nn \LT@rows { \LTchunksize } + } + } \LT@echunk % \end{macrocode} % Changed from "\relax" to "\endgraf" at V3.04, see "\LT@start". % \begin{macrocode} \ifx\LT@start\endgraf \LT@err - {Longtable head or foot not at start of table}% - {Increase LTchunksize}% + {Longtable~ head~ or~ foot~ not~ at~ start~ of~ table}% + {Increase~ LTchunksize}% \fi \setbox#1\box\z@ + \@@_trace:n {-->>~ Saving~\noexpand#1} \LT@get@widths \LT@bchunk} % \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOff +%<@@=> +% \end{macrocode} % \end{macro} % % \begin{macro}{\endfirsthead} @@ -2255,6 +2550,24 @@ % \end{macrocode} % \end{macro} % +% +% +% +% +% Some variables need for the tagging support. +% \begin{macrocode} +%<@@=tbl> +\ExplSyntaxOn + \seq_new:N \g_@@_LT@firsthead_rows_seq + \seq_new:N \g_@@_LT@head_rows_seq + \seq_new:N \g_@@_LT@lastfoot_rows_seq + \seq_new:N \g_@@_LT@foot_rows_seq +\ExplSyntaxOff +%<@@=> +% \end{macrocode} +% +% +% % \begin{macrocode} %</package> % \end{macrocode} diff --git a/macros/latex/required/tools/longtable.ins b/macros/latex/required/tools/longtable.ins index 5c3ad27063..60b7461571 100644 --- a/macros/latex/required/tools/longtable.ins +++ b/macros/latex/required/tools/longtable.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/longtable.pdf b/macros/latex/required/tools/longtable.pdf Binary files differindex 406dee682f..4a3b54a16f 100644 --- a/macros/latex/required/tools/longtable.pdf +++ b/macros/latex/required/tools/longtable.pdf diff --git a/macros/latex/required/tools/multicol-2017-04-11.sty b/macros/latex/required/tools/multicol-2017-04-11.sty index 9e346656bb..bdebc93db9 100644 --- a/macros/latex/required/tools/multicol-2017-04-11.sty +++ b/macros/latex/required/tools/multicol-2017-04-11.sty @@ -1,5 +1,7 @@ %% -%% This is an old release of `multicol.sty', +%% This is an old release of `multicol.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== %% %% The source is maintained by the LaTeX Project team and bug %% reports for it can be opened at http://latex-project.org/bugs.html diff --git a/macros/latex/required/tools/multicol-2019-10-01.sty b/macros/latex/required/tools/multicol-2019-10-01.sty index 221f62f68e..fc8bda5479 100644 --- a/macros/latex/required/tools/multicol-2019-10-01.sty +++ b/macros/latex/required/tools/multicol-2019-10-01.sty @@ -1,6 +1,7 @@ -%% This is a rollback file for multicol to the last version within release 2019-10-01 -%% ======================= %% +%% This is an old release of `multicol.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== %% %% This is file `multicol.sty', %% generated with the docstrip utility. @@ -101,14 +102,6 @@ %% %% Frank.Mittelbach@latex-project.org %% -\NeedsTeXFormat{LaTeX2e}[2018-04-01] - -\providecommand\DeclareRelease[3]{} -\providecommand\DeclareCurrentRelease[2]{} - -\DeclareRelease{}{2017-04-11}{multicol-2017-04-11.sty} -\DeclareCurrentRelease{}{2018-04-01} - \ProvidesPackage{multicol} [2019/12/09 v1.8y multicolumn formatting (FMi)] %% diff --git a/macros/latex/required/tools/multicol.dtx b/macros/latex/required/tools/multicol.dtx index 2676d03aa1..4d86448002 100644 --- a/macros/latex/required/tools/multicol.dtx +++ b/macros/latex/required/tools/multicol.dtx @@ -86,11 +86,10 @@ %<*dtx> \ProvidesFile{multicol.dtx} %</dtx> -%<package>\NeedsTeXFormat{LaTeX2e}[2018-04-01] -%<package> -%<package>\providecommand\DeclareRelease[3]{} -%<package>\providecommand\DeclareCurrentRelease[2]{} %<package> +% For any rollback before 2017 load the 2017 version and hope for the best: +%<package>\DeclareRelease{}{1994-06-01}{multicol-2017-04-11.sty} +% %<package>\DeclareRelease{}{2017-04-11}{multicol-2017-04-11.sty} %<package>\DeclareRelease{v1.8}{2019-10-01}{multicol-2019-10-01.sty} %<package>\DeclareCurrentRelease{}{2021-11-15} @@ -99,10 +98,10 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2023/03/30 v1.9f multicolumn formatting (FMi)] + [2024/05/23 v1.9h multicolumn formatting (FMi)] +% % % -%% % % \changes{v1.9c}{2021/11/30}{Added rollback to v1.8} % \changes{v1.5n}{1997/06/05}{Applied improvement of documentation, @@ -919,9 +918,22 @@ % And we don't show macro names in the margin. % \begin{macrocode} \setcounter{IndexColumns}{4} -\let\DescribeMacro\SpecialUsageIndex -\let\DescribeEnv\SpecialEnvIndex -\renewcommand\PrintMacroName[1]{} +% \end{macrocode} +% +% The following redefinitions have to be moved until after the +% preamble because version 3 of \pkg{doc} resets them after the +% premable (this is tmp, because \pkg{hypdoc} is not yet +% integrated, but as we all know, tmp solutions have a tendency to +% survive for a long time\ldots). +% \begin{macrocode} +\AddToHook{begindocument}{% + \let\DescribeMacro\SpecialUsageIndex + \let\DescribeEnv\SpecialEnvIndex + \renewcommand\PrintMacroName[1]{}% +} +% \end{macrocode} +% +% \begin{macrocode} \CodelineIndex %\DisableCrossrefs % Partial index \RecordChanges % Change log @@ -1082,7 +1094,7 @@ % better test for this situation. Otherwise, we will get a \TeX{} % stack overflow as this would generate a self-referencing definition. % \changes{v1.6e}{2004/02/14}{Avoid self-referencing definition of -% \cs{@footnotetext} (pr/3618)}. +% \cs{@footnotetext} (pr/3618)} % \begin{macrocode} \ifx\@footnotetext\mult@footnotetext \else @@ -2376,7 +2388,7 @@ % If |\raggedcolumns| is in force we add a |vfill| at the bottom by % unboxing the split box. % But we need to unbox anyway to ensure that at the end of the box -% we do not have unwanted space. This can sneak in in certain +% we do not have unwanted space. This can sneak in, in certain % situations, for example, if two lists follow each other and we % break between them. While such space is usually zero it still has % an effect because it hides depth of the last line in the column @@ -2925,7 +2937,11 @@ % We start by setting the kept marks by updating them with any % marks from this box. This has to be done \emph{before} we add a % penalty of $-10000$ to the top of the box, otherwise only an -% empty box will be considered. +% empty box will be considered. But even that is not enough: the box +% may contain \cs{columnbreak}s in which case doing some artifical +% splitting to get the marks out still fails to see all marks +% unless we take some special precaution in \cs{get@keptmarks} +% (which is now done). % \changes{v1.5h}{1994/08/26}{Get kept marks first} % \begin{macrocode} \get@keptmarks\mult@box @@ -3751,8 +3767,15 @@ % everything is split off. As a result |\splitfirstmark| and % |\splitbotmark| will contain the first and last mark in the box % respectively. +% +% Unfortunately, a simple \cs{vsplit} is not enough if the material +% contains forced breaks in that case we first have to get rid of +% those which is why we do this work in a separate macro that can +% call itself recursively. +% \changes{v1.9g}{2023/11/10}{Get rid of forced breaks for mark +% extraction (gh/1130)} % \begin{macrocode} - \setbox#1\vsplit#1to\maxdimen + \mc@get@all@box@marks #1% % \end{macrocode} % Therefore we can now set the kept marks which is a global % operation and afterwards close the group. This will restore the @@ -3773,6 +3796,29 @@ % \end{macro} % % +% \begin{macro}{\mc@get@all@box@marks} +% This macro splits a box to \cs{maxdimen} in order to get at the +% marks inside. If it turns out that we have a remainder after the +% split (e.g., if there was a \cs{columnbreak} in the material) we +% stitch the two parts together again (which omits the forced +% break) and recurse. Eventually, everything is split off and the +% split marks will then have the appropriate values. +% \changes{v1.9g}{2023/11/10}{Get rid of forced breaks for mark +% extraction (gh/1130)} +% \begin{macrocode} +\def\mc@get@all@box@marks #1{% + \setbox\@tempboxa\vsplit#1to\maxdimen + \ifvoid#1\else + \setbox#1\vbox{\unvbox\@tempboxa \unvbox#1}% + \mc@get@all@box@marks #1% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% +% % \begin{macro}{\set@keptmarks} % The macro |\set@keptmarks| is responsible for setting % |\kept@firstmark| and |\kept@botmark|, by checking the current diff --git a/macros/latex/required/tools/multicol.ins b/macros/latex/required/tools/multicol.ins index fa561e0bb1..7a7ef27d24 100644 --- a/macros/latex/required/tools/multicol.ins +++ b/macros/latex/required/tools/multicol.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/multicol.pdf b/macros/latex/required/tools/multicol.pdf Binary files differindex 0295b9ab59..b3d165838a 100644 --- a/macros/latex/required/tools/multicol.pdf +++ b/macros/latex/required/tools/multicol.pdf diff --git a/macros/latex/required/tools/rawfonts.dtx b/macros/latex/required/tools/rawfonts.dtx index 4b930f3ea7..3ffa2032c3 100644 --- a/macros/latex/required/tools/rawfonts.dtx +++ b/macros/latex/required/tools/rawfonts.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/rawfonts.pdf b/macros/latex/required/tools/rawfonts.pdf Binary files differindex 2371e70bd6..ab2b851ab6 100644 --- a/macros/latex/required/tools/rawfonts.pdf +++ b/macros/latex/required/tools/rawfonts.pdf diff --git a/macros/latex/required/tools/shellesc.dtx b/macros/latex/required/tools/shellesc.dtx index aa707fe550..8a556de922 100644 --- a/macros/latex/required/tools/shellesc.dtx +++ b/macros/latex/required/tools/shellesc.dtx @@ -1,6 +1,6 @@ % \iffalse %% Source File: shellesc.dtx -%% Copyright (C) 2015-2023 +%% Copyright (C) 2015-2024 %% %% The LaTeX Project and any individual authors listed elsewhere %% in this file. diff --git a/macros/latex/required/tools/shellesc.pdf b/macros/latex/required/tools/shellesc.pdf Binary files differindex e40b2a84b6..10ad7eb112 100644 --- a/macros/latex/required/tools/shellesc.pdf +++ b/macros/latex/required/tools/shellesc.pdf diff --git a/macros/latex/required/tools/showkeys-2014-10-28.sty b/macros/latex/required/tools/showkeys-2014-10-28.sty index b4d7b19028..9f465dff5c 100644 --- a/macros/latex/required/tools/showkeys-2014-10-28.sty +++ b/macros/latex/required/tools/showkeys-2014-10-28.sty @@ -1,4 +1,8 @@ %% +%% This is an old release of `showkeys.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% %% This is file `showkeys.sty', %% generated with the docstrip utility. %% diff --git a/macros/latex/required/tools/showkeys.dtx b/macros/latex/required/tools/showkeys.dtx index c90b3863e1..b6717950a7 100644 --- a/macros/latex/required/tools/showkeys.dtx +++ b/macros/latex/required/tools/showkeys.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -22,16 +22,15 @@ % \fi % \iffalse %% File: showkeys.dtx Copyright (C) 1992-1997 David Carlisle -%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX Project +%% File: showkeys.dtx Copyright (C) 2006-2024 David Carlisle, LaTeX Project % %<*dtx> \ProvidesFile{showkeys.dtx} %</dtx> %<package>\NeedsTeXFormat{LaTeX2e} %<package> -%<package>\providecommand\DeclareRelease[3]{} -%<package>\providecommand\DeclareCurrentRelease[2]{} -%<package> +% For every rollback request before 2022 use the 2014 version: +%<package>\DeclareRelease{}{1994-06-01}{showkeys-2014-10-28.sty} %<package>\DeclareRelease{}{2014-10-28}{showkeys-2014-10-28.sty} %<package>\DeclareCurrentRelease{}{2022-06-01} %<package> @@ -39,7 +38,7 @@ %<driver> \ProvidesFile{showkeys.drv} % \fi % \ProvidesFile{showkeys.dtx} - [2023/07/08 v3.19 Show cite and label keys (DPC, MH)] + [2024/05/23 v3.21 Show cite and label keys (DPC, MH)] % % \iffalse %<*driver> @@ -417,6 +416,8 @@ % \end{macrocode} % \changes{v3.02}{1995/03/17} % {New code for `in label' case.} +% \changes{v3.20}{2023/12/16} +% {Avoid adding an extra box layer github/1123} % If the |\label| is straight after |\item| (|\bibitem| is handled by % this case as well) then the item label has not been added to the page % yet. It is hanging around in the box |\@labels| waiting for the @@ -425,7 +426,7 @@ \global\setbox\@labels\hbox{% \llap{\SK@lab\SK@lab@relax \kern\@totalleftmargin\kern\marginparsep}% - \box\@labels}% + \unhbox\@labels}% % \end{macrocode} % % \begin{macrocode} diff --git a/macros/latex/required/tools/showkeys.pdf b/macros/latex/required/tools/showkeys.pdf Binary files differindex 7b64f00dea..fb1bc5a5aa 100644 --- a/macros/latex/required/tools/showkeys.pdf +++ b/macros/latex/required/tools/showkeys.pdf diff --git a/macros/latex/required/tools/somedefs.dtx b/macros/latex/required/tools/somedefs.dtx index 02653a1393..156621d70e 100644 --- a/macros/latex/required/tools/somedefs.dtx +++ b/macros/latex/required/tools/somedefs.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/somedefs.pdf b/macros/latex/required/tools/somedefs.pdf Binary files differindex 45c79ac29b..0ef55a179e 100644 --- a/macros/latex/required/tools/somedefs.pdf +++ b/macros/latex/required/tools/somedefs.pdf diff --git a/macros/latex/required/tools/tabularx.dtx b/macros/latex/required/tools/tabularx.dtx index 6d59ca4c22..52ee62cad9 100644 --- a/macros/latex/required/tools/tabularx.dtx +++ b/macros/latex/required/tools/tabularx.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -31,7 +31,7 @@ %<driver> \ProvidesFile{tabularx.drv} % \fi % \ProvidesFile{tabularx.dtx} - [2023/07/08 v2.11c `tabularx' package (DPC)] + [2023/12/11 v2.12a `tabularx' package (DPC)] % \iffalse %<*driver> \documentclass{ltxdoc} @@ -261,6 +261,25 @@ % This behaviour of the package can be customised slightly % as noted in the documentation of the code section. % +% \section{Support for tagged PDF} +% +% With version 2.12a the package is made tagging aware, which means that +% it will automatically produce tagged tables (necessary, for example, for +% accessibility) if tagging is requested via \cs{DocumentMetadata}. +% +% More granular control, e.g., explicitly deciding which cells are +% header cells, etc., is currently under development, but syntax for +% this will not appear in this package. Instead it will become +% available across all tabular-generating packages and then +% automatically apply here as well. +% +% Enabling \LaTeX{} to automatically produce tagged PDF is a long-term +% project and this is a tiny step in this puzzle. For more information +% on the project and already available functionality, see +% \url{https://latex-project.org/publications/indexbytopic/pdf} and +% \url{https://github.com/latex3/tagging-project}. +% +% % \MaybeStop{} % % \section{The Macros} @@ -269,6 +288,14 @@ %<*package> % \end{macrocode} % +% We only need two changes for tagging support, but they require +% that a recent \LaTeX{} kernel is used (which should be no problem +% if \texttt{tools} is distributed in parallel with the kernel. +% \changes{v2.12a}{2023/12/11}{Require newer LaTeX kernel} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e}[2024/06/01] +% \end{macrocode} +% % \changes{v2.00}{1994/02/07} % {New Option Handling} % \begin{macrocode} @@ -506,7 +533,15 @@ % \begin{macrocode} \TX@typeout@ {\@spaces Table Width\@spaces Column Width\@spaces X Columns}% -% \end{macrocode}% +% \end{macrocode} +% +% While we do trial typesetting we suspend any tagging if that is +% active: +% \changes{v2.12a}{2023/12/11} +% {Suspend any tagging while doing trial typesetting} +% \begin{macrocode} + \SuspendTagging {tabularx}% +% \end{macrocode} % First attempt. Modify the {\ttfamily X} definition to count {\ttfamily % X} columns. % \begin{macrocode} @@ -523,6 +558,12 @@ \TX@trial{}% \repeat % \end{macrocode} +% +% And here we restart it again: +% \begin{macrocode} + \ResumeTagging {tabularx}% +% \end{macrocode} +% % One last time, with warnings back on (see appendix D) % use {\ttfamily tabular*} to put it in a box of the right size, in case % the algorithm failed to find the correct size. @@ -737,8 +778,9 @@ % Make the table, and finish the hbox. % Since v1.06, "\toks@" contains the preamble specification, % and possible optional argument, as well as the table body. +% % \begin{macrocode} - \expandafter\tabular\the\toks@ + \expandafter\tabular\the\toks@ \endtabular}% % \end{macrocode} % Since v1.05 reset all \LaTeX\ counters, by executing "\TX@ckpt". @@ -961,6 +1003,7 @@ % \end{macrocode} % \end{macro} % +% % \begin{macrocode} %</package> % \end{macrocode} diff --git a/macros/latex/required/tools/tabularx.ins b/macros/latex/required/tools/tabularx.ins index 6e81e93432..fdce598d37 100644 --- a/macros/latex/required/tools/tabularx.ins +++ b/macros/latex/required/tools/tabularx.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/tabularx.pdf b/macros/latex/required/tools/tabularx.pdf Binary files differindex 5d34197bd2..14c5977f7d 100644 --- a/macros/latex/required/tools/tabularx.pdf +++ b/macros/latex/required/tools/tabularx.pdf diff --git a/macros/latex/required/tools/theorem.dtx b/macros/latex/required/tools/theorem.dtx index e3a8e90b8c..a9c3ccae3e 100644 --- a/macros/latex/required/tools/theorem.dtx +++ b/macros/latex/required/tools/theorem.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/theorem.pdf b/macros/latex/required/tools/theorem.pdf Binary files differindex a2bdfebbf8..579c3b0db3 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 b4278ab9cd..a17f776df9 100644 --- a/macros/latex/required/tools/tools-overview.pdf +++ b/macros/latex/required/tools/tools-overview.pdf diff --git a/macros/latex/required/tools/tools-overview.tex b/macros/latex/required/tools/tools-overview.tex index 3bc325d67c..54f4b5ed63 100644 --- a/macros/latex/required/tools/tools-overview.tex +++ b/macros/latex/required/tools/tools-overview.tex @@ -1,7 +1,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesFile{tools-overview.tex}[2015/03/31 v1.0 Tools overview] -% Copyright (C) 2006-2023 +% Copyright (C) 2006-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/tools.ins b/macros/latex/required/tools/tools.ins index 6898faead3..8687d49d7f 100644 --- a/macros/latex/required/tools/tools.ins +++ b/macros/latex/required/tools/tools.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -49,7 +49,7 @@ reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. @@ -178,6 +178,13 @@ given in the file `manifest.txt'. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \SimplePackage{shellesc} + +% Shell Filee System Queries +%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\batchinput{l3sys-query.ins} + + + % File-Error files %%%%%%%%%%%%%%%%%% \generate{% diff --git a/macros/latex/required/tools/trace.dtx b/macros/latex/required/tools/trace.dtx index 788f831620..27a39c776b 100644 --- a/macros/latex/required/tools/trace.dtx +++ b/macros/latex/required/tools/trace.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/trace.pdf b/macros/latex/required/tools/trace.pdf Binary files differindex 34050d5f22..7b57ee0ea7 100644 --- a/macros/latex/required/tools/trace.pdf +++ b/macros/latex/required/tools/trace.pdf diff --git a/macros/latex/required/tools/varioref-2016-02-16.sty b/macros/latex/required/tools/varioref-2016-02-16.sty index 747e89dc60..39cc4467a7 100644 --- a/macros/latex/required/tools/varioref-2016-02-16.sty +++ b/macros/latex/required/tools/varioref-2016-02-16.sty @@ -1,4 +1,8 @@ %% +%% This is an old release of `varioref.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% %% This is file `varioref.sty', %% generated with the docstrip utility. %% diff --git a/macros/latex/required/tools/varioref.dtx b/macros/latex/required/tools/varioref.dtx index e801c54f81..40b3038074 100644 --- a/macros/latex/required/tools/varioref.dtx +++ b/macros/latex/required/tools/varioref.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -33,14 +33,15 @@ %% % %<package>\NeedsTeXFormat{LaTeX2e}[1995/05/16] -%<package>\providecommand\DeclareRelease[3]{} -%<package>\providecommand\DeclareCurrentRelease[2]{} %<package> +% +% For any rollback before 2019 load the 2016 version and hope for the best: +%<package>\DeclareRelease{}{1994-06-01}{varioref-2016-02-16.sty} %<package>\DeclareRelease{}{2016-02-16}{varioref-2016-02-16.sty} %<package>\DeclareCurrentRelease{}{2019-10-01} %<package> %<package>\ProvidesPackage{varioref} -%<package> [2022/01/09 v1.6f package for extended references (FMi)] +%<package> [2024/05/23 v1.6g package for extended references (FMi)] % \fi % %% @@ -144,8 +145,8 @@ %\DescribeMacro\vref The implementation of |\vref| below produces only % a |\ref| when reference and |\label| are on the same page. It will % additionally produce one of the strings `on the facing page', `on -% the preceding page', or `on the following page', if label and -% reference differ by one and it will produce both |\ref| and +% the preceding page', or `on the following page' if label and +% reference differ by one; and it will produce both |\ref| and % |\pageref| when the difference is larger. The word `facing' is used % when label and reference both fall onto a double spread. However, % if a special page numbering scheme is used instead of the usual @@ -169,7 +170,7 @@ % comes out as ``\ldots~see the example which shows~\ldots'', which % could be misleading. % -% A space in front of |\vpageref| it will be ignored if +% A space in front of |\vpageref| will be ignored if % the command doesn't produce any text at all. % % But in fact |\vpageref| allows even more control. It has two @@ -210,7 +211,7 @@ % \DescribeMacro\vrefrange % This command is similar to |\vref| but it % takes two mandatory arguments denoting a range to refer to (e.g., a -% sequences of figures or a sequence of equations, etc.). So if +% sequence of figures or a sequence of equations, etc.). So if % |fig:a| is your first figure in the sequence and |fig:c| your last % you can write %\begin{verbatim} @@ -273,8 +274,8 @@ % \DescribeMacro\vpagerefcompare % \NewIn{2019} % For this kind of application the package also provides -% |\vpagerefcompare| as a command that takes four argument: two labels for -% comparison and a \meta{true} and \meta{false} argument. One of them +% |\vpagerefcompare| as a command that takes four arguments: two labels +% for comparison and a \meta{true} and \meta{false} argument. One of them % is executed depending on whether the two labels are on the same page % or on different pages. With its help the above definition could be % shortened to @@ -293,8 +294,9 @@ % Another command for conditional processing is |\vpagerefnearby|. It % takes three arguments: a label and a \meta{true} and \meta{false} % argument. It compares the page reference to the label with the -% current page number and if both are Arabic number and only differ by -% $\pm1$ the \meta{true} argument is executed otherwise the +% current page number; if each of these is a positive integer +% (expressed in Arabic numerals) and they differ by at most +% $\pm1$, the \meta{true} argument is executed, otherwise the % \meta{false} argument. In other words it tells you if a |\vpageref| % to the label would result in a textual reference to the previous, % current or next page.\footnote{There is also a @@ -320,11 +322,11 @@ % versions of the macros which do not add any space before the % generated text (they do nevertheless remove space at the left). % -% However, that too has problems (one is that \pkg{hyperref} +% However, that too has problems: one is that \pkg{hyperref} % \ChangedIn{2019} -% introduced the star forms as a means to generating references -% without hyperlinks (which is clearly the more important -% application). +% introduced the star forms as a means of generating references +% without hyperlinks, which is clearly the more important +% application. % So these days I recommend to always call the package with the option % \option{nospace} which prevents \pkg{varioref} from messing with the % space in front. Of course you are then responsible to always add it @@ -381,7 +383,7 @@ % label and reference fall onto the same page, but prefer reference to % page numbers otherwise then |\thevpagerefnum| can be used. This macro % hold the current page ``number'' when |\vpageref| and friends are -% executed. Thus, by defining, for example +% executed. Thus, by defining, for example, %\begin{verbatim} %\renewcommand\reftextfaceafter {on page~\thevpagerefnum} %\renewcommand\reftextfacebefore{on page~\thevpagerefnum} @@ -436,7 +438,7 @@ %\DescribeMacro\reftextafter %\DescribeMacro\reftextfaceafter Backward references use % |\reftextbefore| if the label is on the preceding page but invisible -% and |\reftextfacebefore| if it is one the facing page (i.e., if the +% and |\reftextfacebefore| if it is on the facing page (i.e., if the % current page number is odd). Similarly |\reftextafter| is used % when the label comes on the next page but one has to turn the page % and |\reftextfaceafter| if it is on the following but facing page. @@ -447,7 +449,7 @@ %\DescribeMacro\reftextfaraway Finally we have |\reftextfaraway| which % is used whenever label and reference differ by more than one or when % they aren't numeric. This macro is a bit different because it takes -% one argument, the symbolic reference string so that one cane make +% one argument, the symbolic reference string, so that one can make % use of |\pageref| in its replacement text. % % @@ -521,7 +523,7 @@ % and \option{nospace}. While the former is the default to allow % \NewIn{2019} % documents written in the last twenty years to continue to work -% correctly, I nowadays, suggest that you always use the package with +% correctly, I nowadays suggest that you always use the package with % the option \option{nospace}. This will stop \pkg{varioref} from % meddling with the spaces preceding commands and thus make the star % forms |\vref*| and |\vpageref*| unnecessary. @@ -536,7 +538,7 @@ % Defining commands like the ones described above poses some % interesting problems. Suppose, for example, that a generated text % like `on the next page' gets broken across pages. If this happens it -% is very difficult to find an acceptable solution and in fact can +% is very difficult to find an acceptable solution and it can, in fact, % even result in a document that will always change from one state to % another (i.e., inserting one string, finding that this is wrong, % inserting another string on the next run which makes the first @@ -699,7 +701,7 @@ % \begin{macro}{\reftextbefore} % \begin{macro}{\reftextcurrent} % \label{reftextbefore} The options do set the macros that -% generate the textual strings. Note, that they do not start with a +% generate the textual strings. Note that they do not start with a % space, the space is already added in the main macro below. % \changes{v1.2a}{1998/08/22}{Added American defaults for % \cs{reftextpagerange} and \cs{reftextlabelrange}} @@ -838,7 +840,7 @@ % the noun (clause); bertentangan is ``opposite'' in the sense of % ``facing''; berikutnya is ``next'' (in this context - actually % next-to-this, literally); berikutnya also translates as ``following -% this'' sebelumnya is ``preceding''; also ``previous'' ``ini'' translates, +% this''; sebelumnya is ``preceding'', also ``previous''; ``ini'' translates, % literally, as ``this'' but is also used in the sense of current page. % \changes{v1.4o}{2005/12/02}{Bahasa Malaysia defaults added.} % \begin{macrocode} @@ -1036,7 +1038,7 @@ \let\vrefrangeformat\vrefrangedefaultformat }} % \end{macrocode} -% Default string for dutch have been contributed by Frank Poppe +% Default strings for Dutch have been contributed by Frank Poppe % (\verb=POPPE@SWOV.NL=). % This option currently supports one additional string macro % |\refpagename| so that you can easily change to |bladzijde| @@ -1124,9 +1126,9 @@ \let\vrefrangeformat\vrefrangedefaultformat }} % \end{macrocode} -% The finnish strings were suggested by Matti Rintala +% The Finnish strings were suggested by Matti Rintala % (\verb=bitti@cs.tut.fi=) and Hillevi Gavel -% \verb=Hillevi.Gavel@mdh.se=. +% (\verb=Hillevi.Gavel@mdh.se=). % \changes{v1.0m}{1994/09/23}{Added finnish strings} % \changes{v1.4o}{2005/11/07}{Added a few more finnish strings} % \begin{macrocode} @@ -1200,10 +1202,10 @@ }} % \end{macrocode} % There are no good variants for German (I think and still think but -% this is a matter of taste :-). +% this is a matter of taste :-)). % \changes{v1.0b}{1994/01/31}{Replace in incorrect `def by `let} % The following definitions were recently suggested to me but since -% the original are in for a long time i don't want to change them +% the originals have been there for a long time I don't want to change them % now since that could make a lot of documents change their formatting. % If you fancy them, add a redefinition of the corresponding macro(s) % to the preamble of your document. @@ -1935,7 +1937,7 @@ % \end{macrocode} % But if \texttt{nospace} is in force we simply use the same space % value that was used in the source document (unless that was zero -% or non-existent. +% or non-existent). % \begin{macrocode} \ifdim\@tempskipa=\z@ \else \hskip\@tempskipa @@ -1978,7 +1980,7 @@ % \begin{macrocode} \vrefpagenum\thevpagerefnum{#3}% % \end{macrocode} -% Now after the internal label has served its purpose if would be +% Now after the internal label has served its purpose it would be % nice to free the memory it occupies by using something like % \begin{verbatim} % \global\expandafter\let @@ -2008,7 +2010,7 @@ \fi \else % \end{macrocode} -% If |#2| is empty we do nothing otherwise we insert it followed by +% If |#2| is empty we do nothing, otherwise we insert it followed by % a space. % \begin{macrocode} \def\@tempc{#2}% @@ -2017,7 +2019,7 @@ \fi % \end{macrocode} % Now we check if the page number of the referenced object (stored -% in |\thevpagerefnum| is a single positive number. +% in |\thevpagerefnum|) is a single positive number. % \begin{macrocode} \is@pos@number\thevpagerefnum {% @@ -2032,7 +2034,7 @@ }% % \end{macrocode} % If it is not a positive number we assign the largest possible -% number to |\@tempcnta| and thereby pretending that label and +% number to |\@tempcnta|, thereby pretending that label and % reference are miles away from each other. % \begin{macrocode} {\@tempcnta\maxdimen}% @@ -2049,7 +2051,7 @@ % Thus if the object falls onto an odd page then the reference is % on the facing even page (and so we insert |\reftextfaceafter|), % otherwise the object can not be seen from the reference (and we -% in insert |\reftextafter|). Don't be surprised if we are not +% insert |\reftextafter|). Don't be surprised if we are not % using |\thevpagerefnum| in the check. Since |\@tempcnta| has the same % value it is faster to use the register instead of parsing the % macro contents anew. @@ -2061,7 +2063,7 @@ % used. % Since the value of |\if@twoside| is evaluated before reading in % packages we could do better (saving some tokens) by defining -% the current macro in dependence of this boolean. +% the current macro depending on this boolean. % \begin{macrocode} \if@twoside \reftextfaceafter @@ -2075,11 +2077,11 @@ % If the object is not on the page following the reference we check % if it is on the page before the reference. In \LaTeX{} this % situation is not too common, for example with floats it normally -% does not occur, but of course it isn't impossible if you more +% does not occur, but of course it isn't impossible if you have more % than one reference to the same object, or if you have back % references to sections, theorems, etc. To test this we now % subtract two from the current value of |\@tempcnta| (which was -% set to one higher as the reference page number). Note, that +% set to one higher as the reference page number). Note that % subtraction is also possible if the value was |\maxdimen| --- we % still get something that is much larger than any sensible page % number. @@ -2131,7 +2133,7 @@ \reftextfaraway{#3}}% \fi % \end{macrocode} -% Finally we generate the internal label so that it can be check on +% Finally, we generate the internal label so that it can be checked on % the next run. This means that we compare the position after the % string with the position of the referenced object. There is one % thing to note: to conserve space we locally make |\@currentlabel| @@ -2252,8 +2254,8 @@ % The star form is easy (and just a convenient shortcut), just call % |\ref| followed by |\vpageref| and pass the optional argument to % the latter. We don't support the second optional argument of -% |\vpageref|, it that is needed one has to call both commands -% explicitly +% |\vpageref|, if that is needed one has to call both commands +% explicitly. % \changes{v1.6a}{2019/08/25}{Command added to support hyperref better} % \changes{v1.6e}{2020/07/25}{Changed for Japanese (gh/352)} % \begin{macrocode} @@ -2264,7 +2266,7 @@ % % \begin{macro}{\vrefformat,\vrefdefaultformat} % Japanese needs a different word order in \cs{vref@star} so this -% is separated out o that it can be changed on language level. +% is separated out so that it can be changed at the language level. % \changes{v1.6e}{2020/07/25}{Macro added (gh/352)} % \begin{macrocode} \def\vrefdefaultformat#1#2{% @@ -2293,7 +2295,7 @@ \unskip \nobreakspace \fi % \end{macrocode} -% The use of|\nobreakspace| or |~| after the |\unskip| means that +% The use of |\nobreakspace| or |~| after the |\unskip| means that % this command will always produce a normal space while % something like |\nobreak\space| will % react to settings of |\nonfrenchspacing|. @@ -2341,10 +2343,10 @@ % Now we have to check whether or not the whole string was parsed % into that register or some remainder was left over. Since we have % added a |\@nil| token at the very end we can use that to delimit -% the argument of |\is@pos@num@|. Note, that the added space in +% the argument of |\is@pos@num@|. Note that the added space in % |\is@pos@number| \vpageref[above]{isposnumber} gets parsed away % by the counter assignment. If it would be missing, and the full -% string would consist of a number, \TeX{}would try to replace +% string would consist of a number, \TeX{} would try to replace % |\@nil| by its definition to see if it would contain additional % digits and thus we would be in trouble at this point. % \begin{macrocode} @@ -2389,7 +2391,7 @@ % % \begin{macro}{\fullrefformat,\fullrefdefaultformat} % Japanese needs a different word order in \cs{fullref} so this -% is separated out o that it can be changed on language level. +% is separated out so that it can be changed at the language level. % \changes{v1.6e}{2020/07/25}{Macro added (gh/352)} % \begin{macrocode} \def\fullrefdefaultformat#1{% @@ -2523,7 +2525,7 @@ % % \begin{macro}{\vrefrangeformat,\vrefrangedefaultformat} % Japanese needs a different word order in \cs{vrefrange} so this -% is separated out o that it can be changed on language level. +% is separated out so that it can be changed at the language level. % \changes{v1.6d}{2020/07/20}{Macro added (gh/352)} % \begin{macrocode} \def\vrefrangedefaultformat#1#2#3{% @@ -2558,7 +2560,7 @@ % % \begin{macro}{\Vrefformat,\Vrefdefaultformat} % Japanese needs a different word order in \cs{Vref} so this -% is separated out o that it can be changed on language level. +% is separated out so that it can be changed at the language level. % \changes{v1.6e}{2020/07/25}{Macro added (gh/352)} % \begin{macrocode} \def\Vrefdefaultformat#1#2{% diff --git a/macros/latex/required/tools/varioref.ins b/macros/latex/required/tools/varioref.ins index dcc41d0176..88527a20ba 100644 --- a/macros/latex/required/tools/varioref.ins +++ b/macros/latex/required/tools/varioref.ins @@ -3,7 +3,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright (C) 1993-2023 +%% Copyright (C) 1993-2024 %% The LaTeX Project and any individual authors listed elsewhere %% in this file. %% @@ -45,7 +45,7 @@ The source is maintained by the LaTeX Project team and bug reports for it can be opened at https://latex-project.org/bugs/ (but please observe conditions on bug reports sent to that address!) -Copyright (C) 1993-2023 +Copyright (C) 1993-2024 The LaTeX Project and any individual authors listed elsewhere in this file. diff --git a/macros/latex/required/tools/varioref.pdf b/macros/latex/required/tools/varioref.pdf Binary files differindex 64c89e6f49..7a5aa90622 100644 --- a/macros/latex/required/tools/varioref.pdf +++ b/macros/latex/required/tools/varioref.pdf diff --git a/macros/latex/required/tools/verbatim.dtx b/macros/latex/required/tools/verbatim.dtx index ebcc010a80..468dead3e8 100644 --- a/macros/latex/required/tools/verbatim.dtx +++ b/macros/latex/required/tools/verbatim.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -69,6 +69,8 @@ %\fi % % +% +% \changes{v1.5x}{2024/01/22}{Added TAB marking support to \cs{verbatiminput*}} % \changes{v1.5u}{2020-07-07}{Typo repair and added a missing comment % character} % \changes{v1.5q}{2003/08/22}{Reintroduced \cs{@noligs}, by popular @@ -508,7 +510,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{verbatim} - [2023-11-06 v1.5v LaTeX2e package for verbatim enhancements] + [2024-01-22 v1.5x LaTeX2e package for verbatim enhancements] \@ifundefined{verbatim@@@}{}{\endinput} % \end{macrocode} % @@ -1570,7 +1572,14 @@ % arguments, depending on whether an asterisk follows. % \begin{macrocode} \def\verbatiminput{\begingroup - \@ifstar{\verbatim@input\relax}% +% \end{macrocode} +% +% \changes{v1.5x}{2024/01/22}{Added TAB marking support into the +% starred version (gh/1245)} +% If starred, we mark spaces and TABs, the two +% added pieces are the same as for verbatim*. +% \begin{macrocode} + \@ifstar{\verbatim@input{\@setupverbvisiblespace\@vobeyspaces}}% {\verbatim@input{\frenchspacing\@vobeyspaces}}} % \end{macrocode} % \end{macro} diff --git a/macros/latex/required/tools/verbatim.pdf b/macros/latex/required/tools/verbatim.pdf Binary files differindex a8238cf344..65e18697f4 100644 --- a/macros/latex/required/tools/verbatim.pdf +++ b/macros/latex/required/tools/verbatim.pdf diff --git a/macros/latex/required/tools/xr-2023-07-04.sty b/macros/latex/required/tools/xr-2023-07-04.sty new file mode 100644 index 0000000000..15bfde169a --- /dev/null +++ b/macros/latex/required/tools/xr-2023-07-04.sty @@ -0,0 +1,84 @@ +%% +%% This is an old release of `xr.sty' used during rollback operations. +%% Do not use this file directly. +%% ============================== +%% +%% This is file `xr.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% xr.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at https://latex-project.org/bugs/ +%% (but please observe conditions on bug reports sent to that address!) +%% +%% +%% Copyright (C) 1993-2023 +%% The LaTeX Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'. +%% -------------------------------------------------------------------------- +%% +%% 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 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle' +%% without such generated files. +%% +%% The list of all files belonging to the LaTeX `Tools Bundle' is +%% given in the file `manifest.txt'. +%% +%% File: xr.dtx Copyright (C) 1993-2019 David Carlisle +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{xr} + [2023-07-04 v5.06 eXternal References (DPC)] +\def\externaldocument{\@ifnextchar[\XR@{\XR@[]}} +\let\externalcitedocument\externaldocument +\def\XR@[#1]#2{{% + \makeatletter + \def\XR@prefix{#1}% + \set@curr@file{#2}% + \expandafter\XR@next\@curr@file.aux\relax\\}} +\def\XR@next#1\relax#2\\{% + \edef\XR@list{#2}% + \XR@loop{#1}} +\def\XR@aux{% + \ifx\XR@list\@empty\else\expandafter\XR@explist\fi} + +\def\XR@explist{\expandafter\XR@next\XR@list\\} +\def\XR@loop#1{\openin\@inputcheck{#1}\relax + \ifeof\@inputcheck + \PackageWarning{xr}{^^JNo file #1^^JLABELS NOT IMPORTED.^^J}% + \expandafter\XR@aux + \else + \PackageInfo{xr}{IMPORTING LABELS FROM #1}% + \expandafter\XR@read\fi} +\def\XR@read{% + \read\@inputcheck to\XR@line + \expandafter\XR@test\XR@line...\XR@} +\long\def\XR@test#1#2#3#4\XR@{% + \let\XR@tempa\@gobbletwo + \ifx#1\newlabel + \let\XR@tempa\@firstoftwo + \else\ifx#1\bibcite + \let\XR@tempa\@firstoftwo + \else\ifx#1\@input + \let\XR@tempa\@secondoftwo + \fi\fi\fi + \XR@tempa{#1{\XR@prefix#2}{#3}}{\edef\XR@list{\XR@list#2\relax}}% + \ifeof\@inputcheck\expandafter\XR@aux + \else\expandafter\XR@read\fi} +\endinput +%% +%% End of file `xr.sty'. diff --git a/macros/latex/required/tools/xr.dtx b/macros/latex/required/tools/xr.dtx index be48f5a01b..daa0778b36 100644 --- a/macros/latex/required/tools/xr.dtx +++ b/macros/latex/required/tools/xr.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. @@ -21,14 +21,49 @@ % % \fi % \iffalse -%% File: xr.dtx Copyright (C) 1993-2019 David Carlisle +%% File: xr.dtx Copyright (C) 1993-2024 David Carlisle % %<package>\NeedsTeXFormat{LaTeX2e} +%<package>\DeclareRelease{v5}{2023-07-04}{xr-2023-07-04.sty} +%<package>\DeclareCurrentRelease{}{2024-04-10} %<package>\ProvidesPackage{xr} -%<package> [2023-07-04 v5.06 eXternal References (DPC)] +%<package> [2024-04-10 v6.00 eXternal References (DPC)] % %<*driver> -\documentclass{ltxdoc} +\documentclass{l3doc} +% currently missing in l3doc, copied from array.dtx +\makeatletter +\def\MaintainedBy#1{\gdef\@maintainedby{#1}} +\let\@maintainedby\@empty +\def\MaintainedByLaTeXTeam#1{% +{\gdef\@maintainedby{% +This file is maintained by the \LaTeX{} Project team.\\% +Bug reports can be opened (category \texttt{#1}) at\\% +\url{https://latex-project.org/bugs.html}.}}} +\def\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \par}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \ifx\@maintainedby\@empty + \else + \vskip 1em% + \fbox{\fbox{\begin{tabular}{@{}l@{}}\@maintainedby\end{tabular}}}% + \fi + \end{center}% + \par + \vskip 1.5em} +\makeatother \usepackage{xr} \GetFileInfo{xr.sty} \begin{document} @@ -50,44 +85,113 @@ % % \changes{v5.00}{1993/07/07} % {First DPC version (by agreement with J-PD). New mechanism -% (\cmd{\read} instead of \cmd\input).} +% (\cs{read} instead of \cs{input}).} % % \changes{v5.01}{1993/07/20}{Fix bug added by DPC, v5.00 did not import -% aux files of \cmd\include'ed files. (Reported by J-PD)} +% aux files of \cs{include}'ed files. (Reported by J-PD)} % % \changes{v5.02}{1994/05/28}{Update for LaTeX2e} % \changes{v5.03}{2018/10/01}{Fix for conditionals in aux file} % \changes{v5.05}{2019/07/20}{include xcite} +% \changes{v6.00}{2024/04/10}{merge with xr-hyper} % % % This package implements a system for eXternal References. -% +% Version 6.00 merges the \pkg{xr} package and the \pkg{xr-hyper} package. +% \pkg{xr-hyper} was developed to support the +% extended label syntax of the \pkg{hyperref} package and to enable active links +% to the external documents. +% In the \LaTeX{} release 2023-06-01 the label syntax of \pkg{hyperref} +% and the \LaTeX{} kernel have been synchronized and there is no longer +% a need for two packages. The package \pkg{xr-hyper} will be +% deprecated. +% +% The previous version before the merge can be accessed with +% \begin{verbatim} +% \usepackage{xr}[=v5] +% \end{verbatim} +% or with a rollback date between 2023-07-04 and 2024-04-09 +% \begin{verbatim} +% \usepackage{xr}[=2024-04-09] +% \end{verbatim} +% +% \section{Usage} +% +% \begin{syntax} +% \cs{externaldocument}\oarg{prefix}\texttt[nocite\texttt]\marg{document}\oarg{url} +% \end{syntax} +% % If one document needs to refer to sections of another, say |aaa.tex|, % then this package may be loaded in the main file, and the command\\ % |\externaldocument{aaa}|\\ % given in the preamble. % -% Then you may use |\ref| and |\pageref| to refer to anything which has +% Then you may use |\ref| and |\pageref| (or |\nameref| if the +% package \pkg{nameref} has been loaded to refer to anything which has % been given a |\label| in either |aaa.tex| or the main document. +% It is also possible to refer to properties stored with \cs{RecordProperties}. % You may declare any number of such external documents. % % If any of the external documents, or the main document, use the same % |\label| then an error will occur as the label will be multiply % defined. To overcome this problem |\externaldocument| has an optional -% argument. If you declare |\externaldocument[A-]{aaa}|, then all +% argument \meta{prefix}. +% If you declare |\externaldocument[A-]{aaa}|, then all % references from |aaa| are prefixed by |A-|. So for instance, if a % section of |aaa| had |\label{intro}|, then this could be referenced % with |\ref{A-intro}|. The prefix need not be |A-|, it can be any % string chosen to ensure that all the labels imported from external -% files are unique. Note however that if your style declares certain -% active characters (|:| in French, |"| in German) then these -% characters can not usually be used in |\label|, and similarly may not -% be used in the optional argument to |\externaldocument|. +% files are unique. Note however that the prefix is expanded and +% so should not contain commands that are not safe in this context. % % As first suggested in Enrico Gregorio's |xcite| package, the current version % also allows |\cite| to reference |\bibitem| in the external document. % For compatibility with |xcite|, |\externalcitedocument| is made available % as an alias for |\externaldocument| +% +% Many packages have variant citation commands (natbib, +% biblatex,....) and the external document may or may not have used +% hyperref. Because of these differences the citation linking may not +% always work, it can be disabled by specifying \texttt{[nocite]} after the +% \meta{prefix}: +% \begin{verbatim} +% \externaldocument[][nocite]{aaa} +% \end{verbatim} +% +% The `document' referred to by the main argument \meta{document} is the file +% \file{document.aux} which must be somewhere on TeX's input path. +% Some packages (eg hyperref) really need to know the location of the +% final document rather than the aux file. By default this is assumed +% to be \file{document.pdf}. A package may redefine the command \cs{XR@ext} to +% change this default extension. However sometimes the final +% document may be in a position unrelated to the aux file, or the +% browser may not be able to find files at an arbitrary point in +% TeX's input path, so the final optional argument \meta{url} allows a full +% URL to the final document to be specified. +% \begin{verbatim} +% \externaldocument{aaa}[https://example.com/this/path/to/aaa.pdf] +% \end{verbatim} +% +% The package stores the url of the external document in the label data. It can +% e.g. be retrieved with the \pkg{refcount} package +% +% \begin{verbatim} +% \usepackage{refcount,xr} +% \externaldocument{aaa} +% ... +% \getrefbykeydefault{intro}{url}{??} %prints aaa.pdf or ?? +% \end{verbatim} +% +% \pkg{xr} supports also the properties introduced in \LaTeX{} 2023-11-01. +% Here the url of the external document is stored in the \texttt{xr-url} property. +% +% \begin{verbatim} +% \usepackage{xr} +% \externaldocument{aaa} %aaa contains \RecordProperties{intro}{page} +% ... +% \RefProperty{intro}{page} %gives page number +% \RefProperty{intro}{xr-url} %gives aaa.pdf +% \end{verbatim} % % \MaybeStop{} % @@ -98,20 +202,74 @@ % \end{macrocode} % % Check for the optional argument. +% \changes{v6.00}{2024-04-10}{Copied over extended definition of xr-hyper} % \begin{macrocode} -\def\externaldocument{\@ifnextchar[\XR@{\XR@[]}} +\def\externaldocument{\@testopt\XR@cite{}} \let\externalcitedocument\externaldocument +\def\XR@cite[#1]{\@testopt{\XR@[#1]}{}} +\def\XR@[#1][#2]#3{\@testopt{\XR@@{#1}{#2}{#3}}{#3.\XR@ext}} +% \end{macrocode} +% +% \subsection{helper definitions} +% \changes{v6.00}{2024-04-10}{new, copied over from xr-hyper} +% To test the second optional argument +% \begin{macrocode} +\def\XR@@nocite{nocite} +% \end{macrocode} +% Needed in the processing +% \begin{macrocode} +\long\def\@gobblefour #1#2#3#4{} +\long\def\@firstoffour #1#2#3#4{#1} +\long\def\@secondoffour#1#2#3#4{#2} +\long\def\@thirdoffour #1#2#3#4{#3} +\long\def\@fourthoffour #1#2#3#4{#4} +% \end{macrocode} +% The url is added as fifth argument. The command used here is +% \cs{XR@addURL}. The command is more complicated as needed +% as it tries to handle also older documents with +% \cs{newlabel}'s with two arguments. +% \begin{macrocode} +\def\XR@addURL#1{\XR@@dURL#1{}{}{}{}\\} +\def\XR@@dURL#1#2#3#4#5\\{% + \unexpanded{{#1}{#2}{#3}{#4}}{\XR@URL}% + }% +% \end{macrocode} +% +% \subsection{Variables} +% \changes{v6.00}{2024-04-10}{new, copied over from xr-hyper} +% Default file extension: +% \begin{macrocode} +\providecommand\XR@ext{pdf} % \end{macrocode} % -% Save the optional prefix. Start processing the first |aux| file. -% \changes{v5.06}{2020-05-10}{Remove leading and trailing sapces from +% Save the optional prefix. Start processing the first |aux| file. +% \changes{v6.00}{2024-04-10}{copied over the new extended internal command from xr-hyper. +% It prepends the directory name.} +% Olivier Michel pointed out that +% if the aux file was not on texinputs you could not always go +% \cs{externaldocument}{/some/path/to/file} +% specifically that worked if file.aux was a `simple' document with +% one aux file, but if \cs{include} had been used, the `sub' aux files +% would not be found by xr in the remote directory. +% This version calls \cs{filename@parse} to get the directory name of the +% remote directory, which is then explicitly prepended to the names of +% any included aux files. +% \changes{v5.06}{2020-05-10}{Remove leading and trailing spaces from % the filename (gh/2223)} % \begin{macrocode} -\def\XR@[#1]#2{{% +\def\XR@@#1#2#3[#4]{{% \makeatletter \def\XR@prefix{#1}% - \set@curr@file{#2}% - \expandafter\XR@next\@curr@file.aux\relax\\}} + \def\XR@nocite{#2}% + \ifx\XR@nocite\XR@@nocite + \let\XR@bibcite\vadjust + \else + \let\XR@bibcite\bibcite + \fi + \def\XR@URL{#4}% + \set@curr@file{#3}% + \filename@parse\@curr@file + \XR@next\@curr@file.aux\relax\\}} % \end{macrocode} % % Process the next |aux| file in the list and remove it from the head of @@ -161,23 +319,40 @@ % \end{macrocode} % % Look at the first token of the line. -% If it is |\newlabel|, do the |\newlabel|. If it is |\@input|, add the -% filename to the list of files to process. Otherwise ignore. +% If it is |\newlabel|, define \cs{r@}\meta{label}, ensure that it has +% five label data argument and add the url as the last one. +% If it is |\@input|, add the +% filename to the list of files to process. +% If it is |\bibcite|, call a |\bibcite|. +% If it is |\new@label@record| add the url and then call it. +% Otherwise ignore. % Go around the loop if not at end of file. Finally process the next % file in the list. % % 2018 update: make sure the arguments are handled outside the |\ifx| test, +% \changes{v6.00}{2024-04-10}{copied over extended definition from xr-hyper} % \begin{macrocode} \long\def\XR@test#1#2#3#4\XR@{% - \let\XR@tempa\@gobbletwo + \let\XR@tempa\@gobblefour \ifx#1\newlabel - \let\XR@tempa\@firstoftwo - \else\ifx#1\bibcite - \let\XR@tempa\@firstoftwo + \let\XR@tempa\@firstoffour + \else\ifx#1\XR@bibcite + \let\XR@tempa\@secondoffour \else\ifx#1\@input - \let\XR@tempa\@secondoftwo - \fi\fi\fi - \XR@tempa{#1{\XR@prefix#2}{#3}}{\edef\XR@list{\XR@list#2\relax}}% + \let\XR@tempa\@thirdoffour + \else\ifx#1\new@label@record + \let\XR@tempa\@fourthoffour + \fi\fi\fi\fi + \XR@tempa + {% + \expandafter\protected@xdef\csname r@\XR@prefix#2\endcsname{\XR@addURL{#3}}% + }% + {\expandafter\bibcite\expandafter{\XR@prefix#2}{#3}}% + {\edef\XR@list{\XR@list\filename@area#2\relax}}% + {% + \edef\next{\noexpand\new@label@record{\XR@prefix#2}{\unexpanded{#3}{xr-url}{\XR@URL}}}% + \next + } \ifeof\@inputcheck\expandafter\XR@aux \else\expandafter\XR@read\fi} % \end{macrocode} diff --git a/macros/latex/required/tools/xr.pdf b/macros/latex/required/tools/xr.pdf Binary files differindex 205135ba68..a2ba599a8a 100644 --- a/macros/latex/required/tools/xr.pdf +++ b/macros/latex/required/tools/xr.pdf diff --git a/macros/latex/required/tools/xspace.dtx b/macros/latex/required/tools/xspace.dtx index 807fc9c5df..be20fc9e52 100644 --- a/macros/latex/required/tools/xspace.dtx +++ b/macros/latex/required/tools/xspace.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 1993-2023 +% Copyright (C) 1993-2024 % % The LaTeX Project and any individual authors listed elsewhere % in this file. diff --git a/macros/latex/required/tools/xspace.pdf b/macros/latex/required/tools/xspace.pdf Binary files differindex 0249feb81e..355a222dc1 100644 --- a/macros/latex/required/tools/xspace.pdf +++ b/macros/latex/required/tools/xspace.pdf |