summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/draftwatermark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-07-02 03:03:05 +0000
committerNorbert Preining <norbert@preining.info>2020-07-02 03:03:05 +0000
commitc2b7c45f7c8c093b8bc730da9abaa919d8327491 (patch)
tree640532738a3185f8a21d3080746e2a87059f9577 /macros/latex/contrib/draftwatermark
parentd79a721c345c9a2ced6c0640e88c10cc3378c1f0 (diff)
CTAN sync 202007020303
Diffstat (limited to 'macros/latex/contrib/draftwatermark')
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.dtx48
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.pdfbin264359 -> 264619 bytes
2 files changed, 30 insertions, 18 deletions
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.dtx b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
index ab5cb3b948..b759f29eb7 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.dtx
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
@@ -31,6 +31,7 @@
\setcounter{IndexColumns}{2}
\setlength{\IndexMin}{3cm}
+\DoNotIndex{\\}
\DoNotIndex{\begin, \end, \begingroup, \endgroup}
\DoNotIndex{\csname, \endcsname}
\DoNotIndex{\if, \else, \fi}
@@ -54,7 +55,7 @@
\ProcessKeyvalOptions, \ProvidesPackage}
\DoNotIndex{\relax, \RequirePackage, \rotatebox}
\DoNotIndex{\savebox, \sbox, \scalebox, \section, \selectfont, \setkeys,
- \setlength, \sffamily}
+ \setlength, \sffamily, \shortstack}
\DoNotIndex{\thepage, \title}
\DoNotIndex{\usebox, \usepackage}
\DoNotIndex{\vbox, \vspace, \vss}
@@ -69,12 +70,12 @@
%
% \fi
%
-% \CheckSum{288}
+% \CheckSum{291}
%
% \def\filename{draftwatermark.dtx}
-% \def\fileversion{2.1}
-% \def\filedate{2020/05/11}
-% \def\docdate{2020/05/11}
+% \def\fileversion{2.2}
+% \def\filedate{2020/06/29}
+% \def\docdate{2020/06/29}
%
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\texttt {#1}} ^^A typeset an option
@@ -257,6 +258,11 @@
% for the |hanchor| and |vanchor| options. For instance, if the anchor
% specification is |lt|, then the top left corner of the watermark is
% placed at the position specified by the |hpos| and |vpos| options.
+% \item \verb!alignment=l|c|r!\\
+% Default is |c|.\\
+% Defines the alignment for the watermark text in case it contains line
+% breaks. Specifically, |l| aligns left, |c| aligns at the center and
+% |r| aligns right.
% \item |colormodel=<color model>|\\
% Defaults to |gray|.\\
% Defines the color model for the specification of the color of the
@@ -344,17 +350,19 @@
% a plain string. Conversely, it may include formatting marks, such as
% line break commands (e.g., |\\|) or commands to select font variants
% (e.g., |\bfseries|). In fact, it is also possible to use a command to
-% include an image as the text. A word of caution is necessary, though. To
-% use \LaTeX\ commands in the watermark text, please configure the latter
-% via the |\DraftwatermarkOptions| command. Trying to do so by passing
-% options to the \Lpack{draftwatermark} package via the |\usepackage|
-% mechanism may fail due to how \LaTeX\ parses option strings. Also note
-% that the text may need to be surrounded by braces.
+% include an image as the text. In case line breaks are present, the text
+% is left, right, center aligned according to the |alignment| option. A
+% word of caution is necessary, though. To use \LaTeX\ commands in the
+% watermark text, please configure the latter via the
+% |\DraftwatermarkOptions| command. Trying to do so by passing options to
+% the \Lpack{draftwatermark} package via the |\usepackage| mechanism may
+% fail due to how \LaTeX\ parses option strings. Also note that the text
+% may need to be surrounded by braces.
%
% If the watermark text includes line breaks, \Lpack{draftwatermark} will
-% use a default interline space set to 1.2 times the font size. Consider
-% that multiline texts with alignment, taking up their natural width can
-% easily be obtained with the |\shortstack| command.
+% use a very thin interline space, according to the fact that the
+% multi-line text is managed by surrounding the it with a \LaTeX\
+% |shortstack| command.
%
% Also, note that the watermark typesetting happens inside a \TeX\
% group, to make sure that any parameter setting you do in the |text|
@@ -497,7 +505,8 @@
\documentclass{article}
\usepackage[named]{xcolor}
\usepackage[T1]{fontenc}
-\usepackage[firstpageonly, color={[gray]{0.5}}]{draftwatermark}
+\usepackage[firstpageonly, color={[gray]{0.5}},
+ text=DRAFT\\COPY]{draftwatermark}
\usepackage{mathptmx}
\usepackage{lipsum}
\title{Sample document for the draftwatermark package}
@@ -539,6 +548,7 @@
\usepackage{lipsum}
\SetWatermarkLightness{0.5}
+\SetWatermarkText{DRAFT\\COPY}
\title{Sample document for the draftwatermark package}
\author{}
@@ -711,7 +721,8 @@
% \item[2.0 - 2020/03/08] Configuration management overhaul; introduction
% of a legacy interface for compatibility.
% \item[2.1 - 2020/05/11] Allow anchor information to be re-evaluated on
-% every page
+% every page.
+% \item[2.2 - 2020/06/29] Make line breaks in watermark text work.
% \end{description}
%
% \StopEventually {}
@@ -726,7 +737,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{draftwatermark}%
- [2020/05/11 2.1 Put a gray textual watermark on document pages]
+ [2020/06/29 2.2 Put a gray textual watermark on document pages]
% \end{macrocode}
%
@@ -757,6 +768,7 @@
\DeclareStringOption[0.8]{colorspec}
\DeclareStringOption[c]{hanchor}
\DeclareStringOption[m]{vanchor}
+\DeclareStringOption[c]{alignment}
\DeclareStringOption[\DraftwatermarkStdMark]{markcmd}
\define@key{draftwatermark}{pos}{%
\draftwatermark@processpos #1\@nil}
@@ -900,7 +912,7 @@
\fi
\setlength{\@tempdima}{\draftwatermark@fontsize}%
\fontsize{\@tempdima}{1.2\@tempdima}\selectfont
- \draftwatermark@text
+ \shortstack[\draftwatermark@alignment]{\draftwatermark@text}%
\endgroup}}}
% \end{macrocode}
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.pdf b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
index 059d0262dc..e872276964 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.pdf
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
Binary files differ