Use Evan's watermark implementation by default
authorW. Trevor King <wking@drexel.edu>
Wed, 13 Jan 2010 20:02:38 +0000 (15:02 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 13 Jan 2010 20:02:38 +0000 (15:02 -0500)
drexel-thesis.dtx

index 636334cd20d0e8f2c771605d14f5d5a991299bf8..9c5d5646c58532f62750e7728a210cfc317576dd 100644 (file)
 %   \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}
 % \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.
 \newif\if@boldpart
 \newif\if@dottedpart
 \newif\if@draftwatermark
+\newif\if@mydraftwatermark
 \newif\if@indentfirst
 \newif\if@final \@finalfalse
 %    \end{macrocode}
 % \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}
 %
   \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}
 \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}}
 %
     \setstretch{\@ssp}%
     \interlinepenalty\@M
     \center \large \bfseries  #1\par\nobreak
-    \typeout{makeschapterhead}
     \blanklines{4}%
-    \typeout{end makeschapterhead}
   }
 }
 %    \end{macrocode}