diff options
author | Karl Berry <karl@freefriends.org> | 2012-01-07 22:38:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-01-07 22:38:54 +0000 |
commit | b046744bca2935037aca08e50dd3f3c3144c6b4a (patch) | |
tree | 3afa39918e7bd56359b2d2b50eee8cf686aba0a6 /Master/texmf-dist/tex/latex/draftwatermark | |
parent | 08586a5439b9e8085cb17971b217c8a3b00dd8c3 (diff) |
draftwatermark (7jan12)
git-svn-id: svn://tug.org/texlive/trunk@25045 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/draftwatermark')
-rw-r--r-- | Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty index 7bbcc8406ec..2b0c13b9798 100644 --- a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty +++ b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty @@ -4,15 +4,9 @@ %% %% The original source files were: %% -%% draftwatermark.dtx -%% This is file `draftwatermark.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% draftwatermark.dtx +%% draftwatermark.dtx (with options: `draftwatermark') %% -%% IMPORTANT NOTICE: +%% IMPORTANT NOTICE: %% %% Copyright 2006 %% Sergio Callegari <sergio.callegari@gmail.com> @@ -39,25 +33,39 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{draftwatermark}% [2006/06/30 1.0 Put a gray textual watermark on document pages] -\RequirePackage{everypage} +\RequirePackage{everypage}[2007/06/20] \RequirePackage{graphicx} \RequirePackage{color} \newif\if@sc@wm@first \@sc@wm@firstfalse +\newif\if@sc@wm@stamp +\@sc@wm@stamptrue \DeclareOption{firstpage}{% \@sc@wm@firsttrue} +\DeclareOption{nostamp}{% + \@sc@wm@stampfalse} +\DeclareOption{final}{% + \@sc@wm@stampfalse} +\DeclareOption{stamp}{% + \@sc@wm@stamptrue} \ProcessOptions \newlength\sc@wm@fontsize %% defaults \def\sc@wm@angle{45} -\def\sc@wm@lightness{0.8} +\def\sc@wm@colormodel{[gray]} +\def\sc@wm@colorspecs{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\SetWatermarkColor{} +\def\SetWatermarkColor#1#{\sc@setWatermarkColor{#1}} +\def\sc@setWatermarkColor#1#2{% + \def\sc@wm@colormodel{#1}% + \def\sc@wm@colorspecs{#2}} \newcommand\SetWatermarkLightness[1]{% - \def\sc@wm@lightness{#1}} + \SetWatermarkColor[gray]{#1}} \newcommand\SetWatermarkFontSize[1]{% \setlength\sc@wm@fontsize{#1}} \newcommand\SetWatermarkScale[1]{% @@ -70,17 +78,20 @@ \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}}}}}} + \expandafter\expandafter\expandafter\textcolor + \expandafter\sc@wm@colormodel\expandafter{\sc@wm@colorspecs}{% + \fontsize{\sc@wm@fontsize}{1.2\sc@wm@fontsize} + \selectfont + \sc@wm@text}}}}}} \newcommand\sc@wm@print[1]{% + \if@sc@wm@stamp \setbox\@tempboxa\vbox to \z@{% \vskip -1in \moveleft 1in \vbox{% \hbox to \z@{% #1\hss}}\vss} \dp\@tempboxa\z@ - \box\@tempboxa} + \box\@tempboxa + \fi} \if@sc@wm@first \AddThispageHook{\sc@wm@print{\sc@watermark}} \else |