I'm currently using fancy for my page header everything is Ok but I just still need to also add the number of the chapter to the header.

This is my code:



  • Please be a bit more specific as to where (left, right, center?) and in which format you want the chapter number to appear.
    – Mico
    Commented Jun 7, 2013 at 21:01
  • @Mico everything in my code is so far ok. The name of the chapter is in the middle and the number of the page changes from left to right. I just need the number of the chapter to appear.
    – abdu
    Commented Jun 7, 2013 at 21:20

1 Answer 1


Here's how you can do it. I left only what's strictly necessary for the example (of course you don't need kantlipsum).

Note the setting of \headheight and remember to issue \backmatter before the bibliography.

\usepackage[T1]{fontenc} % recommended for German


\fancyhead[C]{\ifnum\value{chapter}>0 \thechapter.\ \fi\leftmark}
\setlength{\headheight}{14.5pt} % very important!

\usepackage{kantlipsum} % just for this example

\chapter{Some title}

enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .