diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/piff/onepagem.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/piff/onepagem.sty | 37 |
1 files changed, 37 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..d42738c7787 --- /dev/null +++ b/Master/texmf-dist/tex/latex/piff/onepagem.sty @@ -0,0 +1,37 @@ +\def\filename{onepagem.sty} +\def\fileversion{1.01a} +\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... +% +% This file is placed in the public domain. No provision is made for +% support of the use of the facilities herein. +% +% +\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 |