TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the code trying to have the header to display chapter and section alternately

{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
{\markright{\MakeUppercase{\thesection.\ #1}}}
\fancyhead[R]{\fontsize{10}{11}\selectfont \thepage}

but instead of displaying the headers based on the value of pages, I would like to have the header to display section first on the header after every new chapter

My template was obtained from http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/ThesisStyle/

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

share|improve this question

closed as unclear what you're asking by lockstep, Charles Stewart, Claudio Fiandrino, Stefan Kottwitz Jul 17 '13 at 6:45

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

You're getting the chapter titles, I believe. Can you add a minimal preamble, to show the options you're using with the class? – egreg Feb 19 '13 at 18:10
The section mark is obtained with \rightmark, while your code only uses \leftmark. Also, note that the above code seem to be made for twosided output (\documentclass[twoside]{...}): RO means "right on odd-numbered pages, LE left on even-numbered pages, LO left on odd-numbered pages and RE right on even-numbered pages. – Xavier Feb 19 '13 at 23:43
@Xavier how can I change the code for onesided output? I just realised that the document is defined for onesided output. – user25196 Feb 21 '13 at 11:30
It really depends on what you are trying to achieve. The fancyhdr manual gives a lot of examples with code. Also, if you want to alternate page styles, you should use twoside as a class option, because that it really what you are designing (even if you don't print as a two-sided document)! Without it, you will basically try to hack yourself a two-sided output based on a one-sided class, with extra bugs (ever thought on how to handle new chapter pages for example?)... – Xavier Feb 21 '13 at 15:56