summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/draftwatermark
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-05 03:02:44 +0000
committerNorbert Preining <norbert@preining.info>2024-03-05 03:02:44 +0000
commit262a8b0c9d7aa383a7d1ec3a2efa25817abfc2d6 (patch)
treeaec7f5d2ebb9b9bc2939469f0deec23ce81b9d51 /macros/latex/contrib/draftwatermark
parent2af51a2a2d7a231effe8ef99a49b76d8c65e80be (diff)
CTAN sync 202403050302
Diffstat (limited to 'macros/latex/contrib/draftwatermark')
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.dtx69
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.pdfbin153827 -> 155364 bytes
2 files changed, 42 insertions, 27 deletions
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.dtx b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
index 1263ae637a..7efd7d98f0 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.dtx
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
@@ -40,12 +40,12 @@
%
% \fi
%
-% \CheckSum{576}
+% \CheckSum{577}
%
% \def\filename{draftwatermark.dtx}
-% \def\fileversion{3.1}
-% \def\filedate{2024/01/22}
-% \def\docdate{2024/01/22}
+% \def\fileversion{3.3}
+% \def\filedate{2024/03/04}
+% \def\docdate{2024/03/03}
%
% \DoNotIndex{\\}
% \DoNotIndex{\begin, \end, \begingroup, \endgroup}
@@ -80,7 +80,7 @@
% \DoNotIndex{\wd, \wmbox}
%
% \setcounter{IndexColumns}{2}
-% \setlength{\IndexMin}{3cm}
+% \setlength{\IndexMin}{3cm}
%
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\texttt {#1}} ^^A typeset an option
@@ -95,7 +95,7 @@
%
% \author{%
% Sergio Callegari\thanks{Sergio Callegari can be reached at
-% \texttt{sergio.callegari at gmail dot com}}}
+% \texttt{sergio.callegari at gmail dot com}}}
%
% \date{\docdate}
%
@@ -117,7 +117,7 @@
% the \emph{KOMA script} bundle or directly using the new \hologo{LaTeX}
% shipout hooks.
% \end{abstract}
-%
+%
% \section{Introduction}
%
% \changes{R1.0}{2006/06/30}{Initial release.}%
@@ -211,7 +211,7 @@
% \begin{itemize}
% \changes{R1.1}{2012/01/06}{Introduce the ``stamp'', ``nostamp'' and
% ``final'' options to control whether the watermark should actually
-% be printed.}^^A
+% be printed.}^^A
% \item \verb!firstpageonly=true|false!\\
% If no value is provided, |true| is assumed. Default is |false|.\\
% Instructs \Lpack{draftwatermark} to only apply the watermark on the
@@ -459,7 +459,7 @@
% \subsection{Compatibility notes for package version 3.0 and later}
%
% \changes{R3.0}{2020/12/08}{Remove dependency on package
-% \Lpack{everypage}.}^^A
+% \Lpack{everypage}.}^^A
% Version 3.0 of the package takes advantage of the new functionalities
% introduced in \hologo{LaTeX} with the Fall 2020 release and gets rid of
% its dependency on \Lpack{everypage}. In principle, this could result in
@@ -542,7 +542,7 @@
% As an example, consider this first document source:
%
% \iffalse
-%<*samplecode-modern>
+%<*samplecode-modern>
% \fi
% \begin{macrocode}
\documentclass{article}
@@ -579,7 +579,7 @@
% Using the legacy interface, the source for the same sample document as
% above would look like:
% \iffalse
-%<*samplecode-legacy>
+%<*samplecode-legacy>
% \fi
% \begin{macrocode}
\documentclass{article}
@@ -618,7 +618,7 @@
% right top angle of every page. With the modern interface, such a result
% can be easily obtained as in the following sample code:
% \iffalse
-%<*samplecode-anchor>
+%<*samplecode-anchor>
% \fi
% \begin{macrocode}
\documentclass{article}
@@ -655,7 +655,7 @@
% of conditionals to achieve effects such as differentiating the watermark
% for odd and even pages, as shown in the following code:
% \iffalse
-%<*samplecode-dynamic>
+%<*samplecode-dynamic>
% \fi
% \begin{macrocode}
\documentclass{article}
@@ -697,7 +697,7 @@
% following example shows how it can be used, once again differentiating
% the watermark for odd and even pages.
%\iffalse
-%<*samplecode-custom>
+%<*samplecode-custom>
% \fi
% \begin{macrocode}
\documentclass{article}
@@ -737,7 +737,7 @@
%</samplecode-custom>
% \fi
%
-%
+%
% \section{Development and support}
%
% The package is developed on \emph{github}:
@@ -750,26 +750,27 @@
% against some fundamental design decisions.
%
% \StopEventually {}
-%
+%
% \section{Implementation}
% \subsection{Implementation of \Lpack{draftwatermark}}
%
% Announce the name and version of the package, which requires
% \LaTeXe.
+% \changes{R3.2}{2024/03/03}{Fix version number of main package.}^^A
% \iffalse
%<*draftwatermark>
% \fi
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{draftwatermark}%
- [2020/12/08 3.0 Put a gray textual watermark on document pages]
+ [2024/03/04 3.3 Put a gray textual watermark on document pages]
% \end{macrocode}
% \changes{R3.0}{2020/12/08}{Automatically load legacy code for older
% \hologo{LaTeX} formats.}^^A
% Depending on the actual functionalities provided by \hologo{LaTeX}
% consider loading \Lpack{draftwatermark-2x}. If so doing, warn about this,
% and hand over the operation to that package.
-% \begin{macrocode}
+% \begin{macrocode}
\@ifundefined{AddToHook}{%
\PackageWarningNoLine{draftwatermark}{%
You appear to be running a version of LaTeX\MessageBreak
@@ -867,7 +868,7 @@
% \begin{macrocode}
\ProcessKeyvalOptions*
% \end{macrocode}
-%
+%
% \dots\, and then disable the |firstpageonly| and |firstpage| options,
% that can only be used at the package loading time.
% \begin{macrocode}
@@ -979,7 +980,7 @@
\PackageError{draftwatermark}{%
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to left side.}%
- \fi\fi\fi
+ \fi\fi\fi
\edef \draftwatermark@tempa{\draftwatermark@vanchor}%
\@onelevel@sanitize \draftwatermark@tempa
\expandafter\def\expandafter\draftwatermark@tempb
@@ -994,7 +995,7 @@
\PackageError{draftwatermark}{%
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to top side.}%
- \fi\fi\fi
+ \fi\fi\fi
\put(\@tempdima,\@tempdimb){\usebox\@tempboxa}%
}
@@ -1008,7 +1009,7 @@
\fi}
% \end{macrocode}
%
-% \dots\, and finally the code to set up the \Lpack{everypage} hooks to
+% \dots\, now, the code to set up the \Lpack{everypage} hooks to
% assure that the watermark printing commands are called when needed
% \begin{macrocode}
\ifdraftwatermark@firstpageonly
@@ -1019,6 +1020,19 @@
\draftwatermark@print{\draftwatermark@markcmd}}%
\fi
% \end{macrocode}
+% Finally, declare precedence rules with respect to shipout/background
+% hooks that may be set up by other packages. These are important
+% because they end up controlling the stacking of background
+% artifacts. Specifically, the draft watermark should go below
+% anything else. A notable package that must be considered is
+% \Lpack{eso-pic}, particularly because it gets used by
+% \Lpack{pdfpages}
+% \changes{R3.3}{2024/03/04}{Declare precedence rules with respect to
+% other users of the shipout/background hook. This fixes the
+% background stacking order when using \Lpack{pdfpages}.}%
+% \begin{macrocode}
+\DeclareHookRule{shipout/background}{draftwatermark}{<}{eso-pic}
+% \end{macrocode}
% \iffalse
%</draftwatermark>
% \fi
@@ -1027,12 +1041,13 @@
%
% Announce the name and version of the package, which requires
% \LaTeXe.
+% \changes{R3.2}{2024/03/03}{Fix name of legacy package.}
% \iffalse
%<*draftwatermark-2x>
% \fi
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{draftwatermark}%
+\ProvidesPackage{draftwatermark-2x}%
[2020/12/06 2.3 Put a gray textual watermark on document pages]
% \end{macrocode}
@@ -1131,7 +1146,7 @@
% \begin{macrocode}
\ProcessKeyvalOptions*
% \end{macrocode}
-%
+%
% \dots\, and then disable the |firstpageonly| and |firstpage| options,
% that can only be used at the package loading time.
% \begin{macrocode}
@@ -1241,7 +1256,7 @@
\PackageError{draftwatermark}{%
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to left side.}%
- \fi\fi\fi
+ \fi\fi\fi
\edef \draftwatermark@tempa{\draftwatermark@vanchor}%
\@onelevel@sanitize \draftwatermark@tempa
\expandafter\def\expandafter\draftwatermark@tempb
@@ -1258,7 +1273,7 @@
\PackageError{draftwatermark}{%
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to top side.}%
- \fi\fi\fi
+ \fi\fi\fi
\vbox to 0pt {%
\vspace*{-1in}%
\vspace*{\@tempdimb}%
@@ -1315,7 +1330,7 @@
% Right brace \} Tilde \~}
\endinput
-%%% Local Variables:
+%%% Local Variables:
%%% mode: doctex
%%% TeX-master: t
%%% End:
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.pdf b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
index 6ca13c405c..8de1926f10 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.pdf
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
Binary files differ