fancyhdr for table of contents, list of figures and bibliography

1,657 views
Skip to first unread message

DIN1587

unread,
Dec 15, 2011, 6:06:08 PM12/15/11
to LaTeX Users Group
Hi!
I'm putting together a larger document which contains a 'table of
contents' (generated with \tableofcontents), a 'list of
figures' (generated with \listoffigures) and a bibliography using
BibTex.
The headers and footers of the double-page layout are defined using
the fancyheader package:

\pagestyle{fancy}
\fancyhead{}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter \ #1}{}}
\fancyhead[LE,RO]{\textsc{\rightmark}}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}

Unfortunately this layout works only partially in the sections 'table
of contents' and 'list of figures'. Both show the chapter mark (that
is good) but the '\textsc' command is ignored - it's just capital
letters.

For the rest of the text I use:

\pagestyle{fancy}
\fancyhead{}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter \ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection \ #1}{}}
\fancyhead[LE,RO]{\textsc{\rightmark}}
\fancyhead[LO,RE]{\textsc{\leftmark}}
\renewcommand{\headrulewidth}{0.4pt}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}

This works fine until I get to the bibliography. Apparently in that
section both \thechapter and \thesection are 'bibliography'. A header
displaying BIBLIOGRAPHY both left and right looks rather weird. Again,
the '\textsc' is ignored. If I put in a \pagestyle{fancy} command
(like the one specified for the table of contents and list of figures)
just before including the bibliography, the headers in the
bibliography are changed - unfortunately the headers in the chapter
prior to the bibliography as well (a \clearpage command place before
does not change this).

Can anyone point in a direction for me to look in? Thanks a lot!

Peter Flynn

unread,
Dec 15, 2011, 6:21:44 PM12/15/11
to latexus...@googlegroups.com
On Thu, Dec 15, 2011 at 11:06 PM, DIN1587 <277...@gmail.com> wrote:
Hi!
I'm putting together a larger document which contains a 'table of
contents' (generated with \tableofcontents), a 'list of
figures' (generated with \listoffigures) and a bibliography using
BibTex.
The headers and footers of the double-page layout are defined using
the fancyheader package:

\pagestyle{fancy}
\fancyhead{}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter \ #1}{}}
\fancyhead[LE,RO]{\textsc{\rightmark}}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}

Unfortunately this layout works only partially in the sections 'table
of contents' and 'list of figures'. Both show the chapter mark (that
is good) but the '\textsc' command is ignored - it's just capital
letters.

I think the start-pages of the ToC and LoF don't use type 'fancy', they switch to 'plain' or something. Check the fancyhdr documentation for how to use \fancyplain to redefine this.
 

For the rest of the text I use:

\pagestyle{fancy}
\fancyhead{}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter \ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection \ #1}{}}
\fancyhead[LE,RO]{\textsc{\rightmark}}
\fancyhead[LO,RE]{\textsc{\leftmark}}
\renewcommand{\headrulewidth}{0.4pt}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}

This works fine until I get to the bibliography. Apparently in that
section both \thechapter and \thesection are 'bibliography'. A header
displaying BIBLIOGRAPHY both left and right looks rather weird. Again,
the '\textsc' is ignored.

Same problem, I suspect.
 
If I put in a \pagestyle{fancy} command
(like the one specified for the table of contents and list of figures)
just before including the bibliography, the headers in the
bibliography are changed - unfortunately the headers in the chapter
prior to the bibliography as well (a \clearpage command place before
does not change this).

Can anyone point in a direction for me to look in? Thanks a lot!

The fancyhdr documentation is your best explanation.

///Peter
Reply all
Reply to author
Forward
0 new messages