I am writing my thesis using the template obtained from http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/ThesisStyle/ with a bit of modification to suit my needs.

I would like to have the left header to display the chapter title if there is no other sections in the page, display section title if there is a section there.

If that section is longer than 1 page (2 pages and above), I would like the header to display the section title and chapter title alternately over the pages that cover that particular section.

I use the code

{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
{\markright{\MakeUppercase{\thesection.\ #1}}}
\fancyhead[RO,LE]{\fontsize{10}{11}\selectfont \thepage}
\fancyhead[LO]{\fontseries{b}\fontsize{10}{11}\selectfont \leftmark}
\fancyhead[RE]{\fontseries{b}\fontsize{10}{11}\selectfont \leftmark} 

but the header displays only the section title on every page

How can I do it? Any code provided would be much appreciated.


I've always used fancyhdr which allows you to specify things like the chapter title or section title.


You can specify what you want in those sections with various commands.


These commands should put the chapter title centered on the odd pages and the section title centered on the even pages. "O" and "E" refer to odd and even and "C" refers to center. You can also use "L" and "R" for left and right.

This solution will give you "CHAPTER 1. WHATEVER YOUR CHAPTER TITLE IS" in the header. There is probably a way to remove the "CHAPTER 1." portion of it if you wish, but I don't know how.

You can also specify what goes in the footer via similar commands.


Are also options (and work for lhead, rhead, lfoot, and rfoot as well).

  • i know that i can manipulate the header with all these code but i am not getting what i want as posted
    – user25196
    Feb 19 '13 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.