Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am having trouble typesetting multi-line headers using fancyhdr The header on the first page behaves differently than the header on subsequent pages. The first page header has no depth, but produces a greater vertical displacement on subsequent pages.

Here is a sample tex file to illustrate the difficulty

\documentclass{article}

\usepackage{fancyhdr}

\chead{line 1\\line 2\\line 3\\line 4\\line 5\\line 6\\line 7\\line 8}

\cfoot{footer}

\fancypagestyle{plain}{}

\pagestyle{fancy}

\begin{document}
\thispagestyle{fancy}
page 1 \newpage
page 2 \newpage
page 3 


\end{document}
share|improve this question
add comment

2 Answers

And the log-file is telling you

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 94.54448pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.
share|improve this answer
add comment

You get a warning when you compile your MWE:

Package Fancyhdr Warning: \headheight is too small (12.0pt): 
 Make it at least 94.54448pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

Adding \setlength{\headheight}{96pt} fixes the problem.

share|improve this answer
    
For an automatic solution, see Heiko Oberdiek's answer to a related question. –  mforbes Jun 29 '13 at 3:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.