-% \def\fileversion{0.14}
-% \def\filedate{2010/09/21}
+% \def\fileversion{0.15}
+% \def\filedate{2013/05/21}
% \iffalse meta-comment
%<*driver>
\ProvidesFile{drexel-thesis.dtx}
\documentclass{ltxdoc}
%</driver>
%<*class|driver>
-\def\fileversion{0.14}
-\def\filedate{2010/09/21}
+\def\fileversion{0.15}
+\def\filedate{2013/05/21}
%</class|driver>
%
-% Copyright (C) 2010-2012 C.Y. Ip
+% Copyright (C) 2010-2013 C.Y. Ip
% Christopher D. Cera
% Christopher S. Dahn
% Daniel J. Cross
% \changes{0.14}{2010/09/21}{Evan Sultanik added the
% \texttt{approvalform} option for including a \LaTeX\ version of
% the T-1 thesis form.}
+% \changes{0.15}{2011/04/22}{W.~Trevor King added the
+% \texttt{nodraftwatermark} option for clearing previous watermark
+% options.}
+% \changes{0.15}{2011/04/23}{W.~Trevor King added the
+% \texttt{pagebreak} and \texttt{nopagebreak} options for
+% controlling page breaking independently of \texttt{final} and
+% \texttt{draft}.}
%
% \MakeShortVerb{\|}
% \newcommand{\pkg}[1]{\textsf{#1}}
%
% \title{The \textsf{drexel-thesis} class\thanks{This document
% corresponds to \textsf{drexel-thesis}~\fileversion, dated \filedate.}}
-% \author{W.~Trevor King \\\texttt{wking@drexel.edu}
+% \author{W.~Trevor King \\\texttt{wking@tremily.us}
% \and Daniel J.~Cross \and T.~Tsankov \and R.~Rojas. \and Evan A.~Sultanik}
% \date{\filedate}
%
% side of the page (not double-sided).'' \\
% \Lopt{finalspace} & Assorted single, double, and triple spacing
% directives. \\
-% \Lopt{dottedtoc} & From the example on p17.
+% \Lopt{pagebreak} & Conform to thesis pagebreak rules. \\
+% \Lopt{dottedtoc} & From the example on p17. \\
+% \Lopt{nodraftwatermark} & Clear any earlier watermark options.
% \end{tabular}
%
% \Lopt{draft} mode corresponds to \\
% \begin{tabular}{r p{0.8\textwidth}}
% \Lopt{twoside} & Save space. \\
% \Lopt{draftspace} & Save space. \\
+% \Lopt{nopagebreak} & Save space. \\
% \Lopt{dottedtoc} & Might as well be consistent with \Lopt{final}. \\
-% \Lopt{mydraftwatermark} & It's good to have a timestamp. \\
+% \Lopt{xdraftwatermark} & It's good to have a timestamp.
% \end{tabular}
%
% \DescribeOption{subfig}
% \DescribeOption{draftspace}
% Tighten spacing.
%
+% \DescribeOption{pagebreak}
+% Break pages between chapters and chapter-like blocks.
+%
+% \DescribeOption{nopagebreak}
+% Don't break pages between chapters and chapter-like blocks (saves paper).
+%
% \DescribeOptions{dottedtoc,boldtoc,
% dottedpart,boldpart,
% dottedchapter,boldchapter}
% \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. Requires the \pkg{draftmark} package.
+% correcting. Requires the \pkg{draftmark} package, which allows you
+% to override the default watermark style if it is not to your liking
+% (\S~\ref{sec:draftmark}).
%
-% \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{xdraftwatermark}
+% \Lopt{xdraftwatermark} is also similar to \Lopt{draftwatermark} but
+% depends on the possibly more common \pkg{xcolor}, \pkg{eso-pic}, and
+% \pkg{graphicx}.
+%
+% \DescribeOption{nodraftwatermark}
+% \Lopt{nodraftwatermark} clears any earlier watermark options. For
+% example
+% \begin{example}
+% \documentclass[draft,nodraftwatermark]{drexel-thesis}
+% \end{example}
+% will format your thesis in \Lopt{draft} mode but without a watermark.
+% On the other hand,
+% \begin{example}
+% \documentclass[draftmark,final]{drexel-thesis}
+% \end{example}
+% will also format your thesis without a watermark, because
+% \Lopt{final} sets \Lopt{nodraftwatermark} internally.
%
% \DescribeOption{indentfirst}
% \Lopt{indentfirst} indents the first paragraph after sections etc.
% \end{example}
%
% \begin{command}
+% `\cs{ifdraftwatermark}\marg{draftwatermark-mode-action}\marg{other-action}'
+% \end{command}
+% \DescribeMacro{\ifdraftwatermark}
+% \DescribeMacro{\DUTifdraftwatermark}
+% Include \Lopt{draftwatermark}-specific code (e.g. |\draftmarksetup|,
+% \S~\ref{sec:draftmark})..
+% \begin{example}
+% We \ifdraftwatermark{are}{aren't} in draftwatermark mode!
+% \end{example}
+%
+% \begin{command}
% `\cs{ifdaring}\marg{daring-action}\marg{wimpy-action}'
% \end{command}
% \DescribeMacro{\ifdaring}
% \begin{macrocode}
\newif\if@mainmatter \@mainmattertrue
\newif\if@DUT@subfigopt
+\newif\if@DUT@pagebreak
\newif\if@dottedchapter
\newif\if@boldchapter
\newif\if@boldpart
\newif\if@indenttoc
\newif\if@blackref
\newif\if@draftwatermark
-\newif\if@mydraftwatermark
+\newif\if@xdraftwatermark
\newif\if@indentfirst
\newif\if@final
\newif\if@daring
% \end{macrocode}
%
% \begin{macro}{\iffinal}
+% \begin{macro}{\DUTiffinal}
% Setup a user-friendly means for including \Lopt{final}- or
% \Lopt{draft}-specific code.
-% \changes{0.7}{2010/03/14}{W.~Trevor King added macro.}
+% \changes{0.7}{2010/03/14}{W.~Trevor King added iffinal macro.}
+% \changes{0.15}{2011/04/22}{W.~Trevor King added DUTiffinal macro.}
% \begin{macrocode}
\newcommand\iffinal[2]{\if@final #1\else #2\fi}
+\let\DUTiffinal\iffinal
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifdraftwatermark}
+% \begin{macro}{\DUTifdraftwatermark}
+% Setup a user-friendly means for including
+% \Lopt{draftwatermark}-specific code (e.g. |\draftmarksetup|,
+% \S~\ref{sec:draftmark}).
+% \changes{0.15}{2011/04/22}{W.~Trevor King added ifdraftwatermark macro.}
+% \changes{0.15}{2011/04/22}{W.~Trevor King added DUTifdraftwatermark macro.}
+% \begin{macrocode}
+\newcommand\ifdraftwatermark[2]{\if@draftwatermark #1\else #2\fi}
+\let\DUTifdraftwatermark\ifdraftwatermark
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\ifdaring}
+% \begin{macro}{\DUTifdaring}
% Setup a user-friendly means for including \Lopt{daring}-specific
% code.
-% \changes{0.11}{2010/06/04}{W.~Trevor King added macro.}
+% \changes{0.11}{2010/06/04}{W.~Trevor King added ifdaring macro.}
+% \changes{0.15}{2011/04/22}{W.~Trevor King added DUTifdaring macro.}
% \begin{macrocode}
\newcommand\ifdaring[2]{\if@daring #1\else #2\fi}
+\let\DUTifdaring\ifdaring
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\DUT@makeapprovalform}
% Typesets the T-1 thesis/dissertation approval form.
\def\@ssp{1} % single space
\def\@dsp{1} % double space
\def\@tsp{2} % triple space
+}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{pagebreak}
+% \begin{macrocode}
+\DeclareOptionX{pagebreak}{
+ \@DUT@pagebreaktrue
+% \end{macrocode}
+% Force chapters onto right-hand pages.
+% \begin{macrocode}
+ \PassOptionsToClass{openright}{book}
+}
+% \end{macrocode}
+% \end{option}
+% \begin{option}{nopagebreak}
+% \begin{macrocode}
+\DeclareOptionX{nopagebreak}{
+ \@DUT@pagebreakfalse
% \end{macrocode}
% Don't force chapters onto right-hand pages.
% \begin{macrocode}
% \begin{macrocode}
\DeclareOptionX{draftwatermark}{%
\@draftwatermarktrue
- \@mydraftwatermarkfalse}
+ \@xdraftwatermarkfalse}
% \end{macrocode}
% \end{option}
%
-% \begin{option}{mydraftwatermark}
-% Set \Lopt{mydraftwatermark} flag
+% \begin{option}{xdraftwatermark}
+% Set \Lopt{xdraftwatermark} flag
+% \changes{0.15}{2011/04/22}{W.~Trevor King renamed mydraftwatermark
+% to xdraftwatermark.}
% \begin{macrocode}
-\DeclareOptionX{mydraftwatermark}{%
- \@mydraftwatermarktrue
- \@draftwatermarkfalse}
+\DeclareOptionX{xdraftwatermark}{%
+ \@draftwatermarkfalse
+ \@xdraftwatermarktrue}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{nodraftwatermark}
+% Clear \Lopt{draftwatermark} and \Lopt{xdraftwatermark} flags
+% \changes{0.15}{2011/04/22}{W.~Trevor King added nodraftwatermark option.}
+% \begin{macrocode}
+ \DeclareOptionX{nodraftwatermark}{%
+ \@draftwatermarkfalse
+ \@xdraftwatermarkfalse}
% \end{macrocode}
% \end{option}
%
\@finaltrue
\setkeys{drexel-thesis.cls}{oneside}
\setkeys{drexel-thesis.cls}{finalspace}
+ \setkeys{drexel-thesis.cls}{pagebreak}
\setkeys{drexel-thesis.cls}{dottedtoc}
}
% \end{macrocode}
\@finalfalse
\setkeys{drexel-thesis.cls}{twoside}
\setkeys{drexel-thesis.cls}{draftspace}
+ \setkeys{drexel-thesis.cls}{nopagebreak}
\setkeys{drexel-thesis.cls}{dottedtoc}
- \setkeys{drexel-thesis.cls}{mydraftwatermark}
+ \setkeys{drexel-thesis.cls}{xdraftwatermark}
}
% \end{macrocode}
% \end{option}
%
%
% \subsubsection{\pkg{draftmark}}
+% \label{sec:draftmark}
%
% The Comp.~Sci.\ class used
% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/draftcopy/}{\pkg{draftcopy}}
\fi
% \end{macrocode}
%
-% Here is Evan's alternative implementation This will not look right
+% Travis Hoppe went for a more discrete watermark in the lower right
+% corner with something along the lines of:
+% \begin{example}
+% \ifdraftwatermark{
+% \draftmarksetup{angle=0,fontsize=24pt,color=red!45!blue!25,
+% xcoord=80,ycoord=-129,mark={DRAFT\\[12pt] \today}}
+% }{}
+% \end{example}
+%
+% 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
+\if@xdraftwatermark
% \end{macrocode}
% Use \pkg{eso-pic} for |\AddToShipoutPicture|.
% \begin{macrocode}
%
% \begin{macro}{\@DUT@clearpage}
% \begin{macro}{\@DUT@cleardoublepage}
-% Versions of |\clear*page| that only work when |\if@final| is true
-% (\file{ltoutput.dtx}, L877 and L904).
-% \begin{macrocode}
-\newcommand\@DUT@clearpage{\if@final \clearpage \fi}
-\newcommand\@DUT@cleardoublepage{\if@final \cleardoublepage \fi}
+% \begin{macro}{\@DUT@newpage}
+% Versions of |\clear*page| and |\newpage| that only work in
+% \Lopt{pagebreak} mode (\file{ltoutput.dtx}, L877 and L904).
+% Otherwise they add four blank lines.
+% \changes{0.15}{2011/04/23}{W.~Trevor King added
+% $\backslash$\@DUT\@newpage macro.}
+% \begin{macrocode}
+\newcommand\@DUT@clearpage{%
+ \if@DUT@pagebreak \clearpage \else \blanklinesp{4} \fi}
+\newcommand\@DUT@cleardoublepage{%
+ \if@DUT@pagebreak \cleardoublepage \else \blanklinesp{4} \fi}
+\newcommand\@DUT@newpage{%
+ \if@DUT@pagebreak \newpage \else \blanklinesp{4} \fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@DUT@blankpage}
% Add a useful extension to insert a blank page without numbering.
-% In draft mode, this macro is a no-op.
+% If we're not in \Lopt{pagebreak} mode, this macro is a no-op.
% \begin{macrocode}
\newcommand\@DUT@blankpage{%
- \if@final
+ \if@DUT@pagebreak
\@DUT@clearpage
\thispagestyle{empty}
\hphantom{0}
\@DUT@clearpage
- \else\fi
+ \fi
}
% \end{macrocode}
% \end{macro}
\pdfbookmark[0]{Title Page}{Title Page}
\fi
% \end{macrocode}
-% Add some stretchy space to center the title vertically if we're not
-% in draft mode.
+% Add some stretchy space to center the title vertically if we're in
+% \Lopt{pagebreak} mode.
% \begin{macrocode}
- \if@final \vspace*{\fill} \fi
+ \if@DUT@pagebreak \vspace*{\fill} \fi
% \end{macrocode}
% Here is the title text itself.
% \begin{macrocode}
% Some more stretchy space for the bottom if we're not in draft mode.
% \begin{macrocode}
% \end{macrocode}
-% Add some stretchy space to center the title vertically if we're not
-% in draft mode.
+% Add some stretchy space to center the title vertically if we're in
+% \Lopt{pagebreak} mode.
% \begin{macrocode}
- \if@final \vspace*{\fill} \fi
+ \if@DUT@pagebreak \vspace*{\fill} \fi
\end{@DUT@titlepage}%
% \end{macrocode}
% And that's it. We reset the footnote counter for the rest of the
% If we're using pdf\LaTeX, add a bookmark.
% \begin{macrocode}
\ifpdf \pdfbookmark[0]{Copyright Page}{Copyright Page} \fi
- \if@final \vspace*{\fill} \fi
+ \if@DUT@pagebreak \vspace*{\fill} \fi
\begin{center}
\copyright~Copyright \@DUT@year\\
\@DUT@author. \@DUT@copyrighttext
\end{center}
- \if@final \vspace*{\fill} \else \blanklinesp{2} \fi
+ \if@DUT@pagebreak \vspace*{\fill} \fi
% \end{macrocode}
% Turn off page numbering for this page.
% \begin{macrocode}
\thispagestyle{plain}%
\@tempswafalse
% \end{macrocode}
-% Add some stretchy space for vertical centering if we're in final mode.
+% Add some stretchy space for vertical centering if we're in
+% \Lopt{pagebreak} mode.
% \begin{macrocode}
- \if@final \null\vfil \fi
+ \if@DUT@pagebreak \null\vfil \fi
% \end{macrocode}
% Here we use |\secdef| to indicate which commands to use to make
% the actual heading.
% \begin{macro}{\@endpart}
% This macro finishes the part page, for both |\@part| and |\@spart|.
% We drop \cls{book}'s twoside handling.
-% If |\if@final| is true, we fill the current page.
+% If we're in \Lopt{pagebreak} mode, we fill the current page.
% (\file{classes.dtx}, L2435)
% \begin{macrocode}
\def\@endpart{
- \if@final \vfil\newpage \fi
+ \if@DUT@pagebreak \vfil\newpage \fi
% \end{macrocode}
% Then, when we are in twosided mode and the chapters are supposed to
% be on the right hand sides, we produce a completely blank page. We
-% don't need to check |\if@final| here, because \Lopt{draftspace} set
-% |\@openrighttrue|.
+% don't need to check \Lopt{pagebreak}-mode here, because the
+% pagebreak options set the \cls{book} opening options.
% \begin{macrocode}
\if@twoside
\if@openright
% (\file{classes.dtx}, L3111)
% \begin{macrocode}
\renewenvironment{titlepage}%
- {\thispagestyle{empty}%
- \setcounter{page}\z@}%
- {\if@final \newpage \else \blanklinesp{2} \par \fi}
+ {\thispagestyle{empty}\setcounter{page}\z@}%
+ {\@DUT@newpage}
\let\@DUT@titlepage\titlepage
\let\end@DUT@titlepage\endtitlepage
% \end{macrocode}
%
% \subsubsection{Terminal blank page}
%
-% Add a terminal blank page (when |\if@final| is true)
+% Add a terminal blank page (in \Lopt{pagebreak} mode)
% From the Manual \S 3.16 p13
% \begin{quote}
% Include a blank page (with no page number) at the end of the