| 1 |
%% |
| 2 |
%% This is file `pageslts-example.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pageslts.dtx (with options: `example') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: pageslts |
| 12 |
%% Version: 2025-08-14 v2.0g |
| 13 |
%% Info: Variants of last page labels |
| 14 |
%% |
| 15 |
%% Copyright (C) 2010 - 2025 by |
| 16 |
%% H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de> |
| 17 |
%% Portions of code copyrighted by other people as marked. |
| 18 |
%% |
| 19 |
%% IMPORTANT NOTICE: |
| 20 |
%% On the first page backslash pagenumbering should be called |
| 21 |
%% (with the appropriate argument out of e.g. |
| 22 |
%% * roman - Lowercase Roman numerals: i, ii, iii, iv,... |
| 23 |
%% * Roman - Uppercase Roman numerals: I, II, III, IV,... |
| 24 |
%% * arabic - Arabic numerals: 1, 2, 3, 4,... |
| 25 |
%% * alph - Lowercase letters: a, b, c, d,... |
| 26 |
%% * Alph - Uppercase letters: A, B, C, D,... |
| 27 |
%% * fnsymbol - Footnote symbols: *, ^^e2^^80^^a0 (ddagger), ^^e2^^80^^a1 (dddagger), |
| 28 |
%% ^^c2^^a7 (mathsection),... |
| 29 |
%% * silly - from sillypage package |
| 30 |
%% * gobble - gobbles the page numbers; |
| 31 |
%% maybe backslash thispagestyle{empty} is more useful? |
| 32 |
%% ). The command backslash pagenumbering is renewed, but no change |
| 33 |
%% should be visible to the output text, because only labels are added. |
| 34 |
%% backslash OrigPagenumbering can be used to get the original meaning |
| 35 |
%% of backslash pagenumbering, but in that case this package does not |
| 36 |
%% see the change in the page numbering scheme and will make mistakes. |
| 37 |
%% The package takes options. |
| 38 |
%% |
| 39 |
%% This work may be distributed and/or modified under the |
| 40 |
%% conditions of the LaTeX Project Public License, either |
| 41 |
%% version 1.3c of this license or (at your option) any later |
| 42 |
%% version. This version of this license is in |
| 43 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 44 |
%% and the latest version of this license is in |
| 45 |
%% https://www.latex-project.org/lppl.txt |
| 46 |
%% and version 1.3c or later is part of all distributions of |
| 47 |
%% LaTeX version 2005-12-01 or later. |
| 48 |
%% |
| 49 |
%% This work has the LPPL maintenance status "maintained". |
| 50 |
%% |
| 51 |
%% The Current Maintainer of this work is H.-Martin Muench. |
| 52 |
%% |
| 53 |
%% This package first started as a revision of the lastpage |
| 54 |
%% package of Jeffrey P. Goldberg (jeffrey+news at goldmark dot org), |
| 55 |
%% but I thought a replacement was needed. |
| 56 |
%% |
| 57 |
%% This work consists of the main source file pageslts.dtx, |
| 58 |
%% the README, and the derived files |
| 59 |
%% pageslts.sty, pageslts.pdf, |
| 60 |
%% pageslts.ins, pageslts.drv, |
| 61 |
%% pageslts-example.tex, pageslts-example.pdf. |
| 62 |
%% |
| 63 |
%% In memoriam |
| 64 |
%% Claudia Simone Barth + 1996-01-30 |
| 65 |
%% Tommy Muench + 2014-01-02 |
| 66 |
%% Hans-Klaus Muench + 2014-08-24 |
| 67 |
%% |
| 68 |
\documentclass[british]{article}[2025/01/22]% v1.4n |
| 69 |
\usepackage{lipsum}[2021-09-20]% v2.7 |
| 70 |
\usepackage[draft]{showkeys}[2024/05/23]% v3.21 |
| 71 |
%% Use final instead of draft to hide the keys. %% |
| 72 |
\usepackage[pdfpagelabels=true,hyperindex=false]{hyperref}[2024-11-05]% v7.01l |
| 73 |
\makeatletter |
| 74 |
\@ifpackageloaded{hyperref}{% Hypertext links for LaTeX |
| 75 |
\hypersetup{extension=pdf,% |
| 76 |
plainpages=false,% |
| 77 |
pdflang={en},% |
| 78 |
pdftitle={pageslts package example},% |
| 79 |
pdfauthor={H.-Martin Muench},% |
| 80 |
pdfsubject={Example for the pageslts package},% |
| 81 |
pdfkeywords={LaTeX, pageslts},% |
| 82 |
pdfview=Fit,% |
| 83 |
pdfstartview=Fit,% |
| 84 |
pdfpagelayout=SinglePage,% |
| 85 |
bookmarksopen=true% |
| 86 |
}}{\usepackage{url}[2013/09/16]}% v3.4 |
| 87 |
\makeatother |
| 88 |
\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,fnsymbolmult=true,% |
| 89 |
romanMult=true,RomanMulti=true]{pageslts}[2025-08-14]% v2.0g |
| 90 |
%% These are the default options. %% |
| 91 |
|
| 92 |
\makeatletter |
| 93 |
\renewcommand{\@evenfoot}% |
| 94 |
{Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of % |
| 95 |
\lastpageref{pagesLTS.roman}(\lastpageref{pagesLTS.roman.local}) + % |
| 96 |
\ifpagesLTS@pagecontinue% |
| 97 |
\lastpageref{pagesLTS.Roman}(\lastpageref{pagesLTS.Roman.local}) % |
| 98 |
\else% |
| 99 |
\{\lastpageref{pagesLTS.Roman.1}% |
| 100 |
+\lastpageref{pagesLTS.Roman.2}% |
| 101 |
+\lastpageref{pagesLTS.Roman.3}% |
| 102 |
(\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 103 |
\the\numexpr% |
| 104 |
\csname [email protected]\endcsname% |
| 105 |
+\csname [email protected]\endcsname% |
| 106 |
+\csname [email protected]\endcsname% |
| 107 |
\relax)\} % |
| 108 |
\fi + % |
| 109 |
\lastpageref{pagesLTS.arabic}(\lastpageref{pagesLTS.arabic.local}) + % |
| 110 |
\lastpageref{pagesLTS.fnsymbol}(\lastpageref{pagesLTS.fnsymbol.local}) + % |
| 111 |
\lastpageref{pagesLTS.alph}(\lastpageref{pagesLTS.alph.local}) + % |
| 112 |
\lastpageref{pagesLTS.gobble}(\lastpageref{pagesLTS.gobble.local}) + % |
| 113 |
\lastpageref{pagesLTS.Alph}(\lastpageref{pagesLTS.Alph.local}) = % |
| 114 |
\lastpageref{LastPages} pages.% |
| 115 |
} |
| 116 |
\renewcommand{\@oddfoot}{\@evenfoot} |
| 117 |
\def\pagesLTSexampleArabic{3} |
| 118 |
\def\pagesLTSexamplealph{23} |
| 119 |
\makeatother |
| 120 |
\setlength{\parindent}{0pt} |
| 121 |
\listfiles |
| 122 |
\begin{document} |
| 123 |
\pagenumbering{roman} |
| 124 |
%% Note the first \pagenumbering immediately behind \begin{document}! %% |
| 125 |
%%\addtocounter{page}{-2} %% |
| 126 |
\section*{Example for pageslts} |
| 127 |
\addcontentsline{toc}{section}{Example for pageslts} |
| 128 |
\markboth{Example for pageslts}{Example for pageslts} |
| 129 |
|
| 130 |
This example demonstrates the most common uses of package\newline |
| 131 |
\textsf{pageslts}, v2.0g as of 2025-08-14 (HMM);\newline |
| 132 |
\url{https://ctan.org/pkg/pageslts}.\bigskip |
| 133 |
|
| 134 |
The used options were \texttt{pagecontinue=true}, |
| 135 |
\texttt{alphMult=ab}, \texttt{AlphMulti=AB}, \linebreak |
| 136 |
\texttt{fnsymbolmult=true}, |
| 137 |
\texttt{romanMult=true}, and \texttt{RomanMulti=true} |
| 138 |
(the default\linebreak ones).~-- For more details please see the documentation!\bigskip |
| 139 |
|
| 140 |
\label{keys} To hide the \pageref{keys}{\qquad } use option |
| 141 |
\texttt{final} instead of \texttt{draft} with the \textsf{showkeys} |
| 142 |
package (or remove the package call from the preamble of |
| 143 |
this document).\bigskip |
| 144 |
|
| 145 |
\textbf{Hyperlinks or not:} If the \textsf{hyperref} package is loaded, |
| 146 |
the references are also hyperlinked:\bigskip |
| 147 |
\smallskip |
| 148 |
Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of % |
| 149 |
\lastpageref{pagesLTS.roman}(\lastpageref{pagesLTS.roman.local}) + % |
| 150 |
\makeatletter% |
| 151 |
\ifpagesLTS@pagecontinue% |
| 152 |
\lastpageref{pagesLTS.Roman}(\lastpageref{pagesLTS.Roman.local}) % |
| 153 |
\else% |
| 154 |
\{\lastpageref{pagesLTS.Roman.1}% |
| 155 |
+\lastpageref{pagesLTS.Roman.2}% |
| 156 |
+\lastpageref{pagesLTS.Roman.3}% |
| 157 |
(\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 158 |
\the\numexpr% |
| 159 |
\csname [email protected]\endcsname% |
| 160 |
+\csname [email protected]\endcsname% |
| 161 |
+\csname [email protected]\endcsname% |
| 162 |
\relax)\} % |
| 163 |
\fi + % |
| 164 |
\makeatother% |
| 165 |
\lastpageref{pagesLTS.arabic}(\lastpageref{pagesLTS.arabic.local}) + % |
| 166 |
\lastpageref{pagesLTS.fnsymbol}(\lastpageref{pagesLTS.fnsymbol.local}) + % |
| 167 |
\lastpageref{pagesLTS.alph}(\lastpageref{pagesLTS.alph.local}) + % |
| 168 |
\lastpageref{pagesLTS.Alph}(\lastpageref{pagesLTS.Alph.local}) = % |
| 169 |
\lastpageref{LastPages} pages.\bigskip |
| 170 |
If the \textsf{hyperref} package is loaded, but the hyperlinks of the |
| 171 |
references shall be suppressed, \verb|\pageref*{...}| |
| 172 |
and \verb|\lastpageref*{...}| can be used:\\[0.5\baselineskip] |
| 173 |
Page \thepage\ (\theCurrentPage; local: \theCurrentPageLocal) of % |
| 174 |
\lastpageref*{pagesLTS.roman}(\lastpageref*{pagesLTS.roman.local}) + % |
| 175 |
\makeatletter% |
| 176 |
\ifpagesLTS@pagecontinue% |
| 177 |
\lastpageref*{pagesLTS.Roman}(\lastpageref*{pagesLTS.Roman.local}) % |
| 178 |
\else% |
| 179 |
\{\lastpageref*{pagesLTS.Roman.1}% |
| 180 |
+\lastpageref*{pagesLTS.Roman.2}% |
| 181 |
+\lastpageref*{pagesLTS.Roman.3}% |
| 182 |
(\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 183 |
\the\numexpr% |
| 184 |
\csname [email protected]\endcsname% |
| 185 |
+\csname [email protected]\endcsname% |
| 186 |
+\csname [email protected]\endcsname% |
| 187 |
\relax)\} % |
| 188 |
\fi + % |
| 189 |
\makeatother% |
| 190 |
\lastpageref*{pagesLTS.arabic}(\lastpageref*{pagesLTS.arabic.local}) + % |
| 191 |
\lastpageref*{pagesLTS.fnsymbol}(\lastpageref*{pagesLTS.fnsymbol.local}) + % |
| 192 |
\lastpageref*{pagesLTS.alph}(\lastpageref*{pagesLTS.alph.local}) + % |
| 193 |
\lastpageref*{pagesLTS.Alph}(\lastpageref*{pagesLTS.Alph.local}) = % |
| 194 |
\lastpageref*{LastPages} pages.\bigskip |
| 195 |
|
| 196 |
\textbf{Trademarks} appear throughout this example without any |
| 197 |
trademark symbol; they are the property of their respective |
| 198 |
trademark owner. There is no intention of infringement; the |
| 199 |
usage is to the benefit of the trademark owner.\bigskip |
| 200 |
|
| 201 |
\textbf{Tip}: Use \textit{logical page numbers} for the display of the pdf |
| 202 |
(in Adobe Acrobat Reader Continuous Release 2024.005.20320:\newline |
| 203 |
Edit $>$ Preferences $>$ Categories: Page Display $>$ |
| 204 |
Page Content and Information: Use logical page numbers)!\bigskip |
| 205 |
|
| 206 |
You want negative page numbers? Not only arabic, but even roman, |
| 207 |
Roman, alph, Alph or fnsymbol ones? No problem, e.\,g.~just give a\newline |
| 208 |
\verb|\addtocounter{page}{|-\textit{some number}\verb|}| in the |
| 209 |
source code of this example file (or uncomment the prepared line)! |
| 210 |
\newpage |
| 211 |
\tableofcontents |
| 212 |
\newpage% |
| 213 |
\makeatletter% |
| 214 |
\def\pagesLTS@tmpC{roman}% |
| 215 |
\ifx\pagesLTS@pnc\pagesLTS@tmpC% |
| 216 |
\else\pagenumbering{roman}% |
| 217 |
%% in case the page numbering is changed before, |
| 218 |
%% otherwise pagesLTS.current.local.roman on this page would be undefined |
| 219 |
\fi% |
| 220 |
\makeatother% |
| 221 |
\section{roman} |
| 222 |
|
| 223 |
(\texttt{roman} page numbering was started before, |
| 224 |
because the page numbering scheme was needed to start at |
| 225 |
the first page, of course.)\bigskip |
| 226 |
|
| 227 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 228 |
\lastpageref{pagesLTS.0}\bigskip |
| 229 |
|
| 230 |
The page (\verb|\thepage|): \thepage \bigskip |
| 231 |
|
| 232 |
Current page (\verb|\theCurrentPage|), |
| 233 |
i.\,e.~counted continuously from the first\linebreak page):~\theCurrentPage \bigskip |
| 234 |
You can get this also in other formats: |
| 235 |
\roman{CurrentPage}, \Roman{CurrentPage}, \arabic{CurrentPage}, |
| 236 |
\fnsymbol{CurrentPage}, \alph{CurrentPage}, \Alph{CurrentPage}. |
| 237 |
|
| 238 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 239 |
i.\,e.~counted continuously from the first page of the |
| 240 |
current page numbering scheme (if option pagecontinue=false: sector)): |
| 241 |
\theCurrentPageLocal\newline |
| 242 |
You can get also this in other formats, too: |
| 243 |
\roman{pagesLTS.current.local.roman}, \Roman{pagesLTS.current.local.roman}, |
| 244 |
\arabic{pagesLTS.current.local.roman}, \fnsymbol{pagesLTS.current.local.roman}, |
| 245 |
\alph{pagesLTS.current.local.roman}, \Alph{pagesLTS.current.local.roman}, |
| 246 |
but probably it only makes sense if page numbering scheme and format are |
| 247 |
the same, e.\,g.\newline |
| 248 |
\verb|\Roman{pagesLTS.current.local.Roman}|\newline |
| 249 |
or \verb|\Alph{pagesLTS.current.local.Alph}|. \verb|\number\value{...}| could |
| 250 |
make sense even if combined with another page numbering scheme. |
| 251 |
And this is exactly what \verb|\theCurrentPageLocal| does:\newline |
| 252 |
\nolinebreak{\verb|\def\theCurrentPageLocal{\number\value{pagesLTS.current.local.\pagesLTS@pnc}}|.}\bigskip |
| 253 |
|
| 254 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 255 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 256 |
|
| 257 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 258 |
\makeatletter% |
| 259 |
\ifpagesLTS@pagecontinue% |
| 260 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 261 |
\else% |
| 262 |
(There are % |
| 263 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 264 |
\the\numexpr% |
| 265 |
\csname [email protected]\endcsname% |
| 266 |
+\csname [email protected]\endcsname% |
| 267 |
+\csname [email protected]\endcsname% |
| 268 |
\relax~pages with Roman numbers:\newline |
| 269 |
\fi% |
| 270 |
\makeatother% |
| 271 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 272 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 273 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 274 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 275 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 276 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 277 |
|
| 278 |
When the option \texttt{pagecontinue=false} is used with the |
| 279 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 280 |
point to the same page as before, but this will have a lower number. |
| 281 |
And if that page number was also present in a preceding sector, |
| 282 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 283 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 284 |
of pages in the last sector. To get the total number of Roman pages, % |
| 285 |
\begin{verbatim} |
| 286 |
\the\numexpr \csname [email protected]\endcsname% |
| 287 |
+\csname [email protected]\endcsname% |
| 288 |
+\csname [email protected]\endcsname% |
| 289 |
\relax% |
| 290 |
\end{verbatim}% |
| 291 |
would be necessary.\bigskip |
| 292 |
|
| 293 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 294 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 295 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 296 |
|
| 297 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 298 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 299 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\newline |
| 300 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 301 |
|
| 302 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 303 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 304 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 305 |
|
| 306 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 307 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 308 |
|
| 309 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 310 |
|
| 311 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 312 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 313 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 314 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 315 |
|
| 316 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 317 |
(=~total number of pages) |
| 318 |
\newpage |
| 319 |
\pagenumbering{Roman} |
| 320 |
\section{Roman\label{Roman}} |
| 321 |
\subsection{Common Roman page numbering} |
| 322 |
|
| 323 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 324 |
\lastpageref{pagesLTS.0}\bigskip |
| 325 |
|
| 326 |
The page (\verb|\thepage|): \thepage\bigskip |
| 327 |
|
| 328 |
Current page (\verb|\theCurrentPage|), |
| 329 |
i.\,e.~counted continuously from the first page): \theCurrentPage\bigskip |
| 330 |
|
| 331 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 332 |
i.\,e.~counted continuously from the first page of the |
| 333 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 334 |
|
| 335 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 336 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 337 |
|
| 338 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 339 |
\makeatletter% |
| 340 |
\ifpagesLTS@pagecontinue% |
| 341 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 342 |
\else% |
| 343 |
(There are % |
| 344 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 345 |
\the\numexpr% |
| 346 |
\csname [email protected]\endcsname% |
| 347 |
+\csname [email protected]\endcsname% |
| 348 |
+\csname [email protected]\endcsname% |
| 349 |
\relax~pages with Roman numbers:\newline |
| 350 |
\fi% |
| 351 |
\makeatother% |
| 352 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 353 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 354 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 355 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 356 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 357 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 358 |
|
| 359 |
When the option \texttt{pagecontinue=false} is used with the |
| 360 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 361 |
point to the same page as before, but this will have a lower number. |
| 362 |
And if that page number was also present in a preceding sector, |
| 363 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 364 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 365 |
of pages in the last sector. To get the total number of Roman pages, % |
| 366 |
\begin{verbatim} |
| 367 |
\the\numexpr \csname [email protected]\endcsname% |
| 368 |
+\csname [email protected]\endcsname% |
| 369 |
+\csname [email protected]\endcsname% |
| 370 |
\relax% |
| 371 |
\end{verbatim}% |
| 372 |
would be necessary. |
| 373 |
\pagebreak |
| 374 |
|
| 375 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 376 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 377 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 378 |
|
| 379 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 380 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 381 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 382 |
|
| 383 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 384 |
|
| 385 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 386 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 387 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 388 |
|
| 389 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 390 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 391 |
|
| 392 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 393 |
|
| 394 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 395 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 396 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 397 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 398 |
|
| 399 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 400 |
(=~total number of pages) |
| 401 |
|
| 402 |
\newpage |
| 403 |
\subsection{Last page of first Roman sector} |
| 404 |
\verb|\lastpageref{pagesLTS.Roman}| does \textbf{not} |
| 405 |
refer to this page (but there: \lastpageref{pagesLTS.Roman}). |
| 406 |
When a reference to this page is wanted,\newline |
| 407 |
\verb|\lastpageref{pagesLTS.Roman.1}| can be used: \lastpageref{pagesLTS.Roman.1}.\bigskip |
| 408 |
|
| 409 |
There are \lastpages{Roman}{1}~pages (\verb|\lastpages{Roman}{1}|) |
| 410 |
in this first Roman sector.\newline |
| 411 |
The Roman page numbering scheme is continued later in section~\ref{Roman2})! |
| 412 |
|
| 413 |
\newpage |
| 414 |
\pagenumbering{arabic} |
| 415 |
\section{arabic} |
| 416 |
\subsection{Standard page numbering} |
| 417 |
|
| 418 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 419 |
\lastpageref{pagesLTS.0}\bigskip |
| 420 |
|
| 421 |
The page (\verb|\thepage|): \thepage \bigskip |
| 422 |
|
| 423 |
Current page (\verb|\theCurrentPage|), |
| 424 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 425 |
|
| 426 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 427 |
i.\,e.~counted continuously from the first page of the |
| 428 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 429 |
|
| 430 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 431 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 432 |
|
| 433 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 434 |
\makeatletter% |
| 435 |
\ifpagesLTS@pagecontinue% |
| 436 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 437 |
\else% |
| 438 |
(There are % |
| 439 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 440 |
\the\numexpr% |
| 441 |
\csname [email protected]\endcsname% |
| 442 |
+\csname [email protected]\endcsname% |
| 443 |
+\csname [email protected]\endcsname% |
| 444 |
\relax~pages with Roman numbers:\newline |
| 445 |
\fi% |
| 446 |
\makeatother% |
| 447 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 448 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 449 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 450 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 451 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 452 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 453 |
|
| 454 |
When the option \texttt{pagecontinue=false} is used with the |
| 455 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 456 |
point to the same page as before, but this will have a lower number. |
| 457 |
And if that page number was also present in a preceding sector, |
| 458 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 459 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 460 |
of pages in the last sector. To get the total number of Roman pages, % |
| 461 |
\begin{verbatim} |
| 462 |
\the\numexpr \csname [email protected]\endcsname% |
| 463 |
+\csname [email protected]\endcsname% |
| 464 |
+\csname [email protected]\endcsname% |
| 465 |
\relax% |
| 466 |
\end{verbatim}% |
| 467 |
would be necessary. |
| 468 |
\pagebreak |
| 469 |
|
| 470 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 471 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 472 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 473 |
|
| 474 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 475 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 476 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 477 |
|
| 478 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 479 |
|
| 480 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 481 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 482 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 483 |
|
| 484 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 485 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 486 |
|
| 487 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 488 |
|
| 489 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 490 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 491 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 492 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 493 |
|
| 494 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 495 |
(=~total number of pages) |
| 496 |
|
| 497 |
\newpage |
| 498 |
\thispagestyle{empty} |
| 499 |
\subsection[Empty page style]{Also an empty page style is no problem % |
| 500 |
for the current or total page count} |
| 501 |
|
| 502 |
\bigskip |
| 503 |
|
| 504 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 505 |
\lastpageref{pagesLTS.0}\bigskip |
| 506 |
|
| 507 |
The page (\verb|\thepage|): \thepage \bigskip |
| 508 |
|
| 509 |
Current page (\verb|\theCurrentPage|), |
| 510 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 511 |
|
| 512 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 513 |
i.\,e.~counted continuously from the first page of the |
| 514 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 515 |
|
| 516 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 517 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 518 |
|
| 519 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 520 |
\makeatletter% |
| 521 |
\ifpagesLTS@pagecontinue% |
| 522 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 523 |
\else% |
| 524 |
(There are % |
| 525 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 526 |
\the\numexpr% |
| 527 |
\csname [email protected]\endcsname% |
| 528 |
+\csname [email protected]\endcsname% |
| 529 |
+\csname [email protected]\endcsname% |
| 530 |
\relax~pages with Roman numbers:\newline |
| 531 |
\fi% |
| 532 |
\makeatother% |
| 533 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 534 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 535 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 536 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 537 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 538 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\newline |
| 539 |
|
| 540 |
When the option \texttt{pagecontinue=false} is used with the |
| 541 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 542 |
point to the same page as before, but this will have a lower number. |
| 543 |
And if that page number was also present in a preceding sector, |
| 544 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 545 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 546 |
of pages in the last sector. To get the total number of Roman pages, % |
| 547 |
\begin{verbatim} |
| 548 |
\the\numexpr \csname [email protected]\endcsname% |
| 549 |
+\csname [email protected]\endcsname% |
| 550 |
+\csname [email protected]\endcsname% |
| 551 |
\relax% |
| 552 |
\end{verbatim}% |
| 553 |
would be necessary. |
| 554 |
\pagebreak |
| 555 |
|
| 556 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 557 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 558 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 559 |
|
| 560 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 561 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 562 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 563 |
|
| 564 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 565 |
|
| 566 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 567 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 568 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 569 |
|
| 570 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 571 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 572 |
|
| 573 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 574 |
|
| 575 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 576 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 577 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 578 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 579 |
|
| 580 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 581 |
(=~total number of pages) |
| 582 |
|
| 583 |
\newpage |
| 584 |
\subsection[addtocounter, setcounter]{Neither % |
| 585 |
\texttt{\textbackslash addtocounter\{page\}} nor % |
| 586 |
\texttt{\textbackslash setcounter\{page\}} is a problem for the % |
| 587 |
current or total page numbers} |
| 588 |
|
| 589 |
(Here is an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| |
| 590 |
in the source code.) |
| 591 |
\addtocounter{page}{\pagesLTSexampleArabic}\bigskip |
| 592 |
|
| 593 |
The page (from \verb|\thepage| command): \thepage \bigskip |
| 594 |
|
| 595 |
Current page (from \verb|\theCurrentPage|\ % |
| 596 |
command), i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 597 |
|
| 598 |
CurrentPageLocal (from \verb|\theCurrentPageLocal|\ % |
| 599 |
command), i.\,e.~counted continuously from the first page of the |
| 600 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 601 |
|
| 602 |
Last page's number (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 603 |
(= total number of pages) |
| 604 |
|
| 605 |
\newpage |
| 606 |
\pagenumbering{fnsymbol} |
| 607 |
\section{fnsymbol} |
| 608 |
|
| 609 |
Without option \texttt{fnsymbolmult=true} of the \textsf{pageslts} package |
| 610 |
(and the help of the \textsf{alphalph} package), |
| 611 |
after page~9 (\textquotedblleft \ensuremath {\ddagger \ddagger }\textquotedblright ) |
| 612 |
(and also for negative page numbers) there would just appear a |
| 613 |
\begin{quote} |
| 614 |
\begin{verbatim} |
| 615 |
LaTeX Error: Counter too large |
| 616 |
See the LaTeX manual or LaTeX Companion for explanation. |
| 617 |
You've lost some text. Try typing <return> to proceed. |
| 618 |
If that doesn't work, type X <return> to quit. |
| 619 |
\end{verbatim} |
| 620 |
\end{quote} |
| 621 |
Now the page numbers after 5 (\ensuremath {\mathparagraph }) are |
| 622 |
continued with the doubled \textquotedblleft number\textquotedblright{} of |
| 623 |
the first, second, third,\ldots\ page (\ensuremath {**}, |
| 624 |
\ensuremath {\dagger \dagger }, \ensuremath {\ddagger \ddagger }, |
| 625 |
\ensuremath {\mathsection \mathsection }, |
| 626 |
\ensuremath {\mathparagraph \mathparagraph }), |
| 627 |
and after the tenth page the \textquotedblleft number\textquotedblright{} is |
| 628 |
tripled (\ensuremath {***}, \ensuremath {\dagger \dagger \dagger },\ldots). |
| 629 |
Page zero is named 0 and negative pages are just named like the positive ones |
| 630 |
with addition of a minus \mbox{sign ($-$).} |
| 631 |
|
| 632 |
\bigskip |
| 633 |
|
| 634 |
For testing purposes, try: |
| 635 |
|
| 636 |
\begin{small} |
| 637 |
\begin{verbatim} |
| 638 |
\documentclass{article} |
| 639 |
\usepackage[plainpages=false,pageanchor=true,pdfpagelabels=true]{hyperref} |
| 640 |
\usepackage{pageslts} |
| 641 |
\pagenumbering{fnsymbol} |
| 642 |
\begin{document} |
| 643 |
First page.\newpage |
| 644 |
\verb|\lastpageref{pagesLTS.0} | \lastpageref{pagesLTS.0} \par |
| 645 |
\verb|\lastpageref{pagesLTS.0.local} | \lastpageref{pagesLTS.0.local} \par |
| 646 |
\verb|\lastpageref{LastPage} | \lastpageref{LastPage} \par |
| 647 |
\verb|\lastpageref{VeryLastPage} | \lastpageref{VeryLastPage} \par |
| 648 |
\verb|\lastpageref{pagesLTS.fnsymbol.1} | \lastpageref{pagesLTS.fnsymbol.1} \par |
| 649 |
\verb|\lastpageref{pagesLTS.fnsymbol.1.local} | \lastpageref{pagesLTS.fnsymbol.1.local} \par |
| 650 |
\verb|\lastpageref{pagesLTS.fnsymbol} | \lastpageref{pagesLTS.fnsymbol} \par |
| 651 |
\verb|\lastpageref{pagesLTS.fnsymbol.local} | \lastpageref{pagesLTS.fnsymbol.local} \par |
| 652 |
\verb|\lastpageref{LastPages} | \lastpageref{LastPages} \par |
| 653 |
\verb|\pagesLTSlastpage | \pagesLTSlastpage |
| 654 |
\newpage |
| 655 |
Last page. |
| 656 |
\end{document} |
| 657 |
\end{verbatim} |
| 658 |
\end{small} |
| 659 |
\newpage |
| 660 |
|
| 661 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 662 |
\lastpageref{pagesLTS.0}\bigskip |
| 663 |
|
| 664 |
The page (\verb|\thepage|): \thepage \bigskip |
| 665 |
|
| 666 |
Current page (\verb|\theCurrentPage|), |
| 667 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 668 |
|
| 669 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 670 |
i.\,e.~counted continuously from the first page of the |
| 671 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 672 |
|
| 673 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 674 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 675 |
|
| 676 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 677 |
\makeatletter% |
| 678 |
\ifpagesLTS@pagecontinue% |
| 679 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 680 |
\else% |
| 681 |
(There are % |
| 682 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 683 |
\the\numexpr% |
| 684 |
\csname [email protected]\endcsname% |
| 685 |
+\csname [email protected]\endcsname% |
| 686 |
+\csname [email protected]\endcsname% |
| 687 |
\relax~pages with Roman numbers:\newline |
| 688 |
\fi% |
| 689 |
\makeatother% |
| 690 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 691 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 692 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 693 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 694 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 695 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 696 |
|
| 697 |
When the option \texttt{pagecontinue=false} is used with the |
| 698 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 699 |
point to the same page as before, but this will have a lower number. |
| 700 |
And if that page number was also present in a preceding sector, |
| 701 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 702 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 703 |
of pages in the last sector. To get the total number of Roman pages, % |
| 704 |
\begin{verbatim} |
| 705 |
\the\numexpr \csname [email protected]\endcsname% |
| 706 |
+\csname [email protected]\endcsname% |
| 707 |
+\csname [email protected]\endcsname% |
| 708 |
\relax% |
| 709 |
\end{verbatim}% |
| 710 |
would be necessary.\bigskip |
| 711 |
|
| 712 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 713 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 714 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 715 |
|
| 716 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 717 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 718 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 719 |
|
| 720 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 721 |
|
| 722 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 723 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 724 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 725 |
|
| 726 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 727 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 728 |
|
| 729 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 730 |
|
| 731 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 732 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 733 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 734 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 735 |
|
| 736 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 737 |
(=~total number of pages)\bigskip |
| 738 |
|
| 739 |
\lipsum[1-58] |
| 740 |
|
| 741 |
\newpage |
| 742 |
\pagenumbering{Roman} |
| 743 |
\section{Roman -- again!\label{Roman2}} |
| 744 |
|
| 745 |
The page number starts with \textquotedblleft I\textquotedblright{} again for |
| 746 |
option just \texttt{pagecontinue=false}, but for option \texttt{pagecontinue=true}, |
| 747 |
or with option just \texttt{pagecontinue}, or even just |
| 748 |
\nolinebreak{with\textbf{out}} option \texttt{pagecontinue=false} |
| 749 |
the page numbers are continued. |
| 750 |
|
| 751 |
This package remembered the |
| 752 |
$\number\value{pagesLTS.double.Roman}-1$, |
| 753 |
i.\,e.~\the\numexpr\value{pagesLTS.double.Roman}-1\relax, pages |
| 754 |
already done in Roman output, and therefore continues with page |
| 755 |
\textquotedblleft\Roman{pagesLTS.double.Roman}\textquotedblright{} in |
| 756 |
case of option \texttt{pagecontinue}.\newline |
| 757 |
If you want to start with \textquotedblleft I\textquotedblright{} all |
| 758 |
over again, you will have two pages with the same name, |
| 759 |
but nevertheless you can do this by using option \texttt{pagecontinue=false} |
| 760 |
or a \verb|\setcounter{page}{1}|\ here (not demonstrated in this example file).\bigskip |
| 761 |
|
| 762 |
There was the question: \textquotedblleft With option \verb|pagecontinue=false|, |
| 763 |
how do I get the number of pages in each number block (e.\,g.~in the first Roman section, |
| 764 |
second Roman section, third Roman section) with just one command?\textquotedblright |
| 765 |
\begin{verbatim} |
| 766 |
\makeatletter% |
| 767 |
\theCurrentPageLocal~of~\lastpageref*{% |
| 768 |
pagesLTS.\pagesLTS@pnc.\number\value{pagesLTS.pnc.\pagesLTS@pnc}.local}% |
| 769 |
\makeatother% |
| 770 |
\end{verbatim} |
| 771 |
provides this. Here: % |
| 772 |
\makeatletter% |
| 773 |
\theCurrentPageLocal~of~% |
| 774 |
\lastpageref*{pagesLTS.\pagesLTS@pnc.\number\value{pagesLTS.pnc.\pagesLTS@pnc}.local}\newline% |
| 775 |
\makeatother% |
| 776 |
for \verb|pagecontinue=true| is \verb|4 of 8| (including % |
| 777 |
\makeatletter% |
| 778 |
$\the\numexpr\csname [email protected]\endcsname -1\relax$ % |
| 779 |
from the first Roman section, |
| 780 |
$\the\csname [email protected]\endcsname\relax |
| 781 |
=\the\numexpr\csname [email protected]\endcsname -1\relax% first section |
| 782 |
+1% first page of this second section |
| 783 |
$, $\the\numexpr\csname [email protected]\endcsname -1+% |
| 784 |
\csname [email protected]\endcsname\relax% |
| 785 |
=\the\numexpr\csname [email protected]\endcsname -1\relax+% |
| 786 |
\the\numexpr\csname [email protected]\endcsname\relax$)\newline |
| 787 |
\makeatother% |
| 788 |
and for \verb|pagecontinue=false| is \verb|1 of 5| .\bigskip |
| 789 |
|
| 790 |
\verb|pagesLTS.\pagesLTS@pnc.\number\value{pagesLTS.pnc.\pagesLTS@pnc}.local| is: |
| 791 |
\begin{description} |
| 792 |
\item[-] \verb|pagesLTS| just identifies this counter to belong to the pageslts package. |
| 793 |
\item[-] \verb|\pagesLTS@pnc| is the Current Page Numbering scheme, i.\,e.~here it would be \verb|Roman|. |
| 794 |
\item[-] \verb|\number\value{pagesLTS.pnc.\pagesLTS@pnc}| is the value of counter\newline |
| 795 |
\verb|pagesLTS.pnc.\pagesLTS@pnc| printed in arabic numbers (1, 2, 3, ...) -- see below. |
| 796 |
\item[-] \verb|local|: Local there are 5 pages with Roman numbering in this example, globally there are |
| 797 |
$3+5+4=12$~pages with Roman numbering in this example, and the local numbers are wanted. |
| 798 |
\end{description} |
| 799 |
The counter \verb|pagesLTS.pnc.\pagesLTS@pnc| gives the number of the\newline |
| 800 |
\verb|\pagesLTS@pnc| page numbering scheme currently used, i.\,e.~we have consecutivly\newpage |
| 801 |
\begin{verbatim} |
| 802 |
pagesLTS.pnc.roman = 1 |
| 803 |
pagesLTS.pnc.Roman = 1 |
| 804 |
pagesLTS.pnc.arabic = 1 |
| 805 |
pagesLTS.pnc.fnsymbol = 1 |
| 806 |
pagesLTS.pnc.Roman = 2 |
| 807 |
pagesLTS.pnc.alph = 1 |
| 808 |
pagesLTS.pnc.Roman = 3 |
| 809 |
pagesLTS.pnc.Alph = 1 |
| 810 |
\end{verbatim} |
| 811 |
So, \verb|pagesLTS.pnc.Roman| changes from $1$ to $2$ automatically |
| 812 |
when doing the second \verb|\pagenumbering{Roman}|, |
| 813 |
and changes from $2$ to $3$ for the third\newline |
| 814 |
\verb|\pagenumbering{Roman}|.\bigskip |
| 815 |
|
| 816 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 817 |
\lastpageref{pagesLTS.0}\bigskip |
| 818 |
|
| 819 |
The page (\verb|\thepage|): \thepage \bigskip |
| 820 |
|
| 821 |
Current page (\verb|\theCurrentPage|), |
| 822 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 823 |
|
| 824 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 825 |
i.\,e.~counted continuously from the first page of the |
| 826 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 827 |
|
| 828 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 829 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 830 |
|
| 831 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 832 |
\makeatletter% |
| 833 |
\ifpagesLTS@pagecontinue% |
| 834 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 835 |
\else% |
| 836 |
(There are % |
| 837 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 838 |
\the\numexpr% |
| 839 |
\csname [email protected]\endcsname% |
| 840 |
+\csname [email protected]\endcsname% |
| 841 |
+\csname [email protected]\endcsname% |
| 842 |
\relax~pages with Roman numbers:\newline |
| 843 |
\fi% |
| 844 |
\makeatother% |
| 845 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 846 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 847 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 848 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 849 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 850 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 851 |
|
| 852 |
When the option \texttt{pagecontinue=false} is used with the |
| 853 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 854 |
point to the same page as before, but this will have a lower number. |
| 855 |
And if that page number was also present in a preceding sector, |
| 856 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 857 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 858 |
of pages in the last sector. To get the total number of Roman pages, % |
| 859 |
\begin{verbatim} |
| 860 |
\the\numexpr \csname [email protected]\endcsname% |
| 861 |
+\csname [email protected]\endcsname% |
| 862 |
+\csname [email protected]\endcsname% |
| 863 |
\relax% |
| 864 |
\end{verbatim}% |
| 865 |
would be necessary.\bigskip |
| 866 |
|
| 867 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 868 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 869 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 870 |
|
| 871 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 872 |
(\verb|\lastpageref{pagesLTS.fnsymbol}| -- never |
| 873 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\newline |
| 874 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 875 |
|
| 876 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 877 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 878 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 879 |
|
| 880 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 881 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 882 |
|
| 883 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 884 |
|
| 885 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 886 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 887 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 888 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 889 |
|
| 890 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 891 |
(=~total number of pages)\bigskip |
| 892 |
|
| 893 |
\lipsum[1-6] |
| 894 |
|
| 895 |
\newpage |
| 896 |
|
| 897 |
\verb|\lastpageref{pagesLTS.Roman}| does \textbf{not} |
| 898 |
refer to this page (but there: \lastpageref{pagesLTS.Roman}) |
| 899 |
for option \texttt{pagecontinue=true}. When a reference to this page is wanted,\newline |
| 900 |
\verb|\lastpageref{pagesLTS.Roman.2}| can be used: \lastpageref{pagesLTS.Roman.2}.\newline |
| 901 |
When the option \texttt{pagecontinue=false} is used with the |
| 902 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 903 |
point to the same page as before, but this will have a lower number. |
| 904 |
And if that page number was also present in a preceding sector, |
| 905 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 906 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 907 |
of pages in the last sector. To get the total number of Roman pages, % |
| 908 |
\begin{verbatim} |
| 909 |
\the\numexpr \csname [email protected]\endcsname% |
| 910 |
+\csname [email protected]\endcsname% |
| 911 |
+\csname [email protected]\endcsname% |
| 912 |
\relax% |
| 913 |
\end{verbatim}% |
| 914 |
would be necessary.\bigskip |
| 915 |
|
| 916 |
There are \lastpages{Roman}{2}~pages (\verb|\lastpages{Roman}{2}|) in this |
| 917 |
second Roman sector.\newline |
| 918 |
The Roman page numbering scheme is continued later in section~\ref{Roman3})! |
| 919 |
|
| 920 |
\newpage |
| 921 |
\pagenumbering{alph} |
| 922 |
\section{alph\label{alph}} |
| 923 |
|
| 924 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 925 |
\lastpageref{pagesLTS.0}\bigskip |
| 926 |
|
| 927 |
The page (\verb|\thepage|): \thepage \bigskip |
| 928 |
|
| 929 |
Current page (\verb|\theCurrentPage|), |
| 930 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 931 |
|
| 932 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 933 |
i.\,e.~counted continuously from the first page of the |
| 934 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 935 |
|
| 936 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 937 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 938 |
|
| 939 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 940 |
\makeatletter% |
| 941 |
\ifpagesLTS@pagecontinue% |
| 942 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 943 |
\else% |
| 944 |
(There are % |
| 945 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 946 |
\the\numexpr% |
| 947 |
\csname [email protected]\endcsname% |
| 948 |
+\csname [email protected]\endcsname% |
| 949 |
+\csname [email protected]\endcsname% |
| 950 |
\relax~pages with Roman numbers:\newline |
| 951 |
\fi% |
| 952 |
\makeatother% |
| 953 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 954 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 955 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 956 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 957 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 958 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 959 |
|
| 960 |
When the option \texttt{pagecontinue=false} is used with the |
| 961 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 962 |
point to the same page as before, but this will have a lower number. |
| 963 |
And if that page number was also present in a preceding sector, |
| 964 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 965 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 966 |
of pages in the last sector. To get the total number of Roman pages, % |
| 967 |
\begin{verbatim} |
| 968 |
\the\numexpr \csname [email protected]\endcsname% |
| 969 |
+\csname [email protected]\endcsname% |
| 970 |
+\csname [email protected]\endcsname% |
| 971 |
\relax% |
| 972 |
\end{verbatim}% |
| 973 |
would be necessary.\bigskip |
| 974 |
|
| 975 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 976 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 977 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 978 |
|
| 979 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 980 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 981 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 982 |
|
| 983 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 984 |
|
| 985 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 986 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 987 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 988 |
|
| 989 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 990 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 991 |
|
| 992 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 993 |
|
| 994 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 995 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 996 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 997 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 998 |
|
| 999 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 1000 |
(=~total number of pages) |
| 1001 |
|
| 1002 |
\newpage |
| 1003 |
|
| 1004 |
Without option \texttt{alphMult=ab} of the \textsf{pageslts} (and the help of the |
| 1005 |
\textsf{alphalph} package), after page \textquotedblleft z\textquotedblright{} there |
| 1006 |
would just appear a |
| 1007 |
\begin{quote} |
| 1008 |
\begin{verbatim} |
| 1009 |
LaTeX Error: Counter too large |
| 1010 |
See the LaTeX manual or LaTeX Companion for explanation. |
| 1011 |
You've lost some text. Try typing <return> to proceed. |
| 1012 |
If that doesn't work, type X <return> to quit. |
| 1013 |
\end{verbatim} |
| 1014 |
\end{quote} |
| 1015 |
Now the page numbers are continued aa, ab, ac,\ldots\ (aa, bb, cc,\ldots\ is |
| 1016 |
also possible, see the \textsf{pageslts} documentation).\newline |
| 1017 |
To demonstrate this, we add a\newline |
| 1018 |
\verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}|\newline |
| 1019 |
in the source code here. |
| 1020 |
|
| 1021 |
\addtocounter{page}{\pagesLTSexamplealph} |
| 1022 |
|
| 1023 |
\bigskip |
| 1024 |
|
| 1025 |
\lipsum[1-18] |
| 1026 |
|
| 1027 |
\newpage |
| 1028 |
\pagenumbering{Roman} |
| 1029 |
\section{Roman - third time!\label{Roman3}} |
| 1030 |
|
| 1031 |
The page number starts with \textquotedblleft I\textquotedblright{} again for |
| 1032 |
option just \texttt{pagecontinue=false}, but for option \texttt{pagecontinue=true}, |
| 1033 |
or with option just \texttt{pagecontinue}, or even just |
| 1034 |
\nolinebreak{with\textbf{out}} option \texttt{pagecontinue=false} |
| 1035 |
the page numbers are continued. |
| 1036 |
|
| 1037 |
This package remembered the |
| 1038 |
$\number\value{pagesLTS.double.Roman}-1$, |
| 1039 |
i.\,e.~\the\numexpr\value{pagesLTS.double.Roman}-1\relax, pages |
| 1040 |
already done in% |
| 1041 |
\begin{description} |
| 1042 |
\item[-] for \texttt{pagecontinue=false}: the preceding Roman sector, |
| 1043 |
\item[-] for \texttt{pagecontinue=true}: all Roman sectors, |
| 1044 |
\end{description}% |
| 1045 |
and therefore continues with the appropriate page in case of option \texttt{pagecontinue}.\newline |
| 1046 |
If you want to start with \textquotedblleft I\textquotedblright{} all |
| 1047 |
over again, you will have two pages with the same name, |
| 1048 |
but nevertheless you can do this by using option \texttt{pagecontinue=false} |
| 1049 |
or a \verb|\setcounter{page}{1}|\ here (not demonstrated in this example file).\bigskip |
| 1050 |
|
| 1051 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 1052 |
\lastpageref{pagesLTS.0}\bigskip |
| 1053 |
|
| 1054 |
The page (\verb|\thepage|): \thepage \bigskip |
| 1055 |
|
| 1056 |
Current page (\verb|\theCurrentPage|), |
| 1057 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 1058 |
|
| 1059 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 1060 |
i.\,e.~counted continuously from the first page of the |
| 1061 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 1062 |
|
| 1063 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 1064 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 1065 |
|
| 1066 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 1067 |
\makeatletter% |
| 1068 |
\ifpagesLTS@pagecontinue% |
| 1069 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 1070 |
\else% |
| 1071 |
(There are % |
| 1072 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 1073 |
\the\numexpr% |
| 1074 |
\csname [email protected]\endcsname% |
| 1075 |
+\csname [email protected]\endcsname% |
| 1076 |
+\csname [email protected]\endcsname% |
| 1077 |
\relax~pages with Roman numbers:\newline |
| 1078 |
\fi% |
| 1079 |
\makeatother% |
| 1080 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 1081 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 1082 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 1083 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 1084 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 1085 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 1086 |
|
| 1087 |
When the option \texttt{pagecontinue=false} is used with the |
| 1088 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 1089 |
point to the same page as before, but this will have a lower number. |
| 1090 |
And if that page number was also present in a preceding sector, |
| 1091 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 1092 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 1093 |
of pages in the last sector. To get the total number of Roman pages, % |
| 1094 |
\begin{verbatim} |
| 1095 |
\the\numexpr \csname [email protected]\endcsname% |
| 1096 |
+\csname [email protected]\endcsname% |
| 1097 |
+\csname [email protected]\endcsname% |
| 1098 |
\relax% |
| 1099 |
\end{verbatim}% |
| 1100 |
would be necessary.\bigskip |
| 1101 |
|
| 1102 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 1103 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 1104 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 1105 |
|
| 1106 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 1107 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 1108 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 1109 |
|
| 1110 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 1111 |
|
| 1112 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 1113 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 1114 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 1115 |
|
| 1116 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 1117 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 1118 |
|
| 1119 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 1120 |
|
| 1121 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 1122 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 1123 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 1124 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 1125 |
|
| 1126 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 1127 |
(=~total number of pages) |
| 1128 |
\newpage |
| 1129 |
\lipsum[1-3] |
| 1130 |
\newpage |
| 1131 |
|
| 1132 |
\lastpageref{pagesLTS.Roman} (\verb|\lastpageref{pagesLTS.Roman}|) |
| 1133 |
\textbf{does} refers to this page.\newline |
| 1134 |
Also \verb|\lastpageref{pagesLTS.Roman.3}| |
| 1135 |
give the right name of the page, but if \verb|pagecontinue=false| was chosen, |
| 1136 |
it might point to another page with the same name! |
| 1137 |
\lastpageref{pagesLTS.Roman.3}.\bigskip |
| 1138 |
|
| 1139 |
\bigskip |
| 1140 |
|
| 1141 |
There are \lastpages{Roman}{3}~pages (\verb|\lastpages{Roman}{3}|) in this |
| 1142 |
third Roman sector. |
| 1143 |
|
| 1144 |
\newpage |
| 1145 |
\pagenumbering{gobble} |
| 1146 |
\section{gobble} |
| 1147 |
|
| 1148 |
Well. You can use \verb|gobble| as page numbering scheme. It gobbles the page numbers, |
| 1149 |
i.\,e.~there is no page number. Maybe \verb|\thispagestyle{empty}| is more useful? |
| 1150 |
Do not expect to be able to make working references to pages without page number, |
| 1151 |
and do expect to get |
| 1152 |
\begin{verbatim} |
| 1153 |
pdfTeX warning (ext4): destination with the same identifier |
| 1154 |
(name{page.}) has been already used, duplicate ignored |
| 1155 |
<to be read again> |
| 1156 |
\end{verbatim} |
| 1157 |
|
| 1158 |
The page (\verb|\thepage|): \thepage{} (There is a nothing between two spaces there.)\bigskip |
| 1159 |
|
| 1160 |
Current page (\verb|\theCurrentPage|), |
| 1161 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 1162 |
|
| 1163 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 1164 |
i.\,e.~counted continuously from the first page of the |
| 1165 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 1166 |
|
| 1167 |
There are \lastpageref*{pagesLTS.gobble.local} pages with gobbled numbers (i.\,e.~without numbers). |
| 1168 |
|
| 1169 |
\bigskip |
| 1170 |
|
| 1171 |
For testing purposes, try: |
| 1172 |
|
| 1173 |
\begin{small} |
| 1174 |
\begin{verbatim} |
| 1175 |
\documentclass{article} |
| 1176 |
\usepackage[plainpages=false,pageanchor=true,pdfpagelabels=true]{hyperref} |
| 1177 |
\usepackage{pageslts} |
| 1178 |
\pagenumbering{gobble} |
| 1179 |
\begin{document} |
| 1180 |
First page.\newpage |
| 1181 |
\verb|\lastpageref{pagesLTS.0} | \lastpageref{pagesLTS.0} \par |
| 1182 |
\verb|\lastpageref{pagesLTS.0.local} | \lastpageref{pagesLTS.0.local} \par |
| 1183 |
\verb|\lastpageref{LastPage} | \lastpageref{LastPage} \par |
| 1184 |
\verb|\lastpageref{VeryLastPage} | \lastpageref{VeryLastPage} \par |
| 1185 |
\verb|\lastpageref{pagesLTS.gobble.1} | \lastpageref{pagesLTS.gobble.1} \par |
| 1186 |
\verb|\lastpageref{pagesLTS.gobble.1.local} | \lastpageref{pagesLTS.gobble.1.local} \par |
| 1187 |
\verb|\lastpageref{pagesLTS.gobble} | \lastpageref{pagesLTS.gobble} \par |
| 1188 |
\verb|\lastpageref{pagesLTS.gobble.local} | \lastpageref{pagesLTS.gobble.local} \par |
| 1189 |
\verb|\lastpageref{LastPages} | \lastpageref{LastPages} \par |
| 1190 |
\verb|\pagesLTSlastpage | \pagesLTSlastpage |
| 1191 |
\newpage |
| 1192 |
Last page. |
| 1193 |
\end{document} |
| 1194 |
\end{verbatim} |
| 1195 |
\end{small} |
| 1196 |
\newpage |
| 1197 |
|
| 1198 |
\pagenumbering{Alph} |
| 1199 |
\section{Alph} |
| 1200 |
|
| 1201 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 1202 |
\lastpageref{pagesLTS.0}\bigskip |
| 1203 |
|
| 1204 |
The page (\verb|\thepage|): \thepage \bigskip |
| 1205 |
|
| 1206 |
Current page (\verb|\theCurrentPage|), |
| 1207 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 1208 |
|
| 1209 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 1210 |
i.\,e.~counted continuously from the first page of the |
| 1211 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 1212 |
|
| 1213 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 1214 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 1215 |
|
| 1216 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 1217 |
\makeatletter% |
| 1218 |
\ifpagesLTS@pagecontinue% |
| 1219 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 1220 |
\else% |
| 1221 |
(There are % |
| 1222 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 1223 |
\the\numexpr% |
| 1224 |
\csname [email protected]\endcsname% |
| 1225 |
+\csname [email protected]\endcsname% |
| 1226 |
+\csname [email protected]\endcsname% |
| 1227 |
\relax~pages with Roman numbers:\newline |
| 1228 |
\fi% |
| 1229 |
\makeatother% |
| 1230 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 1231 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 1232 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 1233 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 1234 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 1235 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 1236 |
|
| 1237 |
When the option \texttt{pagecontinue=false} is used with the |
| 1238 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 1239 |
point to the same page as before, but this will have a lower number. |
| 1240 |
And if that page number was also present in a preceding sector, |
| 1241 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 1242 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 1243 |
of pages in the last sector. To get the total number of Roman pages, % |
| 1244 |
\begin{verbatim} |
| 1245 |
\the\numexpr \csname [email protected]\endcsname% |
| 1246 |
+\csname [email protected]\endcsname% |
| 1247 |
+\csname [email protected]\endcsname% |
| 1248 |
\relax% |
| 1249 |
\end{verbatim}% |
| 1250 |
would be necessary.\bigskip |
| 1251 |
|
| 1252 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 1253 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 1254 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 1255 |
|
| 1256 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 1257 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 1258 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\newline |
| 1259 |
|
| 1260 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 1261 |
|
| 1262 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 1263 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 1264 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 1265 |
|
| 1266 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 1267 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 1268 |
|
| 1269 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 1270 |
|
| 1271 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 1272 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 1273 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 1274 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 1275 |
|
| 1276 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 1277 |
(=~total number of pages) |
| 1278 |
\newpage |
| 1279 |
|
| 1280 |
Without option \texttt{alphMulti=AB} of the \textsf{pageslts} |
| 1281 |
(and the help of the \textsf{alphalph} package), after page |
| 1282 |
\textquotedblleft Z\textquotedblright{} there would just appear~a |
| 1283 |
\begin{quote} |
| 1284 |
\begin{verbatim} |
| 1285 |
LaTeX Error: Counter too large |
| 1286 |
See the LaTeX manual or LaTeX Companion for explanation. |
| 1287 |
You've lost some text. Try typing <return> to proceed. |
| 1288 |
If that doesn't work, type X <return> to quit. |
| 1289 |
\end{verbatim} |
| 1290 |
\end{quote} |
| 1291 |
Now the page numbers are continued AA, AB, AC,\ldots\ (AA, BB, CC,\ldots\ is |
| 1292 |
also possible, see the \textsf{pageslts} documentation).\newline |
| 1293 |
This is not demonstrated here, but see section~\ref{alph}. |
| 1294 |
\newpage |
| 1295 |
|
| 1296 |
\section{silly} |
| 1297 |
The sillypage package, \url{https://ctan.org/pkg/sillypage}, provides the |
| 1298 |
page\-numbering scheme \verb|silly|, which is not demonstrated here |
| 1299 |
but works with the pageslts package, i.\,e.~the references |
| 1300 |
all show the right (page) number and link to the right page.\bigskip |
| 1301 |
|
| 1302 |
This is \textbf{not} demonstrated here (discussing gobbled page numbers |
| 1303 |
is silly enough), but for testing purposes, try: |
| 1304 |
|
| 1305 |
\begin{small} |
| 1306 |
\begin{verbatim} |
| 1307 |
\documentclass{article} |
| 1308 |
\usepackage[plainpages=false,pageanchor=true,pdfpagelabels=true]{hyperref} |
| 1309 |
\usepackage{pageslts} |
| 1310 |
\usepackage{sillypage} |
| 1311 |
\pagenumbering{silly} |
| 1312 |
\begin{document} |
| 1313 |
First page.\newpage |
| 1314 |
\verb|\lastpageref{pagesLTS.0} | \lastpageref{pagesLTS.0} \par |
| 1315 |
\verb|\lastpageref{pagesLTS.0.local} | \lastpageref{pagesLTS.0.local} \par |
| 1316 |
\verb|\lastpageref{LastPage} | \lastpageref{LastPage} \par |
| 1317 |
\verb|\lastpageref{VeryLastPage} | \lastpageref{VeryLastPage} \par |
| 1318 |
\verb|\lastpageref{pagesLTS.silly.1} | \lastpageref{pagesLTS.silly.1} \par |
| 1319 |
\verb|\lastpageref{pagesLTS.silly.1.local} | \lastpageref{pagesLTS.silly.1.local} \par |
| 1320 |
\verb|\lastpageref{pagesLTS.silly} | \lastpageref{pagesLTS.silly} \par |
| 1321 |
\verb|\lastpageref{pagesLTS.silly.local} | \lastpageref{pagesLTS.silly.local} \par |
| 1322 |
\verb|\lastpageref{LastPages} | \lastpageref{LastPages} \par |
| 1323 |
\verb|\pagesLTSlastpage | \pagesLTSlastpage |
| 1324 |
\newpage |
| 1325 |
Page \theCurrentPage\newpage |
| 1326 |
Page \theCurrentPage\newpage |
| 1327 |
Page \theCurrentPage\newpage |
| 1328 |
Page \theCurrentPage\newpage |
| 1329 |
Page \theCurrentPage\newpage |
| 1330 |
Page \theCurrentPage\newpage |
| 1331 |
Page \theCurrentPage\newpage |
| 1332 |
Page \theCurrentPage\newpage |
| 1333 |
Page \theCurrentPage\newpage |
| 1334 |
Page \theCurrentPage\newpage |
| 1335 |
Page \theCurrentPage\newpage |
| 1336 |
Page \theCurrentPage\newpage |
| 1337 |
Page \theCurrentPage : Last page. |
| 1338 |
\end{document} |
| 1339 |
\end{verbatim} |
| 1340 |
\end{small} |
| 1341 |
\newpage |
| 1342 |
|
| 1343 |
\section{The End} |
| 1344 |
|
| 1345 |
First page (\verb|\lastpageref{pagesLTS.0}|): |
| 1346 |
\lastpageref{pagesLTS.0}\bigskip |
| 1347 |
|
| 1348 |
The page (\verb|\thepage|): \thepage \bigskip |
| 1349 |
|
| 1350 |
Current page (\verb|\theCurrentPage|), |
| 1351 |
i.\,e.~counted continuously from the first page): \theCurrentPage \bigskip |
| 1352 |
|
| 1353 |
CurrentPageLocal (\verb|\theCurrentPageLocal|), |
| 1354 |
i.\,e.~counted continuously from the first page of the |
| 1355 |
current page numbering scheme (if option pagecontinue=false: sector)): \theCurrentPageLocal \bigskip |
| 1356 |
|
| 1357 |
Last roman page (pagesLTS.roman): \lastpageref{pagesLTS.roman}{\hskip4em } |
| 1358 |
(There are \lastpageref{pagesLTS.roman.local} pages with roman numbers.)\bigskip |
| 1359 |
|
| 1360 |
Last Roman page (pagesLTS.Roman): \lastpageref{pagesLTS.Roman}{\hskip3em }% |
| 1361 |
\makeatletter% |
| 1362 |
\ifpagesLTS@pagecontinue% |
| 1363 |
(There are \lastpageref{pagesLTS.Roman.local}~pages with Roman numbers:\newline |
| 1364 |
\else% |
| 1365 |
(There are % |
| 1366 |
\lastpages{Roman}{1}+\lastpages{Roman}{2}+\lastpages{Roman}{3}=% |
| 1367 |
\the\numexpr% |
| 1368 |
\csname [email protected]\endcsname% |
| 1369 |
+\csname [email protected]\endcsname% |
| 1370 |
+\csname [email protected]\endcsname% |
| 1371 |
\relax~pages with Roman numbers:\newline |
| 1372 |
\fi% |
| 1373 |
\makeatother% |
| 1374 |
\lastpages{Roman}{1}~pages in the first Roman sector |
| 1375 |
(\pageref{Roman}{\hskip3em }-\lastpageref{pagesLTS.Roman.1}{\hskip3em }),\newline |
| 1376 |
\lastpages{Roman}{2}~pages in the second Roman sector |
| 1377 |
(\pageref{Roman2}{\hskip3em }-\lastpageref{pagesLTS.Roman.2}{\hskip3em }), and\newline |
| 1378 |
\lastpages{Roman}{3}~pages in the third Roman sector |
| 1379 |
(\pageref{Roman3}{\hskip3em }-\lastpageref{pagesLTS.Roman.3}{\hskip3em }).)\bigskip |
| 1380 |
|
| 1381 |
When the option \texttt{pagecontinue=false} is used with the |
| 1382 |
\textsf{pageslts} package, the \verb|\lastpageref{pagesLTS.Roman}| will |
| 1383 |
point to the same page as before, but this will have a lower number. |
| 1384 |
And if that page number was also present in a preceding sector, |
| 1385 |
the link will go to that page. (Several pages with the same number\ldots)\newline |
| 1386 |
The \verb|\lastpageref{pagesLTS.Roman.local}| will refer only to the number |
| 1387 |
of pages in the last sector. To get the total number of Roman pages, % |
| 1388 |
\begin{verbatim} |
| 1389 |
\the\numexpr \csname [email protected]\endcsname% |
| 1390 |
+\csname [email protected]\endcsname% |
| 1391 |
+\csname [email protected]\endcsname% |
| 1392 |
\relax% |
| 1393 |
\end{verbatim}% |
| 1394 |
would be necessary.\bigskip |
| 1395 |
|
| 1396 |
Last arabic page (pagesLTS.arabic): \lastpageref{pagesLTS.arabic}{\hskip5em } |
| 1397 |
(There are only \lastpageref{pagesLTS.arabic.local} pages with arabic numbers, |
| 1398 |
because an \verb|\addtocounter{page}{|\pagesLTSexampleArabic\verb|}| was used.)\bigskip |
| 1399 |
|
| 1400 |
Last fnsymbol page (pagesLTS.fnsymbol): \lastpageref{pagesLTS.fnsymbol}\newline |
| 1401 |
(better \verb|\lastpageref{pagesLTS.fnsymbol}| than just\newline |
| 1402 |
\verb|\pageref{pagesLTS.fnsymbol}|!)\bigskip |
| 1403 |
|
| 1404 |
(There are \lastpageref{pagesLTS.fnsymbol.local} pages with fnsymbol numbers.)\bigskip |
| 1405 |
|
| 1406 |
Last alph page (pagesLTS.alph): \lastpageref{pagesLTS.alph}{\hskip4em } |
| 1407 |
(There are only \lastpageref{pagesLTS.alph.local} pages with alph numbers, |
| 1408 |
because an \verb|\addtocounter{page}{|\pagesLTSexamplealph\verb|}| was used.)\bigskip |
| 1409 |
|
| 1410 |
Last gobble page (pagesLTS.gobble: \lastpageref{pagesLTS.gobble}{\hskip4em } |
| 1411 |
Yes, there is neither page number nor link, because everything got gobbled. |
| 1412 |
(There is \lastpageref*{pagesLTS.gobble.local} page with gobbled number (i.\,e.~without number).)\bigskip |
| 1413 |
|
| 1414 |
Last Alph page (pagesLTS.Alph): \lastpageref{pagesLTS.Alph}{\hskip4em } |
| 1415 |
(There are \lastpageref{pagesLTS.Alph.local} pages with Alph numbers.)\bigskip |
| 1416 |
|
| 1417 |
Silly page numbers are possible but were not demonstrated in this example. |
| 1418 |
\newpage |
| 1419 |
|
| 1420 |
Last page's \textit{name} (LastPage): \lastpageref{LastPage}\bigskip |
| 1421 |
|
| 1422 |
Very last page's \textit{name} (VeryLastPage): \lastpageref{VeryLastPage}\newline |
| 1423 |
(\texttt{LastPage} and \texttt{VeryLastPage} are now identical, because both are now done |
| 1424 |
\verb|\AddToHook{enddocument/afterlastpage}| instead of formerly\newline |
| 1425 |
\verb|\AtEndDocument| and \verb|\AfterLastShipout|, which were different.)\bigskip |
| 1426 |
|
| 1427 |
Last page's \textit{number} (LastPages): \lastpageref{LastPages}{\hskip3em } |
| 1428 |
(=~total number of pages) |
| 1429 |
\end{document} |
| 1430 |
\endinput |
| 1431 |
%% |
| 1432 |
%% End of file `pageslts-example.tex'. |