11

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?

Umz
  • 664

2 Answers2

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} 
karlkoeller
  • 124,410
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

egreg
  • 1,121,712