Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
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 '13 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 '13 at 11:35
1  
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
show 1 more comment

1 Answer

up vote 2 down vote accepted

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}​
share|improve this answer
add comment

Your Answer

 
discard

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.