texlive[55719] Master/texmf-dist: draftwatermark (1jul20)

commits+karl at tug.org commits+karl at tug.org
Wed Jul 1 22:49:42 CEST 2020


Revision: 55719
          http://tug.org/svn/texlive?view=revision&revision=55719
Author:   karl
Date:     2020-07-01 22:49:42 +0200 (Wed, 01 Jul 2020)
Log Message:
-----------
draftwatermark (1jul20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf
    trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex
    trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex
    trunk/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx
    trunk/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty

Modified: trunk/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex	2020-07-01 20:49:27 UTC (rev 55718)
+++ trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex	2020-07-01 20:49:42 UTC (rev 55719)
@@ -9,7 +9,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}

Modified: trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex	2020-07-01 20:49:27 UTC (rev 55718)
+++ trunk/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex	2020-07-01 20:49:42 UTC (rev 55719)
@@ -14,6 +14,7 @@
 \usepackage{lipsum}
 
 \SetWatermarkLightness{0.5}
+\SetWatermarkText{DRAFT\\COPY}
 
 \title{Sample document for the draftwatermark package}
 \author{}

Modified: trunk/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx	2020-07-01 20:49:27 UTC (rev 55718)
+++ trunk/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx	2020-07-01 20:49:42 UTC (rev 55719)
@@ -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 at key{draftwatermark}{pos}{%
   \draftwatermark at processpos #1\@nil}
@@ -900,7 +912,7 @@
       \fi
       \setlength{\@tempdima}{\draftwatermark at fontsize}%
       \fontsize{\@tempdima}{1.2\@tempdima}\selectfont
-      \draftwatermark at text
+      \shortstack[\draftwatermark at alignment]{\draftwatermark at text}%
       \endgroup}}}
 
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty	2020-07-01 20:49:27 UTC (rev 55718)
+++ trunk/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty	2020-07-01 20:49:42 UTC (rev 55719)
@@ -31,7 +31,7 @@
 %% 
 \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]
 
 \RequirePackage{kvoptions}
 \RequirePackage{everypage}[2007/06/20]
@@ -54,6 +54,7 @@
 \DeclareStringOption[0.8]{colorspec}
 \DeclareStringOption[c]{hanchor}
 \DeclareStringOption[m]{vanchor}
+\DeclareStringOption[c]{alignment}
 \DeclareStringOption[\DraftwatermarkStdMark]{markcmd}
 \define at key{draftwatermark}{pos}{%
   \draftwatermark at processpos #1\@nil}
@@ -134,7 +135,7 @@
       \fi
       \setlength{\@tempdima}{\draftwatermark at fontsize}%
       \fontsize{\@tempdima}{1.2\@tempdima}\selectfont
-      \draftwatermark at text
+      \shortstack[\draftwatermark at alignment]{\draftwatermark at text}%
       \endgroup}}}
 
 \newcommand\draftwatermark at printwm[1]{%



More information about the tex-live-commits mailing list.