% \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
% 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.
% \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.}}
% \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}
% \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
% 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.
% `\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}
% For more useful float information, see the
% \href{http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions}
% {\LaTeX\ wikibook page}.
-%
+%
+% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/}{\pkg{subfig}}
+% cooperates with \cls{drexel-thesis}'s included \pkg{floatrow}. If
+% you wish to use the \pkg{subfig} macros, you should add something
+% like
+% \begin{example}
+% \usepackage{subfig}
+% \usepackage{fr-subfig}
+% \end{example}
+% See the \pkg{floatrow} documentation (Sec.~7.1, ``The \pkg{subfig}
+% package'') and \pkg{subfig} documentation (Sec.~4.3,
+% ``\pkg{FloatRow} Package'') for details.
+%
%
% \subsubsection{Citations}
%
%
% \subsubsection{References}
%
+% Easier cross referencing with
% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/cleveref/}{\pkg{cleveref}}.
-% Is a wonderful tool for easy, consistent crosslinking. The manual is also very good.
+% Is a wonderful tool for easy, consistent crosslinking via |\cref|,
+% |\Cref|, etc.. The manual is also very good.
+% Note that if you use |\part|s in your document, you need to tell
+% \pkg{cleveref} how to deal with them:
+% \begin{example}
+% \usepackage{cleveref}
+% \crefname{part}{part}{parts}
+% \end{example}
%
%
% \subsubsection{Hyperlinks}
% set options overriding these defaults.
%
%
+% \subsubsection{Developing large \LaTeX\ documents}
+%
+% A thesis may take a while to compile, especially if it contains
+% lots of images, etc.. One way to save time, is to use |\includeonly|
+% when including chapter \file{*.tex} files (see
+% \href{http://en.wikibooks.org/wiki/TeX/includeonly}{the \TeX\ Wikibook}).
+% Usage would be something like
+% \begin{example}
+% \documentclass{drexel-thesis}
+% ...
+% \includeonly{chapter2.tex,chapter3.tex}
+% \begin{document}
+% ...
+% \begin{thesis}
+% \include{chapter1.tex}
+% \include{chapter2.tex}
+% \include{chapter3.tex}
+% \include{chapter4.tex}
+% \end{thesis}
+% ...
+% \end{document}
+% \end{example}
+% which would only compile chapters two and three. Don't confuse the
+% similar commands |\include| and |\input|. The more fundamental
+% |\input| just inserts the file contents at that point, while
+% |\include|
+% \begin{itemize}
+% \item may only be used after |\begin{document}|
+% \item acts like |\clearpage \input{} \clearpage|
+% \item will not crash on nonexistent files
+% \end{itemize}
+%
+%
% \StopEventually{\pagebreak\PrintChanges}
%
%
\newif\if@boldpart
\newif\if@dottedpart
\newif\if@draftwatermark
+\newif\if@mydraftwatermark
\newif\if@indentfirst
-\newif\if@appendix
\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}
% \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}
\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}}
%
+% 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}
% 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
% 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}
+\fancyfoot[RE,LO]{\scshape\leftmark}
+\fancyfoot[LE,RO]{\scshape\rightmark}
\fancyhead[LE,RO]{\thepage}
% \end{macrocode}
% Override the |plain| format (for part pages, etc.).
% \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.
+% \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}
+\newlength\DUT@baselineskip
+\setlength\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}
%
% 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{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}'
+% `\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}
%
% 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
% Here is the title text itself.
% \begin{macrocode}
\begin{center}%
- \begin{spacing}{\@tsp}
- {\bf \@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.
% \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\\
\@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}
\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}
% (\file{classes.dtx}, L2053)
% \begin{macrocode}
\renewcommand\chaptermark[1]{%
- \markboth {\MakeUppercase{%
+ \markboth {%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter: \ %
\fi
\fi
- #1}}{}}
+ #1}{}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\schaptermark}
% Setup unnumbered chapter marks for \pkg{fancyhdr}.
% \begin{macrocode}
-\newcommand\schaptermark[1]{\markboth{\MakeUppercase{#1}}{}}
+\newcommand\schaptermark[1]{\markboth{#1}{}}
% \end{macrocode}
% \end{macro}
%
% (\file{classes.dtx}, L2054)
% \begin{macrocode}
\renewcommand{\sectionmark}[1]{%
- \markright {\MakeUppercase{%
+ \markright {%
\ifnum \c@secnumdepth >\z@
\thesection \ %
\fi
- #1}}}
+ #1}}
% \end{macrocode}
% \end{macro}
%
\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
% (\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}
% \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}
+ \setstretch{\@dsp}%
}{%
- \end{spacing}
+ \setstretch{\@ssp}%
}
% \end{macrocode}
% \end{environment}
\DUT@clearpage
\ifpdf
\phantomsection
- \pdfbookmark[0]{\acknowledgmentsname}{acknowledgments}
+ \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}{%
- \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'':
-% \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}
- \begin{spacing}{\@ssp}
\begin{center}
- {\large \bfseries \abstractname \par}
-%% \@endparpenalty\@M
+ \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
- \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}
- \blanklines{1}
- \begin{spacing}{\@dsp}
+ \listed@schapter{\vitaname}
+ \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}
%
%
% \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}
- \setstretch{\@dsp}
+ \setstretch{\@dsp}%
}
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Table of Contents}
+% \label{sec:implement-toc}
%
-% \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{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}
+%
+% \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}
+\renewcommand\cfttoctitlefont{%
+% \end{macrocode}
+% Start a new page in \Lopt{final} mode
% \begin{macrocode}
-\renewcommand\tableofcontents{%
\DUT@clearpage
% \end{macrocode}
-% If we're using pdf\LaTeX, add a bookmark.
+% Add a bookmark if we're using pdf\LaTeX.
% \begin{macrocode}
\ifpdf
\phantomsection
- \pdfbookmark[0]{\contentsname}{tableofcontents}
+ \pdfbookmark[0]{\contentsname}{\contentsname}
\fi
- \chapter*{\contentsname}
% \end{macrocode}
-% Set the marks for \cls{fancyhdr}'s fancy header.
+% |\chapter*| to gobble and format the next token (|\contentsname|).
% \begin{macrocode}
- \@mkboth{\MakeUppercase\contentsname}%
- {\MakeUppercase\contentsname}%
- \@starttoc{toc}%
-}
+ \chapter*}
% \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{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{macro}{\aftertoctitleskip}
+% Don't add any extra space after the title (the chapter will take
+% care of that).
% \begin{macrocode}
- \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+\setlength\cftaftertoctitleskip{0pt}
% \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.
+% \end{macro}
+%
+% \begin{macro}{\l@cont@sep}
+% Define a length for TOC/LOF/LOT spacing.
% \begin{macrocode}
- \penalty\@highpenalty
- \endgroup
- \fi
- \end{spacing}
-}
+\newlength\l@cont@sep
+\set@lines@length{\l@cont@sep}{\@cont@sep}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\l@part}
-% Override \cls{book}'s |\l@part|.
-% (\file{classes.dtx}, L3775)
+% \begin{macro}{\@cont@font}
+% Define a font for high level (part, chapter) entries.
% \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}}
+\newcommand{\@cont@font}{\normalsize\scshape}
% \end{macrocode}
% \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}{\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}{\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). Actually we make a one-line correction so the first
+% line matches the first line in the TOC. HACK!
+% \begin{macrocode}
+\setlength\cftafterloftitleskip{-12pt}
+% \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). Actually we make a one-line correction so the first
+% line matches the first line in the TOC. HACK!
+% \begin{macrocode}
+\setlength\cftafterlottitleskip{-12pt}
+% \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}
%
%
\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}
+\section{Section in long-titled chapter}
\blabla{30}{20}
%</example-part>
% \end{macrocode}
% \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}. This is a
+% problem (although with opposite order) in the \cls{book} class
+% itself. For example, compile
+% \begin{example}
+%\documentclass{book}
+%\begin{document}
+%\chapter{Chapter with text}
+%Bla bla bla.
+%\chapter{Chapter with section}
+%\section{Section}
+%Bla bla bla.
+%\end{document}
+% \end{example}
+% \item Footer overlap if chapter/section names are particularly long.
+% See \emph{Section in long-titled chapter} in \file{example.pdf}.
+% Workaround: turn off either chapters or sections in the footer.
+% \begin{example}
+% \fancyfoot[RE,LO]{\scshape\leftmark}
+% \fancyfoot[LE,RO]{}
+% \end{example}
+% \end{itemize}
+%
+%
% \Finale
\endinput