diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/piff/onepagem.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/piff/onepagem.sty | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/piff/onepagem.sty b/Master/texmf-dist/tex/latex/piff/onepagem.sty new file mode 100644 index 00000000000..dbd42791f0a --- /dev/null +++ b/Master/texmf-dist/tex/latex/piff/onepagem.sty @@ -0,0 +1,34 @@ +\def\filename{onepagem.sty} +\def\fileversion{1.01} +\def\filedate{28 Mar 1996 13:57:34 BST} +%% +%%M.Piff@sheffield.ac.uk +%% +%If the document has only one page, omit page number. (onepagempty) +%The page number must be produced by means of \thepage. +%Needs two passes through LaTeX to work, as it writes to the .aux file. +% +%The first version was a joke put on CTAN to illustrate how useful +%\AtEndDocument is. This one works... +% +% +\typeout{\filename\space v\fileversion, (C) Copyright Mike Piff, \filedate} +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{onepagem} +\ProcessOptions + +\let\opem@shipout\shipout +\newcounter{opem@pagecount} +\def\shipout{% + \stepcounter{opem@pagecount}% count pages in document + \opem@shipout% restore function of \shipout +} + +\AtEndDocument{% + \clearpage% make sure we know we are after the last page + \ifnum\value{opem@pagecount}=1 + \immediate\write\@mainaux{\string\gdef\string\thepage{}}% + \fi +} + +\endinput |