4

I am using a modified BYU Thesis Template for my thesis.

I want to be able to change the page header for the the appendices to read "Appendix A Data & Display" instead of "Chapter A Data & Display" where "Data & Display" is the name of one of my appendices.

Here is the relevant code from the class file:

% The fancyhdr package allows you to easily customize the page header.
% The settings below produce a nice, well separated header.
\usepackage{fancyhdr}
  \fancyhead{}
  \fancyhead[LO]{\slshape \rightmark}
  \fancyhead[RO,LE]{\textbf{\thepage}}
  \fancyhead[RE]{\slshape \leftmark}
  \fancyfoot{}
  \pagestyle{fancy}
  \renewcommand{\chaptermark}[1]{\markboth{\chaptername \ \thechapter \ \ #1}{}}
  \renewcommand{\sectionmark}[1]{\markright{\thesection \ \ #1}}

I suppose I should be using an if statement, but my appendices (in their individual tex files) start with \chapter{Data \& Display}

4

The line

\renewcommand{\chaptermark}[1]{\markboth{\chaptername \ \thechapter \ \ #1}{}}

should be

\renewcommand{\chaptermark}[1]{\markboth{\@chapapp \ \thechapter \ \ #1}{}}

to deal with the automatic change of name from "Cahpter" to "Appendix". Modify the page style in the preamble of your document:

\documentclass{BYUPhys}
\usepackage{lipsum}% just to generate text for the example

\makeatletter
\usepackage{fancyhdr}
  \fancyhead{}
  \fancyhead[LO]{\slshape \rightmark}
  \fancyhead[RO,LE]{\textbf{\thepage}}
  \fancyhead[RE]{\slshape \leftmark}
  \fancyfoot{}
  \pagestyle{fancy}
  \renewcommand{\chaptermark}[1]{\markboth{\@chapapp \ \thechapter \ \ #1}{}}
  \renewcommand{\sectionmark}[1]{\markright{\thesection \ \ #1}}
\makeatother

\begin{document}

\chapter{Regular Chapter}
\lipsum[1-40]
\appendix
\chapter{Appendix One}
\lipsum[1-40]

\end{document}
  • If my documnent is report class, how can I use your code? I want to left is section of each chapter. – minthao_2011 Feb 15 '14 at 5:37

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.