texlive[68473] Master/texmf-dist: lastpage (7oct23)

commits+karl at tug.org commits+karl at tug.org
Sat Oct 7 22:15:04 CEST 2023


Revision: 68473
          https://tug.org/svn/texlive?view=revision&revision=68473
Author:   karl
Date:     2023-10-07 22:15:04 +0200 (Sat, 07 Oct 2023)
Log Message:
-----------
lastpage (7oct23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/lastpage/README
    trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf
    trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
    trunk/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf
    trunk/Master/texmf-dist/source/latex/lastpage/lastpage.drv
    trunk/Master/texmf-dist/source/latex/lastpage/lastpage.dtx
    trunk/Master/texmf-dist/source/latex/lastpage/lastpage.ins
    trunk/Master/texmf-dist/tex/latex/lastpage/lastpage.sty
    trunk/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty
    trunk/Master/texmf-dist/tex/latex/lastpage/lastpage2e.sty
    trunk/Master/texmf-dist/tex/latex/lastpage/lastpageclassic.sty
    trunk/Master/texmf-dist/tex/latex/lastpage/lastpagemodern.sty

Modified: trunk/Master/texmf-dist/doc/latex/lastpage/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lastpage/README	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/doc/latex/lastpage/README	2023-10-07 20:15:04 UTC (rev 68473)
@@ -1,4 +1,4 @@
-README for lastpage package, 2023-07-24, v2.0c
+README for lastpage package, 2023-10-06, v2.0d
 
 
 TABLE OF CONTENTS

Modified: trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -79,7 +80,7 @@
  pdfpagelayout=SinglePage%
 }
 \@ifpackageloaded{hyperref}{}{\usepackage{url}[2013/09/16]}% v3.4
-\usepackage{lastpage}[2023-07-24]% v2.0c
+\usepackage{lastpage}[2023-10-06]% v2.0d
 \renewcommand{\@evenfoot}{%
  \normalsize\slshape \today\hfil \upshape %
  page \thepage{} of \pageref{LastPage}}
@@ -91,7 +92,7 @@
 \section*{Example for lastpage}
 \markboth{Example for lastpage}{Example for lastpage}
 This example demonstrates the use of package\newline
-\textsf{lastpage}, v2.0c as of 2023-07-24 (HMM; JPG).\newline
+\textsf{lastpage}, v2.0d as of 2023-10-06 (HMM; JPG).\newline
 The package takes no options.\newline
 For more details please see the documentation!\newline
 
@@ -116,7 +117,7 @@
 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 2023.003.20244:
+for the display of the pdf (in Adobe Acrobat Reader 2023.006.20320:
 Edit $>$ Preferences $>$ Page Display $>$
 Page Content and Information: Use logical page numbers)!\newline
 
@@ -164,7 +165,7 @@
 \addtocounter{page}{8}
 \edef\here{\thepage}
 \makeatletter
-\ifx\here\lastpage at lastpage\relax foo \else bar \fi
+\ifx\here\lastpage at lastpage\relax foo\else bar\fi
 \makeatother
 \end{document}
 \end{verbatim}
@@ -178,7 +179,8 @@
 prints:\newline
 Page \thepage{} is (not) page \makeatletter\lastpage at lastpage\makeatother.
 \newline
-This can be broken for example by \verb|\pagenumbering{fnsymbol}|.
+This can be broken for example by \verb|\pagenumbering{fnsymbol}|
+(because then \verb|\edef\here{\thepage}| does not work).
 \newpage
 
 \noindent The page (\verb|\thepage|): \thepage\newline
@@ -188,16 +190,15 @@
 With modern \LaTeX{} it is possible to say:
 \begin{quote}
 \begin{verbatim}
-\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\NeedsTeXFormat{LaTeX2e}[2023-06-01]
 \documentclass{article}
 \pagenumbering{fnsymbol}
 \begin{document}
 \addtocounter{page}{8}%
-\makeatletter%
 \ExplSyntaxOn%
 \xdef\test{\numexpr\the\g_shipout_readonly_int +1\relax}%
 \ExplSyntaxOff%
