Giter Site home page Giter Site logo

Comments (1)

callegar avatar callegar commented on July 4, 2024

Proposed new code (by Claudio)

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{watermark}% .............. formely draftwatermark
[2008/05/11 1.0 Put a colored textual watermark on document pages]
\RequirePackage{everypage}
\RequirePackage{graphicx}
\RequirePackage{xcolor}% .................. Different package
\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}
% ......................................... New commands
\def\sc@wm@color@model{gray}
\def\sc@wm@color{0.8}
\newcommand\SetWatermarkColor[2][grey]{%
\def\sc@wm@color@model{#1}\def\sc@wm@color{#2}%
}
% .........................................
\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[\sc@wm@color@model]{\sc@wm@color}{% ........ Modifications
\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'.

from latex-draftwatermark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.