From 217f4d072b9ff774eb8b4399999744824cac8d9a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 1 Jul 2020 20:49:42 +0000 Subject: draftwatermark (1jul20) git-svn-id: svn://tug.org/texlive/trunk@55719 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/draftwatermark/draftwatermark.pdf | Bin 264359 -> 264619 bytes .../latex/draftwatermark/test_draftwatermark1.tex | 3 +- .../latex/draftwatermark/test_draftwatermark2.tex | 1 + .../source/latex/draftwatermark/draftwatermark.dtx | 48 +++++++++++++-------- .../tex/latex/draftwatermark/draftwatermark.sty | 5 ++- 5 files changed, 36 insertions(+), 21 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf b/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf index 059d0262dcc..e8722769642 100644 Binary files a/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf and b/Master/texmf-dist/doc/latex/draftwatermark/draftwatermark.pdf differ diff --git a/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex b/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex index f5c835bfd17..c24a8d6270e 100644 --- a/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex +++ b/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark1.tex @@ -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} diff --git a/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex b/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex index dbefa42ee96..331c41841bc 100644 --- a/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex +++ b/Master/texmf-dist/doc/latex/draftwatermark/test_draftwatermark2.tex @@ -14,6 +14,7 @@ \usepackage{lipsum} \SetWatermarkLightness{0.5} +\SetWatermarkText{DRAFT\\COPY} \title{Sample document for the draftwatermark package} \author{} diff --git a/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx b/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx index ab5cb3b948e..b759f29eb76 100644 --- a/Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx +++ b/Master/texmf-dist/source/latex/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=|\\ % 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/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty index 3829e8251a7..7c865c2d3fb 100644 --- a/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty +++ b/Master/texmf-dist/tex/latex/draftwatermark/draftwatermark.sty @@ -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@key{draftwatermark}{pos}{% \draftwatermark@processpos #1\@nil} @@ -134,7 +135,7 @@ \fi \setlength{\@tempdima}{\draftwatermark@fontsize}% \fontsize{\@tempdima}{1.2\@tempdima}\selectfont - \draftwatermark@text + \shortstack[\draftwatermark@alignment]{\draftwatermark@text}% \endgroup}}} \newcommand\draftwatermark@printwm[1]{% -- cgit v1.2.3