diff options
author | Karl Berry <karl@freefriends.org> | 2010-09-08 23:08:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-09-08 23:08:23 +0000 |
commit | ee2de76f7db0b19a657a7f3b9ba8768bc8e69e37 (patch) | |
tree | cb89ecf46c7a4843251d70c2aa0341a945c81353 /Master/texmf-dist/tex/latex/lastpage | |
parent | d9c6145293d327c544fc033d3e9956fc1afc5b25 (diff) |
lastpage 1.2d (28aug10)
git-svn-id: svn://tug.org/texlive/trunk@19615 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lastpage')
-rw-r--r-- | Master/texmf-dist/tex/latex/lastpage/lastpage.sty | 210 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/lastpage/lastpage209.sty | 62 |
2 files changed, 237 insertions, 35 deletions
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'. |