-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtocloft.dtx
3839 lines (3803 loc) · 135 KB
/
tocloft.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%
% tocloft.dtx
% Author: Peter Wilson, Herries Press
% Maintainer: Will Robertson (will dot robertson at latex-project dot org)
% Copyright 1998-2003 Peter R. Wilson
% Copyright 2009-2017 Will Robertson
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. <http://www.latex-project.org/lppl.txt>
%
% This work has the LPPL maintenance status "maintained".
% The Current Maintainer of this work is Will Robertson.
%
% This work consists of the files listed in the README file.
%
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{hypdoc}
\EnableCrossrefs
\CodelineIndex
\setcounter{StandardModuleDepth}{1}
\begin{document}
\DocInput{tocloft.dtx}
\end{document}
%</driver>
%
%<*usc>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tocloft}[2017/08/31 v2.3i parameterised ToC, etc., typesetting]
%</usc>
%
% \fi
%
% \changes{v0.1}{1998/12/31}{First public (alpha) release}
% \changes{v0.1a}{1999/01/15}{Improved documentation}
% \changes{v0.2}{1999/01/17}{Uses the stdclsdv package}
% \changes{v0.2a}{1999/01/17}{Interfaced with the tocbibind package}
% \changes{v0.2b}{1999/03/07}{Corrected failure when used with float package}
% \changes{v0.2c}{1999/06/30}{Added raggedright example}
% \changes{v0.3}{1999/08/22}{Added option to prevent ToC head change}
% \changes{v1.0}{1999/09/19}{Added PackageNote reporting}
% \changes{v1.1}{2000/02/11}{Added cftXpresnum commands}
% \changes{v1.1}{2000/02/11}{Added support for subfigure package}
% \changes{v1.1a}{2000/02/11}{Changed X to Z in section 2.2}
% \changes{v2.0}{2001/03/03}{Added command for new list of...}
% \changes{v2.0}{2001/03/03}{Removed requirement for stdclsdv package}
% \changes{v2.0}{2001/03/15}{Removed requirement for hyperref option}
% \changes{v2.1}{2001/04/08}{Added control over parskip in ToC etc.}
% \changes{v2.2}{2001/04/17}{Another fix for hyperref}
% \changes{v2.3}{2002/06/15}{Made to work with the koma classes}
% \changes{v2.3a}{2002/10/03}{Partial fix for Part changes}
% \changes{v2.3b}{2003/01/20}{More fixes for Part changes}
% \changes{v2.3c}{2003/09/26}{More fixes for hyperref}
% \changes{v2.3d}{2009/09/04}{New maintainer and tiny bug fix}
% \changes{v2.3e}{2010/10/13}{Remove a message from the console output}
%
% \def\dtxfile{\texttt{tocloft.dtx}}
% \def\fileversion{v1.1a} \def\filedate{2000/02/11}
% \def\fileversion{v2.0} \def\filedate{2001/03/15}
% \def\fileversion{v2.1} \def\filedate{2001/04/08}
% \def\fileversion{v2.2} \def\filedate{2001/04/17}
% \def\fileversion{v2.3} \def\filedate{2002/06/15}
% \def\fileversion{v2.3a} \def\filedate{2002/10/03}
% \def\fileversion{v2.3b} \def\filedate{2003/01/20}
% \def\fileversion{v2.3c} \def\filedate{2003/09/26}
% \def\fileversion{v2.3d} \def\filedate{2009/09/04}
% \def\fileversion{v2.3e} \def\filedate{2010/10/13}
% \def\fileversion{v2.3f} \def\filedate{2013/05/02}
% \def\fileversion{v2.3g} \def\filedate{2014/06/14}
% \def\fileversion{v2.3h} \def\filedate{2017/08/29}
% \def\fileversion{v2.3i} \def\filedate{2017/08/31}
%
% \CheckSum{2302}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
% \DoNotIndex{\@centercr,\@cite}
% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
% \DoNotIndex{\@input,\@ixpt,\@m}
% \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
% \DoNotIndex{\advance,\Alph,\alph}
% \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
% \DoNotIndex{\bullet}
% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
% \DoNotIndex{\fbox}
% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
% \DoNotIndex{\input}
% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
% \DoNotIndex{\NeedsTeXFormat,\newdimen}
% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
% \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
% \DoNotIndex{\wd,\xiipt,\year,\z@}
%
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
% \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
% \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
% \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
% \providecommand{\bs}{\textbackslash}
%
% \title{The \Lpack{tocloft} package\thanks{This
% file (\dtxfile) has version number \fileversion, last revised
% \filedate.}}
%
% \author{
% Author: Peter Wilson, Herries Press \\
% Maintainer: Will Robertson \\
% \texttt{will dot robertson at latex-project dot org}
% }
% \date{\filedate}
% \maketitle
% \begin{abstract}
% The \Lpack{tocloft} package provides means of controlling the
% typographic design of the Table of Contents, List of Figures and List of
% Tables. New kinds of `List of \ldots' can be defined.
%
% The package has been tested with the
% \Lpack{tocbibind},
% \Lpack{minitoc},
% \Lpack{ccaption},
% \Lpack{subfigure},
% \Lpack{float},
% \Lpack{fncychap}, and
% \Lpack{hyperref}
% packages.
% \end{abstract}
% \tableofcontents
% \makeatletter \renewcommand{\@dotsep}{9.0} \makeatother
% \listoffigures
% \listoftables
% \StopEventually{}
%
%
%
% \section{Introduction}
%
% In the standard classes the typographic design of the Table of Contents
% (ToC), the List of Figures (LoF) and List of Tables (LoT) is fixed or,
% more precisely, it is buried within the class definitions.
% The \Lpack{tocloft} package provides handles for an author to
% change the design to meet the needs of the particular document.
%
% Elements of the package were developed as part of a class
% and package bundle for typesetting ISO standards~\cite{PRW96i}.
% This manual is typeset according to the conventions of the
% \LaTeX{} \textsc{docstrip} utility which enables the automatic
% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
%
% Section~\ref{sec:usc} describes the usage of the package.
% Commented source code for the package is in Section~\ref{sec:code}.
%
% The package has been tested in combination with at least
% the \Lpack{tocbibind} package~\cite{TOCBIBIND},
% the \Lpack{minitoc} package~\cite{MINITOC},
% the \Lpack{ccaption} package~\cite{CCAPTION},
% the \Lpack{subfigure} package~\cite{SUBFIGURE} (versions 2.0 and 2.1),
% the \Lpack{algorithm} package~\cite{ALGORITHM} (which, in turn, calls the
% \Lpack{float} package~\cite{FLOAT}) and the \Lpack{fncychap} package~\cite{FNCYCHAP}.
% It also works with the \Lpack{hyperref} package.
% Please send me any comments as to how you think
% that the package can be improved, or of any interesting examples of
% how you have used
% it.\footnote{Thanks to Rowland (\texttt{rebecca@astrid.u-net.com}),
% John Foster (\texttt{john@isjf.demon.co.uk}),
% Kasper (\texttt{kbg@dkik.dk}),
% Lee Nave (\texttt{nave@math.washington.edu}),
% and Andrew Thurber (\texttt{athurber@emba.uvm.edu})
% for their suggestions.}
%
% \subsection{\LaTeX 's methods}
%
% This is a general description of how \LaTeX{} does the processing
% for a Table of Contents. As the processing for List of Figures and
% List of Tables is similar I will, without loss of generality, just
% discuss the ToC.
%
% \DescribeMacro{\addcontentsline}
% \LaTeX{} generates a \file{.toc} file if the document contains a
% |\tableofcontents| command. The sectioning
% commands\footnote{For figures and tables it is the \texttt{\bs caption} command
% that populates the \file{.lof} and \file{.lot} files.}
% put entries into the \file{.toc} file by calling the \LaTeX{}
% |\addcontentsline{|\meta{file}|}{|\meta{kind}|}{|\meta{title}|}|
% command, where \meta{file} is the file extension (e.g., |toc|),
% \meta{kind} is the kind of entry (e.g., |section| or |subsection|),
% and \meta{title} is the (numberered) title text. In the cases where
% there is a number, the \meta{title} argument is given in the
% form |{\numberline{number} title-text}|.
%
% NOTE: The \Lpack{hyperref} package dislikes authors using
% |\addcontentsline|. To get it to work properly with \Lpack{hyperref}
% you normally have to put |\phantomsection| (a macro defined within
% the \Lpack{hyperref} package) immediately
% before |\addcontentsline|.
%
% \DescribeMacro{\contentsline}
% The |\addcontentsline| command writes an entry to the given file
% in the form |\contentsline{|\meta{kind}|}{|\meta{title}|}{|\meta{page}|}|
% where \meta{page} is the page number.
% For each \meta{kind}, \LaTeX{} provides a command
% |\l@kind{|\meta{title}|}{|\meta{page}|}| which performs the actual
% typesetting of the |\contentsline| entry.
%
% \newcommand{\maxx}{120} ^^A picture width
% \newcommand{\maxxm}{118} ^^A \maxx - 2\
% \newcommand{\maxy}{55} ^^A picture height
% \newcommand{\maxym}{53} ^^A \maxy - 2
% \newcommand{\findent}{20} ^^A indent
% \newcommand{\findentp}{22} ^^A \findent + 2
% \newcommand{\fnumwidth}{10} ^^A numwidth
% \newcommand{\ftocrmarg}{30} ^^A \@tocrmarg
% \newcommand{\fpnumwidth}{20} ^^A \@pnumwidth
% \newcommand{\fipn}{30} ^^A \findent + \fnumwidth
% \newcommand{\frmarg}{90} ^^A \maxx - \ftocrmarg
% \newcommand{\frnum}{100} ^^A \maxx - \fpnumwidth
% \newcommand{\fyi}{10} ^^A 1st y height
% \newcommand{\fyim}{8} ^^A \fyi - 2
% \newcommand{\fyii}{20} ^^A 2nd y height
% \newcommand{\fyiii}{25} ^^A 3rd y height
% \newcommand{\fyiv}{30} ^^A 4th y height
% \newcommand{\fyv}{40} ^^A 5th y height
% \newcommand{\fyvp}{42} ^^A \fyv + 2
% \newcommand{\flin}{4} ^^A length of leader lines
% \newcommand{\frmargm}{89} ^^A \frmarg (90) - a little bit
%
% \providecommand{\bs}{\textbackslash}
% \begin{figure}
% \centering
% \setlength{\unitlength}{1mm}
% \begin{picture}(\maxx,\maxy)
% ^^A side lines and linewidth
% \put(0,0){\line(0,1){\maxy}}
% \put(\maxx,0){\line(0,1){\maxy}}
% \put(0,\maxy){\vector(1,0){\maxx}}
% \put(2,\maxym){\makebox(0,0)[tl]{\texttt{\bs linewidth}}}
% ^^A \@pnumwidth
% \put(\maxx,\fyi){\vector(-1,0){\fpnumwidth}}
% \put(\maxxm,\fyim){\makebox(0,0)[tr]{\texttt{\bs @pnumwidth}}}
% \put(\frnum,\fyi){\line(0,1){\flin}}
% ^^A \@tocrmarg
% \put(\maxx,\fyv){\vector(-1,0){\ftocrmarg}}
% \put(\maxxm,\fyvp){\makebox(0,0)[br]{\texttt{\bs @tocrmarg}}}
% \put(\frmarg,\fyv){\line(0,-1){\flin}}
% ^^A indent
% \put(0,\fyv){\vector(1,0){\findent}}
% \put(2,\fyvp){\makebox(0,0)[bl]{\textit{indent}}}
% \put(\findent,\fyv){\line(0,-1){\flin}}
% ^^A numwidth
% \put(\findent,\fyv){\vector(1,0){\fnumwidth}}
% \put(\findentp,\fyvp){\makebox(0,0)[bl]{\textit{numwidth}}}
% \put(\fipn,\fyv){\line(0,-1){\flin}}
% ^^A last title line
% \put(\maxx,\fyii){\makebox(0,0)[br]{487}}
% \put(\fipn,\fyii){title end}
% ^^A second title line
% \put(\fipn,\fyiii){continue\ldots}
% \put(\frmarg,\fyiii){\makebox(0,0)[br]{\ldots title}}
% ^^A first title line
% \put(\findent,\fyiv){\textbf{3.5}}
% \put(\fipn,\fyiv){Heading\ldots}
% \put(\frmarg,\fyiv){\makebox(0,0)[br]{\ldots title}}
% ^^A dotted leader
% \multiput(\frmargm,\fyii)(-\flin,0){12}{.}
% \multiput(\frmarg,\fyi)(-\flin,0){2}{\line(0,1){\flin}}
% \put(\frmarg,\fyi){\vector(-1,0){\flin}}
% \put(\frmarg,\fyi){\vector(1,0){0}}
% \put(\frmarg,\fyim){\makebox(0,0)[tr]{\texttt{\bs @dotsep}}}
%
% \end{picture}
% \setlength{\unitlength}{1pt}
% \caption{Layout of a ToC (LoF, LoT) entry} \label{fig:ltoc}
% \end{figure}
%
%
% \DescribeMacro{\@pnumwidth}
% \DescribeMacro{\@tocrmarg}
% \DescribeMacro{\@dotsep}
% The general layout of a
% typeset entry is illustrated in Figure~\ref{fig:ltoc}. There are three
% internal \LaTeX{} commands that are used in the typesetting. The page
% number is typeset flushright in a box of width |\@pnumwidth|, and the box
% is at the righthand margin. If the page number is too long to fit into
% the box it will stick out into the righthand margin. The title text
% is indented from the righthand margin by an amount given by |\@tocrmarg|.
% Note that |\@tocrmarg| should be greater than |\@pnumwidth|. Some
% entries are typeset with a dotted leader between the end of the title
% title text and the righthand margin indentation. The distance, in
% \emph{math units}\footnote{There are 18mu to 1em.} between the dots
% in the leader is given by the value of |\@dotsep|. In the standard
% classes the same values are used for the ToC, LoF and the LoT.
%
% The standard values for these internal commands are:
% \begin{itemize}
% \item |\@pnumwidth| = 1.55em
% \item |\@tocrmarg| = 2.55em
% \item |\@dotsep| = 4.5
% \end{itemize}
% The values can be changed by using |\renewcommand|, in spite of the
% fact that the first two appear to be lengths.
%
% Dotted leaders are not available for Part and Chapter ToC entries
% (nor for Section entries in the \Lpack{article} class and its derivatives).
%
% \DescribeMacro{\numberline}
% Each |\l@kind| macro is responsible for setting the general
% \textit{indent} from the lefthand margin, and the \textit{numwidth}.
% The |\numberline{|\meta{number}|}| macro is responsible for typesetting
% the number flushleft in a box of width
% \textit{numwidth}. If the number is too long for the box then it will
% protrude into the title text. The title text is indented by
% (\textit{indent + numwidth}) from the lefthand margin. That is, the title
% text is typeset in a block of width \\
% (|\linewidth| - \textit{indent} - \textit{numwidth} - |\@tocrmarg|).
%
% \begin{table}
% \centering
% \caption[Indents and Numwidths]{Indents and Numwidths (in ems)} \label{tab:indents}
% \begin{tabular}{lcrrrr} \hline
% Entry & Level & \multicolumn{2}{c}{Chaptered} & \multicolumn{2}{c}{Otherwise} \\
% & & indent & numwidth & indent & numwidth \\ \hline
% part & -1 & 0 & --- & 0 & --- \\
% chapter & 0 & 0 & 1.5 & & \\
% section & 1 & 1.5 & 2.3 & 0 & 1.5 \\
% subsection & 2 & 3.8 & 3.2 & 1.5 & 2.3 \\
% subsubsection & 3 & 7.0 & 4.1 & 3.8 & 3.2 \\
% paragraph & 4 & 10.0 & 5.0 & 7.0 & 4.1 \\
% subparagraph & 5 & 12.0 & 6.0 & 10.0 & 5.0 \\
% figure/table & (1) & 1.5 & 2.3 & 1.5 & 2.3 \\ \hline
% \end{tabular}
% \end{table}
%
% Table~\ref{tab:indents} lists the standard values for the \textit{indent}
% and \textit{numwidth}. There is no explicit \textit{numwidth} for a
% part; instead a gap of 1em is put between the number and the title text.
% Note that for a sectioning command the values
% depend on whether or not the document class provides the |\chapter|
% command. Also, which somewhat surprises me, the table and figure entries
% are all indented.
%
% \DescribeMacro{\@dottedtocline}
% Most of the |\l@kind| commands are defined in terms of the
% |\@dottedtocline| command. This command takes three arguments: \\
% |\@dottedtocline{|\meta{seclevel}|}{|\meta{indent}|}{|\meta{numwidth}|}|. \\
% For example, one definition of the |\l@section| command is: \\
% |\newcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.3em}}| \\
% If it is necessary to change the default typesetting of the entries,
% then it is usually necessary to change these definitions (but the
% \Lpack{tocloft} package gives you handles to easily alter things without
% having to know the \LaTeX{} internals).
%
% You can use the |\addcontentsline| command to add |\contentsline|
% commands to a file.
%
% \DescribeMacro{\addtocontents}
% \LaTeX{} also provides the |\addtocontents{|\meta{file}|}{|\meta{text}|}|
% command that will insert \meta{text} into \meta{file}. You can use
% this for adding extra text and/or macros into the file, for processing
% when the file is typeset by |\tableofcontents| (or whatever other
% command is used for \meta{file} processing, such as |\listoftables|
% for a \file{.lot} file).
%
% As |\addcontentsline| and |\addtocontents| write their arguments to a
% file, any fragile commands used in their arguments must be |\protect|ed.
%
% You can make certain adjustments to the ToC etc., layout without
% using any package. Some examples are:
% \begin{itemize}
% \item If your page numbers stick out into the righthand margin
% \begin{verbatim}
% \renewcommand{\@pnumwidth}{3em} \renewcommand{\@tocrmarg}{4em}
% \end{verbatim}
% but using lengths appropriate to your document.
%
% \item To have the (sectional) titles in the ToC, etc., typeset ragged right with no
% hyphenation
% \begin{verbatim}
% \renewcommand{\@tocrmarg}{2.55em plus1fil}
% \end{verbatim}
% where the value |2.55em| can be changed for whatever margin space you want.
%
% \item The dots in the leaders can be eliminated by increasing |\@dotsep|
% to a large value:
% \begin{verbatim}
% \renewcommand{\@dotsep}{10000}
% \end{verbatim}
%
% \item To have dotted leaders in your ToC and LoF but not in your LoT:
% \begin{verbatim}
% ...
% \tableofcontents
% \makeatletter \renewcommand{\@dotsep}{10000} \makeatother
% \listoftables
% \makeatletter \renewcommand{\@dotsep}{4.5} \makeatother
% \listoffigures
% ...
% \end{verbatim}
% For this document I used this method to double the dot spacing for
% the LoF with respect to that for the ToC. As you can see, it is much
% better that all dot leaders have the same spacing.
%
% \item To add a horizontal line across the whole width of the ToC below
% an entry for a Part:
% \begin{verbatim}
% \part{Part title}
% \addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par}
% \end{verbatim}
% Note that as both |\addtocontents| and |\addcontentsline| write their
% arguments to a file, it means that any \emph{fragile} commands in
% their arguments must be protected
% by preceding each fragile command with |\protect|.
% The result of the example above
% would be the following two lines in the \file{.toc} file (assuming that it
% is the second Part and is on page 34):
% \begin{verbatim}
% \contentsline {part}{II\hspace {1em}Part title}{34}
% \mbox {}\hrulefill \par
% \end{verbatim}
% If the |\protect|s were not used, then the second line would instead be:
% \begin{small}
% \begin{verbatim}
% \unhbox \voidb@x \hbox {}\unhbox \voidb@x \leaders \hrule \hfill \kern \z@ \par
% \end{verbatim}
% \end{small}
%
% \item You may get undesired page breaks in the ToC. For example you
% may have a long multiline section title and in the ToC there is a page
% break between the lines. After your document is stable you can use
% |\addtocontents| at appropriate places in the body of the document
% to adjust the page breaking in the ToC. As examples:
% \begin{itemize}
% \item |\addtocontents{toc}{\protect\newpage}| to force a page break.
% \item |\addtocontents{toc}{\protect\enlargethispage{2\baselineskip}}| to
% make the page longer.
% \item |\addtocontents{toc}{\protect\needspace{2\baselineskip}}| to specify
% that if there is not a vertical space of two baselines left on
% the page then start a new page (the |\needspace| macro is defined
% in the \Lpack{needspace} package).
% \end{itemize}
%
% \end{itemize}
% Remember, if you are modifying any command that includes an |@| sign then this
% must be done in either a \file{.sty} file or if in the document itself
% it must be
% surrounded by |\makeatletter| and |\makeatother|. For example, if you
% want to modify |\@dotsep| in the preamble to your document you have
% to do it like this:
% \begin{verbatim}
% \makeatletter
% \renewcommand{\@dotsep}{9.0}
% \makeatother
% \end{verbatim}
%
%
% \section{The \Lpack{tocloft} package} \label{sec:usc}
%
% The \Lpack{tocloft} package provides means of specifying the
% typography of the Table of Contents (ToC), the List of Figures (LoF)
% and the List of Tables (LoT).
%
% \DescribeMacro{\tableofcontents}
% \DescribeMacro{\listoffigures}
% \DescribeMacro{\listoftables}
% The ToC, LoF, and LoT are printed at the point in the document where
% these commands are called, as per normal \LaTeX. However, there is
% one difference between the standard \LaTeX{} behaviour and the behaviour
% with the \Lpack{tocloft} package. In the standard \LaTeX{} classes
% that have |\chapter| headings, the ToC, LoF and LoT each appear on
% a new page. With the \Lpack{tocloft} package they do not necessarily
% start new pages; if you want them to be on new pages you may have to
% specifically issue an appropriate command beforehand. For example:
% \begin{verbatim}
% ...
% \clearpage
% \tableofcontents
% \clearpage
% \listoftables
% ...
% \end{verbatim}
%
% \DescribeMacro{\tocloftpagestyle}
% The |\thispagestyle| page style of the ToC, LoF and/or LoT is set
% by the command
% |\tocloftpagestyle{|\meta{style}|}|, where \meta{style} is one of
% the available page styles. The package initially
% sets |\tocloftpagestyle{plain}|.
%
% \subsection{Package options}
%
% The package takes the following options:
% \begin{itemize}
% \item[\Lopt{subfigure}] This option is required if, and only if,
% the \Lpack{tocloft} and
% \Lpack{subfigure} packages are being used together. The two packages
% can be specified in any order.
%
% \item[\Lopt{titles}]
% The \Lopt{titles} option causes
% the titles of the ToC, LoF, and LoT lists to be typeset using the
% default \LaTeX{} methods. This can be useful, for example, when the
% \Lpack{tocloft} and \Lpack{fncychap} packages are used together and
% the `fancy' chapter styles should be used for the ToC, etc., titles.
%
% \end{itemize}
%
% If you use the \Lopt{titles} option you can ignore the next
% section and continue reading at section~\ref{sec:entries}.
%
% \subsection{Changing the titles} \label{sec:titles}
%
% Commands are provided for controlling the appearance of the
% titles. Following \LaTeX{} custom, the title texts are the values
% of the |\contentsname|, |\listfigurename| and |\listtablename| commands.
%
% Similar sets of commands are provided for ToC, LoF and LoT title
% typsetting control. For convenience (certainly mine, and hopefully yours)
% in the following
% descriptions I will use |Z| to stand for `toc' or `lof' or `lot'. For
% example, |\cftmarkZ| stands for |\cftmarktoc| or |\cftmarklof| or
% |\cftmarklot|.
%
% \DescribeMacro{\cftmarkZ}
% These macros set the appearance of the running heads on the ToC, LoF, and
% LoT pages. You probably don't need to change these.
%
% \DescribeMacro{\cftbeforeZtitleskip}
% \DescribeMacro{\cftafterZtitleskip}
% These lengths control the vertical spacing before and after the titles.
% You can change them from their default values by using |\setlength|.
%
% \DescribeMacro{\cftZtitlefont}
% \DescribeMacro{\cftafterZtitle}
% The code used for typesetting the ToC title looks like
% \begin{verbatim}
% {\cfttoctitlefont \contentsname}{\cftaftertoctitle}\par
% \end{verbatim}
% By default, |\cftZtitlefont| is defined as a font specification
% (e.g., |\Large\bfseries|), and |\cftafterZtitle| is empty.
% These commands can be changed (via |\renewcommand|) to change
% the typesetting. As examples:
% \begin{itemize}
% \item |\renewcommand{\cftZtitlefont}{\hfill\Large\itshape}| will
% result in a Large italic title typeset flushright.
% \item |\renewcommand{\cftZtitlefont}{\hfill\Large\bfseries}| together
% with |\renewcommand{\cftafterZtitle}{\hfill}| will give
% a centered Large bold title.
% \item Doing
% \begin{verbatim}
% \renewcommand{\cftafterZtitle}{%
% \\[\baselineskip]\mbox{}\hfill{\normalfont Page}}
% \end{verbatim}
% will put the word `Page' flushright on the line following the title.
% (If you do this, then you may need to decrease
% |\cftafterZtitleskip|).
% \item |\renewcommand{\cftafterZtitle}{\thispagestyle{empty}}| will
% make the page with the title empty (i.e., the page
% number will not be printed).
% \end{itemize}
%
%
% \subsection{Typesetting the entries} \label{sec:entries}
%
% Commands are also provided to enable finer control over the typesetting
% of the different kinds of entries. The parameters defining the default
% layout of the entries are illustrated as part of the \Lpack{layouts}
% package or in~\cite[page 34]{GOOSSENS94}, and are repeated in
% Figure~\ref{fig:ltoc}.
%
% \DescribeMacro{\cftdot}
% In the default ToC typesetting only the more minor entries have dotted
% leader lines between the sectioning title and the page number. The
% \Lpack{tocloft} package provides for general leaders for all entries.
% The `dot' in a leader is given by the value of |\cftdot|. Its default
% definition is |\newcommand{\cftdot}{.}| which gives the default
% dotted leader. By changing |\cftdot| you can use symbols other than
% a period in the leader. For example
% \begin{verbatim}
% \renewcommand{\cftdot}{\ensuremath{\ast}}
% \end{verbatim}
% will result in a dotted leader using asterisks as the symbol.
%
% \DescribeMacro{\cftdotsep}
% \DescribeMacro{\cftnodots}
% Each kind of entry can control the separation between the dots
% in its leader (see below). For consistency though, all dotted leaders
% should use the same spacing. The macro |\cftdotsep| specifies the
% default spacing. Its value is a number.
% However, if the separation is too large
% then no dots will be actually typeset. The macro |\cftnodots| is
% a separation value that is `too large'.
%
% \DescribeMacro{\cftsetpnumwidth}
% \DescribeMacro{\cftsetrmarg}
% The page numbers are typeset in a fixed width box. The command
% |\cftsetpnumwidth{|\meta{length}|}| can be used to change the width
% of the box (\LaTeX 's internal |\@pnumwidth|).
% The title texts will end before reaching the righthand margin.
% |\cftsetrmarg{|\meta{length}|}| can be used to set this distance
% (\LaTeX 's internal |\@tocrmarg|).
% Note that the length used in |\cftsetrmarg| should be greater
% than the length set in |\cftsetpnumwidth|. These values should remain
% constant in any given document.
%
% \DescribeMacro{\cftpnumalign}
% The page numbers are typeset in a box as described above.
% By default they are right-aligned which is suitable when the page numbers are aligned vertically on the page so their digits line up.
% For a design with fixed width between a ToC entry and its page number, say, a left alignment may be more suitable.
% This can be controlled by setting the \cs{cftpnumalign} macro to \verb|l|, \verb|c|, or \verb|r| (just like \cs{makebox}):
% \begin{verbatim}
% \renewcommand{\cftpnumalign}{l}
% \end{verbatim}
%
% \DescribeMacro{\cftparskip}
% Normally the |\parskip| in the ToC, etc., is zero. This may be changed
% by changing the |\cftparskip| length. Note that the current value
% of |\cftparskip| is used for the ToC, LoF and LoT, but you can change
% the value before calling |\tableofcontents| or |\listoffigures| or
% |\listoftables| if one or other of these should have different values
% (which is not a good idea).
%
%
% In the following I will use |X| to stand for the following:
% \begin{itemize}
% \item |part| for |\part| titles
% \item |chap| for |\chapter| titles
% \item |sec| for |\section| titles
% \item |subsec| for |\subsection| titles
% \item |subsubsec| for |\subsubsection| titles
% \item |para| for |\paragraph| titles
% \item |subpara| for |\subparagraph| titles
% \item |fig| for figure |\caption| titles
% \item |subfig| for subfigure |\caption| titles
% \item |tab| for table |\caption| titles
% \item |subtab| for subtable |\caption| titles
% \end{itemize}
%
% \DescribeMacro{\cftbeforeXskip}
% This controls the vertical space before an entry. It can be changed
% by using |\setlength|.
%
% \DescribeMacro{\cftXindent}
% This controls the indentation of an entry from the left margin
% (\textit{indent} in Figure~\ref{fig:ltoc}). It
% can be changed using |\setlength|.
%
% \DescribeMacro{\cftXnumwidth}
% This controls the space allowed for typesetting title numbers
% (\textit{numwidth} in Figure~\ref{fig:ltoc}). It can
% be changed using |\setlength|. Second and subsequent lines of a multiline
% title will be indented by this amount.
%
% The remaining commands are related to the specifics of typesetting
% an entry.
% This is a simplified pseudo-code version for the typesetting of numbered
% and unnumbered entries.
% \begin{verbatim}
% {\cftXfont {\cftXpresnum SNUM\cftXaftersnum\hfil} \cftXaftersnumb TITLE}%
% {\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par
%
% {\cftXfont TITLE}{\cftXleader}{\cftXpagefont PAGE}\cftXafterpnum\par
% \end{verbatim}
% where |SNUM| is the section number, |TITLE| is the title text and |PAGE|
% is the page number. In the numbered entry the pseudo-code \\
% |{\cftXpresnum SNUM\cftaftersnum\hfil}| \\
% is typeset within a box of width |\cftXnumwidth|.
%
% \DescribeMacro{\cftXfont}
% This controls the appearance of the title (and its preceding number,
% if any). It may be changed using |\renewcommand|.
%
% \DescribeMacro{\cftXpresnum}
% \DescribeMacro{\cftXaftersnum}
% \DescribeMacro{\cftXaftersnumb}
% \changes{v1.1}{2000/02/11}{Added description of \cs{cftXpresnum}}
% Normally the section number is typeset within a box of width |\cftXnumwidth|.
% Within the box the macro |\cftXpresnum| is first called, then the
% number is typeset, and next the |\cftXaftersnum|
% macro is called after the number is typeset. The last command
% within the box is |\hfil| to make the box contents flushleft.
% After the box is
% typeset the |\cftXaftersnumb| macro is called before typesetting
% the title text. All three of these can be changed by |\renewcommand|.
% By default they are defined to do nothing.
%
% In the standard classes the ToC entry for a |\part| is just typeset as
% the number and title, followed by the page number, with the
% |\cftpartpresnum|
% macro being called before typesetting the number and title.
% Due to \LaTeX\ ideosyncracies, |\cftpartpresnum| may become doubled in the output
% if a third-party package behaves differently to that of the default internal \LaTeX\ commands.
% The |tocloft| package contains specific code to prevent this in the case of
% the KomaScript classes and for the |titlesec| package; please contact the maintainer
% to add further corrections if you discover other packages which also exhibit this mis-behaviour.
%
% When a standard class is used the |\cftpartaftersnum| and
% |\cftpartaftersnumb| macros have no effect, but they may do something
% if a non-standard class is used.
%
%
% \DescribeMacro{\cftXleader}
% \DescribeMacro{\cftXdotsep}
% |\cftXleader| defines the leader between the title and the page number;
% it can be changed by |\renewcommand|.
% The spacing between any dots in the leader is controlled by |\cftXdotsep|
% (|\@dotsep| in Figure~\ref{fig:ltoc}).
% It can be changed by |\renewcommand| and its value must be either a
% number (e.g., 6.6 or |\cftdotsep|) or |\cftnodots| (to disable the dots).
% The spacing
% is in terms of \emph{math units} where there are 18mu to 1em.
%
% \DescribeMacro{\cftXpagefont}
% This defines the font to be used for typesetting the page number. It
% can be changed by |\renewcommand|.
%
% \DescribeMacro{\cftXafterpnum}
% This macro is called after the page number has been typeset. Its default
% is to do nothing. It can be changed by |\renewcommand|.
%
% \DescribeMacro{\cftsetindents}
% The command
% |\cftsetindents{|\meta{entry}|}{|\meta{indent}|}{|\meta{numwidth}|}|
% sets the \meta{entry}'s \textit{indent} to the length \meta{indent} and its
% \textit{numwidth} to the length \meta{numwidth}. The \meta{entry} argument
% is the name of one of the standard entries (e.g., |subsection|) or the name of
% entry that has been defined with the \Lpack{tocloft} package.
% For example \\
% |\cftsetindents{figure}{0em}{1.5em}| \\
% will make figure entries left justified.
%
%
% Various effects can be achieved by changing the definitions of |\cftXfont|,
% |\cftXaftersnum|, |\cftXaftersnumb|, |\cftXleader| and |\cftXafterpnum|,
% either singly or in combination.
% For the sake of some examples, assume that we have the following initial
% definitions
% \begin{verbatim}
% \newcommand{\cftXfont}{}
% \newcommand{\cftXaftersnum}{}
% \newcommand{\cftXaftersnumb}{}
% \newcommand{\cftXleader}{\cftdotfill{\cftXdotsep}}
% \newcommand{\cftXdotsep}{\cftdotsep}
% \newcommand{\cftXpagefont}{}
% \newcommand{\cftXafterpnum}{}
% \end{verbatim}
% (Note that the same font should be used for the title, leader and page
% number to provide a coherent appearance).
%
% \begin{itemize}
% \item To eliminate the dots in the leader:
% \begin{verbatim}
% \renewcommand{\cftXdotsep}{\cftnodots}
% \end{verbatim}
%
% \item To put something (e.g., a name) before the title (number):
% \begin{verbatim}
% \renewcommand{\cftXpresnum}{SOMETHING }
% \end{verbatim}
%
% \item To add a colon after the section number:
% \begin{verbatim}
% \renewcommand{\cftXaftersnum}{:}
% \end{verbatim}
%
% \item To put something before the title number, add a colon after the
% the title number, set everything in bold font,
% and start the title text on the following line:
% \begin{verbatim}
% \renewcommand{\cftXfont}{\bfseries}
% \renewcommand{\cftXleader}{\bfseries\cftdotfill{\cftXdotsep}}
% \renewcommand{\cftXpagefont}{\bfseries}
% \renewcommand{\cftXpresnum}{SOMETHING }
% \renewcommand{\cftXaftersnum}{:}
% \renewcommand{\cftXaftersnumb}{\\}
% \end{verbatim}
%
% If you are adding text in the number box in addition to the number,
% then you will probably have to increase the width of the box so that
% multiline titles have a neat vertical alignment; changing box widths
% usually implies that the indents will require modification as
% well.\footnote{Lyndon Dudding (\texttt{lyndon.dudding@totalise.co.uk})
% discovered this.}
% One possible method of adjusting the box width for the above example
% is:
% \begin{verbatim}
% \newlength{\mylen} % a "scratch" length
% \settowidth{\mylen}{\bfseries\cftXpresnum\cftXaftersnum} % extra space
% \addtolength{\cftXnumwidth}{\mylen} % add the extra space
% \end{verbatim}
%
% \item To set the section numbers flushright:\footnote{With thanks to
% David Holz (\texttt{lbda@earthlink.net}) for requesting this.}
% \begin{verbatim}
% \setlength{\mylen}{0.5em} % need some extra space at end of number
% \renewcommand{\cftXpresnum}{\hfill} % note the double `l'
% \renewcommand{\cftXaftersnum}{\hspace*{\mylen}}
% \addtolength{\cftXnumwidth}{\mylen}
% \end{verbatim}
% In the above, the added initial |\hfill| in the box overrides the
% final |\hfil| in the box, thus shifting everything to the right hand
% end of the box. The extra space is so that the number is not typeset
% immediately at the left of the title text.
%
% \item To set the entry ragged left (but this only looks good for single
% line titles):
% \begin{verbatim}
% \renewcommand{\cftXfont}{\hfill\bfseries}
% \renewcommand{\cftXleader}{}
% \end{verbatim}
%
% \item To set the page number immediately after the entry text instead of at
% the righthand margin:
% \begin{verbatim}
% \renewcommand{\cftXleader}{}
% \renewcommand{\cftXafterpnum}{\cftparfillskip}
% \renewcommand{\cftpnumalign}{l}
% \end{verbatim}
% By default the |\parfillskip| value is locally set to fill up the last
% line of a paragraph. Just changing |\cftXleader| puts horrible interword
% spaces into the last line of the title. The |\cftparfillskip|
% command
% is part of the \Lpack{tocloft} package and is provided just so that
% the above effect can be achieved.
% In addition, this is a good example of when it would be suitable to change the alignment of the page number box.
%
% \item To remove the space inserted between table and figure caption entries between chapters:
% \begin{verbatim}
% \begingroup
% \renewcommand*{\addvspace}[1]{}
% \listoftables
% \listoffigures
% \endgroup
% \end{verbatim}
% \end{itemize}
%
% \DescribeMacro{\cftpagenumbersoff}
% \DescribeMacro{\cftpagenumberson}
% The command |\cftpagenumbersoff{|\meta{entry}|}| will
% eliminate the page numbers for \meta{entry} in the listing, where
% \meta{entry} is the name of one of the standard
% kinds of entries (e.g., |subsection|, or |figure| --- including |subfigure|
% if the \Lpack{subfigure} package is used --- etc.), or the name of a
% new entry defined with the \Lpack{tocloft} package.
%
% The command |\cftpagenumberson{|\meta{entry}|}| reverses
% the effect of a corresponding |\cftpagenumbersoff|.
%
% One question that appeared on the \file{comp.text.tex} newsgroup asked
% how to get the titles of Appendices list in the ToC \emph{without}
% page numbers. Here is a simple way of doing it, assuming the document
% has chapters
% \begin{verbatim}
% ...
% \appendix
% \addtocontents{toc}{\cftpagenumbersoff{chapter}}
% \chapter{First appendix}
% \end{verbatim}
% If there are other chaptered headings to go into the ToC after the
% appendices, then it will be necessary to do a similar \\
% |\addtocontents{toc}{\cftpagenumberson{chapter}}| \\
% to restore the page numbering in the ToC.
%
% Similarly, if you are using the \Lpack{subfigure} package you may
% want to eliminate the page numbers for the subfigure captions. This
% can be accomplished by: \\
% |\cftpagenumbersoff{subfigure}|
%
% At this point, I leave it up to your ingenuity as to other effects that
% you can achieve. However, if you come up with further examples, let me
% know for possible inclusion in a later version of this document.
%
% \subsection{New list of\ldots}
%
% \DescribeMacro{\newlistof}
% The command |\newlistof[|\meta{within}|]{|\meta{entry}|}{|\meta{ext}|}{|\meta{listofname}|}|
% creates a new List of \ldots, and assorted commands to go along with it.
%
% The first required argument, \meta{entry} is used to define a new
% counter called |entry|. The optional \meta{within} argument can
% be used so that |entry| gets reset to one every time the counter called
% |within| is changed. That is, the first two arguments are equivalent to
% calling |\newcounter{|\meta{entry}|}[|\meta{within}|]|.
%
% The next argument, \meta{ext}, is the file extension for the new List of.
% The last argument, \meta{listofname}, is the text for the heading of the
% new List of. As an example:
% \begin{verbatim}
% \newcommand{\listanswername}{List of Answers}
% \newlistof[chapter]{answer}{ans}{\listanswername}
% \end{verbatim}
% will create a new |answer| counter that will be reset at the start of each
% |\chapter{...}|. Any answer titles will be written to the file
% \file{jobname.ans} and |\listanswername| will be used as the list heading.
% A command |\listofanswer| is created which can be used just like the
% |\listoftables| or |tableofcontents| commands to generate a listing.
% It is up to you to specify how the entries are put into the
% new List of Answers. Here is a very simple example, remembering that an
% |answer| counter has been created.
% \begin{verbatim}
% \newcommand{\answer}[1]{%
% \refstepcounter{answer}
% \par\noindent\textbf{Answer \theanswer. #1}
% \addcontentsline{ans}{answer}{\protect\numberline{\theanswer}#1}\par}
% \end{verbatim}
% which, when used like: \\
% |\answer{Hard} The \ldots| will print as:
% \par\noindent\textbf{Answer 1. Hard}\par The \ldots
%
% As mentioned above, the |\newlistof| command creates several new
% commands, most of which you should now be familiar with. For convenience,
% assume that |\newlistof{X}{Z}{...}| has been issued; so |X| is the name
% of the new counter and corresponds to the |X| in section~\ref{sec:entries},
% and |Z| is the new file extension and corresponds to the |Z| in
% section~\ref{sec:titles}. Then, among others, the following new commands
% will be made available.
%
% The five commands, |\cftmarkZ|,
% |\cftbeforeZtitleskip|,
% |\cftafterZtitleskip|,
% |\cftZtitlefont|, and
% |\cftafterZtitle|,
% are analogous to the commands of the same names
% described in section~\ref{sec:titles}.
%
% \DescribeMacro{\listofX}
% The command |\listofX| is similar to |\listoftables|, etc.,
% in that it typesets
% the new listing at the point where it is called.
%
% \DescribeMacro{\Zdepth}
% The command |\Zdepth{|\meta{number}|}| is analogous to the standard
% |\tocdepth{|\meta{number}|}| command, in that it specifies that entries
% in the new listing should not be typeset if their numbering level
% is greater
% than \meta{number}. The default definition is
% |\setcounter{Zdepth}{1}|.
%
% \DescribeMacro{\newlistentry}
% The command
% |\newlistentry[|\meta{within}|]{|\meta{entry}|}{|\meta{ext}|}{|\meta{level-1}|}| creates
% new commands for typesetting a new kind of entry in a listing. It is used
% internally by the |\newlistof| command but may be used independently.
%
% The first required argument, \meta{entry} is used to define a new
% counter called |entry|. The optional \meta{within} argument can
% be used so that |entry| gets reset to one every time the counter called
% |within| is changed. That is, the first two arguments are equivalent to
% calling |\newcounter{|\meta{entry}|}[|\meta{within}|]|.
% The second required argument, \meta{ext}, is the file extension for the
% entry listing.
% The last argument, \meta{level-1}, is a number specifying the numbering
% level minus one,
% of the entry in a listing.
% For example, the command \\
% |\newlistof[chapter]{answer}{ans}{\listanswername}| \\
% will call the command: \\
% |\newlistentry[chapter]{answer}{ans}{0}| \\
%
%
% Calling |\newlistentry| creates several new commands. Assuming that
% it is called as |\newlistentry[within]{X}{Z}{N}|, where |X| and |Z| are
% similar to the
% previous uses of them, and |N| is an integer number, then the following
% commands are made available.
%
% The set of commands |\cftbeforeXskip|,
% |\cftXfont|,
% |\cftXpresnum|,
% |\cftXaftersnum|,
% |\cftXaftersnumb|,
% |\cftXleader|,
% |\cftXdotsep|,
% |\cftXpagefont|, and
% |\cftXafterpnum|,
% are analogous to the commands of the same names