2

I am having some trouble combining fancyhdr with my Appendix. There's two problems. The first is that the header doesn't show the correct information on the page just before the Appendix (the last page of the main text).

It should look something like this:

correct header

But what I get is:

bad header

The second is that the header in the Appendix shows:

appendix header

And I would like 'Chapter' to be 'Appendix'. I've tried the suggestions here, but those don't seem to work. The relevant code:

\documentclass[11pt]{report}

\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}

\usepackage{parskip}
\setlength\parindent{0pt}
\setlength{\headheight}{15pt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{Entanglement Entropy}
\fancyhead[C]{Chapter \thechapter}
\fancyhead[R]{Section \thesection}

\renewcommand{\headrulewidth}{0.4pt}

\begin{document}

\chapter{title}
\input{chapters/chapter05}

\appendix
\chapter{another title}
\input{chapters/appendix}

\printbibliography

\end{document}
1
  • Please edit your example so that it compiles. Remember also that we do not have your files!
    – cfr
    Commented Jun 15, 2014 at 16:30

1 Answer 1

2

The first issue is that the switch to the appendices is affecting the header on the final page of the last chapter. To fix that, you can use \clearpage beforehand.

The second is that you have told TeX to use Chapter \thechapter for the central header and so it will keep doing so. One way to fix this is to tell it what you want it to do instead. I've just redefined the central header at the appropriate point which is probably the simplest solution.

\documentclass[11pt]{report}

\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}
\usepackage{biblatex,kantlipsum}

\usepackage{parskip}
\setlength\parindent{0pt}
\setlength{\headheight}{15pt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{Entanglement Entropy}
\fancyhead[C]{Chapter \thechapter}
\fancyhead[R]{Section \thesection}

\renewcommand{\headrulewidth}{0.4pt}

\begin{document}

  \chapter{title}
  \kant[1-6]
  \clearpage

  \appendix
  \fancyhead[C]{Appendix \thechapter}
  \chapter{another title}
  \kant[7-10]

  \printbibliography

\end{document}

Last page before appendix Appendix header

You must log in to answer this question.

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