[Tex/LaTex] Writing thesis using fancyhdr – problems with section title

fancyhdrheader-footer

I am writing my thesis using LaTeX with a provided thesis document class, which uses fancyhdr. My problem is that both the chapter and section titles appear automatically in the header, writing over each other.
Ideally i would like to remove the section titles from the header and leave the chapter headers, but I can't find how to do this. How can this be done?

Best Answer

The fancyhdr package allows to modify the document headers using any one of the following commands:

  • \lhead{<text>}: Left header
  • \chead{<text>}: Center header
  • \rhead{<text>}: Right header
  • \fancyhead[<pos>]{<text>}: Header at <pos>={L,C,R} + {E,O} for left L, center C and right R headers on even E and odd O pages.

The last (advanced) command is more commonly used since it allows more flexibility via the optional [ ] parameters.

Assuming your thesis documentclass may have the following fancy header style defined (taken directly from the fancyhdr documentation:

\fancyhead[LE,RO]{\slshape \rightmark}
\fancyhead[LO,RE]{\slshape \leftmark}

which would print something like:

Traditional fancyhdr styles

In order to remove the section mark, clear the \rightmark by

\fancyhead[LE,RO]{}% Remove headers on Left Even and Right Odd pages

In general, find the side & page combination (resulting in a combination like the LE,RO choice above), and clear that specific header.

Related Question