I am creating a document with a header image created in TikZ. I have encountered an unusual behaviour that is frustrating my attempts to control the positioning.
If the header is left out (for instance by commenting out \header
in the code below, the first section begins hard up against the top of the page (in this example). However, with the header image included, called with the macro \header
, the first section begins lower. The amount it drops down is greater than the separation between the sections.
What is this spacing? Where does it come from? Is there a defined length controlling it?
Ideally I would like to compensate for it in the definition of \header
in an associated class file and control precisely where the text will begin below the header.
\documentclass{article}
\usepackage[top=0mm, bottom=30mm, left=20mm, right=20mm, nohead, nofoot]{geometry}
\usepackage{tikz}
\newcommand{\header}{
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=black!40, anchor=north, minimum width=\paperwidth, minimum height=4cm] (box) at (current page.north){};
\end{tikzpicture}}
\begin{document}
\header
\section{The First}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ipsum ipsum, porta eget rutrum et, scelerisque at tortor. Donec adipiscing est sed odio congue, quis pulvinar leo semper. Sed euismod ut augue a imperdiet. Ut et enim quam. Nam id hendrerit mi, sed pretium tortor.
\section{The Second}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ipsum ipsum, porta eget rutrum et, scelerisque at tortor. Donec adipiscing est sed odio congue, quis pulvinar leo semper. Sed euismod ut augue a imperdiet. Ut et enim quam. Nam id hendrerit mi, sed pretium tortor.
\end{document}
Many thanks
\header
your first\section
command is not on vertical mode. – Gonzalo Medina Jul 31 '13 at 0:23