Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 :

Header picutre

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}}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

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

Here's an example:

enter image description here

\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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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