Use \@tsp insead of hard coded 3 in \maketitle
[drexel-thesis.git] / drexel-thesis.dtx
index 1bf7dafead2f80158acbe9da1e6f9fcbc24c339b..2cce1b61d6e85b5dd06a598ffaece9957b1bbe76 100644 (file)
@@ -1,11 +1,22 @@
 % \def\fileversion{0.3}
-% \def\filedate{2010/01/09}
+% \def\filedate{2010/01/13}
 % \iffalse meta-comment
 %<class>\def\fileversion{0.3}
-%<class>\def\filedate{2010/01/09}
-%
-% Copyright (C) 2010 W. Trevor King, Daniel J. Cross, T. Tsankov, and
-%    R. Rojas.
+%<class>\def\filedate{2010/01/13}
+%
+% Copyright (C) 2010  C.Y. Ip
+%                     Christopher D. Cera
+%                     Christopher S. Dahn
+%                     Daniel J. Cross
+%                     David T. McWherter
+%                     Evan Sultanik
+%                     Jeff Arahamson
+%                     Mitchell Peabody
+%                     R. Rojas, E
+%                     Robert Bernecky
+%                     T. Tsankov
+%                     Vincent A. Cicirello
+%                     W. Trevor King
 % -------------------------------------------------------
 % 
 % This file may be distributed and/or modified under the
@@ -18,7 +29,8 @@
 % and version 1.3 or later is part of all distributions of LaTeX 
 % version 2003/12/01 or later.
 %
-% Based on Scott Pakin's dtxtut/cskeleton.dtx
+% Docstrip formatting initially based on Scott Pakin's
+% dtxtut/cskeleton.dtx
 %   http://www.ctan.org/tex-archive/info/dtxtut/
 %
 % \fi
 % \changes{0.1}{2006/01/18}{Rewrite by Daniel J.~Cross}
 % \changes{0.2}{2010/01/09}{W.~Trevor King transitioned from thesis.cls
 %   to drexel-thesis.dtx and did a good deal of reorganizing.}
-% \changes{0.3}{2010/01/11}{W.~Trevor King merged drexelthesis.cls
+% \changes{0.3}{2010/01/13}{W.~Trevor King merged drexelthesis.cls
 %   developed in the Comp.~Sci.~Department by Jeff Abrahamson,
 %   Evan Sultanik, C.Y.~Ip, Christopher S.~Dahn, Christopher D.~Cera,
 %   Mitchell Peabody, David T.~McWherter, and Vincent A.~Cicirello.
 %   \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}}
 %
 % \begin{macro}{\DUT@baselineskip}
 % Since we'll be messing with the spacing, save the single-spaced
 % baseline.
+%   \changes{0.3}{2010/01/13}{Use \\setlength to store the value at
+%     the default font.  The previous version used \\let, which made
+%     \\DUT\@baselineskip a synonym for \\baselineskip that changed
+%     with font size.}
 %    \begin{macrocode}