-\ifnum \@abspage at last = \test\relax%
+\ifnum\PreviousTotalPages=\test\relax%
 This is the last page.%
 \else%
 This is not the last page
@@ -204,7 +205,6 @@
 (or it is but \LaTeX{} needs another compilation run
 to detect this).
 \fi
-\makeatother
 \end{document}
 \end{verbatim}
 \end{quote}

Modified: trunk/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/lastpage/lastpage.drv
===================================================================
--- trunk/Master/texmf-dist/source/latex/lastpage/lastpage.drv	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/source/latex/lastpage/lastpage.drv	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -58,7 +59,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2022-11-01]
 \ProvidesFile{lastpage.drv}%
-  [2023-07-24 v2.0c Refers to last page's name (HMM)]
+  [2023-10-06 v2.0d 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{%

Modified: trunk/Master/texmf-dist/source/latex/lastpage/lastpage.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/lastpage/lastpage.dtx	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/source/latex/lastpage/lastpage.dtx	2023-10-07 20:15:04 UTC (rev 68473)
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 %
 % File: lastpage.dtx
-% Version: 2023-07-24 v2.0c
+% Version: 2023-10-06 v2.0d
 % Info: Refers to last page's name
 %
 % Copyright © 2010 - 2023 by
@@ -18,7 +18,8 @@
 %
 % While this package 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 nowadays available via \@abspage at last from the kernel,
+% the NUMBER of pages is nowadays available from the kernel
+% (\@abspage at last, \thetotalpages, \PreviousTotalPages),
 % but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 % while the name of the last page is "10". Decide what you need/want!
 %
@@ -65,7 +66,7 @@
 \input docstrip.tex
 \Msg{**********************************************************************}
 \Msg{* Installation                                                       *}
-\Msg{* Package: lastpage 2023-07-24 v2.0c Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2023-10-06 v2.0d Refers to last page's name (HMM)*}
 \Msg{**********************************************************************}
 
 \keepsilent
@@ -77,7 +78,7 @@
 This is a generated file.
 
 Project: lastpage
-Version: 2023-07-24 v2.0c
+Version: 2023-10-06 v2.0d
 Info: Refers to last page's name
 
 Copyright (C) 2010 - 2023 by
@@ -108,7 +109,8 @@
 
 While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 to get "Page 7 of 9" or "Page VII of IX",
-the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+the NUMBER of pages is nowadays available from the kernel
+(slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 while the name of the last page is "10". Decide what you need/want!
 
@@ -184,7 +186,7 @@
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}[2022-11-01]
 \ProvidesFile{lastpage.drv}%
-  [2023-07-24 v2.0c Refers to last page's name (HMM)]
+  [2023-10-06 v2.0d 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{%
@@ -237,19 +239,19 @@
 % \DoNotIndex{\enddocument,\ExplSyntaxOff,\ExplSyntaxOn,\fmtversion}
 % \DoNotIndex{\g,\gdef,\here,\hfil,\Hy at temp,\Hy at unicodefalse}
 % \DoNotIndex{\hypersetup,\if at filesw,\if at nobreak,\ifHy at hypertexnames,\ifHy at pageanchor,\ifHy at plainpages}
-% \DoNotIndex{\ifnum,\IfPackageAtLeastTF,\IfPackageLoadedTF,\ifvmode,\ifx,\immediate,\input}
+% \DoNotIndex{\ifdim,\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{\lastpageclassic.sty,\lastpagemodern.sty,\LaTeX,\LaTeX-kernel,\listfiles}
 % \DoNotIndex{\makeatletter,\makeatother,\markboth,\mbox,\message,\MessageBreak}
-% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newline,\newpage,\nobreak}
+% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newcounter,\newline,\newpage,\nobreak}
 % \DoNotIndex{\noindent,\normalsize,\numexpr,\origenddocument,\PackageError}
 % \DoNotIndex{\PackageWarning,\pagenumbering,\pageref,\pdfstringdef,\protect,\ProvidesPackage}
-% \DoNotIndex{\qquad,\RequirePackage,\section,\slshape,\smallskip,\space,\test,\textbf}
+% \DoNotIndex{\qquad,\RequirePackage,\section,\ShowHook,\slshape,\smallskip,\space,\test,\textbf}
 % \DoNotIndex{\textit,\textquotedblleft,\textquotedblright,\textsf,\texttt,\the,\thepage}
-% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\write}
+% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\wd,\write}
 %
 % \title{The \xpackage{lastpage} package}
-% \date{2023-07-24 v2.0c}
+% \date{2023-10-06 v2.0d}
 % \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}\\
 %   invented by Jeffrey P. Goldberg\\\xemail{jeffrey+news at goldmark.org}}
 %
@@ -264,7 +266,8 @@
 % \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 at last| from the kernel,
+% the \emph{number} of pages is nowadays available from the kernel
+% (|\@abspage at last|, |\thetotalpages|, |\PreviousTotalPages|),
 % 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 ,}
@@ -360,8 +363,8 @@
 % \xpackage{lastpage} package.\bigbreak
 %
 % If the total \emph{number} of pages of a document is needed,
-% the kernel already gives this by |\makeatletter\@abspage at last\makeatother|
-% (needs at least two compiler runs).
+% the kernel already gives this by |\makeatletter\@abspage at last\makeatother|,
+% |\thetotalpages|, and |\PreviousTotalPages| (needing at least two compiler runs).
 % \newpage
 %
 % \section{Some \textsc{Warnings}\label{sec:warn}}
@@ -459,7 +462,8 @@
 % \textquotedblleft 36\textquotedblright{} as reference to the last page.
 % 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 at last\makeatother|.
+% the kernel already gives this by |\makeatletter\@abspage at last\makeatother|,
+% |\thetotalpages|, and |\PreviousTotalPages|.
 % The \xpackage{pageslts} package puts |\lastpageref{LastPages}|
 % (with \textbf{s} at the end) at your disposal for remediation,
 % giving the number of pages and linking to the last page, if linking is provided
@@ -473,8 +477,9 @@
 % 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 at last|
-% from the kernel is not influenced by page number manipulation.
+% \texttt{LastPages} ignores page number manipulation. Also |\@abspage at last|,
+% |\thetotalpages|, and |\PreviousTotalPages| from the kernel
+% are not influenced by page number manipulation.
 %
 % \subsection{Page number reset by \texttt{\textbackslash pagenumbering\{\ldots\}}}
 % At a page numbering change the page number is reset to one.
@@ -702,14 +707,16 @@
 %
 % \DescribeMacro{LaTeX-kernel}\vspace{-\baselineskip}
 % \begin{description}
-% \item[-] The number of pages is nowadays available via |\@abspage at last|
-%  from the kernel, but when more than one page numbering scheme is used
+% \item[-] The number of pages is nowadays available via |\@abspage at last|,
+%  |\thetotalpages|, and |\PreviousTotalPages| 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,
-%  there might be problems.
+%  there might be issues. (Is the total number of pages wanted? Or is the name
+%  of the last page sought?)
 % \end{description}
 %
 % \bigskip
@@ -749,7 +756,7 @@
  pdfpagelayout=SinglePage%
 }
 \@ifpackageloaded{hyperref}{}{\usepackage{url}[2013/09/16]}% v3.4
