3

I'm using fancyhdr to create a header with two lines in lhead and two lines in rhead like so,

\documentclass[12pt]{article} 
\usepackage[margin=1.0in]{geometry}
\usepackage{lipsum}
\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\lhead{lhead line 1 \\ lhead line 2}
\rhead{rhead line 1 \\ rhead line 2}

\begin{document}
\lipsum[1]

\lipsum
\end{document}

The problem is:

  • On the first page, the distance between the header and the paragraph text doesn't change when a multi-line \lhead or multi-line \rhead is used. However, one subsequent pages, the distance adjusts properly

I've attached pictures showing what I mean.

enter image description here

enter image description here

Notice that there is a difference between the headheight on the different pages. I want the first page header to be like the second, ... page header.

  • 4
    There is a warning in the log file: "\headheight is too small (12.0pt): Make it at least 27.18335pt. We now make it that large for the rest of the document. This may cause the page layout to be inconsistent, however." So use \usepackage[margin=1.0in,headheight=27.18335pt]{geometry} or a larger value for headheight. – esdd Sep 19 '15 at 17:45
  • 1
    @esdd Can you make that an official answer or mark as duplicate? – Johannes_B Dec 21 '15 at 11:11

1 Answers1

1

As pointed out by esdd, this problem can be dealt with by passing the headheight=27.18335pt option to the geometry package. The 27.18335pt value is suggested by the log file.

\usepackage[margin=1.0in,headheight=27.18335pt]{geometry}