2 % This is a version of tocloft that I've modified to eliminated the hardcoded
3 % \par after the table of contents title. My modifications are
4 % are commented with my name.
5 % - Ben Crowell, 2002 Jan 1
8 %% This is file `tocloft.sty',
9 %% generated with the docstrip utility.
11 %% The original source files were:
13 %% tocloft.dtx (with options: `usc')
15 %% Copyright 1998, 1999 Peter R. Wilson
17 %% This program is provided under the terms of the
18 %% LaTeX Project Public License distributed from CTAN
19 %% archives in directory macros/latex/base/lppl.txt.
21 %% Author: Peter Wilson (CUA and NIST)
22 %% now at: peter.r.wilson@boeing.com
24 \NeedsTeXFormat{LaTeX2e
}
25 \ProvidesPackage{tocloft
}[1999/
09/
19 v1.0 parameterised ToC, etc., typesetting
]
26 \RequirePackage{stdclsdv
}
27 \providecommand{\PRWPackageNote}[2]{%
29 (
#1)\@spaces\@spaces\@spaces\@spaces
34 \providecommand{\PRWPackageNoteNoLine}[2]{%
35 \PRWPackageNote{#1}{#2\@gobble
}%
38 \PackageWarning{tocloft
}%
39 {I don't recognize any sectional divisions so I'll do nothing
}
40 \renewcommand{\SCDquit}{\endinput}
44 \PackageWarning{tocloft
}%
45 {I don't recognize the class but I'll do my best
}
47 \PackageWarning{tocloft
}%
48 {I don't recognize any sectional divisions so I'll do nothing
}
49 \renewcommand{\SCDquit}{\endinput}
52 \PRWPackageNoteNoLine{tocloft
}{The
document class has chapter divisions
}
55 \PRWPackageNoteNoLine{tocloft
}{The
document class has section divisions
}
57 \PackageWarning{tocloft
}%
58 {The class has neither chapters nor sections, so I'll do nothing
}
59 \renewcommand{\SCDquit}{\endinput}
65 \newif\if@cfttocbibind
67 \@ifpackageloaded
{tocbibind
}{\@cfttocbibindtrue
}{\@cfttocbibindfalse
}
69 \@ifpackagelater
{tocbibind
}{1998/
11/
16}{}{%
70 \PackageWarning{tocloft
}{%
71 You are using a version of the tocbibind package
\MessageBreak
72 that is not compatible with tocloft.
\MessageBreak
73 The results may be surprising.
\MessageBreak
74 Consider installing the current version of tocbibind.
}}
77 \newif\if@cftnctoc\@cftnctocfalse
78 \DeclareOption{titles
}{\@cftnctoctrue
}
80 \newcommand{\cftmarktoc}{%
81 \@mkboth
{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
82 \newcommand{\cftmarklof}{%
83 \@mkboth
{\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
84 \newcommand{\cftmarklot}{%
85 \@mkboth
{\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
86 \newcommand{\@cfttocstart
}{%
89 \@restonecoltrue
\onecolumn
94 \newcommand{\@cfttocfinish
}{%
96 \if@restonecol
\twocolumn\fi
98 \newcommand{\@cftdobibtoc
}{%
101 \addcontentsline{toc
}{chapter
}{\contentsname}
103 \addcontentsline{toc
}{\@tocextra
}{\contentsname}
108 \renewcommand{\tableofcontents}{%
110 %whoopsie%\par% B. Crowell, 2002 Jan 1
112 \parindent\z@
\parskip\z@
122 \newcommand{\@cftmaketoctitle
}{%
123 \vspace*
{\cftbeforetoctitleskip}
125 {\cfttoctitlefont\contentsname}{\cftaftertoctitle}
128 \vskip \cftaftertoctitleskip
130 \newlength{\cftbeforetoctitleskip}
131 \newlength{\cftaftertoctitleskip}
133 \setlength{\cftbeforetoctitleskip}{50pt
}
134 \setlength{\cftaftertoctitleskip}{40pt
}
136 \setlength{\cftbeforetoctitleskip}{3.5ex \@plus
1ex \@minus
.2ex
}
137 \setlength{\cftaftertoctitleskip}{2.3ex \@plus
.2ex
}
140 \newcommand{\cfttoctitlefont}{\normalfont\Huge\bfseries}
142 \newcommand{\cfttoctitlefont}{\normalfont\Large\bfseries}
144 \newcommand{\cftaftertoctitle}{}
145 \newcommand{\cftsetpnumwidth}[1]{\renewcommand{\@pnumwidth
}{#1}}
146 \newcommand{\cftsetrmarg}[1]{\renewcommand{\@tocrmarg
}{#1}}
147 \newcommand{\cftdot}{.
}
148 \newcommand{\@cftdotfill
}[1]{%
149 \leaders\hbox{$
\m@th
\mkern #1 mu
\hbox{\cftdot}\mkern #1 mu$
}\hfill}
150 \newcommand{\cftdotsep}{4.5}
151 \newcommand{\cftnodots}{10000}
152 \newcommand{\cftparfillskip}{\parfillskip=
0pt plus1fil
}
153 \renewcommand{\numberline}[1]{%
154 \hb@xt@\@tempdima
{#1\@cftasnum
\hfil}\@cftasnumb
}
155 \newcommand{\@cftasnum
}{}
156 \newcommand{\@cftasnumb
}{}
159 \renewcommand*
{\l@part
}[2]{%
161 \ifnum \c@
tocdepth >-
2\relax
165 \ifnum \c@
tocdepth >
\m@ne
173 \addpenalty{-\@highpenalty
}%
175 \addpenalty\@secpenalty
177 \addvspace{\cftbeforepartskip}%
178 \@tempdima
\cftpartnumwidth\relax
179 \let\@cftasnum
\cftpartaftersnum
180 \let\@cftasnumb
\cftpartaftersnumb
182 \parindent \z@
\rightskip \@pnumwidth
183 \parfillskip -\@pnumwidth
185 {\cftpartfont #1}{\cftpartleader}
186 {\hb@xt@\@pnumwidth
{\hss {\cftpartpagefont #2}}}\cftpartafterpnum}\par
190 \everypar{\global\@nobreakfalse
\everypar{}}%
194 \everypar{\global\@nobreakfalse
\everypar{}}%
200 \newlength{\cftbeforepartskip}
201 \setlength{\cftbeforepartskip}{2.25em \@plus
\p@
}
202 \newlength{\cftpartnumwidth}
203 \setlength{\cftpartnumwidth}{3em
}
204 \newcommand{\cftpartfont}{\large\bfseries}
205 \newcommand{\cftpartaftersnum}{}
206 \newcommand{\cftpartaftersnumb}{}
207 \newcommand{\cftpartleader}{\large\bfseries\@cftdotfill
{\cftpartdotsep}}
208 \newcommand{\cftpartdotsep}{\cftnodots}
209 \newcommand{\cftpartpagefont}{\large\bfseries}
210 \newcommand{\cftpartafterpnum}{}
212 \renewcommand*
{\l@chapter
}[2]{%
213 \ifnum \c@
tocdepth >
\m@ne
214 \addpenalty{-\@highpenalty
}%
215 \vskip \cftbeforechapskip
216 {\leftskip \cftchapindent\relax
217 \rightskip \@tocrmarg
218 \parfillskip -
\rightskip
219 \parindent \cftchapindent\relax\@afterindenttrue
222 \@tempdima
\cftchapnumwidth\relax
223 \let\@cftasnum
\cftchapaftersnum
224 \let\@cftasnumb
\cftchapaftersnumb
225 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
226 {\cftchapfont #1}\nobreak
229 \hb@xt@\@pnumwidth
{\hfil\cftchappagefont #2}\cftchapafterpnum\par}%
232 \newlength{\cftbeforechapskip}
233 \setlength{\cftbeforechapskip}{1.0em \@plus
\p@
}
234 \newlength{\cftchapindent}
235 \setlength{\cftchapindent}{0em
}
236 \newlength{\cftchapnumwidth}
237 \setlength{\cftchapnumwidth}{1.5em
}
238 \newcommand{\cftchapfont}{\bfseries}
239 \newcommand{\cftchapaftersnum}{}
240 \newcommand{\cftchapaftersnumb}{}
241 \newcommand{\cftchapleader}{\bfseries\@cftdotfill
{\cftchapdotsep}}
242 \newcommand{\cftchapdotsep}{\cftnodots}
243 \newcommand{\cftchappagefont}{\bfseries}
244 \newcommand{\cftchapafterpnum}{}
245 \renewcommand*
{\l@section
}[2]{%
246 \ifnum \c@
tocdepth >
\z@
248 \vskip \cftbeforesecskip
250 \addpenalty\@secpenalty
251 \addvspace{\cftbeforesecskip}
253 {\leftskip \cftsecindent\relax
254 \rightskip \@tocrmarg
255 \parfillskip -
\rightskip
256 \parindent \cftsecindent\relax\@afterindenttrue
259 \@tempdima
\cftsecnumwidth\relax
260 \let\@cftasnum
\cftsecaftersnum
261 \let\@cftasnumb
\cftsecaftersnumb
262 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
263 {\cftsecfont #1}\nobreak
266 \hb@xt@\@pnumwidth
{\hfil\cftsecpagefont #2}\cftsecafterpnum\par}%
268 \newlength{\cftbeforesecskip}
270 \setlength{\cftbeforesecskip}{\z@ \@plus
.2\p@
}
272 \setlength{\cftbeforesecskip}{1.0em \@plus
\p@
}
274 \newlength{\cftsecindent}
276 \setlength{\cftsecindent}{1.5em
}
278 \setlength{\cftsecindent}{0em
}
280 \newlength{\cftsecnumwidth}
282 \setlength{\cftsecnumwidth}{2.3em
}
284 \setlength{\cftsecnumwidth}{1.5em
}
287 \newcommand{\cftsecfont}{\normalfont}
289 \newcommand{\cftsecfont}{\bfseries}
291 \newcommand{\cftsecaftersnum}{}
292 \newcommand{\cftsecaftersnumb}{}
294 \newcommand{\cftsecleader}{\normalfont\@cftdotfill
{\cftsecdotsep}}
296 \newcommand{\cftsecleader}{\bfseries\@cftdotfill
{\cftsecdotsep}}
299 \newcommand{\cftsecdotsep}{\cftdotsep}
301 \newcommand{\cftsecdotsep}{\cftnodots}
304 \newcommand{\cftsecpagefont}{\normalfont}
306 \newcommand{\cftsecpagefont}{\bfseries}
308 \newcommand{\cftsecafterpnum}{}
309 \renewcommand*
{\l@subsection
}[2]{%
310 \ifnum \c@
tocdepth >\@ne
311 \vskip \cftbeforesubsecskip
312 {\leftskip \cftsubsecindent\relax
313 \rightskip \@tocrmarg
314 \parfillskip -
\rightskip
315 \parindent \cftsubsecindent\relax\@afterindenttrue
318 \@tempdima
\cftsubsecnumwidth\relax
319 \let\@cftasnum
\cftsubsecaftersnum
320 \let\@cftasnumb
\cftsubsecaftersnumb
321 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
322 {\cftsubsecfont #1}\nobreak
325 \hb@xt@\@pnumwidth
{\hfil\cftsubsecpagefont #2}\cftsubsecafterpnum\par}%
327 \newlength{\cftbeforesubsecskip}
328 \setlength{\cftbeforesubsecskip}{\z@ \@plus
.2\p@
}
329 \newlength{\cftsubsecindent}
331 \setlength{\cftsubsecindent}{3.8em
}
333 \setlength{\cftsubsecindent}{1.5em
}
335 \newlength{\cftsubsecnumwidth}
337 \setlength{\cftsubsecnumwidth}{3.2em
}
339 \setlength{\cftsubsecnumwidth}{2.3em
}
341 \newcommand{\cftsubsecfont}{\normalfont}
342 \newcommand{\cftsubsecaftersnum}{}
343 \newcommand{\cftsubsecaftersnumb}{}
344 \newcommand{\cftsubsecleader}{\normalfont\@cftdotfill
{\cftsubsecdotsep}}
345 \newcommand{\cftsubsecdotsep}{\cftdotsep}
346 \newcommand{\cftsubsecpagefont}{\normalfont}
347 \newcommand{\cftsubsecafterpnum}{}
348 \renewcommand*
{\l@subsubsection
}[2]{%
349 \ifnum \c@
tocdepth >
\tw@
350 \vskip \cftbeforesubsubsecskip
351 {\leftskip \cftsubsubsecindent\relax
352 \rightskip \@tocrmarg
353 \parfillskip -
\rightskip
354 \parindent \cftsubsubsecindent\relax\@afterindenttrue
357 \@tempdima
\cftsubsubsecnumwidth\relax
358 \let\@cftasnum
\cftsubsubsecaftersnum
359 \let\@cftasnumb
\cftsubsubsecaftersnumb
360 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
361 {\cftsubsubsecfont #1}\nobreak
362 {\cftsubsubsecleader}
364 \hb@xt@\@pnumwidth
{\hfil\cftsubsubsecpagefont #2}\cftsubsubsecafterpnum\par}%
366 \newlength{\cftbeforesubsubsecskip}
367 \setlength{\cftbeforesubsubsecskip}{\z@ \@plus
.2\p@
}
368 \newlength{\cftsubsubsecindent}
370 \setlength{\cftsubsubsecindent}{7.0em
}
372 \setlength{\cftsubsubsecindent}{3.8em
}
374 \newlength{\cftsubsubsecnumwidth}
376 \setlength{\cftsubsubsecnumwidth}{4.1em
}
378 \setlength{\cftsubsubsecnumwidth}{3.2em
}
380 \newcommand{\cftsubsubsecfont}{\normalfont}
381 \newcommand{\cftsubsubsecaftersnum}{}
382 \newcommand{\cftsubsubsecaftersnumb}{}
383 \newcommand{\cftsubsubsecleader}{\normalfont\@cftdotfill
{\cftsubsubsecdotsep}}
384 \newcommand{\cftsubsubsecdotsep}{\cftdotsep}
385 \newcommand{\cftsubsubsecpagefont}{\normalfont}
386 \newcommand{\cftsubsubsecafterpnum}{}
387 \renewcommand*
{\l@paragraph
}[2]{%
388 \ifnum \c@
tocdepth >
3\relax
389 \vskip \cftbeforeparaskip
390 {\leftskip \cftparaindent\relax
391 \rightskip \@tocrmarg
392 \parfillskip -
\rightskip
393 \parindent \cftparaindent\relax\@afterindenttrue
396 \@tempdima
\cftparanumwidth\relax
397 \let\@cftasnum
\cftparaaftersnum
398 \let\@cftasnumb
\cftparaaftersnumb
399 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
400 {\cftparafont #1}\nobreak
403 \hb@xt@\@pnumwidth
{\hfil\cftparapagefont #2}\cftparaafterpnum\par}%
405 \newlength{\cftbeforeparaskip}
406 \setlength{\cftbeforeparaskip}{\z@ \@plus
.2\p@
}
407 \newlength{\cftparaindent}
409 \setlength{\cftparaindent}{10em
}
411 \setlength{\cftparaindent}{7.0em
}
413 \newlength{\cftparanumwidth}
415 \setlength{\cftparanumwidth}{5em
}
417 \setlength{\cftparanumwidth}{4.1em
}
419 \newcommand{\cftparafont}{\normalfont}
420 \newcommand{\cftparaaftersnum}{}
421 \newcommand{\cftparaaftersnumb}{}
422 \newcommand{\cftparaleader}{\normalfont\@cftdotfill
{\cftparadotsep}}
423 \newcommand{\cftparadotsep}{\cftdotsep}
424 \newcommand{\cftparapagefont}{\normalfont}
425 \newcommand{\cftparaafterpnum}{}
426 \renewcommand*
{\l@subparagraph
}[2]{%
427 \ifnum \c@
tocdepth >
4\relax
428 \vskip \cftbeforesubparaskip
429 {\leftskip \cftsubparaindent\relax
430 \rightskip \@tocrmarg
431 \parfillskip -
\rightskip
432 \parindent \cftsubparaindent\relax\@afterindenttrue
435 \@tempdima
\cftsubparanumwidth\relax
436 \let\@cftasnum
\cftsubparaaftersnum
437 \let\@cftasnumb
\cftsubparaaftersnumb
438 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
439 {\cftsubparafont #1}\nobreak
442 \hb@xt@\@pnumwidth
{\hfil\cftsubparapagefont #2}\cftsubparaafterpnum\par}%
444 \newlength{\cftbeforesubparaskip}
445 \setlength{\cftbeforesubparaskip}{\z@ \@plus
.2\p@
}
446 \newlength{\cftsubparaindent}
448 \setlength{\cftsubparaindent}{12em
}
450 \setlength{\cftsubparaindent}{10em
}
452 \newlength{\cftsubparanumwidth}
454 \setlength{\cftsubparanumwidth}{6em
}
456 \setlength{\cftsubparanumwidth}{5em
}
458 \newcommand{\cftsubparafont}{\normalfont}
459 \newcommand{\cftsubparaaftersnum}{}
460 \newcommand{\cftsubparaaftersnumb}{}
461 \newcommand{\cftsubparaleader}{\normalfont\@cftdotfill
{\cftsubparadotsep}}
462 \newcommand{\cftsubparadotsep}{\cftdotsep}
463 \newcommand{\cftsubparapagefont}{\normalfont}
464 \newcommand{\cftsubparaafterpnum}{}
465 \newcommand{\@cftdobiblof
}{%
468 \addcontentsline{toc
}{chapter
}{\listfigurename}
470 \addcontentsline{toc
}{\@tocextra
}{\listfigurename}
475 \renewcommand{\listoffigures}{%
479 \parindent\z@
\parskip\z@
489 \newcommand{\@cftmakeloftitle
}{%
490 \vspace*
{\cftbeforeloftitleskip}
492 {\cftloftitlefont\listfigurename}{\cftafterloftitle}
495 \vskip \cftafterloftitleskip
497 \newlength{\cftbeforeloftitleskip}
498 \newlength{\cftafterloftitleskip}
500 \setlength{\cftbeforeloftitleskip}{50pt
}
501 \setlength{\cftafterloftitleskip}{40pt
}
503 \setlength{\cftbeforeloftitleskip}{3.5ex \@plus
1ex \@minus
.2ex
}
504 \setlength{\cftafterloftitleskip}{2.3ex \@plus
.2ex
}
507 \newcommand{\cftloftitlefont}{\normalfont\Huge\bfseries}
509 \newcommand{\cftloftitlefont}{\normalfont\Large\bfseries}
511 \newcommand{\cftafterloftitle}{}
512 \renewcommand*
{\l@figure
}[2]{%
513 \vskip \cftbeforefigskip
514 {\leftskip \cftfigindent\relax
515 \rightskip \@tocrmarg
516 \parfillskip -
\rightskip
517 \parindent \cftfigindent\relax\@afterindenttrue
520 \@tempdima
\cftfignumwidth\relax
521 \let\@cftasnum
\cftfigaftersnum
522 \let\@cftasnumb
\cftfigaftersnumb
523 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
524 {\cftfigfont #1}\nobreak
527 \hb@xt@\@pnumwidth
{\hfil\cftfigpagefont #2}\cftfigafterpnum\par}%
529 \newlength{\cftbeforefigskip}
530 \setlength{\cftbeforefigskip}{\z@ \@plus
.2\p@
}
531 \newlength{\cftfigindent}
532 \setlength{\cftfigindent}{1.5em
}
533 \newlength{\cftfignumwidth}
534 \setlength{\cftfignumwidth}{2.3em
}
535 \newcommand{\cftfigfont}{\normalfont}
536 \newcommand{\cftfigaftersnum}{}
537 \newcommand{\cftfigaftersnumb}{}
538 \newcommand{\cftfigleader}{\normalfont\@cftdotfill
{\cftfigdotsep}}
539 \newcommand{\cftfigdotsep}{\cftdotsep}
540 \newcommand{\cftfigpagefont}{\normalfont}
541 \newcommand{\cftfigafterpnum}{}
542 \newcommand{\@cftdobiblot
}{%
545 \addcontentsline{toc
}{chapter
}{\listtablename}
547 \addcontentsline{toc
}{\@tocextra
}{\listtablename}
552 \renewcommand{\listoftables}{%
556 \parindent\z@
\parskip\z@
566 \newcommand{\@cftmakelottitle
}{%
567 \vspace*
{\cftbeforelottitleskip}
569 {\cftlottitlefont\listtablename}{\cftafterlottitle}
572 \vskip \cftafterlottitleskip
574 \newlength{\cftbeforelottitleskip}
575 \newlength{\cftafterlottitleskip}
577 \setlength{\cftbeforelottitleskip}{50pt
}
578 \setlength{\cftafterlottitleskip}{40pt
}
580 \setlength{\cftbeforelottitleskip}{3.5ex \@plus
1ex \@minus
.2ex
}
581 \setlength{\cftafterlottitleskip}{2.3ex \@plus
.2ex
}
584 \newcommand{\cftlottitlefont}{\normalfont\Huge\bfseries}
586 \newcommand{\cftlottitlefont}{\normalfont\Large\bfseries}
588 \newcommand{\cftafterlottitle}{}
589 \renewcommand*
{\l@table
}[2]{%
590 \vskip \cftbeforetabskip
591 {\leftskip \cfttabindent\relax
592 \rightskip \@tocrmarg
593 \parfillskip -
\rightskip
594 \parindent \cfttabindent\relax\@afterindenttrue
597 \@tempdima
\cfttabnumwidth\relax
598 \let\@cftasnum
\cfttabaftersnum
599 \let\@cftasnumb
\cfttabaftersnumb
600 \advance\leftskip \@tempdima
\null\nobreak\hskip -
\leftskip
601 {\cfttabfont #1}\nobreak
604 \hb@xt@\@pnumwidth
{\hfil\cfttabpagefont #2}\cfttabafterpnum\par}%
606 \newlength{\cftbeforetabskip}
607 \setlength{\cftbeforetabskip}{\z@ \@plus
.2\p@
}
608 \newlength{\cfttabindent}
609 \setlength{\cfttabindent}{1.5em
}
610 \newlength{\cfttabnumwidth}
611 \setlength{\cfttabnumwidth}{2.3em
}
612 \newcommand{\cfttabfont}{\normalfont}
613 \newcommand{\cfttabaftersnum}{}
614 \newcommand{\cfttabaftersnumb}{}
615 \newcommand{\cfttableader}{\normalfont\@cftdotfill
{\cfttabdotsep}}
616 \newcommand{\cfttabdotsep}{\cftdotsep}
617 \newcommand{\cfttabpagefont}{\normalfont}
618 \newcommand{\cfttabafterpnum}{}
619 \newcommand{\cftchapterprecis}[1]{%
620 \cftchapterprecishere{#1}
621 \cftchapterprecistoc{#1}}
622 \newcommand{\cftchapterprecishere}[1]{%
623 \vspace*
{-
2\baselineskip}
624 \begin{quote
}\textit{#1}\end{quote
}}
625 \newcommand{\cftchapterprecistoc}[1]{\addtocontents{toc
}{%
626 {\leftskip \cftchapindent\relax
627 \advance\leftskip \cftchapnumwidth\relax
628 \rightskip \@tocrmarg
\relax
629 \textit{#1}\protect\par}}}
630 \newcommand{\cftlocalchange}[3]{%
631 \addtocontents{#1}{\protect\cftsetpnumwidth{#2} \protect\cftsetrmarg{#3}}}
632 \newcommand{\cftaddtitleline}[4]{%
633 \addtocontents{#1}{\protect\contentsline{#2}{#3}{#4}}}
634 \newcommand{\cftaddnumtitleline}[5]{%
636 {\protect\contentsline{#2}{\protect\numberline{#3}{\protect\ignorespaces #4}}{#5}}}
639 %% End of file `tocloft.sty'.