-\usepackage{lastpage}[2023-07-24]% v2.0c
+\usepackage{lastpage}[2023-10-06]% v2.0d
 \renewcommand{\@evenfoot}{%
  \normalsize\slshape \today\hfil \upshape %
  page \thepage{} of \pageref{LastPage}}
@@ -761,7 +768,7 @@
 \section*{Example for lastpage}
 \markboth{Example for lastpage}{Example for lastpage}
 This example demonstrates the use of package\newline
-\textsf{lastpage}, v2.0c as of 2023-07-24 (HMM; JPG).\newline
+\textsf{lastpage}, v2.0d as of 2023-10-06 (HMM; JPG).\newline
 The package takes no options.\newline
 For more details please see the documentation!\newline
 
@@ -786,7 +793,7 @@
 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 2023.003.20244:
+for the display of the pdf (in Adobe Acrobat Reader 2023.006.20320:
 Edit $>$ Preferences $>$ Page Display $>$
 Page Content and Information: Use logical page numbers)!\newline
 
@@ -834,7 +841,7 @@
 \addtocounter{page}{8}
 \edef\here{\thepage}
 \makeatletter
-\ifx\here\lastpage at lastpage\relax foo \else bar \fi
+\ifx\here\lastpage at lastpage\relax foo\else bar\fi
 \makeatother
 \end{document}
 \end{verbatim}
