Graphics, Figures & TablesAuto 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

Post by Faust »

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[11inch]{8.5inch }{%
\vfill
%\centering
\includegraphics[width=8.27inch,height=11.69inch, keepaspectratio ]{watermark.pdf}%
\vfill
}}}


\begin{document}
\AddToShipoutPicture{\BackgroundPic}


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!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Auto background picture on every odd (or even) page

Post by localghost »

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¹
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

Re: Auto background picture on every odd (or even) page

Post by Faust »

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

Re: Auto background picture on every odd (or even) page

Post by Faust »

Ah yeah I know what bothered me: that pdf with documentation makes no sense to me :lol:

I use latex, I'm not an expert, though I am very interested into learning more.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Auto background picture on every odd (or even) page

Post by localghost »

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.
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

Auto background picture on every odd (or even) page

Post by Faust »

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
(191.71 KiB) Downloaded 455 times
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!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Auto background picture on every odd (or even) page

Post by localghost »

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.
(172.32 KiB) Downloaded 673 times
Faust
Posts: 55
Joined: Thu Oct 29, 2009 12:45 pm

Re: Auto background picture on every odd (or even) page

Post by Faust »

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

Re: Auto background picture on every odd (or even) page

Post by Faust »

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).
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Auto background picture on every odd (or even) page

Post by localghost »

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.
Post Reply