% Style file for LaTeX2e % This package defines the macro \lastpage which contains the (string) % value of the page number of the last page of the document. The document has % to be processed at least twice for this label to be defined. % % This package defines a page style is similar to plain, but with the page % number expressed as "N / M", where M is the total number of pages. This % package invokes \pagestyle{NofM} to make this the default page style. % % \usepackage{PageNofM} % $Id: PageNofM.sty,v 1.3 1997/01/15 16:28:21 kabal Exp $ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{PageNofM}[1997/01/14] % Set the reference lastpage at the end of the document % (This is effectively a \label{lastpage} \AtEndDocument{\clearpage \addtocounter{page}{-1}% \immediate\write\@auxout{\string \newlabel{lastpage}{{}{\thepage}}}% \addtocounter{page}{-1}} \def\lastpage{\pageref{lastpage}} \def\ps@NofM{% \ps@plain \def\@oddfoot{\hfil \textrm{\thepage\ / \lastpage}\hfil} \def\@evenfoot{\@oddfoot}} \pagestyle{NofM}