## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Auto background picture on every odd (or even) page

Information and discussion about graphics, figures & tables in LaTeX documents.
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

### Auto background picture on every odd (or even) page

Ok here's the thing:

I use photoshop to make nice (A4 sized) backgrounds for my reports and letters.
It has logos included etc.

I inlcude these in tex using the eso-pic package with the following code:

\newcommand\BackgroundPic{
\put(-46,-3){
\parbox[b][11inch]{8.5inch }{%
\vfill
%\centering
\includegraphics[width=8.27inch,height=11.69inch, keepaspectratio ]{watermark.pdf}%
\vfill
}}}

\begin{document}

Works like a charm. Does not upset the document layout.

However, I am using the twoside a4 package. Hence, I'd like to use different background pictures for odd and even pages.

My question: How do I automatically get this done.

thanks!

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
I think you can forget all your recent efforts because all you need is the watermark package from the ncctools bundle. It supports different watermarks for even and odd pages.

Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm
Thank you for the swift reply.

If I remember correcly, I already looked into the watermark package but for some reason it didnt work out for me. I'll have a look at it again.

with eso-pic it is impossible to do what I want?

Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm
Ah yeah I know what bothered me: that pdf with documentation makes no sense to me

I use latex, I'm not an expert, though I am very interested into learning more.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
If you are willing to provide two of your pictures you can attach them to your next post. So we would be able to do some testing.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm
Sure, no problem.

I currently have a background for a letter (attached both the background pdf (watermark.pdf) and the compiled letter (letter1.pdf) ). I put the tex file in the zip too.
texfiles.zip
Zipped file, also includes the tex file

Currently just 1 page. However, for future purposes I'll probably have multi page AND
more importantly I'm working on a background design for a businessplan that I'm currently writing. (twoside, report) with mirrored layouts for even and odd pages.

I think this will suffice for testing, you can use the same picture for even and odd pages (just rename to watermarkodd and watermarkeven or something).

Last, but not least, I'd like to thank you for your efforts, greatly appreciated!

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Actually I wanted to withdraw my advice because the wallpaper package seemed better. But my experiments with that package came to nothing.

Finally I was able to work out a very short example which uses the watermark package. I converted your watermark from PDF to PNG and then mirrored it because I needed two different pictures.

Although it offers to specify wallpapers for even (left) and odd (right) pages, the interface of this package isn't very comfortable. Internally the package uses a picture environment with its origin at the upper left corner of the text body. But this means that the picture chosen as watermark has to be shifted to make it fit on the page. This shift depends strongly on the type area. So there is a lot of trial and error needed to get the right coordinates because the manual is very unclear in regard to the unit length.

I attached the source with the two graphics as well as the final output in a ZIP archive.
Attachments
watermark-smpl.zip
Source and output for a watermark example.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm
Thank you very much for your effort. I will see how it works out for me and post my results here on the forum for future users with similar questions.

Once again, thank you very much for your help!

Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm
This is just what I need.
I use a template (with standard dimensions A4) in Photoshop, so I'll be fine
with these coordinates.
The eso-pic packages also involves a bit trial on error with coordinates so this doesnt make any difference.

Last, is there a way to understand the documentation on packages better?
The pdf on the watermark package did not make any sense to me (maybe I'm too noobish).

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Faust wrote:[…] Last, is there a way to understand the documentation on packages better?
The pdf on the watermark package did not make any sense to me (maybe I'm too noobish).

I don't know. So far I got along pretty good with these manuals.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

### Who is online

Users browsing this forum: No registered users and 7 guests