I am trying to use fancyhdr
to set the part no. and name on my left pages and chapter no and name on the right pages.
My document is
\documentclass[11pt,a4paper,twoside,openright,bibliography=totocnumbered]{scrbook}
I use the following code (which looks wrong and doesn't work too well):
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\renewcommand{\partmark}[1]{\markboth%
{\color[gray]{.0}\thepart. #1}{}}
\renewcommand{\chaptermark}[1]{\markright%
{\color[gray]{.0}\thechapter.\ #1}}
The effect is: I get the part alright but the chapter only makes it to the head as long as I haven't used a section. Once there's a section in my text, it seems to overrule the chapter.
Best Answer
You have to redefine
\sectionmark
to do nothing (and also to clear the fields):However, I would put formatting instructions into
\fancyhead
and not in the\markright
and\markboth
commands: