summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex209/contrib/misc/nofm.sty
blob: 062c1b6738fd2f0c2aa28316160213db9f086edf (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
% nofm.sty
%
% This is a LaTeX document style option for "n of m" style pagination.
% It produces a centered header in the above style, and no footer;
% variations to put the information elsewhere, incorporate other
% information, or include the word "page" should be easy.  This option
% works by recording the last page's page number in the .aux file
% (using the standard label/pageref mechanism).  Therefore, you will
% have to run LaTeX a second time if the number of pages changes, in
% order to get correct output.
%
%     -- Max Hailperin, 9/27/88
%
% 25 Feb 91 - Don't clobber \pagestyle, redefine \ps@plain.
%             Define \@lastpageref to eliminate warnings.
%             clayton@thumper.bellcore.com
 
 
% Make the plain page style be the same as the empty page style to
% avoid having a footer-centered page number on the first page and on
% index pages (in article style, anyway).
 
\let \ps@plain = \ps@empty
 
 
% The below is reproduced from the latex.tex file, version 2.09 of 27 October
% 1986, Copyright (C) 1985 by Leslie Lamport, with the exception of the
% marked change in the first line----vvvvvvvvvvvvvvvvvv.
 
\def\enddocument{\@checkend{document}\label{@lastpage}\clearpage\begingroup
\if@filesw \immediate\closeout\@mainaux
\def\global\@namedef##1##2{}\def\newlabel{\@testdef r}%
\def\bibcite{\@testdef b}\@tempswafalse \makeatletter\input \jobname.aux
\if@tempswa \@warning{Label(s) may have changed.  Rerun to get
cross-references right}\fi\fi\endgroup\deadcycles\z@\@@end}
 
 
% Define a special-purpose \pageref to avoid having a "Reference
% @lastpage undefined" warning on every page.
 
\def\@lastpageref{%
   \@ifundefined{r@@lastpage}{{\bf ??}}%
    {\edef\@tempa{\@nameuse{r@@lastpage}}%
     \expandafter\@cdr\@tempa\@nil\null
    }%
}
 
 
% The page number is centered in the header.  Change the definitions
% to make it something else.
 
\def \@oddhead{\rm\hfil\thepage\ of \@lastpageref\hfil}
\def \@evenhead{\@oddhead}
\def \@oddfoot{}
\def \@evenfoot{\@oddfoot}