diff options
author | Karl Berry <karl@freefriends.org> | 2009-11-16 19:54:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-11-16 19:54:47 +0000 |
commit | e8c2ee1869c4f626395c3c2c85e2a2e48e403712 (patch) | |
tree | 818f69a72f5c84a60748d756aee24888fc278795 /Master/texmf-dist/tex/latex | |
parent | a4d8f696b0807d001fa89b52b59552a669709a69 (diff) |
new latex package background (8nov09)
git-svn-id: svn://tug.org/texlive/trunk@16034 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/background/background.sty | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/background/background.sty b/Master/texmf-dist/tex/latex/background/background.sty new file mode 100644 index 00000000000..314c090a90a --- /dev/null +++ b/Master/texmf-dist/tex/latex/background/background.sty @@ -0,0 +1,107 @@ +%% +%% This is file `background.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% background.dtx (with options: `package') +%% +%% Copyright (C) 2009 Gonzalo Medina (gmedinaar@unal.edu.co) +%% +%% -------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Gonzalo Medina. +%% +%% This work consists of the files background.ins, background.dtx, +%% and the derived files background.sty and background.pdf. +%% + % \end{center} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{background}[2009/11/07 v1.0 bg material] + +\RequirePackage{everypage} +\RequirePackage{tikz} +\RequirePackage{afterpage} + +\newif\ifbg@some + \bg@somefalse + +\def\bg@contents{Draft} +\def\bg@color{red!45} +\def\bg@angle{60} +\def\bg@opacity{.5} +\def\bg@scale{15} +\def\bg@position{current page.center} +\def\bg@anchor{} +\def\bg@hshift{0} +\def\bg@vshift{0} + +\DeclareOption{all}{\bg@somefalse} +\DeclareOption{some}{\bg@sometrue} +\DeclareOption{center}{% + \def\bg@position{current page.center}% + \def\bg@anchor{}% + \def\bg@angle{60}} +\DeclareOption{bottom}{% + \def\bg@position{current page.south}% + \def\bg@anchor{above}% + \def\bg@angle{0}% + \def\bg@scale{8}} +\DeclareOption{top}{% + \def\bg@position{current page.north}% + \def\bg@anchor{below}% + \def\bg@angle{0}% + \def\bg@scale{8}} + +\ExecuteOptions{all,center} +\ProcessOptions + +\newcommand*\SetBgContents[1]{% + \def\bg@contents{#1}} +\newcommand*\SetBgColor[1]{% + \def\bg@color{#1}} +\newcommand*\SetBgAngle[1]{% + \def\bg@angle{#1}} +\newcommand*\SetBgOpacity[1]{% + \def\bg@opacity{#1}} +\newcommand*\SetBgScale[1]{% + \def\bg@scale{#1}} +\newcommand*\SetBgPosition[1]{% + \def\bg@position{#1}} +\newcommand*\SetBgAnchor[1]{% + \def\bg@anchor{#1}} +\newcommand*\SetBgHshift[1]{% + \def\bg@hshift{#1}} +\newcommand*\SetBgVshift[1]{% + \def\bg@vshift{#1}} + +\newcommand\bg@material{% + \begin{tikzpicture}[remember picture,overlay] + \node [rotate=\bg@angle,scale=\bg@scale,opacity=\bg@opacity,% + xshift=\bg@hshift,yshift=\bg@vshift,color=\bg@color] + at (\bg@position) [\bg@anchor] {\bg@contents}; + \end{tikzpicture}}% +\newcommand\BgThispage{\AddThispageHook{\bg@material}} + +\newcommand\NoBgThispage{% + \let\oldbg@material\bg@material\renewcommand\bg@material{}% + \afterpage{\AddEverypageHook{\oldbg@material}}} + +\ifbg@some + \AddThispageHook{} +\else + \AddEverypageHook{\bg@material} +\fi +\endinput +%% +%% End of file `background.sty'. |