Updated CC license to version 3.0
[drexel-thesis.git] / drexel-thesis.dtx
index b5b91b8a27cbcef91e890979bb0b7e6b0881d738..ea928ece2afa596b15f1ceea3b755cd5759bf568 100644 (file)
 % \MakeShortVerb{\|}
 % \newcommand{\pkg}[1]{\textsf{#1}}
 % \newcommand{\cls}[1]{\textsf{#1}}
-% ^^A\newcommand{\BibTeX}{{\sc Bib}\TeX}
+% ^^A\newcommand{\BibTeX}{{\scshape Bib}\TeX}
 % 
 % \title{The \textsf{drexel-thesis} class\thanks{This document
 %   corresponds to \textsf{drexel-thesis}~\fileversion, dated \filedate.}}
 % \DescribeOptions{dottedtoc,boldtoc,
 %                  dottedpart,boldpart,
 %                  dottedchapter,boldchapter}
-% These options change how the relevant TOC lines are printed
-% \LaTeX\ defaults to bold but not dots.  The \Lopt{*toc} options set
-% all of the types.  For example, \Lopt{boldtoc} is equivalent to
-% \Lopt{boldchapter,boldpart}.
+% These options change how the relevant table of contents lines are
+% printed.  \LaTeX\ defaults to bold but not dots.  The \Lopt{*toc}
+% options set all of the types.  For example, \Lopt{boldtoc} is
+% equivalent to \Lopt{boldchapter,boldpart}.
 %
 % \DescribeOption{draftwatermark}
 % \Lopt{draftwatermark} adds ``DRAFT \meta{date}'' watermarks to each
 % is not final.  Also helps reviewers tell you what version they're
 % correcting.
 %
+% \DescribeOption{indentfirst}
+% \Lopt{indentfirst} indents the first paragraph after sections etc.
+%
 %
 % \subsubsection{Interesting \cls{book} options}
 % 
 % \begin{example}
 %   \advisor{John A. Wheeler, Ph.D.}
 % \end{example}
+% You can set multiple advisors, if appropriate, by calling |\advisor|
+% multiple times.
+% \begin{example}
+%   \advisor{John A. Wheeler, Ph.D.}
+%   \advisor{Advisor 2}
+% \end{example}
 % See the Manual 3.1 p8.
 %
 % \begin{command}
 %   `\cs{listoftables}'
 % \end{command}
 % \DescribeMacro{\listoftables}
-% Write the List of Tables page (Manual 3.7 p10).
+% Write the List of Tables page (Manual 3.6 p10).
 % Skip if you have no tables in your thesis.
 %
 % \begin{command}
 %
 % \subsubsection{Tables and Figures}
 %
-% From the Manual 2.3 p6, ``Tables and Figures'', 
-% \begin{quote}
-%   Place figure captions below figures.
-%   Place table captions above tables.
-% \end{quote}
-% so make sure the |\caption| command is in the appropriate location.
-% For example
+% \pkg{drexel-thesis} loads
+% \href{http://www.ctan.org/tex-archive/macros/latex/required/graphics/}{\pkg{graphicx}}
+% to define the |\includegraphics| macro,
+% \href{http://www.ctan.org/tex-archive/macros/latex/required/caption/}{\pkg{caption}}
+% for pretty caption formatting, and
+% \href{http://www.ctan.org/tex-archive/macros/latex/required/floatrow/}{\pkg{floatrow}}
+% for placing captions.
+%
+% Simple float definitions will look like
 % \begin{example}
 %   \begin{table}
 %      \caption{Some caption text}
 %      \caption{Some caption text}
 %   \end{float}
 % \end{example}
-% \pkg{drexel-thesis} loads
-% \href{http://www.ctan.org/tex-archive/macros/latex/required/graphics/}{\pkg{graphicx}}
-% to define the |\includegraphics| macro.  For more useful
-% float information, see the
+% For more useful float information, see the
 % \href{http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions}
 %   {\LaTeX\ wikibook page}.
 % 
 \newif\if@boldpart
 \newif\if@dottedpart
 \newif\if@draftwatermark
-\newif\if@appendix
+\newif\if@indentfirst
 \newif\if@final \@finalfalse
 %    \end{macrocode}
 %
 % \end{option}
 %
 % \begin{option}{draftwatermark}
-% Set draft watermark flag
+% Set \Lopt{draftwatermark} flag
 %    \begin{macrocode}
 \DeclareOptionX{draftwatermark}{\@draftwatermarktrue}
 %    \end{macrocode}
 % \end{option}
 %
+% \begin{option}{indentfirst}
+% Set \Lopt{indentfirst} flag
+%    \begin{macrocode}
+\DeclareOptionX{indentfirst}{\@indentfirsttrue}
+%    \end{macrocode}
+% \end{option}
+%
 % Define the book options that \Lopt{final} and \Lopt{draft} need to
 % access.
 % \begin{option}{oneside}
 %
 % \subsection{Internal package includes}
 %
-
+%
 % Include some other packages we'll need.  If the package is not
 % installed on your system, see Section \ref{sec:dependencies} for
 % installation instructions.
 \RequirePackage{setspace}
 %    \end{macrocode}
 %
+%
 % \subsubsection{\pkg{calc}}
 %
 % \href{http://www.ctan.org/tex-archive/macros/latex/required/tools/}{\pkg{calc}}
-% for |\blanklines| macro.
+% for |\set@lines@length| macro (page
+%   \pageref{sec:implement-line-spacing}).
 %    \begin{macrocode}
 \RequirePackage{calc}
 %    \end{macrocode}
 %
+%
 % \subsubsection{\pkg{graphicx}}
 %
 % \href{http://www.ctan.org/tex-archive/macros/latex/required/graphics/}{\pkg{graphicx}}
 %     [final]
 % \end{example}
 %
+%
 % \subsubsection{\pkg{draftmark}}
 %
 % The Comp.~Sci.\ class used
 % which unfortunately has a number of apparently non-standard dependencies
 % (\href{http://www.ctan.org/tex-archive/macros/latex/contrib/etextools/}{\pkg{etextools}},
 %  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/etoolbox/}{\pkg{etoolbox}},
-%  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/xifthen/}{\pkg{xifthen}},
+%  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/lastpage/}{\pkg{lastpage}},
 %  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/ltxnew/}{\pkg{ltxnew}},
 %  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/pagerange/}{\pkg{pagerange}},
-%  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/lastpage/}{\pkg{lastpage}},
+%  \href{http://www.ctan.org/tex-archive/macros/latex/contrib/xifthen/}{\pkg{xifthen}},
 %  if only I had the space to install |texlive-latexextra| |:p|).
 % The output is, however, very flexible, and it \emph{does} work with
 % both \LaTeX\ and pdf\LaTeX.  If you don't like the default watermark,
 \fi
 %    \end{macrocode}
 %
+%
+% \subsubsection{\pkg{indentfirst}}
+%
+% Indent the first paragraph after sections etc.\ with
+% \href{http://www.ctan.org/tex-archive/macros/latex/required/tools/}{\pkg{indentfirst}}.
+%    \begin{macrocode}
+\if@indentfirst
+  \RequirePackage{indentfirst}
+\fi
+%    \end{macrocode}
+%
+%
 % \subsubsection{\pkg{geometry}}
 %
-% Setup page margins with the
-% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/geometry/}{\pkg{geometry}}
-% package.  From the Manual p5:
+% Setup page margins with
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/geometry/}{\pkg{geometry}}.
+% From the Manual p5:
 % \begin{itemize}
 %   \item The left margin must be at least 1 1/2'' (1.5 inches)
 %   throughout the document.
 % Note that we include the \pkg{geometry} package after loading \cls{book} to
 % override the margin manipulation that takes place in \cls{book}.
 %
+%
+% \subsubsection{\pkg{tocloft}}
+%
+% Typeset the table of contents, etc., with
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/tocloft/}{\pkg{tocloft}}.
+%    \begin{macrocode}
+\RequirePackage{tocloft}
+%    \end{macrocode}
+% The configuration of \pkg{tocloft} takes place in Sections
+% \ref{sec:implement-toc}, \ref{sec:implement-lof}, and
+% \ref{sec:implement-lot}.
+%
+%
+% \subsubsection{\pkg{caption}}
+%
+% Get nice caption formatting with
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/caption/}{\pkg{caption}}.
+% From the Manual p5:
+% \begin{itemize}
+%   \item The left margin must be at least 1 1/2'' (1.5 inches)
+%   throughout the document.
+%   \item All other margins (top, bottom, and right) must be at least 1''.
+% \end{itemize}
+%    \begin{macrocode}
+\RequirePackage[margin=10pt,labelfont=bf,labelsep=colon]{caption}
+%    \end{macrocode}
+% You can change these settings if you like using |\captionsetup|.
+%
+%
+% \subsubsection{\pkg{floatrow}}
+% \label{sec:floatrow}
+%
+% Enforce caption placement with
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/floatrow/}{\pkg{floatrow}}.
+% From the Manual 2.3 p6, ``Tables and Figures'', 
+% \begin{quote}
+%   \begin{itemize}
+%     \item Place figure captions below figures.
+%     \item Place table captions above tables.
+%   \end{itemize}
+% \end{quote}
+%    \begin{macrocode}
+\RequirePackage{floatrow}
+\floatsetup[table]{style=plaintop}
+\floatsetup{captionskip=10pt}
+\floatsetup[table]{captionskip=10pt}
+%    \end{macrocode}
+% We set up the three-line surrounding spaces in Section
+% \ref{sec:implement-floats}.
+%
+% You can change these settings using |\floatsetup|, but you probably
+% won't need to.
+%
+%
 % \subsubsection{\pkg{fancyhdr}}
 %
 % \href{http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/}{\pkg{fancyhdr}}
 % for correct page numbering and fancy headers.
+% From the Manual 2.3 p5, ``Pagination''
+% \begin{quote}
+%   Place page numbers in the upper right-hand corner of the page,
+%   3/4'' from the top.
+% \end{quote}
 %    \begin{macrocode}
 \RequirePackage{fancyhdr}
 %    \end{macrocode}
-% Setup the standard |fancy| format.  |\leftmark| is the higher level
-% mark, see |\chaptermark| below.  |\rightmark| is the lower level
-% mark, see |\sectionmark| below.
+% Setup the standard |fancy| format.
 %    \begin{macrocode}
 \pagestyle{fancy}
 \fancyhf{}
-\fancyhead[LE,RO]{\slshape\rightmark}
-\fancyhead[LO,RE]{\slshape\leftmark}
-\fancyfoot[LE,RO]{\thepage}
+\renewcommand{\headrulewidth}{0pt}
 %    \end{macrocode}
-% Override the |plain| format (for chapter pages, etc.).
+% 0.4 pt is \pkg{fancyhdr}'s default |\headrulewidth|, so we'll
+% recycle the value.
+%    \begin{macrocode}
+\renewcommand{\footrulewidth}{0.4pt}
+%    \end{macrocode}
+% |\leftmark| is the higher level mark, see |\chaptermark| below.
+% |\rightmark| is the lower level mark, see |\sectionmark| below.
+% We put the lower level mark to the outside because it changes more
+% often.  Page numbers also go on the outside.
+%    \begin{macrocode}
+\fancyfoot[RE,LO]{\slshape\leftmark}
+\fancyfoot[LE,RO]{\slshape\rightmark}
+\fancyhead[LE,RO]{\thepage}
+%    \end{macrocode}
+% Override the |plain| format (for part pages, etc.).
 %    \begin{macrocode}
 \fancypagestyle{plain}{
   \fancyhf{}
-  \renewcommand{\headrulewidth}{0pt}
-  \fancyfoot[LE,RO]{\thepage}
+  \renewcommand{\footrulewidth}{0pt}
+  \fancyhead[LE,RO]{\thepage}
+}
+%    \end{macrocode}
+% Keep the |empty| format at its default.
+%    \begin{macrocode}
+\fancypagestyle{empty}{
+  \fancyhf{}
+  \renewcommand{\footrulewidth}{0pt}
 }
 %    \end{macrocode}
 %
 %
 % In a similar vein, we some additional meta-info macros.
 %
-%  \begin{macro}{\advisor}
-%  \begin{macro}{\@advisor}
-% |\advisor| for use in |\maketitle|.  If not given |\maketitle| will
-% produce an error message.
-%    \begin{macrocode}
-\def\advisor#1{\gdef\@advisor{#1}}
-\def\@advisor{\@latex@error{No \noexpand\advisor given}\@ehc}
-%    \end{macrocode}
-%  \end{macro}
-%  \end{macro}
-%
 %  \begin{macro}{\defmonth}
 %  \begin{macro}{\@defmonth}
 % |\defmonth| (defense month) for use in |\maketitle|.  If not given
 %    \begin{macrocode}
 \def\degree#1{\gdef\@degree{#1}
   \ifpdf \hypersetup{pdfsubject={\@degree}} \fi}
-\def\@advisor{\@latex@error{No \noexpand\degree given}\@ehc}
+\def\@degree{\@latex@error{No \noexpand\degree given}\@ehc}
 %    \end{macrocode}
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
 %
+%  \begin{macro}{\advisor}
+%  \begin{macro}{\@advisor}
+% |\advisor| for use in |\maketitle|.  If not given |\maketitle| will
+% produce an error message.  We get a bit fancier here to support
+% multiple advisors.
+%    \begin{macrocode}
+\newcounter{advisors}
+\setcounter{advisors}{0}
+\newcommand\advisor[1]{%
+  \ifx
+%    \end{macrocode}
+% If |#1| is |\empty|, this call is a no-op.
+%    \begin{macrocode}
+    \empty{#1}
+  \else
+%    \end{macrocode}
+% Save the advisors to |\@advisor@a|, |\@advisor@b|, \ldots.
+% |\alph{|\Lcount{COUNTER}|}| (\file{ltcounts.dtx}, L319) prints the
+%   value of \Lcount{COUNTER} as a lowercase letter: $1 =$~a, $2 =$~
+%   b, etc.
+%    \begin{macrocode}
+    \stepcounter{advisors}
+    \expandafter\gdef\csname @advisor@\alph{advisors}\endcsname{#1}
+  \fi}
+\newcommand\@advisor{%
+  \ifnum\c@advisors=0%
+    \@latex@error{No \noexpand\advisor given}\@ehc%
+  \else%
+%    \end{macrocode}
+% Start a group so \Lcount{advisor@loop} is released afterwards to
+% save memory.
+%    \begin{macrocode}
+    \begingroup%
+      \newcounter{advisor@loop}%
+      \setcounter{advisor@loop}{1}%
+%    \end{macrocode}
+% Print the first advisor.
+%    \begin{macrocode}
+      \csname @advisor@\alph{advisor@loop}\endcsname\relax%
+%    \end{macrocode}
+% For any remaining advisors\ldots
+%    \begin{macrocode}
+      \loop\ifnum\c@advisor@loop<\c@advisors%
+        \stepcounter{advisor@loop}%
+%    \end{macrocode}
+% Print the connecting text.
+%    \begin{macrocode}
+        \ifnum\c@advisor@loop=\c@advisors%
+          \ifnum\c@advisors=2%
+%    \end{macrocode}
+% The next advisor if the last of two.
+%    \begin{macrocode}
+            {\ and\ }%
+          \else%
+%    \end{macrocode}
+% The next advisor if the last of many.
+%    \begin{macrocode}
+            {, and\ }%
+          \fi%
+        \else%
+%    \end{macrocode}
+% The next advisor is not the last.
+%    \begin{macrocode}
+          {,\ }%
+        \fi%
+%    \end{macrocode}
+% Print the advisor's name.
+%    \begin{macrocode}
+        \csname @advisor@\alph{advisor@loop}\endcsname\relax%
+      \repeat%
+    \endgroup%
+  \fi}
+%    \end{macrocode}
+%  \end{macro}
+%  \end{macro}
+%
+% \paragraph{baselineskip}
+% \label{sec:implement-line-spacing}
+%
+% \begin{macro}{\DUT@baselineskip}
+% Since we'll be messing with the spacing, save the single-spaced
+% baseline.
+%    \begin{macrocode}
+\let\DUT@baselineskip\baselineskip
+%    \end{macrocode}
+% \end{macro}
 %
 % \begin{command}
-%   `\cs{AddContentsLine}\marg{table}\marg{type}\marg{notcap}\marg{entry}'
+%   `\cs{set@lines@length}\marg{length}\marg{N}'
 % \end{command}
-% \begin{macro}{\AddContentsLine}
-% Define a version of |\addcontentsline| that capitalizes \meta{entry}.
-% \meta{notcap} allows for |\numberline| bits, etc.
-%    \begin{macrocode}
-\newcommand{\AddContentsLine}{\@ifstar
-  \@AddContentsLine\@sAddContentsLine}
-\newcommand{\@AddContentsLine}[4]{%
-%  \addcontentsline{#1}{#2}{#3#4}}
-  \addcontentsline{#1}{#2}{#3\uppercase{#4}}}
-\newcommand{\@sAddContentsLine}[4]{%
-%  \addcontentsline{#1}{#2}{#3#4}}
-  \addcontentsline{#1}{#2}{#3\uppercase{#4}}}
-%  \addcontentsline{#1}{#2}{#3\MakeUppercase{#4}}}
-%    \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\@dottedtocline}
-% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|\meta{numwidth}%
-%        |}{|\meta{title}|}{|\meta{page}|}|:
-%   Macro to produce a table of contents line with the following
-%   parameters:
-%   \begin{description}
-%   \item[level] If \meta{level} $>$ |\c@tocdepth|, then no line 
-%                produced.
-%   \item[indent] Total indentation from the left margin.
-%   \item[numwidth] Width of box for number if the \meta{title} has a
-%                |\numberline| command.  This is also the amount of extra
-%                indentation added to second and later lines of a
-%                multiple line entry.
-%   \item[title] Contents of entry.
-%   \item[page] Page number.
-%  \end{description}
-%
-%  Uses the following parameters, which must be set by the document
-%  style. They should be defined with |\def|'s.
-%  \begin{description}
-%  \item[|\@pnumwidth|]  Width of box in which page number is set.
-%  \item[|\@tocrmarg|] Right margin indentation for all but last line
-%        of multiple-line entries.
-%  \item[|\@dotsep|] Separation between dots, in mu units.
-%                  Should be |\def|'d to a number like 2 or 1.7
-%  \end{description}
-%
-% We just add |spacing| environments to \cls{book}'s version.
-% (\file{ltsect.dtx}, L804).
-%    \begin{macrocode}
-\def\@dottedtocline#1#2#3#4#5{%
-  \begin{spacing}{\@ssp}
-  \ifnum #1>\c@tocdepth \else
-    \vskip \z@ \@plus.2\p@
-    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
-     \parindent #2\relax\@afterindenttrue
-     \interlinepenalty\@M
-     \leavevmode
-     \@tempdima #3\relax
-     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
-     {#4}\nobreak
-     \leaders\hbox{$\m@th
-        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
-        mu$}\hfill
-     \nobreak
-     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
-     \par}%
-     \blanklines{\@cont@sep}
-  \fi
-  \end{spacing}
+% \begin{macro}{\set@lines@length}
+% Many specifications in the Manual refer to ``\meta{N} blank lines''.
+% |\set@lines@length| allows you to set a length to a given number of
+% lines, protecting against external |spacing| environments.  It
+% requires \pkg{calc} for the multiplication.
+%    \begin{macrocode}
+\newcommand{\set@lines@length}[2]{%
+  \setlength{#1}{\DUT@baselineskip * {#2}}
 }
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@sect}
 % Pseudocode for the |\@sect| command
-%     \begin{macrocode}
+% \begin{example}
 % \@sect{NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}[ARG1]{ARG2}
 %           ==
 %   BEGIN
 %    FI
 %    \@xsect{AFTERSKIP}
 % END
-%    \end{macrocode}
+% \end{example}
 % (\file{ltsect.dtx}, L295).
 %    \begin{macrocode}
 \def\@sect#1#2#3#4#5#6[#7]#8{%
 %
 % \begin{macro}{\@ssect}
 % Pseudocode for the |\@ssect| command
-%     \begin{macrocode}
+% \begin{example}
 % \@ssect{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}{ARG} ==
 %   BEGIN
 %    IF AFTERSKIP > 0
 %    FI
 %    \@xsect{AFTERSKIP}
 %   END
-%     \end{macrocode}
+% \end{example}
 % (\file{ltsect.dtx}, L521).
 %    \begin{macrocode}
 \def\@ssect#1#2#3#4#5{%
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{command}
-%   `\cs{set@lines@length}\marg{length}\marg{N}'
-% \end{command}
-% \begin{macro}{\set@lines@length}
-% Many specifications in the Manual refer to ``\meta{N} blank lines''.
-% |\set@lines@length| allows you to set a length to a given number of
-% lines, protecting against external |spacing| environments.  It
-% requires \pkg{calc} for the multiplication.
-%    \begin{macrocode}
-\let\DUT@baselineskip\baselineskip
-\newcommand{\set@lines@length}[2]{%
-  \setlength{#1}{\DUT@baselineskip * {#2}}
-}
-%    \end{macrocode}
-% \end{macro}
 %
 % \begin{command}
 %   `\cs{blanklines}\marg{N}'
 %
 %
 % \subsubsection{Floats on a text page}
+% \label{sec:implement-floats}
 %
 % \begin{macro}{\floatsep}
 % \begin{macro}{\textfloatsep}
-% \begin{macro}{\intextsep}
 % When a floating object is placed on a page with text, these
 % parameters control the separation between the float and the other
 % objects on the page.
 % |\textfloatsep| is the space between the main text and floats
 % at the top or bottom of the page.
 %
-% |\intextsep| is the space between in-text floats and the text.
+% |\intextsep| is the space between in-text floats and the text.  We
+% don't bother overriding this one, because we've handled it with
+% \pkg{floatrow} in Section \ref{sec:floatrow}.
 %
 % From the Manual 2.3 p6, ``Tables and Figures''
 % \begin{quote}
 %    \begin{macrocode}
 \set@lines@length{\floatsep}{\@ssp}
 \set@lines@length{\textfloatsep}{\@tsp}
-\set@lines@length{\intextsep}{\@tsp}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 %
 % \subsubsection{The title}
 % chapters.
 %    \begin{macrocode}
     \ifpdf
-      \pdfbookmark[-1]{Frontmatter}{frontmatter}
-      \pdfbookmark[0]{Title Page}{title}
+      \pdfbookmark[-1]{Frontmatter}{Frontmatter}
+      \pdfbookmark[0]{Title Page}{Title Page}
     \fi
 %    \end{macrocode}
 % Add some stretchy space to center the title vertically if we're not
 %    \begin{macrocode}
     \begin{center}%
     \begin{spacing}{\@tsp}
-      {\bf \@title \par}%
+      {\bfseries \@title \par}%
     \end{spacing}
     \begin{spacing}{\@dsp}
       A Thesis\\
 %    \end{macrocode}
 % If we're using pdf\LaTeX, add a bookmark.
 %    \begin{macrocode}
-  \ifpdf \pdfbookmark[0]{Copyright Page}{copyright} \fi
+  \ifpdf \pdfbookmark[0]{Copyright Page}{Copyright Page} \fi
   \if@final \vspace*{\fill} \fi
   \begin{center}
     \copyright~Copyright \def@year\\
   \begin{quote}
     This work is licensed under the terms of the Creative Commons
     Attribution-ShareAlike license.  The license is available at \\
-    \url{http://creativecommons.org/licenses/by-sa/2.0/}.
+    \url{http://creativecommons.org/licenses/by-sa/3.0/}.
   \end{quote}
 }
 %    \end{macrocode}
 %
 % \subsubsection{Mark commands}
 %
-% Default initializations of |\...mark| commands.  These commands
+% Default initializations of |\*mark| commands.  These commands
 % are used in the definition of the page styles.
 %
 % \begin{macro}{\chaptermark}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\chaptermark}
+% \begin{macro}{\schaptermark}
+% Setup unnumbered chapter marks for \pkg{fancyhdr}.
+%    \begin{macrocode}
+\newcommand\schaptermark[1]{\markboth{\MakeUppercase{#1}}{}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sectionmark}
 % Setup space rather than period separated section marks.
 % (\file{classes.dtx}, L2054)
 %    \begin{macrocode}
 \def\@part[#1]#2{%
     \ifnum \c@secnumdepth >-2\relax
       \refstepcounter{part}%
-      \AddContentsLine{toc}{part}%
-        {\protect\numberline{\thepart}}{#1}%
+      \addcontentsline{toc}{part}%
+        {\protect\numberline{\thepart}#1}%
     \else
-      \AddContentsLine{toc}{part}{}{#1}%
+      \addcontentsline{toc}{part}{#1}%
     \fi
 %    \end{macrocode}
 % We empty the mark registers and center the title on the page.
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\listed@schapter}
+% |\chapter| declares numbered chapters, which are listed in the table
+% of contents.
+% |\chapter*| declares unnumbered chapters, which are \emph{not}
+% listed in the TOC.
+% |\listed@schapter| declares an unnumbered chapter that \emph{is}
+% listed in the TOC.
+%    \begin{macrocode}
+\newcommand\listed@schapter[1]{%
+  \if@openright\DUT@cleardoublepage\else\DUT@clearpage\fi
+  \thispagestyle{plain}%
+  \global\@topnum\z@
+  \phantomsection
+  \addcontentsline{toc}{chapter}{#1}
+  \@afterindentfalse
+  \@schapter{#1}}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@chapter}
 % This macro is called when we have a numbered chapter. When
 % \Lcount{secnumdepth} is larger than $-1$ and |\@mainmatter| is true,
 % (\file{classes.dtx}, L2496).
 % \begin{macrocode}
 \def\@chapter[#1]#2{
-  \ifnum \c@secnumdepth >\m@ne
-    \if@mainmatter
-      \refstepcounter{chapter}%
 % \end{macrocode}
 % Inform the user that a new chapter is about to be typeset by writing
 % a message to the terminal.
 % \begin{macrocode}
-      \typeout{\@chapapp\space\thechapter.}%
-      \if@appendix
-% \end{macrocode}
-% We're in the appendix (when |\if@mainmatter| and
-% |\if@appendix| are both true), add a TOC line like
-% \begin{center}
-%   Appendix A: Chapter Title
-% \end{center}
-% |\thechapter| (defined in \cls{book}) is the text representation of 
-% the chapter number (e.g.\ |1| or, for an appendix, |A|).
-% |\@chapapp{}| (also defined in \cls{book}) was redefined in
-% |\appendix| (Sec. \ref{sec:implement-appendix}) as |\appendixname|.
-% \begin{macrocode}
-        \AddContentsLine{toc}{appendix}%
-          {\protect\numberline{\@chapapp{} \thechapter:}}{#1}%
-      \else
-% \end{macrocode}
-% We're in the pre-appendix mainmatter, so add a TOC line like
-% \begin{center}
-%   1 Chapter Title
-% \end{center}
-% \begin{macrocode}
-        \AddContentsLine{toc}{chapter}%
-          {\protect\numberline{\thechapter}}{#1}%
-      \fi
+  \typeout{\@chapapp\space\thechapter. #1}%
+  \ifnum \c@secnumdepth >\m@ne
+    \if@mainmatter
+      \refstepcounter{chapter}%
+      \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}%
     \else
-% \end{macrocode}
-% We're in the pre-mainmatter, so add a TOC line like
-% \begin{center}
-%   Chapter Title
-% \end{center}
-% \begin{macrocode}
-      \AddContentsLine{toc}{chapter}{}{#1}%
+      \addcontentsline{toc}{chapter}{#1}%
     \fi
   \else
-    \AddContentsLine{toc}{chapter}{}{#1}%
+    \addcontentsline{toc}{chapter}{#1}%
   \fi
 %    \end{macrocode}
 % After having written an entry to the table of contents we store
-% the (alternative) title of this chapter with |\chaptermark| and
-% add some white space to the lists of figures and tables.
+% the (alternative) title of this chapter with |\chaptermark|.
 %    \begin{macrocode}
   \chaptermark{#1}%
-  \addtocontents{lof}{\protect\addvspace{10\p@}}%
-  \addtocontents{lot}{\protect\addvspace{10\p@}}%
+%    \end{macrocode}
+% For nicer lists of figures and tables, we could add some white space
+% to separate the chapters.  However, nice lists $\neq$~Manual
+% specifications.
+%    \begin{macrocode}
+%  \addtocontents{lof}{\protect\addvspace{10\p@}}%
+%  \addtocontents{lot}{\protect\addvspace{10\p@}}%
 %    \end{macrocode}
 % Then we call upon |\@makechapterhead| to format the actual chapter
 % title.  |\@afterheading| which takes care of suppressing the
 % \end{macro}
 %
 % \begin{macro}{\@schapter}
-% We don't have to worry about |\@schapter|, since it is very simple.
-% In onecolumn mode it's just
+% This macro is called when we have an unnumbered chapter.  We drop
+% \file{classes.dtx}'s \Lopt{twocolumn} code and set marks for
+% \pkg{fancyhdr}.
 % (\file{classes.dtx}, L2582).
 %    \begin{macrocode}
-%\def\@schapter#1{\@makeschapterhead{#1}%
-%                 \@afterheading}
+\def\@schapter#1{\schaptermark{#1}%
+                 \@makeschapterhead{#1}%
+                 \@afterheading}
 %    \end{macrocode}
 % \end{macro}
 %
 % \end{macro}
 %
 %
-% \begin{macro}{\toclevel@appendix}
-% We've added a new TOC entry type with the
-% \begin{example} 
-%   \AddContentsLine{toc}{appendix}{...}{...}
-% \end{example}
-% calls above, and \pkg{hyperref} needs to know what level they belong
-% to.  Obviously they belong to the chapter level ($0$).
-%    \begin{macrocode}
-\providecommand*{\toclevel@appendix}{0}
-%    \end{macrocode}
-% \end{macro}
-%
-%
 % \subsubsection{Lower level headings}
 %
 % \begin{macro}{\section}
   \DUT@clearpage
   \ifpdf
     \phantomsection
-    \pdfbookmark[0]{\dedicationsname}{dedications}
+    \pdfbookmark[0]{\dedicationsname}{\dedicationsname}
   \fi
   \chapter*{\dedicationsname}
   \begin{spacing}{\@dsp}
   \DUT@clearpage
   \ifpdf
     \phantomsection
-    \pdfbookmark[0]{\acknowledgmentsname}{acknowledgments}
+    \pdfbookmark[0]{\acknowledgmentsname}{\acknowledgmentsname}
   \fi
   \chapter*{\acknowledgmentsname}
   \begin{spacing}{\@dsp}
 % \begin{environment}{abstract}
 %    \begin{macrocode}
 \newenvironment{abstract}{%
-  \DUT@clearpage
-  \thispagestyle{plain}%
-  \global\@topnum\z@
-  \phantomsection
-  \AddContentsLine*{toc}{chapter}{}{\abstractname}
-  \vspace*{50\p@}%
+  \listed@schapter{\abstractname}
 %    \end{macrocode}
 % From the Manual 3.9 p10 ``The following heading must be centered at
 % the top of the page'':
 % Note that the heading is single spaced, but the abstract is double
 % spaced.''
 %    \begin{macrocode}
+  \blanklines{-3}
   \begin{spacing}{\@ssp}
     \begin{center}
-      {\large \bfseries \abstractname \par}
-%%      \@endparpenalty\@M
       \@title\\
       \@author\\
       \@advisor\\
   \DUT@clearpage
   \ifpdf
     \phantomsection
-    \pdfbookmark[-1]{Backmatter}{backmatter}
+    \pdfbookmark[-1]{Backmatter}{Backmatter}
   \fi
 }
 %    \end{macrocode}
 % \end{environment}
 %
+% \paragraph{Vita}
+% \label{sec:implement-vita}
+% 
 % \begin{environment}{vita}
 % From the Manual 3.15 p13
 % \begin{itemize}
 % \end{itemize}
 %    \begin{macrocode}
 \newenvironment{vita}{%
-  \DUT@clearpage
-  \phantomsection
-  \AddContentsLine*{toc}{chapter}{}{\vitaname}
-  \chapter*{\vitaname}
+  \listed@schapter{\vitaname}
   \blanklines{1}
   \begin{spacing}{\@dsp}
 }{%
 %
 %
 % \subsubsection{Appendix}
+% \label{sec:implement-appendix}
 %
 % \begin{macro}{\appendix}
 % The |\appendix| command is not really an environment, it is a
 %         as \texttt{multicols}.
 % \end{itemize}
 %
-% In addition to \cls{book}'s (or \pkg{hyperref}'s) activity, we add
-% |\@appendixtrue|.  This gets |\if@appendix| working in our
-% |\chapter| definition (Sec.~\ref{sec:implement-chapters}).
+% In addition to \cls{book}'s (or \pkg{hyperref}'s) activity, we
+% fiddle with the \pkg{tocloft} chapter settings add switch to global
+% double-spacing.
 % (\file{classes.dtx}, L3177)
 %    \begin{macrocode}
 \let\DUT@appendix\appendix
 \renewcommand\appendix{%
-  \@appendixtrue%
   \DUT@appendix%
 %    \end{macrocode}
+% Setup TOC entries like
+% \begin{center}
+%   Appendix A: Chapter Title
+% \end{center}
+% We don't need to worry about the |vita| environment (page
+% \pageref{sec:implement-vita}), because it is a |\listed@schapter|,
+% and therefore lacks a |\numberline| section in its \file{*.toc}
+% entry.
+%
+% We increase |numwidth| to 6.5em to make room for |Appendix~| before
+% the chapter number/letter, and add a colon after it.
+%
+% The |\protect| calls get the macros into \file{*.toc} unexpanded, so
+% they function correctly when \LaTeX\ parses \file{*.toc}.
+%    \begin{macrocode}
+  \addtocontents{toc}{%
+    \protect\cftsetindents{chapter}{0pt}{6.5em}
+    \protect\renewcommand{\protect\cftchappresnum}{\protect\appendixname~}
+    \protect\renewcommand{\protect\cftchapaftersnum}{:}}
+%    \end{macrocode}
 % We also turn on double spacing by default, since we're no longer
 % wrapped in the |thesis| environment.
 %    \begin{macrocode}
 % \end{macro}
 %
 %
-% \subsubsection{Table}
-% \label{sec:implement-tables}
-%
-% \begin{environment}{table}
-% \begin{environment}{table*}
-% To help symmetrize the spacing around tables and figures, we set
-% |\if@table| in the |table| environments.  The remainder of the
-% code comes in Section \ref{sec:implement-captions}.
-% (\file{classes.dtx}, L3491)
-%    \begin{macrocode}
-\newif\if@table \@tablefalse
-\renewenvironment{table}
-                 {\@tabletrue\@float{table}}
-                 {\end@float\@tablefalse}
-\renewenvironment{table*}
-                 {\@tabletrue\@dblfloat{table}}
-                 {\end@dblfloat\@tablefalse}
-%    \end{macrocode}
-% \end{environment}
-% \end{environment}
-%
-%
-% \subsubsection{Captions}
-% \label{sec:implement-captions}
-%
-% \begin{macro}{\@makecaption}
-% The |\caption| command calls |\@makecaption| to format the
-% caption of floating objects. It gets two arguments,
-% \meta{number}, the number of the floating object and \meta{text},
-% the text of the caption. Usually \meta{number} contains a string
-% such as ``Figure 3.2''. The macro can assume it is called inside a
-% |\parbox| of right width, with |\normalsize|.
+% \subsubsection{Table of Contents}
+% \label{sec:implement-toc}
 %
-% We override \cls{book}'s |\@makecaption|, adding two |\if@table|
-% conditionals, which swap |\abovecaptionskip| and |\belowcaptionskip|
-% for tables (where the caption is above the float body).  With our
-% implementation, |\belowcaptionskip| \emph{always} gives the distance
-% between the caption and the text, and |\abovecaptionskip|
-% \emph{always} gives the distance between the caption and the float
-% body.  See Section \ref{sec:implement-tables} for our |\if@table|
-% control.
+% From Manual 3.5 p9, ``Table of Contents'', and the example on p17.
+% \begin{quote}
+%   \begin{itemize}
+%     \item Do not list any sections that precede the
+%     |Table of Contents| (e.g.\ |Dedications|, |Acknowledgments|).  Do
+%     not list the |Table of Contents| itself.
+%     \item These pages are counted and numbered in lowercase Roman numerals.
+%   \end{itemize}
+% \end{quote}
 %
-% We also replace the caption lead-in |#1: #2| with
-% |\small{\bfseries#1:} #2|.
-% (\file{classes.dtx}, L3508)
-%    \begin{macrocode}
-%    \end{macrocode}
-% Define a temporary length for swapping.
-%    \begin{macrocode}
-\newlength\@tempcapskip
-%    \end{macrocode}
-% The definition of this macro is |\long| in order to allow more
-% then one paragraph in a caption.
-%    \begin{macrocode}
-\long\def\@makecaption#1#2{%
-  \if@table
-%    \end{macrocode}
-% Swap |\abovecaptionskip| and |\belowcaptionskip|.
-%    \begin{macrocode}
-    \@tempcapskip\abovecaptionskip
-    \abovecaptionskip\belowcaptionskip
-    \belowcaptionskip\@tempcapskip
-  \fi
-  \vskip\abovecaptionskip
-%    \end{macrocode}
-% We want to see if the caption fits on one line on the page,
-% therefore we first typeset it in a temporary box.
+% \begin{macro}{\cfttoctitlefont}
+% Take advantange of \pkg{tocloft}'s TOC title code.
+% (\file{tocloft.dtx}, L1501)
+% \begin{example}
+%   \cfttoctitlefont\contentsname}{\cftaftertoctitle}
+% \end{example}
+% by setting it equal to something ending in |\chapter*|.  That way
+% \LaTeX parses the whole thing as
+% \begin{example}
+%   ...\chapter*\contentsname}{\cftaftertoctitle}
+% \end{example}
+% which will set up the TOC page correctly.
 %    \begin{macrocode}
-  \sbox\@tempboxa{\small{\bfseries#1:} #2}%
+\renewcommand\cfttoctitlefont{%
 %    \end{macrocode}
-% We can the measure its width. It that is larger than the current
-% |\hsize| we typeset the caption as an ordinary paragraph.
+% Start a new page in \Lopt{final} mode
 %    \begin{macrocode}
-  \ifdim \wd\@tempboxa >\hsize
-    {\small{\bfseries#1:} #2\par}
-  \else
+  \DUT@clearpage
 %    \end{macrocode}
-% If the caption fits, we center it. Because this uses an |\hbox|
-% directly in vertical mode, it does not execute the |\everypar|
-% tokens; the only thing that could be needed here is resetting the
-% `minipage flag' so we do this explicitly.
+% Add a bookmark if we're using pdf\LaTeX.
 %    \begin{macrocode}
-    \global \@minipagefalse
-    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \ifpdf
+    \phantomsection
+    \pdfbookmark[0]{\contentsname}{\contentsname}
   \fi
-  \vskip\belowcaptionskip
 %    \end{macrocode}
-% Restore |\abovecaptionskip| and |\belowcaptionskip|.
+% |\chapter*| to gobble and format the next token (|\contentsname|).
 %    \begin{macrocode}
-  \if@table
-    \@tempcapskip\belowcaptionskip
-    \belowcaptionskip\abovecaptionskip
-    \abovecaptionskip\@tempcapskip
-  \fi
-}
+  \chapter*}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\abovecaptionskip}
-% \begin{macro}{\belowcaptionskip}
-% For \cls{book}, these lengths contain the amount of white space to
-% leave above and below the caption.  However, because of our work
-% with |\@makecaption| (above), |\belowcaptionskip| \emph{always}
-% gives the distance between the caption and the text, and
-% |\abovecaptionskip| \emph{always} gives the distance between the
-% caption and the float.
-% (\file{classes.dtx}, L3516)
+% \begin{macro}{\aftertoctitleskip}
+% Don't add any extra space after the title (the chapter will take
+% care of that).
 %    \begin{macrocode}
-\set@lines@length{\abovecaptionskip}{\@ssp}
-\set@lines@length{\belowcaptionskip}{\@tsp}
+\setlength\cftaftertoctitleskip{0pt}
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-%
 %
-% \subsubsection{Table of Contents}
-%
-% \begin{macro}{\tableofcontents}
-% Automate the creation of the table of contents.
-% From Manual 3.5 p9, ``Table of Contents'', and the example on p17.
-% \begin{itemize}
-%   \item Do not list any sections that precede the
-%   |Table of Contents| (e.g.\ |Dedications|, |Acknowledgments|).  Do
-%   not list the |Table of Contents| itself.
-%   \item These pages are counted and numbered in lowercase Roman numerals.
-% \end{itemize}
-% We inhibit the paging in draft mode and drop the \Lopt{twocolumn} code.
-% (\file{classes.dtx}, L3728)
-%    \begin{macrocode}
-\renewcommand\tableofcontents{%
-  \DUT@clearpage
-%    \end{macrocode}
-% If we're using pdf\LaTeX, add a bookmark.
+% \begin{macro}{\l@cont@sep}
+% Define a length for TOC/LOF/LOT spacing.
 %    \begin{macrocode}
-  \ifpdf
-    \phantomsection
-    \pdfbookmark[0]{\contentsname}{tableofcontents}
-  \fi
-  \chapter*{\contentsname}
-%    \end{macrocode}
-% Set the marks for \cls{fancyhdr}'s fancy header.
-%    \begin{macrocode}
-  \@mkboth{\MakeUppercase\contentsname}%
-          {\MakeUppercase\contentsname}%
-  \@starttoc{toc}%
-}
+\newlength\l@cont@sep
+\set@lines@length{\l@cont@sep}{\@cont@sep}
 %    \end{macrocode}
 % \end{macro}
 %
-% The command |\contentsline{|\meta{name}|}| expands to
-% |\l@|\meta{name}.  So, to specify the table of contents, we must
-% define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to
-% specify the list of figures, we must define |\l@figure|; and so
-% on.
-%
-% \begin{command}
-%   `\cs{l@DUT@major}\marg{title}\marg{page}\marg{inset}'
-% \end{command}
-% \begin{macro}{\l@DUT@major}
-% Define a wrapper class for printing TOC entries for parts, chapters,
-% and appendicies, since they should all have the same formatting.
-% \meta{title} and \meta{page} are the first two arguments passed to
-% the outer |\l@*| macro.  \meta{inset} gives the distance that the
-% title text is offset from the left margin (|\@tempdima|), with any
-% |\numberline| text (e.g.\ part or chapter numbers) being printed
-% flush on the left margin.
-%    \begin{macrocode}
-\newif\if@bold@DUT@major
-\newif\if@dotted@DUT@major
-\newcommand\l@DUT@major[3]{%
-  \begin{spacing}{\@ssp}
-    \ifnum \c@tocdepth >\m@ne
-%    \end{macrocode}
-% Make sure that if a pagebreak should occur, it occurs \emph{before}
-% this entry.
-%    \begin{macrocode}
-      \addpenalty{-\@highpenalty}%
-%    \end{macrocode}
-% The macro |\numberline| requires that the width of the box that
-% holds the part number is stored in \LaTeX's scratch register
-% |\@tempdima|. Therefore we initialize it there even though we may
-% not use |\numberline| internally.
+% \begin{macro}{\@cont@font}
+% Define a font for high level (part, chapter) entries.
 %    \begin{macrocode}
-      \setlength\@tempdima{#3}%
-      \begingroup
-%    \end{macrocode}
-% We set |\parindent| to 0pt and use |\rightskip| to leave
-% enough room for the pagenumbers.\footnote{^^A
-%   We use \file{classes.dtx} suggested \cs{@tocrmarg} for
-%   \cs{rightskip}, which they're delaying until \LaTeX3.}
-% To prevent overfull box messages the |\parfillskip| is set to a 
-% negative value.
-%    \begin{macrocode}
-        \parindent \z@ \rightskip \@tocrmarg \parfillskip -\rightskip
-%    \end{macrocode}
-% Leave vertical mode.
-%    \begin{macrocode}
-        \leavevmode
-%    \end{macrocode}
-% Switch to bold font if appropriate.
-%    \begin{macrocode}
-        \if@bold@DUT@major
-          \bfseries
-        \fi
-%    \end{macrocode}
-% Manuever to place the part number flush left, with the part title
-% inset by |\@tempdima|.
-%    \begin{macrocode}
-        \advance\leftskip\@tempdima
-        \hskip -\leftskip
-%    \end{macrocode}
-% Set the part title.
-%    \begin{macrocode}
-        #1\nobreak
-%    \end{macrocode}
-% Draw a dotted line if appropriate.
-%    \begin{macrocode}
-        \if@dotted@DUT@major
-          \leaders\hbox{$\m@th
-            \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
-        \fi
-%    \end{macrocode}
-% Wrap up with the page entry, set flush right.
-%    \begin{macrocode}
-        \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
-%    \end{macrocode}
-% Prevent a pagebreak immediately after this entry.
-%    \begin{macrocode}
-        \nobreak
-%    \end{macrocode}
-% Add a content-page-spacing blank after this entry.
-%    \begin{macrocode}
-        \blanklines{\@cont@sep}
-%    \end{macrocode}
-% Discourage page breaking.
-%    \begin{macrocode}
-        \penalty\@highpenalty
-      \endgroup
-    \fi
-  \end{spacing}
-}
+\newcommand{\@cont@font}{\normalsize\scshape}
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\l@part}
-% Override \cls{book}'s |\l@part|.
-% (\file{classes.dtx}, L3775)
-%    \begin{macrocode}
-\renewcommand*\l@part[2]{%
-  \if@boldpart
-    \@bold@DUT@majortrue
-  \else
-    \@bold@DUT@majorfalse
-  \fi
-  \if@dottedpart
-    \@dotted@DUT@majortrue
-  \else
-    \@dotted@DUT@majorfalse
-  \fi
-  \l@DUT@major{#1}{#2}{3em}}
+% \begin{macro}{\cftbeforepartskip}
+% \begin{macro}{\cftpartfont}
+% \begin{macro}{\cftpartleader}
+% \begin{macro}{\cftpartdotsep}
+% \begin{macro}{\cftpartpagefont}
+% Setup parts.  See the \pkg{tocloft} manual for a description of the
+% commands.
+%    \begin{macrocode}
+\setlength\cftbeforepartskip{\l@cont@sep}
+\cftsetindents{part}{0pt}{3em}
+\if@boldpart   \renewcommand{\cftpartfont}{\bfseries\@cont@font}
+\else          \renewcommand{\cftpartfont}{\@cont@font}
+\renewcommand{\cftpartleader}{\cftdotfill{\cftpartdotsep}}
+\if@dottedpart \renewcommand{\cftpartdotsep}{\cftdotsep}
+\else          \renewcommand{\cftpartdotsep}{\cftnodots} \fi
+\renewcommand{\cftpartpagefont}{\normalfont}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
-% \begin{macro}{\l@chapter}
-% Override \cls{book}'s |\l@chapter|.
-% (\file{classes.dtx}, L3847)
-%    \begin{macrocode}
-\renewcommand*\l@chapter[2]{%
-  \if@boldchapter
-    \@bold@DUT@majortrue
-  \else
-    \@bold@DUT@majorfalse
-  \fi
-  \if@dottedchapter
-    \@dotted@DUT@majortrue
-  \else
-    \@dotted@DUT@majorfalse
-  \fi
-  \l@DUT@major{#1}{#2}{1.5em}}
+% \begin{macro}{\cftbeforechapskip}
+% \begin{macro}{\cftchapaftersnum}
+% \begin{macro}{\cftchapfont}
+% \begin{macro}{\cftchapleader}
+% \begin{macro}{\cftchapdotsep}
+% \begin{macro}{\cftchappagefont}
+% Setup chapters and appendicies.  Some of these settings are adjusted
+% for appendicies in particular by |\appendix|
+% (Sec.~\ref{sec:implement-appendix}).
+%    \begin{macrocode}
+\setlength\cftbeforechapskip{\l@cont@sep}
+\cftsetindents{chapter}{0pt}{1.5em}
+\renewcommand{\cftchapaftersnum}{.}
+\if@boldchapter   \renewcommand{\cftchapfont}{\bfseries\@cont@font}
+\else             \renewcommand{\cftchapfont}{\@cont@font} \fi
+\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}
+\if@dottedchapter \renewcommand{\cftchapdotsep}{\cftdotsep}
+\else             \renewcommand{\cftchapdotsep}{\cftnodots} \fi
+\renewcommand{\cftchappagefont}{\normalfont}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
-%
-% \begin{macro}{\l@appendix}
-% Add |\l@appendix|, which is identical to our |\l@chapter| except
-% for setting |\@tempdima| to 8em rather than 1.5em, because the word
-% |Appendix| takes up a bunch of space.
-%    \begin{macrocode}
-\newcommand*\l@appendix[2]{%
-  \if@boldchapter
-    \@bold@DUT@majortrue
-  \else
-    \@bold@DUT@majorfalse
-  \fi
-  \if@dottedchapter
-    \@dotted@DUT@majortrue
-  \else
-    \@dotted@DUT@majorfalse
-  \fi
-  \l@DUT@major{#1}{#2}{8em}}
+% \begin{macro}{\cftbeforesecskip}
+% \begin{macro}{\cftsecfont}
+% \begin{macro}{\cftbeforesubsecskip}
+% \begin{macro}{\cftsubsecfont}
+% \begin{macro}{\cftbeforesubsubsecskip}
+% \begin{macro}{\cftsubsubsecfont}
+% Setup sections, subsections, etc.
+%    \begin{macrocode}
+%\cftsetindents{chap}{0pt}{1.5em}
+\setlength\cftbeforesecskip{\l@cont@sep}
+\cftsetindents{section}{0pt}{3em}
+\renewcommand{\cftsecfont}{\normalsize}
+\setlength\cftbeforesubsecskip{\l@cont@sep}
+\cftsetindents{subsection}{0pt}{4.5em}
+\renewcommand{\cftsubsecfont}{\cftsecfont}
+\setlength\cftbeforesubsubsecskip{\l@cont@sep}
+\cftsetindents{subsubsection}{0pt}{6em}
+\renewcommand{\cftsubsubsecfont}{\cftsecfont}
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %
 % \subsubsection{List of figures}
-%
-% \begin{macro}{\listoffigures}
-% This macro is used to request that \LaTeX\ produces a list of
-% figures. It is very similar to |\tableofcontents|.
+% \label{sec:implement-lof}
 %
 % From the Manual 3.7 p10
 % \begin{quote}
-%   The heading |List of Figures| must appear at the top of the first
-%   page.
-%   The heading must be bold, centered, and without punctuation.
-%   List figure captions exactly as they appear below the figures in
-%   the text.
-%   Single space each entry, but double-space between entries.
-%   Separate figure captions from page numbers with right-justified
-%   tabs and dot leaders.
-%   Do not use periods to separate captions and page numbers.
-%   These pages are counted and numbered in lowercase Roman numerals.
+%   \begin{itemize}
+%     \item The heading |List of Figures| must appear at the top of
+%       the first page.
+%     \item The heading must be bold, centered, and without
+%       punctuation.  List figure captions exactly as they appear
+%       below the figures in the text.
+%     \item Single space each entry, but double-space between entries.
+%     \item Separate figure captions from page numbers with
+%       right-justified tabs and dot leaders.
+%     \item Do not use periods to separate captions and page numbers.
+%     \item These pages are counted and numbered in lowercase Roman
+%     numerals.
+%   \end{itemize}
 % \end{quote}
 %
-% We drop the \Lopt{twocolumn} code, add a line to the table of
-% contents, and adjust paging.
-% (\file{classes.dtx}, L3981).
+% \begin{macro}{\cftloftitlefont}
+% Much like our |\cfttoctitlefont|, but the list of figures gets
+% listed in the TOC.
 %    \begin{macrocode}
-\renewcommand\listoffigures{%
-  \DUT@clearpage
-  \phantomsection
-  \AddContentsLine*{toc}{chapter}{}{\listfigurename}
-  \chapter*{\listfigurename}%
-  \@mkboth{\MakeUppercase\listfigurename}%
-          {\MakeUppercase\listfigurename}%
-  \@starttoc{lof}%
-}
+\renewcommand\cftloftitlefont{\listed@schapter}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\afterloftitleskip}
+% Don't add any extra space after the title (the chapter will take
+% care of that).
+%    \begin{macrocode}
+\setlength\cftafterloftitleskip{0pt}
+%    \end{macrocode}
+% \end{macro}
 %
-% \subsubsection{List of tables}
+% \begin{macro}{\cftbeforefigskip}
+% \begin{macro}{\cftfigindent}
+% \begin{macro}{\cftfigfont}
+% Setup figure entries.
+%    \begin{macrocode}
+\setlength{\cftbeforefigskip}{\l@cont@sep}
+\setlength{\cftfigindent}{0pt}
+\renewcommand{\cftfigfont}{\normalsize\singlespace}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
-% \begin{macro}{\listoftables}
-% This macro is used to request that \LaTeX\ produces a list of
-% tables. It is very similar to |\tableofcontents|.
+%
+% \subsubsection{List of tables}
+% \label{sec:implement-lot}
 %
 % From the Manual 3.6 p10
 % \begin{quote}
-%   The heading |List of Tables| must appear at the top of the first
-%   page.
-%   The heading must be bold, centered, and without punctuation.
-%   List table captions exactly as they appear above the tables in
-%   the text.
-%   Single space each entry, but double-space between entries.
-%   Separate table captions from page numbers with right-justified
-%   tabs and dot leaders.
-%   Do not use periods to separate captions and page numbers.
-%   These pages are counted and numbered in lowercase Roman numerals.
+%   \begin{itemize}
+%     \item The heading |List of Tables| must appear at the top of the
+%       first page.
+%     \item The heading must be bold, centered, and without
+%       punctuation.
+%     \item List table captions exactly as they appear above the
+%       tables in the text.
+%     \item Single space each entry, but double-space between entries.
+%     \item Separate table captions from page numbers with
+%       right-justified tabs and dot leaders.
+%     \item Do not use periods to separate captions and page numbers.
+%       These pages are counted and numbered in lowercase Roman
+%       numerals.
+%   \end{itemize}
 % \end{quote}
 %
-% We drop the \Lopt{twocolumn} code, add a line to the table of
-% contents, and adjust paging.
-% (\file{classes.dtx}, L4017).
+% \begin{macro}{\cftlottitlefont}
+% Much like our |\cfttoctitlefont|, but the list of tables gets
+% listed in the TOC.
 %    \begin{macrocode}
-\renewcommand\listoftables{%
-  \DUT@clearpage
-  \phantomsection
-  \AddContentsLine*{toc}{chapter}{}{\listtablename}
-  \chapter*{\listtablename}%
-  \@mkboth{\MakeUppercase\listtablename}%
-          {\MakeUppercase\listtablename}%
-  \@starttoc{lot}%
-}
+\renewcommand\cftlottitlefont{\listed@schapter}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\afterlottitleskip}
+% Don't add any extra space after the title (the chapter will take
+% care of that).
+%    \begin{macrocode}
+\setlength\cftafterlottitleskip{0pt}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\cftbeforetabskip}
+% \begin{macro}{\cfttabindent}
+% \begin{macro}{\cfttabfont}
+% Setup table entries.
+%    \begin{macrocode}
+\setlength{\cfttabindent}{0pt}
+\setlength{\cftbeforetabskip}{\l@cont@sep}
+\renewcommand{\cfttabfont}{\normalsize\singlespace}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 %
 % \subsubsection{Bibliography}
 %
 % so we will still get our table of contents entry.
 %    \begin{macrocode}
 \newcommand{\bib@heading}{%
-  \phantomsection%
-  \AddContentsLine*{toc}{chapter}{}{\bibname}%
-  \chapter*{\bibname}%
+  \listed@schapter{\bibname}%
   \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
 }
 %    \end{macrocode}
 %    \end{macrocode}
 %
 %
-% \subsection{Caveats and bugs}
-%
-%
-% \subsubsection{\pkg{hyperref} and uppercase}
-%
-% In order to comply with the Manual's specifications,
-% part and chapter entries to the table of contents need
-% to be uppercased, which we do via |\AddContentsLine|.
-% This generates some whining from \pkg{hyperref}
-% \begin{example}
-%   Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding),
-%   (hyperref)                removing `\uppercase' on input line 72.
-% \end{example}
-% This is because |\uppercase| is parsed in \TeX's stomach, but
-% \pkg{hyperref} deals with code in \TeX's mouth, so \pkg{hyperref} is
-% drops the token and complains.  Which is fine, since the titles
-% don't actually need to be uppercased in the bookmark, but the
-% error messages are still produced.  If anyone knows of a good way
-% to either fix the problem or silence these particular error messages,
-% please let me know.  Otherwise, just ignore the errors.
-%
-%
 % \section{Examples}
 %
 %
 \defyear{1872}
 \degree{Doctor of Philosophy}
 \advisor{Collis Potter Huntington, R.R.D.}
+\advisor{Advisor 2, Ph.D.}
+\advisor{Advisor 3, Ph.D.}
 \copyrighttext{\copyrighttextCC}
 
 \usepackage[super,sort&compress]{natbib} % fancy citation extensions
-\bibliographystyle{plainnat}
+\bibliographystyle{unsrtnat}
 
 \usepackage{fancyvrb} % nicer verbatim handling
 \DefineShortVerb{\|}  % \verb+TEXT+  ->  |TEXT|
@@ -2740,7 +2698,6 @@ parenthetical citation\citep{rief97}.
 \subsubsection{Tables and Figures}
 \blabla{2}{20}
 \begin{table}
-  \caption{A table float}
   \begin{center}
   \begin{tabular}{r@{.}l r@{.}l r@{.}l}
     \multicolumn{2}{c}{Time (s)} &
@@ -2751,6 +2708,7 @@ parenthetical citation\citep{rief97}.
     30&0 & 11&9 & 10&1 \\
     \ldots
   \end{tabular}
+  \caption{A table float. \bla{20}}  % low caption allowed with floatrow
 %% Note the strange |r@{.}l| notation in the |\tabular| column
 %% definition.  This allows for numbers aligned at the decimal point
 %% (see \href{http://www.stat.unipg.it/tex-man/ltx-68.html}{here}).
@@ -2761,17 +2719,18 @@ parenthetical citation\citep{rief97}.
 \end{table}
 \blabla{5}{20}
 \begin{figure}
+  \caption{A figure float. \bla{20}} % high caption allowed with floatrow
   \begin{center}
     \includegraphics[width=0.4\textwidth]{drexel-logo}
   \end{center}
-  \caption{A figure float}
 \end{figure}
 \blabla{10}{20}
 
 \part{Another Part}
 \chapter{Another Chapter}
 \blabla{30}{20}
-\chapter{Yet another Chapter}
+\chapter{A Long Title Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla
+Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla Bla}
 \blabla{30}{20}
 %</example-part>
 %    \end{macrocode}
@@ -2855,17 +2814,25 @@ parenthetical citation\citep{rief97}.
 %    \begin{macrocode}
 %<*blabla>
 \ProvidesPackage{blabla} [2010/01/11 1.0 Dummy text generation]
+%    \end{macrocode}
+% Use
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/forloop/}{\pkg{foorloop}}
+% for
+% \begin{command}
+%   `\cs{forloop}\oarg{step}\marg{counter}\marg{initial value}\marg{condition}\marg{code}'
+% \end{command}
+%    \begin{macrocode}
 \RequirePackage{forloop}[2006/09/18]
-%% http://www.ctan.org/tex-archive/macros/latex/contrib/forloop/
 
 \newcounter{blabla@i}
 \newcounter{blabla@j}
+\newcommand{\bla}[1]{
+   Bla
+  \forloop{blabla@i}{0}{\value{blabla@i} < #1}{ bla }
+  bla.
+}
 \newcommand{\blabla}[2]{
-  \forloop{blabla@i}{0}{\value{blabla@i} < #1}{
-    Bla
-    \forloop{blabla@j}{0}{\value{blabla@j} < #2}{ bla }
-    bla.\par
-  }
+  \forloop{blabla@j}{0}{\value{blabla@j} < #1}{ \bla{#2}\par }
 }
 %</blabla>
 %    \end{macrocode}