# Image in header, custom padding

First of all, sorry about the poor title, but I searched for ten minutes and couldn't find a better one..

I'm using fancyhdr to set some custom headers and footer in my LaTeX document.

I'd like to make my top left image overlap the auto-generated header line. To be clear, I'd like the Eiffel tower to overlap the line in the picture below :

My current code to get this result is pretty simple, but I have no idea on how to solve my goal :

\fancyhead[L]{\includegraphics[scale=0.15]{logo.png}}

-

## 1 Answer

Use \raisebox{<len>}[0pt][0pt]{\includegraphics[..]{...}} with a negative <len> to drop the image as far as you want.

Here's an example:

\documentclass{report}
\usepackage{fancyhdr,graphicx}
\usepackage{lipsum}

\fancyhf{}% Clear fancy header/footer
\fancyhead[L]{\raisebox{-.7\height}[0pt][0pt]{\includegraphics[scale=0.1]{example-image}}}
\fancyhead[R]{\leftmark}
\pagestyle{fancy}

\begin{document}
\chapter{A chapter}
\lipsum[1-5]

\end{document}


In the example, the image is dropped 70% of its own height (\height). For help on the syntax of \raisebox, see source2e (section 57 LaTeX Box commands, p 232):

\raisebox{<distance>}[<height>][<depth>]{<box>}:

Raises <box> up by length (down if <distance> negative). Makes TeX think that the new box extends <height> above the line and <depth> below, for a total vertical length of <height>+<depth>. Default values of <height> & <depth> = actual height and depth of box in new position.

-