3

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

 ...
\backmatter 
\appendix
\chpater{Appendix A}
  ...
\chpater{Appendix B}
  ...

Using fancyhdr:

\usepackage[]{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead{} 

\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

6
  • 4
    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, 2013 at 11:27
  • 2
    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, 2013 at 11:35
  • 2
    Is the command spelled \chpater on purpose?
    – T. Verron
    Feb 4, 2013 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, 2013 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, 2013 at 19:15

1 Answer 1

5

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

\documentclass{book}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead{} 

\makeatletter
\renewcommand{\sectionmark}[1]{\markright{\thesection~~#1}}
\renewcommand{\chaptermark}[1]{\markboth{\if@mainmatter\chaptername\ \thechapter~~\fi#1}{}}
\makeatother

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

\usepackage{lipsum}

\begin{document}

\backmatter

\chapter{Appendix~A}

\lipsum[1-12]

\end{document}​

You must log in to answer this question.

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