1

I have a image as footer:

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\usepackage{lipsum}
\setlength\headheight{26pt}
\fancyhead[L]{\includegraphics[width=10cm]{myimage}}

The image still starts around 2cm under the top of the page, how let I start it on the utter top?

Thanks in advance

  • 3
    \headheight is different than the top margin value. – user31729 Feb 8 '16 at 14:27
  • @ChristianHupfer If you want to answer, please do. – Johannes_B Jul 19 '16 at 10:11
  • @Johannes_B: Answered! – user31729 Jul 19 '16 at 21:11
3

The top margin value is not the same as headheight, as can be seen from the graphics (from geometry.pdf package documentation). There's a small \headsep value too, that serves as vertical spacing between the page header content and the real text body.

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage[headheight=65pt,tmargin=65pt,headsep=5pt,showframe]{geometry}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[L]{\includegraphics[scale=0.2]{ente}}


\usepackage{blindtext}

\begin{document}
\blindtext[10]
\end{document}

If some content shall be squeezed right at the top boundary of the page, tmargin and headheight should be quite identical, the values in the solution above are just arbitrary ones, depending on the real size of the graphics that should be placed there.

In case the potential warning reported by fancyhdr about headheight values should not be ignored -- the reported values are quite helpful to prevent wrong page headers!

enter image description here

  • 1
    Vielen Dank :-) – Johannes_B Jul 19 '16 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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