I'm a bit confused with the behaviour of fancyhdr.
- When I change the
\headheightfor a\fancypagestyleto include a picture (here a tikz placeholder), why is the footer as well as the bottom margin not respected, but also moved (see first page of output)? How can I fix that? - Why does the
\headheightof the first page with one\fancypagestyleseemingly influence theheadheightof the second page with a different\fancypagestyleand different\headheight(see second page of output)?
A MWE and its output follows. Thanks in advance!
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{tikz}
%header first page
\fancypagestyle{firststyle}{
\setlength{\headheight}{130pt}
\fancyhead[L]{}
\fancyhead[C]{\begin{tikzpicture}
\draw[fill=red] (0,0) rectangle (\textwidth,5);
\end{tikzpicture}}
\fancyhead[R]{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
}
%main header
\fancypagestyle{main}{
\setlength{\headheight}{10pt}
\fancyhead[L]{Test Left}
\fancyhead[C]{}
\fancyhead[R]{Test Right}
\fancyfoot[C]{\thepage}}
\pagestyle{main}
%
\begin{document}
\thispagestyle{firststyle}
\lipsum
\end{document}



