diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/draftwatermark')
-rw-r--r-- | Master/texmf-dist/source/latex/draftwatermark/draftwatermark.dtx | 48 |
1 files changed, 30 insertions, 18 deletions
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=<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} |