I am using fancyhdr in my report and a selected font. The page number font is correct on the pages when a new chapter starts, but it is reverts to some other font on the other pages. I think these problematic pages are the ones defined by fancy? I cannot understand why fancy gets the header font correct, but messes up with the footer page number font. I have searched a lot but cannot find the solution. Please see my MWE:
\documentclass[a4paper,12pt]{report}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{fancyhdr}
\begin{document}
\pagestyle{fancy}
\chapter{Test}
The page number font for the page where a chapter starts is correct.
\newpage
\section{Wrong font}
The page number font on this page is wrong.
\end{document}
Am I defining my document font correctly? If so, how can I fix the page numbering font for my fancy pages so that they are the same as the document font?
This problem occurs in a large report, so if there is a solution that is unlikely to clash with anything else it would be better.
plain
page style as it is a chapter title page. By defaultfancyhdr
does not touchplain
unless you explicitly as it to. Just for fun, I switched to thememoir
class (give it theopenany
class option and it will behave likereport
), it has its own build in header/footer interface. Inmemoir
there is no issues with the fonts.fancyhdr
souece you'll find the problem, the code actually says\fancyfoot[c]{\rmfamily\thepage}
as the default footer for thefancy
style (the\rmfamily
overwrites your setting). You'd probably have to tellfancyhdr
what footer you want. That would be described in thefancyhdr
manual.