I'm new here and I'm into headers with package fancyhdr
.
My request is: I want on even pages, CHAPTER NUMBER, in the odd pages CHAPTERTITLE. So in a way like: [E] \chaptername \thechapter
[O] \chaptermark
I face some issues with \renewcommand
on \leftmark
and \rightmark
that I cant't edit both entry simoultaneously. Do you have any suggestions? Thanks
\documentclass[a4paper,12pt,twoside,titlepage,openright,fleqn,onecolumn,draft]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=2.5cm,right=2.5cm, bindingoffset=5mm]{geometry}
\usepackage{lastpage}
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\fancyhf{}
\renewcommand\chaptermark[1]{%
\markboth{\MakeUppercase{\chaptername\ \thechapter}}{#1}}
\fancyhead[RE]{\slshape \leftmark}
\fancyhead[LO]{\slshape \leftmark}
\fancyhead[LE,RO]{\slshape \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\usepackage{blindtext}
\begin{document}
\chapter{CCC1}
\Blindtext\Blindtext\Blindtext
\section{SS1}
\Blindtext\Blindtext\Blindtext
\chapter{CCC2}
\Blindtext\Blindtext\Blindtext
\section{SS2}
\Blindtext\Blindtext\Blindtext
\end{document}
Best Answer
the answer provided by Christian Hupfer solves, in a specific way, the issue. But when I've added nomenclature
nomencl
and bibliographybibtex
, headings become painful. So I discovered\usepackage{titleps}
, instead offancyhdr
that provide simple solution: set upplain
andmain
pagestyle and other styles builded up eg. for nomenclature and bibliography , changing pagestyle whenever you want.