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:

The page number font for the page where a chapter starts is correct.
\section{Wrong font}
The page number font on this page is wrong.

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.

  • The first page is using the plain page style as it is a chapter title page. By default fancyhdr does not touch plain unless you explicitly as it to. Just for fun, I switched to the memoir class (give it the openany class option and it will behave like report), it has its own build in header/footer interface. In memoir there is no issues with the fonts.
    – daleif
    Commented Jul 21, 2017 at 7:40
  • 1
    Actually, in the fancyhdr souece you'll find the problem, the code actually says \fancyfoot[c]{\rmfamily\thepage} as the default footer for the fancy style (the \rmfamily overwrites your setting). You'd probably have to tell fancyhdr what footer you want. That would be described in the fancyhdr manual.
    – daleif
    Commented Jul 21, 2017 at 7:45
  • Thanks @daleif. If you can post the answer and it works, I'll mark it as correct. Commented Jul 21, 2017 at 10:37

2 Answers 2


If we look in fancyhdr.sty we find

\fancyfoot[c]{\rmfamily\thepage} % page number

as the default code for the header of the fancy page style. Note the \rmfamily. It overrides your sans serif setting.

You can probably just add




to your preamble and it should work.

As mentioned, it might be easier in the long run to switch to a more high level class, like memoir or something from the KOMA bundle. Then you don't need so many packages to get the layout you want. Note for example that memoir has its own well integrated page style system, so fancyhdr should not be used with that class.

  • 1
    Thank you! fancyfoot[c]{\thepage} did the trick! I cannot use memoir as it does not seem to be compatible with my use of \part{} sectioning. Commented Jul 21, 2017 at 11:06
  • @NicoleAndrew please show me an example of that. memoir supports \part just fine.
    – daleif
    Commented Jul 21, 2017 at 11:15
  • @NicoleAndrew memoir not only supports \parts but also \books. Commented Jul 21, 2017 at 18:08

I just want to point titleps, which comes with titlesec, does not have this problem:

\sethead{\itshape\thesection. \MakeUppercase{\sectiontitle}}%




The page number font for the page where a chapter starts is correct.

\section{Right font} The page number font on this page is right.


enter image description here

  • Thanks @Bernard! This causes some kind of compatibility problem in the huge report structure I'm using... I get this error from inside : Command \headrule already defined. \newcommand\headrule{\setheadrule{.4\p@}}. I don't know nearly enough about LaTeX, but was hoping there might be a less 'intrusive' answer. Commented Jul 21, 2017 at 10:32
  • Probably you still load fancyhdr? If that's the case, you can't load both, as they tackle the same problem. Note titleps is easier to customise than fancyhdr, as it doesn't use the marks system by default.
    – Bernard
    Commented Jul 21, 2017 at 10:38
  • 1
    I cannot find any code explicitly adding fancyhdr, I used grep on the whole folder, but found it in the main files log file: main.log:(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty Can fancyhdr be added by other packages somehow? Commented Jul 21, 2017 at 10:43
  • Yes, it may happen: either a package, or by your .cls file. Could you post them (or a link to)?
    – Bernard
    Commented Jul 21, 2017 at 10:51
  • Is it possible that fancyhdr is automatically included in the report class that I am using? I cannot use memoir, as suggested in the other comments because I use \part dividers in my report that memoir doesn't seem to support. Commented Jul 21, 2017 at 11:02

You must log in to answer this question.

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