Debian Codegraph @

texmf-dist/doc/pdftex/tests/16-nolink-special/fancyhdr.sty

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