summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/piff/onepagem.sty
blob: d42738c7787b06326c258a9d6582fde4b42b6601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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