From ac05a6c505f93fbe1868657a8117e2a8de51abe0 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 13 Jan 2010 15:02:38 -0500 Subject: [PATCH] Use Evan's watermark implementation by default --- drexel-thesis.dtx | 67 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/drexel-thesis.dtx b/drexel-thesis.dtx index 636334c..9c5d564 100644 --- a/drexel-thesis.dtx +++ b/drexel-thesis.dtx @@ -173,7 +173,7 @@ % \Lopt{twoside} & Save space. \\ % \Lopt{draftspace} & Save space. \\ % \Lopt{dottedtoc} & Might as well be consistent with \Lopt{final}. \\ -% \Lopt{draftwatermark} & It's good to have a timestamp. \\ +% \Lopt{mydraftwatermark} & It's good to have a timestamp. \\ % \end{tabular} % % \DescribeOption{finalspace} @@ -194,7 +194,12 @@ % \Lopt{draftwatermark} adds ``DRAFT \meta{date}'' watermarks to each % page. A useful way to remember that the version you're looking at % is not final. Also helps reviewers tell you what version they're -% correcting. +% correcting. Requires the \pkg{draftmark} package. +% +% \DescribeOption{mydraftwatermark} +% \Lopt{mydraftwatermark} is similar to \Lopt{draftwatermark} but +% depends on the possibly more common \pkg{xcolor}, \pkg{eso-pic}, +% and \pkg{graphicx}. % % \DescribeOption{indentfirst} % \Lopt{indentfirst} indents the first paragraph after sections etc. @@ -561,6 +566,7 @@ \newif\if@boldpart \newif\if@dottedpart \newif\if@draftwatermark +\newif\if@mydraftwatermark \newif\if@indentfirst \newif\if@final \@finalfalse % \end{macrocode} @@ -634,7 +640,18 @@ % \begin{option}{draftwatermark} % Set \Lopt{draftwatermark} flag % \begin{macrocode} -\DeclareOptionX{draftwatermark}{\@draftwatermarktrue} +\DeclareOptionX{draftwatermark}{% + \@draftwatermarktrue + \@mydraftwatermarkfalse} +% \end{macrocode} +% \end{option} +% +% \begin{option}{mydraftwatermark} +% Set \Lopt{mydraftwatermark} flag +% \begin{macrocode} +\DeclareOptionX{mydraftwatermark}{% + \@mydraftwatermarktrue + \@draftwatermarkfalse} % \end{macrocode} % \end{option} % @@ -675,7 +692,7 @@ \setkeys{drexel-thesis.cls}{twoside} \setkeys{drexel-thesis.cls}{draftspace} \setkeys{drexel-thesis.cls}{dottedtoc} - \setkeys{drexel-thesis.cls}{draftwatermark} + \setkeys{drexel-thesis.cls}{mydraftwatermark} } % \end{macrocode} % \end{option} @@ -779,6 +796,46 @@ \fi % \end{macrocode} % +% Here is Evan's alternative implementation This will not look right +% as a DVI, but it'll look fine once rendered to either a PS or PDF. +% \begin{macrocode} +\if@mydraftwatermark +% \end{macrocode} +% Use \pkg{eso-pic} for |\AddToShipoutPicture|. +% \begin{macrocode} + \RequirePackage{eso-pic} +% \end{macrocode} +% Use \pkg{xcolor} for |\definecolor|. +% \begin{macrocode} + \RequirePackage{xcolor} + \definecolor{watermark}{rgb}{0.9,0.9,0.9} +% \end{macrocode} +% Set the font explicitly to avoid being effected by the last text on +% the page having some strange font. |\sffamily| sets a sans serif +% font. +% \begin{macrocode} + \newcommand{\watermarkfont}{% + \color{watermark}}%\fontfamily{phv}\selectfont\sffamily} + \newcommand{\watermark}{% + \rule{4.25in}{0pt}\raisebox{5.5in}{% + \makebox[0pt]{% +% \end{macrocode} +% |\rotatebox| and |\resizebox| from \pkg{graphicx}. +% \begin{macrocode} + \rotatebox[origin=c]{45}{% + \resizebox{!}{1.5in}{% + {\watermarkfont DRAFT}% + }}}} + \raisebox{4.2in}{% + \makebox[0pt]{% + \rotatebox[origin=c]{45}{% + \resizebox{!}{.6in}{% + {\watermarkfont \qquad\today}% + }}}}} + \AddToShipoutPicture{\watermark{}} +\fi +% \end{macrocode} +% % % \subsubsection{\pkg{indentfirst}} % @@ -1892,9 +1949,7 @@ \setstretch{\@ssp}% \interlinepenalty\@M \center \large \bfseries #1\par\nobreak - \typeout{makeschapterhead} \blanklines{4}% - \typeout{end makeschapterhead} } } % \end{macrocode} -- 2.26.2