TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The document is book class and the Appendix is added by:

\chpater{Appendix A}
\chpater{Appendix B}

Using fancyhdr:


\renewcommand{\sectionmark}[1]{\markright{\thesection ~ \ #1}}
\renewcommand{\chaptermark}[1]{\markboth{ \chaptername\ \thechapter ~ \ #1}{}} 

%head setting
\fancyhead[LE]{\textcolor{black} {\thepage}}
\fancyhead[RE]{\textcolor{black} {\itshape \nouppercase  \leftmark}}%higher level \scshape  \MakeUppercase
\fancyhead[LO]{\textcolor{black} {\itshape \nouppercase  \rightmark}} 
\fancyhead[RO]{\textcolor{black} {\thepage}}   %odd page

The chapter-mark is expected to be re-defined like Chapter 2 State of the art, However, the \chaptername will appear in Appendix heading.

So how to solve this issue?

enter image description here

share|improve this question
In the book class, \backmatter will remove the "Chapter" (or "Appendix") prefix. If the question is still relevant, please add a minimal working example (MWE). – lockstep Feb 4 '13 at 11:27
This is not a bug. You're surely defining your personalized headings, so it's necessary to know how you do it. – egreg Feb 4 '13 at 11:35
Is the command spelled \chpater on purpose? – T. Verron Feb 4 '13 at 12:13
\renewcommand{\sectionmark}[1]{\markright{\thesection ~ \ #1}} and \renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter ~ \ #1}{}} used to define section and chapter mark. However, if I comment these commands, the Appendix heading becomes Appendix. Appendix A. – KOF Feb 4 '13 at 19:07
@KOF The code in the question and in the last comment don't agree. Which one are you using? – egreg Feb 4 '13 at 19:15
up vote 3 down vote accepted

Add a test for the mainmatter switch to the definition of \chaptermark.



\renewcommand{\chaptermark}[1]{\markboth{\if@mainmatter\chaptername\ \thechapter~~\fi#1}{}}

\fancyhead[RE]{\itshape\nouppercase  \leftmark}
\fancyhead[LO]{\itshape\nouppercase  \rightmark}






share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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