summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty')
-rw-r--r--Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty67
1 files changed, 24 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
index 7c865c2d3fb..5be94f8d1f9 100644
--- a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
+++ b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
@@ -19,25 +19,30 @@
%% This program consists of the files listed in the README.md file included
%% in the package.
%%
-%% Any modified versions of this file must be renamed with new filenames distinct
-%% from draftwatermark.sty.
+%% 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
+%% 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}%
- [2020/06/29 2.2 Put a gray textual watermark on document pages]
-
+ [2020/12/08 3.0 Put a gray textual watermark on document pages]
+\@ifundefined{AddToHook}{%
+ \PackageWarningNoLine{draftwatermark}{%
+ You appear to be running a version of LaTeX\MessageBreak
+ unsupported by current draftwatermark.\MessageBreak
+ Forcing fallback to `draftwatermark-2x` that\MessageBreak
+ uses an older code base}%
+ \RequirePackageWithOptions{draftwatermark-2x}%
+ \endinput}{}
\RequirePackage{kvoptions}
-\RequirePackage{everypage}[2007/06/20]
\RequirePackage{graphicx}
\RequirePackage{color}
-
\DeclareBoolOption[false]{firstpageonly}
\define@key{draftwatermark}{firstpage}[true]{%
\csname draftwatermark@firstpageonly#1\endcsname}
@@ -62,7 +67,6 @@
\draftwatermark@processanchor{#1}}
\define@key{draftwatermark}{color}{%
\draftwatermark@processcolor #1\@nil}
-
\def\draftwatermark@processpos#1,#2\@nil{%
\def\draftwatermark@hpos{#1}%
\def\draftwatermark@vpos{#2}}
@@ -118,7 +122,7 @@
\DraftwatermarkOptions{hpos=#1, hanchor=c}}
\newcommand\SetWatermarkVerCenter[1]{%
\DraftwatermarkOptions{vpos=#1, vanchor=m}}
-\newcommand\SetWatermarkText[1]{\DraftwatermarkOptions{text=#1}}
+\newcommand\SetWatermarkText[1]{\DraftwatermarkOptions{text={#1}}}
\newcommand\SetWatermarkColor[2][]{%
\DraftwatermarkOptions{colormodel=#1, colorspec=#2}}
\newcommand\SetWatermarkLightness[1]{%
@@ -139,9 +143,9 @@
\endgroup}}}
\newcommand\draftwatermark@printwm[1]{%
- \sbox\@tempboxa{#1}%
+ \sbox\@tempboxa{\raisebox{\depth}{#1}}%
\setlength{\@tempdima}{\draftwatermark@hpos}%
- \setlength{\@tempdimb}{\draftwatermark@vpos}%
+ \setlength{\@tempdimb}{-\draftwatermark@vpos}%
\edef \draftwatermark@tempa{\draftwatermark@hanchor}%
\@onelevel@sanitize \draftwatermark@tempa
\expandafter\def\expandafter\draftwatermark@tempb
@@ -162,53 +166,30 @@
\expandafter\def\expandafter\draftwatermark@tempb
\expandafter{\expandafter\@car \draftwatermark@tempa\@nil}%
\if \draftwatermark@tempb b%
- \addtolength\@tempdimb{-\ht\@tempboxa}%
- \addtolength\@tempdimb{-\dp\@tempboxa}%
+ \relax
\else\if \draftwatermark@tempb m%
\addtolength\@tempdimb{-0.5\ht\@tempboxa}%
- \addtolength\@tempdimb{-0.5\dp\@tempboxa}%
\else\if \draftwatermark@tempb t%
- \relax
+ \addtolength\@tempdimb{-\ht\@tempboxa}%
\else
\PackageError{draftwatermark}{%
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to top side.}%
\fi\fi\fi
- \vbox to 0pt {%
- \vspace*{-1in}%
- \vspace*{\@tempdimb}%
- \hbox to 0pt {%
- \hspace*{-1in}%
- \hspace*{\@tempdima}%
- \usebox\@tempboxa
- \hss}%
- \vss}}
+ \put(\@tempdima,\@tempdimb){\usebox\@tempboxa}%
+}
\newcommand\draftwatermark@print[1]{%
\ifdraftwatermark@stamp
\draftwatermark@printwm{#1}%
\fi}
\ifdraftwatermark@firstpageonly
- \AddThispageHook{\draftwatermark@print{\draftwatermark@markcmd}}
+ \AddToHookNext{shipout/background}{%
+ \draftwatermark@print{\draftwatermark@markcmd}}%
\else
- \AddEverypageHook{\draftwatermark@print{\draftwatermark@markcmd}}
+ \AddToHook{shipout/background}{%
+ \draftwatermark@print{\draftwatermark@markcmd}}%
\fi
-
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
\endinput
%%
%% End of file `draftwatermark.sty'.