|
Document 488
The LaTeX fancyhdr package
Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific
Word
The fancyhdr package is a page layout customizing package that replaces
the fancyheadings package. It handles footers and headers efficiently, but
also works with placement of floats. With the package, you can define headers
and footers with multiple parts and on multiple lines,
specify header and footer information,
place rules in headers and footers, and use a header
and footer width different from that of the text. Additionally, with the
package you can use different headers and footers for even and odd pages,
first pages of chapters, and pages containing floats. You can
move the location of page numbers,
increase the space used for headers and footers, and
produce dictionary-style headers reflecting the first and last words on a
page. You can also suppress headers and footers on selected pages.
Fancyhdr also provides control over fonts and upper- and lowercase
letters.
No package options are available. However, the package uses a simplified
syntax for entering commands.
How to define the content of headers and footers
-
Add the fancyhdr package to your document.
-
Specify a new header and footer setup in the document preamble:
-
From the Typeset menu, choose
Preamble.
-
Click the mouse in the entry area.
-
On a new line, type \pagestyle{fancy}.
-
Define the content of the header:
-
On a new line, type \lhead{text} where
text is the information you want left-justified in
the header.
-
On a new line, type \chead{text} where
text is the information you want centered in the
header.
-
On a new line, type \rhead{text} where
text is the information you want right-justified
in the header.
-
If you want a rule under the header, type
\renewcommand{\headrulewidth}{x} where x is
the point size of the rule you want.
Note
The text argument can contain TeX commands.
-
Define the content of the footer:
-
On a new line, type \lfoot{text} where
text is the information you want left-justified in
the footer.
-
On a new line, type \cfoot{text} where
text is the information you want centered in the
footer.
-
On a new line, type \rfoot{text} where
text is the information you want right-justified
in the footer.
-
If you want a rule over the footer, type
\renewcommand{\footrulewidth}{x} where x is the point size
of the rule you want.
Note
The text argument can contain TeX commands.
-
Choose OK
How to define the content of different headers and footers
for even and odd pages
Defining different headers and footers for double-sided documents increases
the definitions, some for even (left) and others for odd (right) pages. You
can occasionally combine definitions in the same command by specifying when
they should appear. The package uses these settings:
Setting |
Prints on |
E |
Even page |
O |
Odd page |
L |
Left |
C |
Center |
R |
Right |
H |
Header |
F |
Footer |
-
Add the fancyhdr package to your document.
-
Specify a new header and footer setup in the document preamble:
-
From the Typeset menu, choose
Preamble.
-
Click the mouse in the entry area.
-
On a new line, type \pagestyle{fancy}.
-
On a new line, type \fancyhf{} to clear all fields
in the header and footer.
-
Specify the header:
-
On a new line, type \fancyhead[location]{text}
where location specifies the page and field of the
header and text specifies the information you want
to appear.
For example, the command \fancyhead[LE,RO]{\thepage}
places the page number in the left field of the header on even (left) pages
and in the right field of the header on odd (right) pages.
-
Repeat step a as needed to specify the header fields on both even and odd
pages.
-
Specify the footer:
-
On a new line, type \fancyfoot[location]{text}
where location specifies the page and field of the
footer and text specifies the information you want
to appear.
-
Repeat step a as needed to specify the footer fields on both even and odd
pages.
-
Choose OK.
The package documentation contains complete instructions and useful diagrams
of LaTeX page layout elements. The installation program places this package in
the TCITeX/TeX/LaTeX/contrib/fancyhdr directory.
Last revised 06/13/06
This document was created with Scientific WorkPlace.
|