I want to use this style in my fancy header:

Number of Chapter - Title of Chapter

i.e: 1 - Chapter Name

I use this command, but I view only the title of chapter.


How can I add the number of chapter ?

  • 2
    Please don't post fragments only.
    – user31729
    Dec 23, 2015 at 9:45
  • 1
    If "#1" is "1 - Chapter Name", it should be OK. Could you please post a minimal working example (MWE)?
    – Stephen
    Dec 23, 2015 at 9:52
  • @Stephen: It depends on the documentclass what #1 might be, so you're right: we need a MWE
    – user31729
    Dec 23, 2015 at 9:53
  • I don't understand why the \leftmark should appear in the center of the head?
    – user31729
    Dec 23, 2015 at 9:55
  • 2
    @ChristianHupfer: Well, you are right, my comment was too short. What I wanted to say was: We do not know when/where/how \chaptermark is used with which argument, thus without MWE it is not clear where (or whether) to add \thechapter{} - (or to change something else).
    – Stephen
    Dec 23, 2015 at 9:58

2 Answers 2


A trial: I assume that the left mark should be empty (or it should use another style at least).

The \chaptermark{} must be redefined at begin of the \document body, otherwise the standard definition of \@chapapp.~#1 etc. is used.

Please note that the chapter start page is using another pagestyle, i.e. plain.



  \markboth {\MakeUppercase{%
      \ifnum \c@secnumdepth >\m@ne
      \bfseries\thechapter~--~ %



\chapter{First one}
\section{A section}
\chapter{Next chapter}

resulting output from compiling the given code


titleps is also a viable option for setting titles of sectional units in the header.

enter image description here


  \sethead{}      % left
             \bfseries \thechapter~--~\chaptertitle
          \fi\fi} % center
          {}      % right




\sloppy% Just for this example
\chapter{First chapter}\lipsum[1-10]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[1-10]
\section{Third section}\lipsum[1-10]
\section{Last section}\lipsum[1-10]
\chapter{Second chapter}\lipsum[11-20]
\section{First section}\lipsum[11-20]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[11-20]
\section{Last section}\lipsum[11-20]
\chapter{Third chapter}\lipsum[21-30]
\section{First section}\lipsum[21-30]
\section{Second section}\lipsum[21-30]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[21-30]
\chapter{Last chapter}\lipsum[31-40]
\section{First section}\lipsum[31-40]
\section{Second section}\lipsum[31-40]
\section{Third section}\lipsum[31-40]
\section{Last section}\lipsum[31-40]


It's good to review the quick guide as it show-cases the difference in input between fancyhdr and titleps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.