diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/README | 146 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/README.lastpage | 22 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf | bin | 0 -> 128200 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex | 146 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/lastpage.pdf | bin | 166512 -> 498075 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/lastpage/ltxdoc.cfg | 112 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/lastpage/lastpage.drv | 107 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/lastpage/lastpage.dtx | 1903 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/lastpage/lastpage.ins | 149 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/lastpage/lastpage.sty | 210 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/lastpage/lastpage209.sty | 62 |
11 files changed, 2542 insertions, 315 deletions
diff --git a/Master/texmf-dist/doc/latex/lastpage/README b/Master/texmf-dist/doc/latex/lastpage/README new file mode 100644 index 00000000000..f275f0e49f2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/lastpage/README @@ -0,0 +1,146 @@ +README for lastpage package, 2010/08/25, v1.2d + + +TABLE OF CONTENTS +================= + +1 Introduction +2 Download +3 Installation +4 Additional Packages +5 New Features +6 Package Compatibility +7 Authors/Maintainers +8 Bug Reports +9 Known Problems + + +1 INTRODUCTION +============== + +This package puts the label LastPage (\AtEndDocument) into +the .aux file, allowing the user to refer to the last page +of a document. This might be particularly useful in places +like headers or footers. - +When more than one page numbering scheme is used, or the +fnsymbol page numbering scheme is used, or another package +has output after this package, or the number of pages +instead of the last page's name is needed, or the page +numbers exeed a certain range, there might be problems, +which can be solved by using the pagesLTS package instead. + + +2 DOWNLOAD +========== + +`lastpage' is available on CTAN: + CTAN:macros/latex/contrib/lastpage/ + +Also a ZIP file is provided that contains the files, already +sorted in a TDS tree (should become available on CTAN soon): + CTAN:install/macros/latex/contrib/lastpage.tds.zip + +`CTAN:' means one of the `Comprehensive TeX Archive Network' +nodes or one of its mirrors. This is explained in + http://www.tex.ac.uk/cgi-bin/texfaq2html?label=archives + +The CTAN stuff will be mirrored automatically from the +ftp server, so + ftp://ftp.tug.org/pub/tex/pagesLTS/ +corresponds to + CTAN:macros/latex/contrib/pagesLTS/ + + +3 INSTALLATION +============== + +First, please make sure that there is no old version of +lastpage at some obsolete place in your system. + +Installation with ZIP file in TDS format +---------------------------------------- +The ZIP file `lastpage.tds.zip' contains the files sorted +in a TDS tree. Thus you can directly unpack the ZIP file +inside a TDS tree. +(See CTAN:tds.zip for an explanation of TDS.) +Example: + cd /...somewhere.../texmf + unzip /...downloadpath.../lastpage.tds.zip +Do not forget to refresh the file name database of this +TDS tree. +Example: + texhash /...somewhere.../texmf + +Manual installation +------------------- +a) Download the lastpage files from CTAN or the TUG server. + If necessary, unpack them. +b) If directory `beta' exists, replace the files by the + counterparts in this directory, if you want to use the + latest versions. +c) Generate the package and driver files: + tex lastpage.ins +d) Install the files `*.sty', and `*.cfg' in your TDS tree: + cp *.sty *.cfg TDS:tex/latex/muench/lastpage/ + Replace `TDS:' by the prefix of your TDS tree + (texmf directory). +e) Copy the documentation files to + "TDS:doc/latex/muench/lastpage/": + README, lastpage.pdf, lastpage-example.tex, + lastpage-example.pdf. +f) Update the databases if necessary, e.g. for teTeX: + mktexlsr .../texmf + + +4 ADDITIONAL PACKAGES +===================== + +The lastpage package does not depend on other packages. + + +5 PACKAGE COMPATIBILITY +======================= + +lastpage is not compatible with the very old version 2.0 +(and earlier) of the endfloat package. Newer versions of +endfloat exists (at the time of writing this documentation: +v2.4i as of 1995/10/11), which are available at CTAN. + + +6 AUTHOR/MAINTAINER +===================== + +* Hans-Martin Münch + + +7 BUG REPORTS +============== + +A bug report should contain: +* Comprehensive problem description. This includes error or + warning messages. + * \errorcontextlines=\maxdimen can be added in the + TeX code to get more informations in TeX error messages. +* Minimal test file that shows the problem, but does not + contain any unnecessary packages and code. +* Used drivers/programs. +* Version information about used packages and programs. + * If you are using LaTeX, then add "\listfiles". Then + a list of version informations is printed at the end + of the LaTeX run. +* Please no other files than the minimal test file. + The other files .log, .dvi, .ps, .pdf are seldom + necessary, so send them only on request. +* Please .zip or .tar.gz your file(s) before sending them! + +Bug address +----------- +Bug reports can be send to the maintainer: + Hans-Martin Münch + <Martin [dot] Muench [at] Uni-Bonn [dot] de> + + +8 KNOWN PROBLEMS +================= + +* Really a lot, see chapter 3 of the documentation!
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/lastpage/README.lastpage b/Master/texmf-dist/doc/latex/lastpage/README.lastpage deleted file mode 100644 index 22d3a7820b2..00000000000 --- a/Master/texmf-dist/doc/latex/lastpage/README.lastpage +++ /dev/null @@ -1,22 +0,0 @@ -This is an extremely minor package (7 lines of "real code") -for LaTeX2e. Allows for a references to something on the -last page of a document. - -README.lastpage This file (sorry not 8.3 character name) - -lastpage.ins The installation batch file. (just run - latex on that) to get .drv and .sty files - -lastpage.dtx The main file. - -Written and -currently maintained by Jeff Goldberg (J.Goldberg@Cranfield.ac.uk) - -Note that as of May 1999, I am formally releasing this package under the terms -of the General Public License Agreement of the Free Software Foundation. - -The previous license was not well thought out and was overly restrictive. -I am happy for the new freedoms granted by the license change to applied -retrospectively to any previous release of this package. - -1999/05/29 diff --git a/Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf Binary files differnew file mode 100644 index 00000000000..bbe410bdeb9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.pdf diff --git a/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex new file mode 100644 index 00000000000..ca05690ffc3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/lastpage/lastpage-example.tex @@ -0,0 +1,146 @@ +%% +%% This is file `lastpage-example.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lastpage.dtx (with options: `example') +%% +%% This is a generated file. +%% +%% IMPORTANT NOTICE: +%% The usual disclaimers apply: +%% 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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% +\documentclass[british]{article} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[draft]{showkeys}[2007/08/07]% v3.15 +%% Use final instead of draft to hide the keys. %% +\usepackage{hyperref}[2010/06/18]% v6.81g +\hypersetup{% + extension=pdf,% + plainpages=false,% + pdfpagelabels=true,% + hyperindex=false,% + pdflang={en},% + pdftitle={lastpage package example},% + pdfauthor={Hans-Martin Muench},% + pdfsubject={Example for the lastpage package},% + pdfkeywords={LaTeX, lastpage, Hans-Martin Muench},% + pdfview=Fit,% + pdfstartview=Fit,% + pdfpagelayout=SinglePage% +} +%% If you disable hyperref, you must also remove the one \href in this example. +\usepackage{lastpage}[2010/08/25]% v1.2d +\makeatletter +\renewcommand{\@evenfoot}% + {\normalsize\slshape \today\hfil \upshape page {\thepage} of \pageref{LastPage}} +\renewcommand{\@oddfoot}{\@evenfoot} +\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}% +\makeatother +\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.2d as of 2010/08/25 (HMM; JPG).\newline +The package takes no options.\newline +For more details please see the documentation!\newline + +\noindent \label{keys} To hide the \pageref{keys}{\qquad } use option +\texttt{final} instead of \texttt{draft} with the \textsf{showkeys} +package (or remove the package call from the preamble of +this document).\newline + +\textbf{Trademarks} appear throughout this example without any +trademark symbol; they are the property of their respective +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!\newline +(In Adobe Reader 9.3.3: \underline{E}dit $>$ +Prefere\underline{n}ces (Ctrl+k) $>$ Page Display $>$ +Page Content and Information $>$ Use logical page +\nolinebreak{\underline{n}umbers.)}\newline + +If you are more ambitiouse in respect to your aims with this package, +you might want to have a look at the \textsf{pagesLTS} package\newline +(\href{http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/}{% +CTAN:/macros/latex/contrib/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 (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\section*{The End} + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} +\end{document} +\endinput +%% +%% End of file `lastpage-example.tex'. diff --git a/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf b/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf Binary files differindex 3737be8ac94..acfb9b47ef3 100644 --- a/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf +++ b/Master/texmf-dist/doc/latex/lastpage/lastpage.pdf diff --git a/Master/texmf-dist/doc/latex/lastpage/ltxdoc.cfg b/Master/texmf-dist/doc/latex/lastpage/ltxdoc.cfg new file mode 100644 index 00000000000..2789906c283 --- /dev/null +++ b/Master/texmf-dist/doc/latex/lastpage/ltxdoc.cfg @@ -0,0 +1,112 @@ +%% +%% This is file `ltxdoc.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lastpage.dtx (with options: `ltxdoc') +%% +%% This is a generated file. +%% +%% IMPORTANT NOTICE: +%% The usual disclaimers apply: +%% 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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesFile{ltxdoc.cfg}[2010/07/29 v1.0b configuration file for lastpage (HMM)] + %% Code from original ltxdoc.cfg [2007/01/08 latex-tds: ltxdoc.cls configuration (HO)], %% + % copyrighted 2006, 2007 Heiko Oberdiek, part of project `latex-tds'. + % That file may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://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. + % That work has the LPPL maintenance status `maintained'. + % The Current Maintainer of that work is Heiko Oberdiek. + \PassOptionsToClass{a4paper}{article} + \AtEndOfClass{% + \RequirePackage[numbered]{hypdoc}[2010/03/26]% v1.9 + \pdfstringdefDisableCommands{% + \let\env\relax % longtable.dtx + \let\mytt\relax % tabularx.dtx + }% + \addtolength{\topmargin}{-10mm}% + \addtolength{\textheight}{20mm}% + % Depending on the page style, the head or foot area + % are put into the text area. + % Usually the page style is the default "plain". + % tools/verbatim.dtx uses "myheadings". + \def\string@plain{plain}% + \def\string@myheadings{myheadings}% + \def\current@pagestyle{plain}% + \let\ltxdoc@cfg@pagestyle\pagestyle + \def\pagestyle#1{% + \def\current@pagestyle{#1}% + \ltxdoc@cfg@pagestyle{#1}% + }% + \edef\ltxdoc@cfg@jobname{\jobname}% + \def\ltxdoc@cfg@longtable{longtable}% + \@onelevel@sanitize\ltxdoc@cfg@longtable + \ifx\ltxdoc@cfg@jobname\ltxdoc@cfg@longtable + \def\current@pagestyle{both}% + \fi + \let\ltxdoc@cfg@document\document + \def\document{% + \ifx\current@pagestyle\string@plain + \addtolength{\textheight}{\headheight}% + \addtolength{\textheight}{\headsep}% + \setlength{\headheight}{0pt}% + \setlength{\headsep}{0pt}% + \global\textheight\textheight + \global\headheight\headheight + \global\headsep\headsep + \fi + \ifx\current@pagestyle\string@myheadings + \addtolength{\textheight}{\footskip}% + \global\textheight\textheight + \fi + \ltxdoc@cfg@document + }% + %% End of code from original ltxdoc.cfg [2007/01/08 latex-tds: ltxdoc.cls configuration (HO)] %% + %% Place additional code here. %% + } + +\endinput +%% +%% End of file `ltxdoc.cfg'. diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.drv b/Master/texmf-dist/source/latex/lastpage/lastpage.drv index 22742f8e45c..885cc7bd181 100644 --- a/Master/texmf-dist/source/latex/lastpage/lastpage.drv +++ b/Master/texmf-dist/source/latex/lastpage/lastpage.drv @@ -6,42 +6,89 @@ %% %% lastpage.dtx (with options: `driver') %% +%% This is a generated file. +%% %% IMPORTANT NOTICE: -%% This is part of a set of tools (or better yet, experiments) -%% written by Jeff Goldberg (J.Goldberg@Cranfield.ac.uk) %% The usual disclaimers apply: %% If it doesn't work right that's your problem. -%% It is released under the terms of the -%% General Public License Agreement (version 2) -\def\filename{lastpage} -\def\fileversion{v0.1b} -\def\filedate{1994/06/25} -\def\docdate {1994/07/20} - -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -%% Allow for things like |page \thepage\ of \pageref{LastPage}| to -%% get `page 5 of 23' -\documentclass[11pt]{ltxdoc} -\setlength\hfuzz{1pt} % ignore slight overfulls +%% (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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesFile{lastpage.drv}[2010/08/25 v1.2d + Refers to last page's name (HMM)]% +\documentclass{ltxdoc}[2007/11/11]% v2.0u +\usepackage{holtxdoc}[2010/04/18]% v0.18 +%% lastpage may work with earlier versions of LaTeX2e and those +%% class and package, but this was not tested. +%% Please consider updating your LaTeX, class, and package +%% to the most recent version (if they are not already the most +%% recent version). +%% Warning: holtxdoc, 2010/04/24 v0.19, requires the packages +%% hypdoc, 2010/03/26, v1.9 +%% hyperref, 2010/03/30, v6.80u (latest: 2010/06/18 v6.81g) +%% pdftexcmds, 2010/04/01, v0.9 +%% ltxcmds, 2010/03/09, v1.4 (latest: 2010/04/26, v1.7) +%% hologo, 2010/04/24, v1.2 +%% array (latest: 2008/09/09, v2.4c) +%% (or more recent versions) and does neither work with +%% nor check for earlier versions! +\hypersetup{% + pdfsubject={Refers to last page's name (HMM; JPG)},% + pdfkeywords={LaTeX, lastpage, last page, page number, page name, Hans-Martin Muench, Jeffrey P. Goldberg},% + pdfencoding=auto,% + pdflang={en},% + breaklinks=true,% + linktoc=all,% + pdfstartview=FitH,% + pdfpagelayout=OneColumn,% + bookmarksnumbered=true,% + bookmarksopen=true,% + bookmarksopenlevel=2,% + pdfmenubar=true,% + pdftoolbar=true,% + pdfwindowui=true,% + pdfnewwindow=true% +} +\setlength\hfuzz{1pt} % Ignore slight overfulls. \CodelineIndex \EnableCrossrefs +\hyphenation{created every-thing ignored} +\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}% \begin{document} - \DocInput{lastpage.dtx} + \DocInput{lastpage.dtx}% \end{document} \endinput %% diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.dtx b/Master/texmf-dist/source/latex/lastpage/lastpage.dtx index 84653e15c66..a8007bea090 100644 --- a/Master/texmf-dist/source/latex/lastpage/lastpage.dtx +++ b/Master/texmf-dist/source/latex/lastpage/lastpage.dtx @@ -1,257 +1,1736 @@ -\def\filename{lastpage} -\def\fileversion{v0.1b} -\def\filedate{1994/06/25} -\def\docdate {1994/07/20} - -% \CheckSum{33} -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -% -%\iffalse -%% Allow for things like |page \thepage\ of \pageref{LastPage}| to -%% get `page 5 of 23' -%\fi +% \iffalse meta-comment % +% lastpage package +% file version: v1.2d +% file date: 2010/08/25 +% documentation date: 2010/08/25 +% +% Copyright (C) 2010 H.-Martin M\"{u}nch (Martin dot Muench at Uni-Bonn dot de) +% Portions of code copyrighted by other people as marked. +% +% This package was invented by Jeffrey P. Goldberg (jeffrey+news at goldmark dot org). +% I thought that a replacement was needed and therefore created the pagesLTS package, +% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +% or +% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +% . 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. +% +% 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 +% version. This version of this license is in +% http://www.latex-project.org/lppl/lppl-1-3c.txt +% and the latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is H.-Martin Muench. +% +% This work consists of the main source file lastpage.dtx +% and the derived files +% lastpage.sty, lastpage.ins, lastpage.drv, +% lastpage-example.tex, lastpage.pdf. +% +% Unpacking: +% (a) If lastpage.ins is present: +% tex lastpage.ins +% (b) Without lastpage.ins: +% tex lastpage.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{lastpage.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If lastpage.drv is present: +% (pdf)latex lastpage.drv +% makeindex -s gind.ist lastpage.idx +% (pdf)latex lastpage.drv +% makeindex -s gind.ist lastpage.idx +% (pdf)latex lastpage.drv +% (b) Without lastpage.drv: +% (pdf)latex lastpage.dtx +% makeindex -s gind.ist lastpage.idx +% (pdf)latex lastpage.dtx +% makeindex -s gind.ist lastpage.idx +% (pdf)latex lastpage.dtx +% +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use DIN A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (for example): +% pdflatex lastpage.dtx +% makeindex -s gind.ist lastpage.idx +% % makeindex -s gglo.ist -o lastpage.gls lastpage.glo +% pdflatex lastpage.dtx +% makeindex -s gind.ist lastpage.idx +% % makeindex -s gglo.ist -o lastpage.gls lastpage.glo +% pdflatex lastpage.dtx +% +% Installation: +% ! First, please make sure that there is no old version of ! +% ! lastpage at some obsolete place in your system. ! +% TDS:tex/latex/muench/lastpage/lastpage.sty +% TDS:doc/latex/muench/lastpage/lastpage.pdf +% TDS:doc/latex/muench/lastpage/lastpage-example.tex +% TDS:source/latex/muench/lastpage/lastpage.dtx +% +%<*ignore> +\begingroup + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +%</ignore> +%<*install> +\input docstrip.tex + +\obeyspaces +\Msg{******************************************************} +\Msg{* Installation *} +\Msg{* Package: lastpage v1.2d 2010/08/25 LaTeX2e package *} +\Msg{* Refers to last page's name (HMM) *} +\Msg{******************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +This is a generated file. + +IMPORTANT NOTICE: +The usual disclaimers apply: +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 +version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainer of this work is H.-Martin Muench +(Martin dot Muench at Uni-Bonn dot de). + +This package was invented by Jeffrey P. Goldberg + (jeffrey+news at goldmark dot org). +I thought that a replacement was needed and therefore created the +pagesLTS package, +http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +or +http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +. 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. + +This work consists of the main source file lastpage.dtx +and the derived files + lastpage.sty, lastpage.ins, lastpage.drv, + lastpage-example.tex, lastpage.pdf. + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{lastpage.ins}{\from{lastpage.dtx}{install}}% + \file{lastpage.drv}{\from{lastpage.dtx}{driver}}% + \file{ltxdoc.cfg}{\from{lastpage.dtx}{ltxdoc}}% + \usedir{tex/latex/muench/lastpage}% + \file{lastpage209.sty}{\from{lastpage.dtx}{lastpage209}}% + \file{lastpage.sty}{\from{lastpage.dtx}{package}}% + \usedir{doc/latex/muench/lastpage}% + \file{lastpage-example.tex}{\from{lastpage.dtx}{example}}% +} + +\obeyspaces +\Msg{**************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* lastpage.sty (or lastpage209.sty for TeX 2.09) *} +\Msg{* *} +\Msg{* To produce the documentation run the file `lastpage.drv' *} +\Msg{* through (pdf)LaTeX, e. g. *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* makeindex -s gind.ist lastpage.idx *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* makeindex -s gind.ist lastpage.idx *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* *} +\Msg{* At least three runs are necessary e. g. to get the *} +\Msg{* references right! *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{**************************************************************} + +\endbatchfile + +%</install> +%<*ignore> +\fi +%</ignore> +% +% \section{The documentation driver file} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.\,e., the file that will produce the documentation you +% are currently reading. It will be extracted from this file by the +% \texttt{docstrip} programme. That is, run \LaTeX\ on \texttt{docstrip} +% and specify the \texttt{driver} option when \texttt{docstrip} +% asks for options. +% +% \begin{macrocode} +%<*driver> +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesFile{lastpage.drv}[2010/08/25 v1.2d + Refers to last page's name (HMM)]% +\documentclass{ltxdoc}[2007/11/11]% v2.0u +\usepackage{holtxdoc}[2010/04/18]% v0.18 +%% lastpage may work with earlier versions of LaTeX2e and those +%% class and package, but this was not tested. +%% Please consider updating your LaTeX, class, and package +%% to the most recent version (if they are not already the most +%% recent version). +%% Warning: holtxdoc, 2010/04/24 v0.19, requires the packages +%% hypdoc, 2010/03/26, v1.9 +%% hyperref, 2010/03/30, v6.80u (latest: 2010/06/18 v6.81g) +%% pdftexcmds, 2010/04/01, v0.9 +%% ltxcmds, 2010/03/09, v1.4 (latest: 2010/04/26, v1.7) +%% hologo, 2010/04/24, v1.2 +%% array (latest: 2008/09/09, v2.4c) +%% (or more recent versions) and does neither work with +%% nor check for earlier versions! +\hypersetup{% + pdfsubject={Refers to last page's name (HMM; JPG)},% + pdfkeywords={LaTeX, lastpage, last page, page number, page name, Hans-Martin Muench, Jeffrey P. Goldberg},% + pdfencoding=auto,% + pdflang={en},% + breaklinks=true,% + linktoc=all,% + pdfstartview=FitH,% + pdfpagelayout=OneColumn,% + bookmarksnumbered=true,% + bookmarksopen=true,% + bookmarksopenlevel=2,% + pdfmenubar=true,% + pdftoolbar=true,% + pdfwindowui=true,% + pdfnewwindow=true% +} +\setlength\hfuzz{1pt} % Ignore slight overfulls. +\CodelineIndex +%\PageIndex % instead of \CodelineIndex to get the page numbers +\EnableCrossrefs +%\DisableCrossrefs % Say \DisableCrossrefs if index is ready. +%\RecordChanges % Gather update information. +%\OnlyDescription % Comment out for implementation details. +\hyphenation{created every-thing ignored} +\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}% +\begin{document} + \DocInput{lastpage.dtx}% +\end{document} +%</driver> +% \end{macrocode} +% +% \begin{macrocode} +%<*ltxdoc> +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesFile{ltxdoc.cfg}[2010/07/29 v1.0b configuration file for lastpage (HMM)] + %% Code from original ltxdoc.cfg [2007/01/08 latex-tds: ltxdoc.cls configuration (HO)], %% + % copyrighted 2006, 2007 Heiko Oberdiek, part of project `latex-tds'. + % That file may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://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. + % That work has the LPPL maintenance status `maintained'. + % The Current Maintainer of that work is Heiko Oberdiek. + \PassOptionsToClass{a4paper}{article} + \AtEndOfClass{% + \RequirePackage[numbered]{hypdoc}[2010/03/26]% v1.9 + \pdfstringdefDisableCommands{% + \let\env\relax % longtable.dtx + \let\mytt\relax % tabularx.dtx + }% + \addtolength{\topmargin}{-10mm}% + \addtolength{\textheight}{20mm}% + % Depending on the page style, the head or foot area + % are put into the text area. + % Usually the page style is the default "plain". + % tools/verbatim.dtx uses "myheadings". + \def\string@plain{plain}% + \def\string@myheadings{myheadings}% + \def\current@pagestyle{plain}% + \let\ltxdoc@cfg@pagestyle\pagestyle + \def\pagestyle#1{% + \def\current@pagestyle{#1}% + \ltxdoc@cfg@pagestyle{#1}% + }% + \edef\ltxdoc@cfg@jobname{\jobname}% + \def\ltxdoc@cfg@longtable{longtable}% + \@onelevel@sanitize\ltxdoc@cfg@longtable + \ifx\ltxdoc@cfg@jobname\ltxdoc@cfg@longtable + \def\current@pagestyle{both}% + \fi + \let\ltxdoc@cfg@document\document + \def\document{% + \ifx\current@pagestyle\string@plain + \addtolength{\textheight}{\headheight}% + \addtolength{\textheight}{\headsep}% + \setlength{\headheight}{0pt}% + \setlength{\headsep}{0pt}% + \global\textheight\textheight + \global\headheight\headheight + \global\headsep\headsep + \fi + \ifx\current@pagestyle\string@myheadings + \addtolength{\textheight}{\footskip}% + \global\textheight\textheight + \fi + \ltxdoc@cfg@document + }% + %% End of code from original ltxdoc.cfg [2007/01/08 latex-tds: ltxdoc.cls configuration (HO)] %% + %% Place additional code here. %% + } + +%</ltxdoc> +% \end{macrocode} +% +% \fi +% +% \CheckSum{141} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \GetFileInfo{lastpage.drv} +% +% \begingroup +% \def\x{\#,\$,\^,\_,\~,\ ,\&,\{,\},\%}% +% \makeatletter +% \@onelevel@sanitize\x +% \expandafter\endgroup +% \expandafter\DoNotIndex\expandafter{\x} +% \expandafter\DoNotIndex\expandafter{\string\ } +% \begingroup +% \makeatletter +% \lccode`9=32\relax +% \lowercase{%^^A +% \edef\x{\noexpand\DoNotIndex{\@backslashchar9}}%^^A +% }%^^A +% \expandafter\endgroup\x % \DoNotIndex{\documentclass,\usepackage,\hfuzz,\small,\tt,\begin,\end} % \DoNotIndex{\NeedsTeXFormat,\filedate,\fileversion,\DoNotIndex} -% \DoNotIndex{\def,\divide,\advance,\multiply} -% \DoNotIndex{\",\-,\H} -% \DoNotIndex{\ifthenelse,\and,\equal,\whiledo,\if,\fi} +% \DoNotIndex{\def,\edef,\divide,\advance,\multiply} +% \DoNotIndex{\",\-,\,,\\,\hskip,\H,\ldots,\indent,\noindent,\textbackslash} +% \DoNotIndex{\textbf,\textit,\textquotedblleft,\textquotedblright,\textsf,\texttt,\underline} +% \DoNotIndex{\ifthenelse,\and,\equal,\whiledo,\if,\ifx,\ifnum,\else,\fi} % \DoNotIndex{\CodelineIndex,\EnableCrossrefs,\DisableCrossrefs} % \DoNotIndex{\DocInput,\AltMacroFont} +% \DoNotIndex{\@ne,\tw@,\thr@@,\today} +% \DoNotIndex{\newpage,\pagebreak,\newline,\linebreak,\nolinebreak} +% \DoNotIndex{\lipsum,\MessageBreak,\pageref,\protect} % \DoNotIndex{\RecordChanges,\OnlyDescription} +% \DoNotIndex{\smallskip,\medskip,\bigskip,\space,\hfil,\qquad,\thinspace} +% \DoNotIndex{\item,\arabic,\listfiles,\section} +% \DoNotIndex{\plainTeX,\TeX,\LaTeX,\pdfLaTeX} +% \DoNotIndex{\makeatletter,\makeatother,\mathord,\normalsize,\rm,\fancyhdr} % -% \title{The \texttt{lastpage} package\thanks{This file -% has version number \fileversion, last -% revised \filedate, documentation dated \docdate.}} -% \author{Jeff Goldberg\\ -% \texttt{goldberg@nytud.hu}} -% \date{\docdate} +% \title{The \textsf{lastpage} package\footnote{This file% +% has version number v1.2d, last% +% revised 2010/08/25, documentation dated 2010/08/25.}} +% \author{invented by Jeffrey P. Goldberg\\ +% (\texttt{jeffrey+news at goldmark dot org})\\ +% now maintained by H.-Martin M\"{u}nch\\ +% (\texttt{Martin dot Muench at Uni-Bonn dot de})} +% \date{2010/08/25} % % \maketitle % -% % \begin{abstract} -% This package puts the label \texttt{LastPage} into the -% \texttt{.aux} file, allowing the user to use references -% to the last page of a document. This might be -% particularly useful in places like headers or footers. +% This package puts the label \texttt{LastPage} +% (\texttt{\textbackslash AtEndDocument}) +% into the \texttt{.aux} file, allowing the user to refer +% to the last page of a document. This might be +% particularly useful in places like headers or footers.~--\\ +% When more than one page numbering scheme is used, +% or the fnsymbol page numbering scheme is used, or +% another package has output after this package, or +% the number of pages instead of the last page's name +% is needed, or the page numbers exeed a certain range, +% there might be problems, which can be solved by using the +% \textsf{pagesLTS} package instead. % \end{abstract} % +% \bigskip +% +% \noindent Disclaimer for web links: The author is not responsible for any contents +% referred to in this work unless he has full knowledge of illegal contents. +% If any damage occurs by the use of information presented there, only the +% author of the respective pages might be liable, not the one who has referred +% to these pages. +% +% \bigskip +% +% \noindent Save per page about $200\unit{ml}$ water, +% $2\unit{g}$ CO$_{2}$ and $2\unit{g}$ wood: +% Therefore please print only if this is really necessary. +% +% \newpage +% +% \tableofcontents +% % \section{Introduction} % -% For various draft forms it is desirable to have a page reference -% to the last page so that page footers, for example, could contain -% something like ``page $N$ of $K$', where $N$ is the current page -% and $K$ is the last page. -% -% This package defines a label, \texttt{LastPage}, which the user -% can refer to using the |\pageref| command. -% -% \section{The user interface} -% -% Just load it with by placing -% \begin{verbatim} -% \usepackage{lastpage} -%\end{verbatim} -% in the preamble of your \LaTeXe\ source file. -% -%\DescribeMacro{LastPage} -% Once that is loaded, you will be able to make reference anywhere -% in your text to the label \texttt{LastPage}. In particular you -% can either use the \textsf{fancyheadings} package, or your own -% redefinitions of the page headings and footings to get a reference -% to the last page, as in the example below. +% \indent This package puts the label \texttt{LastPage} +% (\texttt{\textbackslash AtEndDocument}) +% into the \xfile{aux} file, allowing the user to refer +% to the last page of a document via +% |\pageref{LastPage}|. +% This might be particularly useful in places like headers or +% footers. +% +% \bigskip +% This package was invented by \textbf{Jeffrey P. Goldberg}, +% and is now maintained by H.-Martin M\"{u}nch. A~big +% \textquotedblleft Thank you!\textquotedblright\ to Jeffrey P. Goldberg +% for granting this. +% +% \bigskip +% If you are more ambitiouse in respect to your aims with this package, +% you might want to have a look at the \textsf{pagesLTS} package +% (see section~\ref{sec:Alternatives}: Alternatives). +%\newpage +% \section{Usage} +% +% \indent Just load the package placing +% \begin{quote} +% |\usepackage{lastpage}| +% \end{quote} +% \noindent in the preamble of your \LaTeXe\ source file.\\ +% +% \indent For example for various draft forms it is desirable to have a +% page reference to the last page, so that e.\,g. page footers can +% contain something like \textquotedblleft page $N$ of $K$\textquotedblright, +% where $N$ is the current page and $K$ is the last page. Once the package +% is loaded, anywhere in the text references can be made +% to the label \texttt{LastPage}. +% In particular one can use the \textsf{fancyhdr} or \textsf{nccfancyhdr} +% package, or redefinitions of the page headings and footings to get +% a reference to the last page. +% +% \noindent In your document the code % \begin{verbatim} % \makeatletter % \renewcommand{\@evenfoot}% -% {\normalsize\slshape DRAFT \today\hfil -% \upshape page {\thepage} of \pageref{LastPage}} +% {\normalsize\slshape DRAFT \today\hfil \upshape % +% page {\thepage} of \pageref{LastPage}} % \renewcommand{\@oddfoot}{\@evenfoot} % \makeatother %\end{verbatim} -% to get footers like ``\mbox{\textsl{DRAFT \today}\hspace{1cm}page 5 of 23}'' -% into your document. Or for text like, -% \begin{verbatim} -% Hey, you don't write a \pageref{LastPage}~page letter every day, -% you know. -%\end{verbatim} -% to get +% \noindent creates footers like\\ +% +% \textquotedblleft\mbox{\textsl{DRAFT \today}\hspace{1cm}page 7 of 9}\textquotedblright\\ +% +% \noindent in the compiled document (cf.~the \texttt{lastpage-example} file)\\ +% (when using the \textsf{hyperref} package, the references are even hyperlinked). +% +% \section{A lot of WARNINGS\label{sec:warn}} +% +% \indent (Short: try using the \textsf{pagesLTS} package instead, +% if you have room for some more |\count|ers.) +% +% \subsection{\texttt{\textbackslash AtEndDocument}\label{ssec:aed}} +% +% \indent The output of a \LaTeXe\ run is not independent of the order +% in which the packages are loaded. It is often the case that the same +% formats for which one must put tables and figure at the end, +% are the ones in which endnotes are also required. +% If one wants to use |\AtEndDocument| here as well (as done for +% |\pageref{LastPage}|), then it is easy to get to three separate +% uses of |\AtEndDocument| (assuming one uses this for the endnotes +% as well). Clearly it is not safe for any package writer or user +% to assume that no material will follow what they put into +% |\AtEndDocument|. Therefore a message, which begins with +% \texttt{AED}, is included in every usage of |\AtEndDocument|.~--\\ +% \indent (The \textsf{pagesLTS} package solves this problem by using +% |\AfterLastShipout| from Heiko Oberdiek's \textsf{atveryend} package +% for the references\\ +% |\lastpageref{VeryLastPage}| and |\lastpageref{LastPages}|.) +% +% \subsection{Interaction with very old versions of the \textsf{endfloat} package\label{sec:endfloat}} +% +% \indent The very old version~2.0 (and earlier) of the \textsf{endfloat} +% package actually redefined the |\enddocument| command, +% and so interferred drastically with the \LaTeXe\ commands which +% make use of |\AtEndDocument|. Newer versions of \textsf{endfloat} exists \linebreak +% (at the time of writing this documentation: v2.4i as of 1995/10/11) +% in modern documentation form, which should be available from +% the same source where you received this file, see subsection~\ref{ss:Downloads}.\\ +% A note is placed in the style file. +% If you want your \texttt{LastPage} to label the last page of these end floats, +% you need to load \textsf{lastpage} after loading \textsf{endfloat} +% (or use \texttt{VeryLastPage} from the \textsf{pagesLTS} package instead). +% If, on the other hand, you \textit{want}\ \texttt{LastPage} to refer +% to the (not so) last page, exclusive of the the floats at the end, +% then load in the reverse order. Independent from the order of +% \textsf{lastpage} and \textsf{endfloat}, you will still need the +% modified\footnote{The \textquotedblleft new\textquotedblright\ version +% is nearly 15~years old, so it might be time to update to this +% version, \linebreak if you did not do it already.} version of \textsf{endfloat}.\\ +% +% Other \LaTeX209\ (!) packages also seem to like to redefine +% |\enddocument|. In addition to the old \textsf{endfloat}, +% \textsf{harvard} comes to mind. All of these will need to be +% modified swiftly. \textbf{If possible, update to \LaTeXe!} +% +% \subsection{Page name instead of page number} +% +% When any page numbering scheme other than \texttt{arabic} is used +% at the page, which |\pageref{LastPage}| referes to, the \textit{name} +% and not the \textit{number} of the page is given. For example, +% \texttt{Alph} page numbering scheme and $10$ pages will give \texttt{J} instead of 10, +% \texttt{Roman} page numbering scheme and $10$ pages will give \texttt{X} instead of 10, +% and so on.\\ +% \indent (The \textsf{pagesLTS} package puts |\lastpageref{LastPages}| +% (with \textbf{s} at the end) at your disposal for remediation.) +% +% \subsection{Wrong last page number with more than one page numbering scheme} +% +% When more than one page numbering scheme is used, +% \texttt{LastPage} does not give the total \textbf{number} of pages +% (even if \texttt{arabic} is the page numbering scheme of that page). +% For example, for a document with VI+36 pages, it gives +% \textquotedblleft 36\textquotedblright\ as reference to the last page. +% While this is correct, the total number of pages is 42.\\ +% \indent (The \textsf{pagesLTS} package puts |\lastpageref{LastPages}| +% (with \textbf{s} at the end) at your disposal for remediation.) +% +% \subsection{\texttt{\textbackslash addtocounter\{page\}\{\ldots\} and \texttt{\textbackslash setcounter\{page\}\{\ldots\}}}} +% +% When the page number was manipulated by |\addtocounter{page}{...}| +% or |\setcounter{page}{...}|, +% \texttt{LastPage} does not give the total \textbf{number} of pages +% (even if \texttt{arabic} is the page numbering scheme of that page).\\ +% \indent (The \textsf{pagesLTS} package puts |\lastpageref{LastPages}| +% (with \textbf{s} at the end) at your disposal for remediation: +% \texttt{LastPages} ignores page number manipulation.) +% +% \subsection{Page number reset by \texttt{\textbackslash pagenumbering\{\ldots\}}} +% +% At a page numbering change the page number is reset to one. +% Therefore \texttt{LastPage} does not give the total \textbf{number} of pages +% (even if \texttt{arabic} is the page numbering scheme of that page). +% Furthermore, now two pages have the same name.\\ +% \indent (The \textsf{pagesLTS} package does not only put |\lastpageref{LastPages}| +% (with \textbf{s} at the end) at your disposal for remediation: +% \texttt{LastPages} ignores page number manipulation. +% It furthermore offers the option |pagecontinue| to continue the +% page numbering, when |\pagenumbering{...}| is used.) +% +% \subsection{Last pages of different page numbering schemes} +% +% |\pageref{LastPage}| referes to the (maybe not so) last page of the last +% page numbering scheme. References to the respective last page of the other +% page numbering schemes are not provided.\\ +% \indent (The \textsf{pagesLTS} package does this with labels \texttt{pagesLTS.<numbering scheme>}, +% where \texttt{<numbering scheme>} is e.\,g. arabic, roman, Roman, alph, or Alph.\linebreak +% For fnsymbol please use \texttt{\textbackslash lastpageref\{pagesLTS.fnsymbol\}} +% instead of\\ +% \texttt{\textbackslash pageref\{pagesLTS.fnsymbol\}}.) +% +% \subsection{Current page} +% +% The command |\thepage| gives the \textbf{name} of the current page +% in the current page numbering scheme, which is different from the +% current total/absolute page number e.\,g. with a second +% page numbering scheme, |\addtocounter{page}{...}|, or |\setcounter{page}{...}|, +% and it will not be an arabic number at all, +% if the current page numbering scheme is not arabic.\\ +% \indent (The \textsf{pagesLTS} package provides the command +% \texttt{\textbackslash theCurrentPage} and for the current +% number of pages in the current page numbering scheme\\ +% \texttt{\textbackslash theCurrentPageLocal}.) +% +% \subsection{First page} +% +% There is no special label at the first page.\\ +% (This is the \textbf{last}\textsf{page} package, after all.)\\ +% \indent (The \textsf{pagesLTS} package creates a label \texttt{pagesLTS.0} +% at the first page of the document.) +% +% \subsection{Using the \textsf{fnsymbol} page numbering scheme\label{ss:fnsymbol}} +% +% \indent Using the \texttt{fnsymbol} page numbering scheme can result in +% problems -- big ones!\\ +% When the page, where |\pageref{lastpage}| points at, is in \texttt{fnsymbol} +% page numbering scheme, this package will probably skrew up -- +% and quite totally for that, especially when used together with the +% \textsf{hyperref} package (at least \textsf{hyperref} v6.80x as of 2010/04/17). +% Really! Sorry. So, you have been warned!\\ +% \indent (The \textsf{pagesLTS} package with |\lastpageref{lastpage}| and +% appropriate package options should cope even with this case.) +% +% \subsection{Page counter overflow\label{ss:overflow}} +% +% \indent \textquotedblleft The ranges of supported counter values are more or less +% restricted. Only \cs{arabic} can be used with any counter +% value \TeX\ supports. % \begin{quote} -% Hey, you don't write a 12~page letter every day, -% you know. +% \catcode`\|=12 % +% \begin{tabular}{@{}l|l|l|l@{}} +% Presentation & Supported & Ignored & Error message\\ +% command & domain & values & `Counter too large'\\ +% \hline +% \cs{arabic} +% & \ttfamily -MAX..MAX & &\\ +% \cs{roman}, \cs{Roman} +% & \ttfamily 1..MAX & \ttfamily -MAX..0 &\\ +% \cs{alph}, \cs{Alph} +% & \ttfamily 1..26 & 0 & \ttfamily -MAX..-1, 27..MAX\\ +% \cs{fnsymbol} +% & \ttfamily 1..9 & 0 & \ttfamily -MAX..-1, 10..MAX\\ +% \hline +% \end{tabular}\\[1ex] +% \texttt{MAX} = \texttt{2147483647} % \end{quote} -% -% \section{A few warnings}\label{sec:warn} -% -% This package uses the \LaTeXe\ directive of |\AtEndDocument|. If -% you use other packages that do the same and actually put material -% at the end, then it is important to load \textsf{lastpage} after -% such other packages if you want the true last page. That is -% if a package \textsf{xyzzy} uses |\AtEndDocument| to put -% out two pages of material at the end of the document, then -% to get the last page to be the page number of the second of those -% pages you need to load \textsf{lastpage} after \textsf{xyzzy} makes -% its call to |\AtEndDocument| -% -% \subsection{Interaction with \textsf{endfloat}}\label{sec:endfloat} -% -% Version 2.0 (and earlier) of \textsf{endfloat} actually redefine -% the |\enddocument|, and so interfere drastically with the \LaTeXe\ -% commands which make use of |\AtEndDocument|. A newer version -% of \textsf{endfloat} exists -% in modern documentation form, which should be available from the same -% source where you received this file. -% -% If you want your \texttt{LastPage} to label the last page of -% these end floats, you need to load \textsf{lastpage} after -% loading \textsf{endfloat}. If, on the other hand, you want -% \texttt{LastPage} to refer to the last page, exclusive of the -% the floats at the end, then load in the reverse order. For -% each of these, you will still need the modified version -% of \textsf{endfloat}. -% -% Other \LaTeX209 packages also seem to like to redefine |\enddocument|. -% In addition to the old \textsf{endfloat}, \textsf{harvard} comes to mind. -% All of these will need to be modified swiftly. (How did these ever -% work together before? -% I can't believe that nobody wanted harvard bibliography -% style and floats at the end before!) -% -% \subsection{General ordering and wish list}\label{sec:order} -% -% I believe that the output of a \LaTeXe\ run should be independent -% of the order in which package are loaded. It would be possible -% to set this up, but it would take coordiniation of all package -% writers who use |\AtEndDocument|. The actual call to |\AtEndDocument| -% would not occur during package loading, but some new command, -% like |\ExecuteAtEndDocument| would be called by the user after -% all such packages are loaded, with tags for each thing in the -% packages, so something like -% \begin{verbatim} -% \usepackage{lastpage} -% \usepackage{endfloat,xyzzy} -% \ExecuteAtEndDocument{endfloat, xyzzy, lastpage} -%\end{verbatim} -% and the order of End Document material would be the \textsf{endfloat} -% material, followed by \textsf{xyzzy}, and finally by \textsf{lastpage}. -% -% It is often the case that the same formats for which one -% must put tables and figure at the end, are the ones in which -% endnotes are also required. If one wants to use \textsf{lastpage} -% here as well, then it is easy to get to three separate uses -% of |\AtEndDocument| (assuming one uses that for the endnotes as -% well). Clearly it is not safe for any package writer or user -% to assume that no material will follow what they put into -% and |\AtEndDocument|. This, in addition to the ordering, is -% a good reason to develop safe practices for use of this -% very powerful tool. -% -% I will have to wait until someone else develops such a system, but -% I will gladly modify \textsf{lastpage} to comply with it. Until then -% I will include a message -% which begins with \texttt{AED} -% in every usage of |\AtEndDocument|, and try to minimize any side -% effects my usage may have. -% -% \subsection{Ignorance is bliss} -% -% The author of this package is not only new to \LaTeXe, but also -% to \LaTeX209. If I have duplicated something that already -% exists, forgive me. I have always wanted this in \PlainTeX, -% but never had the robust cross referencing that \LaTeX\ provides. -% Now that I have made the big switch, I jumped at the chance -% to get this done. -% -%\StopEventually{\PrintIndex\PrintChanges} +% \textquotedblright\ (Heiko Oberdiek: +% The \textsf{alphalph} package, 2010/04/18, v2.3, first table, p.~2).\\ % -% \section{The documentation driver file} +% \noindent When \textit{any} page is out of that range, there will be a counter overflow.\\ +% \indent (\textsf{lastpage} probably is not the right package to be asked +% to correct this anyway, but the \textsf{pagesLTS} package +% (with appropriate options) can do this.)\\ +% +%\subsection{Other packages manipulating \texttt{\textbackslash lastpage@putlabel}} +% +% The \textsf{hyperref} package redefines the |\lastpage@putlabel| command, +% and the \textsf{revtex4} class redefines the |\lastpage@putlabel| command, +% and the \textsf{hyperref} package redefines the |\lastpage@putlabel| command, +% if the \textsf{revtex4} class is used, and the \textsf{pagesLTS} +% \textquotedblleft kills\textquotedblright\ the |\lastpage@putlabel| command, +% because that package uses more advanced labels.\\ +% In my humble opinion it would be preferably if one package (the original one, +% i.\,e. \textsf{lastpage}) would do the job right, all others packages would +% check for the version of that package, and if an old version is found, +% an error (or at least a warning) message about the use of an outdated +% package is given, and \textit{then} as +% \textquotedblleft last aid\textquotedblright\ the command of the outdated +% package is redefined.\\ +% Therefore here none of the definitions or commands of the other packages +% is altered, but |\lastpage@putlabel| was replaced by |\lastpage@putl@bel|. +% Because |\lastpage@putlabel| is no longer called, now there should not be any +% double definitions of the \texttt{lastpage} label. +% +% \newpage +% +% \section{Alternatives\label{sec:Alternatives}} +% +% There are similar packages, which do (or do not) similar +% things (or even more). As I neither know what exactly you want to accomplish +% when using this package (e.\,g.~page number vs. page name, +% hyperlinks or not), nor what resources you have (e.\,g.~\eTeX), +% here is a list of some possible alternatives:\\ +% +% \DescribeMacro{lastpage209.sty} +% \begin{description} +% \item[-] If \LaTeX2.09\ is still used, and if you are unable +% to switch to \LaTeXe, the \LaTeX2.09\ compatible +% \textsf{lastpage209.sty} can be used, which is defined as follows:\\ +% (It is also generated automatically from lastpage.dtx when compiling it.) % -% The next bit of code contains the documentation driver file for -% \TeX{}, i.e., the file that will produce the documentation you are -% currently reading. It will be extracted from this file by the -% \texttt{docstrip} program, That is, run \LaTeX\ on \texttt{docstrip} -% and specify the \texttt{driver} option when \texttt{docstrip} -% asks for options. % \begin{macrocode} -%<*driver> -\documentclass[11pt]{ltxdoc} -\setlength\hfuzz{1pt} % ignore slight overfulls -\CodelineIndex -\EnableCrossrefs -%\DisableCrossrefs % Say \DisableCrossrefs if index is ready -%\RecordChanges % Gather update information -%\OnlyDescription % comment out for implementation details +%<*lastpage209> + % FOR LaTeX 2.09 ONLY - FOR LaTeX 2e USE lastpage.sty OR pagesLTS.sty! + % This is lastpage209.sty invented by Jeffrey P. Goldberg + % (jeffrey+news at goldmark dot org), maintained by + % H.-Martin M\"{u}ench (Martin dot Muench at Uni-Bonn dot de). +\let\origenddocument=\enddocument% +\def\enddocument{\clearpage% + {\addtocounter{page}{-1}% + \immediate\write\@mainaux{\string\newlabel{LastPage}{{}{\thepage}}}}% + \addtocounter{page}{+1}% + \origenddocument% + }% +%</lastpage209> +% \end{macrocode} +% +% (after Piet van Oostrum: Page layout in \LaTeX, March~2, 2004, +% section~16; fancyhdr.pdf). Because |\enddocument| is redefined, +% similar problems as with the old version of the \textsf{endfloat} +% package (see subsection~\ref{sec:endfloat}) will arise.\\ +% \textbf{If possible, update to \LaTeXe}\ (and maybe to the \textsf{pagesLTS} package)\textbf{!} +% \end{description} +% +% \DescribeMacro{pagesLTS} +% \begin{description} +% \item[-] The \textsf{pagesLTS} package first started as a revision of the \textsf{lastpage} +% package, but it became obviouse that a replacement was needed. For backward +% compatibility, a label named |LastPage| is provided. +% Thus |\usepackage{lastpage}| can be replaced by\\ +% |\usepackage[pagecontinue=false,alphMult=0,AlphMulti=0,|\\ +% | fnsymbolmult=false,romanMult=false,RomanMulti=false]{pagesLTS}|,\\ +% if the behaviour of the \textsf{lastpage} package should be simulated. +% The default options are\\ +% |\usepackage[pagecontinue=true,alphMult=ab,AlphMulti=AB,|\\ +% |fnsymbolmult=true,romanMult=true,RomanMulti=true]{pagesLTS}|. +% Using the \textsf{lastpage} before the \textsf{pagesLTS} before the +% \textsf{hyperref [2010/06/18] v6.81g}\ package +% results in multiply definitions of the |LastPage| label. +% While the \textsf{pagesLTS} package cancels the command |\lastpage@putlabel| +% from the \textsf{lastpage} package (because it does this itself, and better), +% \textsf{hyperref} redefines |\lastpage@putlabel| and thereby reintroduces it again +% (\textsf{hyperref} should probably check for the version of this \textsf{lastpage} +% package and/or whether the \textsf{pagesLTS} package was also loaded.)\\ +% Benefits of \textsf{pagesLTS} package (with appropriate options) are: +% \begin{description} +% \item[+] Labels \texttt{LastPage} (\texttt{\textbackslash AtEndDocument}) and\\ +% \texttt{VeryLastPage} (\texttt{\textbackslash AfterLastShipout}),\\ +% allowing the user to refer to the (very) last page of a document. +% \item[+] For example, when more than one page numbering scheme is used, +% the label \texttt{LastPage}\textbf{s} gives the total \textit{number} of pages. +% \item[+] At the last page of each page numbering +% scheme a label\\ +% \texttt{pagesLTS.<numbering scheme>} is +% placed, where \texttt{<numbering scheme>} is e.\,g. +% arabic, roman, Roman, alph, or Alph. For fnsymbol +% please use \texttt{\textbackslash lastpageref\{pagesLTS.fnsymbol\}} +% instead of\\ +% \texttt{\textbackslash pageref\{pagesLTS.fnsymbol\}}. +% \item[+] When the same numbering scheme is used twice, +% the page numbers are either reset to one or continued +% automatically, depending on the option given when the package +% is called. +% \item[+] The command \texttt{\textbackslash theCurrentPage} +% prints the current total/absolute page number -- in contrast to +% \texttt{\textbackslash thepage}, which gives only the page +% \textit{name} in the current page numbering scheme. +% \texttt{\textbackslash theCurrentPageLocal} gives the current +% number of pages in the current page numbering scheme. +% \texttt{\textbackslash thepage} and +% \texttt{\textbackslash theCurrentPageLocal} are different e.\,g. +% when \texttt{\textbackslash addtocounter\{page\}\{\ldots \}} or +% \texttt{\textbackslash setcounter\{page\}\{\ldots \}} were used. +% \item[+] At the first page of the document a label \texttt{pagesLTS.0} is created. +% \item[+] The \textsf{alphalph} package is supported, i.\,e. +% page numbers alph or Alph $>26$ and fnyambol $>9$ +% can be used (with according options set). Even zero +% and negative page numbers can be used with \texttt{arabic}, +% \texttt{alph}, \texttt{Alph}, \texttt{roman}, \texttt{Roman}, +% and \texttt{fnsymbol} page numbering (with \textsf{alphalph} package +% and according options). +% \item[+] It is checked whether a (very) old \textsf{endfloat} package +% is in use. If it is, a warning or even an error message is given, +% depending on \textsf{endfloat} version. +% \item[+] A rerun warning is given, when labels have changed. +% \end{description} +% Further labels are provided for special cases. +% \end{description} +% +% \DescribeMacro{totpages} +% \begin{description} +% \item[-] The \textsf{totpages} package provides a +% \texttt{totpages} label similar to \\ +% \texttt{LastPages} |\AtEndDocument| (instead of |\AfterLastShipout|, +% as done by \textsf{pagesLTS}). +% The \textsf{totpages} package additionally computes the number of paper sheets needed to +% (double) print the document (with one, two, three,\ldots\ pages on one sheet of paper)\\ +% (which can be achived also with the \textsf{papermas} package, an extension of the +% \textsf{pagesLTS} package, which further allows to compute the mass of that printed +% version of the document, useful e.\,g. when sending it by mail to determine the postage). +% \end{description} +% +% \DescribeMacro{nofm.sty} +% \begin{description} +% \item[-] \textquotedblleft There is a package \textsf{nofm.sty} +% available, but some versions of it are defective, and most +% don't work with \textsf{fancyhdr} because they take over the +% complete page layout.\textquotedblright (Piet van Oostrum: +% Page layout in \LaTeX, March~2, 2004, section~16; fancyhdr.pdf)\\ +% \textsf{nofm} as of 1991/02/25 (without version number), available at\\ +% \url{ftp://tug.ctan.org/pub/tex-archive/obsolete/macros/latex209/contrib/misc/nofm.sty},\\ +% does not work with e.\,g. \textsf{hyperref}, redefines |\enddocument| +% as well as |\@oddhead|, |\@evenhead|, |\@oddfoot|, and |\@evenfoot|.\\ +% If you know the (\CTAN{}) location of a \textbf{working}~(!) version, +% please send me an e-mail, thanks! +% \end{description} +% +% \DescribeMacro{count1to} +% \begin{description} +% \item[-] You may want to have a look at the \textsf{count1to} package. +% \end{description} +% +% \DescribeMacro{zref} +% \begin{description} +% \item[-] The \textsf{zref} package of Heiko Oberdiek requires +% \eTeX. \textsf{lastpage} does not require \eTeX, but if you +% already have \eTeX, you may have a look at the extensive +% \textsf{zref} package, whether it suits your needs better +% (or additionally or whatsoever). +% \end{description} +% +% \bigskip +% +% \noindent (You programmed or found another alternative, +% which is available at \CTAN{}?\\ +% OK, send an e-mail to me with the name, location at \CTAN{}, +% and a short notice, and I will probably include it in +% the list above.)\\ +% +% \smallskip +% +% \noindent About how to get those packages, please see subsection~\ref{ss:Downloads}. +% +% \newpage +% +% \section{Example} +% +% \begin{macrocode} +%<*example> +\documentclass[british]{article} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[draft]{showkeys}[2007/08/07]% v3.15 +%% Use final instead of draft to hide the keys. %% +\usepackage{hyperref}[2010/06/18]% v6.81g +\hypersetup{% + extension=pdf,% + plainpages=false,% + pdfpagelabels=true,% + hyperindex=false,% + pdflang={en},% + pdftitle={lastpage package example},% + pdfauthor={Hans-Martin Muench},% + pdfsubject={Example for the lastpage package},% + pdfkeywords={LaTeX, lastpage, Hans-Martin Muench},% + pdfview=Fit,% + pdfstartview=Fit,% + pdfpagelayout=SinglePage% +} +%% If you disable hyperref, you must also remove the one \href in this example. +\usepackage{lastpage}[2010/08/25]% v1.2d +\makeatletter +\renewcommand{\@evenfoot}% + {\normalsize\slshape \today\hfil \upshape page {\thepage} of \pageref{LastPage}} +\renewcommand{\@oddfoot}{\@evenfoot} +\gdef\unit#1{\mathord{\thinspace\mathrm{#1}}}% +\makeatother +\listfiles \begin{document} - \DocInput{lastpage.dtx} +\pagenumbering{Roman} + +\section*{Example for lastpage} +\markboth{Example for lastpage}{Example for lastpage} + +This example demonstrates the use of package\newline +\textsf{lastpage}, v1.2d as of 2010/08/25 (HMM; JPG).\newline +The package takes no options.\newline +For more details please see the documentation!\newline + +\noindent \label{keys} To hide the \pageref{keys}{\qquad } use option +\texttt{final} instead of \texttt{draft} with the \textsf{showkeys} +package (or remove the package call from the preamble of +this document).\newline + +\textbf{Trademarks} appear throughout this example without any +trademark symbol; they are the property of their respective +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!\newline +(In Adobe Reader 9.3.3: \underline{E}dit $>$ +Prefere\underline{n}ces (Ctrl+k) $>$ Page Display $>$ +Page Content and Information $>$ Use logical page +\nolinebreak{\underline{n}umbers.)}\newline + +If you are more ambitiouse in respect to your aims with this package, +you might want to have a look at the \textsf{pagesLTS} package\newline +(\href{http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/}{% +CTAN:/macros/latex/contrib/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 (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} + +\newpage + +\section*{The End} + +\noindent The page (\texttt{\textbackslash thepage}): \thepage \newline + +\noindent Last page's name (LastPage): \pageref{LastPage} \end{document} -%</driver> +%</example> % \end{macrocode} % +% \newpage +% +% \StopEventually{ +% } +% % \section{The implementation} % -% We start by checking if this file was already loaded. If not we -% identify the current version. -% \changes{v0.99a}{1994/06/17}{First shot} +% We start off by checking that we are loading into \LaTeXe\ and +% announcing the name and version of this package. +% % \begin{macrocode} %<*package> +% \end{macrocode} +% +% \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{lastpage}[2010/08/25 v1.2d + Refers to last page's name (HMM; JPG)]% + +% \end{macrocode} +% +% A short description of the \textsf{lastpage} package: +% +% \begin{macrocode} +%% Allows for things like +%% Page \thepage of \pageref{LastPage} +%% to get +%% 'Page 7 of 9'. +% \end{macrocode} +% +% A last information for the user(s): +% +% \begin{macrocode} +%% For LaTeX 2.09 use lastpage209.sty. - +%% For LaTeX 2e maybe consider upgrading to the pagesLTS package. + +% \end{macrocode} +% +% The very old version~2.0 (and earlier) of the \textsf{endfloat} +% package actually redefined the |\enddocument| command, +% and so interferred drastically with the \LaTeXe\ commands which +% make use of |\AtEndDocument|. Newer versions of \textsf{endfloat} +% exists (at the time of writing this documentation: v2.4i as of 1995/10/11) +% in modern documentation form, which are available from \CTAN{} +% (see subsection~\ref{ss:Downloads}). +% A~note is placed here. (The \textsf{pagesLTS} package even checks whether a (very) old +% \textsf{endfloat} package is in use. If it is, a warning or even +% an error message is given, depending on \textsf{endfloat} version.) +% +% \begin{macrocode} +%% The recent version of the endfloat package is v2.4i as of 1995/10/11. +%% The lastpage package is not fully compatible with version 2.0 +%% (and earlier) of the endfloat package, because those versions +%% redefined the \enddocument command. + +% \end{macrocode} +% +% There are no options to be introduced.\\ +% \indent For comparisons, \textquotedblleft one\textquotedblright\ is defined +% (|\@ne| does not work for this). +% +% \begin{macrocode} +\def\lastpage@one{1} +% \end{macrocode} +% +% We define |\lastpage@hyper| and |\lastpage@LTS| to be \textquotedblleft \texttt{0}\textquotedblright . +% +% \begin{macrocode} +\gdef\lastpage@hyper{0} +\gdef\lastpage@LTS{0} +% \end{macrocode} +% +% We define |\lastpage@firstpage| to be \textquotedblleft \texttt{1}\textquotedblright . +% +% \begin{macrocode} +\def\lastpage@firstpage{1} +% \end{macrocode} +% +% \begin{macro}{\AtBeginDocument} +% \indent |\AtBeginDocument| it is checked whether the \textsf{hyperref} package is loaded.\\ +% (|\@ifpackageloaded| cannot be used later than |\AtBeginDocument|.)\\ +% If this is the case, |\lastpage@hyper| is defined as \texttt{1} +% (otherwise it stays \texttt{0}). +% +% \begin{macrocode} +\AtBeginDocument{ + \@ifpackageloaded{hyperref}{\gdef\lastpage@hyper{1}}{}% + \@ifpackageloaded{pagesLTS}{% + \PackageWarning{lastpage}{Package pagesLTS found.\MessageBreak% + Therefore the lastpage package is no longer necessary.\MessageBreak% + }% + \gdef\lastpage@LTS{1}% + \@ifpackagelater{pagesLTS}{2010/08/24}{% 2010/08/25 v1.1i + }{% + \PackageWarning{lastpage}{Outdated version of pagesLTS package found.\MessageBreak% + For a recent version, see e.g. at\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + macros/latex/contrib/pagesLTS/ \MessageBreak% + or\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + install/macros/latex/contrib/pagesLTS.tds.zip\MessageBreak% + !% + }% + }% + }{% + \PackageInfo{lastpage}{Have a look at the pagesLTS package at\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + macros/latex/contrib/pagesLTS/ \MessageBreak% + or\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + install/macros/latex/contrib/pagesLTS.tds.zip\MessageBreak% + !% + }% + }% + } + +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\lastpage@putl@bel} +% \indent This command (in older package versions: definition) does the writing of the label: +% +% \begin{macrocode} +\newcommand{\lastpage@putl@bel}% +% \end{macrocode} +% +% |\AtBeginDocument| it is checked whether the \textsf{hyperref} package is loaded,\\ +% |\@ifpackageloaded{hyperref}{\gdef\lastpage@hyper{1}}{}|.\\ +% |\@ifpackageloaded| cannot be used later than |\AtBeginDocument|.\\ +% User Sebastian Bank found and reported (Thanks!) a~case, when this check is not +% sufficient. Using a class with\\ +% |\usepackage{lastpage}|\\ +% |\AtBeginDocument{\usepackage{hyperref}}|\\ +% leads to failed detection of the \textsf{hyperref} package, because +% |\AtBeginDocument| \textit{first} the check for \textsf{hyperref} is performed, +% and \textit{then} \textsf{hyperref} is loaded. As mentioned above, +% |\@ifpackageloaded| cannot be used later, so here we do not check for the +% \textsf{hyperref} package again, but for its |\Hy@Warning| command. +% In version~1.2c of the \textsf{lastpage} package, it was checked for +% the |\hyperref| command, but as it turned out, \textsf{tcilatex} \textit{is} +% defining that. If some other package or user is defining |\Hy@Warning|, +% \textsf{lastpage} will falsely assume, that \textsf{hyperref} has been loaded, +% but in my humble opinion, defining |\Hy@Warning| does not make sense and +% is bad style (except definition by the \textsf{hyperref} package itself, +% of course). +% +% \begin{macrocode} + {\@ifundefined{Hy@Warning}{% hyperref not loaded + }{% hyperref loaded + \gdef\lastpage@hyper{1}% + }% +% \end{macrocode} +% +% If the \textsf{pagesLTS} package is used, this \textsf{lastpage} package is not needed at all. +% The \texttt{LastPage} label would even be defined twice. Thus, if \textsf{pagesLTS} is used, +% here nothing is done: +% +% \begin{macrocode} + \ifx\lastpage@LTS\lastpage@one% + \else% +% \end{macrocode} +% +% Otherwise the label is set:\\ +% We have got to distinguish whether \textsf{hyperref} has been loaded or not: +% +% \begin{macrocode} + \ifx\lastpage@hyper\lastpage@one% + \lastpage@putlabelhyper% + \else% +% \end{macrocode} +% +% When \textsf{hyperref} has not been loaded, we just write the +% simple label into the \xfile{aux} file: +% +% \begin{macrocode} + \begingroup + \addtocounter{page}{-1}% + \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}% + \addtocounter{page}{+1}% + \endgroup + \fi% + \fi% + } +% \end{macrocode} +% \end{macro} +% +% \pagebreak +% +% \begin{macro}{\lastpage@putlabelhyper}% +% \indent When \textsf{hyperref} has been loaded, the label is set with the\\ +% |\lastpage@putlabelhyper| command. If the \textsf{hyperref} package is used, +% but pageanchors are disabled, the hyperlinking will not work. +% +% \begin{macrocode} +\newcommand{\lastpage@putlabelhyper}% + {\ifHy@pageanchor + \else% + \PackageError{lastpage}{hyperref option pageanchor disabled}{% + The \string\pageref{LastPage} link doesn't work\MessageBreak% + using hyperref with disabled option `pageanchor'.\MessageBreak% + }% + \fi% +% \end{macrocode} +% +% Since the page has been put out, we are on the page \textit{after} that page.\\ +% We therefore subtract one from the page counter. (For the compiler, +% this is equal to |\advance\c@page\m@ne|, but for human readers it is probably +% easier to understand.) +% \begin{macrocode} + \begingroup% + \addtocounter{page}{-1}% +% \end{macrocode} +% +% Simply using |\label| for \texttt{LastPage} would not work, +% because labels wait for the output routines to work, and there +% may not be any more invocations of the output routines. To force +% the write out, we need to do an |\immediate| write into the \xfile{aux} file. +% +% \begin{macrocode} +%% The following code is from the hyperref package %% +%% [2010/04/17 v6.80x; newer versions are available] %% +%% by Heiko Oberdiek (Big Thanks!). %% + \let\@number\@firstofone + \ifHy@pageanchor + \ifHy@hypertexnames + \ifHy@plainpages + \def\Hy@temp{\arabic{page}}% + \else + \Hy@unicodefalse +%% Code not from hyperref package: %% +%% The following lines are taken from the pagesLTS package, %% +%% which in turn got them from the hyperref package and %% +%% modified them. %% +%% Without the modification, after the first shipout "PD1" %% +%% is inserted each time |\pdfstringdef\Hy@temp{\thepage}| %% +%% is executed. %% + \ifnum \value{page}=1% +% \end{macrocode} +% +% We do not count the pages ourselfes, and so they could have been changes by +% e.\,g. |\pagenumbering{...}|, |\addtocounter{page}{...}|,\\ +% |\setcounter{page}{...}|. Thus the page might have the number one +% while not beeing the first page at all. Using the \textsf{everyshi} +% package would help, but this package should not require other packages. +% \textsf{pagesLTS} package does a better handling, but requires +% some other packages.\\ +% We will make a mistake here at most once: +% % \begin{macrocode} -\ProvidesPackage{lastpage}[\filedate\space\fileversion\space - LaTeX2e package for refs to last page number (JPG)] + \ifx \lastpage@firstpage\lastpage@one + \def\Hy@temp{\thepage}% + \gdef\lastpage@firstpage{0}% + \else% +%% Code from hyperref package again: %% + \pdfstringdef\Hy@temp{\thepage}% +%% End of code from the hyperref package. %% + \fi% +%% The pagesLTS package would even check for fnsymbol page %% +%% numbering scheme and adapt the code correspondingly. %% + \else% +%% Code from hyperref package again: %% + \pdfstringdef\Hy@temp{\thepage}% +%% Code from pagesLTS package again: %% + \fi% +%% Code from hyperref package again: %% + \fi + \else + \def\Hy@temp{\the\Hy@pagecounter}% + \fi + \fi + \immediate\write\@auxout{% + \string\newlabel + {LastPage}{{}{\thepage}{}{% + \ifHy@pageanchor page.\Hy@temp\fi}{}}% + }% +%% End of code from the hyperref package. %% % \end{macrocode} % -% \begin{macro}{\lastpage@putlabel} -% Simply using |\label| wouldn't work; because labels wait -% for the output routines to work, and there may not be any -% more invocations of the output routines. -% To force the write out we need to do an |\immediate| write. -% Since the last page has been output, we are on the page after -% the last. I subtract one from the page counter. After the writeout -% I restore it again since there might be other things At the End -% of Document still to do. -% \begin{macrocode} -\def\lastpage@putlabel{\addtocounter{page}{-1}% - \immediate\write\@auxout{\string - \newlabel{LastPage}{{}{\thepage}}}% - \addtocounter{page}{1}} +% After the writeout we restore the page number again, +% since there might be other things still to be done. +% +% \begin{macrocode} + \addtocounter{page}{+1}% + \endgroup + } + % \end{macrocode} % \end{macro} % -% The call to |\AtEndDocument| is simple. I put in a |\message| to -% show what order thing are called done in (see section~\ref{sec:endfloat}). -% \begin{macrocode} +% \begin{macro}{\AtEndDocument} +% \indent |\AtEndDocument| it is checked whether writing to files is allowed +% (otherwise, only an error message is issued and nothing done). +% +% \begin{macrocode} \AtEndDocument{% - \message{AED: lastpage setting LastPage}% - \clearpage\lastpage@putlabel}% + \if@filesw% +% \end{macrocode} +% +% We put in a |\message| to show, in what order things (which were called) +% are done (see subsection~\ref{ssec:aed}). +% +% \begin{macrocode} + \message{AED: lastpage setting LastPage ^^J}% +% \end{macrocode} +% +% After this we issue a |\clearpage| to put out all floats, +% which are still floatig, and place the \texttt{LastPage} label. +% +% \begin{macrocode} + \clearpage\lastpage@putl@bel% +% \end{macrocode} +% +% When writing to files is not allowed, only an error message is issued and nothing is done. +% +% \begin{macrocode} + \else% + \PackageError{lastpage}{No auxiliary file allowed.}% + {The lastpage package was not allowed to write to an .aux file.\MessageBreak% + This package does not work without access to an .aux file.\MessageBreak% + Press Ctrl+Z to exit.\MessageBreak% + }% + \fi% + } +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} %</package> % \end{macrocode} -% -% \section{Things to be done}\label{sec:todo} -% -% \begin{itemize} -% \item Allow user to specify a given page number. -% \item Allow user to specify a string other than \texttt{LastPage} -% for the reference. -% \item Work on better order control as discussed in section~\ref{sec:order}. -% \item Work on general conventions for using |\AtEndDocument| generally. -% (see section~\ref{sec:order}). -% \end{itemize} -% -% \Finale % -\endinput +% \pagebreak +% +% \section{Installation} +% +% \begin{center} +% {\large \textbf{First, please make sure that there is no old version of}} +% {\large \textbf{\textsf{lastpage}\ at some obsolete place in your system!}} +% \end{center} +% +% \subsection{Downloads\label{ss:Downloads}} +% +% Everything should be available on \CTAN{}, \url{http://www.ctan.org/tex-archive/}, +% but may need additional packages themselves.\\ +% +% \DescribeMacro{lastpage.dtx} +% For unpacking the |lastpage.dtx| file and constructing the documentation it is required: +% \begin{description} +% \item[-] \TeX Format \LaTeXe, 1994/06/01, v2$\varepsilon $: \CTAN{} +% +% \item[-] document class \textsf{ltxdoc}, 2007/11/11, v2.0u,\\ +% \CTAN{macros/latex/base/ltxdoc.dtx} +% +% \item[-] package \textsf{holtxdoc}, 2010/04/24, v0.19,\\ +% \CTAN{macros/latex/contrib/oberdiek/holtxdoc.dtx} +% +% \item[-] package \textsf{hypdoc}, 2010/03/26, v1.9,\\ +% \CTAN{macros/latex/contrib/oberdiek/hypdoc.dtx} +% \end{description} +% +% \DescribeMacro{lastpage.sty} +% The |lastpage.sty| for \LaTeXe\ (i.\,e. all documents using +% the \textsf{lastpage} package) requires: +% \begin{description} +% \item[-] \TeX Format \LaTeXe, 1994/06/01, v2$\varepsilon $, \CTAN{} +% +% \item[-] package \textsf{lastpage}, 2010/08/25, v1.2d,\\ +% \CTAN{macros/latex/contrib/lastpage/lastpage.dtx} +% \end{description} +% and can use +% \begin{description} +% \item[-] package \textsf{hyperref}, 2010/06/18, v6.81g,\\ +% \CTAN{macros/latex/contrib/hyperref.zip} +% \end{description} +% +% \DescribeMacro{lastpage209.sty} +% The |lastpage209.sty| for \LaTeX209\ (i.\,e. all documents using +% the \textsf{lastpage209} package) requires: +% \begin{description} +% \item[-] \TeX Format \LaTeX, v2.09 +% +% \item[-] package \textsf{lastpage209}, 2010/08/25, v1.2d, included in \\ +% \CTAN{macros/latex/contrib/lastpage/lastpage.dtx}% +% \end{description} +% and does not work with \textsf{hyperref}, which needs \LaTeX2e.\\ +% +% \DescribeMacro{lastpage-example.tex} +% The |lastpage-example.tex| requires the same file as all +% documents using the \textsf{lastpage} package, i.\,e. +% \begin{description} +% \item[-] package \textsf{lastpage}, 2010/08/25, v1.2d,\\ +% \CTAN{macros/latex/contrib/pagesLTS/pagesLTS.dtx}\\ +% (Well, it is the example file for this package, and because you are reading the +% documentation for the \textsf{lastpage} package, it can be assumed that you already +% have some version of it -- is it the current one?) +% \end{description} +% and additionally: +% \begin{description} +% \item[-] class \textsf{article}, 2007/10/19, v1.4h, from \textsf{classes.dtx}:\\ +% \CTAN{macros/latex/base/classes.dtx} +% +% \item[-] package \textsf{showkeys}, 2007/08/07, v3.15,\\ +% \CTAN{macros/latex/required/tools/showkeys.dtx} +% +% \item[-] package \textsf{hyperref}, 2010/06/18, v6.81g,\\ +% \CTAN{macros/latex/contrib/hyperref.zip} +% \end{description} +% +% \pagebreak +% +% \DescribeMacro{endfloat} +% The \textsf{endfloat} package is not required, but because +% the \textsf{lastpage} package is incompatibel with very old versions +% of the \textsf{endfloat} package (see subsection~\ref{sec:endfloat}), +% here the recent one is listed: +% \begin{description} +% \item[-] package \textsf{endfloat}, 1995/10/11, v2.4i,\\ +% \CTAN{macros/latex/contrib/endfloat/endfloat.dtx} +% \end{description} +% +% \DescribeMacro{fancyhdr} +% \DescribeMacro{nccfancyhdr} +% Neither \textsf{fancyhdr} nor \textsf{nccfancyhdr} package is required +% (older versions of the \textsf{lastpage} package used its predecessor \textsf{fancyheadings}), +% but because they were mentioned, also they are listed here: +% \begin{description} +% \item[-] package \textsf{fancyhdr}, 2005/03/22, v3.2,\\ +% \CTAN{macros/latex/contrib/fancyhdr.zip} +% +% \item[-] package \textsf{nccfancyhdr}, 2004/12/07, v1.1,\\ +% \CTAN{macros/latex/contrib/ncctools/source/nccfancyhdr.dtx} +% \end{description} +% +% \DescribeMacro{count1to} +% \DescribeMacro{nofm} +% \DescribeMacro{totpages} +% \DescribeMacro{lastpage} +% \DescribeMacro{zref} +% As possible alternatives in section~\ref{sec:Alternatives}, Alternatives, there are listed +% \begin{description} +% \item[-] package \textsf{pagesLTS}, 2009/06/24, v1.1c,\\ +% \CTAN{macros/latex/contrib/pagesLTS/pagesLTS.dtx} +% +% \item[-] package \textsf{papermas}, 2009/06/24, v1.0c; the \textsf{papermas} package +% can be considered as kind of add-on to the \textsf{pagesLTS} package.\\ +% \CTAN{macros/latex/contrib/papermas/papermas.dtx} +% +% \item[-] package \textsf{count1to}, 2009/05/24, v2.1,\\ +% \CTAN{macros/latex/contrib/ms/count1to.dtx} +% +% \item[-] package \textsf{nofm}, 1991/02/25, v?.?,\\ +% \url{ftp://tug.ctan.org/pub/tex-archive/obsolete/macros/latex209/contrib/misc/nofm.sty} +% does not work with e.\,g. \textsf{hyperref} +% +% \item[-] package \textsf{totpages}, 2005/09/19, v2.00,\\ +% \CTAN{macros/latex/contrib/totpages/totpages.dtx} +% +% \item[-] package \textsf{zref}, 2010/05/01, v2.17,\\ +% \CTAN{macros/latex/contrib/oberdiek/zref.dtx} +% \end{description} +% +% \DescribeMacro{Oberdiek} +% \DescribeMacro{holtxdoc} +% \DescribeMacro{zref} +% All packages of Heiko Oberdiek's bundle `oberdiek' +% (especially \textsf{holtxdoc} and \textsf{zref}) +% are also available in a TDS compliant ZIP archive:\\ +% \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}.\\ +% \textbf{Warning}: holtxdoc, 2010/04/24 v0.19, requires the packages +% \begin{description} +% \item[-] hypdoc, 2010/03/26, v1.9 +% \item[-] hyperref, 2010/03/30, v6.80u (latest: 2010/06/18, v6.81g) +% \item[-] pdftexcmds, 2010/04/01, v0.9 +% \item[-] ltxcmds, 2010/03/09, v1.4 (latest: 2010/04/26, v1.7) +% \item[-] hologo, 2010/04/24, v1.2 +% \item[-] array (latest: 2008/09/09, v2.4c) +% \end{description} +% (or more recent versions) and does neither work with +% nor check for earlier versions!\\ +% (It is probably best to download\\ +% \CTAN{install/macros/latex/contrib/oberdiek.tds.zip}\\ +% and use this, because the packages in there should be both +% recent and compatible.)\\ +% +% \pagebreak +% +% \DescribeMacro{M\"{u}nch} +% Packages of mine (alphabetically ordered):\\ +% \begin{description} +% \item[hrefhide] 2010/07/29, v1.0d, \CTAN{macros/latex/contrib/hrefhide/hrefhide.dtx} and +% \CTAN{install/macros/latex/contrib/hrefhide.tds.zip}\\ +% That package allows to \textquotedblleft hide\textquotedblright\ some (hyperlinked) +% text when printing the document while keeping the layout. +% +% \item[lastpage] 2010/08/25, v1.2d, \CTAN{macros/latex/contrib/lastpage/lastpage.dtx} and +% \CTAN{install/macros/latex/contrib/lastpage.tds.zip}\\ +% The package described in this very documentation:\\ +% This package allows to refer to the (maybe not so) last page. +% \textit{The package was originally invented by Jeffrey P. Goldberg.} +% The \textsf{pagesLTS} package is much more mighty, but needs more resources +% (e.\,g.~new counters). +% +% \item[pagesLTS] 2010/08/25, v1.1i, \CTAN{macros/latex/contrib/pagesLTS/pagesLTS.dtx} and +% \CTAN{install/macros/latex/contrib/pagesLTS.tds.zip}\\ +% That package allows to refer to the (very) last page, gives the total number of +% pages, references to special pages, facilitates the use of nearly any pagenumbering +% you like (e.\,g. negative |Roman| numbers or more than |Z| pages with |Alph| page numbering), +% and works even with |fnsymbol| page numbers. +% +% \item[papermas] 2010/07/29, v1.0d, \CTAN{macros/latex/contrib/papermas/papermas.dtx} and +% \CTAN{install/macros/latex/contrib/papermas.tds.zip}\\ +% That package allows to compute the number of sheets of paper needed to +% print a document as well as the mass of that printed version of the document. +% Further that package allows to compute \textquotedblleft base to the power of +% exponent\textquotedblright\ inside \LaTeX. +% +% \item[undolabl] 2010/07/29, v1.0f, \CTAN{macros/latex/contrib/undolabl/undolabl.dtx} and +% \CTAN{install/macros/latex/contrib/undolabl.tds.zip}\\ +% That package allows to override existing labels, especially automatically generated ones. +% \textit{The main code of that package was invented by }\\ +% \textbf{Ulrich Diez} (\texttt{eu\_angelion@web.de})\textit{\ and first published in the }\\ +% \Newsgroup{comp.text.tex} \textit{\ newsgroup at } +% \texttt{Sun,~20~Apr~2008~16:39:26~+0200}\textit{, with subject:} +% \texttt{Re:~How~to~undefine/overwrite~a~label?}\textit{\ (see e.\,g.\ } +% \url{http://groups.google.de/group/comp.text.tex/msg/5ba8d4722e5cd326?dmode=source} +% \textit{\ as well as\ } +% \url{http://groups.google.de/group/comp.text.tex/msg/af6cfe93917097da?dmode=source}\textit{).}\\ +% \end{description} +% +% \pagebreak +% +% \subsection{Package, unpacking TDS} +% +% \paragraph{Package.} This package is available on \CTAN{} +% \begin{description} +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage.dtx}]\hspace*{0.1cm} \\ +% The source file. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage.ins}]\hspace*{0.1cm} \\ +% The installation file. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage.drv}]\hspace*{0.1cm} \\ +% The driver to generate the documentation. +% \item[\CTAN{macros/latex/contrib/lastpage/ltxdoc.cfg}]\hspace*{0.1cm} \\ +% The \LaTeX documentation configuration file, also for generating the documentation. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage.pdf}]\hspace*{0.1cm} \\ +% The documentation. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage.sty}]\hspace*{0.1cm} \\ +% The \xext{sty}le file. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage-example.tex}]\hspace*{0.1cm} \\ +% The example file. +% \item[\CTAN{macros/latex/contrib/lastpage/lastpage-example.pdf}]\hspace*{0.1cm} \\ +% The compiled example file, as it should look like. +% \item[\CTAN{install/macros/latex/contrib/lastpage.tds.zip}]\hspace*{0.1cm} \\ +% Everything in TDS compliant, compiled format. +% \end{description} +% +% For required other packages, see the preceding subsection. +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex lastpage.dtx| +% \end{quote} +% +% About generating the documentation see paragraph~\ref{GenDoc} below.\\ +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree), \textbf{but first you should delete +% the old \textsf{lastpage} files (which are probably located in other directories).} +% You can make a backup of the old files before deleting them, of course. +% \begin{quote} +% \def\t{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} +% lastpage.sty & tex/latex/muench/lastpage.sty\\ +% lastpage.pdf & doc/latex/muench/lastpage.pdf\\ +% lastpage-example.tex & doc/latex/muench/lastpage-example.tex\\ +% lastpage-example.pdf & doc/latex/muench/lastpage-example.pdf\\ +% lastpage.dtx & source/latex/muench/lastpage.dtx\\ +% lastpage209.sty & tex/latex/lastpage209.sty for \LaTeX209\\ +% \end{tabular}^^A +% }^^A +% \sbox0{\t}^^A +% \ifdim\wd0>\linewidth +% \begingroup +% \advance\linewidth by\leftmargin +% \advance\linewidth by\rightmargin +% \edef\x{\endgroup +% \def\noexpand\lw{\the\linewidth}^^A +% }\x +% \def\lwbox{^^A +% \leavevmode +% \hbox to \linewidth{^^A +% \kern-\leftmargin\relax +% \hss +% \usebox0 +% \hss +% \kern-\rightmargin\relax +% }^^A +% }^^A +% \ifdim\wd0>\lw +% \sbox0{\small\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\footnotesize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\scriptsize\t}^^A +% \ifdim\wd0>\linewidth +% \ifdim\wd0>\lw +% \sbox0{\tiny\t}^^A +% \ifdim\wd0>\linewidth +% \lwbox +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \else +% \lwbox +% \fi +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \pagebreak +% +% \subsection{Refresh file name databases} +% +% If your \TeX~distribution (\teTeX, \mikTeX,\dots) relies on file name +% databases, you must refresh these. For example, \teTeX\ users run +% \verb|texhash| or \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intention: +% \begin{quote} +% \verb|latex \let\install=y\input{lastpage.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.\label{GenDoc}} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put the following +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% +% \noindent An example follows how to generate the +% documentation with \pdfLaTeX : +% +% \begin{quote} +%\begin{verbatim} +%pdflatex lastpage.dtx +%makeindex -s gind.ist lastpage.idx +%pdflatex lastpage.dtx +%makeindex -s gind.ist lastpage.idx +%pdflatex lastpage.dtx +%\end{verbatim} +% \end{quote} +% +% \subsection{Compiling the example} +% +% The example file, \textsf{lastpage-example.tex}, can be compiled via\\ +% \indent |latex lastpage-example.tex|\\ +% or (recommended)\\ +% \indent |pdflatex lastpage-example.tex|\\ +% and will need at least two compiler runs to get all references right. +% +% \section{Acknowledgements} +% +% I (H.-Martin M\"{u}nch) would like to thank Jeffrey P. Goldberg +% (jeffrey+news at goldmark dot org) for inventing the +% \textsf{lastpage} package as well as for granting me to update it. +% Further I would like to thank Heiko Oberdiek +% (heiko dot oberdiek at googlemail dot com) for providing +% a~lot~(!) of useful packages (from which I also got everything I +% know about creating a file in \xfile{dtx} format, ok, say it: copying), +% and the \Newsgroup{comp.text.tex} and \Newsgroup{de.comp.text.tex} +% newsgroups for their help in all things \TeX. Thanks for bug reports go +% to Ulrike Fischer and Sebastian Bank. +% +% \pagebreak +% +% \phantomsection +% \begin{History}\label{History} +% \begin{Version}{1994/06/17 v0.99a} +% \item First shot by Jeffrey P. Goldberg. +% \end{Version} +% \begin{Version}{1994/06/25 v0.1b} +% \item Last version number created by Jeffrey P. Goldberg. +% \end{Version} +% \begin{Version}{1994/07/20 v0.1b (again)} +% \item Documentation updated by Jeffrey P. Goldberg.\\ +% The main source code of the \textsf{lastpage} package 1994/07/20 v0.1b was:\\ +% \begin{verbatim} +% \NeedsTeXFormat{LaTeX2e}[1994/06/01] +% \ProvidesPackage{lastpage}[1994/07/20 v0.1b +% LaTeX2e package for refs to last page number (JPG)] +% \def\lastpage@putlabel{\addtocounter{page}{-1}% +% \immediate\write\@auxout{\string +% \newlabel{LastPage}{{}{\thepage}}}% +% \addtocounter{page}{1}} +% \AtEndDocument{% +% \message{AED: lastpage setting LastPage}% +% \clearpage\lastpage@putlabel}% +% \endinput +% \end{verbatim} +% and then the \textsf{hyperref} package and the \textsf{revtex4} class +% even redefine\\ +% |\lastpage@putlabel| (at least \textsf{hyperref} version 2010/06/18, v6.81g, +% and REV\TeX4\ version 2009/10/08, v4.1g, still do this). +% \end{Version} +% \begin{Version}{2010/02/18 v1.1} +% \item Proposed |LastPages| label by H.-Martin M\"{u}nch +% on \Newsgroup{comp.text.tex}, see e.\,g. +% \url{http://groups.google.com/group/comp.text.tex/msg/4407493da9c747f0?dmode=source}; +% now available in the \textsf{pagesLTS} package. +% \end{Version} +% \begin{Version}{2010/07/29 v1.2a} +% \item Complete rewriting of the package; upgrade from \textsf{fancyheadings} to +% \textsf{fancyhdr} package, then removed the need for a \textsf{fancyhdr} +% package at all. +% \item Included \textsf{lastpage209.sty} for \LaTeX209. +% \item Replacement of |\filedate|, |-version|, |-name|,\ldots\ because +% of \LaTeX~bug 2705:\\ +% Synopsis: Possible problem with |\fileversion| and |\filedate|\\ +% \url{http://www.latex-project.org/cgi-bin/ltxbugs2html?category=LaTeX&responsible=anyone&state=anything&keyword=lastpage&pr=latex%2F2705&search=} +% \item Example |lastpage-example.tex|. +% \item Alternatives listing (section \ref{sec:Alternatives}). +% \item Listing of \TeX\ sources (subsection \ref{ss:Downloads}). +% \item A~lot~(!) of details. +% \item Complete rewriting of the documentation. +% \item Added a list of my other packages. +% \item Everything in DTX framework. +% \item Included a |\CheckSum|. +% \item Complete rewriting of the Readme file. +% \end{Version} +% \begin{Version}{2010/08/12 v1.2b} +% \item Bug fix: |\@PackageInfoNoLine| is only available, +% if the \textsf{hyperref} package is loaded. +% (Bug reported by Ulrike Fischer, thanks!) +% \item Detected another bug: |\ifHy@pageanchor| etc. do not work without +% \texttt{hyperref}, and |\else| related to |\ifHy@pageanchor| was wrongly +% associated with a preceding |\if|, and everything went wrong. +% Now everything should work without \textsf{hyperref} again. +% \item Renamed |\lastpage@putlabel| to |\lastpage@putl@bel| to get rid of +% the conflicts with other classes and packages and resulting +% multiple definitions of \texttt{lastpage} label. +% \end{Version} +% \begin{Version}{2010/08/23 v1.2c} +% \item Bug fix: Additionally to checking for the \textsf{hyperref} package +% |\AtBeginDocument|, when placing the \texttt{lastpage} label it is also +% checked for the |\hyperref| command, in case \textsf{hyperref} was not +% loaded at |\begin{document}| yet. (Bug reported by Sebastian Bank, thanks!) +% \item Changed the |\unit| definition (got rid of an old |\rm|). +% \item Changed |\lastpage@puthyperlabel| to |\lastpage@putlabelhyper| analogous to +% |\pagesLTS@putlabelhyper| of the \textsf{pagesLTS} package. +% \item The recent version of the Adobe Reader is 9.3.3 (instead of 9.3.1). +% \item Updated version number and date of \textsf{pagesLTS} package (especially +% for the check for outdated versions). +% \item Removed wrong \% from the driver file. +% \end{Version} +% \begin{Version}{2010/08/25 v1.2d} +% \item Bug fix: \textsf{tcilatex} defines the |\hyperref| command, therefore +% for \textsf{hyperref} package detection this had to be changed to +% |\Hy@Warning|. +% \end{Version} +% \end{History} +% +% % \PrintChanges +% +% \bigskip +% +% When you find a mistake or have a suggestion for an improvement of this package, +% please send an e-mail to the maintainer, thanks! (Please see BUG REPORTS in the README.) +% +% \pagebreak +% +% \PrintIndex +% +% \Finale +\endinput
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/lastpage/lastpage.ins b/Master/texmf-dist/source/latex/lastpage/lastpage.ins index f477599b8f0..b88bae50d20 100644 --- a/Master/texmf-dist/source/latex/lastpage/lastpage.ins +++ b/Master/texmf-dist/source/latex/lastpage/lastpage.ins @@ -1,28 +1,145 @@ -\def\fildedate{1999/05/29} -\def\batchfile{lastpage.ins} +%% +%% This is file `lastpage.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lastpage.dtx (with options: `install') +%% +%% This is a generated file. +%% +%% IMPORTANT NOTICE: +%% The usual disclaimers apply: +%% 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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% \input docstrip.tex -\def\SimplePackage#1{% - \generateFile{#1.sty}{t}{\from{#1.dtx}{package}}} - -\def\SimpleDriver#1{% - \generateFile{#1.drv}{t}{\from{#1.dtx}{driver}}} - -\def\SimpleClass#1{% - \generateFile{#1.cls}{t}{\from{#1.dtx}{class}}} +\obeyspaces +\Msg{******************************************************} +\Msg{* Installation *} +\Msg{* Package: lastpage v1.2d 2010/08/25 LaTeX2e package *} +\Msg{* Refers to last page's name (HMM) *} +\Msg{******************************************************} \keepsilent +\askforoverwritefalse +\let\MetaPrefix\relax \preamble +This is a generated file. + IMPORTANT NOTICE: -This is part of a set of tools (or better yet, experiments) -written by Jeff Goldberg (J.Goldberg@Cranfield.ac.uk) The usual disclaimers apply: If it doesn't work right that's your problem. -It is released under the terms of the -General Public License Agreement (version 2) +(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 +version. This version of this license is in + http://www.latex-project.org/lppl/lppl-1-3c.txt +and the latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +The Current Maintainer of this work is H.-Martin Muench +(Martin dot Muench at Uni-Bonn dot de). + +This package was invented by Jeffrey P. Goldberg + (jeffrey+news at goldmark dot org). +I thought that a replacement was needed and therefore created the +pagesLTS package, +http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +or +http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +. 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. + +This work consists of the main source file lastpage.dtx +and the derived files + lastpage.sty, lastpage.ins, lastpage.drv, + lastpage-example.tex, lastpage.pdf. + \endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{lastpage.ins}{\from{lastpage.dtx}{install}}% + \file{lastpage.drv}{\from{lastpage.dtx}{driver}}% + \file{ltxdoc.cfg}{\from{lastpage.dtx}{ltxdoc}}% + \usedir{tex/latex/muench/lastpage}% + \file{lastpage209.sty}{\from{lastpage.dtx}{lastpage209}}% + \file{lastpage.sty}{\from{lastpage.dtx}{package}}% + \usedir{doc/latex/muench/lastpage}% + \file{lastpage-example.tex}{\from{lastpage.dtx}{example}}% +} + +\obeyspaces +\Msg{**************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following *} +\Msg{* file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* lastpage.sty (or lastpage209.sty for TeX 2.09) *} +\Msg{* *} +\Msg{* To produce the documentation run the file `lastpage.drv' *} +\Msg{* through (pdf)LaTeX, e. g. *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* makeindex -s gind.ist lastpage.idx *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* makeindex -s gind.ist lastpage.idx *} +\Msg{* pdflatex lastpage.dtx *} +\Msg{* *} +\Msg{* At least three runs are necessary e. g. to get the *} +\Msg{* references right! *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{**************************************************************} + +\endbatchfile -\SimplePackage{lastpage} -\SimpleDriver{lastpage} +\endinput +%% +%% End of file `lastpage.ins'. diff --git a/Master/texmf-dist/tex/latex/lastpage/lastpage.sty b/Master/texmf-dist/tex/latex/lastpage/lastpage.sty index 5f735f0a04b..47760b2f05c 100644 --- a/Master/texmf-dist/tex/latex/lastpage/lastpage.sty +++ b/Master/texmf-dist/tex/latex/lastpage/lastpage.sty @@ -6,46 +6,186 @@ %% %% lastpage.dtx (with options: `package') %% +%% This is a generated file. +%% %% IMPORTANT NOTICE: -%% This is part of a set of tools (or better yet, experiments) -%% written by Jeff Goldberg (J.Goldberg@Cranfield.ac.uk) %% The usual disclaimers apply: %% If it doesn't work right that's your problem. -%% It is released under the terms of the -%% General Public License Agreement (version 2) -\def\filename{lastpage} -\def\fileversion{v0.1b} -\def\filedate{1994/06/25} -\def\docdate {1994/07/20} - -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -%% Allow for things like |page \thepage\ of \pageref{LastPage}| to -%% get `page 5 of 23' +%% (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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% \NeedsTeXFormat{LaTeX2e}[1994/06/01] -\ProvidesPackage{lastpage}[\filedate\space\fileversion\space - LaTeX2e package for refs to last page number (JPG)] -\def\lastpage@putlabel{\addtocounter{page}{-1}% - \immediate\write\@auxout{\string - \newlabel{LastPage}{{}{\thepage}}}% - \addtocounter{page}{1}} +\ProvidesPackage{lastpage}[2010/08/25 v1.2d + Refers to last page's name (HMM; JPG)]% + +%% Allows for things like +%% Page \thepage of \pageref{LastPage} +%% to get +%% 'Page 7 of 9'. +%% For LaTeX 2.09 use lastpage209.sty. - +%% For LaTeX 2e maybe consider upgrading to the pagesLTS package. + +%% The recent version of the endfloat package is v2.4i as of 1995/10/11. +%% The lastpage package is not fully compatible with version 2.0 +%% (and earlier) of the endfloat package, because those versions +%% redefined the \enddocument command. + +\def\lastpage@one{1} +\gdef\lastpage@hyper{0} +\gdef\lastpage@LTS{0} +\def\lastpage@firstpage{1} +\AtBeginDocument{ + \@ifpackageloaded{hyperref}{\gdef\lastpage@hyper{1}}{}% + \@ifpackageloaded{pagesLTS}{% + \PackageWarning{lastpage}{Package pagesLTS found.\MessageBreak% + Therefore the lastpage package is no longer necessary.\MessageBreak% + }% + \gdef\lastpage@LTS{1}% + \@ifpackagelater{pagesLTS}{2010/08/24}{% 2010/08/25 v1.1i + }{% + \PackageWarning{lastpage}{Outdated version of pagesLTS package found.\MessageBreak% + For a recent version, see e.g. at\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + macros/latex/contrib/pagesLTS/ \MessageBreak% + or\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + install/macros/latex/contrib/pagesLTS.tds.zip\MessageBreak% + !% + }% + }% + }{% + \PackageInfo{lastpage}{Have a look at the pagesLTS package at\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + macros/latex/contrib/pagesLTS/ \MessageBreak% + or\MessageBreak% + http://www.ctan.org/tex-archive/ \MessageBreak% + install/macros/latex/contrib/pagesLTS.tds.zip\MessageBreak% + !% + }% + }% + } + +\newcommand{\lastpage@putl@bel}% + {\@ifundefined{Hy@Warning}{% hyperref not loaded + }{% hyperref loaded + \gdef\lastpage@hyper{1}% + }% + \ifx\lastpage@LTS\lastpage@one% + \else% + \ifx\lastpage@hyper\lastpage@one% + \lastpage@putlabelhyper% + \else% + \begingroup + \addtocounter{page}{-1}% + \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}% + \addtocounter{page}{+1}% + \endgroup + \fi% + \fi% + } +\newcommand{\lastpage@putlabelhyper}% + {\ifHy@pageanchor + \else% + \PackageError{lastpage}{hyperref option pageanchor disabled}{% + The \string\pageref{LastPage} link doesn't work\MessageBreak% + using hyperref with disabled option `pageanchor'.\MessageBreak% + }% + \fi% + \begingroup% + \addtocounter{page}{-1}% +%% The following code is from the hyperref package %% +%% [2010/04/17 v6.80x; newer versions are available] %% +%% by Heiko Oberdiek (Big Thanks!). %% + \let\@number\@firstofone + \ifHy@pageanchor + \ifHy@hypertexnames + \ifHy@plainpages + \def\Hy@temp{\arabic{page}}% + \else + \Hy@unicodefalse +%% Code not from hyperref package: %% +%% The following lines are taken from the pagesLTS package, %% +%% which in turn got them from the hyperref package and %% +%% modified them. %% +%% Without the modification, after the first shipout "PD1" %% +%% is inserted each time |\pdfstringdef\Hy@temp{\thepage}| %% +%% is executed. %% + \ifnum \value{page}=1% + \ifx \lastpage@firstpage\lastpage@one + \def\Hy@temp{\thepage}% + \gdef\lastpage@firstpage{0}% + \else% +%% Code from hyperref package again: %% + \pdfstringdef\Hy@temp{\thepage}% +%% End of code from the hyperref package. %% + \fi% +%% The pagesLTS package would even check for fnsymbol page %% +%% numbering scheme and adapt the code correspondingly. %% + \else% +%% Code from hyperref package again: %% + \pdfstringdef\Hy@temp{\thepage}% +%% Code from pagesLTS package again: %% + \fi% +%% Code from hyperref package again: %% + \fi + \else + \def\Hy@temp{\the\Hy@pagecounter}% + \fi + \fi + \immediate\write\@auxout{% + \string\newlabel + {LastPage}{{}{\thepage}{}{% + \ifHy@pageanchor page.\Hy@temp\fi}{}}% + }% +%% End of code from the hyperref package. %% + \addtocounter{page}{+1}% + \endgroup + } + \AtEndDocument{% - \message{AED: lastpage setting LastPage}% - \clearpage\lastpage@putlabel}% + \if@filesw% + \message{AED: lastpage setting LastPage ^^J}% + \clearpage\lastpage@putl@bel% + \else% + \PackageError{lastpage}{No auxiliary file allowed.}% + {The lastpage package was not allowed to write to an .aux file.\MessageBreak% + This package does not work without access to an .aux file.\MessageBreak% + Press Ctrl+Z to exit.\MessageBreak% + }% + \fi% + } \endinput %% %% End of file `lastpage.sty'. diff --git a/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty b/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty new file mode 100644 index 00000000000..9e5799fea3a --- /dev/null +++ b/Master/texmf-dist/tex/latex/lastpage/lastpage209.sty @@ -0,0 +1,62 @@ +%% +%% This is file `lastpage209.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lastpage.dtx (with options: `lastpage209') +%% +%% This is a generated file. +%% +%% IMPORTANT NOTICE: +%% The usual disclaimers apply: +%% 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 +%% version. This version of this license is in +%% http://www.latex-project.org/lppl/lppl-1-3c.txt +%% and the latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is H.-Martin Muench +%% (Martin dot Muench at Uni-Bonn dot de). +%% +%% This package was invented by Jeffrey P. Goldberg +%% (jeffrey+news at goldmark dot org). +%% I thought that a replacement was needed and therefore created the +%% pagesLTS package, +%% http://www.ctan.org/tex-archive/macros/latex/contrib/pagesLTS/pagesLTS.dtx +%% or +%% http://www.ctan.org/tex-archive/install/macros/latex/contrib/pagesLTS.tds.zip +%% . 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. +%% +%% This work consists of the main source file lastpage.dtx +%% and the derived files +%% lastpage.sty, lastpage.ins, lastpage.drv, +%% lastpage-example.tex, lastpage.pdf. +%% + % FOR LaTeX 2.09 ONLY - FOR LaTeX 2e USE lastpage.sty OR pagesLTS.sty! + % This is lastpage209.sty invented by Jeffrey P. Goldberg + % (jeffrey+news at goldmark dot org), maintained by + % H.-Martin M\"{u}ench (Martin dot Muench at Uni-Bonn dot de). +\let\origenddocument=\enddocument% +\def\enddocument{\clearpage% + {\addtocounter{page}{-1}% + \immediate\write\@mainaux{\string\newlabel{LastPage}{{}{\thepage}}}}% + \addtocounter{page}{+1}% + \origenddocument% + }% +\endinput +%% +%% End of file `lastpage209.sty'. |