summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/draftwatermark
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-07-04 12:50:21 +0000
committerKarl Berry <karl@freefriends.org>2006-07-04 12:50:21 +0000
commitebe0c16022730f6878335a52bc7604dc0b1d96f0 (patch)
tree1f490ce660e9a9f08fe2d163d1406b524dd93aac /Master/texmf-dist/tex/latex/draftwatermark
parent81cb4991a294f8c832eeebda60e9f0b49f7c389c (diff)
new package draftwatermark
git-svn-id: svn://tug.org/texlive/trunk@1764 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/draftwatermark')
-rw-r--r--Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty91
1 files changed, 91 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
new file mode 100644
index 00000000000..7bbcc8406ec
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
@@ -0,0 +1,91 @@
+%%
+%% This is file `draftwatermark.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% draftwatermark.dtx
+%% This is file `draftwatermark.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% draftwatermark.dtx
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Copyright 2006
+%% Sergio Callegari <sergio.callegari@gmail.com>
+%%
+%% ---------------------------------------------
+%% This file is part of the draftwatermark package,
+%% a contribution to the LaTeX2e system.
+%% ---------------------------------------------
+%%
+%% This program consists of the files listed in the README file included
+%% in the package.
+%%
+%% Any modified versions of this file must be renamed with new filenames
+%% distinct from draftwatermark.sty.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file draftwatermark.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{draftwatermark}%
+ [2006/06/30 1.0 Put a gray textual watermark on document pages]
+\RequirePackage{everypage}
+\RequirePackage{graphicx}
+\RequirePackage{color}
+\newif\if@sc@wm@first
+\@sc@wm@firstfalse
+\DeclareOption{firstpage}{%
+ \@sc@wm@firsttrue}
+\ProcessOptions
+\newlength\sc@wm@fontsize
+%% defaults
+\def\sc@wm@angle{45}
+\def\sc@wm@lightness{0.8}
+\def\sc@wm@scale{1}
+\setlength\sc@wm@fontsize{5cm}
+\def\sc@wm@text{DRAFT}
+\newcommand\SetWatermarkAngle[1]{%
+ \def\sc@wm@angle{#1}}
+\newcommand\SetWatermarkLightness[1]{%
+ \def\sc@wm@lightness{#1}}
+\newcommand\SetWatermarkFontSize[1]{%
+ \setlength\sc@wm@fontsize{#1}}
+\newcommand\SetWatermarkScale[1]{%
+ \def\sc@wm@scale{#1}}
+\newcommand\SetWatermarkText[1]{%
+ \def\sc@wm@text{#1}}
+\newcommand\sc@watermark{%
+ \setlength{\@tempdimb}{.5\paperwidth}%
+ \setlength{\@tempdimc}{-.5\paperheight}%
+ \put(\strip@pt\@tempdimb,\strip@pt\@tempdimc){%
+ \makebox(0,0){\rotatebox{\sc@wm@angle}{%
+ \scalebox{\sc@wm@scale}{%
+ \textcolor[gray]{\sc@wm@lightness}{
+ \fontsize{\sc@wm@fontsize}{1.2\sc@wm@fontsize}
+ \selectfont
+ \sc@wm@text}}}}}}
+\newcommand\sc@wm@print[1]{%
+ \setbox\@tempboxa\vbox to \z@{%
+ \vskip -1in \moveleft 1in \vbox{%
+ \hbox to \z@{%
+ #1\hss}}\vss}
+ \dp\@tempboxa\z@
+ \box\@tempboxa}
+\if@sc@wm@first
+\AddThispageHook{\sc@wm@print{\sc@watermark}}
+\else
+\AddEverypageHook{\sc@wm@print{\sc@watermark}}
+\fi
+\endinput
+%%
+%% End of file `draftwatermark.sty'.