I'm using fancydr
like this:
\usepackage{titlesec} % Normal chapter titles
\titleformat{\chapter}{\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\emph{\leftmark}}
\rhead{\nouppercase{\emph{\rightmark}}}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\space#1}{}}
\setlength{\headheight}{15pt}
This doesn't work well with chapter*{}
, as it leaves the last chapter's details to the header.
e.g. I have
\chapter{Conclusions and future directions}
\input{./tex/conclusions}
\chapter*{Summary}
\input{./tex/summary}
\addcontentsline{toc}{chapter}{Summary}
Then the pages in summary show Conclusions and future directions
in their header. How could I make fancyhdr
work with chapter*
? and is there a possibility to disable the fancyhdr
for some pages?
Best Answer
You should define
\chaptermark
in a better way:so “0.” will not be added when the chapter number is zero (that is, for the chapters before the first).
For the conclusion, use
Notice the different order, because you want to execute those commands at the start of the chapter text, not at the end.