@@ -848,7 +855,8 @@
 prints:\newline
 Page \thepage{} is (not) page \makeatletter\lastpage at lastpage\makeatother.
 \newline
-This can be broken for example by \verb|\pagenumbering{fnsymbol}|.
+This can be broken for example by \verb|\pagenumbering{fnsymbol}|
+(because then \verb|\edef\here{\thepage}| does not work).
 \newpage
 
 \noindent The page (\verb|\thepage|): \thepage\newline
@@ -858,16 +866,15 @@
 With modern \LaTeX{} it is possible to say:
 \begin{quote}
 \begin{verbatim}
-\NeedsTeXFormat{LaTeX2e}[2022-11-01]
+\NeedsTeXFormat{LaTeX2e}[2023-06-01]
 \documentclass{article}
 \pagenumbering{fnsymbol}
 \begin{document}
 \addtocounter{page}{8}%
-\makeatletter%
 \ExplSyntaxOn%
 \xdef\test{\numexpr\the\g_shipout_readonly_int +1\relax}%
 \ExplSyntaxOff%
-\ifnum \@abspage at last = \test\relax%
+\ifnum\PreviousTotalPages=\test\relax%
 This is the last page.%
 \else%
 This is not the last page
@@ -874,7 +881,6 @@
 (or it is but \LaTeX{} needs another compilation run
 to detect this).
 \fi
-\makeatother
 \end{document}
 \end{verbatim}
 \end{quote}
@@ -898,7 +904,7 @@
 % \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/07/24 v2.0c lastpage:|\linebreak
+% |\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/06 v2.0d lastpage:|\linebreak
 % | 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}|.)
 %
 %    \begin{macrocode}
@@ -906,7 +912,7 @@
 %% 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/07/24 v2.0c lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
