summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex')
-rw-r--r--Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex139
1 files changed, 78 insertions, 61 deletions
diff --git a/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
index a06abddb9f3..14fc5deb30b 100644
--- a/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
+++ b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex
@@ -9,17 +9,13 @@
%% This is a generated file.
%%
%% Project: lastpage
-%% Version: 2021/09/03 v1.2n
+%% Version: 2023-03-07 v2.0a
+%% Info: Refers to last page's name
%%
-%% Copyright (C) 2010 - 2021 by
-%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+%% Copyright (C) 2010 - 2023 by
+%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
%% Portions of code copyrighted by other people as marked.
%%
-%% The usual disclaimer applies:
-%% If it doesn't work right that's your problem.
-%% (Nevertheless, send an e-mail to the maintainer
-%% when you find an error in this package.)
-%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
@@ -28,39 +24,50 @@
%% and the latest version of this license is in
%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
-%% LaTeX version 2005/12/01 or later.
+%% LaTeX version 2005-12-01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This package was invented by
-%% Jeffrey P. Goldberg (jeffrey+news at goldmark dot org).
+%% This package was invented by Jeffrey P. Goldberg.
%% I thought that a replacement was needed and therefore created the pageslts package,
-%% https://www.ctan.org/pkg/pageslts
+%% https://ctan.org/pkg/pageslts
%% . Nevertheless, for compatibility with existing documents/packages as well as for
%% the low amount of resources needed by the lastpage package (no new counter!),
%% I updated this package.
%% Thanks go to Jeffrey P. Goldberg for allowing me to do this.
%%
+%% 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@last from the kernel,
+%% 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!
+%%
%% This work consists of the main source file lastpage.dtx,
%% the README, and the derived files
-%% lastpage.sty, lastpage.pdf,
-%% lastpage.ins, lastpage.drv,
+%% lastpage.sty, lastpage209.sty, lastpage2e.sty,
+%% lastpageclassic.sty, lastpagemodern.sty,
+%% lastpage.pdf, lastpage.ins, lastpage.drv,
%% lastpage-example.tex, lastpage-example.pdf.
%%
%% In memoriam
-%% Claudia Simone Barth + 1996/01/30
-%% Tommy Muench + 2014/01/02
-%% Hans-Klaus Muench + 2014/08/24
+%% Claudia Simone Barth + 1996-01-30
+%% Tommy Muench + 2014-01-02
+%% Hans-Klaus Muench + 2014-08-24
%%
-\documentclass[british]{article}[2014/09/29]% v1.4h
-\AtEndDocument{\message{^^JLaTeX Info: Executing hook `AtEndDocument'.}}
-\usepackage[draft]{showkeys}[2014/10/28]% v3.17
+\documentclass[british]{article}[2022/07/02]% 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)
%% Use final instead of draft to hide the keys. %%
-\usepackage{hyperref}[2012/11/06]% v6.83m
-\hypersetup{%
- extension=pdf,%
+\usepackage{hyperref}[2023-02-07]% v7.00v Hypertext links for LaTeX
+\hypersetup{extension=pdf,%
plainpages=false,%
pdfpagelabels=true,%
hyperindex=false,%
@@ -68,33 +75,30 @@
pdftitle={lastpage package example},%
pdfauthor={H.-Martin Muench},%
pdfsubject={Example for the lastpage package},%
- pdfkeywords={LaTeX, lastpage, H.-Martin Muench},%
+ pdfkeywords={LaTeX, lastpage},%
pdfview=Fit,%
pdfstartview=Fit,%
pdfpagelayout=SinglePage%
}
%% If hyperref is not used, the url package
-%% https://www.ctan.org/pkg/url
+%% 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}[2021/09/03]% v1.2n
+\usepackage{lastpage}[2023-03-07]% v2.0a
\makeatletter
\renewcommand{\@evenfoot}{%
\normalsize\slshape \today\hfil \upshape %
page \thepage{} of \pageref{LastPage}}
\renewcommand{\@oddfoot}{\@evenfoot}
\makeatother
-\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}%
\listfiles
\begin{document}
\pagenumbering{Roman}
-
\section*{Example for lastpage}
\markboth{Example for lastpage}{Example for lastpage}
-
This example demonstrates the use of package\newline
-\textsf{lastpage}, v1.2n as of 2021/09/03 (HMM; JPG).\newline
+\textsf{lastpage}, v2.0a as of 2023-03-07 (HMM; JPG).\newline
The package takes no options.\newline
For more details please see the documentation!\newline
@@ -119,47 +123,21 @@ 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 Reader DC 2021.005.20060:
-Edit $>$ Preferences $>$ Categories: Page Display $>$
+for the display of the pdf (in Adobe Acrobat Reader 2022.003.20322:
+Edit $>$ Preferences $>$ Page Display $>$
Page Content and Information: Use logical page numbers)!\newline
If you are more ambitious in respect to your aims with this package,
you might want to have a look at the \textsf{pageslts} package:\newline
-\url{https://www.ctan.org/pkg/pageslts}.
-
+\url{https://ctan.org/pkg/pageslts}.
\bigskip
-Save per page about $200\unit{ml}$~water, $2\unit{g}$~CO$_{2}$
-and $2\unit{g}$~wood:\newline
-Therefore please print only if this is really necessary.\newline
-I do NOT think, that it is necessary to print THIS file, really\newline
-(at least not after this page)!
-
-\bigskip
-
-\noindent The page (\verb|\thepage|): \thepage \newline
-
-\noindent Last page's name (LastPage): \pageref{LastPage}
-
-\newpage
-
\noindent The page (\verb|\thepage|): \thepage \newline
-
-\noindent Last page's name (LastPage): \pageref{LastPage}
-
-\newpage
-
-\noindent The page (\verb|\thepage|): \thepage \newline
-
-\noindent Last page's name (LastPage): \pageref{LastPage}
-
+Last page's name (LastPage): \pageref{LastPage}
\newpage
-\section*{The End}
-
\noindent The page (\verb|\thepage|): \thepage \newline
-
-\noindent Last page's name (LastPage): \pageref{LastPage}
+Last page's name (LastPage): \pageref{LastPage}
\bigskip
@@ -207,6 +185,45 @@ prints:\newline
Page \thepage{} is page \makeatletter\lastpage@lastpage\makeatother.%
\newline
This can be broken for example by \verb|\pagenumbering{fnsymbol}|.
+\newpage
+
+\noindent The page (\verb|\thepage|): \thepage \newline
+Last page's name (LastPage): \pageref{LastPage}
+\bigskip
+
+With modern \LaTeX{} it is possible to say:
+\begin{quote}
+\begin{verbatim}
+\NeedsTeXFormat{LaTeX2e}[2022-11-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@last = \test\relax%
+This is the last page.%
+\else%
+This is not the last page
+(or it is but \LaTeX{} needs another compilation run
+to detect this).
+\fi
+\makeatother
+\end{document}
+\end{verbatim}
+\end{quote}
+
+\newpage
+\section*{The End}
+\noindent The page (\verb|\thepage|): \thepage \newline
+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!
\end{document}
\endinput
%%