The citthesis class and related packages^{∗}

Andrew D. Lewis

1998/03/05

1 Introduction

This file contains documentation for the citthesis document class and some of the packages I include along with it for people who might find them useful. As you probably can guess, the document class will typeset a thesis which meets the criteria of the graduate office at the California Institute of Technology. The L^{A}TEX stuff should come bundled along with a bunch of other stuff including a demo thesis to get you started. Probably the best way to get quickly using citthesis is to look at the demo and the documentation for the main system. Here we outline some of the details of the L^{A}TEX files.

2 The basic features of the citthesis document class

citthesis is based on the book document class and so inherits all the functionality of book. However, it has some different/extra features as well.

2.1 Files loaded by citthesis

\citthesis requires the packages multicol, graphicx, and comment. The first

two are standard L^{A}TEX packages (the first belonging to the tools bundle and the second to the graphics bundle). I have included comment with the citthesis files.

2.2 Options

As well as the options for book there are the following options.

abstract Abstract gets printed.

noabstract Abstract does not get printed. acknowledgements Acknowledgements get printed. noacknowledgements Acknowledgements do not get printed. doublespace Text is double spaced. singlespace Text is single spaced. techreport The document is processed in a more readable technical report format

∗This file has version number v2.0a, last revised 1998/03/05.

for “non-official” uses. uppercase Makes the automatically generated chapter titles (i.e., “List of Fig-

ures” and “List of Tables”) uppercase (as I have written them here). lowercase Makes those same chapter titles lowercase (i.e., “List of figures” and

“List of tables”). 2up Make document in 2up format (requires Timothy Van Zandt’s package).

The defaults are abstract, acknowledgements, doublespace, and uppercase.

2.3 The title page

In order to typeset the title page you must provide citthesis with the your data by providing the proper arguments for the following commands:

1. \title: The title of the thesis.

2. \author: That’d be you.

3. \degree: “Master of Science” or “Doctor of Philosophy”.

4. \degreemonth: The month you defended your thesis.

5. \degreeyear: The year you defended your thesis.

6. \thesisdate: The date of your defence in Month dd, yyyy format.

7. \department: Department from which you will receive your degree.

8. \techreportnumber: This is optional and is just what you think it is.

\maketitle When you have entered the data, simply type \maketitle and the title page will be built.

2.4 The copyright page

If you will be getting your thesis copyrighted (they offer to have someone take care of this for a fee), then a page to this effect should appear. It will appear

\copyrightpage immediately following the title page and to get it, simply type \copyrightpage.

2.5 Acknowledgements

acknowledgementspage Your acknowledgements should be enclosed in the environment acknowledgementspage.

2.6 Abstract

abstractpage Your abstract should be enclosed in the environment abstractpage.

2.7 The main body of the thesis

\starttext To get all the page numbering and that sort of thing straight, type \starttext just before you start your first “real” chapter (likely the introduction).

3 The citendfloat macros

I had someone ask me to make it so all the figures for the thesis would appear at the end. Well, this is possible and I heavily modified an existing package to accomplish this. The resulting package is citendfloat.

3.1 Options

I tried to build a large degree of flexibility into citendfloat by making certain behaviour controllable by options. These are as follows.

display Selecting this option will ensure the figures are displayed at the end of the document.

nodisplay In this case, the figures will not appear. This can save printing time, etc.

figlist A list of figures is generated.

nofiglist No figure list is generated.

figparts A list of figures is displayed at the end of each part. Specifying this option will provide erratic results if your dissertation doe not in fact contain parts…

nofigparts If your thesis has multiple parts, the figures will be all kept until the very end.

write The figures created in the document will be built anew.

nowrite The existing figures from previous runs will not be overwritten by the ones from this run. I recall this feature being useful for something — can’t remember what now though.

The defaults are display, nofiglist, nofigparts, and write.

3.2 Usage

Well, there shouldn’t be much to say here. Just load the package with the options you want and the figures should appear at the end (or not depending on the options you select).

If you have figures which appear before the first part, these figures will get written to the file filename.figs0 and will not be processed by citthesis. So be aware of this!

4 The citmakesdx package

\sindex This package makes available the \sindex macro for making a list of symbols with the program Makesymbolindex. If you don’t have this program, the package won’t be of much use. If you do have the program, read its documentation to see how it works.

There are two options for citmakesdx, colon and nocolon. Choose the one you want depending on whether you want a colon after the symbol in the list. Try each and see which you like…

5 Implementation

I will be a bit sketchy here. There’s a lot of stuff!

5.1 citthesis.cls

1 ⟨∗citthesis⟩

Required packages and options. Use the book document class as a template.

