summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lastpage
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-07-25 03:01:17 +0000
committerNorbert Preining <norbert@preining.info>2023-07-25 03:01:17 +0000
commitbe53973de38a7aa9a3a0a8c70fd92bdf893c1a35 (patch)
tree50d18c7e399afeaa37df77a57667580ba93fea0a /macros/latex/contrib/lastpage
parent19444d4440a66200b03e05b567996375d0404a46 (diff)
CTAN sync 202307250301
Diffstat (limited to 'macros/latex/contrib/lastpage')
-rw-r--r--macros/latex/contrib/lastpage/README7
-rw-r--r--macros/latex/contrib/lastpage/lastpage-example.pdfbin129504 -> 129330 bytes
-rw-r--r--macros/latex/contrib/lastpage/lastpage.dtx658
-rw-r--r--macros/latex/contrib/lastpage/lastpage.pdfbin440853 -> 439739 bytes
4 files changed, 289 insertions, 376 deletions
diff --git a/macros/latex/contrib/lastpage/README b/macros/latex/contrib/lastpage/README
index 57a301f013..a22d2498f1 100644
--- a/macros/latex/contrib/lastpage/README
+++ b/macros/latex/contrib/lastpage/README
@@ -1,4 +1,4 @@
-README for lastpage package, 2023-04-12, v2.0b
+README for lastpage package, 2023-07-24, v2.0c
TABLE OF CONTENTS
@@ -21,11 +21,10 @@ This LaTeX package puts the label LastPage at the end of the document
into the .aux file, allowing the user to refer to the last page
of a document. This might be particularly useful in places
like headers or footers. -
-When more than one page numbering scheme is used, or the
-fnsymbol page numbering scheme is used, or another package
+When more than one page numbering scheme is used, or another package
has output after this package, or the number of pages
instead of the last page's name is needed, or the page
-numbers exeed a certain range, there might be problems,
+numbers exceed a certain range, there might be problems,
which can be solved by using the pageslts package instead
[which needs updating to current LaTeX-format and therefore might fail].
diff --git a/macros/latex/contrib/lastpage/lastpage-example.pdf b/macros/latex/contrib/lastpage/lastpage-example.pdf
index d3826c7544..547293f401 100644
--- a/macros/latex/contrib/lastpage/lastpage-example.pdf
+++ b/macros/latex/contrib/lastpage/lastpage-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/lastpage/lastpage.dtx b/macros/latex/contrib/lastpage/lastpage.dtx
index cff2874020..ce1a71ad79 100644
--- a/macros/latex/contrib/lastpage/lastpage.dtx
+++ b/macros/latex/contrib/lastpage/lastpage.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% File: lastpage.dtx
-% Version: 2023-04-12 v2.0b
+% Version: 2023-07-24 v2.0c
% Info: Refers to last page's name
%
% Copyright © 2010 - 2023 by
@@ -65,7 +65,7 @@
\input docstrip.tex
\Msg{**********************************************************************}
\Msg{* Installation *}
-\Msg{* Package: lastpage 2023-04-12 v2.0b Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2023-07-24 v2.0c Refers to last page's name (HMM)*}
\Msg{**********************************************************************}
\keepsilent
@@ -77,7 +77,7 @@
This is a generated file.
Project: lastpage
-Version: 2023-04-12 v2.0b
+Version: 2023-07-24 v2.0c
Info: Refers to last page's name
Copyright (C) 2010 - 2023 by
@@ -184,8 +184,8 @@ In memoriam
%<*driver>
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesFile{lastpage.drv}%
- [2023-04-12 v2.0b Refers to last page's name (HMM)]
-\documentclass{ltxdoc}[2022/06/22]% v2.1i Standard LaTeX documentation class
+ [2023-07-24 v2.0c Refers to last page's name (HMM)]
+\documentclass{ltxdoc}[2023/03/28]% v2.1j Standard LaTeX documentation class
\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
pdfsubject={Refers to last page's name (HMM; JPG)},%
@@ -230,26 +230,26 @@ In memoriam
% }%^^A
% \expandafter\endgroup\x
%
-% \DoNotIndex{\@auxout,\@evenfoot,\@firstofone,\@ifl@t@r,\@ifpackagelater,\@ifpackageloaded}
-% \DoNotIndex{\@ifundefined,\@mainaux,\@number,\@oddfoot}
+% \DoNotIndex{\@auxout,\@evenfoot,\@firstofone,\@firstoftwo,\@ifl@t@r,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifundefined,\@kernel@reserved@label@data,\@mainaux,\@number,\@oddfoot}
% \DoNotIndex{\addtocounter,\AddToHook,\arabic,\begin}
-% \DoNotIndex{\bigskip,\clearpage,\csname,\documentclass,\empty,\end,\endcsname}
+% \DoNotIndex{\bigskip,\clearpage,\csname,\documentclass,\EdefUnescapeString,\empty,\end,\endcsname}
% \DoNotIndex{\enddocument,\ExplSyntaxOff,\ExplSyntaxOn,\fmtversion}
% \DoNotIndex{\g,\gdef,\here,\hfil,\Hy@temp,\Hy@unicodefalse}
-% \DoNotIndex{\hypersetup,\if@filesw,\ifHy@hypertexnames,\ifHy@pageanchor,\ifHy@plainpages}
-% \DoNotIndex{\ifnum,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifx,\immediate,\input}
+% \DoNotIndex{\hypersetup,\if@filesw,\if@nobreak,\ifHy@hypertexnames,\ifHy@pageanchor,\ifHy@plainpages}
+% \DoNotIndex{\ifnum,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifvmode,\ifx,\immediate,\input}
% \DoNotIndex{\label,\lastpage,\lastpage-example.tex,\lastpage.dtx,\lastpage.sty,\lastpagee.sty}
% \DoNotIndex{\lastpageclassic.sty,\lastpagemodern.sty,\LaTeX,\listfiles}
-% \DoNotIndex{\makeatletter,\makeatother,\markboth,\message,\MessageBreak}
-% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newline,\newpage}
+% \DoNotIndex{\makeatletter,\makeatother,\markboth,\mbox,\message,\MessageBreak}
+% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newline,\newpage,\nobreak}
% \DoNotIndex{\noindent,\normalsize,\numexpr,\origenddocument,\PackageError}
-% \DoNotIndex{\PackageWarning,\pagenumbering,\pageref,\pdfstringdef,\ProvidesPackage}
+% \DoNotIndex{\PackageWarning,\pagenumbering,\pageref,\pdfstringdef,\protect,\ProvidesPackage}
% \DoNotIndex{\qquad,\RequirePackage,\section,\slshape,\smallskip,\space,\test,\textbf}
% \DoNotIndex{\textit,\textquotedblleft,\textquotedblright,\textsf,\texttt,\the,\thepage}
% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\write}
%
% \title{The \xpackage{lastpage} package}
-% \date{2023-04-12 v2.0b}
+% \date{2023-07-24 v2.0c}
% \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}\\
% invented by Jeffrey P. Goldberg\\\xemail{jeffrey+news at goldmark.org}}
%
@@ -259,18 +259,18 @@ In memoriam
% \noindent This \LaTeX{} package puts the label \texttt{LastPage}
% at the end of the document into the \xfile{.aux} file,
% allowing the user to refer to the last page of a document.
-% This might be particularly useful in places like headers or footers.~--\\
-% While this package allows for things like\\
+% This might be particularly useful in places like headers or footers.~--\newline
+% While this package allows for things like\newline
% \hbox{\textquotedblleft Page} \hbox{|\thepage{}|} of |\pageref{LastPage}|\textquotedblright{}
% to get \textquotedblleft Page 7 of 9\textquotedblright{} or
% \textquotedblleft Page VII of IX\textquotedblright,
% the \emph{number} of pages is nowadays available via |\@abspage@last| from the kernel,
% but when more than one page numbering scheme is used
-% (for example pages I~to X and then 1~to 10, thus number of pages
-% \hbox{\textquotedblleft 20\textquotedblright ,} but name of the last page
-% \hbox{\textquotedblleft 10\textquotedblright ),}
-% or when or the fnsymbol page numbering scheme is used, or another package
-% has output after this package, or the page numbers exceed a certain range,
+% (for example pages I~to X and then 1~to 10,
+% thus number of pages \hbox{\textquotedblleft 20\textquotedblright ,}
+% but name of the last page \hbox{\textquotedblleft 10\textquotedblright ),}
+% or another package has output after this package,
+% or the page numbers exceed a certain range,
% there might be problems, which can be solved by using the
% \xpackage{pageslts} package instead.
% \end{abstract}
@@ -289,9 +289,9 @@ In memoriam
% package is \textquotedblleft advertised\textquotedblright. The current version
% 2015/12/21 v1.2f of that package has not yet been updated to the new hook mechanism.
% In special cases (for example }|\pagenumbering{fnsymbol}|\textbf{) the current version
-% of that package combined with a current \LaTeX-format fails. Together with about
-% 80~other packages (small to large, public as well as private, some probably obsolete)
-% it is in the update queue.}
+% of that package combined with a current \LaTeX-format fails. Together with a lot of
+% other packages (small to large, public as well as private, some probably obsolete)
+% it is in my update queue.}
%
% \newpage
%
@@ -322,7 +322,7 @@ In memoriam
% |\usepackage{lastpage}|
% \end{quote}
% \noindent in the preamble of your source file
-% (or |\input{lastpage.sty}| if |\usepackage| is unknown).\\
+% (or |\input{lastpage.sty}| if |\usepackage| is unknown).
%
% \indent For example for various draft forms it is desirable to have a
% page reference to the last page, so that e.\,g. page footers can
@@ -342,14 +342,12 @@ In memoriam
% \renewcommand{\@oddfoot}{\@evenfoot}
% \makeatother
%\end{verbatim}
-% \noindent creates footers like\\
-%
-% \textquotedblleft\mbox{\textsl{DRAFT \today}\hspace{1cm}page 7 of 9}\textquotedblright\\
-%
-% \noindent in the compiled document (cf.~the \texttt{lastpage-example} file).\\
+% \noindent creates footers like\smallbreak
+% \textquotedblleft\mbox{\textsl{DRAFT \today}\hspace{1cm}page 7 of 9}\textquotedblright\smallbreak
+% \noindent in the compiled document (cf.~the \texttt{lastpage-example} file).\newline
% If the \xpackage{hyperref} package is used, the references are hyperlinked
% to their aims. If these hyperlinks shall be suppressed, |\pageref*{...}|
-% instead of |\pageref{...}| can be used.\\
+% instead of |\pageref{...}| can be used.\bigbreak
%
% The \xpackage{lastpage} package does not provide the words
% \textquotedblleft page\textquotedblright{} or \textquotedblleft of\textquotedblright{},
@@ -359,11 +357,12 @@ In memoriam
% redefining this.) If you want to change \textquotedblleft page\textquotedblright{} or
% \textquotedblleft of\textquotedblright{} (e.\,g. to another language), you therefore
% have got to look in the used class/package(s)/preamble instead of in the
-% \xpackage{lastpage} package.\\
+% \xpackage{lastpage} package.\bigbreak
%
% If the total \emph{number} of pages of a document is needed,
% the kernel already gives this by |\makeatletter\@abspage@last\makeatother|
% (needs at least two compiler runs).
+% \newpage
%
% \section{Some \textsc{Warnings}\label{sec:warn}}
% \subsection{\texttt{\textbackslash AtEndDocument}\label{ssec:aed}}
@@ -371,12 +370,11 @@ In memoriam
% version of the lastpage package, requiring \LaTeX -format 2022-11-01
% or newer. Instead |\AddToHook{enddocument/afterlastpage}| is used
% and the problem does not arise.}
-%
% \bigskip
%
% \pkg{lastpageclassic.sty} uses |\AtEndDocument| and
% \pkg{lastpage209.sty} redefines \linebreak |\enddocument|.
-% The last two cases are problematic:\\
+% The last two cases are problematic:\newline
% The output of a \LaTeXe{} run is not independent of the order
% in which the packages are loaded. It is often the case that the same
% formats for which one must put tables and figure at the end,
@@ -388,9 +386,9 @@ In memoriam
% to assume that no material will follow what they put into
% |\AtEndDocument|. Therefore a message, which begins with
% \texttt{AED}, is included in every usage of |\AtEndDocument|.
-% \xpackage{lastpage} uses |\AtEndDocument{|\ldots|\clearpage|\ldots|}|, thus\\
+% \xpackage{lastpage} uses |\AtEndDocument{|\ldots|\clearpage|\ldots|}|, thus\newline
%|\usepackage{lastpage}|\ldots|\AtEndDocument{|\textit{something}|}|
-% will place \textit{something} after the |\clearpage|. To place it earlier, use\\
+% will place \textit{something} after the |\clearpage|. To place it earlier, use\newline
% |\AtEndDocument{|\textit{something}|}|\ldots|\usepackage{lastpage}|.
% If the \textit{something} is not known before |\usepackage{lastpage}|,
% you can use for example
@@ -429,7 +427,7 @@ In memoriam
% to the (not so) last page, exclusive of the floats at the end,
% then load in the reverse order. Independent from the order of
% \xpackage{lastpage} and \xpackage{endfloat}, you will still need
-% a version of \xpackage{endfloat} later than 2.0 from 1992.\\
+% a version of \xpackage{endfloat} later than 2.0 from 1992.
%
% Other \LaTeX2.09{} (!) packages also seem to like to redefine
% |\enddocument|. In addition to the old \xpackage{endfloat},
@@ -442,7 +440,7 @@ In memoriam
% and not the \textit{number} of the page is given. For example,
% \texttt{Alph} page numbering scheme and $10$ pages will give \texttt{J} instead of 10,
% \texttt{Roman} page numbering scheme and $10$ pages will give \texttt{X} instead of 10,
-% and so on.\\
+% and so on.\newline
% \indent (The \xpackage{pageslts} package puts |\lastpageref{LastPages}|
% (with \textbf{s} at the end) at your disposal for remediation.)
%
@@ -459,7 +457,7 @@ In memoriam
% (even if \texttt{arabic} is the page numbering scheme of that page).
% For example, for a document with VI+36 pages, it gives
% \textquotedblleft 36\textquotedblright{} as reference to the last page.
-% While this is correct, the total number of pages is $42$.\\
+% While this is correct, the total number of pages is $42$.\newline
% If the total \emph{number} of pages of a document is needed,
% the kernel already gives this by |\makeatletter\@abspage@last\makeatother|.
% The \xpackage{pageslts} package puts |\lastpageref{LastPages}|
@@ -472,7 +470,7 @@ In memoriam
% When the page number was manipulated by |\addtocounter{page}{...}| or
% |\setcounter{page}{...}|, \texttt{LastPage} does not give the total
% \textbf{number} of pages (even if \texttt{arabic} is the page numbering
-% scheme of that page).\\
+% scheme of that page).\newline
% The \xpackage{pageslts} package puts |\lastpageref{LastPages}|
% (with \textbf{s} at the end) at your disposal for remediation:
% \texttt{LastPages} ignores page number manipulation. Also |\@abspage@last|
@@ -482,7 +480,7 @@ In memoriam
% At a page numbering change the page number is reset to one.
% Therefore \texttt{LastPage} does not give the total \textbf{number} of pages
% (even if \texttt{arabic} is the page numbering scheme of that page).
-% Furthermore, now two pages have the same name.\\
+% Furthermore, now two pages have the same name.\newline
% The \xpackage{pageslts} package does not only put
% |\lastpageref{LastPages}| (with \textbf{s} at the end) at your disposal
% for remediation: \texttt{LastPages} also ignores page number manipulation.
@@ -492,11 +490,11 @@ In memoriam
% \subsection{Last pages of different page numbering schemes}
% |\pageref{LastPage}| refers to the (maybe not so) last page of the last
% page numbering scheme. References to the respective last page of the other
-% page numbering schemes are not provided.\\
+% page numbering schemes are not provided.\newline
% The \xpackage{pageslts} package does this with labels
% \texttt{pagesLTS.<numbering scheme>}, where \texttt{<numbering scheme>} is
% e.\,g. arabic, roman, Roman, alph, or Alph.\linebreak
-% For fnsymbol please use |\lastpageref{pagesLTS.fnsymbol}| instead of\\
+% For fnsymbol please use |\lastpageref{pagesLTS.fnsymbol}| instead of\newline
% |\pageref{pagesLTS.fnsymbol}|.
%
% \subsection{Current page}
@@ -505,31 +503,20 @@ In memoriam
% current total/absolute page number e.\,g. with a second
% page numbering scheme, |\addtocounter{page}{...}|, or |\setcounter{page}{...}|,
% and it will not be an arabic number at all,
-% if the current page numbering scheme is not arabic.\\
+% if the current page numbering scheme is not arabic.\newline
% The \xpackage{pageslts} package provides the command
% |\theCurrentPage| and for the current number of pages in the current
-% page numbering scheme\\
+% page numbering scheme\newline
% |\theCurrentPageLocal|. The kernel already provides the
% number of pages, which have been shipped out, as |\the\ReadonlyShipoutCounter|.
% The current page is always |ReadonlyShipoutCounter +1|.
%
% \subsection{First page}
% There is no special label at the first page.
-% (This is the \textbf{last}\textsf{page} package, after all.)\\
+% (This is the \textbf{last}\textsf{page} package, after all.)\newline
% The \xpackage{pageslts} package creates a label \texttt{pagesLTS.0}
% at the first page of the document.
%
-% \subsection{Using the \xpackage{fnsymbol} page numbering scheme\label{ss:fnsymbol}}
-% \indent Using the \texttt{fnsymbol} page numbering scheme can result in problems!\\
-% When the page, where |\pageref{lastpage}| points at, is in \texttt{fnsymbol}
-% page numbering scheme, this package might screw up --
-% and quite totally for that, especially when used together with \emph{very old}
-% versions of the \xpackage{hyperref} package (e.\,g. \xpackage{hyperref} v6.80x
-% as of 2010/04/17). When testing with version v6.83m as of 2012/11/06 everything
-% seemed to worked fine, but this might not always be the case.\\
-% The \xpackage{pageslts} package with |\lastpageref{lastpage}| and
-% appropriate package options should cope even with this case.
-%
% \subsection{Page counter overflow\label{ss:overflow}}
% \indent \textquotedblleft The ranges of supported counter values are more or less
% restricted. Only \cs{arabic} can be used with any counter value \TeX{} supports.
@@ -552,31 +539,32 @@ In memoriam
% \texttt{MAX} = \texttt{2147483647}
% \end{quote}
% \textquotedblright{} (\textsc{Heiko Oberdiek}:
-% The \xpackage{alphalph} package, 2010/04/18, v2.3, first table, p.~2).\\
+% The \xpackage{alphalph} package, 2010/04/18, v2.3, first table, p.~2).
%
-% \noindent When \textit{any} page is out of that range, there will be a counter overflow.\\
+% \noindent When \textit{any} page is out of that range, there will be a counter overflow.\newline
% \xpackage{lastpage} probably is not the right package to be asked
% to correct this anyway, but the \xpackage{pageslts} package
% (with appropriate options) can do this.
%
% \subsection{Other packages manipulating \texttt{\textbackslash lastpage@putlabel}}
-% The \xpackage{hyperref} package redefines the |\lastpage@putlabel| command,
-% and the \xpackage{revtex4} class redefines the |\lastpage@putlabel| command,
-% and the \xpackage{hyperref} package redefines the |\lastpage@putlabel| command,
-% if the \xpackage{revtex4} class is used, and the \xpackage{pageslts} package
+% The \xpackage{hyperref} package redefined the |\lastpage@putlabel| command,
+% and the \xpackage{revtex4} class still redefines the |\lastpage@putlabel| command,
+% and the \xpackage{hyperref} package redefined the |\lastpage@putlabel| command,
+% if the \xpackage{revtex4} class was used, and the \xpackage{pageslts} package
% \textquotedblleft kills\textquotedblright{} the |\lastpage@putlabel| command,
-% because that package uses more advanced labels.\\
+% because that package uses more advanced labels.\newline
% In my humble opinion it would be preferably if one package (the original one,
% i.\,e. \xpackage{lastpage}) would do the job right, all others packages would
% check for the version of that package, and if an old version is found,
% an error (or at least a warning) message about the use of an outdated
% package is given, and \textit{then} as
% \textquotedblleft last aid\textquotedblright{} the command of the outdated
-% package is redefined.\\
+% package is redefined.\newline
% Therefore here none of the definitions or commands of the other packages
% is altered, but |\lastpage@putlabel| was replaced by |\lastpage@putl@bel|.
% Because |\lastpage@putlabel| is no longer called, now there should not be any
% double definitions of the \texttt{lastpage} label.
+% \newpage
%
% \section{Alternatives\label{sec:Alternatives}}
% There are similar packages, which do (or do not) similar things (or even more).
@@ -598,26 +586,24 @@ In memoriam
% \xpackage{lastpage} package, but it became obvious that a replacement was
% needed to accomplish what the \xpackage{pageslts} package does. For backward
% compatibility, a label named |LastPage| is provided.
-% Thus |\usepackage{lastpage}| can be replaced by\\
-% |\usepackage[pagecontinue=false,alphMult=0,AlphMulti=0,|\\
-% | fnsymbolmult=false,romanMult=false,RomanMulti=false]{pageslts}|,\\
+% Thus |\usepackage{lastpage}| can be replaced by\newline
+% |\usepackage[pagecontinue=false,alphMult=0,AlphMulti=0,|\newline
+% | fnsymbolmult=false,romanMult=false,RomanMulti=false]{pageslts}|,\newline
% if the behaviour of the \xpackage{lastpage} package should be simulated.
-% The default options are\\
-% |\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,|\\
-% |fnsymbolmult=true,romanMult=true,RomanMulti=true]{pageslts}|.\\
+% The default options are\newline
+% |\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,|\newline
+% |fnsymbolmult=true,romanMult=true,RomanMulti=true]{pageslts}|.\newline
% Benefits of \xpackage{pageslts} package (with appropriate options) are:
% \begin{description}
-% \item[+] Labels \texttt{LastPage} (|\AtEndDocument|) and\\
-% \texttt{VeryLastPage} (|\AfterLastShipout|),\\
+% \item[+] Labels \texttt{LastPage} (|\AtEndDocument|) and\newline
+% \texttt{VeryLastPage} (|\AfterLastShipout|),\newline
% allowing the user to refer to the (very) last page of a document.
% \item[+] For example, when more than one page numbering scheme is used,
% the label \texttt{LastPage}\textbf{s} gives the total \textit{number} of pages.
-% \item[+] At the last page of each page numbering
-% scheme a label\\
-% \texttt{pagesLTS.<numbering scheme>} is
-% placed, where \texttt{<numbering scheme>} is e.\,g.
-% arabic, roman, Roman, alph, or Alph. For fnsymbol
-% please use |\lastpageref{pagesLTS.fnsymbol}| instead of\\
+% \item[+] At the last page of each page numbering scheme a label\newline
+% \texttt{pagesLTS.<numbering scheme>} is placed, where
+% \texttt{<numbering scheme>} is e.\,g. arabic, roman, Roman, alph, or Alph.
+% For fnsymbol please use |\lastpageref{pagesLTS.fnsymbol}| instead of\newline
% |\pageref{pagesLTS.fnsymbol}|.
% \item[+] When the same numbering scheme is used twice, the page numbers
% are either reset to one or continued automatically, depending on the option
@@ -646,7 +632,7 @@ In memoriam
% \DescribeMacro{totpages}\vspace{-\baselineskip}
% \begin{description}
% \item[-] The \xpackage{totpages} package provides a \texttt{totpages} label similar to
-% \texttt{LastPages}\\
+% \texttt{LastPages}\newline
% |\AtEndDocument| (instead of |\AfterLastShipout|, as done by \xpackage{pageslts}).
% The \xpackage{totpages} package additionally computes the number of paper sheets
% needed to (double) print the document (with one, two, three,\ldots{} pages on
@@ -661,12 +647,12 @@ In memoriam
% \item[-] \textquotedblleft There is a package \xpackage{nofm.sty} available,
% but some versions of it are defective, and most don't work with \xpackage{fancyhdr}
% because they take over the complete page layout.\textquotedblright (\textsc{Piet van %
-% Oostrum}: Page layout in \LaTeX{}, March~2, 2004, section~16; fancyhdr.pdf)\\
-% \xpackage{nofm} as of 1991/02/25 (without version number), available at\\
+% Oostrum}: Page layout in \LaTeX{}, March~2, 2004, section~16; fancyhdr.pdf)\newline
+% \xpackage{nofm} as of 1991/02/25 (without version number), available at\newline
% \href{https://mirror.ctan.org/obsolete/macros/latex209/contrib/misc/nofm.sty}{%
% https://mirror.ctan.org/obsolete/macros/latex209/contrib/misc/nofm.sty}, \linebreak
% does not work with e.\,g. \xpackage{hyperref}, redefines |\enddocument|
-% as well as |\@oddhead|, |\@evenhead|, |\@oddfoot|, and |\@evenfoot|.\\
+% as well as |\@oddhead|, |\@evenhead|, |\@oddfoot|, and |\@evenfoot|.\newline
% If you know the (CTAN) location of a \textbf{working}~(!) version,
% please send an e-mail to the \xpackage{lastpage} maintainer, thanks!
% \end{description}
@@ -729,10 +715,9 @@ In memoriam
% \bigskip
%
% \noindent (You programmed or found another alternative,
-% which is available at \url{CTAN.org}?\\
+% which is available at \url{CTAN.org}?\newline
% OK, send an e-mail to me with the name, location at \url{CTAN.org},
-% and a short notice, and I will probably include it in the list above.)\\
-%
+% and a short notice, and I will probably include it in the list above.)
% \smallskip
%
% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}.
@@ -741,21 +726,19 @@ In memoriam
%
% \begin{macrocode}
%<*example>
-\documentclass[british]{article}[2022/07/02]% v1.4n Standard LaTeX document class
+\documentclass[british]{article}[2023/05/17]% v1.4n Standard LaTeX document class
\makeatletter
\@ifl@t@r\fmtversion{2022/11/01}{%
\AddToHook{enddocument/afterlastpage}[lastpage]{%
\message{^^JLaTeX Info: Executing hook `enddocument/afterlastpage'.}}%
}{\AtEndDocument{\message{^^JLaTeX Info: Executing hook `AtEndDocument'.}}%
}
-\makeatother
-\usepackage[draft]{showkeys}[2022/04/12]% v3.18 Show cite and label keys (DPC, MH)
+\usepackage[draft]{showkeys}[2023/05/11]% v3.19 Show cite and label keys (DPC, MH)
%% Use final instead of draft to hide the keys. %%
-\usepackage{hyperref}[2023-02-07]% v7.00v Hypertext links for LaTeX
+\usepackage[pdfpagelabels=true,hyperindex=false]{hyperref}[2023-07-08]% v7.01b
+%% Hypertext links for LaTeX
\hypersetup{extension=pdf,%
plainpages=false,%
- pdfpagelabels=true,%
- hyperindex=false,%
pdflang={en},%
pdftitle={lastpage package example},%
pdfauthor={H.-Martin Muench},%
@@ -765,13 +748,8 @@ In memoriam
pdfstartview=Fit,%
pdfpagelayout=SinglePage%
}
-%% If hyperref is not used, the url package
-%% https://ctan.org/pkg/url
-%% must be loaded for the \url used in this example:
-%% \usepackage{url}
-%% or just use \let\url\texttt for the one used url.
-\usepackage{lastpage}[2023-04-12]% v2.0b
-\makeatletter
+\@ifpackageloaded{hyperref}{}{\usepackage{url}[2013/09/16]}% v3.4
+\usepackage{lastpage}[2023-07-24]% v2.0c
\renewcommand{\@evenfoot}{%
\normalsize\slshape \today\hfil \upshape %
page \thepage{} of \pageref{LastPage}}
@@ -783,7 +761,7 @@ In memoriam
\section*{Example for lastpage}
\markboth{Example for lastpage}{Example for lastpage}
This example demonstrates the use of package\newline
-\textsf{lastpage}, v2.0b as of 2023-04-12 (HMM; JPG).\newline
+\textsf{lastpage}, v2.0c as of 2023-07-24 (HMM; JPG).\newline
The package takes no options.\newline
For more details please see the documentation!\newline
@@ -808,7 +786,7 @@ trademark owner. There is no intention of infringement; the
usage is to the benefit of the trademark owner.\newline
\textbf{Tip}: Use \textit{logical page numbers}
-for the display of the pdf (in Adobe Acrobat Reader 2022.003.20322:
+for the display of the pdf (in Adobe Acrobat Reader 2023.003.20244:
Edit $>$ Preferences $>$ Page Display $>$
Page Content and Information: Use logical page numbers)!\newline
@@ -863,16 +841,17 @@ The code does not generally work even without hyperref.
\end{quote}
\noindent does work, because \verb|\lastpage@lastpage| contains the name
-of the page, example:\newline
-\verb|Page \thepage{} is page \makeatletter\lastpage@lastpage\makeatother.|%
-\newline
+of the page, \mbox{example:}
+\begin{verbatim}
+Page \thepage{} is (not) page \makeatletter\lastpage@lastpage\makeatother.
+\end{verbatim}
prints:\newline
-Page \thepage{} is page \makeatletter\lastpage@lastpage\makeatother.%
+Page \thepage{} is (not) page \makeatletter\lastpage@lastpage\makeatother.
\newline
This can be broken for example by \verb|\pagenumbering{fnsymbol}|.
\newpage
-\noindent The page (\verb|\thepage|): \thepage \newline
+\noindent The page (\verb|\thepage|): \thepage\newline
Last page's name (LastPage): \pageref{LastPage}
\bigskip
@@ -907,8 +886,8 @@ Last page's name (LastPage): \pageref{LastPage}
\bigskip
To see the content of the \texttt{enddocument/afterlastpage}-hook
-(for a recent \LaTeX-format!) use
-\verb|\ShowHook{enddocument/afterlastpage}|.% without the \verb||, of course!
+(for a recent \LaTeX-format!) use % without the \verb||, of course!
+\verb|\ShowHook{enddocument/afterlastpage}|.
\end{document}
%</example>
% \end{macrocode}
@@ -919,7 +898,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \DescribeMacro{lastpage.sty}
% We first need to determine whether we are on \TeX~2.09 or \LaTeX2e.\newline
% (That line, which is too long for the documentation, reads:\newline
-% |\def\loadlastpage{\ProvidesPackage{lastpage}[2023/04/12 v2.0b lastpage:|\linebreak
+% |\def\loadlastpage{\ProvidesPackage{lastpage}[2023/07/24 v2.0c lastpage:|\linebreak
% | 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}|.)
%
% \begin{macrocode}
@@ -927,7 +906,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%% Part of the "lastpage" package
%% loads either lastpage2.09.sty for TeX 2.09 or lastpage2e.sty for LaTeX 2e
%% with code from https://groups.google.com/g/comp.text.tex/c/-Qmhj1ZI4xM
-\def\loadlastpage{\ProvidesPackage{lastpage}[2023/04/12 v2.0b lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
+\def\loadlastpage{\ProvidesPackage{lastpage}[2023/07/24 v2.0c lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
\begingroup \expandafter \ifx \csname documentclass\endcsname\relax
\endgroup \expandafter \input{lastpage209.sty}
\else \endgroup \expandafter \loadlastpage
@@ -943,8 +922,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%% Part of the "lastpage" package
%% FOR LaTeX 2.09 ONLY - FOR LaTeX 2e USE lastpage2e.sty
%% This is lastpage209.sty invented by Jeffrey P. Goldberg,
-%% after Piet van Oostrum: Page layout in LaTeX, March 2, 2004, section 16; fancyhdr.pdf;
-%% lastpage209.sty maintained by H.-Martin Muench.
+%% after Piet van Oostrum: Page layout in LaTeX, March 2, 2004, section 16;
+%% fancyhdr.pdf; lastpage209.sty maintained by H.-Martin Muench.
\let\origenddocument=\enddocument%
\def\enddocument{\clearpage%
{\addtocounter{page}{-1}%
@@ -957,7 +936,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
%
% \DescribeMacro{lastpage2e.sty}
-% If |\documentclass| is known, we are in \LaTeXe{} - but which one?
+% If |\documentclass| is known, we are in \LaTeXe{} -- but which one?
% For modern versions with \eTeX{} and hook management etc.
% we load version \pkg{lastpagemodern.sty}, otherwise
% \pkg{lastpageclassic.sty}. We start off by checking that we are
@@ -967,7 +946,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpage2e>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpage2e}[2023/04/12 v2.0b Decide which 2e lastpage version to use (HMM)]
+\ProvidesPackage{lastpage2e}[2023/07/24 v2.0c %
+ Decide which 2e lastpage version to use (HMM)]
\@ifl@t@r\fmtversion{2022/11/01}{\RequirePackage{lastpagemodern}}{%
\RequirePackage{lastpageclassic}}
\message{^^J}
@@ -981,8 +961,10 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpageclassic>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpageclassic}[2023/04/12 v2.0b Refers to last page's name (HMM; JPG)]
-%% allows for things like "Page \thepage{} of \pageref{LastPage}" to get "Page 7 of 9"
+\ProvidesPackage{lastpageclassic}[2023/07/24 v2.0c %
+ Refers to last page's name (HMM; JPG)]
+%% allows for things like "Page \thepage{} of \pageref{LastPage}"
+%% to get "Page 7 of 9"
% \end{macrocode}
%
@@ -1018,7 +1000,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \indent |\AtBeginDocument| we give a waring about ancient versions of the \pkg{endfloat} package.
% Then it is checked whether various packages are loaded.
% (|\@ifpackageloaded| cannot be used later than |\AtBeginDocument|.)
-% If this is the case,\\
+% If this is the case,\newline
% |\lastpage@<package abbreviation>| is defined as \texttt{1}
% (otherwise it stays~\texttt{0}).
%
@@ -1043,24 +1025,22 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
%
% |\lastpage@putlabel|, used by older versions of this package,
-% is redefined e.\,g. by \xpackage{revtex}, \xpackage{hyperref},
-% \xpackage{frenchle}, and \xpackage{PPRcorners}.
+% is redefined e.\,g. by \xpackage{revtex}, \xpackage{frenchle},
+% \xpackage{PPRcorners}, and old versions of \xpackage{hyperref}.
% While now |\lastpage@putl@bel| is used instead, \xpackage{revtex}
-% or \xpackage{hyperref} could also define a label \texttt{LastPage},
+% could also define a label \texttt{LastPage},
% which then would be multiply defined. (Which is no big issue,
% if it is associated with the same page.) Therefore we define
%
% \begin{macrocode}
\gdef\lastpage@putlabel{\relax}%
-% \end{macrocode}
-%
-% Because |\lastpage@putlabel| might be (re)defined later, depending on the order
-% in which the packages are loaded, we will do this again |\AtEndDocument|.
-%
-% \begin{macrocode}
}
% \end{macrocode}
+%
+% \noindent Because |\lastpage@putlabel| might be (re)defined later,
+% depending on the order in which the packages are loaded,
+% we will do this again |\AtEndDocument|.
% \end{macro}
%
% \begin{macro}{\lastpage@putl@bel}
@@ -1070,13 +1050,13 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\newcommand{\lastpage@putl@bel}{%
% \end{macrocode}
%
-% |\AtBeginDocument| it is checked whether the \xpackage{hyperref} package is loaded,\\
-% |\@ifpackageloaded{hyperref}{\gdef\lastpage@hyper{1}}{}|.\\
-% |\@ifpackageloaded| cannot be used later than |\AtBeginDocument|.\\
+% |\AtBeginDocument| it is checked whether the \xpackage{hyperref} package is loaded,\newline
+% |\@ifpackageloaded{hyperref}{\gdef\lastpage@hyper{1}}{}|.\newline
+% |\@ifpackageloaded| cannot be used later than |\AtBeginDocument|.\newline
% User \textsc{Sebastian Bank} found and reported (Thanks!) a~case, when this check is not
-% sufficient. Using a class with\\
-% |\usepackage{lastpage}|\\
-% |\AtBeginDocument{\usepackage{hyperref}}|\\
+% sufficient. Using a class with\newline
+% |\usepackage{lastpage}|\newline
+% |\AtBeginDocument{\usepackage{hyperref}}|\newline
% leads to failed detection of the \xpackage{hyperref} package, because
% |\AtBeginDocument| \textit{first} the check for \xpackage{hyperref} is performed,
% and \textit{then} \xpackage{hyperref} is loaded. As mentioned above,
@@ -1105,7 +1085,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\else%
% \end{macrocode}
%
-% Otherwise the label is set:\\
+% Otherwise the label is set:\newline
% We have got to distinguish whether \xpackage{hyperref} has been loaded or not:
%
% \begin{macrocode}
@@ -1173,8 +1153,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% the write out, we need to do an |\immediate| write into the \xfile{aux} file.
%
% \begin{macrocode}
-%% The following code is from the hyperref package %%
-%% 2010/04/17 v6.80x; newer versions are available. %%
+%% with code from \Hy@EveryPageAnchor of the hyperref package,
+%% 2010/04/17 v6.80x; newer versions are available
\let\@number\@firstofone%
\ifHy@pageanchor%
\ifHy@hypertexnames%
@@ -1182,23 +1162,16 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\def\Hy@temp{\arabic{page}}%
\else%
\Hy@unicodefalse%
-%% Code not from hyperref package: %%
-%% The following lines are taken from the pageslts package, %%
-%% which in turn got them from the hyperref package and %%
-%% modified them. %%
-%% Without the modification, after the first shipout "PD1" %%
-%% is inserted each time |\pdfstringdef\Hy@temp{\thepage}| %%
-%% is executed. %%
\ifnum \value{page}=1\relax%
% \end{macrocode}
%
% We do not count the pages ourselves, and so they could have been changed by
-% e.\,g. |\pagenumbering{...}|, |\addtocounter{page}{...}|,\\
+% e.\,g. |\pagenumbering{...}|, |\addtocounter{page}{...}|,\newline
% |\setcounter{page}{...}|. Thus the page might have the number one
% while not being the first page at all. Using the \xpackage{everyshi}
% package would help, but this package should not require other packages.
% The \xpackage{pageslts} package does a better handling, but requires
-% some other packages.\\
+% some other packages.\newline
% We will make a mistake here at most once:
%
% \begin{macrocode}
@@ -1206,18 +1179,11 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\def\Hy@temp{\thepage}%
\gdef\lastpage@firstpage{0}%
\else%
-%% Code from hyperref package again: %%
\pdfstringdef\Hy@temp{\thepage}%
-%% End of code from the hyperref package. %%
\fi%
-%% The pageslts package would even check for fnsymbol page %%
-%% numbering scheme and adapt the code correspondingly. %%
\else%
-%% Code from hyperref package again: %%
\pdfstringdef\Hy@temp{\thepage}%
-%% Code from pageslts package again: %%
\fi%
-%% Code from hyperref package again: %%
\fi%
\else%
\def\Hy@temp{\the\Hy@pagecounter}%
@@ -1227,7 +1193,6 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\string\newlabel{LastPage}{{}{\thepage}{}{%
\ifHy@pageanchor page.\Hy@temp\fi}{}}%
}%
-%% End of code from the hyperref package. %%
% \end{macrocode}
%
% We also save the values, so that we can later (next rerun) check,
@@ -1241,7 +1206,6 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\immediate\write\@auxout{\string\gdef\string\lastpage@lastpageHy{}}%
\fi%
% \end{macrocode}
-% \pagebreak
%
% After the writeout we restore the page number again,
% since there might be other things still to be done.
@@ -1253,6 +1217,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
% \end{macro}
+% \newpage
%
% \begin{macro}{\lastpage@putlabelNR}
% \indent The \xpackage{nameref} package redefines |\label| to have five arguments
@@ -1317,7 +1282,6 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
% \end{macro}
-% \pagebreak
%
% \begin{macro}{\lastpage@fileswtestHy}
% \indent When the \xpackage{hyperref} package has been loaded,
@@ -1333,7 +1297,6 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\lastpage@fileswtest{\empty}{\lastpage@lastpageHy}%
\fi%
}
-
% \end{macrocode}
% \end{macro}
%
@@ -1343,6 +1306,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% whether it is still unchanged, which is OK for the first run only.
%
% \begin{macrocode}
+
\AtEndDocument{%
\ifx\lastpage@LTS\lastpage@one%
\else%
@@ -1411,7 +1375,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpagemodern>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
-\ProvidesPackage{lastpagemodern}[2023-04-12 v2.0b Refers to last page's name (HMM; JPG)]
+\ProvidesPackage{lastpagemodern}[2023-07-24 v2.0c %
+ Refers to last page's name (HMM; JPG)]
%% allows for things like "Page \thepage{} of \pageref{LastPage}"
%% to get "Page 7 of 9" or "Page VII of IX";
%% the NUMBER of pages is available via \@abspage@last, but with pages
@@ -1439,46 +1404,47 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
%
% \DescribeMacro{\AddToHook\{begindocument/end\}}
-% \indent At |begindocument/end| we give a warning about ancient versions
-% of the \pkg{endfloat} package.
-%
-% \begin{macrocode}
-\AddToHook{begindocument/end}{%
- \IfPackageLoadedTF{endfloat}{%
- \IfPackageAtLeastTF{endfloat}{1994/06/01}{\relax}{%
- \PackageError{lastpage}{%
- Incompatibility with outdated version of endfloat package}{%
- lastpage is not fully compatible with a version\MessageBreak%
- before 2.1 of the endfloat package,\MessageBreak%
- because those versions redefined\MessageBreak%
- the \string\enddocument\space command.}%
- }}{}%
-% \end{macrocode}
-%
-% |\lastpage@putlabel|, used by older versions of this package,
-% is redefined e.\,g. by \xpackage{revtex}, \xpackage{hyperref},
-% \xpackage{frenchle}, and \xpackage{PPRcorners}.
+% \indent |\lastpage@putlabel|, used by older versions of this package,
+% is redefined e.\,g. by \xpackage{revtex}, \xpackage{frenchle},
+% \xpackage{PPRcorners}, and old versions of \xpackage{hyperref}.
% While now |\lastpage@putl@bel| is used instead, \xpackage{revtex}
-% or \xpackage{hyperref} could also define a label \texttt{LastPage},
+% could also define a label \texttt{LastPage},
% which then would be multiply defined. (Which is no big issue,
% if it is associated with the same page.) Therefore we define
%
% \begin{macrocode}
- \gdef\lastpage@putlabel{\relax}%
+\AddToHook{begindocument/end}{\gdef\lastpage@putlabel{\relax}}
+
% \end{macrocode}
%
% Because |\lastpage@putlabel| might be (re)defined later, depending on the order
% in which the packages are loaded, we will do this again at the end of the document.
%
+% \begin{macro}{\protected@iwrite}
+% \indent We need an |\immediate\protected@write|. Just |\immediate\write| had led to errors,
+% for example when pakets like \pkg{babel-greek} re-defined |\roman|\ %
+% (thanks to Ulrike Fischer for the report).
+%
% \begin{macrocode}
+%% From https://tex.stackexchange.com/a/542425 with thanks to
+%% Prof. Enrico Gregorio
+\long\def\protected@iwrite#1#2#3{%
+ \begingroup%
+ #2%
+ \let\protect\@unexpandable@protect%
+ \edef\reserved@a{\immediate\write#1{#3}}%
+ \reserved@a%
+ \endgroup%
+ \if@nobreak\ifvmode\nobreak\fi\fi%
}
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\lastpage@putl@bel}
% \indent This command does the writing of the label.
-% If the \xpackage{pageslts} package is used, this \xpackage{lastpage} package is
-% not needed at all. The \xpackage{LastPage} label would even be defined twice.
+% If the \xpackage{pageslts} package is used, this \xpackage{lastpage} package
+% is not needed at all. The \xpackage{LastPage} label would even be defined twice.
% Thus, if \xpackage{pageslts} is used, here nothing is done.
%
% \begin{macrocode}
@@ -1486,175 +1452,117 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\IfPackageLoadedTF{pageslts}{\relax}{%
% \end{macrocode}
%
-% Otherwise the label is set:\\
-% We have got to distinguish whether \xpackage{hyperref} has been loaded or not:
-%
-% \begin{macrocode}
- \IfPackageLoadedTF{hyperref}{\lastpage@putlabelhyper}{%
-% \end{macrocode}
-%
-% and also need to treat documents with \xpackage{nameref} differently:
-%
-% \begin{macrocode}
- \IfPackageLoadedTF{nameref}{\lastpage@putlabelNR}{%
-% \end{macrocode}
+% \noindent Otherwise the label is set:\newpage
%
-% When those packages have not been loaded, we just write the
-% simple label into the \xfile{aux} file (and store the value of the page):
+% \noindent If the \xpackage{hyperref} package is used, but page-anchors are disabled,
+% the hyperlinking will not work.
%
% \begin{macrocode}
- \begingroup%
- \addtocounter{page}{-1}%
- \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}%
- \immediate\write\@auxout{\string\xdef\string\lastpage@lastpage{\thepage}}%
- \immediate\write\@auxout{\string\gdef\string\lastpage@lastpageHy{}}%
- \addtocounter{page}{+1}%
- \endgroup%
- }%
- }%
- }%
- }
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\lastpage@putlabelhyper}%
-% \indent When \xpackage{hyperref} has been loaded, the label is set with the
-% |\lastpage@putlabelhyper| command. If the \xpackage{hyperref} package is used,
-% but page-anchors are disabled, the hyperlinking will not work.
-%
-% \begin{macrocode}
-\newcommand{\lastpage@putlabelhyper}{%
- \ifHy@pageanchor%
- \else%
- \PackageError{lastpage}{hyperref option pageanchor disabled}{%
- The \string\pageref{LastPage} link does not work\MessageBreak%
- using hyperref with disabled option `pageanchor'.\MessageBreak%
- }%
- \fi%
+ \IfPackageLoadedTF{hyperref}{\ifHy@pageanchor\else%
+ \PackageError{lastpage}{hyperref option pageanchor disabled}{%
+ The \string\pageref{LastPage} link does not work\MessageBreak%
+ using hyperref with disabled option `pageanchor'.\MessageBreak%
+ }\fi}{}%
+ \begingroup%
% \end{macrocode}
%
-% Since the page has been put out, we are on the page \textit{after} that page.
+% \noindent Since the page has been put out, we are on the page \textit{after} that page.
% We therefore subtract one from the page counter. (For the compiler,
% this is equal to |\advance\c@page\m@ne|, but for human readers of the code
% it is probably easier to understand.)
%
% \begin{macrocode}
- \begingroup%
- \addtocounter{page}{-1}%
+ \addtocounter{page}{-1}%
% \end{macrocode}
%
-% Simply using |\label| for \texttt{LastPage} would not work,
+% \noindent Simply using |\label| for \texttt{LastPage} would not work,
% because labels wait for the output routines to work, and there
-% may be no more invocations of the output routines. To force
-% the write out, we need to do an |\immediate| write into the \xfile{aux} file.
-%
-% \begin{macrocode}
-%% The following code is from the hyperref package %%
-%% 2010/04/17 v6.80x; newer versions are available. %%
- \let\@number\@firstofone%
- \ifHy@pageanchor%
- \ifHy@hypertexnames%
- \ifHy@plainpages%
- \def\Hy@temp{\arabic{page}}%
- \else%
- \Hy@unicodefalse%
-%% Code not from hyperref package: %%
-%% The following lines are taken from the pageslts package, %%
-%% which in turn got them from the hyperref package and %%
-%% modified them. %%
-%% Without the modification, after the first shipout "PD1" %%
-%% is inserted each time |\pdfstringdef\Hy@temp{\thepage}| %%
-%% is executed. %%
- \ifnum \value{page}=1\relax%
-% \end{macrocode}
-%
-% We do not count the pages ourselves, and so they could have been changed by
-% e.\,g. |\pagenumbering{...}|, |\addtocounter{page}{...}|,\\
-% |\setcounter{page}{...}|. Thus the page might have the number one
-% while not being the first page at all. Using the (obsolete) \xpackage{everyshi}
-% package would help, but this package should not require other packages.
-% The \xpackage{pageslts} package does a better handling, but requires
-% some other packages.\\
-% We will make a mistake here at most once:
+% may be no more invocations of the output routines.
+% To force the write out, we need to do an |\immediate| protected write
+% into the \xfile{aux} file.
%
% \begin{macrocode}
- \ifx \lastpage@firstpage\lastpage@one\relax%
- \def\Hy@temp{\thepage}%
- \gdef\lastpage@firstpage{0}%
+ \IfPackageLoadedTF{hyperref}{%
+ % with code from \Hy@EveryPageAnchor of the hyperref package,
+ % 2023-07-08 v7.01b
+ \ifHy@pageanchor%
+ \ifHy@hypertexnames%
+ \ifHy@plainpages%
+ \def\Hy@temp{\the\c@page}%
+ \def\Hy@TempPageAnchor{\hyper@@anchor{page.\the\c@page}}%
+ \Hy@PageAnchorSlidesPlain%
\else%
-%% Code from hyperref package again: %%
- \pdfstringdef\Hy@temp{\thepage}%
-%% End of code from the hyperref package. %%
- \fi%
-%% The pageslts package would even check for fnsymbol page %%
-%% numbering scheme and adapt the code correspondingly. %%
+ % No \begingroup, because we are in a group anyway.
+ \let\@number\@firstofone%
+ \Hy@unicodefalse%
+ \Hy@PageAnchorSlide%
+ \pdfstringdef\@the@H@page{\thepage}%
+ % No \endgroup, because we are in a group anyway.
+ \EdefUnescapeString\@the@H@page{\@the@H@page}%
+ \def\Hy@TempPageAnchor{\hyper@@anchor{page.\@the@H@page}}%
+ \def\Hy@temp{\@the@H@page}%
+ \fi%
\else%
-%% Code from hyperref package again: %%
- \pdfstringdef\Hy@temp{\thepage}%
-%% Code from pageslts package again: %%
+ % NOT! \Hy@GlobalStepCount\Hy@pagecounter
+ \def\Hy@TempPageAnchor{\hyper@@anchor{page.\the\Hy@pagecounter}}%
+ \def\Hy@temp{\the\Hy@pagecounter}%
\fi%
-%% Code from hyperref package again: %%
\fi%
- \else%
- \def\Hy@temp{\the\Hy@pagecounter}%
- \fi%
- \fi%
- \immediate\write\@auxout{%
- \string\newlabel{LastPage}{{}{\thepage}{}{%
- \ifHy@pageanchor page.\Hy@temp\fi}{}}%
- }%
-%% End of code from the hyperref package. %%
+ }{}%
+ \IfFormatAtLeastTF{2023/06/01}{%
% \end{macrocode}
%
-% We also save the values, so that we can later (next rerun) check,
-% whether they have been saved in the \xfile{aux} file.
+% \noindent The |\label| command has been extended, see \LaTeX{} News Issue~37,
+% June~2023 (\LaTeX{} release 2023-06-01),
+% \url{https://www.latex-project.org/news/latex2e-news/ltnews37.pdf}.
%
% \begin{macrocode}
- \immediate\write\@auxout{\string\xdef\string\lastpage@lastpage{\thepage}}%
- \ifHy@pageanchor%
- \immediate\write\@auxout{\string\xdef\string\lastpage@lastpageHy{\Hy@temp}}%
- \else%
- \immediate\write\@auxout{\string\gdef\string\lastpage@lastpageHy{}}%
- \fi%
+ \protected@iwrite\@auxout{}{\string\newlabel{LastPage}{%
+ {\@currentlabel}%
+ {\IfPackageLoadedTF{hyperref}{\string\begingroup%
+ \string\pdfstringdefDisableCommands{\string\let%
+ \string\TextOrMath\string\@firstoftwo}\thepage%
+ \string\endgroup%
+ }{\thepage}}%
+ {\@currentlabelname}%
+ {\IfPackageLoadedTF{hyperref}{\ifHy@pageanchor page.\Hy@temp\fi%
+ }{\@currentHref}}%
+ {\@kernel@reserved@label@data}}}%
+ }{\IfPackageLoadedTF{hyperref}{\protected@iwrite\@auxout{}{%
+ \string\newlabel{LastPage}{{}{\thepage}{}{%
+ \ifHy@pageanchor page.\Hy@temp\fi}{}}}%
+ }{\IfPackageLoadedTF{nameref}{\protected@iwrite\@auxout{}{%
+ \string\newlabel{LastPage}{{}{\thepage}{}{}{}}}%
+ }{\protected@iwrite\@auxout{}{\string\newlabel{LastPage}{%
+ {}{\thepage}}}%
+ }%
+ }%
+ }%
% \end{macrocode}
%
-% After the writeout we restore the page number again,
-% since there might be other things still to be done.
+% \noindent We also save the values, so that we can later (next rerun) check,
+% whether they have been saved in the \xfile{aux} file.
%
% \begin{macrocode}
- \addtocounter{page}{+1}%
- \endgroup%
- }
-
+ \protected@iwrite\@auxout{}{\string\gdef\string\lastpage@lastpage{\thepage}}%
+ \gdef\lastpage@Hy{\IfPackageLoadedTF{hyperref}{\ifHy@pageanchor\Hy@temp\fi}{}}%
+ \protected@iwrite\@auxout{}{\string\gdef\string\lastpage@lastpageHy{\lastpage@Hy}}%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\lastpage@putlabelNR}
-% \indent The \xpackage{nameref} package redefines |\label| to have five arguments
-% instead of two, therefore
-% \newline
-% |\newlabel{LastPage}{{}{\thepage}{}{}{}}|
-% instead of\newline
-% |\newlabel{LastPage}{{}{\thepage}}| must be used:
+% \noindent After the writeout we restore the page number again,
+% since there might be other things still to be done.
%
% \begin{macrocode}
-\newcommand{\lastpage@putlabelNR}{%
- \begingroup%
- \addtocounter{page}{-1}%
- \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}{}{}{}}}%
- \immediate\write\@auxout{\string\xdef\string\lastpage@lastpage{\thepage}}%
- \immediate\write\@auxout{\string\gdef\string\lastpage@lastpageHy{}}%
- \addtocounter{page}{+1}%
- \endgroup%
+ \addtocounter{page}{+1}%
+ \endgroup%
+ }%
}
% \end{macrocode}
% \end{macro}
-% \pagebreak
%
% \begin{macro}{\lastpage@fileswtest}
-% \indent Later it will be determined whether it is allowed to write
+% \indent \hspace*{2em}Later it will be determined whether it is allowed to write
% to the \xfile{aux} file. If it was \emph{not} allowed, it is checked
% whether the label was already set via the \xfile{aux} file in some
% earlier compilation run. (There are packages where the document
@@ -1694,9 +1602,10 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{macrocode}
% \end{macro}
+% \newpage
%
% \begin{macro}{\lastpage@fileswtestHy}
-% \indent When the \xpackage{hyperref} package has been loaded,
+% \indent \hspace*{2em}When the \xpackage{hyperref} package has been loaded,
% |\lastpage@lastpageHy| must be tested additionally. (And a
% |\newcommand| is needed, because |\ifHy@pageanchor| is not even
% defined when \xpackage{hyperref} has not been loaded.)
@@ -1730,7 +1639,6 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
}%
\gdef\lastpage@putlabel{\relax}%
% \end{macrocode}
-% \pagebreak
%
% It is checked whether writing to files is allowed
% (otherwise, only an error message is issued and nothing is done).
@@ -1739,8 +1647,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
\if@filesw%
% \end{macrocode}
%
-% We put in a |\message| to show, in what order things (which were called)
-% are done.
+% We put in a |\message| to show, in what order things (which were called) are done.
%
% \begin{macrocode}
\message{^^Jenddocument/afterlastpage: lastpage setting LastPage.^^J}%
@@ -1768,19 +1675,19 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
}
%</lastpagemodern>
% \end{macrocode}
-% \pagebreak
+% \newpage
%
% \section{Installation}
% \subsection{Downloads\label{ss:Downloads}}
% Everything is available at \url{https://www.ctan.org},
-% but may need additional packages themselves.\\
+% but may need additional packages themselves.
%
% \DescribeMacro{lastpage.dtx}
% For unpacking the |lastpage.dtx| file and constructing the documentation it is required:
% \begin{description}
% \item[-] \TeX Format \LaTeXe{}: \url{https://www.CTAN.org}
%
-% \item[-] document class \xclass{ltxdoc}, 2022/06/22, v2.1i,
+% \item[-] document class \xclass{ltxdoc}, 2023/03/28, v2.1j,
% \url{https://ctan.org/pkg/ltxdoc}
%
% \item[-] package \xpackage{holtxdoc}, 2019/12/09, v0.30,
@@ -1793,7 +1700,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX, \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-04-12, v2.0b,
+% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1803,10 +1710,10 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX-format \LaTeX{}, v2.09
%
-% \item[-] package \xpackage{lastpage209}, 2023-04-12, v2.0b,
+% \item[-] package \xpackage{lastpage209}, 2023-07-24, v2.0c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
-% and does not work with \xpackage{hyperref}, which needs \LaTeX2e{}.\\
+% and does not work with \xpackage{hyperref}, which needs \LaTeX2e{}.
%
% \DescribeMacro{lastpage2e.sty}
% The |lastpage2e.sty| for \LaTeXe{} (i.\,e. each document using
@@ -1815,7 +1722,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} 1994/12/01 or newer,
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-04-12, v2.0b,
+% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1823,15 +1730,15 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% The |lastpageclassic.sty| for \LaTeXe{} (i.\,e. each document using
% the \xpackage{lastpageclassic} package) requires:
% \begin{description}
-% \item[-] \TeX-format \LaTeXe{} between 1994/12/01 and 2022/11/01,\\
+% \item[-] \TeX-format \LaTeXe{} between 1994/12/01 and 2022/11/01,\newline
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-04-12, v2.0b,
+% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
% \begin{description}
-% \item[-] package \xpackage{hyperref}, 2023-02-07, v7.00v,
+% \item[-] package \xpackage{hyperref}, 2023-07-08, v7.01b,
% \url{https://ctan.org/pkg/hyperref}
% \end{description}
%
@@ -1839,15 +1746,15 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% The |lastpagemodern.sty| for \LaTeXe{} (i.\,e. each document using
% the \xpackage{lastpagemodern} package) requires:
% \begin{description}
-% \item[-] \TeX-format \LaTeXe{} 2022-11-01 or newer,
+% \item[-] \TeX-format \LaTeXe{} 2022-11-01, better yet 2023-06-01 or newer,
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-04-12, v2.0b,
+% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
% \begin{description}
-% \item[-] package \xpackage{hyperref}, 2023-02-07, v7.00v,
+% \item[-] package \xpackage{hyperref}, 2023-07-08, v7.01b,
% \url{https://ctan.org/pkg/hyperref}
% \end{description}
%
@@ -1855,21 +1762,21 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% The |lastpage-example.tex| requires the same file as all
% documents using the \xpackage{lastpage} package, i.\,e.
% \begin{description}
-% \item[-] package \xpackage{lastpage}, 2023-04-12, v2.0b,
-% \url{https://ctan.org/pkg/lastpage}\\
+% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
+% \url{https://ctan.org/pkg/lastpage}\newline
% (Well, it is the example file for this package, and because you are reading the
% documentation for the \xpackage{lastpage} package, it can be assumed that you already
% have some version of it -- is it the current one?)
% \end{description}
% and additionally:
% \begin{description}
-% \item[-] class \xpackage{article}, 2022/07/02, v1.4n, from \xpackage{classes}:
+% \item[-] class \xpackage{article}, 2023-05-17, v1.4n, from \xpackage{classes}:
% \url{https://ctan.org/pkg/classes}
%
-% \item[-] package \xpackage{showkeys}, 2022/04/12, v3.18,
+% \item[-] package \xpackage{showkeys}, 2023-05-11, v3.19,
% \url{https://ctan.org/pkg/showkeys}
%
-% \item[-] package \xpackage{hyperref}, 2023-02-07, v7.00v,
+% \item[-] package \xpackage{hyperref}, 2023-07-08, v7.01b,
% \url{https://ctan.org/pkg/hyperref}
% \end{description}
%
@@ -1890,7 +1797,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \xpackage{fancyheadings}), but because they were mentioned, also they are listed
% here:
% \begin{description}
-% \item[-] package \xpackage{fancyhdr}, 2022/11/09, v4.1,
+% \item[-] package \xpackage{fancyhdr}, 2022-11-09, v4.1,
% \url{https://ctan.org/pkg/fancyhdr}
%
% \item[-] package \xpackage{nccfancyhdr}, 2004/12/07, v1.1,
@@ -1910,8 +1817,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] package \xpackage{pageslts}, 2015/12/21, v1.2f,
% \url{https://ctan.org/pkg/pageslts}
%
-% \item[-] package \xpackage{papermas}, 2011/08/22, v1.0h; the \xpackage{papermas}
-% package can be considered as kind of add-on to the \xpackage{pageslts} package.\\
+% \item[-] package \xpackage{papermas}, 2023-04-12, v1.1a; the \xpackage{papermas}
+% package can be considered as kind of add-on to the \xpackage{pageslts} package.\newline
% \url{https://ctan.org/pkg/papermas}
%
% \item[-] package \xpackage{count1to}, 2009/05/24, v2.1,
@@ -1933,7 +1840,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] package \xpackage{zref}, 2022-04-07, v2.34,
% \url{https://ctan.org/pkg/zref}
%
-% \item[-] class \xpackage{memoir}, 2022-11-17, 3.7.19,
+% \item[-] class \xpackage{memoir}, 2022-11-17, v3.7.19,
% \url{https://ctan.org/pkg/memoir}.
% \end{description}
%
@@ -1942,25 +1849,24 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \DescribeMacro{zref}
% All packages of the `oberdiek' bundle
% (especially \xpackage{holtxdoc} and \xpackage{zref})
-% are also available in a TDS compliant ZIP archive:\\
-% \url{https://mirror.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip}.\\
+% are also available in a TDS compliant ZIP archive:\newline
+% \url{https://mirror.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip}.\newline
% It is probably best to download and use this, because the packages in there
-% are quite probably both recent and compatible among themselves.\\
+% are quite probably both recent and compatible among themselves.\par
%
% \DescribeMacro{hyperref}
% \noindent \xpackage{hyperref} is not included in that bundle and needs to be
-% downloaded separately,\\
-% \url{https://mirror.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\\
+% downloaded separately,\newline
+% \url{https://mirror.ctan.org/install/macros/latex/contrib/hyperref.tds.zip}.\par
%
% \DescribeMacro{Münch}
-% A hyperlinked list of my (other) packages can be found at\\
+% A hyperlinked list of my (other) packages can be found at\newline
% \url{https://ctan.org/author/muench-hm}.
-% \pagebreak
%
% \subsection{Package, unpacking TDS}
% \paragraph{Package.} This package is available on \url{https://www.CTAN.org}.
% \begin{description}
-% \item[\url{https://mirror.ctan.org/macros/latex/contrib/lastpage/lastpage.dtx}]\hspace*{0.1cm} \\
+% \item[\url{https://mirror.ctan.org/macros/latex/contrib/lastpage/lastpage.dtx}]\hspace*{0.1cm} \newline
% The source file.
% \item[\url{https://mirror.ctan.org/macros/latex/contrib/lastpage/lastpage.pdf}]\hspace*{0.1cm} \\
% The documentation.
@@ -1997,7 +1903,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \verb|tex lastpage.dtx|
% \end{quote}
%
-% About generating the documentation see paragraph~\ref{GenDoc} below.\\
+% \noindent About generating the documentation see paragraph~\ref{GenDoc} below.\par
%
% \paragraph{TDS.} Now the different files must be moved into
% the different directories in your installation TDS tree
@@ -2123,10 +2029,10 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \end{quote}
%
% \subsection{Compiling the example}
-% The example file, \textsf{lastpage-example.tex}, can be compiled via\\
-% \indent |latex lastpage-example.tex|\\
-% or (recommended)\\
-% \indent |pdflatex lastpage-example.tex|\\
+% The example file, \textsf{lastpage-example.tex}, can be compiled via\newline
+% \indent |latex lastpage-example.tex|\newline
+% or (recommended)\newline
+% \indent |pdflatex lastpage-example.tex|\newline
% and will need at least two compiler runs to get all references right.
%
% \section{Acknowledgements}
@@ -2139,13 +2045,11 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% I know about creating a file in \xfile{dtx} format, OK, say it: copying),
% and the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex}
% newsgroups for their help in all things \TeX{}. Thanks for bug reports
-% to \textsc{Ulrike Fischer}, \textsc{Sebastian Bank}, \textsc{James Hedges},
+% to \textsc{Ulrike Fischer} (twice), \textsc{Sebastian Bank}, \textsc{James Hedges},
% \textsc{Mikhail Titov}, \textsc{Micha\l{} Herman}, and \textsc{Matteo Gamboz}.
% Thanks to \textsc{Sven Siegmund} for pointing out a necessary further
% explanation in the documentation.
%
-% \pagebreak
-%
% \phantomsection
% \begin{History}\label{History}
% \begin{Version}{1994/06/17 v0.99a}
@@ -2155,9 +2059,9 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item Last version number created by \textsc{Jeffrey P. Goldberg}.
% \end{Version}
% \begin{Version}{1994/07/20 v0.1b (again)}
-% \item Documentation updated by \textsc{Jeffrey P. Goldberg}.\\
+% \item Documentation updated by \textsc{Jeffrey P. Goldberg}.\newline
% The main source code of the \xpackage{lastpage} package 1994/07/20,
-% v0.1b, was:\\
+% v0.1b, was:
% \begin{verbatim}
% \NeedsTeXFormat{LaTeX2e}[1994/06/01]
% \ProvidesPackage{lastpage}[1994/07/20 v0.1b
@@ -2171,11 +2075,9 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \clearpage\lastpage@putlabel}%
% \endinput
% \end{verbatim}
-% and then the \xpackage{hyperref} package and the \xpackage{revtex4}
-% class even redefine\\
-% |\lastpage@putlabel| (at least \xpackage{hyperref} version
-% 2012/11/06, v6.83m, and
-% REV\TeX{}4 version 2010/07/25, v4.1r, still did this).
+% and then the \xpackage{hyperref} package (2012/11/06, v6.83m)
+% even redefined |\lastpage@putlabel|; the \xpackage{REV\TeX{}4}
+% class 2022-06-05, v4.2f, still does this.
% \end{Version}
% \begin{Version}{2010/02/18 v1.1}
% \item Proposed |LastPages| label by \textsc{H.-Martin Münch}
@@ -2189,8 +2091,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \xpackage{fancyhdr} package at all.
% \item Included \textsf{lastpage209.sty} for \LaTeX2.09{}.
% \item Replacement of |\filedate|, |-version|, |-name|,\ldots{} because
-% of \LaTeX{}~bug 2705:\\
-% Synopsis: Possible problem with |\fileversion| and |\filedate|\\
+% of \LaTeX{}~bug 2705:\newline
+% Synopsis: Possible problem with |\fileversion| and |\filedate|\newline
% \url{https://www.latex-project.org/cgi-bin/ltxbugs2html?category=LaTeX&responsible=anyone&state=anything&keyword=lastpage&pr=latex/2705}
% \item Example |lastpage-example.tex|.
% \item Alternatives listing (section \ref{sec:Alternatives}).
@@ -2218,7 +2120,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% |\AtBeginDocument|, when placing the \texttt{lastpage} label it is also
% checked for the |\hyperref| command, in case \xpackage{hyperref} was not
% loaded at |\begin{document}| yet. (Bug reported by \textsc{Sebastian Bank},
-% thanks!) [lastpagemodern.sty just uses |\IfPackageLoadedTF{hyperref}|.]
+% thanks!)\newline
+% [\pkg{lastpagemodern.sty} just uses |\IfPackageLoadedTF{hyperref}|.]
% \item Changed the |\unit| definition (got rid of an old |\rm|). [Removed in v2.0a.]
% \item Changed |\lastpage@puthyperlabel| to |\lastpage@putlabelhyper| analogous to
% |\pagesLTS@putlabelhyper| of the \xpackage{pageslts} package.
@@ -2229,8 +2132,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{Version}{2010/08/25 v1.2d}
% \item Bug fix: also \xpackage{tcilatex} defines the |\hyperref| command,
% therefore for \xpackage{hyperref} package detection this had to be
-% changed to |\Hy@Warning|.
-% [lastpagemodern just uses |\IfPackageLoadedTF{hyperref}|.]
+% changed to |\Hy@Warning|.\newline
+% [\pkg{lastpagemodern.sty} just uses |\IfPackageLoadedTF{hyperref}|.]
% \end{Version}
% \begin{Version}{2010/09/12 v1.2e}
% \item \textsc{James Hedges} pointed out, that there was no instruction in the
@@ -2241,7 +2144,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item Updated to version 2010/09/13 v6.81n of the \xpackage{hyperref} package.
% \item New version of REV\TeX{}4\ 2010/07/25, v4.1r, old problem.
% \item New version of \xpackage{pagesLTS} package, 2010/09/22, v1.1k.
-% \item Moved the package from \texttt{.../latex/muench/lastpage/...} to\\
+% \item Moved the package from \texttt{.../latex/muench/lastpage/...} to\newline
% \texttt{.../latex/lastpage/...}.
% \end{Version}
% \begin{Version}{2011/02/01 v1.2g}
@@ -2270,11 +2173,12 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% to the \xfile{aux} file. (Bug reported by \textsc{Mikhail Titov}.)
% \end{Version}
% \begin{Version}{2011/09/01 v1.2k}
-% \item Fixed |\thepage{}| to |\thepage{} |, where there should be a space.
-% \item New version of the \xpackage{hyperref} package, 2011/08/19, v6.82h, but
-% still problem with links to pages with
+% \item Fixed |\thepage{}| to \mbox{|\thepage{}|\textvisiblespace,}
+% where there should be a space.
+% \item New version of the \xpackage{hyperref} package, 2011/08/19, v6.82h,
+% but still problem with links to pages with
% page-\textquotedblleft number\textquotedblright{} in \texttt{fnsymbol}
-% pagenumbering scheme. [Seems to be fixed since v6.83m as of 2012/11/06.]
+% pagenumbering scheme. [Fixed since v6.83m as of 2012/11/06.]
% \item Documentation update about \textquotedblleft No write access to the
% \xfile{aux} file\textquotedblright .
% \item New version of \xpackage{regstats} package available.
@@ -2289,7 +2193,8 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% instead of two, therefore |\newlabel{LastPage}{{}{\thepage}{}{}{}}| instead of
% |\newlabel{LastPage}{{}{\thepage}}| must be used.
% (Bug reported at \url{https://tex.stackexchange.com/q/95541},
-% thanks to \textsc{Micha\l{} Herman}!) Fixed.
+% thanks to \textsc{Micha\l{} Herman}!) Fixed.\newline
+% [Since \LaTeX{} release 2023-06-01 five arguments are standard.]
% \end{Version}
% \begin{Version}{2015/03/29 v1.2m}
% \item Updated to \TeX{} Live 2014 (for compiling the documentation and example).
@@ -2306,7 +2211,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item Removed |\unit|.
% \item \pkg{lastpage} should now determine automatically, whether to load
% its \TeX~2.09 version, classic \LaTeX2e-version, or modern version
-% with \eTeX, hook-management etc.
+% with \eTeX, hook{-}man\-age\-ment etc.
% \item Converted to UTF-8.
% \item Updated to \LaTeX{} format 2022-11-01.
% \item Extensive updates to the documentation (manual \& README) and to the example.
@@ -2314,6 +2219,15 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{Version}{2023-04-12 v2.0b}
% \item Bug fix: What should have been |}}{}| was |}{}}|. Thanks to \textsc{Matteo Gamboz}!
% \end{Version}
+% \begin{Version}{2023-07-24 v2.0c}
+% \item Since \LaTeX{} release 2023-06-01 labels have always five arguments.
+% \item Removed the incompatibility warning regarding \pkg{endfloat}
+% before 1994-06-01~(!) from \pkg{lastpagemodern.sty}.
+% \item Replaced |\immediate\write| by a form of (pseudo-code!) |\immediate\protected@write|.
+% (Thanks to \textsc{Ulrike Fischer} for the error report and solution!)
+% \item Update of the |\lastpage@putl@bel| code to \pkg{hyperref} 2023-07-08, v7.01b,
+% which now allows fnsymbol as page numbering scheme.
+% \end{Version}
% \end{History}
% \bigskip
%
diff --git a/macros/latex/contrib/lastpage/lastpage.pdf b/macros/latex/contrib/lastpage/lastpage.pdf
index 67a493ada8..064afaac10 100644
--- a/macros/latex/contrib/lastpage/lastpage.pdf
+++ b/macros/latex/contrib/lastpage/lastpage.pdf
Binary files differ