summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wallpaper/wallpaper.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/wallpaper/wallpaper.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/wallpaper/wallpaper.sty')
-rw-r--r--macros/latex/contrib/wallpaper/wallpaper.sty250
1 files changed, 250 insertions, 0 deletions
diff --git a/macros/latex/contrib/wallpaper/wallpaper.sty b/macros/latex/contrib/wallpaper/wallpaper.sty
new file mode 100644
index 0000000000..c64e8c6388
--- /dev/null
+++ b/macros/latex/contrib/wallpaper/wallpaper.sty
@@ -0,0 +1,250 @@
+%%
+%% This is file `wallpaper.sty' v 1.10
+%%
+%% Author Michael H.F. Wilkinson
+%% April 21, 2006
+%%
+%% Create background, either centered, tiled, or in any corner
+%% 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
+%% version 1.10, 2006/04/21:
+%% - Commands added for corner wallpapers
+%%
+%% version 1.01, 2005/01/18:
+%% - \providecommand{\LenToUnit} included to be compatible
+%% with earlier versions of eso-pic.sty
+%%
+%% version 1.00, 2004/12/22:
+%% - first release
+%%
+%%
+\ProvidesPackage{wallpaper}[2005/01/18, v1.01 easy wallpaper formatting (MHFW)]
+\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+
+\RequirePackage{ifthen}
+\RequirePackage{calc}
+\RequirePackage{eso-pic}
+\RequirePackage{graphicx}
+
+\providecommand{\LenToUnit}[1]{#1\@gobble}
+
+
+\newlength{\wpXoffset}
+\setlength{\wpXoffset}{-\hoffset}
+\newlength{\wpYoffset}
+\setlength{\wpYoffset}{0pt}
+\newlength{\tileXoffset}
+\newlength{\tileYoffset}
+\newlength{\tilewidth}
+\newlength{\tileheight}
+\newlength{\tileX}
+\newlength{\tileY}
+
+\newcommand{\LLCornerWallPaper}[2]{%
+\AddToShipoutPicture{%
+ \AtPageLowerLeft{%
+ \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ }
+ }
+}
+
+\newcommand{\ThisLLCornerWallPaper}[2]{%
+\AddToShipoutPicture*{%
+ \AtPageLowerLeft{%
+ \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ }
+ }
+}
+
+\newcommand{\ULCornerWallPaper}[2]{%
+ \AddToShipoutPicture{%
+ \AtPageLowerLeft{%
+ \parbox[b][\paperheight]{#1\paperwidth}{%
+ \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ \vfill%
+ }
+ }
+ }
+}
+
+\newcommand{\ThisULCornerWallPaper}[2]{%
+ \AddToShipoutPicture*{%
+ \AtPageLowerLeft{%
+ \parbox[b][\paperheight]{#1\paperwidth}{%
+ \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ \vfill%
+ }
+ }
+ }
+}
+
+\newcommand{\LRCornerWallPaper}[2]{%
+ \AddToShipoutPicture{%
+ \AtPageLowerLeft{%
+ \parbox[b]{\paperwidth}{%
+ \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ }
+ }
+ }
+}
+
+\newcommand{\ThisLRCornerWallPaper}[2]{%
+ \AddToShipoutPicture*{%
+ \AtPageLowerLeft{%
+ \parbox[b]{\paperwidth}{%
+ \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ }
+ }
+ }
+}
+
+\newcommand{\URCornerWallPaper}[2]{%
+ \AddToShipoutPicture{%
+ \AtPageLowerLeft{%
+ \parbox[b][\paperheight]{\paperwidth}{%
+ \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ \vfill%
+ }
+ }
+ }
+}
+\newcommand{\ThisURCornerWallPaper}[2]{%
+ \AddToShipoutPicture*{%
+ \AtPageLowerLeft{%
+ \parbox[b][\paperheight]{\paperwidth}{%
+ \hfill \includegraphics[width=#1\paperwidth,height=#1\paperheight,%
+ keepaspectratio]{#2}%
+ \vfill%
+ }
+ }
+ }
+}
+
+\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