2

 3 \RequirePackage{multicol,graphicx,comment}
 4 \newif\if@CIT@techreport\@CIT@techreportfalse
 5 \newcommand\techreporttest[2]{\if@CIT@techreport#1\else#2\fi}
 6 \newif\if@CIT@singlespace\@CIT@singlespacefalse
 7 \newif\if@CIT@abstract\@CIT@abstracttrue
 8 \newif\if@CIT@acknowledgements\@CIT@acknowledgementstrue
 9 \newcommand\@CIT@ptsize{\@ne}
10 \DeclareOption{10pt}{\renewcommand\@CIT@ptsize{\z@}}
11 \DeclareOption{11pt}{\renewcommand\@CIT@ptsize{\@ne}}
12 \DeclareOption{12pt}{\renewcommand\@CIT@ptsize{\tw@}}
13 \DeclareOption{techreport}{\@CIT@techreporttrue\@CIT@singlespacetrue}
14 \DeclareOption{singlespace}{\@CIT@singlespacetrue}
15 \DeclareOption{doublespace}{\@CIT@singlespacefalse}
16 \DeclareOption{abstract}{\@CIT@abstracttrue}
17 \DeclareOption{noabstract}{\@CIT@abstractfalse}
18 \DeclareOption{acknowledgements}{\@CIT@acknowledgementstrue}
19 \DeclareOption{noacknowledgements}{\@CIT@acknowledgementsfalse}
20 \DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse}

21 \DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue}
22 \DeclareOption{uppercase}{\def\@CIT@uppercase{\@ne}}
23 \DeclareOption{lowercase}{\def\@CIT@uppercase{\z@}}
24 \DeclareOption{2up}{\def\@ADL@@twoup{\@ne}}
25 \DeclareOption{1up}{\def\@ADL@@twoup{\z@}}
26 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
27 \ExecuteOptions{draft,abstract,acknowledgements,oneside,uppercase,1up}
28 \ProcessOptions

29

30 \ifnum\@CIT@ptsize=\z@
31 \if@twoside
32 \LoadClass[10pt,twoside,onecolumn]{book}
33 \else
34 \LoadClass[10pt,oneside,onecolumn]{book}
35 \fi
36 \else\ifnum\@CIT@ptsize=\tw@
37 \if@twoside
38 \LoadClass[12pt,twoside,onecolumn]{book}
39 \else
40 \LoadClass[12pt,oneside,onecolumn]{book}
41 \fi
42 \else
43 \if@twoside
44 \LoadClass[11pt,twoside,onecolumn]{book}
45 \else
46 \LoadClass[11pt,oneside,onecolumn]{book}
47 \fi
48 \fi
49 \fi
50 \ifnum\@CIT@uppercase=\@ne\else
51 \def\listfigurename{List of figures}
52 \def\listtablename{List of tables}
53 \fi

Get the right page parameters.

54

55 \textwidth5.4in
56 \textheight8.3in
57 \setlength\@tempdima        {\paperwidth}
58 \addtolength\@tempdima      {-\textwidth}
59 \setlength\oddsidemargin    {.5\@tempdima}
60 \addtolength\oddsidemargin  {-1in}
61 \setlength\marginparwidth   {.5\@tempdima}
62 \addtolength\marginparwidth {-2\marginparsep}
63 \ifdim \marginparwidth >2in
64 \setlength\marginparwidth{2in}
65 \fi
66 \@settopoint\oddsidemargin
67 \@settopoint\marginparwidth
68 \setlength\evensidemargin  {\paperwidth}

69 \addtolength\evensidemargin{-2in}
70 \addtolength\evensidemargin{-\textwidth}
71 \addtolength\evensidemargin{-\oddsidemargin}
72 \@settopoint\evensidemargin

73

74 \addtolength\textheight{\topskip}
75 \setlength\topmargin{\paperheight}
76 \addtolength\topmargin{-1.5in}
77 \addtolength\topmargin{-\headheight}
78 \addtolength\topmargin{-\headsep}
79 \addtolength\topmargin{-\textheight}
80 \addtolength\topmargin{-\footskip}     % this might be wrong!
81 \addtolength\topmargin{-.5\topmargin}
82 \@settopoint\topmargin

83

84 \ifnum\@ADL@@twoup=\@ne
85 \RequirePackage{2up}
86 \twoupplain
87 \setlength\paperheight{12in}
88 \setlength\paperwidth{15.9in}
89 \fi

90

91 \newcommand\twouphack{\ifnum\@ADL@@twoup=\@ne
92 \ifodd\thepage\null\newpage\null\newpage\fi\fi}

Page styles. Keep track of techreport option and two/oneside. Make a special page style for the beginning of chapters.