-\let\DUT@baselineskip\baselineskip
+\newlength\DUT@baselineskip
+\setlength\DUT@baselineskip\baselineskip
 %    \end{macrocode}
 % \end{macro}
 %
 % requires \pkg{calc} for the multiplication.
 %    \begin{macrocode}
 \newcommand{\set@lines@length}[2]{%
-  \setlength{#1}{\DUT@baselineskip * {#2}}
-}
+  \setlength{#1}{\DUT@baselineskip * {#2}}}
 %    \end{macrocode}
 % \end{macro}
 %
 % Here we deviate from \file{ltsect.dtx} to ensure single spacing for
 % the section title.
 %    \begin{macrocode}
-    \begin{spacing}{\@ssp}
+      \setstretch{\@ssp}%
       #6{%
         \@hangfrom{\hskip #3\relax\@svsec}%
           \interlinepenalty \@M #8\@@par}%
-    \end{spacing}
     \endgroup
     \csname #1mark\endcsname{#7}%
     \addcontentsline{toc}{#1}{%
 % Here we deviate from \file{ltsect.dtx} to ensure single spacing for
 % the section title.
 %    \begin{macrocode}
-    \begin{spacing}{\@ssp}
+      \setstretch{\@ssp}%
       #4{%
         \@hangfrom{\hskip #1}%
           \interlinepenalty \@M #5\@@par}%
     \endgroup
-    \end{spacing}
   \else
     \def\@svsechd{#4{\hskip #1\relax #5}}%
   \fi
 %
 % \begin{command}
 %   `\cs{blanklines}\marg{N}'
+%   `\cs{blanklines*}\marg{N}'
 % \end{command}
 % \begin{macro}{\blanklines}
-% Insert \meta{N} blank lines.
+% Insert \meta{N} blank lines.  The starred forms use |\vspace|, which
+% inserts space even at the start and end of pages.  The |p| forms
+% add a trailing |\par|.  \emph{I'm still trying to get this part working
+% cleanly\ldots}
 %    \begin{macrocode}
 \newlength\DUT@blanklines@length
-\newcommand{\blanklines}[1]{%
-  \begin{spacing}{1}
-    \set@lines@length{\DUT@blanklines@length}{#1}%
-    \vspace{\DUT@blanklines@length}
-  \end{spacing}
+\newcommand{\@blanklines@setup}[1]{%
+  \set@lines@length{\DUT@blanklines@length}{#1}%
+  %\typeout{BLANKLINES -- #1}%
+  %\showthe\DUT@blanklines@length
 }
+\newcommand{\blanklines}{\@ifstar\@sblanklines\@blanklines}
+\newcommand{\@blanklines}[1]{%
+  \@blanklines@setup{#1}%
+  \vspace{\DUT@blanklines@length}}
+\newcommand{\@sblanklines}[1]{%
+  \@blanklines@setup{#1}%
+  \vspace*{\DUT@blanklines@length}}
+\newcommand{\blanklinesp}{\@ifstar\@sblanklines\@blanklines}
+\newcommand{\@blanklinesp}[1]{%
+  \@blanklines@setup{#1}%
+  \vspace{\DUT@blanklines@length}\par}
+\newcommand{\@sblanklinesp}[1]{%
+  \@blanklines@setup{#1}%
+  \vspace*{\DUT@blanklines@length}\par}
 %    \end{macrocode}
 % \end{macro}
 %
 % Here is the title text itself.
 %    \begin{macrocode}
     \begin{center}%
-    \begin{spacing}{\@tsp}
-      {\bfseries \@title \par}%
-    \end{spacing}
-    \begin{spacing}{\@dsp}
+      {\setstretch{\@tsp} \bfseries \@title \par}%
+%    \end{macrocode}
+% We want two blank lines (triple spacing) between the title and the
+% remaining material, so add three but don't end the paragraph.
+%    \begin{macrocode}
+      \blanklines{\@tsp}%
+      \setstretch{\@dsp}%
       A Thesis\\
       Submitted to the Faculty\\
       of\\
       Drexel University\\
       by\\
-      \@author \\
+      \@author\\
       in partial fulfillment of the\\
       requirements for the degree\\
       of\\
       \@degree\\
       \def@month\ \def@year
-    \end{spacing}
     \end{center}\par
 %    \end{macrocode}
 % Some more stretchy space for the bottom if we're not in draft mode.
     \copyright~Copyright \def@year\\
     \@author.  \@copyrighttext
   \end{center}
-  \if@final \vspace*{\fill} \else \blanklines{2} \fi
+  \if@final \vspace*{\fill} \else \blanklinesp{2} \fi
 %    \end{macrocode}
 % Turn off page numbering for this page.
 %    \begin{macrocode}
 % (\file{classes.dtx}, L2540).
 %    \begin{macrocode}
 \def\@makechapterhead#1{%
-  \blanklines{2}%
+%    \end{macro}
+% Adding even a \vspace*{0\p@} here seems to increase the vertical
+% space above the chapter heading by two lines.  I'm not sure why.
+% Workaround is to pass the ``value of blanklines you want minus two''
+% to |\blanklines*|.  HACK!
+%    \begin{macro}
+  \blanklines*{-1}%
   {\parindent \z@ \raggedright \normalfont
 %    \end{macrocode}
 % Ensure single spacing.
 %    \begin{macrocode}
-    \begin{spacing}{\@ssp}
+    \setstretch{\@ssp}%
 %    \end{macrocode}
 % Prevent a pagebreak from occuring in the middle of or after the title.
 %    \begin{macrocode}
     \else
       \center \large \bfseries #1\par\nobreak
     \fi
-    \end{spacing}
 %    \end{macrocode}
-% Put a little space before the chapter body.
+% Put a little space before the chapter body.  We use four blank lines
+% to comply with the Manual 3.13 p12
+% \begin{quote}
+%   Begin the list of sources four spaces below the heading.
+% \end{quote}
 %    \begin{macrocode}
-    \blanklines{2}
+    \blanklines{4}
   }
 }
 %    \end{macrocode}
 % (\file{classes.dtx}, L2595).
 %    \begin{macrocode}
 \def\@makeschapterhead#1{%
-  \blanklines{2}%
-  {\parindent \z@ \raggedright
-    \normalfont
+  \blanklines*{-1}% HACK!
+  {\parindent \z@ \raggedright \normalfont
+    \setstretch{\@ssp}%
     \interlinepenalty\@M
-    \begin{spacing}{\@ssp}
     \center \large \bfseries  #1\par\nobreak
-    \end{spacing}
-    \blanklines{2}
+    \blanklines{4}%
   }
 }
 %    \end{macrocode}
     \pdfbookmark[0]{\dedicationsname}{\dedicationsname}
   \fi
   \chapter*{\dedicationsname}
-  \begin{spacing}{\@dsp}
+  \setstretch{\@dsp}%
 }{%
-  \end{spacing}
+  \setstretch{\@ssp}%
 }
 %    \end{macrocode}
 % \end{environment}
     \pdfbookmark[0]{\acknowledgmentsname}{\acknowledgmentsname}
   \fi
   \chapter*{\acknowledgmentsname}
-  \begin{spacing}{\@dsp}
+  \setstretch{\@dsp}%
 }{%
-  \end{spacing}
+  \setstretch{\@ssp}%
 }
 %    \end{macrocode}
 % \end{environment}
 % \begin{environment}{abstract}
 %    \begin{macrocode}
 \newenvironment{abstract}{%
-  \listed@schapter{\abstractname}
+  \listed@schapter{\abstractname}%
 %    \end{macrocode}
-% From the Manual 3.9 p10 ``The following heading must be centered at
-% the top of the page'':
-% \begin{center}
-%   Abstract \\
-%   Full Title of Dissertation or Thesis \\
-%   Author's Name as it appears on the Dissertation or Thesis
-% \end{center}
-% In the example on p20, they list the advisor's name after the
-% author, but that is not specified in the text on p10.
-%
-% On p20, ``These pages are numbered using lowercase Roman numerals.
-% Note that the heading is single spaced, but the abstract is double
-% spaced.''
+% Suck up some blank space to position the rest of the header right
+% under the chapter title.
+%    \begin{macrocode}
+  \blanklines{-4}%
+%    \end{macrocode}
+% From the Manual 3.9 p10
+% \begin{quote}
+%   \begin{itemize}
+%     \item The following heading must be centered at the top of the page
+%       \begin{center}
+%         Abstract \\
+%         Full Title of Dissertation or Thesis \\
+%         Author's Name as it appears on the Dissertation or Thesis
+%       \end{center}
+%       In the example on p20, they list the advisor's name after the
+%       author, but that is not specified in the text on p10.
+%     \item The text begins four lines below this heading.
+%   \end{itemize}
+% \end{quote}
+% On p20
+% \begin{quote}
+%   \begin{itemize}
+%     \item These pages are numbered using lowercase Roman numerals.
+%     \item Note that the heading is single spaced, but the abstract
+%       is double spaced.
+%   \end{itemize}
+% \end{quote}
 %    \begin{macrocode}
-  \blanklines{-3}
-  \begin{spacing}{\@ssp}
     \begin{center}
+      \setstretch{\@ssp}%
       \@title\\
       \@author\\
       \@advisor\\
     \end{center}
-  \end{spacing}
-  \blanklines{2}
-  \begin{spacing}{\@dsp}
+  \blanklines{4}%
+  \setstretch{\@dsp}%
   \@nobreaktrue
   \@afterindentfalse
   \@afterheading
 }{%
-  \end{spacing}
+  \setstretch{\@ssp}%
 }
 %    \end{macrocode}
 % \end{environment}
 %    \begin{macrocode}
 \newenvironment{thesis}{%
   \mainmatter
-  \begin{spacing}{\@dsp}
+  \setstretch{\@dsp}%
 }{%
-  \end{spacing}
+  \setstretch{\@ssp}%
   \DUT@clearpage
   \ifpdf
     \phantomsection
 %    \begin{macrocode}
 \newenvironment{vita}{%
   \listed@schapter{\vitaname}
-  \blanklines{1}
-  \begin{spacing}{\@dsp}
+  \setstretch{\@dsp}%
 }{%
-  \end{spacing}
+  \setstretch{\@ssp}%
 }
 %    \end{macrocode}
 % \end{environment}
 %    \begin{macrocode}
 \renewenvironment{titlepage}{\thispagestyle{empty}%
                              \setcounter{page}\z@}%
-                            {\if@final \newpage \else \blanklines{2} \fi}
+                            {\if@final \newpage \else \blanklinesp{2} \par \fi}
 %    \end{macrocode}
 % \end{environment}
 %
 % We also turn on double spacing by default, since we're no longer
 % wrapped in the |thesis| environment.
 %    \begin{macrocode}
-  \setstretch{\@dsp}
+  \setstretch{\@dsp}%
 }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\afterloftitleskip}
 % Don't add any extra space after the title (the chapter will take
-% care of that).
+% care of that).  Actually we make a one-line correction so the first
+% line matches the first line in the TOC.  HACK!
 %    \begin{macrocode}
-\setlength\cftafterloftitleskip{0pt}
+\setlength\cftafterloftitleskip{-12pt}
 %    \end{macrocode}
 % \end{macro}
 %
 %
 % \begin{macro}{\afterlottitleskip}
 % Don't add any extra space after the title (the chapter will take
-% care of that).
+% care of that).  Actually we make a one-line correction so the first
+% line matches the first line in the TOC.  HACK!
 %    \begin{macrocode}
-\setlength\cftafterlottitleskip{0pt}
+\setlength\cftafterlottitleskip{-12pt}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2838,5 +2948,28 @@ Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla}
 %    \end{macrocode}
 %
 %
+% \section{Known bugs and issues}
+%
+%
+% \subsection{Hacks}
+%
+% \begin{itemize}
+%   \item |\vspace*{0\p@}| space between page top and chapter
+%     headings (|\@makechapterhead| and |\@makeschapterhead|,
+%     Sec.~\ref{sec:implement-chapters}).
+%   \item Extra space under LOT and LOF titles compared to TOC.
+%     (Secs.~\ref{sec:implement-lof} and \ref{sec:implement-lot}).
+% \end{itemize}
+%
+%
+% \subsection{Bugs}
+%
+% \begin{itemize}
+%   \item Different space between chapter heading and section heading,
+%     vs.\ chapter heading and text.  Compare \emph{A Chapter Heading}
+%     and \emph{Another Chapter} in \file{example.pdf}.
+% \end{itemize}
+%
+%
 % \Finale
 \endinput