Hi there,
\chaptermark
is used by
\chpter
to set the mark(s) for this chapter. If you call it from within
\fancyhead
, you're overwriting the current mark(s).
Use
\leftmark
within
\fancyhead
, instead.
Now, the page header on odd pages contains the chapter title (plus chapter's number & name), but not on the first page of a chapter: here, page style plain is used by default, because it lets the eye catch on a new chapter start easier, if something is missing (page header) on one page while leafing through the pages.
If you really want to change that, use
\fancypagestyle{plain}{}
.
Now you can use your redefinition of
\chaptermark
to get rid of chapter's number & name in the page header.
Put it all together:
Code: Select all
\documentclass[12pt,a4paper]{book}
\usepackage{polyglossia}
\usepackage{blindtext}
\setdefaultlanguage{english}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{\thepage}
\fancyhead[CE]{Title of the book}
%\fancyhead[CO]{\chaptermark}<-- \chaptermark has no place here. It is used to *set* the mark(s) for a chapter, not to get it.
\fancyhead[CO]{\leftmark}
\fancyfoot{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{}%<-- only if you really want to have the first page of a chapter showing the same stuff like the chapter's title just below it...
\begin{document}
\chapter{Title of the chapter}
\blindtext[12]
\end{document}
KR
Rainer