## LaTeX forum ⇒ Page Layout ⇒ fancyhdr: \chaptermark empty Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Emanuelo
Posts: 2
Joined: Sun Apr 22, 2018 9:57 am

### fancyhdr: \chaptermark empty  Topic is solved

Hi! I'm sorry if my question was asked one thousand times, but I did not found the solution by myself. In a "book" class, I want that the odd pages display in the head the name of the chapter, but not its number, nor the \chaptername.

However, if I type :

And if I add enough text to reach the second odd page (the first one being "plain", as usual), after compilation (with XeLaTeX) I just see the page number shifted to le left, and that's all. No chapter title at all is displayed. I tried things like add :
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
but nothing changes. What do I wrong?

Thank you!

Tags:

rais
Posts: 153
Joined: Sun Nov 16, 2014 8:51 pm
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:

KR
Rainer

Emanuelo
Posts: 2
Joined: Sun Apr 22, 2018 9:57 am
Thank you, it works! I did not understood what \chaptermark was and what its relation with \leftmark was. Now I do.

PS: No, I do not want to change the style for the first odd pages ^^.