# Distance between fancy header and section title

Problem description

When I use two lines in my header, the distance between the bottom line of my fancy header and the title of the first section is different than the distance between the header and the title of all subsequent sections. It seems like the content of all subsequent pages if moved down by a little bit compared to the first page.

Code to replicate problem

\documentclass[a4paper,12pt]{article}
\usepackage[margin=2.5cm]{geometry} %layout
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Some text \\ some more text}

\begin{document}
\section*{Section 1}
\newpage
\section*{Section 2}
\end{document}


In your log file you will find the message

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


which explains the problem as well as the consequences, and how the problem can be solved.

In your case, add headheight=27.05003pt to the options of the geometry package, and the page layout will be consistent for all pages, including the first one. (Without the geometry package, use \setlength\headheight{27.05003pt}.)

\documentclass[a4paper,12pt]{article}