-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfancyhdr.dtx
8582 lines (8558 loc) · 345 KB
/
fancyhdr.dtx
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%
% Copyright (C) 1994-2025 by Pieter van Oostrum <[email protected]>
% -------------------------------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{\jobname.dtx}
%</driver>
%
% \begin{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
%<fancyhdr>\ProvidesPackage{fancyhdr}%
%<fancyheadings>\ProvidesPackage{fancyheadings}
%<extramarks|extramarks-v4>\ProvidesPackage{extramarks}
%<fancyhdr|extramarks> [2025/01/07 v5.1.1
%<fancyhdr> Extensive control of page headers and footers]%
%<fancyheadings> [2022/11/09 v4.1
%<fancyheadings> Legacy package to call fancyhdr]
%<extramarks> Extra marks for LaTeX]
%<fancyhdr|extramarks>% Copyright (C) 1994-2025 by Pieter van Oostrum <[email protected]>
%<extramarks-v4> [2024/11/30 v4.5
%<extramarks-v4> Legacy version of extramarks for LaTeX]
%<extramarks-v4>% Copyright (C) 1994-2024 by Pieter van Oostrum <[email protected]>
%<extramarks-v4>%%
%<extramarks-v4>%% This is a legacy version (v4) of extramarks.sty
%<extramarks-v4>%%
%<fancyheadings>% Public domain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \end{macrocode}
%
%<*driver>
% Specify options for the url and hyperref packages
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{colorlinks,linktocpage}{hyperref}
\documentclass[a4paper]{l3doc}
\addtolength\textheight{2cm}
\usepackage{multicol}
\usepackage{float}
\usepackage{makeidx}
\usepackage{robustindex}
\makeindex
\usepackage{layout}
\usepackage{array}
\usepackage{booktabs}
\usepackage{boxedminipage}
\usepackage{tikz}
\usetikzlibrary{decorations.fractals}
% The package fourier-orns defines \danger, which conflicts
% with the 'danger' environment of l3doc.
% We save, clear and restore \danger arounf this \usepackage
\let \liiidocxxxsavedanger\danger
\let\danger\undefined
\usepackage{fourier-orns}
\let\danger\liiidocxxxsavedanger
% End of conflict resolution
\usepackage[T1]{fontenc}
\usepackage[hyphens]{url}
\usepackage[fit]{truncate}
\usepackage{fancyvrb}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[colorlinks,linktocpage]{hyperref}
\usepackage{ifthen}
\usepackage{xparse}
\usepackage{enumitem}
\setlist{itemsep=1pt}
\usepackage{fancyhdr}
\GetFileInfo{fancyhdr.sty}
\def\ams/{\protect\pAmS}
\def\pAmS{{\the\textfont2
A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
\newcommand{\bs}{\symbol{'134}}
\providecommand\env{}
\renewcommand{\env}[1]{\texttt{#1}}
\renewcommand{\partname}{Part}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
\newcommand\bsbs{\char`\\\char`\\}
\newcommand{\Cmd}[1]{\texttt{\def\{{\char`\{}\def\}{\char`\}}\bs#1}}
%\newcommand{\CmdIndex}[1]{\index{#1=\string\texttt{\bs#1}}}
\newcommand{\CmdIndex}[1]{\setbox0\hbox{\cs{#1}}}
\newcommand{\TTindex}[1]{\index{#1=\string\texttt{#1}}\ignorespaces}
\newcommand{\PSindex}[1]{\index{page style>#1=\string\texttt{#1}}}
\newcommand{\OPTindex}[1]{\index{option>#1=\string\texttt{#1}}}
\newcommand{\PKGindex}[1]{\index{package>#1=\string\pkg{#1}}\ignorespaces}
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\textfraction}{0.05}
\setlength{\emergencystretch}{4em}
\addtolength{\textheight}{-0.5in} % make it print better on US letter paper
\setlength\IndexMin{4cm}
\makeatletter
\renewcommand\l@section {\@dottedtocline{1}{1.5em}{2.3em}}
\makeatother
\newenvironment{block}{\vspace{8pt}\noindent\begin{minipage}{\textwidth}}{\end{minipage}\vspace{8pt}}
\newenvironment{fblock}{\vspace{8pt}\noindent\begin{boxedminipage}{\textwidth}}{\end{boxedminipage}\vspace{8pt}}
\newcommand{\showrule}{\\[-1.5ex]\noindent\makebox[\textwidth]{\hrulefill}\\[\baselineskip]}
\newenvironment{xvspace}{\vspace{1ex}}{{\vspace{1ex}}}
\setcounter{tocdepth}{1}
% Compare section numbers in references
\usepackage{refcount}
\newcounter{secnum}
% #1=current section label #2=ref section label
\newcommand{\smartref}[2]{%
\setcounterref{secnum}{#1}%
\addtocounter{secnum}{-1}%
\ifnum\value{secnum}=\getrefnumber{#2}
the previous section%
\else
\addtocounter{secnum}{2}%
\ifnum\value{secnum}=\getrefnumber{#2}
the next section%
\else
section~\ref{#2}%
\fi
\fi
}
% Our own page style:
\pagestyle{fancy}
\setlength{\headheight}{16.0pt}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{0.5\marginparwidth}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\textbf{\thepage}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\quad#1}}
% Page style for demonstrating struts, \headruleskip and \footruleskip.
\newcommand{\strutheader}{%
\texttt{\textbackslash strut}:\{
\rule{10pt}{0.7\normalbaselineskip}%
\hspace{-3pt}\rule[-0.3\normalbaselineskip]{10pt}{0.3\normalbaselineskip}%
\raisebox{-0.3\normalbaselineskip}[0pt][0pt]%
{\ifdim \headruleskip>0pt
\rule[-\headruleskip]{10pt}{\headruleskip}
\else
\rule{10pt}{-\headruleskip}
\fi}%
\raisebox{-0.3\normalbaselineskip}[0pt][0pt]{$\swarrow$}\texttt{\textbackslash headruleskip}%
}
\newcommand{\strutfooter}{%
\raisebox{0pt}[0pt][0pt]{%
\texttt{\textbackslash strut}:\{
\rule[-0.3\normalbaselineskip]{10pt}{0.3\normalbaselineskip}%
\hspace{-3pt}\rule{10pt}{0.7\normalbaselineskip}%
\rule[0.7\normalbaselineskip]{10pt}{\footruleskip}
\raisebox{0.3\normalbaselineskip}{$\nwarrow$}\texttt{\textbackslash footruleskip}}%
}
\fancypagestyle{showstruts}{%
\fancyhead[L]{%
\ifthenelse{\value{page}=\getpagerefnumber{showstruts}}%
{\strutheader}%
{\rightmark}%
}
\fancyfoot[L]{%
\ifthenelse{\value{page}=\getpagerefnumber{showstruts}}%
{\strutfooter}%
{}%
}
\fancyheadinit{%
\ifthenelse{\value{page}=\getpagerefnumber{showstruts}}%
{\renewcommand{\headruleskip}{4pt}}%
{\renewcommand{\headruleskip}{0pt}}%
}
\fancyfootinit{%
\ifthenelse{\value{page}=\getpagerefnumber{showstruts}}%
{\renewcommand{\footrulewidth}{0.4pt}}%
{\renewcommand{\footrulewidth}{0pt}}%
}
}
\newcommand\exampleindex{}
\def\exampleindex#1#2#3\relax{%
\ifx \relax#2\relax \index{Example 0#1=Example #1}\else \index{Example #1#2#3}\fi}
\newcommand{\ExampleLabel}{}
\NewDocumentCommand \Example { m o }
{
\renewcommand{\ExampleLabel}{Example~#1\IfNoValueF{#2}{\\#2}}%
\exampleindex#1\relax\relax%
}
\newcommand{\NoExample}[1]
{%
\renewcommand{\ExampleLabel}{#1}%
% \index{Example `#1'}%
}
\newcommand{\formatexample}{\hbox{\hspace{-2.5cm}%
\raisebox{-2\baselineskip}[0pt][0pt]{%
\parbox[t]{2.5cm}{\normalfont\normalsize
\centering
\ExampleLabel}}}\nopagebreak}
\newcommand{\FExample}[1]{%
\noindent\makebox[0pt][l]{\hspace{-2.5cm}\parbox[t][0pt]{2.5cm}{%
\normalfont\normalsize
\centering
Example #1}}%
\exampleindex#1\relax\relax%
}%
\newcommand{\VL}{0.008} % size of vertical line segments
\newcommand{\upperline}{%
\hbox to 0pt{%
\kern\leftmargin
\begin{picture}(0pt,0pt)
\setlength{\unitlength}{\linewidth}
\put(0,0){\line(1,0){1}}
\put(0,0){\line(0,-1){\VL}}
\put(1,0){\line(0,-1){\VL}}
\end{picture}\hss}%
\nopagebreak
}
\newcommand{\lowerline}{
\nopagebreak\noindent
\begin{picture}(0pt,0pt)
\setlength{\unitlength}{\linewidth}
\put(0,\VL){\line(1,0){1}}
\put(0,\VL){\line(0,1){\VL}}
\put(1,\VL){\line(0,1){\VL}}
\end{picture}\par
}
% fancyvrb hacking
\makeatletter
\def\FV@Frame@mylines{%
\let\FV@BeginListFrame\upperline
\let\FV@LeftListFrame\relax
\let\FV@RightListFrame\relax
\let\FV@EndListFrame\lowerline}
\makeatother
% print the Example number in the margin and gobble the % sign of ltxdoc
\DefineVerbatimEnvironment{example}{Verbatim}{formatcom=\formatexample,gobble=1,
vspace=0pt,frame=mylines}
\DefineVerbatimEnvironment{code}{Verbatim}{gobble=1,vspace=0pt,frame=mylines}
\newlength{\normalparindent}
\setlength{\normalparindent}{\parindent}
% Macro to print a header in the running text
\makeatletter
\newcommand\showheader[2][O]{%
% #1 optional = O/E (odd/even header)
% #2 = fancyhdr code for the header
%
\begingroup
\let\headwidth\textwidth
#2
\noindent\makebox[\textwidth][c]{\if O#1\@oddhead\else\@evenhead\fi}
\endgroup
}
\makeatother
% l3doc resets section counters at \part.
% I don't want that.
\makeatletter
\@removefromreset{section}{part}
\makeatother
\begin{document}
\DeleteShortVerb{\|}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
% \expandafter\DoNotIndex\expandafter{\bslash} ^^A BUG in l3doc
% \DoNotIndex{\@ne,\box,\box_new:N,\csx,\csn,\copy,\color}
% \DoNotIndex{\@opcol,\@opcol:,\expandafter,\errorcontextlines}
% \DoNotIndex{\advance,\begingroup,\catcode,\closein,\centering,\dbltextfloatsep}
% \DoNotIndex{\begin,\end,\bgroup,\egroup}
% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup,\everypar}
% \DoNotIndex{\cs_gset_eq:NN,\cs_gset_protected:Npn,\cs_if_exist:NTF,\cs_if_exist:cTF}
% \DoNotIndex{\cs_new:Nn,\cs_new_eq:NN,\cs_new_protected:Npn,\cs_set_eq:NN}
% \DoNotIndex{\csname,\endcsname,\end,\endinput,\def,\dimen,\do,\dp}
% \DoNotIndex{\dim_set:Nn,\c_max_dim,\endlinechar,\errmessage}
% \DoNotIndex{\exp_args:Nc,\exp_last_unbraced:Nv,\exp_not:n,\exp_not:v}
% \DoNotIndex{\ExplSyntaxOn,\ExplSyntaxOff,\fi,\gdef,\global}
% \DoNotIndex{\group_begin:,\group_end:,\hbox,\hfil,\hfill,\hsize,\hskip,\hss,\ht}
% \DoNotIndex{\hrule,\hrulefill,\if,\ifdim,\ifnum,\ifx,\ifvmode,\ifvoid,\ifdefined}
% \DoNotIndex{\index,\int_new:N,\int_set:Nn,\int_set_eq:NN,\c_max_int}
% \DoNotIndex{\label,\leavevmode,\let,\llap,\LM,\long,\macro}
% \DoNotIndex{\makeatletter,\makeatother,\MessageBreak,\mark,\maxdimen}
% \DoNotIndex{\msg_error:nnn,\msg_error:nnnn,\msg_new:nnn,\mysaved,\newif}
% \DoNotIndex{\newmarks,\newtoks,\nobreak,\noexpand,\noindent,\output,\outputdblcol}
% \DoNotIndex{\parbox,\patchcmd,\plain,\pretocmd,\protect,\providecommand}
% \DoNotIndex{\protect,\ProvidesPackage,\quad,\relax,\renewcommand,\RequirePackage,\restorecr}
% \DoNotIndex{\restylefloat,\rlap,\rm,\rmfamily,\scan_stop:}
% \DoNotIndex{\seq_map_inline:Nn,\seq_new:N,\seq_put_right:Nn,\setAP,\setbox}
% \DoNotIndex{\setcounter,\setlength,\settowidth,\sl,\slshape,\space,startAP,\string}
% \DoNotIndex{\strut,\temp@a,\temp@a:,\@[xy]lhead,\@botlist,\@chapapp,\@currbox,\@currsize,\@empty}
% \DoNotIndex{\@firstoftwo,\@for,\@forloop,\@fortmp,\@gobble,\@gobbletwo,\@height}
% \DoNotIndex{\@ifnextchar,\@ifpackageloaded,\@ifstar,\@ifundefined,\@makecol,\@minus}
% \DoNotIndex{\@mkboth,\@namedef,\@nameuse,\@newbaseline,\@nil,\@normalcr,\@normalsize}
% \DoNotIndex{\@outputbox,\@outputdblcol,\@outputpage,\@parboxrestore,\@plus}
% \DoNotIndex{\@secondoftwo,\@spaces,\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc}
% \DoNotIndex{\@tempskipa,\@tempskipb,\@temptokena,\@temptokenb,\@tfor,\@themark}
% \DoNotIndex{\@toplist,\@topnewpage,\@undefined,\@unexpandable@protect,\@width}
% \DoNotIndex{\c@page,\c@secnumdepth,\col@number,\color@begingroup,\color@endgroup}
% \DoNotIndex{\color@endbox,\color@vbox,\f@nch@,\insert@nonemptymarks,\latex@makecol}
% \DoNotIndex{\m@ne,\partial@page,\pcol@@outputpage,\pcol@combinefloats}
% \DoNotIndex{\pcol@getcurrcol,\pcol@imakeflushedpage,\pcol@ioutputelt,\pcol@makecol,\pcol@prevdepth}
% \DoNotIndex{\pcol@makeflushedpage,\pcol@outputpage@l,\pcol@outputpage@r,\pcol@prec_depth}
% \DoNotIndex{\pcol@rightpage,\pcol@spanning,\pcol@synccolumn,\ps@xxx,\return@nonemptymark}
% \DoNotIndex{\scr@topnewpage,\set@keptmarks,\temp@a,\temp@b,\temp@c,\temp@ty,\tmpf@ra}
% \DoNotIndex{\toks@,\unrestored@protected@xdef,\voidb@x,\z@,\z@skip}
% \DoNotIndex{\tex_marks:D,\tex_splitmaxdepth:D,\tex_vbadness:D,\textbf,\textsl,\texttt}
% \DoNotIndex{\textfraction,\textwidth,\the,\c_empty_tl}
% \DoNotIndex{\tl_gset:cn,\tl_gset:Nn,\tl_gset:No,\tl_gset:co,\tl_gset_eq:NN,\tl_gset_eq:cc,\tl_gset_eq:cN}
% \DoNotIndex{\tl_if_empty:cF,\tl_if_empty:cTF,\tl_if_empty:cT,\tl_if_empty:NF,\tl_if_empty:NTF}
% \DoNotIndex{\tl_new:N,\tl_new:c,\tl_set_eq:cc,\tl_to_str:c,\token_to_str:c,\token_to_str:N}
% \DoNotIndex{\undefined,\unskip,\unvbox,\unvcopy,\use:n,\use:N,\use:c,\use_none:n,\usepackage}
% \DoNotIndex{\var,\vbox,\vbox_set:Nn,\vbox_set_split_to_ht:NNn,\vboxed,\vskip,\vspace}
% \DoNotIndex{\vsplit,\vss,\xdef,\xlap,\xxxx,\xmarks}
% \DoNotIndex{\newcommand,\NewDocumentCommand,\NewExpandableDocumentCommand,\newlength,\newtoks}
%
% \ProvideDocElement[printtype=\textit{hook},idxtype=hook,idxgroup=Hooks]{Hook}{hookdecl}%
% \newcommand\makedate{}
% \def\makedate#1/#2/#3/{%
% \date{%
% \ifcase #2\or
% Jan\or Feb\or March\or Apr\or May\or June\or
% July\or Aug\or Sept\or Oct\or Nov\or Dec\fi~\number #3,
% #1}%
% }
% \expandafter\makedate\filedate/
%
% \title{The \pkg{fancyhdr} and \pkg{extramarks}
% packages\\{\normalsize version \fileversion.}}
% \author{Pieter van Oostrum\thanks{Part of this documentation was
% written by George
% Gr\"atzer (University of Manitoba) in \emph{Notices Amer. Math. Soc.}
% Thanks, George!}\\
% Dept.\ of Computer Science\thanks{This was my employer at the time I developed this package.
% I am now retired.}\\
% Utrecht University}
%
% \maketitle
% \begin{abstract}
% This document describes how to customize the page layout of your LaTeX
% documents, i.e., how to change page margings and sizes,
% headers and footers, and the
% proper placement of figures and tables (collectively called floats) on
% the page.
%
% This documentation describes version 5.0 or later of the
% \pkg{fancyhdr} and \pkg{extramarks} packages. The user
% documentation is also mostly valid for the versions 4.0 or later of
% the \pkg{fancyhdr} and \pkg{extramarks} packages (except
% for the changes mentioned in sections~\ref{sec:version-4} and
% \ref{sec:version-5}).
%
% \end{abstract}
%
% \tableofcontents
% \markright{Contents}
%
% \begin{documentation}
% \part{Introduction}
%
% This document contains four parts:
%
% Part I is a short documentation on
% the user commands of the \pkg{fancyhdr} and \pkg{extramarks} packages.
%
% Part II contains elaborate documentation on page layout in \LaTeX.
% This used to be the complete documentation of \pkg{fancyhdr} and
% \pkg{extramarks} for several years.
%
% Part III contains Questions and Answers.
%
% Part IV contains the annotated implementation.
%
% This document describes version 5 of \pkg{fancyhdr}. This version
% is an extension of \pkg{fancyhdr} version 4, which is described in
% the \emph{The \LaTeX{} Companion, Third Edition}. It just
% has some additional commands that are not mentioned in \emph{The
% \LaTeX{} Companion}.
% The differences between these versions
% are summarized in section~\ref{sec:version-4} on
% page~\pageref{sec:version-4}, and section~\ref{sec:version-5} on
% page~\pageref{sec:version-5}.
% Throughout this documentation it is mentioned when a specific feature
% is only available in version 4 or a later version, or when there are
% differences between version 4 and 5.
%
% This document also describes version 5 of \pkg{extramarks}. This
% is a new implementation that differs significantly from the previous
% versions. See section~\ref{sec:extramarks-5} on
% page~\pageref{sec:extramarks-5} for more details.
%
% This documentation contains several examples. Most of the examples are
% available for download from Github, see section~\ref{sec:contact}.
% These examples are indicated with their name in the margin. If the
% margin says ``Example \meta{n}'', where \meta{n} is numeric, maybe
% followed by a letter, then the file name will be
% \texttt{example\meta{n}.tex}. When it is followed by a letter in
% parentheses like (A), it means an item in the file. Other names
% without the word ``Example'' are just the file name without extension,
% for example ``with-beamer'' indicates the file name \texttt{with-beamer.tex}.
%
% \section{Installation}
% \label{sec:installation}
%
% The preferred way to install this package is with a package installer.
% If you want to install it by hand, then first run the command
% `\verb+tex fancyhdr.ins+' and then move the files \pkg{fancyhdr.sty},
% \pkg{extramarks.sty}, \pkg{extramarks-v4.sty}
% and \pkg{fancyheadings.sty} to a place
% where \LaTeX{} can find it, preferably in a directory similar to
% \texttt{.../texmf/tex/latex/fancyhdr/} in your \TeX{} directory tree.
% To get the documentation, run `\verb+pdflatex fancyhdr.dtx+'.
%
% \section{Using \pkg{fancyhdr}}
% \label{sec:using-fancyhdr}
%
% The package \pkg{fancyhdr} gives you several commands to define
% headers and footers of the pages in a \LaTeX{} document.
% You load the package with the following command in the preamble:
% \begin{quote}
% \cs{usepackage}\oarg{options}\verb|{fancyhdr}|
% \end{quote}
% (Options are available since version~4.0.
% See \smartref{sec:using-fancyhdr}{sec:options} for the details.)
%
% \begin{function}{\fancyhead,\fancyfoot,\fancyhf}
% \begin{syntax}
% \cmd{\fancyhead}\oarg{places}\marg{field} \\
% \cmd{\fancyfoot}\oarg{places}\marg{field} \\
% \cmd{\fancyhf}\oarg{places}\marg{field}
% \end{syntax}
% Here \meta{places} is a comma-separated list of places where
% \meta{field} will be placed. There are 12 places defined: Left,
% Center and Right Headers and Footers, and both can be on Even or Odd
% pages. Each place therefore has 3 coordinates which are the inital
% letters of the above description: (1) \texttt{E} or \texttt{O}, (2) \texttt{L}, \texttt{C} or
% \texttt{R}, (3) \texttt{H} or \texttt{F}. So a place is given with 3
% letters, like \texttt{EOH}. A missing coordinate means: all
% possibilities, except for \cs{fancyhead} where \texttt{H} is implied
% and \cs{fancyfoot} where \texttt{F} is implied. Although in this
% documentation always uppercase letters are used in the \meta{places},
% lowercase is also acceptable.
% \end{function}
%
% \begin{function}{\fancyheadoffset,\fancyfootoffset,\fancyhfoffset}
% \begin{syntax}
% \cmd{\fancyheadoffset}\oarg{places}\marg{length} \\
% \cmd{\fancyfootoffset}\oarg{places}\marg{length} \\
% \cmd{\fancyhfoffset}\oarg{places}\marg{length}
% \end{syntax}
% These define offsets to let the headers stick into the margin (or to
% the inside if negative). Places cannot contain the \texttt{C}
% specifier. See sections~\ref{sec:book-examples} and
% \ref{sec:headwidth} for more details.
% \end{function}
%
% \begin{function}{\fancyheadwidth,\fancyfootwidth,\fancyhfwidth}
% \begin{syntax}
% \cmd{\fancyheadwidth}\oarg{places}\marg{length} \\
% \cmd{\fancyfootwidth}\oarg{places}\marg{length} \\
% \cmd{\fancyhfwidth}\oarg{places}\marg{length}
% \end{syntax}
% These define widths for the header and footer fields. The fields will
% be typeset in a \cs{parbox} of this width, which can be different for
% each \emph{place}. If the width of a field is not specified, it
% defaults to \cs{headwidth}, which may cause them to overlap. See
% section~\ref{sec:field-width} for more details.
% \end{function}
%
% \begin{variable}{\headrulewidth, \footrulewidth, \headruleskip,
% \footruleskip, \headwidth}
% \cs{headrulewidth} and \cs{footrulewidth} are macros to define the
% thickness of a line under the header and above the footer.
% \cs{headruleskip} and \cs{footruleskip} are macros that define the
% distance between the lines and the header and footer text,
% respectively. (But \cs{headruleskip} is only available since version~4.0.)
% And \cs{headwidth} is a length parameter that defines the
% total width of the headers and footers. See section~\ref{sec:headwidth} for more details.
% \end{variable}
%
% \begin{function}{\headrule, \footrule}
% \cs{headrule} and \cs{footrule} are macros to completely redefine
% these lines.
% \end{function}
%
% \begin{function}{\fancyheadinit, \fancyfootinit, \fancyhfinit}
% \cs{fancyheadinit} and \cs{fancyfootinit} can be used to define
% initialisation code for the header and footer, respectively, and
% \cs{fancyhfinit} defines both of these. These commands are only
% available in \pkg{fancyhdr} version~4.0 and later. See section~\ref{sec:curpagestyle}.
% \end{function}
%
% \begin{function}{\fancyfootalign}
% \begin{syntax}
% \cmd{\fancyfootalign}\texttt{\{\}}\\
% \cmd{\fancyfootalign}\marg{length}
% \end{syntax}
% \end{function}
% The command \cs{fancyfootalign} allows you to fine-tune the vertical
% position of the footer with respect to the page bottom. This command
% is only available in \pkg{fancyhdr} 5.0 and later.
% See section~\ref{sec:fancyfootalign}.
%
% \begin{function}{\fancycenter}
% \begin{syntax}
% \cs{fancycenter}\oarg{dist}\oarg{stretch}\marg{left-field}\marg{center-field}\marg{right-field}
% \end{syntax}
% (Only in version~4.0 and later.) The command \cs{fancycenter} packs 3
% header fields into a full-width header. See section~\ref{sec:fancycenter}.
% \end{function}
%
% \begin{function}{\fancyhdrbox}
% \begin{syntax}
% \cs{fancyhdrbox}\oarg{alignment}\oarg{width}\marg{lines separated by \cmd{\\}}
% \end{syntax}
% (Only in version~5.0 and later.) The command \cs{fancyhdrbox} can be
% used to align multi-line parts vertically and horizontally.
% See section~\ref{sec:fancyhdrbox}.
% \end{function}
%
% \begin{function}{\iftopfloat, \ifbotfloat, \iffloatpage, \iffootnote}
% The macros \cs{iftopfloat}, \cs{ifbotfloat}, \cs{iffloatpage} and
% \cs{iffootnote} are used to detect if there is a float on the top or
% the bottom of the page, or the page is a float page, or if there is
% a footnote at the bottom of the page. These can be used to choose
% different headers and/or footers if these conditions are met. See
% section~\ref{sec:float} for more details.
% \end{function}
%
% \begin{function}{\fancypagestyle,\fancypagestyle*}
% \begin{syntax}
% \cs{fancypagestyle}\marg{style-name}\oarg{base-style}\marg{definitions}\\
% \cs{fancypagestyle}*\marg{style-name}\oarg{base-style}\marg{definitions}
% \end{syntax}
% This command lets you (re)define page styles for use in special
% situations. See sections~\ref{sec:pagestyle-plain} and
% \ref{sec:fancypagestyle} for more details.
% \end{function}
%
% \begin{function}{\fancypagestyleassign}
% \begin{syntax}
% \cs{fancypagestyleassign}\marg{ps1}\marg{ps2}
% \end{syntax}
% This command assigns page style \meta{ps2} to \meta{ps1}. This causes
% \meta{ps1} to be an exact copy of \meta{ps2}, but completely
% independent of \meta{ps2}. Or you could say that \meta{ps1} becomes a
% new name for page style \meta{ps2}.
% See section~\ref{sec:tocstyle} for an example.
% \end{function}
%
% \begin{function}{\fancyhdrsettoheight}
% \begin{syntax}
% \cs{fancyhdrsettoheight}\marg{lengthvar}\marg{header/footer}
% \end{syntax}
% Sets \meta{lengthvar} to the height of the \meta{header/footer}, which must
% be one of \texttt{oddhead}, \texttt{evenhead}, \texttt{oddfoot} or \texttt{evenfoot}.
% Please note: You usually use this outside of a header or a footer (for
% example in the \emph{preamble}, but then if you use marks with a non-standard height
% in your headers or footers, the calculated height may be wrong, as marks don't work well
% outside of a header or footer.
% \end{function}
%
% \section{Package \pkg{fancyhdr} options}
% \label{sec:options}
%
% \textbf{NOTE:} This section applies to \pkg{fancyhdr} version~4.0 and later.
%
% You can supply options to the \cs{usepackage} command:
% \begin{quote}
% \verb|\usepackage|\oarg{options}\verb|{fancyhdr}|
% \end{quote}
% The following options are supported:
% \begin{center}
% \OPTindex{nocheck}\OPTindex{compatV3}\OPTindex{twoside}\OPTindex{headings}\OPTindex{myheadings}%
% \begin{tabular}{ l l }
% \toprule
% Option & Meaning \\
% \midrule
% \texttt{nocheck} & do not check the heights of the header and footer \\
% \texttt{compatV3} & keep some behaviour (now considered undesirable) as in version~3 \\
% \texttt{twoside} & use two-sided headers and footers even in one-sided documents \\
% & for \pkg{fancyhdr}-based page styles (version 4.1 or later) \\
% \texttt{headings} & redefine the \texttt{headings} page style to be fancy-based \\
% \texttt{myheadings} & redefine the \texttt{myheadings} page style to be fancy-based \\
% \bottomrule
% \end{tabular}
% \end{center}
%
% \begin{itemize}
% \item Options \texttt{nocheck} and \texttt{compatV3} are described in
% section~\ref{sec:warning} on page~\pageref{page:warning}.
%
% \item \OPTindex{compatV3}Option \texttt{compatV3} keeps two \pkg{fancyhdr}
% version~3.x (or earlier) features that are now considered undesirable.
% \begin{enumerate}
% \item The automatic adjustment of \cs{headheight} or \cs{footskip}
% when these are too small. This causes the page layout to become
% inconsistent.
% \item In these previous versions the changes to the
% \pkg{fancyhdr} headers and footers (including those by
% \cs{fancyhead}, \cs{fancyheadoffset} and similar commands) are
% made globally, except within a page style defined by
% \cs{fancypagestyle}. That is, when these commands are given inside
% a \LaTeX{} group, they affect the whole document, not only the
% group. If your document depends on this behaviour, you can give
% the \texttt{compatV3} package option. However, this is only
% considered a short-time solution. You should change your document
% as soon as possible to work around this problem. In version~4.0 and
% later, without this option, the changes are always local.
% \end{enumerate}
% This option is deprecated in version~5.0 of
% \pkg{fancyhdr}. It will disappear in a later release. Please
% don't use this option anymore, but rather change your document.
%
% \item \OPTindex{twoside}Option \texttt{twoside} implements two-sided headers
% and footers in one-sided documents (version 4.1 or later). This applies only
% for \pkg{fancyhdr}-based page styles. This option doesn't do anything
% special for two-sided documents (\texttt{twoside} documentclass option), as
% these already have that functionality. And with the \texttt{twoside}
% documentclass option that does apply to other page styles as well.
%
% \item \PSindex{headings}\PSindex{myheadings}\OPTindex{headings}\OPTindex{myheadings}
% The options \texttt{headings} and \texttt{myheadings} redefine the
% corresponding page style with \pkg{fancyhdr} commands (including a
% decorative line under the header), so that you can later select this
% page style as the page style for (part of) the
% document\footnote{These options were copied from the
% \PKGindex{nccfancyhdr}
% \pkg{nccfancyhdr} package, but contrary to that package, they are
% not automatically selected.}.
% \end{itemize}
%
% \PSindex{headings}
% The page style \texttt{headings} is in some aspects similar to the default page
% style \texttt{fancy} settings. In the \texttt{fancy} page style, the
% page number is in the footer, but in the \texttt{headings}
% page style it is in the header. The header fields look similar, however.
%
% Please note that these page styles redefine the \cs{chaptermark} and/or
% \Cmd{[sub]sectionmark} commands (see section~\ref{sec:scoop}), as do the
% standard \LaTeX{} page styles. The consequence is, that if you select
% e.g., \Cmd{pagestyle\{headings\}}, the definitions of
% \Cmd{pagestyle\{fancy\}} are overridden.
% Also when you change the headers and/or footers
% while such a page style is in effect, and you then switch back to this
% page style, for
% example with \verb|\pagestyle{headings}|, they revert to the built-in
% settings. Therefore it is not advisable to change the headers or
% footers in this way, but instead define your
% own page style, as explained in section~\ref{sec:fancypagestyle}.
%
% \section{Using \pkg{extramarks}}
% \label{sec:using-extramarks}
%
% Standard \LaTeX{} has two marks: a left one and a right one. The standard
% command \cs{leftmark} gives you the last left mark on a page, and
% \cs{rightmark} gives you the first right one. These are to be used in
% the headers and footers of a page. These are derived from information
% that is given by the \cs{markboth} and \cs{markright} commands in the
% text body.
%
% \begin{function}{\firstleftmark, \lastrightmark, \firstrightmark, \lastleftmark}
% These macros give you the other combinations, where
% \cs{firstrightmark} = \cs{rightmark} and \cs{lastleftmark} = \cs{leftmark}.
% \end{function}
%
% \begin{function}{\extramarks, \extramarksleft, \extramarksright}
% \begin{syntax}
% \cs{extramarks}\marg{left-text}\marg{right-text}
% \cs{extramarksleft}\marg{left-text}\\
% \cs{extramarksright}\marg{right-text}
% \end{syntax}
%
% The command \cs{extramarks}\marg{$m_1$}\marg{$m_2$} defines two extra marks,
% similar to the standard ones by \LaTeX, where \meta{$m_1$} is the left
% mark and \meta{$m_2$} is the right mark.
%
% \label{sec:extramarks-5}
% In versions before 5.0, the \texttt{extramarks} are connected to each
% other and to the original \LaTeX{} marks; they are not independent.
% For example, if you use \cs{markboth} or \cs{markright}, this
% introduced empty \texttt{extramarks} or duplicated existing ones. This is
% also true in the other direction. This sometimes caused unwanted effects.
%
% Since version 5.0 this is no longer the case.
% Now the \texttt{extramarks} are independent of the traditional marks,
% and they can also be set independently of each other by the commands
% \cs{extramarksleft}\marg{$m_1$} and \cs{extramarksright}\marg{$m_2$}.
% \end{function}
%
% \begin{variable}{extramarks-left, extramarks-right}
% \begin{syntax}
% \texttt{extramarks-left}\\
% \texttt{extramarks-right}
% \end{syntax}
% These are the `mark classes' for the two marks.
% \end{variable}
%
% \medskip
%
% \textbf{NOTE}: The implementation of \pkg{extramarks} version 5
% only is available if your \LaTeX{} release is the
% November 2022 \LaTeX{} release or newer. It uses the new \LaTeX{}
% marks introduced in that release. These marks are described in \emph{The \LaTeX{}
% Companion, Third Edition}, section 5.3.5 (Part I). Of course you can
% also use these new marks directly, or use additional ones if you need
% more. Some examples in this manual use these.
%
% This manual contains several examples of the use of \pkg{extramarks},
% where its features are essential, but in future releases of this
% manual these examples will be rewritten to use the new \LaTeX{} marks directly.
%
% \subsubsection*{Extramarks commands to be used in the headers or footers}
%
% \begin{function}{\firstleftxmark, \firstrightxmark, \topleftxmark,
% \toprightxmark, \lastleftxmark, \lastrightxmark, \firstxmark,
% \lastxmark, \topxmark}
% \begin{flushleft}
% These commands are used to extract the marks defined by
% \cs{extramarks}\marg{$m_1$}\marg{$m_2$}, \cs{extramarksleft}\marg{$m_1$}\ and
% \cs{extramarksright}\marg{$m_2$} described above.\\
% They are used in the headers or footers, similar to the ones without
% the \texttt{x}.
% \end{flushleft}
% \end{function}
%
% If you want to keep the old behaviour of \pkg{extramarks}, you can use:
% \begin{verbatim}
% \usepackage{extramarks}[=v4]
% \end{verbatim}
% or if you have an old \LaTeX{} system where the above doesn't work
% \begin{verbatim}
% \usepackage{extramarks-v4}
% \end{verbatim}
% Please note that in that case the
% \cs{topleftxmark}, \cs{toprightxmark} and \cs{topxmark} commands may
% give you unexpected results.
%
% See sections~\ref{sec:scoop} and \ref{sec:xmarks} for more details
% about the use of the package.
%
% \newpage
% \part{Page Layout in \LaTeX}
%
% \section{Introduction}
% \label{sec:intro}
%
% A page in a \LaTeX{} document is built from various elements as shown in
% figure \ref{fig:layout}.
% \begin{figure}[htbp]
% \begin{center}
% \leavevmode
% \layout
% \vspace{1.5cm}
% \caption{Page elements. The values shown are those in effect in the current document, not the defaults.}
% \label{fig:layout}
% \end{center}
% \end{figure}
% \thispagestyle{plain}
% The body contains the main text of the document
% together with the so called floats (tables and figures).
%
% The pages are constructed by \LaTeX's output routine, which is quite
% complicated and should therefore not be modified. Some of the packages
% described in this paper contains small modifications to the output routine
% to accomplish things that cannot be done in another way. You should use
% these packages to get the desired result rather than fiddling with the
% output routine yourself.
%
% There are a number of things that you must be aware of:
% \begin{enumerate}
% \item The margins on the left are not called \cs{leftmargin}, but
% \cs{evensidemargin} (on even-numbered pages) and \cs{oddsidemargin}
% (on odd-numbered pages). In one-sided documents
% \cs{oddsidemargin} is used for either. \cs{leftmargin} is also a valid
% \LaTeX{} parameter but it has a different use (namely the indentation of
% lists).
% \item Most of the parameters should not be changed in the middle of a
% document. Some changes might work at a pagebreak. If you want to change
% the height of a single page, you can use the \cs{enlargethispage}
% command.
% \end{enumerate}
%
% The margin notes
% area contains small pieces of information created by the \cs{marginpar}
% command. On two-sided documents the margin notes appear on the left and right
% alternatively. The margin notes are not on fixed places with respect to the
% paper but at approximately the same height as the paragraph in which they
% appear. Due to the algorithm used to decide the placement of margin notes,
% in a two-sided document unfortunately
% they may appear on the wrong side if they are close
% to a page break.
% If you want to put information on fixed places in the margins you may use
% the technique described in sections \ref{sec:movie} and \ref{sec:thumb}.
%
% The first part of this paper describes how to change the header and footer
% areas. The last part describes how to get your floats at the desired place.
%
% \section{Page headers and footers}
%
% The page headers and footers in \LaTeX{} are defined by the
% \cs{pagestyle} and \cs{pagenumbering} commands. \cs{pagestyle}
% defines the general contents of the headers and footers (e.g., where the
% page number will be printed), while
% \cs{pagenumbering} defines the format of the page number.
% \LaTeX{} has four standard page styles:
%
% \begin{center}
% \noindent
% \begin{tabular}{>{\tt}lp{9cm}}
% \toprule
% empty & no headers or footers \\
% plain & no header, footer contains page number centered \\
% headings & no footer, header contains name of chapter/section and/or
% subsection and page number \\
% myheadings & no footer, header contains page number and user
% supplied information \\
% \bottomrule
% \end{tabular}
% \end{center}
%
% Although these are useful styles, they are quite limited. Additional page
% styles can be defined by defining commands of the form \cs{ps@xxx}. This
% command is executed when a \Cmd{pagestyle\{xxx\}} is given in the document.
% The \cs{ps@xxx} command should define the following
% commands for the contents of the headers and footers:
%
% \begin{center}
% \noindent
% \begin{tabular}{lp{9cm}}
% \toprule
% \cs{@oddhead} & header on odd numbered pages in two-sided documents
% (on all pages in one-sided) \\
% \cs{@evenhead} & header on even numbered pages in two-sided documents \\
% \cs{@oddfoot} & footer on odd numbered pages in two-sided documents
% (on all pages in one-sided) \\
% \cs{@evenfoot} & footer on even numbered pages in two-sided documents \\
% \bottomrule
% \end{tabular}
% \end{center}
%
% These are not user commands, but rather ``variables'' that are used by
% \LaTeX's output routine.
% As the command names contain the character `\texttt{@}', they should
% be defined in a package file, or otherwise be sandwiched between the commands
% \cs{makeatletter} and \cs{makeatother}.
%
% The \cs{pagenumbering} command defines the layout of the page number. It
% has a parameter from the following list:
%
% \begin{center}
% \begin{tabular}{>{\tt}ll}
% \toprule
% arabic & arabic numerals \\
% roman & lower case roman numerals \\
% Roman & upper case roman numerals \\
% alph & lower case letter \\
% Alph & upper case letter \\
% \bottomrule
% \end{tabular}
% \end{center}
%
% The \Cmd{pagenumbering\{xxx\}} defines the command \cs{thepage} to be the
% expansion of the page number in the given notation \texttt{xxx}.
% The page style command
% then would include \cs{thepage} in the appropriate place. Additionally
% the \cs{pagenumbering} command resets the page number to~1.
% The \cs{pagestyle} and \cs{pagenumbering} apply to the page that is
% being constructed, so they should be used at a location where it is clear
% to what page they apply (see section \ref{sec:change}).
%
%
% \section{What is \pkg{fancyhdr}}
%
% The \pkg{fancyhdr} macro package allows you to customize
% in \LaTeX{} your page headers and footers in an easy way. You can
% define:
% \begin{itemize}
% \item three-part headers and footers
% \item decorative lines in headers and footers
% \item headers and footers wider than the width of the text
% \item multi-line headers and footers
% \item separate headers and footers for even and odd pages
% \item different headers and footers for chapter pages
% \item different headers and footer on pages with floats
% \end{itemize}
%
% Of course, you also have complete control over fonts, uppercase
% and lowercase displays, etc.
%
% \section{Simple use of \pkg{fancyhdr}} To use this package
% install it in a place where \LaTeX{} can find it (see
% section~\ref{sec:installation})\footnote{In most modern \TeX{}
% installation the package is already included.}, and include in the preamble of your document
% the commands:
%
% \PSindex{fancy}
% \begin{code}
% \usepackage{fancyhdr}
% \pagestyle{fancy}
% \end{code}
%
% We can visualize the page layout we can create with \pkg{fancyhdr}
% as follows:
%
% \begin{fblock}
% \noindent\makebox[\textwidth]{LeftHeader\hfill
% CenteredHeader\hfill RightHeader}\showrule
% \noindent\makebox[\textwidth]{\hfill page body\hfill}\\[\baselineskip]
% \noindent\makebox[\textwidth]{\hrulefill}
% \noindent\makebox[\textwidth]{LeftFooter\hfill
% CenteredFooter\hfill RightFooter}
% \end{fblock}
%
% The LeftHeader and LeftFooter are left justified; the
% CenteredHeader and CenteredFooter are centered; the
% RightHeader and RightFooter are right justified.
%
% We define each of the six ``fields'' and the two decorative lines
% separately.
%
% \section{A simple example}
% \label{sec:simple}
%
% K. Grant is writing a report to Dean
% A. Smith, on ``The performance of new graduates'' with the
% following page layout:
%
% \begin{fblock}
% \noindent\makebox[\textwidth]{\hfill\textbf{The performance of new
% graduates}}\showrule
% \noindent\makebox[\textwidth]{\hfill page body\hfill}\\[\baselineskip]
% \noindent\makebox[\textwidth]{\rule{\textwidth}{2pt}}
% \noindent\makebox[\textwidth]{From: K. Grant\phantom{3}\hfill
% To: Dean A. Smith\hfill \phantom{From: K. Grant}3}
% \end{fblock}
%
% \noindent where ``3'' is the page number. The title: ``The
% performance of new graduates'' is bold. The rule above the footer is a
% bit thicker (2pt).
%
% This is accomplished by these commands following
% \Cmd{pagestyle\{fancy\}}\footnote{Note that version 1 of \pkg{fancyheadings}
% used the \cs{setlength} command to change the \texttt{\bs...rulewidth} parameters.}:
% \CmdIndex{fancyhead}
% \CmdIndex{fancyfoot}
% \CmdIndex{headrulewidth}
% \CmdIndex{footrulewidth}
% \Example{1}
% \begin{example}
% \fancyhead[L,C]{}
% \fancyhead[R]{\textbf{The performance of new graduates}}
% \fancyfoot[L]{From: K. Grant}
% \fancyfoot[C]{To: Dean A. Smith}
% \fancyfoot[R]{\thepage}
% \renewcommand{\headrulewidth}{0.4pt}
% \renewcommand{\footrulewidth}{2pt}
% \end{example}
% (The \cs{thepage} macro displays the current page number.
% \cs{textbf} puts its argument in bold face.)