views:

9878

answers:

4

I want to put a background-image on a titlepage of a document. Is it possible and dows it work?

EDIT: The answer from Presidenten using the eso-pic-package and my answer found after some research using the wallpaper-package are both working.

+4  A: 

Assuming you have a background file named background.png - Add this code before \begin{document}

\usepackage{eso-pic}
\newcommand\BackgroundPic{
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics[width=\paperwidth,height=\paperheight,
keepaspectratio]{background.png}%
\vfill
}}}

...and this immediately after \begin{document} :

\AddToShipoutPicture*{\BackgroundPic}

The * will make sure that the background picture will only be put on one page.

If you wish to use the picture on multiple pages, skip the *

\AddToShipoutPicture{\BackgroundPic}

Then use this command to stop using the background picture:

\ClearShipoutPicture
Presidenten
Your solution with eso-pic is working. I found myself a solution in the meantime (look my answer), that is working too. So some choice for other reader. And upvote for your answer. :-)
Mnementh
+4  A: 

After some research I found an answer myself. This is a little bit different to the answer from Presidenten, both solutions work.

The latex-package 'wallpaper' works well for this usage.

You need to import the package in the header:

\usepackage{wallpaper}

After that you can use commands like:

\ThisLRCornerWallPaper{0.5}{somerights.png}
\LRCornerWallPaper{0.5}{somerights.png}

The LRCorner-Command places the image in the Lower-right corner of the site. There are commands like ULCornerWallPaper and so on for the other corners and CenterWallPaper and TileWallPaper for centering or tiling the image.

The This at the start of the command place the image only on the current page, without this the image is placed on all following pages.

The numerical argument 0.5 scales the image to 0.5 the size of the page.

Mnementh
A: 

Hi!

Both methods work fine, but how can you make the background image to occupy the whole sheet on every page EXCEPT a certain stripe on the inner side of each page? I can't figure it out.

Matyi

It makes sense, that you ask this as another question. You can set a link to this question. The way Stackoverflow works you get only answers in comments (like this).
Mnementh
wallpaper.sty defines a couple commands to tweak positioning. Have a look at the manual of wallpaper (`texdoc wallpaper` should open it for you)
Damien Pollet
A: 

erase the keepaspectratio option in the first method and you'll get it.

Doxdrum