<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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
</pre></body></html>