diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:11:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:11:13 +0000 |
commit | 23e7162338e0006320660626575dc9f19c0f4059 (patch) | |
tree | 7d655ae67e3cc90c08eb6a165c6b7cb1d41cd4ee /Master | |
parent | 9158dfc01290b31f46ce22a07ccf64ef234bc8d1 (diff) |
wallpaper
git-svn-id: svn://tug.org/texlive/trunk@1446 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/tex/latex/wallpaper/wallpaper.sty | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/wallpaper/wallpaper.sty b/Master/texmf-dist/tex/latex/wallpaper/wallpaper.sty new file mode 100644 index 00000000000..c0b79c586b7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/wallpaper/wallpaper.sty @@ -0,0 +1,149 @@ +%% +%% This is file `wallpaper.sty' v 1.00 +%% +%% Author Michael H.F. Wilkinson +%% December 22, 2004 +%% +%% Create background, either centered or tiled +%% relies heavily on eso-pic.sty, corrects for changes in \hoffset +%% by classes such as sciposter.cls +%% Problems, bugs and comments to +%% michael@cs.rug.nl + +\ProvidesPackage{wallpaper}[2004/12/22, v1.00 easy wallpaper formatting (MHFW)] +\NeedsTeXFormat{LaTeX2e}[1995/06/01] + +\RequirePackage{ifthen} +\RequirePackage{calc} +\RequirePackage{eso-pic} +\RequirePackage{graphicx} + +\newlength{\wpXoffset} +\setlength{\wpXoffset}{-\hoffset} +\newlength{\wpYoffset} +\setlength{\wpYoffset}{0pt} +\newlength{\tileXoffset} +\newlength{\tileYoffset} +\newlength{\tilewidth} +\newlength{\tileheight} +\newlength{\tileX} +\newlength{\tileY} + +\newcommand{\CenterWallPaper}[2]{% +\AddToShipoutPicture{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% + \parbox[b][\paperheight]{\paperwidth}{% + \vfill + \centering + \includegraphics[width=#1\paperwidth,height=#1\paperheight,% + keepaspectratio]{#2}% + \vfill + }}} +} + +\newcommand{\ThisCenterWallPaper}[2]{% +\AddToShipoutPicture*{\put(\LenToUnit{\wpXoffset},\LenToUnit{\wpYoffset}){% + \parbox[b][\paperheight]{\paperwidth}{% + \vfill + \centering + \includegraphics[width=#1\paperwidth,height=#1\paperheight,% + keepaspectratio]{#2}% + \vfill + }}} +} + + + +\newcommand{\TileSquareWallPaper}[2]{% +\AddToShipoutPicture{% + \begingroup + \setlength{\tileYoffset}{\wpYoffset} + \setlength{\tilewidth}{\paperwidth/#1}% + \setlength{\tileheight}{\tilewidth}% + \setlength{\tileY}{0pt}% + \whiledo{\lengthtest{\tileY < \paperheight}}{% + \setlength{\tileX}{0pt}% + \setlength{\tileXoffset}{\wpXoffset}% + \whiledo{\lengthtest{\tileX < \paperwidth}}{% + \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){% + \includegraphics[height=\tileheight,width=\tilewidth]{#2}}% + \addtolength{\tileX}{\tilewidth} + \addtolength{\tileXoffset}{\tilewidth} + }% + \addtolength{\tileY}{\tileheight} + \addtolength{\tileYoffset}{\tileheight} + }% + \endgroup +}% +} + +\newcommand{\ThisTileSquareWallPaper}[2]{% +\AddToShipoutPicture*{% + \begingroup + \setlength{\tileYoffset}{\wpYoffset} + \setlength{\tilewidth}{\paperwidth/#1}% + \setlength{\tileheight}{\tilewidth}% + \setlength{\tileY}{0pt}% + \whiledo{\lengthtest{\tileY < \paperheight}}{% + \setlength{\tileX}{0pt}% + \setlength{\tileXoffset}{\wpXoffset}% + \whiledo{\lengthtest{\tileX < \paperwidth}}{% + \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){% + \includegraphics[height=\tileheight,width=\tilewidth]{#2}}% + \addtolength{\tileX}{\tilewidth} + \addtolength{\tileXoffset}{\tilewidth} + }% + \addtolength{\tileY}{\tileheight} + \addtolength{\tileYoffset}{\tileheight} + }% + \endgroup +}% +} + + +\newcommand{\TileWallPaper}[3]{% +\AddToShipoutPicture{% + \begingroup + \setlength{\tileYoffset}{\wpYoffset} + \setlength{\tilewidth}{#1}% + \setlength{\tileheight}{#2}% + \setlength{\tileY}{0pt}% + \whiledo{\lengthtest{\tileY < \paperheight}}{% + \setlength{\tileX}{0pt}% + \setlength{\tileXoffset}{\wpXoffset}% + \whiledo{\lengthtest{\tileX < \paperwidth}}{% + \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){% + \includegraphics[height=\tileheight,width=\tilewidth]{#3}}% + \addtolength{\tileX}{\tilewidth} + \addtolength{\tileXoffset}{\tilewidth} + }% + \addtolength{\tileY}{\tileheight} + \addtolength{\tileYoffset}{\tileheight} + }% + \endgroup +}% +} + +\newcommand{\ThisTileWallPaper}[3]{% +\AddToShipoutPicture*{% + \begingroup + \setlength{\tileYoffset}{\wpYoffset} + \setlength{\tilewidth}{#1}% + \setlength{\tileheight}{#2}% + \setlength{\tileY}{0pt}% + \whiledo{\lengthtest{\tileY < \paperheight}}{% + \setlength{\tileX}{0pt}% + \setlength{\tileXoffset}{\wpXoffset}% + \whiledo{\lengthtest{\tileX < \paperwidth}}{% + \put(\LenToUnit{\tileXoffset},\LenToUnit{\tileYoffset}){% + \includegraphics[height=\tileheight,width=\tilewidth]{#3}}% + \addtolength{\tileX}{\tilewidth} + \addtolength{\tileXoffset}{\tilewidth} + }% + \addtolength{\tileY}{\tileheight} + \addtolength{\tileYoffset}{\tileheight} + }% + \endgroup +}% +} + +\newcommand{\ClearWallPaper}{\ClearShipoutPicture}
\ No newline at end of file |