10

I am using \fancyhdr package for the headings and report as a document class samplecode is given below

\documentclass[a4paper,11pt]{report} 
\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}


\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\fancyhf{}
\fancyhead[LE,LO]{\slshape \leftmark}
\rhead{\thepage}
\cfoot{}

\begin{document}
\pagenumbering{arabic}

\input{chap_01}
\input{chap_02}
\input{chap_03}

\begin{appendices}

\input{Appendix_01}
\end{appendices}
\end{document}

Now everything seems to be working but on the appendix page i get: enter image description here

where as instead of chapter i would like 'Appendix A. Parameter Definition'.

Suggestions?

15

You can simply put the line

\renewcommand\chaptername{Appendix}

just after the line

\begin{appendices}

enter image description here

Sample document:

\documentclass[a4paper,11pt]{report}
\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}


\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\fancyhf{}
\fancyhead[LE,LO]{\slshape \leftmark}
\rhead{\thepage}
\cfoot{}

\begin{document}
\pagenumbering{arabic}

\begin{appendices}

\renewcommand\chaptername{Appendix}

\chapter{Parameter Definition}
\newpage
\setcounter{page}{35}
some text
\end{appendices}
\end{document} 
  • but shouldn't that be part of the appendices routine? – barbara beeton Dec 23 '13 at 20:13
  • @barbarabeeton If the OP didn't change the meaning of \chaptermark this would have been automatic. – karlkoeller Dec 23 '13 at 20:19
  • aha! i spaced through that. thanks for pointing it out. – barbara beeton Dec 23 '13 at 20:21
8

LaTeX already has a method for changing between \chaptername and \appendixname; the command \@chapapp usually expands to \chaptername but is redefined to mean \appendixname after \appendix.

I have removed from your example something that's not needed.

\documentclass[a4paper,11pt]{report}

\usepackage{kantlipsum} % just for the example

\usepackage[toc,page]{appendix}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\slshape \leftmark}
\fancyhead[R]{\thepage}
\makeatletter % necessary for using \@chapapp
\renewcommand{\chaptermark}[1]{%
  \markboth{\@chapapp\ \thechapter.\ #1}{}}
\makeatother

\begin{document}
\pagenumbering{arabic}

\chapter{One}
\kant

\chapter{Two}
\kant


\begin{appendices}

\chapter{Again}
\kant

\end{appendices}
\end{document}

enter image description here

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.