summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncclatex/ncchdr.sty
blob: f05c47adc2f5b89ce895e9047c18bdd52d71b803 (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
57
58
59
60
61
62
63
64
65
66
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ncchdr}
         [2005/01/12 v1.02 Fancy headers for NCC class (NCC)]
%
% \changes{v1.01}{2002/02/14}{This version is uploaded to CTAN}
% \changes{v1.02}{2002/04/25}{Bug in left header fixed}
% \changes{v1.03}{2005/01/12}{Bug in \PassOptionsToPackage command fixed}
%
% This package redefines NCC page styles to fancy styles
% and defines the fancy `title' page style if the `title' option is used.
% This style has three header marks:
% \lefttitlemark, \titlemark (in center), and \righttitlemark.
%
% If NCC class is not loaded, the package transfers redifinition of
% styles to the nccfancyhdr package in assumption that one of standard
% LaTeX classes is loaded.
%
\@ifundefined{NCC@setpsheading}{%
  \def\NCC@temp{\PassOptionsToPackage{\CurrentOption}{nccfancyhdr}}%
}{%
  \def\NCC@temp{%
    \def\NCC@setpsheading{\ps@fancy
      \fancyhead[CO]{%
        \fancycenter{}%
                    {\small\itshape\ignorespaces\rightmark\unskip}%
                    {\thepage}%
      }%
      \fancyhead[CE]{%
        \fancycenter{\thepage}%
                    {\small\itshape\ignorespaces\leftmark\unskip}%
                    {}%
      }%
    }%
  }%
}
%
\DeclareOption{empty}{%
  \PassOptionsToPackage{\CurrentOption}{nccfancyhdr}%
  \AtEndOfPackage{\pagestyle{empty}}%
}
\DeclareOption{plain}{%
  \PassOptionsToPackage{\CurrentOption}{nccfancyhdr}%
  \AtEndOfPackage{\pagestyle{plain}}%
}
\DeclareOption{myheadings}{%
  \NCC@temp
  \AtEndOfPackage{\pagestyle{myheadings}}%
}
\DeclareOption{headings}{%
  \NCC@temp
  \AtEndOfPackage{\pagestyle{headings}}%
}
\DeclareOption{title}{%
  \def\ps@title{\ps@fancy
    \fancyhead[L]{\ignorespaces\lefttitlemark\unskip}%
    \fancyhead[C]{\ignorespaces\titlemark\unskip}%
    \fancyhead[R]{\ignorespaces\righttitlemark\unskip}%
  }%
  \newcommand\lefttitlemark{}%
  \newcommand\titlemark{}%
  \newcommand\righttitlemark{}%
  \AtEndOfPackage{\pagestyle{title}}%
}
\ProcessOptions*
\RequirePackage{nccfancyhdr}
\endinput