0
|
1 %%
|
|
2 %% This is file `fancyhdr.sty',
|
|
3 %% generated with the docstrip utility.
|
|
4 %%
|
|
5 %% The original source files were:
|
|
6 %%
|
|
7 %% fancyhdr.dtx (with options: `fancyhdr')
|
|
8 %%
|
|
9 %% This is a generated file.
|
|
10 %%
|
|
11 %% This file may be distributed and/or modified under the conditions of
|
|
12 %% the LaTeX Project Public License, either version 1.3 of this license
|
|
13 %% or (at your option) any later version. The latest version of this
|
|
14 %% license is in:
|
|
15 %%
|
|
16 %% http://www.latex-project.org/lppl.txt
|
|
17 %%
|
|
18 %% and version 1.3 or later is part of all distributions of LaTeX version
|
|
19 %% 2005/12/01 or later.
|
|
20 %%
|
|
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
22 \NeedsTeXFormat{LaTeX2e}
|
|
23 \ProvidesPackage{fancyhdr}%
|
|
24 [2017/06/30 v3.9a
|
|
25 Extensive control of page headers and footers]%
|
|
26 % Copyright (C) 1994-2016 by Piet van Oostrum <piet@vanoostrum.org>
|
|
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
28 \def\if@nch@mpty#1{\def\temp@a{#1}\ifx\temp@a\@empty}
|
|
29 \def\f@nch@def#1#2{\if@nch@mpty{#2}\f@nch@gbl\def#1{\leavevmode}\else
|
|
30 \f@nch@gbl\def#1{#2\strut}\fi}
|
|
31 \let\f@nch@gbl\global
|
|
32 \def\f@nch@errmsg#1{%
|
|
33 \ifx\PackageError\undefined \errmessage{#1}\else
|
|
34 \PackageError{Fancyhdr}{#1}{}\fi}
|
|
35 \def\f@nch@warning#1{%
|
|
36 \ifx\PackageWarning\undefined \errmessage{#1}\else
|
|
37 \PackageWarning{Fancyhdr}{#1}{}\fi}
|
|
38 \def\f@nch@forc#1#2#3{\expandafter\f@rc\expandafter#1\expandafter{#2}{#3}}
|
|
39 \def\f@rc#1#2#3{\def\temp@ty{#2}\ifx\@empty\temp@ty\else
|
|
40 \f@nch@rc#1#2\f@nch@rc{#3}\fi}
|
|
41 \def\f@nch@rc#1#2#3\f@nch@rc#4{\def#1{#2}#4\f@rc#1{#3}{#4}}
|
|
42 \newcommand{\f@nch@for}[3]{\edef\@fortmp{#2}%
|
|
43 \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}}
|
|
44 \newcommand\f@nch@default[3]{%
|
|
45 \edef\temp@a{\lowercase{\edef\noexpand\temp@a{#3}}}\temp@a \def#1{}%
|
|
46 \f@nch@forc\tmpf@ra{#2}%
|
|
47 {\expandafter\f@nch@ifin\tmpf@ra\temp@a{\edef#1{#1\tmpf@ra}}{}}%
|
|
48 \ifx\@empty#1\def#1{#2}\fi}
|
|
49 \newcommand{\f@nch@ifin}[4]{%
|
|
50 \edef\temp@a{#2}\def\temp@b##1#1##2\temp@b{\def\temp@b{##1}}%
|
|
51 \expandafter\temp@b#2#1\temp@b\ifx\temp@a\temp@b #4\else #3\fi}
|
|
52 \newcommand{\fancyhead}[2][]{\f@nch@fancyhf\fancyhead h[#1]{#2}}%
|
|
53 \newcommand{\fancyfoot}[2][]{\f@nch@fancyhf\fancyfoot f[#1]{#2}}%
|
|
54 \newcommand{\fancyhf}[2][]{\f@nch@fancyhf\fancyhf {}[#1]{#2}}%
|
|
55 \newcommand{\fancyheadoffset}[2][]{\f@nch@fancyhfoffs\fancyheadoffset h[#1]{#2}}%
|
|
56 \newcommand{\fancyfootoffset}[2][]{\f@nch@fancyhfoffs\fancyfootoffset f[#1]{#2}}%
|
|
57 \newcommand{\fancyhfoffset}[2][]{\f@nch@fancyhfoffs\fancyhfoffset {}[#1]{#2}}%
|
|
58 \def\f@nch@fancyhf#1#2[#3]#4{%
|
|
59 \def\temp@c{}%
|
|
60 \f@nch@forc\tmpf@ra{#3}%
|
|
61 {\expandafter\f@nch@ifin\tmpf@ra{eolcrhf,EOLCRHF}%
|
|
62 {}{\edef\temp@c{\temp@c\tmpf@ra}}}%
|
|
63 \ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
|
|
64 \string#1 argument: [#3]}%
|
|
65 \fi \f@nch@for\temp@c{#3}%
|
|
66 {\f@nch@default\f@nch@@eo{eo}\temp@c \if@twoside\else \if\f@nch@@eo
|
|
67 e\f@nch@warning {\string#1's `E' option without twoside option is
|
|
68 useless}\fi\fi \f@nch@default\f@nch@@lcr{lcr}\temp@c
|
|
69 \f@nch@default\f@nch@@hf{hf}{#2\temp@c}%
|
|
70 \f@nch@forc\f@nch@eo\f@nch@@eo
|
|
71 {\f@nch@forc\f@nch@lcr\f@nch@@lcr
|
|
72 {\f@nch@forc\f@nch@hf\f@nch@@hf
|
|
73 {\expandafter\f@nch@def\csname
|
|
74 f@nch@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname {#4}}}}}}
|
|
75 \def\f@nch@fancyhfoffs#1#2[#3]#4{%
|
|
76 \def\temp@c{}%
|
|
77 \f@nch@forc\tmpf@ra{#3}%
|
|
78 {\expandafter\f@nch@ifin\tmpf@ra{eolrhf,EOLRHF}%
|
|
79 {}{\edef\temp@c{\temp@c\tmpf@ra}}}%
|
|
80 \ifx\@empty\temp@c\else \f@nch@errmsg{Illegal char `\temp@c' in
|
|
81 \string#1 argument: [#3]}%
|
|
82 \fi \f@nch@for\temp@c{#3}%
|
|
83 {\f@nch@default\f@nch@@eo{eo}\temp@c \if@twoside\else \if\f@nch@@eo
|
|
84 e\f@nch@warning {\string#1's `E' option without twoside option is
|
|
85 useless}\fi\fi \f@nch@default\f@nch@@lcr{lr}\temp@c
|
|
86 \f@nch@default\f@nch@@hf{hf}{#2\temp@c}%
|
|
87 \f@nch@forc\f@nch@eo\f@nch@@eo
|
|
88 {\f@nch@forc\f@nch@lcr\f@nch@@lcr
|
|
89 {\f@nch@forc\f@nch@hf\f@nch@@hf
|
|
90 {\expandafter\setlength\csname
|
|
91 f@nch@O@\f@nch@eo\f@nch@lcr\f@nch@hf\endcsname {#4}}}}}%
|
|
92 \f@nch@setoffs}
|
|
93 \newcommand{\lhead}[2][\f@nch@olh]%
|
|
94 {\f@nch@def\f@nch@olh{#2}\f@nch@def\f@nch@elh{#1}}
|
|
95 \newcommand{\chead}[2][\f@nch@och]%
|
|
96 {\f@nch@def\f@nch@och{#2}\f@nch@def\f@nch@ech{#1}}
|
|
97 \newcommand{\rhead}[2][\f@nch@orh]%
|
|
98 {\f@nch@def\f@nch@orh{#2}\f@nch@def\f@nch@erh{#1}}
|
|
99 \newcommand{\lfoot}[2][\f@nch@olf]%
|
|
100 {\f@nch@def\f@nch@olf{#2}\f@nch@def\f@nch@elf{#1}}
|
|
101 \newcommand{\cfoot}[2][\f@nch@ocf]%
|
|
102 {\f@nch@def\f@nch@ocf{#2}\f@nch@def\f@nch@ecf{#1}}
|
|
103 \newcommand{\rfoot}[2][\f@nch@orf]%
|
|
104 {\f@nch@def\f@nch@orf{#2}\f@nch@def\f@nch@erf{#1}}
|
|
105 \newlength{\f@nch@headwidth} \let\headwidth\f@nch@headwidth
|
|
106 \newlength{\f@nch@O@elh}
|
|
107 \newlength{\f@nch@O@erh}
|
|
108 \newlength{\f@nch@O@olh}
|
|
109 \newlength{\f@nch@O@orh}
|
|
110 \newlength{\f@nch@O@elf}
|
|
111 \newlength{\f@nch@O@erf}
|
|
112 \newlength{\f@nch@O@olf}
|
|
113 \newlength{\f@nch@O@orf}
|
|
114 \newcommand{\headrulewidth}{0.4pt}
|
|
115 \newcommand{\footrulewidth}{0pt}
|
|
116 \@ifundefined{footruleskip}%
|
|
117 {\newcommand{\footruleskip}{.3\normalbaselineskip}}{}
|
|
118 \newcommand{\plainheadrulewidth}{0pt}
|
|
119 \newcommand{\plainfootrulewidth}{0pt}
|
|
120 \newif\if@fancyplain \@fancyplainfalse
|
|
121 \def\fancyplain#1#2{\if@fancyplain#1\else#2\fi}
|
|
122 \headwidth=-123456789sp
|
|
123 \let\f@nch@raggedleft\raggedleft
|
|
124 \let\f@nch@raggedright\raggedright
|
|
125 \let\f@nch@centering\centering
|
|
126 \let\f@nch@everypar\everypar
|
|
127 \def\f@nch@reset{\f@nch@everypar{}\restorecr\endlinechar=13
|
|
128 \let\\\@normalcr \let\raggedleft\f@nch@raggedleft
|
|
129 \let\raggedright\f@nch@raggedright \let\centering\f@nch@centering
|
|
130 \def\baselinestretch{1}%
|
|
131 \hsize=\headwidth
|
|
132 \def\nouppercase##1{{\let\uppercase\relax\let\MakeUppercase\relax
|
|
133 \expandafter\let\csname MakeUppercase \endcsname\relax##1}}%
|
|
134 \ifx\undefined\@newbaseline % NFSS not present; 2.09 or 2e
|
|
135 \ifx\@normalsize\undefined \normalsize % for ucthesis.cls
|
|
136 \else \@normalsize \fi \else % NFSS (2.09) present
|
|
137 \@newbaseline%
|
|
138 \fi}
|
|
139 \fancyhf{}
|
|
140 \if@twoside
|
|
141 \fancyhead[el,or]{\fancyplain{}{\slshape\rightmark}}
|
|
142 \fancyhead[er,ol]{\fancyplain{}{\slshape\leftmark}}
|
|
143 \else
|
|
144 \fancyhead[l]{\fancyplain{}{\slshape\rightmark}}
|
|
145 \fancyhead[r]{\fancyplain{}{\slshape\leftmark}}
|
|
146 \fi
|
|
147 \fancyfoot[c]{\rmfamily\thepage} % page number
|
|
148 \def\f@nch@vbox#1#2{\setbox0\vbox{#2}\ifdim\ht0>#1\f@nch@warning
|
|
149 {\string#1 is too small (\the#1): ^^J Make it at least \the\ht0.^^J We
|
|
150 now make it that large for the rest of the document.^^J This may
|
|
151 cause the page layout to be inconsistent, however\@gobble}%
|
|
152 \dimen0=#1\global\setlength{#1}{\ht0}\ht0=\dimen0\fi \box0}
|
|
153 \def\f@nch@head#1#2#3#4#5{#1\hbox to\headwidth{\f@nch@reset
|
|
154 \f@nch@vbox\headheight{\hbox
|
|
155 {\rlap{\parbox[b]{\headwidth}{\raggedright#2}}\hfill
|
|
156 \parbox[b]{\headwidth}{\centering#3}\hfill
|
|
157 \llap{\parbox[b]{\headwidth}{\raggedleft#4}}}\headrule}}#5}
|
|
158 \def\f@nch@foot#1#2#3#4#5{#1\hbox to\headwidth{\f@nch@reset
|
|
159 \f@nch@vbox\footskip{\footrule
|
|
160 \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2}}\hfill
|
|
161 \parbox[t]{\headwidth}{\centering#3}\hfill
|
|
162 \llap{\parbox[t]{\headwidth}{\raggedleft#4}}}}}#5}
|
|
163 \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
|
|
164 \hrule\@height\headrulewidth\@width\headwidth
|
|
165 \vskip-\headrulewidth}}
|
|
166 \def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
|
|
167 \vskip-\footruleskip\vskip-\footrulewidth
|
|
168 \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}}
|
|
169 \def\ps@fancy{%
|
|
170 \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}% for amsbook
|
|
171 \@ifundefined{MakeUppercase}{\def\MakeUppercase{\uppercase}}{}%
|
|
172 \ifx\chapter\@undefined \def\sectionmark##1{\markboth
|
|
173 {\MakeUppercase{\ifnum \c@secnumdepth>\z@ \thesection\hskip 1em\relax
|
|
174 \fi ##1}}{}}%
|
|
175 \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne
|
|
176 \thesubsection\hskip 1em\relax \fi ##1}}%
|
|
177 \else \def\chaptermark##1{\markboth {\MakeUppercase{\ifnum
|
|
178 \c@secnumdepth>\m@ne \@chapapp\ \thechapter. \ \fi ##1}}{}}%
|
|
179 \def\sectionmark##1{\markright{\MakeUppercase{\ifnum \c@secnumdepth >\z@
|
|
180 \thesection. \ \fi ##1}}}%
|
|
181 \fi
|
|
182 \ps@@fancy
|
|
183 \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}%
|
|
184 \ifdim\headwidth<0sp
|
|
185 \global\advance\headwidth123456789sp\global\advance\headwidth\textwidth
|
|
186 \fi}
|
|
187 \def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy}
|
|
188 \def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy}
|
|
189 \let\ps@@empty\ps@empty
|
|
190 \def\ps@@fancy{%
|
|
191 \ps@@empty
|
|
192 \def\@mkboth{\protect\markboth}%
|
|
193 \def\@oddhead{\f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh}%
|
|
194 \def\@oddfoot{\f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf}%
|
|
195 \def\@evenhead{\f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh}%
|
|
196 \def\@evenfoot{\f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf}%
|
|
197 }
|
|
198 \def\f@nch@Oolh{\if@reversemargin\hss\else\relax\fi}
|
|
199 \def\f@nch@Oorh{\if@reversemargin\relax\else\hss\fi}
|
|
200 \let\f@nch@Oelh\f@nch@Oorh
|
|
201 \let\f@nch@Oerh\f@nch@Oolh
|
|
202 \let\f@nch@Oolf\f@nch@Oolh
|
|
203 \let\f@nch@Oorf\f@nch@Oorh
|
|
204 \let\f@nch@Oelf\f@nch@Oelh
|
|
205 \let\f@nch@Oerf\f@nch@Oerh
|
|
206 \def\f@nch@offsolh{\headwidth=\textwidth\advance\headwidth\f@nch@O@olh
|
|
207 \advance\headwidth\f@nch@O@orh\hskip-\f@nch@O@olh}
|
|
208 \def\f@nch@offselh{\headwidth=\textwidth\advance\headwidth\f@nch@O@elh
|
|
209 \advance\headwidth\f@nch@O@erh\hskip-\f@nch@O@elh}
|
|
210 \def\f@nch@offsolf{\headwidth=\textwidth\advance\headwidth\f@nch@O@olf
|
|
211 \advance\headwidth\f@nch@O@orf\hskip-\f@nch@O@olf}
|
|
212 \def\f@nch@offself{\headwidth=\textwidth\advance\headwidth\f@nch@O@elf
|
|
213 \advance\headwidth\f@nch@O@erf\hskip-\f@nch@O@elf}
|
|
214 \def\f@nch@setoffs{%
|
|
215 \f@nch@gbl\let\headwidth\f@nch@headwidth
|
|
216 \f@nch@gbl\let\f@nch@Oolh\f@nch@offsolh
|
|
217 \f@nch@gbl\let\f@nch@Oelh\f@nch@offselh \f@nch@gbl\let\f@nch@Oorh\hss
|
|
218 \f@nch@gbl\let\f@nch@Oerh\hss \f@nch@gbl\let\f@nch@Oolf\f@nch@offsolf
|
|
219 \f@nch@gbl\let\f@nch@Oelf\f@nch@offself \f@nch@gbl\let\f@nch@Oorf\hss
|
|
220 \f@nch@gbl\let\f@nch@Oerf\hss
|
|
221 }
|
|
222 \newif\iff@nch@footnote
|
|
223 \AtBeginDocument{%
|
|
224 \let\latex@makecol\@makecol
|
|
225 \def\@makecol{\ifvoid\footins\f@nch@footnotefalse\else\f@nch@footnotetrue\fi
|
|
226 \let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol}%
|
|
227 }
|
|
228 \newcommand\iftopfloat[2]{\ifx\topfloat\empty #2\else #1\fi}%
|
|
229 \newcommand\ifbotfloat[2]{\ifx\botfloat\empty #2\else #1\fi}%
|
|
230 \newcommand\iffloatpage[2]{\if@fcolmade #1\else #2\fi}%
|
|
231 \newcommand\iffootnote[2]{\iff@nch@footnote #1\else #2\fi}%
|
|
232 \newcommand{\fancypagestyle}[2]{%
|
|
233 \@namedef{ps@#1}{\let\f@nch@gbl\relax#2\relax\ps@fancy}}
|
|
234 \endinput
|
|
235 %%
|
|
236 %% End of file `fancyhdr.sty'.
|