## LaTeX forum ⇒ Page Layout ⇒ Compilation glitches with the fancyhdr package Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Cham
Posts: 830
Joined: Sat Apr 02, 2011 4:06 pm

### Compilation glitches with the fancyhdr package

I'm experiencing a few small glitches with my customized header/footer, and I have a few questions.

1. What is the best "universal" (i.e. compatible with most classes) up-to-date package to customize the headers and footers in LaTeX ? I'm using fancyhdr in the MWE below.

2. Is the fancyhdr package compatible with all the following classes? (apparently, it's working great with all of them yet, in my experimentations) : article, book, memoir, paper, report, revtex4, scrartcl, scrbook, scrreprt, exam.

Here's a MWE for the revtex4-1 class (a pesky and difficult to customize class), showing the warnings glitches in the console (I'm getting similar warnings with many other classes as well) :


Here's the typical warnings I'm getting in the console. I don't understand how to properly fix them :
Package Fancyhdr Warning: \fancyhead's E' option without twoside option is useless on input line 11.
Package Fancyhdr Warning: \fancyhead's E' option without twoside option is useless on input line 12.
Package Fancyhdr Warning: \fancyhead's E' option without twoside option is useless on input line 13.
Package Fancyhdr Warning: \fancyfoot's E' option without twoside option is useless on input line 14.
Package Fancyhdr Warning: \fancyfoot's E' option without twoside option is useless on input line 15.
Package Fancyhdr Warning: \fancyfoot's E' option without twoside option is useless on input line 16.
...snip...
Package nag Warning: Command \it is an old LaTeX 2.09 command.
(nag) Use \itshape or \textit instead on input line 32.
...snip...
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 13.59999pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
...snip...
Package nag Warning: 1 complaints in total.

So what's wrong with my code above? How to make it better? How to fix each warning?

Unrelated questions :
Also, should I use \ (for a space), \\, or \par, or \newline (or even something else) in the bibliography?

Stefan Kottwitz
Posts: 8668
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
1. Practically universal: that's probably fancyhdr, the classic package for headers and footers. But not up-to-date. It hasn't been developed since many years, also that's why nag prints warnings about obsolete commands. By default capitalized headings are also questionable.

The most up-to-date package is scrlayer-scrpage, the successor of scrpage2. It integrates with the KOMA-Script classes, but I guess it can be used with other classes too.

2. It should be compatible with most. Probably not with memoir, since that one implements package features as copies already.

For unrelated questions, it would be good to have a separate topic. It's hard to follow a mix of questions with mixed answers, especially when several people write then. And you know, people read this topic because of the title, fancyhdr, not for finding a question about bibliography tweaks.

Stefan

Cham
Posts: 830
Joined: Sat Apr 02, 2011 4:06 pm
Stefan, what about the other warnings in the MWE above ?

Why the \headheight is too small (12.0pt) ?

And why the E option without twoside option is useless on input line 11 ?

Stefan Kottwitz
Posts: 8668
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Cham wrote:Why the \headheight is too small (12.0pt) ?

You have set it to 12pt, but the contained text in the header is bigger. In your example, compare the header boxes of first and second page. Just set it to 14.

Cham wrote:And why the E option without twoside option is useless on input line 11 ?

The fancyhdr package doesn't see that it's twoside since the revtex4-1 class doesn't make it like the standard book class. If it's just a warning but no issue with the output, ignore it. fancyhdr works like requested, it just comments that in case of oneside layout there's no effect of the E option.

Stefan

Johannes_B
Site Moderator
Posts: 3620
Joined: Thu Nov 01, 2012 4:08 pm
As i said in another post, use scrlayer-scrpage. You get warnings by using fancyhdr with KOMA-classes.
You get a nag warning, because your distribution is outdated. fancyhdr is up-to-date by 2017.

revtex is doing something the standard classes do, but in a different way. hence the warnings about the twoside stuff.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Cham
Posts: 830
Joined: Sat Apr 02, 2011 4:06 pm
Johannes, I don't understand your comment about outdated distribution. My whole installation (including fancyhdr, KOMA-script and revtex4-1) is all from 2015. Why would nag say anything if fancyhdr is from 2015 too ?

Johannes_B
Site Moderator
Posts: 3620
Joined: Thu Nov 01, 2012 4:08 pm
nag is complaining about the old version of fancyhdr. The package was updated in 2016, latest update in july this year. There is no nag warning with a recent distribution.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.