+\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/06 v2.0d 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
@@ -946,7 +952,7 @@
 %<*lastpage2e>
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpage2e}[2023/07/24 v2.0c %
+\ProvidesPackage{lastpage2e}[2023/10/06 v2.0d %
   Decide which 2e lastpage version to use (HMM)]
 \@ifl at t@r\fmtversion{2022/11/01}{\RequirePackage{lastpagemodern}}{%
                                  \RequirePackage{lastpageclassic}}
@@ -961,7 +967,7 @@
 %<*lastpageclassic>
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpageclassic}[2023/07/24 v2.0c %
+\ProvidesPackage{lastpageclassic}[2023/10/06 v2.0d %
   Refers to last page's name (HMM; JPG)]
 %% allows for things like "Page \thepage{} of \pageref{LastPage}"
 %% to get "Page 7 of 9"
@@ -1375,12 +1381,12 @@
 %<*lastpagemodern>
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[2022-11-01]
-\ProvidesPackage{lastpagemodern}[2023-07-24 v2.0c %
+\ProvidesPackage{lastpagemodern}[2023-10-06 v2.0d %
   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 at last, but with pages
-%% for example I to X and then 1 to 10, the number of pages woud be "20",
+%% for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 
 %    \end{macrocode}
@@ -1403,6 +1409,53 @@
 
 %    \end{macrocode}
 %
+% People use the label |LastPage| for calculations, for example with
+% \begin{quote}
+%\begin{verbatim}
+%\getrefbykeydefault{LastPage}{page}{0}
+%\end{verbatim}
+% \end{quote}
+% and with
+% \begin{quote}
+%\begin{verbatim}
+%\getpagerefnumber{LastPage}
+%\end{verbatim}
+% \end{quote}
+% (using the \pkg{refcount} package). On the one hand, direct calculations do not work,
+% if the page \textquotedblleft number\textquotedblright{} is not
+% a plain arabic number (1, 2, 3,\ldots) but |alph| (a, b, c,\ldots), |Alph| (A, B, C,\ldots),
+% |roman| (i, ii, iii, iv,\ldots), |Roman| (I, II, III, IV,\ldots),
+% |fnsymbol| (foot note symbols: \textasteriskcentered{} (asterisk), \textdagger{} (dagger),
+% \textdaggerdbl{} (double dagger), \textsection{} (section symbol),\ldots) or some other fancy name.
+% On the other hand, if the page number \emph{is} a plain arabic number,
+% calculations do work, if that plain number can be extracted from the label.
+% To handle non-numeric page \textquotedblleft number\textquotedblright{} as well as providing
+% extractable numeric page numbers, we need to determine (later), whether a page number is numeric or not:
+%
+% \begin{macro}{\lastpage at gobbleminus}
+%    \begin{macrocode}
+\newcommand\lastpage at gobbleminus[1]{\ifx-#1\else#1\fi}
+%% from https://texfaq.org/FAQ-isitanum
+
+%    \end{macrocode}
+% \end{macro}
+%    \begin{macrocode}
+\newcounter{lastpagecount}
+
+%    \end{macrocode}
+% \begin{macro}{\lastpage at IfNumericTF}
+%    \begin{macrocode}
+\newcommand{\lastpage at IfNumericTF}[3]{%
+%% similar to https://tex.stackexchange.com/a/17119
+\sbox\z@{\c at lastpagecount=0\lastpage at gobbleminus{#1}\relax}%
+\ifdim\wd0>\z@\relax#3% is not numeric
+\else#2% is numeric
+\fi%
+}
+
+%    \end{macrocode}
+% \end{macro}
+%
 % \DescribeMacro{\AddToHook\{begindocument/end\}}
 % \indent |\lastpage at putlabel|, used by older versions of this package,
 % is redefined e.\,g. by \xpackage{revtex}, \xpackage{frenchle},
@@ -1422,7 +1475,7 @@
 %
 % \begin{macro}{\protected at iwrite}
 % \indent We need an |\immediate\protected at write|. Just |\immediate\write| had led to errors,
-% for example when pakets like \pkg{babel-greek} re-defined |\roman|\ %
+% for example when packages like \pkg{babel-greek} re-defined |\roman|\ %
 % (thanks to Ulrike Fischer for the report).
 %
 %    \begin{macrocode}
@@ -1441,6 +1494,42 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% We need two macros for writing numeric and non-numeric page
+% \textquotedblleft numbers\textquotedblright{} into the \xfile{aux} file:
+%
+% \begin{macro}{\lastpage at numeric}
+%    \begin{macrocode}
+\newcommand{\lastpage at numeric}{\protected at iwrite\@auxout{}{%
+ \string\newlabel{LastPage}{%
+  {\@currentlabel}%
+  {\thepage}%
+  {\@currentlabelname}%
+  {\IfPackageLoadedTF{hyperref}{\ifHy at pageanchor page.\Hy at temp\fi%
+                               }{\@currentHref}}%
+  {\@kernel at reserved@label at data}}}%
+ }
+
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lastpage at nonnumeric}
+%    \begin{macrocode}
+\newcommand{\lastpage at nonnumeric}{\protected at 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 at pageanchor page.\Hy at temp\fi%
+                               }{\@currentHref}}%
+  {\@kernel at reserved@label at data}}}%
+ }
+
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\lastpage at putl@bel}
 % \indent This command does the writing of the label.
 % If the \xpackage{pageslts} package is used, this \xpackage{lastpage} package
@@ -1516,18 +1605,10 @@
 % June~2023 (\LaTeX{} release 2023-06-01),
 % \url{https://www.latex-project.org/news/latex2e-news/ltnews37.pdf}.
 %
+% Here we need to distinguish between numeric page numbers, which shall be extractable,
+% and non-numeric ones, which need some protection:
 %    \begin{macrocode}
-        \protected at 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 at pageanchor page.\Hy at temp\fi%
-                                       }{\@currentHref}}%
-          {\@kernel at reserved@label at data}}}%
+        \lastpage at IfNumericTF{\thepage}{\lastpage at numeric}{\lastpage at nonnumeric}%
        }{\IfPackageLoadedTF{hyperref}{\protected at iwrite\@auxout{}{%
             \string\newlabel{LastPage}{{}{\thepage}{}{%
             \ifHy at pageanchor page.\Hy at temp\fi}{}}}%
@@ -1549,7 +1630,7 @@
       \protected at iwrite\@auxout{}{\string\gdef\string\lastpage at lastpageHy{\lastpage at Hy}}%
 %    \end{macrocode}
 %
-% \noindent After the writeout we restore the page number again,
+% \noindent After the write-out we restore the page number again,
 % since there might be other things still to be done.
 %
 %    \begin{macrocode}
@@ -1700,7 +1781,7 @@
 % \begin{description}
 % \item[-] \TeX, \url{https://www.CTAN.org}
 %
-% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
 %   \url{https://ctan.org/pkg/lastpage}
 % \end{description}
 %
@@ -1710,7 +1791,7 @@
 % \begin{description}
 % \item[-] \TeX-format \LaTeX{}, v2.09
 %
-% \item[-] package \xpackage{lastpage209}, 2023-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage209}, 2023-10-06, v2.0d,
 %   \url{https://ctan.org/pkg/lastpage}
 % \end{description}
 % and does not work with \xpackage{hyperref}, which needs \LaTeX2e{}.
@@ -1722,7 +1803,7 @@
 % \item[-] \TeX-format \LaTeXe{} 1994/12/01 or newer,
 %   \url{https://www.CTAN.org}
 %
-% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
 %   \url{https://ctan.org/pkg/lastpage}
 % \end{description}
 %
@@ -1733,7 +1814,7 @@
 % \item[-] \TeX-format \LaTeXe{} between 1994/12/01 and 2022/11/01,\newline
 %   \url{https://www.CTAN.org}
 %
-% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
 %   \url{https://ctan.org/pkg/lastpage}
 % \end{description}
 % and can use
@@ -1746,10 +1827,10 @@
 % The |lastpagemodern.sty| for \LaTeXe{} (i.\,e. each document using
 % the \xpackage{lastpagemodern} package) requires:
 % \begin{description}
-% \item[-] \TeX-format \LaTeXe{} 2022-11-01, better yet 2023-06-01 or newer,
+% \item[-] \TeX-format \LaTeXe{} 2022-11-01, better yet 2023-06-01 or newer,\newline
 %   \url{https://www.CTAN.org}
 %
-% \item[-] package \xpackage{lastpage}, 2023-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
 %   \url{https://ctan.org/pkg/lastpage}
 % \end{description}
 % and can use
@@ -1762,7 +1843,7 @@
 % 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-07-24, v2.0c,
+% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
 %   \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
@@ -1837,10 +1918,10 @@
 % \item[-] package \xpackage{totalcount}, 2018/01/21, v1.0a,
 %   \url{https://ctan.org/pkg/totalcount}
 %
-% \item[-] package \xpackage{zref}, 2022-04-07, v2.34,
+% \item[-] package \xpackage{zref}, 2023-09-14, v2.35,
 %   \url{https://ctan.org/pkg/zref}
 %
-% \item[-] class \xpackage{memoir}, 2022-11-17, v3.7.19,
+% \item[-] class \xpackage{memoir}, 2023-08-21, v3.8.1,
 %   \url{https://ctan.org/pkg/memoir}.
 % \end{description}
 %
@@ -2046,7 +2127,8 @@
 % 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} (twice), \textsc{Sebastian Bank}, \textsc{James Hedges},
-% \textsc{Mikhail Titov}, \textsc{Micha\l{} Herman}, and \textsc{Matteo Gamboz}.
+% \textsc{Mikhail Titov}, \textsc{Micha\l{} Herman}, \textsc{Matteo Gamboz}, and
+% \textsc{James Small}.
 % Thanks to \textsc{Sven Siegmund} for pointing out a necessary further
 % explanation in the documentation.
 %
@@ -2181,7 +2263,6 @@
 %             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.
 %   \end{Version}
 %   \begin{Version}{2013/01/28 v1.2l}
 %     \item Updated to \TeX{} Live 2012 (for compiling the documentation and example).
@@ -2228,6 +2309,11 @@
 %     \item Update of the |\lastpage at putl@bel| code to \pkg{hyperref} 2023-07-08, v7.01b,
 %             which now allows fnsymbol as page numbering scheme.
 %   \end{Version}
+%   \begin{Version}{2023-10-06 v2.0d}
+%     \item For plain arabic page numbers only, \pkg{lastpage} again writes the page number
+%             in a plain format in the label in the \xfile{aux} file, so that it can be extracted
+%             to perform calculations with it.
+%   \end{Version}
 % \end{History}
 % \bigskip
 %

Modified: trunk/Master/texmf-dist/source/latex/lastpage/lastpage.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/lastpage/lastpage.ins	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/source/latex/lastpage/lastpage.ins	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -59,7 +60,7 @@
 \input docstrip.tex
 \Msg{**********************************************************************}
 \Msg{* Installation                                                       *}
-\Msg{* Package: lastpage 2023-07-24 v2.0c Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2023-10-06 v2.0d Refers to last page's name (HMM)*}
 \Msg{**********************************************************************}
 
 \keepsilent
@@ -71,7 +72,7 @@
 This is a generated file.
 
 Project: lastpage
-Version: 2023-07-24 v2.0c
+Version: 2023-10-06 v2.0d
 Info: Refers to last page's name
 
 Copyright (C) 2010 - 2023 by
@@ -102,7 +103,8 @@
 
 While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 to get "Page 7 of 9" or "Page VII of IX",
-the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+the NUMBER of pages is nowadays available from the kernel
+(slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 while the name of the last page is "10". Decide what you need/want!
 

Modified: trunk/Master/texmf-dist/tex/latex/lastpage/lastpage.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lastpage/lastpage.sty	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/tex/latex/lastpage/lastpage.sty	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -59,7 +60,7 @@
 %% 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/07/24 v2.0c lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
+\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/06 v2.0d 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

Modified: trunk/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/lastpage/lastpage2e.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lastpage/lastpage2e.sty	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/tex/latex/lastpage/lastpage2e.sty	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -58,7 +59,7 @@
 %% 
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpage2e}[2023/07/24 v2.0c %
+\ProvidesPackage{lastpage2e}[2023/10/06 v2.0d %
   Decide which 2e lastpage version to use (HMM)]
 \@ifl at t@r\fmtversion{2022/11/01}{\RequirePackage{lastpagemodern}}{%
                                  \RequirePackage{lastpageclassic}}

Modified: trunk/Master/texmf-dist/tex/latex/lastpage/lastpageclassic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lastpage/lastpageclassic.sty	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/tex/latex/lastpage/lastpageclassic.sty	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -58,7 +59,7 @@
 %% 
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpageclassic}[2023/07/24 v2.0c %
+\ProvidesPackage{lastpageclassic}[2023/10/06 v2.0d %
   Refers to last page's name (HMM; JPG)]
 %% allows for things like "Page \thepage{} of \pageref{LastPage}"
 %% to get "Page 7 of 9"

Modified: trunk/Master/texmf-dist/tex/latex/lastpage/lastpagemodern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lastpage/lastpagemodern.sty	2023-10-07 20:14:55 UTC (rev 68472)
+++ trunk/Master/texmf-dist/tex/latex/lastpage/lastpagemodern.sty	2023-10-07 20:15:04 UTC (rev 68473)
@@ -9,7 +9,7 @@
 %% This is a generated file.
 %% 
 %% Project: lastpage
-%% Version: 2023-07-24 v2.0c
+%% Version: 2023-10-06 v2.0d
 %% Info: Refers to last page's name
 %% 
 %% Copyright (C) 2010 - 2023 by
@@ -40,7 +40,8 @@
 %% 
 %% While this package allows for things like "Page slash thepage{} of slash pageref{LastPage}"
 %% to get "Page 7 of 9" or "Page VII of IX",
-%% the NUMBER of pages is nowadays available via slash @abspage at last from the kernel,
+%% the NUMBER of pages is nowadays available from the kernel
+%% (slash @abspage at last, slash thetotalpages, slash PreviousTotalPages),
 %% but with pages for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 %% 
@@ -58,12 +59,12 @@
 %% 
 %% Part of the "lastpage" package
 \NeedsTeXFormat{LaTeX2e}[2022-11-01]
-\ProvidesPackage{lastpagemodern}[2023-07-24 v2.0c %
+\ProvidesPackage{lastpagemodern}[2023-10-06 v2.0d %
   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 at last, but with pages
-%% for example I to X and then 1 to 10, the number of pages woud be "20",
+%% for example I to X and then 1 to 10, the number of pages would be "20",
 %% while the name of the last page is "10". Decide what you need/want!
 
 \gdef\lastpage at one{1}
@@ -71,6 +72,19 @@
 \gdef\lastpage at lastpage{??}
 \gdef\lastpage at lastpageHy{??}
 
+\newcommand\lastpage at gobbleminus[1]{\ifx-#1\else#1\fi}
+%% from https://texfaq.org/FAQ-isitanum
+
+\newcounter{lastpagecount}
+
+\newcommand{\lastpage at IfNumericTF}[3]{%
+%% similar to https://tex.stackexchange.com/a/17119
+\sbox\z@{\c at lastpagecount=0\lastpage at gobbleminus{#1}\relax}%
+\ifdim\wd0>\z@\relax#3% is not numeric
+\else#2% is numeric
+\fi%
+}
+
 \AddToHook{begindocument/end}{\gdef\lastpage at putlabel{\relax}}
 
 %% From https://tex.stackexchange.com/a/542425 with thanks to
@@ -85,6 +99,30 @@
   \if at nobreak\ifvmode\nobreak\fi\fi%
   }
 
+\newcommand{\lastpage at numeric}{\protected at iwrite\@auxout{}{%
+ \string\newlabel{LastPage}{%
+  {\@currentlabel}%
+  {\thepage}%
+  {\@currentlabelname}%
+  {\IfPackageLoadedTF{hyperref}{\ifHy at pageanchor page.\Hy at temp\fi%
+                               }{\@currentHref}}%
+  {\@kernel at reserved@label at data}}}%
+ }
+
+\newcommand{\lastpage at nonnumeric}{\protected at 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 at pageanchor page.\Hy at temp\fi%
+                               }{\@currentHref}}%
+  {\@kernel at reserved@label at data}}}%
+ }
+
 \newcommand{\lastpage at putl@bel}{%
   \IfPackageLoadedTF{pageslts}{\relax}{%
     \IfPackageLoadedTF{hyperref}{\ifHy at pageanchor\else%
@@ -122,17 +160,7 @@
         \fi%
       }{}%
       \IfFormatAtLeastTF{2023/06/01}{%
-        \protected at 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 at pageanchor page.\Hy at temp\fi%
-                                       }{\@currentHref}}%
-          {\@kernel at reserved@label at data}}}%
+        \lastpage at IfNumericTF{\thepage}{\lastpage at numeric}{\lastpage at nonnumeric}%
        }{\IfPackageLoadedTF{hyperref}{\protected at iwrite\@auxout{}{%
             \string\newlabel{LastPage}{{}{\thepage}{}{%
             \ifHy at pageanchor page.\Hy at temp\fi}{}}}%



More information about the tex-live-commits mailing list.