2 %% This is file `wallpaper.sty' v 1.10
4 %% Author Michael H.F. Wilkinson
7 %% Create background, either centered, tiled, or in any corner
8 %% relies heavily on eso-pic.sty, corrects for changes in \hoffset
9 %% by classes such as sciposter.cls
10 %% Problems, bugs and comments to
12 %% version 1.10, 2006/04/21:
13 %% - Commands added for corner wallpapers
15 %% version 1.01, 2005/01/18:
16 %% - \providecommand{\LenToUnit} included to be compatible
17 %% with earlier versions of eso-pic.sty
19 %% version 1.00, 2004/12/22:
23 \ProvidesPackage{wallpaper}[2005/01/18, v1.01 easy wallpaper formatting (MHFW)]
24 \NeedsTeXFormat{LaTeX2e}[1995/06/01]
26 \RequirePackage{ifthen}
28 \RequirePackage{eso-pic}
29 \RequirePackage{graphicx}
31 \providecommand{\LenToUnit}[1]{#1\@gobble}
34 \newlength{\wpXoffset}
35 \setlength{\wpXoffset}{-\hoffset}
36 \newlength{\wpYoffset}
37 \setlength{\wpYoffset}{0pt}
38 \newlength{\tileXoffset}
39 \newlength{\tileYoffset}
40 \newlength{\tilewidth}
41 \newlength{\tileheight}
45 \newcommand{\LLCornerWallPaper}[2]{%
46 \AddToShipoutPicture{%
48 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
54 \newcommand{\ThisLLCornerWallPaper}[2]{%
55 \AddToShipoutPicture*{%
57 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
63 \newcommand{\ULCornerWallPaper}[2]{%
64 \AddToShipoutPicture{%
66 \parbox[b][\paperheight]{#1\paperwidth}{%
67 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
75 \newcommand{\ThisULCornerWallPaper}[2]{%
76 \AddToShipoutPicture*{%
78 \parbox[b][\paperheight]{#1\paperwidth}{%
79 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
87 \newcommand{\LRCornerWallPaper}[2]{%
88 \AddToShipoutPicture{%
90 \parbox[b]{\paperwidth}{%
91 \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
98 \newcommand{\ThisLRCornerWallPaper}[2]{%
99 \AddToShipoutPicture*{%
101 \parbox[b]{\paperwidth}{%
102 \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
103 keepaspectratio]{#2}%
109 \newcommand{\URCornerWallPaper}[2]{%
110 \AddToShipoutPicture{%
112 \parbox[b][\paperheight]{\paperwidth}{%
113 \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
114 keepaspectratio]{#2}%
120 \newcommand{\ThisURCornerWallPaper}[2]{%
121 \AddToShipoutPicture*{%
123 \parbox[b][\paperheight]{\paperwidth}{%
124 \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
125 keepaspectratio]{#2}%
132 \newcommand{\CenterWallPaper}[2]{%
133 \AddToShipoutPicture{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){%
134 \parbox[b][\paperheight]{\paperwidth}{%
137 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
138 keepaspectratio]{#2}%
144 \newcommand{\ThisCenterWallPaper}[2]{%
145 \AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){%
146 \parbox[b][\paperheight]{\paperwidth}{%
149 \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
150 keepaspectratio]{#2}%
157 \newcommand{\TileSquareWallPaper}[2]{%
158 \AddToShipoutPicture{%
160 \setlength{\tileYoffset}{\wpYoffset}
161 \setlength{\tilewidth}{\paperwidth/#1}%
162 \setlength{\tileheight}{\tilewidth}%
163 \setlength{\tileY}{0pt}%
164 \whiledo{\lengthtest{\tileY < \paperheight}}{%
165 \setlength{\tileX}{0pt}%
166 \setlength{\tileXoffset}{\wpXoffset}%
167 \whiledo{\lengthtest{\tileX < \paperwidth}}{%
168 \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){%
169 \includegraphics[height=\tileheight,width=\tilewidth]{#2}}%
170 \addtolength{\tileX}{\tilewidth}
171 \addtolength{\tileXoffset}{\tilewidth}
173 \addtolength{\tileY}{\tileheight}
174 \addtolength{\tileYoffset}{\tileheight}
180 \newcommand{\ThisTileSquareWallPaper}[2]{%
181 \AddToShipoutPicture*{%
183 \setlength{\tileYoffset}{\wpYoffset}
184 \setlength{\tilewidth}{\paperwidth/#1}%
185 \setlength{\tileheight}{\tilewidth}%
186 \setlength{\tileY}{0pt}%
187 \whiledo{\lengthtest{\tileY < \paperheight}}{%
188 \setlength{\tileX}{0pt}%
189 \setlength{\tileXoffset}{\wpXoffset}%
190 \whiledo{\lengthtest{\tileX < \paperwidth}}{%
191 \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){%
192 \includegraphics[height=\tileheight,width=\tilewidth]{#2}}%
193 \addtolength{\tileX}{\tilewidth}
194 \addtolength{\tileXoffset}{\tilewidth}
196 \addtolength{\tileY}{\tileheight}
197 \addtolength{\tileYoffset}{\tileheight}
204 \newcommand{\TileWallPaper}[3]{%
205 \AddToShipoutPicture{%
207 \setlength{\tileYoffset}{\wpYoffset}
208 \setlength{\tilewidth}{#1}%
209 \setlength{\tileheight}{#2}%
210 \setlength{\tileY}{0pt}%
211 \whiledo{\lengthtest{\tileY < \paperheight}}{%
212 \setlength{\tileX}{0pt}%
213 \setlength{\tileXoffset}{\wpXoffset}%
214 \whiledo{\lengthtest{\tileX < \paperwidth}}{%
215 \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){%
216 \includegraphics[height=\tileheight,width=\tilewidth]{#3}}%
217 \addtolength{\tileX}{\tilewidth}
218 \addtolength{\tileXoffset}{\tilewidth}
220 \addtolength{\tileY}{\tileheight}
221 \addtolength{\tileYoffset}{\tileheight}
227 \newcommand{\ThisTileWallPaper}[3]{%
228 \AddToShipoutPicture*{%
230 \setlength{\tileYoffset}{\wpYoffset}
231 \setlength{\tilewidth}{#1}%
232 \setlength{\tileheight}{#2}%
233 \setlength{\tileY}{0pt}%
234 \whiledo{\lengthtest{\tileY < \paperheight}}{%
235 \setlength{\tileX}{0pt}%
236 \setlength{\tileXoffset}{\wpXoffset}%
237 \whiledo{\lengthtest{\tileX < \paperwidth}}{%
238 \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){%
239 \includegraphics[height=\tileheight,width=\tilewidth]{#3}}%
240 \addtolength{\tileX}{\tilewidth}
241 \addtolength{\tileXoffset}{\tilewidth}
243 \addtolength{\tileY}{\tileheight}
244 \addtolength{\tileYoffset}{\tileheight}
250 \newcommand{\ClearWallPaper}{\ClearShipoutPicture}