X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=drexel-thesis.dtx;h=904e7f483863cd1d91268c38ddf91ffaa6cc6a0e;hb=f39ba2dbaf7ed3df14181c7ff47cc38759e3b0bb;hp=ec42f3f142b1c2bc491e4ca249668014609410af;hpb=11df4cfeb9ddddecc1fbbbd99c85661543c30c3d;p=drexel-thesis.git diff --git a/drexel-thesis.dtx b/drexel-thesis.dtx index ec42f3f..904e7f4 100644 --- a/drexel-thesis.dtx +++ b/drexel-thesis.dtx @@ -1,11 +1,22 @@ -% \def\fileversion{0.3} -% \def\filedate{2010/01/09} +% \def\fileversion{0.7} +% \def\filedate{2010/03/14} % \iffalse meta-comment -%\def\fileversion{0.3} -%\def\filedate{2010/01/09} -% -% Copyright (C) 2010 W. Trevor King, Daniel J. Cross, T. Tsankov, and -% R. Rojas. +%\def\fileversion{0.7} +%\def\filedate{2010/03/14} +% +% Copyright (C) 2010 C.Y. Ip +% Christopher D. Cera +% Christopher S. Dahn +% Daniel J. Cross +% David T. McWherter +% Evan Sultanik +% Jeff Arahamson +% Mitchell Peabody +% R. Rojas, E +% Robert Bernecky +% T. Tsankov +% Vincent A. Cicirello +% W. Trevor King % ------------------------------------------------------- % % This file may be distributed and/or modified under the @@ -18,7 +29,8 @@ % and version 1.3 or later is part of all distributions of LaTeX % version 2003/12/01 or later. % -% Based on Scott Pakin's dtxtut/cskeleton.dtx +% Docstrip formatting initially based on Scott Pakin's +% dtxtut/cskeleton.dtx % http://www.ctan.org/tex-archive/info/dtxtut/ % % \fi @@ -110,18 +122,30 @@ % \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. % Based on the University of Toronto Thesis \LaTeXe\ Class. Also % greatly improved the documentation by incorperating bits of % the base/*.dtx files.} +% \changes{0.4}{2010/02/23}{W.~Trevor King repositioned hyperref +% inclusion for proper hyperref overriding. The previous +% implementation couldn't handle $\backslash$label for +% $\backslash$paragraph and some other section levels. The page +% number for the reference was correct, but the link went to the +% label's parent chapter.} +% \changes{0.5}{2010/03/03}{W.~Trevor King use hypcap for better +% caption hyperlink anchor placement.} +% \changes{0.6}{2010/03/11}{W.~Trevor King fixed +% $\backslash$if\@ final handling. Previous versions used +% it more like a hypothetical $\backslash$if\@ finalspace. +% Also adjusted theindex to use a listed\@ schapter.} % % \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.}} @@ -173,9 +197,18 @@ % \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{subfig} +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/}{\pkg{subfig}} +% makes it easy to include and caption multi-part figures. However, +% getting \pkg{subfig} to cooperate with \pkg{floatrow} and +% \pkg{tocloft} can be tricky. If you want to use \pkg{subfig}, just +% pass the \Lopt{subfig} option to \cls{drexel-thesis}, and all the +% pesky details will be taken care of. See Section +% \ref{sec:better-example} for an example. +% % \DescribeOption{finalspace} % Loosen spacing. % @@ -185,16 +218,27 @@ % \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{indenttoc} +% The example table of contents in the Manual p17 does not indent +% section entries, etc., so neither does \cls{drexel-thesis}. If you +% \emph{do} want pretty, indented TOCs, like the \LaTeX\ defaults pass +% \Lopt{indenttoc} to \cls{drexel-thesis}. % % \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. @@ -307,11 +351,12 @@ % See the Manual 3.2 p9. % % \begin{command} -% `\cs{copyrighttextCC}' +% `\cs{copyrighttextCCBYSA}' % \end{command} % There are a number of predefined copyright messages for ease of use \\ % \begin{tabular}{l l} -% |\copyrighttextCC| & Creative Commons copyright \\ +% |\copyrighttextCCBYSA| & +% Creative Commons Attribution-ShareAlike License Version 3.0.\\ % \end{tabular} % % \begin{command} @@ -347,7 +392,7 @@ % `\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} @@ -368,6 +413,15 @@ % The skipped lines are always \emph{single spaced} lines, regardless % of the current line spacing in the environment calling this macro. % +% \begin{command} +% `\cs{iffinal}\marg{final-mode-action}\marg{draft-mode-action}' +% \end{command} +% \DescribeMacro{\iffinal} +% Include \Lopt{final}- or \Lopt{draft}-specific code. +% \begin{example} +% We're in \iffinal{final}{draft} mode! +% \end{example} +% % % \subsection{Environments} % @@ -471,9 +525,11 @@ % \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 +% for pretty caption formatting, % \href{http://www.ctan.org/tex-archive/macros/latex/required/floatrow/}{\pkg{floatrow}} -% for placing captions. +% for placing captions, and +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}{\pkg{hypcap}} +% for placing caption anchors. % % Simple float definitions will look like % \begin{example} @@ -491,10 +547,11 @@ % \caption{Some caption text} % \end{float} % \end{example} -% For more useful float information, see the +% For more useful float information, see the examples in Section +% \ref{sec:better-example-part} and the % \href{http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions} % {\LaTeX\ wikibook page}. -% +% % % \subsubsection{Citations} % @@ -512,8 +569,16 @@ % % \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} @@ -531,6 +596,39 @@ % 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} % % @@ -556,16 +654,34 @@ % Define some booleans to store option states % \begin{macrocode} \newif\if@mainmatter \@mainmattertrue +\newif\if@DUT@subfigopt \newif\if@dottedchapter \newif\if@boldchapter \newif\if@boldpart \newif\if@dottedpart +\newif\if@indenttoc \newif\if@draftwatermark +\newif\if@mydraftwatermark \newif\if@indentfirst -\newif\if@appendix -\newif\if@final \@finalfalse +\newif\if@final % \end{macrocode} % +% \begin{macro}{\iffinal} +% Setup a user-friendly means for including \Lopt{final}- or +% \Lopt{draft}-specific code. +% \changes{0.7}{2010/03/14}{W.~Trevor King added macro.} +% \begin{macrocode} +\newcommand\iffinal[2]{\if@final #1\else #2\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{option}{subfig} +% Set \Lopt{subfig} flag +% \begin{macrocode} +\DeclareOptionX{subfig}{\@DUT@subfigopttrue} +% \end{macrocode} +% \end{option} +% % \begin{option}{finalspace} % \begin{macrocode} \DeclareOptionX{finalspace}{ @@ -574,7 +690,6 @@ \def\@ssp{1} % single space \def\@dsp{2} % double space \def\@tsp{3} % triple space - \@finaltrue } % \end{macrocode} % \end{option} @@ -590,7 +705,6 @@ % Don't force chapters onto right-hand pages. % \begin{macrocode} \PassOptionsToClass{openany}{book} - \@finalfalse } % \end{macrocode} % \end{option} @@ -603,7 +717,7 @@ % \begin{option}{dottedchapter} % \begin{macrocode} \DeclareOptionX{dottedchapter}{\@dottedchaptertrue} -% \end{macrocode} +% \end{macrocode}1 % \end{option} % \begin{option}{boldpart} % \begin{macrocode} @@ -632,10 +746,28 @@ % \end{macrocode} % \end{option} % +% \begin{option}{indenttoc} +% Set \Lopt{indenttoc} flag +% \begin{macrocode} +\DeclareOptionX{indenttoc}{\@indenttoctrue} +% \end{macrocode} +% \end{option} +% % \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} % @@ -663,6 +795,7 @@ % \begin{option}{final} % \begin{macrocode} \DeclareOptionX{final}{ + \@finaltrue \setkeys{drexel-thesis.cls}{oneside} \setkeys{drexel-thesis.cls}{finalspace} \setkeys{drexel-thesis.cls}{dottedtoc} @@ -673,10 +806,11 @@ % \begin{option}{draft} % \begin{macrocode} \DeclareOptionX{draft}{ + \@finalfalse \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} @@ -725,7 +859,8 @@ % \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} @@ -779,9 +914,51 @@ \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} @@ -810,6 +987,28 @@ % 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} +\if@DUT@subfigopt + \RequirePackage[subfigure]{tocloft} +\else + \RequirePackage{tocloft} +\fi +% \end{macrocode} +% The \Lopt{subfigure} option sets up \pkg{tocloft} for +% \pkg{subfig}/\pkg{subfigure} compatibility. See the +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/tocloft/tocloft.pdf}{% +% \pkg{tocloft} manual, Section 2.1} +% for details. +% +% 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 @@ -844,6 +1043,15 @@ \floatsetup{captionskip=10pt} \floatsetup[table]{captionskip=10pt} % \end{macrocode} +% Use \pkg{fr-subfig} for \pkg{floatrow}/\pkg{subfig} compatibility. +% See the \pkg{floatrow} documentation (Sec.~7.1, ``The \pkg{subfig} +% package'') and \pkg{subfig} documentation (Sec.~4.3, +% ``\pkg{FloatRow} Package'') for details. +% \begin{macrocode} +\if@DUT@subfigopt + \RequirePackage{fr-subfig} +\fi +% \end{macrocode} % We set up the three-line surrounding spaces in Section % \ref{sec:implement-floats}. % @@ -851,7 +1059,20 @@ % won't need to. % % +% \subsubsection{\pkg{subfig}} +% \label{sec:subfig} +% +% Allow multi-part figures with +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/}{\pkg{subfig}}. +% \begin{macrocode} +\if@DUT@subfigopt + \RequirePackage{subfig} +\fi +% \end{macrocode} +% +% % \subsubsection{\pkg{fancyhdr}} +% \label{sec:fancyhdr} % % \href{http://www.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/}{\pkg{fancyhdr}} % for correct page numbering and fancy headers. @@ -867,6 +1088,9 @@ % \begin{macrocode} \pagestyle{fancy} \fancyhf{} +% \end{macrocode} +% Turn off the header rule by setting its width to $0$. +% \begin{macrocode} \renewcommand{\headrulewidth}{0pt} % \end{macrocode} % 0.4 pt is \pkg{fancyhdr}'s default |\headrulewidth|, so we'll @@ -879,8 +1103,8 @@ % 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.). @@ -899,6 +1123,14 @@ } % \end{macrocode} % +% Note that the Chapter / Section footer is not required. You can +% remove the footer text and rule entirely with. +% \begin{example} +% \renewcommand{\footrulewidth}{0pt} +% \fancyfoot[RE,LO]{} +% \fancyfoot[LE,RO]{} +% \end{example} +% % % \subsubsection{\pkg{ifpdf}} % @@ -909,19 +1141,24 @@ % \end{macrocode} % % \subsubsection{\pkg{hyperref}} +% \label{sec:hyperref} % % \href{http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/}{\pkg{hyperref}} % for hyperlinks. Not strictly necessary, but I can't imagine a -% thesis without it. -% \begin{macrocode} -\RequirePackage[final]{hyperref} -% \end{macrocode} -% Nobody likes the default colored boxes. Color the text itself. -% \begin{macrocode} -\hypersetup{colorlinks} -% \end{macrocode} -% If we're writing a PDF, we set the |pdfauthor|, etc.\ arguments in -% |\author|, etc.\ to avoid using |\AtBeginDocument| or some such. +% thesis without it. We actually include this later +% (Section~\ref{sec:hyperref-inclusion}), because \pkg{hyperref} +% sticks its fingers into \emph{everything} and we want it to use our +% versions of some macros (e.g. |\@sect|) but not others +% (e.g. |thebibliography|). +% +% +% \subsubsection{\pkg{hypcap}} +% \label{sec:hypcap} +% +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}{\pkg{hypcap}} +% for placing caption hyperlink anchors. Must be included after +% \pkg{hypercap}, so the actual inclusion is in +% Section~\ref{sec:hypcap-inclusion}). % % % \subsection{\LaTeX\ overrides and extensions} @@ -955,7 +1192,8 @@ % |\author| for use in |\maketitle|. If not given |\maketitle| will % produce a warning message (\file{ltsect.dtx}, L129). % -% We extend |\author| to set \pkg{hyperref}'s |pdfauthor|. +% We extend |\author| to set \pkg{hyperref}'s |pdfauthor| if we're +% writing a PDF to avoid using |\AtBeginDocument| or some such. % (\file{ltsect.dtx}, L129). % \begin{macrocode} \let\DUT@author\author @@ -1089,78 +1327,34 @@ % \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 $\backslash$setlength to store the +% value at the default font. The previous version used +% $\backslash$let, which made $\backslash$DUT\@baselineskip a +% synonym for $\backslash$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} % @@ -1221,11 +1415,10 @@ % 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}{% @@ -1276,12 +1469,11 @@ % 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 @@ -1355,37 +1547,64 @@ % % % \begin{command} -% `\cs{set@lines@length}\marg{length}\marg{N}' +% `\cs{blanklines}\marg{N}' +% `\cs{blanklines*}\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{macro}{\blanklines} +% 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} -\let\DUT@baselineskip\baselineskip -\newcommand{\set@lines@length}[2]{% - \setlength{#1}{\DUT@baselineskip * {#2}} +\newlength\DUT@blanklines@length +\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} % % -% \begin{command} -% `\cs{blanklines}\marg{N}' -% \end{command} -% \begin{macro}{\blanklines} -% Insert \meta{N} blank lines. +% \subsection{\pkg{hyperref} inclusion} +% \label{sec:hyperref-inclusion} +% +% This is the awkward \pkg{hyperref} inclusion. See +% Section~\ref{sec:hyperref} for an explanation of why we stash it +% here. % \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} -} +\RequirePackage[final]{hyperref} % \end{macrocode} -% \end{macro} +% Nobody likes the default colored boxes. Color the text itself. +% \begin{macrocode} +\hypersetup{colorlinks} +% \end{macrocode} +% +% \subsubsection{\pkg{hypcap}} +% \label{sec:hypcap-inclusion} +% +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/}{\pkg{hypcap}} +% for placing caption hyperlink anchors. Not strictly necessary, but +% we're using \pkg{hyperref}, and the poor link targets are annoying. +% \begin{macrocode} +\RequirePackage[all]{hypcap} +% \end{macrocode} +% \Lopt{all} redefines the figure and table environments to +% place the anchor at the start of the float. % % % \subsection{\cls{book} overrides and extensions} @@ -1452,8 +1671,8 @@ % 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 @@ -1464,22 +1683,24 @@ % 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. @@ -1526,13 +1747,13 @@ % \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} @@ -1541,14 +1762,18 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\copyrighttextCC} -% The Creative Commons license. +% \begin{macro}{\copyrighttextCCBYSA} +% The Creative Commons Attribution-ShareAlike License. +% \changes{0.4}{2010/02/23}{W.~Trevor King renamed from +% $\backslash$copyrighttextCC, and made specific to Creative Commons +% Attribution-ShareAlike Version 3.0.} % \begin{macrocode} -\newcommand\copyrighttextCC{ +\newcommand\copyrighttextCCBYSA{ \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/}. + Attribution-ShareAlike license Version 3.0. The license is + available at \\ + \url{http://creativecommons.org/licenses/by-sa/3.0/}. \end{quote} } % \end{macrocode} @@ -1557,7 +1782,7 @@ % % \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} @@ -1565,20 +1790,20 @@ % (\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} % @@ -1587,11 +1812,11 @@ % (\file{classes.dtx}, L2054) % \begin{macrocode} \renewcommand{\sectionmark}[1]{% - \markright {\MakeUppercase{% + \markright {% \ifnum \c@secnumdepth >\z@ \thesection \ % \fi - #1}}} + #1}} % \end{macrocode} % \end{macro} % @@ -1662,10 +1887,10 @@ \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. @@ -1761,6 +1986,25 @@ % \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, @@ -1769,58 +2013,33 @@ % (\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 @@ -1855,12 +2074,18 @@ % (\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}% HACK! {\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} @@ -1886,11 +2111,14 @@ \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} @@ -1902,9 +2130,15 @@ % \pkg{fancyhdr}. % (\file{classes.dtx}, L2582). % \begin{macrocode} -\def\@schapter#1{\schaptermark{#1}% - \@makeschapterhead{#1}% - \@afterheading} +\def\@schapter#1{ +% \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 #1}% + \schaptermark{#1}% + \@makeschapterhead{#1}% + \@afterheading} % \end{macrocode} % \end{macro} % @@ -1915,33 +2149,18 @@ % (\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} @@ -2004,12 +2223,12 @@ \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} @@ -2027,12 +2246,12 @@ \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} @@ -2040,43 +2259,49 @@ % \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} @@ -2089,18 +2314,21 @@ % \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} @@ -2112,14 +2340,10 @@ % \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} @@ -2136,12 +2360,13 @@ % \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 @@ -2157,287 +2382,304 @@ % 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{macro}{\aftertoctitleskip} +% Don't add any extra space after the title (the chapter will take +% care of that). % \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 +\setlength\cftaftertoctitleskip{0pt} % \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{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. +% \end{macro} +% +% \begin{macro}{\l@cont@sep} +% Define a length for TOC/LOF/LOT spacing. % \begin{macrocode} - \blanklines{\@cont@sep} +\newlength\l@cont@sep +\set@lines@length{\l@cont@sep}{\@cont@sep} % \end{macrocode} -% Discourage page breaking. +% \end{macro} +% +% \begin{macro}{\@cont@font} +% Define a font for high level (part, chapter) entries. % \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}{\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} % -% \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. +% The default indents above are all |0pt|. If \Lopt{indenttoc} was +% given, override this, restoring the \pkg{tocloft} defaults, see the +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/tocloft/tocloft.pdf}{% +% \pkg{tocloft} manual, Table 1}. % \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}} +\if@indenttoc + \cftsetindents{chapter}{0pt}{1.5em} + \cftsetindents{section}{1.5em}{2.3em} + \cftsetindents{subsection}{3.8em}{3.2em} + \cftsetindents{subsubsection}{7.0em}{4.1em} +\fi % \end{macrocode} -% \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} % @@ -2498,15 +2740,68 @@ % so we will still get our table of contents entry. % \begin{macrocode} \newcommand{\bib@heading}{% - \phantomsection% - \AddContentsLine*{toc}{chapter}{}{\bibname}% - \chapter*{\bibname}% - \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}% + \listed@schapter{\bibname}% } % \end{macrocode} % \end{macro} % +% +% \subsubsection{Index} +% +% \begin{environment}{theindex} +% The environment |theindex| can be used for indices. It makes an +% index with two columns, with each entry a separate paragraph. At +% the user level the commands |\item|, |\subitem| and |\subsubitem| +% are used to produce index entries of various levels. When a new +% letter of the alphabet is encountered an amount of |\indexspace| +% white space can be added. +% +% Override \cls{book}'s version, adding a line to the table of +% contents. We split out the section-creation code into +% |\bib@heading| for \pkg{natbib} compatibility. +% (\file{classes.dtx}, L4107). +% \begin{macrocode} +\renewenvironment{theindex} + {\if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi +% \end{macrocode} +% Here we add our TOC entry, and setup two-columness by hand +% to avoid the |\clearpage| in \LaTeX's default |\twocolumn|. +% \begin{macrocode} + \listed@schapter{\indexname} + \global\columnwidth\textwidth + \global\advance\columnwidth-\columnsep + \global\divide\columnwidth\tw@ + \global\hsize\columnwidth + \global\linewidth\columnwidth + \global\@twocolumntrue + \global\@firstcolumntrue + \col@number \tw@ +% \end{macrocode} +% Parameter changes to |\columnseprule| and |\columnsep| have to be +% done after |\twocolumn| has acted. Otherwise they can affect the +% last page before the index. +% \begin{macrocode} + \parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \columnseprule \z@ + \columnsep 35\p@ + \let\item\@idxitem} +% \end{macrocode} +% When the document continues after the index and it was a one +% column document we have to switch back to one column after the +% index. +% \begin{macrocode} + {\if@restonecol\onecolumn\else\DUT@clearpage\fi} +% \end{macrocode} +% \end{environment} +% +% % \subsubsection{Words} +% \label{sec:words} % % Set the official names of the various sections encountered. Some of % these are not defined in \file{classes.dtx} but are close analogs of @@ -2611,28 +2906,6 @@ % \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} % % @@ -2706,8 +2979,8 @@ % \begin{macrocode} %<*example|example-draft> %% See drexel-thesis.pdf for details. -%\documentclass{drexel-thesis} -%\documentclass[draft]{drexel-thesis} +%\documentclass[subfig]{drexel-thesis} +%\documentclass[draft,subfig]{drexel-thesis} %% Enter the appropriate information here \author{Johny Henry} @@ -2718,7 +2991,7 @@ \advisor{Collis Potter Huntington, R.R.D.} \advisor{Advisor 2, Ph.D.} \advisor{Advisor 3, Ph.D.} -\copyrighttext{\copyrighttextCC} +\copyrighttext{\copyrighttextCCBYSA} \usepackage[super,sort&compress]{natbib} % fancy citation extensions \bibliographystyle{unsrtnat} @@ -2726,17 +2999,43 @@ \usepackage{fancyvrb} % nicer verbatim handling \DefineShortVerb{\|} % \verb+TEXT+ -> |TEXT| -\usepackage{blabla} % \blabla macro for producing dummy output +% \end{macrocode} +% Use +% \href{http://www.ctan.org/tex-archive/macros/latex/contrib/blindtext/}{\pkg{blindtext}} +% for dummy text creation. \pkg{blindtext} requires +% \href{}{\pkg{babel}}. +% \begin{macrocode} +\usepackage[english]{babel} % English blindtext +\usepackage{blindtext} % macros for producing dummy output +% \end{macrocode} +% \pkg{babel} messes with some of our words (Section \ref{sec:words}), so +% we have to reset them. See the +% \href{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords}{\TeX\ FAQ} +% for details. +% \begin{macrocode} +\addto\captionsenglish{% + \renewcommand\dedicationsname{Dedications}% + \renewcommand\acknowledgmentsname{Acknowledgments}% + \renewcommand\contentsname{Table of Contents}% + \renewcommand\listtablename{List of Tables}% + \renewcommand\listfigurename{List of Figures}% + \renewcommand\abstractname{Abstract}% + \renewcommand\bibname{Bibliography}% + \renewcommand\appendixname{Appendix}% + \renewcommand\vitaname{Vita}% +} \begin{document} \begin{preamble} \begin{dedications} -\blabla{10}{20} +We're in \iffinal{final}{draft} mode! + +\Blindtext[3] \end{dedications} \begin{acknowledgments} -\blabla{10}{20} +\Blindtext[3] \end{acknowledgments} \tableofcontents @@ -2744,7 +3043,7 @@ \listoffigures \begin{abstract} -\blabla{10}{20} +\Blindtext[3] \end{abstract} \end{preamble} @@ -2758,7 +3057,7 @@ \include{example-a} \begin{vita} -\blabla{10}{20} +\Blindtext[3] \end{vita} \end{document} @@ -2767,6 +3066,7 @@ % % % \subsubsection{Part} +% \label{section:better-example-part} % % \begin{macrocode} %<*example-part> @@ -2794,7 +3094,7 @@ Here we have a text citation \citet{rief97} followed by a parenthetical citation\citep{rief97}. \subsubsection{Tables and Figures} -\blabla{2}{20} +\Blindtext[2] \begin{table} \begin{center} \begin{tabular}{r@{.}l r@{.}l r@{.}l} @@ -2806,7 +3106,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 + \caption{A table float.} % 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}). @@ -2815,20 +3115,37 @@ parenthetical citation\citep{rief97}. %% to span the pre- and post-decimal columns. \end{center} \end{table} -\blabla{5}{20} +\Blindtext[2] \begin{figure} - \caption{A figure float. \bla{20}} % high caption allowed with floatrow + \caption{A figure float. \blindtext} % high caption allowed with floatrow \begin{center} \includegraphics[width=0.4\textwidth]{drexel-logo} \end{center} \end{figure} -\blabla{10}{20} +\Blindtext[3] +\begin{figure} + \begin{center} + \subfloat[][]{% + \includegraphics[width=0.2\textwidth]{drexel-logo}% + \label{fig:sub-a}} + \subfloat[][]{% + \includegraphics[width=0.2\textwidth]{drexel-logo}% + \label{fig:sub-b}} + \caption{(a) One subfig float. (b) Another subfig float.% + \label{fig:both}} + \end{center} +\end{figure} +You can reference the subfig floats individually (\ref{fig:sub-a}) or +together (\ref{fig:both}). + +\Blindtext[3] \part{Another Part} \chapter{Another Chapter} -\blabla{30}{20} -\chapter{Yet another Chapter} -\blabla{30}{20} +\Blindtext[5] +\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} +\Blindtext[5] % % \end{macrocode} % @@ -2897,42 +3214,54 @@ parenthetical citation\citep{rief97}. % \begin{macrocode} %<*example-appendix> \chapter{Some Appendix Heading} -\blabla{10}{20} +\Blindtext[5] \chapter{Another Appendix Heading} -\blabla{10}{20} +\Blindtext[5] % % \end{macrocode} % % -% \subsubsection{\pkg{blabla}} +% \section{Known bugs and issues} % -% Define the \pkg{blabla} package for generating dummy text. This -% will make it easier to generate reasonable exampes. -% \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] - -\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@j}{0}{\value{blabla@j} < #1}{ \bla{#2}\par } -} -% -% \end{macrocode} +% +% \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 sections in the footer: +% \begin{example} +% \fancyfoot[RE,LO]{\scshape\leftmark} +% \fancyfoot[LE,RO]{} +% \end{example} +% For more header or footer manipulation ideas, see Section \ref{sec:fancyhdr}. +% \end{itemize} % % % \Finale