I'm trying to compile a document with multiple chapters and an appendix but run into problems with the fancyhdr
package. After compilation, I do not get the desired effect of \chaptername
appearing at the right place.
Page 5 marks the actual start of the \chapter{Dummy test}
A minimum working example that reproduces my issue is below [compiled with xelatex
]:
\documentclass[11pt,twoside,openright]{report}
\usepackage{appendix}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LO,RE]{\chaptername\ \thechapter}
\fancyhead[RO,LE]{\thepage}
\fancyfoot{}
\begin{document}
\chapter{Sample}
\section{Introduction}
\lipsum[1-10]
\clearpage
\begin{appendices}
\renewcommand\chaptername{Appendix}
\chapter{Dummy test}
\section{Introduction}
\lipsum[1-3]
\end{appendices}
\end{document}
I am aware of similar questions, such as chapter-heading-appearing-in-appendix and fancyheader-and-appendix, but neither solves my issue.