7

Before anything, this question may have been asked already, but I can't find it. I want to place a picture right on top of the page letting no white space between the top edge of the page and the top edge of the picture. I have already fitted the picture width to the paper width like this:

\makebox[\textwidth]{\includegraphics[width=\paperwidth]{mypicture}}

Thanks for all and sorry about my spelling.

  • 3
    In every page or just in the first one? – egreg Nov 29 '12 at 16:25
4

I suggest you to use the eso-pic package:

\documentclass{scrartcl}
\usepackage{eso-pic}
\begin{document}

\AddToShipoutPicture*{\put(0,788){\rule{21cm}{2cm}}} 

Hello

\end{document}

You might need to play with the settings but basically this is one way to do it. To have the picture on each page just remove the '*'.

result

  • Ehhh, I can't get the same result. I get the picture centered verticaly and without the page width. Can you explain me a little bit more how it works? – Agustin Nov 29 '12 at 17:14
  • Try by changing \textwidth to \paperwidth, the following line works nicely here: \AddToShipoutPicture*{\put(0,820){\makebox[\paperwidth]{\includegraphics[width=\paperwidth,height=1cm]{tulpen}}}} – Uwe Ziegenhagen Nov 29 '12 at 17:27
  • No, it doesn't work for me. Is there a way to tell latex to stick the picture to the top edge? Or something like this: \vspace*{-xxx}\makebox[\textwidth]{\includegraphics[width=\paperwidth]{mypicture}}, but I cant know what xxx is. – Agustin Nov 29 '12 at 19:17
  • Check egreg's solution then. The code works fine for me but I don't know your setup. – Uwe Ziegenhagen Nov 29 '12 at 20:21
3

With the picture package you don't even have to guess:

\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{picture}
\usepackage{eso-pic}
\begin{document}

\AddToShipoutPicture*{\put(0,\dimexpr\paperheight-1cm){%
  \makebox[\paperwidth]{\includegraphics[width=\paperwidth,height=1cm]{tulpen}}%
}}

Hello
\newpage
Hello

\end{document}

If you use \AddToShipoutPicture (without the *), the image will be added to every page.

  • Note: the -1cm part needs to be adjusted according to your image – John J. Camilleri Sep 13 '13 at 15:07

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.