93

94 \newif\if@CIT@chapnum\@CIT@chapnumtrue
95 \renewcommand*\chaptermark[1]{}

96

97 \def\ps@plain{\let\@mkboth\markboth
98 \def\@oddfoot{}\def\@evenfoot{}
99 \def\@oddhead{\hfil\rmfamily\thepage\hfil}
100 \let\@evenhead\@oddhead}

101

102 \if@twoside
103 \def\ps@headings{\let\@mkboth\markboth
104 \let\@oddfoot\@empty\let\@evenfoot\@empty
105 \def\@evenhead{\thepage\hss{\slshape\leftmark}\hss}
106 \def\@oddhead{\hbox{}\hss{\slshape\rightmark}\hss\thepage}
107 \def\chaptermark##1{\markboth{\if@CIT@chapnum
108  \thechapter\enspace\fi ##1}{\if@CIT@chapnum\thechapter\enspace\fi ##1}}
109 \def\sectionmark##1{\markright{\if@CIT@chapnum
110  \thesection\ \fi ##1}}}
111 \else
112 \def\ps@headings{\let\@mkboth\markboth
113 \def\@oddfoot{}\def\@evenfoot{}
114 \def\@oddhead{\hbox{}{\slshape\rightmark}\hfill\rmfamily\thepage}
115 \def\@evenhead{\hfil\rmfamily\thepage\hfil\hbox{}{\slshape\leftmark}}

116 \def\chaptermark##1{\markboth{\if@CIT@chapnum
117  \thechapter\enspace\fi ##1}{\if@CIT@chapnum\thechapter\enspace\fi ##1}}
118 \def\sectionmark##1{\markright{\if@CIT@chapnum\thesection\enspace \fi ##1}}}
119 \fi
120 \def\ps@chapstart{\let\@mkboth\@gobbletwo
121  \let\@oddhead\@empty\def\@oddfoot{\reset@font\rmfamily\hfil\thepage
122  \hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot}
123 \if@CIT@techreport\pagestyle{headings}\else\pagestyle{plain}\fi

User data commands and title and copyright pages.

124

125 \newcommand\degree[1]{\setbox0\hbox{#1}\gdef\@CIT@degree{#1}}
126 \renewcommand\and{\gdef\@CIT@degreeword{Degrees}\par and\par}
127 \newcommand\@CIT@degreeword{Degree}
128 \newcommand\thesisdate[1]{\gdef\@CIT@thesisdate{#1}}
129 \newcommand\degreemonth[1]{\gdef\@CIT@degreemonth{#1}}
130 \newcommand\degreeyear[1]{\gdef\@CIT@degreeyear{#1}}
131 \newcommand\department[1]{\gdef\@CIT@department{#1}}
132 \newcommand\techreportnumber[1]{\gdef\@CIT@techrepno{#1}}
133 \let\@CIT@techrepno\@empty
134 \newcommand\advisor[1]{\gdef\@CIT@advisor{#1}}
135 \let\@CIT@advisor\@empty
136 \renewenvironment{titlepage}{\newpage\centering\thispagestyle{empty}
137 \parindent0pt\parskip10pt plus1fil minus1fil\def\baselinestretch{1}%
138 \@normalsize\vbox to \vsize\bgroup\vbox to 8in\bgroup}
139 {\par\kern 0pt\egroup\vss\egroup\newpage}
140 \if@CIT@techreport
141 \def\maketitle{\begin{titlepage}
142 \large\addvspace{5em}{\def\baselinestretch{1.2}%
143 \Large\bfseries\mathversion{bold}\@title\par}
144 \par\addvspace{1.5em} Thesis by\\\@author\par\normalsize%
145 \addvspace{14em}\par
146 \ifx\@CIT@techrepno\@empty{Technical Report}%
147 \else{Technical Report~\@CIT@techrepno}\fi\\for the\\
148 \@CIT@department\par\addvspace{0.25em}\par
149 \includegraphics[height=6.5em]{epsfiles/citlogo}\par\addvspace{0.25em}\par
150 \Cit\\Pasadena, California\par\addvspace{0.75em}\par\@CIT@degreeyear\par
151 \addvspace{0.75em}\par(Thesis defended \@CIT@thesisdate)
152 \end{titlepage}\pagenumbering{roman}\setcounter{page}{2}
153 \if@twoside\newpage\null\fi}
154 \def\copyrightpage{\PackageWarning{citthesis}{No copyright page with
155 techreport option}}
156 \else
157 \def\maketitle{\begin{titlepage}
158 \large\addvspace{5em}{\def\baselinestretch{1.2}%
159 \Large\bfseries\mathversion{bold}\@title\par}%
160 \par\addvspace{1.5em}Thesis by\\\@author\par%
161 \ifx\@CIT@advisor\@empty\addvspace{14em}\else%
162 Superadvisor\\\@CIT@advisor\par\addvspace{12em}\fi\par\normalsize%
163 In Partial Fulfillment of the Requirements\\for the \@CIT@degreeword\ of\\%

164 \@CIT@degree\par\addvspace{0.25em}\par\includegraphics[height=6.5em]{epsfiles/citlogo}%
165 \par\addvspace{0.25em}\par\Cit\\Pasadena, California\par\addvspace{1.5em}%
166 \par\@CIT@degreeyear\par\addvspace{1.5em}\par(Defended \@CIT@thesisdate)\vss%
167 \end{titlepage}\pagenumbering{roman}\setcounter{page}{2}%
168 \if@twoside\newpage\null\fi}
169 \def\copyrightpage{\newpage\hspace{0.1in}\vspace{7in}
170 \begin{center}\copyright\hspace{1em}\@CIT@degreeyear\par
171 \@author\par All rights Reserved\end{center}\if@twoside\newpage\null\fi}
172 \fi

Abstract and acknowledgements.

173

174 \newenvironment{abstract}
175 {\section*{Abstract}\if@CIT@singlespace\def\baselinestretch{1}\else%
176 \def\baselinestretch{1.5}\fi\@normalsize}{\par}
177 \if@CIT@abstract
178 \if@CIT@techreport
179 \newenvironment{abstractpage}{\newpage\if@twoside{\ifodd\arabic{page}
180 \else\hbox{}\newpage\fi}\fi\if@CIT@singlespace%
181 \def\baselinestretch{1}\else\def\baselinestretch{1.5}\fi
182 \par\begin{abstract}}
183 {\end{abstract}\noindent\newpage}
184 \else
185 \newenvironment{abstractpage}{\newpage\if@twoside{\ifodd\arabic{page}
186 \else\hbox{}\newpage\fi}\fi\begin{center}{%
187 \large{\bfseries\mathversion{bold} \@title}\\
188 by \\ \@author \\[\baselineskip]}\par\if@CIT@singlespace%
189 \def\baselinestretch{1}\else\def\baselinestretch{1.5}\fi\@normalsize
190 In Partial Fulfillment of the\\Requirements for the \@CIT@degreeword\ of\\
191 \@CIT@degree\end{center}\par\begin{abstract}}
192 {\end{abstract}\noindent\newpage}
193 \fi
194 \else
195 \PackageWarning{citthesis}{No abstract being built.}
196 \excludecomment{abstractpage}
197 \fi
198 \if@CIT@acknowledgements
199 \newenvironment{acknowledgementspage}{\section*{Acknowledgements}}{\par}
200 \else
201 \PackageWarning{citthesis}{No acknowledgements being built.}
202 \excludecomment{acknowledgementspage}
203 \fi

Parts and chapters.

204

205 \newcommand\starttext{\cleardoublepage\pagenumbering{arabic}
206 \setcounter{page}{1}}
207 \newcommand\Cit{California Institute of Technology}

208

209 \renewcommand\section{\@startsection {section}{1}{\z@}%
210  {-3.5ex \@plus -1ex \@minus -.2ex}%

211  {2.3ex \@plus.2ex}%
212  {\normalfont\Large\bfseries\mathversion{bold}}}
213 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
214  {-3.25ex\@plus -1ex \@minus -.2ex}%
215  {1.5ex \@plus .2ex}%
216  {\normalfont\large\bfseries\mathversion{bold}}}
217 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
218  {-3.25ex\@plus -1ex \@minus -.2ex}%
219  {1.5ex \@plus .2ex}%
220  {\normalfont\normalsize\bfseries\mathversion{bold}}}
221 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
222  {3.25ex \@plus1ex \@minus.2ex}%
223  {-1em}%
224  {\normalfont\normalsize\bfseries\mathversion{bold}}}
225 \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
226  {3.25ex \@plus1ex \@minus .2ex}%
227  {-1em}%
228  {\normalfont\normalsize\bfseries\mathversion{bold}}}

229

230 \renewcommand\part{\cleardoublepage\if@CIT@techreport\thispagestyle{chapstart}%
231 \else\thispagestyle{plain}\fi\@tempswafalse\hbox{}\vfil\secdef\@part\@spart}
232 \@addtoreset{chapter}{part}
233 \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
234 \if@CIT@techreport\thispagestyle{chapstart}\else%
235 \thispagestyle{plain}\fi%
236 \global\@topnum\z@
237 \@afterindentfalse
238 \secdef\@chapter\@schapter}
239 \def\@chapter[#1]#2{\@CIT@chapnumtrue\ifnum \c@secnumdepth >\m@ne
240 \if@mainmatter
241  \refstepcounter{chapter}%
242  \typeout{\@chapapp\space\thechapter}%
243  \addcontentsline{toc}{chapter}%
244  {\protect\numberline{\thechapter}#1}%
245 \else
246  \addcontentsline{toc}{chapter}{#1}\fi
247 \else
248  \addcontentsline{toc}{chapter}{#1}
249 \fi
250 \chaptermark{#1}%
251 \addtocontents{lof}{\protect\addvspace{10\p@}}%
252 \addtocontents{lot}{\protect\addvspace{10\p@}}%
253 \@makechapterhead{#2}%
254 \@afterheading}
255 \def\@makechapterhead#1{%
256 \vspace*{50\p@}%
257 {\parindent \z@ \raggedright \normalfont
258  \ifnum \c@secnumdepth >\m@ne
259  \if@mainmatter
260  \LARGE\bfseries\mathversion{bold} \@chapapp{} \thechapter

261  \par
262  \vskip 20\p@
263  \fi
264  \fi
265  \LARGE \bfseries\mathversion{bold} #1\par
266  \nobreak
267  \vskip 40\p@

268 }}

269 \def\@schapter#1{\@CIT@chapnumfalse\@makeschapterhead{#1}\@afterheading}
270 \def\@makeschapterhead#1{%
271 \vspace*{50\p@}%
272 {\parindent \z@ \raggedright
273  \normalfont
274  \LARGE \bfseries\mathversion{bold}  #1\par
275  \nobreak
276  \vskip 40\p@

277 }}

Contents of all sorts.

278

279 \renewcommand\tableofcontents{%
280  \chapter*{\contentsname
281  \@mkboth{}{}}%
282  \@starttoc{toc}%

283 }

284 \renewcommand\listoffigures{%
285  \chapter*{\listfigurename
286  \@mkboth{}{}}%
287  \@starttoc{lof}%

288 }

289 \renewcommand\listoftables{%
290  \chapter*{\listtablename
291  \@mkboth{}{}}%
292  \@starttoc{lot}%

293 }

Bibliography and indexing. This is where we use multicol for the index.

294

295 \renewcommand\bibname{Bibliography}
296 \renewenvironment{thebibliography}[1]
297  {\chapter*{\bibname
298  \@mkboth{}{}}%
299  \list{\@biblabel{\arabic{enumiv}}}%
300  {\settowidth\labelwidth{\@biblabel{#1}}%
301  \leftmargin\labelwidth
302  \advance\leftmargin\labelsep
303  \@openbib@code
304  \usecounter{enumiv}%
305  \let\p@enumiv\@empty
306  \renewcommand\theenumiv{\arabic{enumiv}}}%
307  \sloppy\clubpenalty4000\widowpenalty4000%

308  \sfcode`\.=\@m}
309  {\def\@noitemerr
310  {\@latex@warning{Empty `thebibliography' environment}}%
311  \endlist}
312 \let\@openbib@code\empty
313 \renewcommand\newblock{}
314 \let\indexheader\@empty
315 \newcommand\@indexheader{\ifx\indexheader\@empty{\relax}\else
316 {\par\noindent\indexheader}\fi}
317 \renewenvironment{theindex}
318  {\cleardoublepage \columnseprule \z@ \columnsep 35\p@
319 \begin{multicols}{3}[\@makeschapterhead{\indexname}
320 \@indexheader]
321  \if@CIT@techreport\markboth{\indexname}{\indexname}\else%
322 \markboth{}{}\fi%
323  \if@CIT@techreport\thispagestyle{chapstart}\else%
324 \thispagestyle{plain}\fi \parindent\z@
325  \parskip\z@ \@plus .3\p@\relax
326  \let\item\@idxitem\small\raggedright}
327 {\end{multicols}}
328 \renewcommand\@idxitem  {\par\hangindent 25\p@}
329 \renewcommand\subitem   {\par\hangindent 25\p@ \hspace*{15\p@}}
330 \renewcommand\subsubitem{\par\hangindent 25\p@ \hspace*{20\p@}}
331 \renewcommand\indexspace{\par \vskip 15\p@ \@plus5\p@ \@minus3\p@\relax}

332

Spacing and related commands.

333

334 \if@CIT@techreport\def\baselinestretch{1}\else
335 \if@CIT@singlespace\def\baselinestretch{1}\else\def\baselinestretch{1.5}\fi\fi

336

337 \def\setstretch#1{\renewcommand{\baselinestretch}{#1}}

338

339 \newenvironment{singlespace}{\trivlist\item[]\def\baselinestretch{1}%
340 \normalfont\vskip0.5\baselineskip}{\endtrivlist}

341

342 \def\spacing#1{\par\begingroup\def\baselinestretch{#1}%
343 \ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}

344

345 \def\endspacing{\par\vskip\parskip\vskip\baselineskip\endgroup%
346 \vskip-\parskip\vskip-\baselineskip}

347

348 \def\onehalfspace{\spacing{1.25}}
349 \let\endonehalfspace=\endspacing

350

351 \def\doublespace{\spacing{2}}
352 \let\doublespace=\endspacing

353

354 \everydisplay{%
355 \abovedisplayskip\baselinestretch\abovedisplayskip%

356 \belowdisplayskip\abovedisplayskip%
357 \abovedisplayshortskip\baselinestretch\abovedisplayshortskip%
358 \belowdisplayshortskip\baselinestretch\belowdisplayshortskip}

359

360 \raggedbottom

361

362 ⟨/citthesis⟩

5.2 citendfloat.sty

First the options and related commands.

363 ⟨∗citendfloat⟩

364

365 \newif\if@CIT@figlist\global\@CIT@figlistfalse
366 \newcommand\@CIT@figlist{\global\@CIT@figlisttrue
367 \PackageWarning{citendfloat}{Making figure list}}
368 \newcommand\@CIT@nofiglist{\global\@CIT@figlistfalse
369 \PackageWarning{citendfloat}{Not making figure list}}

370

371 \newif\if@CIT@displayfigs\global\@CIT@displayfigsfalse
372 \newcommand\@CIT@displayfigs{\global\@CIT@displayfigstrue
373 \PackageWarning{citendfloat}{Displaying figures at end of document}}
374 \newcommand\@CIT@nodisplayfigs{\global\@CIT@displayfigsfalse
375 \PackageWarning{citendfloat}{Not displaying figures at end of document}}

376

377 \newif\if@CIT@write\global\@CIT@writefalse
378 \newcommand\@CIT@write{\global\@CIT@writetrue
379 \PackageWarning{citendfloat}{Writing new figures to \jobname.figs}}
380 \newcommand\@CIT@nowrite{\global\@writefalse
381 \PackageWarning{citendfloat}{Not writing new figures}}

382

383 \newif\if@CIT@figparts\global\@CIT@figpartsfalse
384 \newcommand\@CIT@figparts{\global\@CIT@figpartstrue
385 \PackageWarning{citendfloat}{Putting figures at the end of each part}}
386 \newcommand\@CIT@nofigparts{\global\@CIT@figpartsfalse
387 \PackageWarning{citendfloat}{Displaying all figures together}}

388

389 \DeclareOption{display}{\@CIT@displayfigs}
390 \DeclareOption{nodisplay}{\@CIT@nodisplayfigs}
391 \DeclareOption{figlist}{\@CIT@figlist}
392 \DeclareOption{nofiglist}{\@CIT@nofiglist}
393 \DeclareOption{write}{\@CIT@write}
394 \DeclareOption{nowrite}{\@CIT@nowrite}
395 \DeclareOption{figparts}{\@CIT@figparts}
396 \DeclareOption{nofigparts}{\@CIT@nofigparts}
397 \ExecuteOptions{write,display}
398 \ProcessOptions

\chapter needs to be changed to write some junk to the .lof file. Same for

 \appendix.

400 \newcount\@CIT@startchapter\@CIT@startchapter\z@

401

402 \let\@CIT@existchapter\@chapter
403 \def\@chapter[#1]#2{\@CIT@existchapter[#1]{#2}%
404 \@CIT@optwrite{\string\refstepcounter{chapter}}%
405 \@CIT@optwrite{\string\addtocontents{lof}{\string\protect%
406  \string\addvspace{10pt}}}}
407 \let\@CIT@existappendix\appendix
408 \def\appendix{\@CIT@existappendix%
409 \@CIT@optwrite{\string\setcounter{chapter}{0}}%
410 \@CIT@optwrite{\string\def\string\thechapter{\string\Alph{chapter}}}}

Here’s the internal file handling macros. \@CIT@postfigs gets assigned to the file \jobname.figs and to this file are written the L^{A}TEX commands for the figures. These then get read in at the end of the document. Because figparts may be set, we have to tap dance with that for awhile too. Tedious.

411

412 \newwrite\@CIT@postfigs
413 \newif\if@CIT@postfigsopen\global\@CIT@postfigsopenfalse
414 \newif\iffigsout\global\figsoutfalse
415 \if@CIT@figparts
416 \newcommand\@CIT@openpostfigs{%
417 \global\@CIT@postfigsopentrue%
418 \@tempcnta\c@part\advance\@tempcnta by\@ne
419 \immediate\openout\@CIT@postfigs=\jobname.figs\@arabic{\@tempcnta}\relax
420 \message{Writing \jobname.figs\@arabic{\@tempcnta}}%
421 \@CIT@optwrite{\string\iffigsout}%
422 \@CIT@optwrite{\string\addcontentsline{toc}{chapterstar}%
423  {\string\protect\string\numberline{}{Figures}}}%
424 \@CIT@optwrite{\string\addcontentsline{lof}{figpart}{Figures for Part \@Roman{\the\@tempcnta}}}
425 \@CIT@optwrite{\string\fi}%
426 \@CIT@optwrite{\string\setcounter{chapter}{0}}%
427 \@CIT@optwrite{\string\def\string\thechapter{\string\arabic{chapter}}}}

This is the lof string for a new part.

428

429 \newcommand\l@figpart[2]{%
430 \ifnum \c@tocdepth >\m@ne
431  \addpenalty{-\@highpenalty}%
432  \vskip 1.0em \@plus\p@
433  \setlength\@tempdima{\z@}%
434  \begingroup
435  \parindent \z@ \rightskip \@pnumwidth
436  \parfillskip -\@pnumwidth
437  \leavevmode \bfseries\mathversion{bold}
438  \advance\leftskip\@tempdima
439  \hskip -\leftskip
440  #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hfil}\par
441  \penalty\@highpenalty

442  \endgroup
443 \fi}
444 \else

445

446 \newcommand\@CIT@openpostfigs{%
447 \immediate\openout\@CIT@postfigs=\jobname.figs\relax%
448 \message{Writing \jobname.figs}%
449 \@CIT@optwrite{\string\addcontentsline{toc}{chapterstar}%
450  {\string\protect\string\numberline{}{Figures}}}%
451 \@CIT@optwrite{\string\setcounter{chapter}{0}}%
452 \@CIT@optwrite{\string\def\string\thechapter{\string\arabic{chapter}}}}
453 \fi

Contents line for special chapters with no numbers.

454

455 \newcommand\l@chapterstar[2]{%
456 \ifnum \c@tocdepth >\m@ne
457  \addpenalty{-\@highpenalty}%
458  \vskip 1.0em \@plus\p@
459  \setlength\@tempdima{\z@}%
460  \begingroup
461  \parindent \z@ \rightskip \@pnumwidth
462  \parfillskip -\@pnumwidth
463  \leavevmode \bfseries\mathversion{bold}
464  \advance\leftskip\@tempdima
465  \hskip -\leftskip
466  #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
467  \penalty\@highpenalty
468  \endgroup
469 \fi}

Make figures appear after each part.

470

471 \if@CIT@figparts
472 \let\@CIT@existpart\part
473 \def\part{\if@CIT@postfigsopen\middleprocessfigures\@CIT@openpostfigs%
474 \else\@CIT@openpostfigs\fi\global\figsoutfalse\@CIT@existpart}
475 \let\@CIT@exist@part\@part
476 \def\@part[#1]#2{\@CIT@exist@part[#1]{#2}}
477 \fi

Here’s the new definition of the figure environment. It opens the .figs file if it’s not already open, and writes the figure commands to it. The hard part here is that the lines haves to be scanned for \end{figure} so it stops writing.

478

479 \newcommand\@CIT@intfigure{%
480  \global\figsouttrue
481  \@CIT@optwrite{\string\begin{figure}}%
482  \def\@currenvir{figure}%
483  \begingroup%
484  \let\do\makeinnocent \dospecials%

485  \makeinnocent\^^L% and whatever other special cases
486  \endlinechar`\^^M \catcode`\^^M=12 \xfigure}%
487 {\catcode`\^^M=12 \endlinechar=-1 %
488 \gdef\xfigure#1^^M{\def\test{#1}%
489  \ifx\test\endfiguretest%
490  \def\next{\endgroup\end{figure}%
491  \@CIT@optwrite{\string\end{figure}}%
492  \@CIT@optwrite{\string\clearpage}%
493  \@CIT@optwrite{ }}%
494  \else\ifx\test\enddblfiguretest%
495  \def\next{\endgroup\end{figure}%
496  \@CIT@optwrite{\string\end{figure}}%
497  \@CIT@optwrite{\string\clearpage}%
498  \@CIT@optwrite{ }}%
499  % skip over float position specifier (fps)
500  \else\@ifnextchar[%
501  \@whilesw \ifx\test\CB \fi%
502  \@gobble%
503  \else%
504  \@CIT@optwrite{#1}%
505  \let\next\xfigure%
506  \fi \fi \next}%

507 }%

508

509 \let\@CIT@bfig\figure
510 \let\@CIT@efig\endfigure
511 \let\figure\@CIT@intfigure
512 \let\endfigure\relax

513

514 \newcommand\@CIT@optwrite[1]{\if@CIT@write\immediate\write\@CIT@postfigs{#1}%
515 \else\relax\fi}

516

517 {\escapechar=-1%
518 \xdef\CB{]}%
519 \xdef\endfiguretest{\string\\end\string\{figure\string\}}%
520 \xdef\enddblfiguretest{\string\\end\string\{figure*\string\}}%

521 }%

522

523 \@namedef{figure*}{\figure}

\@makeemptyfigs is used when we reach the end of the file and we have chosen not to display the figures. It simply undefines all the possible figure commands which come from floatlib (it doesn’t matter if you are not using floatlib). Also in this chunk of the code are the commands to which the floatlib figure commands get assigned. These are all given the value \relax.

524

525 \newcommand\@CIT@makeemptyfigs{\global\let\@makecaption\@CIT@empty@makecaption
526 \global\let\cfigure\@CIT@emptycfigure%
527 \global\let\ctwofigure\@CIT@emptyctwofigure
528 \global\let\@@dblcaption\@CIT@empty@@dblcaption\global\let\clearpage\relax}

530 \let\@CIT@clearpage\clearpage

531

532 \newcommand\@CIT@empty@makecaption[2]{\relax}

533

534 \def\@CIT@empty@@dblcaption#1[#2]#3{\relax}

535

536 \newcommand\@CIT@emptycfigure{\@ifnextchar[{\@CIT@@emptycfigure}
537 {\@CIT@@emptycfigure[d]}}
538 \def\@CIT@@emptycfigure[#1]#2{\relax}

539

540 \newcommand\@CIT@emptyctwofigure{\@ifstar{\@CIT@@emptyctwofigure}
541 {\@CIT@@emptyctwofigure}}
542 \newcommand\@CIT@@emptyctwofigure{\@ifnextchar[{\@CIT@@@emptyctwofigure}
543 {\@CIT@@@emptyctwofigure[d]}}
544 \def\@CIT@@@emptyctwofigure[#1]#2#3{\relax}

Two commands for processing figures, one for in the middle of the thesis (if using figparts), and the other for at the end.

545

546 \newcommand\middleprocessfigures{
547 \immediate\closeout\@CIT@postfigs
548 \let\figure\@CIT@bfig
549 \let\endfigure\@CIT@efig
550 \iffigsout\clearpage\fi
551 \if@CIT@displayfigs\else\@CIT@makeemptyfigs\fi
552 \if@CIT@figparts\ifnum\c@part=0\else
553 \@input{\jobname.figs\arabic{part}}\fi\else
554 \@input{\jobname.figs}\fi\let\clearpage\@CIT@clearpage
555 \let\figure\@CIT@intfigure\let\endfigure\relax}

556

557 \newcommand\finalprocessfigures{
558 \immediate\closeout\@CIT@postfigs
559 \let\figure\@CIT@bfig
560 \let\endfigure\@CIT@efig
561 \clearpage
562 \if@CIT@figlist
563  {\normalsize\listoffigures}
564  \clearpage
565 \fi
566 \if@CIT@displayfigs\else\@CIT@makeemptyfigs\fi
567 \if@CIT@figparts\ifnum\c@part=0\else
568 \@input{\jobname.figs\arabic{part}}\fi\else
569 \@input{\jobname.figs}\fi\let\clearpage\@CIT@clearpage}

What to do when the document is ended.

570

571 \AtEndDocument{\finalprocessfigures}

572

573 \if@CIT@figparts
574 \global\@CIT@postfigsopentrue%

575 \immediate\openout\@CIT@postfigs=\jobname.figs\@arabic{\c@part}\relax
576 \message{Writing \jobname.figs\@arabic{\c@part}}%
577 \else
578 \@CIT@openpostfigs
579 \fi

580 ⟨/citendfloat⟩

5.3 citmakesdx.sty

581 ⟨∗citmakesdx⟩

Load makesdx and then modify it for use with citthesis.

582

583 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{makesdx}}
584 \ProcessOptions
585 \RequirePackage{makesdx}
 \@ADL@@listofsymbols is modified for use with citthesis.

586

587 \renewcommand\@ADL@@listofsymbols{\@restonecolfalse
588 \if@twocolumn\@restonecoltrue
589 \onecolumn\fi\chapter*{\listsymbolname\@mkboth
590 {}{}}\@input{\jobname.los}\if@restonecol
591 \twocolumn\fi}

592

593 ⟨/citmakesdx⟩