/
classes.dtx
4502 lines (4501 loc) · 152 KB
/
classes.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
%
% Copyright (C) 1993-2021
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It 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.
% The latest version of this license is in
% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
%
% \iffalse
% \section{Identification}
%
% These document classes can only be used with \LaTeXe, so we make
% sure that an appropriate message is displayed when another \TeX{}
% format is used.
% \changes{v1.3p}{1995/11/30}{Added date of \LaTeX\ format to argument
% of \cs{NeedsTeXFormat}}
% \begin{macrocode}
%<article|report|book>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
% \end{macrocode}
%
% Announce the Class name and its version:
% \begin{macrocode}
%<article>\ProvidesClass{article}
%<report>\ProvidesClass{report}
%<book>\ProvidesClass{book}
%<10pt&!bk>\ProvidesFile{size10.clo}
%<11pt&!bk>\ProvidesFile{size11.clo}
%<12pt&!bk>\ProvidesFile{size12.clo}
%<10pt&bk>\ProvidesFile{bk10.clo}
%<11pt&bk>\ProvidesFile{bk11.clo}
%<12pt&bk>\ProvidesFile{bk12.clo}
%<*driver>
\ProvidesFile{classes.drv}
%</driver>
[2020/11/23 v1.4m
%<article|report|book> Standard LaTeX document class]
%<10pt|11pt|12pt> Standard LaTeX file (size option)]
% \end{macrocode}
%
% \section{A driver for this document}
%
% The next bit of code contains the documentation driver file for
% \TeX{}, i.e., the file that will produce the documentation you are
% currently reading. It will be extracted from this file by the
% {\sc docstrip} program.
%
% \changes{1.0f}{1993/12/07}{Use class ltxdoc document class}
% \changes{1.0r}{1994/02/28}{Moved driver code in order not to need a
% separate driver}
% \begin{macrocode}
%<*driver>
]
\documentclass{ltxdoc}
% \end{macrocode}
%
% We don't want everything to appear in the index
% \begin{macrocode}
\DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
\DoNotIndex{\@badmath,\@centercr,\@cite}
\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
\DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
\DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@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,\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}
\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
\DoNotIndex{\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@}
% \end{macrocode}
% We do want an index, using line numbers
% \begin{macrocode}
\EnableCrossrefs
\CodelineIndex
% \end{macrocode}
% We use so many \file{docstrip} modules that we set the
% \texttt{StandardModuleDepth} counter to 1.
% \begin{macrocode}
\setcounter{StandardModuleDepth}{1}
% \end{macrocode}
% The following command retrieves the date and version information
% from the file.
% \begin{macrocode}
\GetFileInfo{classes.drv}
% \end{macrocode}
% Some commonly used abbreviations
% \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*}}
% \begin{macrocode}
\newcommand*{\Lopt}[1]{\textsf {#1}}
\newcommand*{\file}[1]{\texttt {#1}}
\newcommand*{\Lcount}[1]{\textsl {\small#1}}
\newcommand*{\pstyle}[1]{\textsl {#1}}
% \end{macrocode}
% We also want the full details.
% \begin{macrocode}
\begin{document}
\DocInput{classes.dtx}
\PrintIndex
% ^^A\PrintChanges
\end{document}
%</driver>
% \end{macrocode}
%
% \fi
%
% \changes{v1.0d}{1993/11/30}{remove \cs{@in}, made option makeindex
% a synonym for option makeidx}
% \changes{v1.0d}{1993/11/30}{removed \cs{@minus}, \cs{@plus},
% \cs{@settopoint}, \cs{@setfontsize}; they are now in the
% kernel}
% \changes{v1.0d}{1993/11/30}{Added use of \cs{NeedsTeXFormat}}
% \changes{v1.0d}{1993/11/30}{Replaced \cs{bf} with \cs{bfseries};
% \cs{rm} with \cs{rmfamily}}
% \changes{v1.0d}{1993/11/30}{Made equation and eqnarray environments
% in the fleqn option up to date with latex.dtx}
% \changes{v1.0f}{1993/12/08}{Made all lines shorter than 72 characters}
% \changes{v1.0g}{1993/12/08}{Made change in eqnarray for the fleqn
% option, as suggested by Rainer.}
% \changes{v1.0h}{1993/12/18}{Made the definitions of the font- and
% size-changing commands use \cs{renew} rather than \cs{new}.
% Defined the float parameters with \cs{renewcommand} rather than
% \cs{newcommand}. Corrected some typos in the fleqn option.
% Replaced two occurrences of -\cs{@secpenalty} by
% \cs{@secpenalty}. ASAJ.}
% \changes{v1.0j}{1993/12/20}{Added \cs{ProvidesFile} to size files}
% \changes{v1.0j}{1993/12/10}{Use \cs{cmd} in change entries}
% \changes{v1.0k}{1994/01/09}{Removed some typos/bugs}
% \changes{v1.0l}{1994/01/11}{add the extension to the names of the
% files}
% \changes{v1.0l}{1994/01/10}{Changed version numbering; moved leqno
% and fleqn options to an external file.}
% \changes{v1.0n}{1994/01/19}{Removed code for makeidx option and made
% it a separate package; removed use of \cs{setlength} from list
% parameters.}
% \changes{v1.0o}{1994/01/31}{Small documentation changes}
% \changes{v1.0q}{1994/02/16}{Small documentation changes}
% \changes{v1.1a}{1994/03/12}{Removed \cs{typeout} messages}
% \changes{v1.1f}{1994/04/15}{Inserted forgotten line break}
% \changes{v1.2a}{1994/03/17}{Added openright option. (LL)}
% \changes{v1.2b}{1994/03/17}{Added the \ldots{}matter commands. (LL)}
% \changes{v1.2c}{1994/03/17}{Fixed page numbering in titlepage
% env. (LL)}
% \changes{v1.2d}{1994/04/11}{Checked the file for long lines and
% wrapped them when necessary; made a slight implementation
% modification to the openright and openany options.}
% \changes{v1.2i}{1994/04/28}{Use LaTeX instead of LaTeX2e in messages}
% \changes{v1.2j}{1994/05/01}{Removed the use of \cs{fileversion}
% c.s.}
% \changes{v1.2l}{1994/05/11}{changed some \cs{changes} entries}
% \changes{v1.2m}{1994/05/12}{Forgot a few entries}
% \changes{v1.2o}{1994/05/24}{Changed file information}
% \changes{v1.2p}{1994/05/27}{Moved identification and driver to the
% front of the file}
% \changes{v1.2t}{1994/06/22}{Rephrased a few sentences to prevent
% overfull hboxes}
% \changes{v1.2v}{1994/12/01}{Made the oneside option work for the
% book class}
% \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*} for commands with
% arguments}
% \changes{v1.2z}{1995/05/16}{Always use \cs{cs} in \cs{changes}
% entries}
% \changes{v1.3a}{1995/05/17}{Replaced all \cs{hbox to} by \cs{hb@xt@}}
% \changes{v1.3d}{1995/06/05}{Replaced all \cs{uppercase} by
% \cs{MakeUppercase}}
% \changes{v1.3l}{1995/10/20}{Disabled in compatibility mode all
% options that are new in \LaTeXe.}
% \changes{v1.3v}{1997/06/16}{Documentation fixes.}
% \changes{v1.4j}{2019/08/27}{Various commands made robust}
% \changes{v1.4m}{2020/04/10}{(JLB) prettyprinting the code}
%
%
% \title{Standard Document Classes for \LaTeX{} version 2e\thanks{This
% file has version number \fileversion, last revised \filedate.}}
%
% \author{%
% Copyright (C) 1992 by Leslie Lamport and
% Copyright (C) 1994-2020 by Frank Mittelbach and Johannes Braams and
% LaTeX Project Team
% }
% \date{\filedate}
% \MaintainedByLaTeXTeam{latex}
% \maketitle
% \tableofcontents
%
% \StopEventually{} ^^A
%
% \section{The {\sc docstrip} modules}
%
% The following modules are used in the implementation to direct
% {\sc docstrip} in generating the external files:
% \begin{center}
% \begin{tabular}{ll}
% article & produce the documentclass article\\
% report & produce the documentclass report\\
% size10 & produce the class option for 10pt\\
% size11 & produce the class option for 11pt\\
% size12 & produce the class option for 12pt\\
% book & produce the documentclass book\\
% bk10 & produce the book class option for 10pt\\
% bk11 & produce the book class option for 11pt\\
% bk12 & produce the book class option for 12pt\\
% driver & produce a documentation driver file \\
% \end{tabular}
% \end{center}
%
% \section{Initial Code}
%
% In this part we define a few commands that are used later on.
%
% \begin{macro}{\@ptsize}
% This control sequence is used to store the second digit of the
% pointsize we are typesetting in. So, normally, it's value is one
% of 0, 1 or 2.
% \begin{macrocode}
%<*article|report|book>
\newcommand\@ptsize{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@restonecol}
% When the document has to be printed in two columns, we sometimes
% have to temporarily switch to one column. This switch is used to
% remember to switch back.
% \begin{macrocode}
\newif\if@restonecol
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@titlepage}
% A switch to indicate if a titlepage has to be produced. For the
% article document class the default is not to make a separate
% titlepage.
% \begin{macrocode}
\newif\if@titlepage
%<article>\@titlepagefalse
%<!article>\@titlepagetrue
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@openright}
% A switch to indicate if chapters must start on a right-hand page.
% The default for the report class is no; for the book class it's
% yes.
% \begin{macrocode}
%<!article>\newif\if@openright
% \end{macrocode}
% \end{macro}
%
% \changes{v1.3k}{1995/08/27}{Macro \cs{if@openbib} removed}
%
% \begin{macro}{\if@mainmatter}
% \changes{v1.2v}{1994/12/01}{Moved the allocation of
% \cs{if@mainmatter} here}
%
% The switch |\if@mainmatter|, only available in the document class
% book, indicates whether we are processing the main material in
% the book.
% \begin{macrocode}
%<book>\newif\if@mainmatter \@mainmattertrue
% \end{macrocode}
% \end{macro}
%
% \section{Declaration of Options}
%
%
% \subsection{Setting Paper Sizes}
%
% The variables |\paperwidth| and |\paperheight| should reflect the
% physical paper size after trimming. For desk printer output this
% is usually the real paper size since there is no post-processing.
% Classes for real book production will probably add other paper
% sizes and additionally the production of crop marks for trimming.
% In compatibility mode, these (and some of the subsequent) options
% are disabled, as they were not present in \LaTeX 2.09.
% \changes{v1.0g}{1993/12/09}{Removed typo, A4 is not 279 mm high}
% \begin{macrocode}
\if@compatibility\else
\DeclareOption{a4paper}
{\setlength\paperheight {297mm}%
\setlength\paperwidth {210mm}}
\DeclareOption{a5paper}
{\setlength\paperheight {210mm}%
\setlength\paperwidth {148mm}}
\DeclareOption{b5paper}
{\setlength\paperheight {250mm}%
\setlength\paperwidth {176mm}}
\DeclareOption{letterpaper}
{\setlength\paperheight {11in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{legalpaper}
{\setlength\paperheight {14in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{executivepaper}
{\setlength\paperheight {10.5in}%
\setlength\paperwidth {7.25in}}
% \end{macrocode}
%
% The option \Lopt{landscape} switches the values of |\paperheight|
% and |\paperwidth|, assuming the dimensions were given for portrait
% paper.
% \begin{macrocode}
\DeclareOption{landscape}
{\setlength\@tempdima {\paperheight}%
\setlength\paperheight {\paperwidth}%
\setlength\paperwidth {\@tempdima}}
\fi
% \end{macrocode}
%
% \subsection{Choosing the type size}
%
% The type size options are handled by defining |\@ptsize| to contain
% the last digit of the size in question and branching on |\ifcase|
% statements. This is done for historical reasons to stay compatible
% with other packages that use the |\@ptsize| variable to select
% special actions. It makes the declarations of size options less
% than 10pt difficult, although one can probably use \texttt{9}
% and \texttt{8} assuming that a class wont define both
% \Lopt{8pt} and \Lopt{18pt} options.
%
% \begin{macrocode}
\if@compatibility
\renewcommand\@ptsize{0}
\else
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\fi
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
% \end{macrocode}
%
%
% \subsection{Two-side or one-side printing}
%
% For two-sided printing we use the switch |\if@twoside|. In
% addition we have to set the |\if@mparswitch| to get any margin
% paragraphs into the outside margin.
% \begin{macrocode}
\if@compatibility\else
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\fi
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
% \end{macrocode}
%
%
% \subsection{Draft option}
%
% If the user requests \Lopt{draft} we show any overfull boxes.
% We could probably add some more interesting stuff to this option.
% \begin{macrocode}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\if@compatibility\else
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\fi
% \end{macrocode}
%
% \subsection{Titlepage option}
% An article usually has no separate titlepage, but the user can
% request one.
% \begin{macrocode}
\DeclareOption{titlepage}{\@titlepagetrue}
\if@compatibility\else
\DeclareOption{notitlepage}{\@titlepagefalse}
\fi
% \end{macrocode}
%
% \subsection{openright option}
% This option determines whether or not a chapter must start on
% a right-hand page
% request one.
% \begin{macrocode}
%<!article>\if@compatibility
%<book>\@openrighttrue
%<!article>\else
%<!article>\DeclareOption{openright}{\@openrighttrue}
%<!article>\DeclareOption{openany}{\@openrightfalse}
%<!article>\fi
% \end{macrocode}
%
% \subsection{Two-column printing}
%
% Two-column and one-column printing is again realized via a switch.
% \begin{macrocode}
\if@compatibility\else
\DeclareOption{onecolumn}{\@twocolumnfalse}
\fi
\DeclareOption{twocolumn}{\@twocolumntrue}
% \end{macrocode}
%
% \subsection{Equation numbering on the left}
%
% The option \Lopt{leqno} can be used to get the equation numbers
% on the left side of the equation. It loads code which is generated
% automatically from the kernel files when the format is built.
% If the equation number does get a special formatting then instead
% of using the kernel file the class would need to provide the code
% explicitly.
% \begin{macrocode}
\DeclareOption{leqno}{\input{leqno.clo}}
% \end{macrocode}
%
% \subsection{Flush left displays}
%
% The option \Lopt{fleqn} redefines the displayed math environments
% in such a way that they come out flush left, with an indentation
% of |\mathindent| from the prevailing left margin. It loads
% code which is generated
% automatically from the kernel files when the format is built.
% \changes{v1.0h}{1993/12/18}{Corrected some typos. ASAJ.}
% \begin{macrocode}
\DeclareOption{fleqn}{\input{fleqn.clo}}
% \end{macrocode}
%
% \subsection{Open bibliography}
%
% The option \Lopt{openbib} produces the ``open'' bibliography
% style, in which each block starts on a new line, and succeeding
% lines in a block are indented by |\bibindent|.
% \changes{v1.3k}{1995/08/27}{openbib option reimplemented}
% \begin{macrocode}
\DeclareOption{openbib}{%
% \end{macrocode}
% First some hook into the bibliography environment is filled.
% \begin{macrocode}
\AtEndOfPackage{%
\renewcommand\@openbib@code{%
\advance\leftmargin\bibindent
\itemindent -\bibindent
\listparindent \itemindent
\parsep \z@
}%
% \end{macrocode}
% In addition the definition of |\newblock| is overwritten.
% \begin{macrocode}
\renewcommand\newblock{\par}}%
}
% \end{macrocode}
%
%
% \section{Executing Options}
%
% Here we execute the default options to initialize certain
% variables. Note that the document class `book' always uses two
% sided printing.
% \begin{macrocode}
%<*article>
\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final}
%</article>
%<*report>
\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany}
%</report>
%<*book>
\ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}
%</book>
% \end{macrocode}
%
% The |\ProcessOptions| command causes the execution of the code
% for every option \Lopt{FOO}
% which is declared and for which the user typed
% the \Lopt{FOO} option in his
% |\documentclass| command. For every option \Lopt{BAR} he typed,
% which is not declared, the option is assumed to be a global option.
% All options will be passed as document options to any
% |\usepackage| command in the document preamble.
% \begin{macrocode}
\ProcessOptions
% \end{macrocode}
% Now that all the options have been executed we can load the
% chosen class option file that contains all size dependent code.
% \begin{macrocode}
%<!book>\input{size1\@ptsize.clo}
%<book>\input{bk1\@ptsize.clo}
%</article|report|book>
% \end{macrocode}
%
% \section{Loading Packages}
%
% The standard class files do not load additional packages.
%
%
% \section{Document Layout}
% \label{sec:classes:maincode}
%
% In this section we are finally dealing with the nasty typographical
% details.
%
% \subsection{Fonts}
%
% \LaTeX\ offers the user commands to change the size of the font,
% relative to the `main' size. Each relative size changing command
% |\size| executes the command
% |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where:
%
% \begin{description}
% \item[\meta{font-size}] The absolute size of the font to use from
% now on.
%
% \item[\meta{baselineskip}] The normal value of |\baselineskip|
% for the size of the font selected. (The actual value will be
% |\baselinestretch| * \meta{baselineskip}.)
% \end{description}
%
% A number of commands, defined in the \LaTeX{} kernel, shorten the
% following definitions and are used throughout. They are:
% \begin{center}
% \begin{tabular}{ll@{\qquad}ll@{\qquad}ll}
% \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\
% \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\
% \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\
% ...
% \end{tabular}
% \end{center}
%
% \begin{macro}{\normalsize}
% \begin{macro}{\@normalsize}
% \changes{v1.0o}{1994/01/31}{\cs{@normalsize} now defined in the
% kernel}
%
% The user level command for the main size is |\normalsize|.
% Internally \LaTeX{} uses |\@normalsize| when it refers to the
% main size. |\@normalsize| will be defined to work like
% |\normalsize| if the latter is redefined from its default
% definition (that just issues an error message). Otherwise
% |\@normalsize| simply selects a 10pt/12pt size.
%
% The |\normalsize| macro also sets new values for\\
% |\abovedisplayskip|, |\abovedisplayshortskip| and
% |\belowdisplayshortskip|.
%
% \changes{v1.0e}{1993/12/07}{\cs{normalsize} doesn't exist, so use
% \cs{newcommand}}
% \changes{v1.0h}{1993/12/18}{\cs{normalsize} is now defined in the
% kernel, so use \cs{renewcommand}. ASAJ.}
% \begin{macrocode}
%<*10pt|11pt|12pt>
\renewcommand\normalsize{%
%<*10pt>
\@setfontsize\normalsize\@xpt\@xiipt
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
%</10pt>
%<*11pt>
\@setfontsize\normalsize\@xipt{13.6}%
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
%</11pt>
%<*12pt>
\@setfontsize\normalsize\@xiipt{14.5}%
\abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
%</12pt>
% \end{macrocode}
% The |\belowdisplayskip| is always equal to the
% |\abovedisplayskip|. The parameters of the first level list are
% always given by |\@listI|.
% \begin{macrocode}
\belowdisplayskip \abovedisplayskip
\let\@listi\@listI}
% \end{macrocode}
%
% We initially choose the normalsize font.
% \begin{macrocode}
\normalsize
% \end{macrocode}
% We use |\MakeRobust| instead of |\DeclareRobustCommand| above to avoid a log
% entry for the redefinition. But if we are running in a rollback situation
% (prior to 2015) we don't touch it.
% \changes{v1.4k}{2019/10/25}{Roll back handling (gh/201)}
% \begin{macrocode}
\ifx\MakeRobust\@undefined \else
\MakeRobust\normalsize
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\small}
% This is similar to |\normalsize|.
% \changes{v1.0h}{1993/12/18}{\cs{small} is now defined in the kernel,
% so use \cs{renewcommand}. ASAJ.}
% \changes{v1.2e}{1994/04/14}{\cs{small} is no longer defined in the
% kernel; use \cs{newcommand}}
% \begin{macrocode}
\DeclareRobustCommand\small{%
%<*10pt>
\@setfontsize\small\@ixpt{11}%
\abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus2\p@
\belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 4\p@ \@plus2\p@ \@minus2\p@
\parsep 2\p@ \@plus\p@ \@minus\p@
\itemsep \parsep}%
%</10pt>
%<*11pt>
\@setfontsize\small\@xpt\@xiipt
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
\def\@listi{\leftmargin\leftmargini
\topsep 6\p@ \@plus2\p@ \@minus2\p@
\parsep 3\p@ \@plus2\p@ \@minus\p@
\itemsep \parsep}%
%</11pt>
%<*12pt>
\@setfontsize\small\@xipt{13.6}%
\abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
\def\@listi{\leftmargin\leftmargini
\topsep 9\p@ \@plus3\p@ \@minus5\p@
\parsep 4.5\p@ \@plus2\p@ \@minus\p@
\itemsep \parsep}%
%</12pt>
\belowdisplayskip \abovedisplayskip
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\footnotesize}
% This is similar to |\normalsize|.
% \changes{v1.0h}{1993/12/18}{\cs{footnotesize} is now defined in the
% kernel, so use \cs{renewcommand}. ASAJ.}
% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
% \begin{macrocode}
\DeclareRobustCommand\footnotesize{%
%<*10pt>
\@setfontsize\footnotesize\@viiipt{9.5}%
\abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 3\p@ \@plus\p@ \@minus\p@
\parsep 2\p@ \@plus\p@ \@minus\p@
\itemsep \parsep}%
%</10pt>
%<*11pt>
\@setfontsize\footnotesize\@ixpt{11}%
\abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 4\p@ \@plus2\p@ \@minus2\p@
\parsep 2\p@ \@plus\p@ \@minus\p@
\itemsep \parsep}%
%</11pt>
%<*12pt>
\@setfontsize\footnotesize\@xpt\@xiipt
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
\def\@listi{\leftmargin\leftmargini
\topsep 6\p@ \@plus2\p@ \@minus2\p@
\parsep 3\p@ \@plus2\p@ \@minus\p@
\itemsep \parsep}%
%</12pt>
\belowdisplayskip \abovedisplayskip
}
%</10pt|11pt|12pt>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\scriptsize}
% \begin{macro}{\tiny}
% \begin{macro}{\large}
% \begin{macro}{\Large}
% \begin{macro}{\LARGE}
% \begin{macro}{\huge}
% \begin{macro}{\Huge}
% These are all much simpler than the previous macros, they just
% select a new fontsize, but leave the parameters for displays and
% lists alone.
% \changes{v1.0h}{1993/12/18}{These are now defined in the kernel,
% so use \cs{renewcommand}. ASAJ.}
% \changes{v1.2e}{1994/04/14}{use \cs{newcommand} again}
% \begin{macrocode}
%<*10pt>
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</10pt>
%<*11pt>
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xiipt{14}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xivpt{18}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxpt{25}}
\DeclareRobustCommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%</11pt>
%<*12pt>
\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}
\DeclareRobustCommand\tiny{\@setfontsize\tiny\@vipt\@viipt}
\DeclareRobustCommand\large{\@setfontsize\large\@xivpt{18}}
\DeclareRobustCommand\Large{\@setfontsize\Large\@xviipt{22}}
\DeclareRobustCommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}
\DeclareRobustCommand\huge{\@setfontsize\huge\@xxvpt{30}}
\let\Huge=\huge
%</12pt>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{Paragraphing}
%
% \begin{macro}{\lineskip}
% \begin{macro}{\normallineskip}
% These parameters control \TeX's behaviour when two lines tend to
% come too close together.
% \begin{macrocode}
%<*article|report|book>
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\baselinestretch}
% This is used as a multiplier for |\baselineskip|. The default is
% to \emph{not} stretch the baselines. Note that if this command
% doesn't resolve to ``empty'' any \texttt{plus} or \texttt{minus}
% part in the specification of |\baselineskip| is ignored.
% \begin{macrocode}
\renewcommand\baselinestretch{}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\parskip}
% \begin{macro}{\parindent}
% |\parskip| gives extra vertical space between paragraphs and
% |\parindent| is the width of the paragraph indentation. The value
% of |\parindent| depends on whether we are in two-column mode.
% \changes{v1.0m}{1994/01/12}{\cs{parindent} should be different,
% depending on the pointsize}
% \begin{macrocode}
\setlength\parskip{0\p@ \@plus \p@}
%</article|report|book>
%<*10pt|11pt|12pt>
\if@twocolumn
\setlength\parindent{1em}
\else
%<10pt> \setlength\parindent{15\p@}
%<11pt> \setlength\parindent{17\p@}
%<12pt> \setlength\parindent{1.5em}
\fi
%</10pt|11pt|12pt>
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\smallskipamount}
% \begin{macro}{\medskipamount}
% \begin{macro}{\bigskipamount}
% The values for these three parameters are set in the \LaTeX\
% kernel. They should perhaps vary, according to the size option
% specified. But as they have always had the same value regardless
% of the size option we do not change them to stay compatible with
% both \LaTeX~2.09 and older releases of \LaTeXe.
% \changes{v1.3n}{1995/10/29}{Added setting the values of
% \cs{...skipamount}}
% \begin{macrocode}
%<*10pt|11pt|12pt>
\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
%</10pt|11pt|12pt>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@lowpenalty}
% \begin{macro}{\@medpenalty}
% \begin{macro}{\@highpenalty}%
% The commands |\nopagebreak| and |\nolinebreak| put in penalties
% to discourage these breaks at the point they are put in.
% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|,
% dependent on their argument.
% \begin{macrocode}
%<*article|report|book>
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\clubpenalty}
% \begin{macro}{\widowpenalty}
% These penalties are use to discourage club and widow lines.
% Because we use their default values we only show them here,
% commented out.
% \begin{macrocode}
% \clubpenalty 150
% \widowpenalty 150
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\displaywidowpenalty}
% \begin{macro}{\predisplaypenalty}
% \begin{macro}{\postdisplaypenalty}
% Discourage (but not so much) widows in front of a math display
% and forbid breaking directly in front of a display. Allow break
% after a display without a penalty. Again the default values are
% used, therefore we only show them here.
% \begin{macrocode}
% \displaywidowpenalty 50
% \predisplaypenalty 10000
% \postdisplaypenalty 0
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\interlinepenalty}
% Allow the breaking of a page in the middle of a paragraph.
% \begin{macrocode}
% \interlinepenalty 0
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\brokenpenalty}
% We allow the breaking of a page after a hyphenated line.
% \changes{v1.1a}{1994/03/12}{Show correct default which is 100}
% \begin{macrocode}
% \brokenpenalty 100
%</article|report|book>
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Page Layout}
%
% All margin dimensions are measured from a point one inch from the
% top and lefthand side of the page.
%
% \subsubsection{Vertical spacing}
%
% \begin{macro}{\headheight}
% \begin{macro}{\headsep}
% \begin{macro}{\topskip}
% The |\headheight| is the height of the box that will contain the
% running head. The |\headsep| is the distance between the bottom
% of the running head and the top of the text. The |\topskip| is
% the |\baselineskip| for the first line on a page; \LaTeX's output
% routine will not work properly if it has the value 0pt, so do not
% do that!
% \begin{macrocode}
%<*10pt|11pt|12pt>
\setlength\headheight{12\p@}
%<!bk>\setlength\headsep {25\p@}
%<10pt&bk>\setlength\headsep {.25in}
%<11pt&bk>\setlength\headsep {.275in}
%<12pt&bk>\setlength\headsep {.275in}
%<10pt>\setlength\topskip {10\p@}
%<11pt>\setlength\topskip {11\p@}
%<12pt>\setlength\topskip {12\p@}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\footskip}
% The distance from the baseline of the box which contains the
% running footer to the baseline of last line of text is controlled
% by the |\footskip|.
% \begin{macrocode}
%<!bk>\setlength\footskip{30\p@}
%<10pt&bk>\setlength\footskip{.35in}
%<11pt&bk>\setlength\footskip{.38in}
%<12pt&bk>\setlength\footskip{30\p@}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\maxdepth}
% \changes{v1.2k}{1994/05/06}{Added setting of \cs{maxdepth} and
% \cs{@maxdepth}}
% \changes{v1.3j}{1995/08/16}{Take setting of
% \cs{@maxdepth} out again}
% The \TeX\ primitive register |\maxdepth| has a function that is
% similar to that of |\topskip|. The register |\@maxdepth| should
% always contain a copy of |\maxdepth|. This is achieved by setting
% it internally at |\begin{document}|. In both plain \TeX\ and
% \LaTeX~2.09 |\maxdepth| had a fixed value of \texttt{4pt}; in
% native \LaTeX2e\ mode we let the value depend on the typesize. We
% set it so that |\maxdepth| $+$ |\topskip| $=$ typesize $\times
% 1.5$. As it happens, in these classes |\topskip| is equal to the
% typesize, therefore we set |\maxdepth| to half the value of
% |\topskip|.
% \begin{macrocode}
\if@compatibility \setlength\maxdepth{4\p@} \else
\setlength\maxdepth{.5\topskip} \fi
% \end{macrocode}
% \end{macro}
%
% \subsubsection{The dimension of text}
%
% \begin{macro}{\textwidth}
% When we are in compatibility mode we have to make sure that the
% dimensions of the printed area are not different from what the
% user was used to see.
%
% \begin{macrocode}
\if@compatibility
\if@twocolumn
\setlength\textwidth{410\p@}
\else
%<10pt&!bk> \setlength\textwidth{345\p@}
%<11pt&!bk> \setlength\textwidth{360\p@}
%<12pt&!bk> \setlength\textwidth{390\p@}
%<10pt&bk> \setlength\textwidth{4.5in}
%<11pt&bk> \setlength\textwidth{5in}
%<12pt&bk> \setlength\textwidth{5in}
\fi
% \end{macrocode}
% When we are not in compatibility mode we can set some of the
% dimensions differently, taking into account the paper size for
% instance.
% \begin{macrocode}
\else
% \end{macrocode}
% First, we calculate the maximum |\textwidth|, which we will allow
% on the selected paper and store it in |\@tempdima|. Then we store
% the length of a line with approximately 60--70 characters in
% |\@tempdimb|. The values given are more or less suitable when
% Computer Modern fonts are used.
% \changes{v1.1a}{1994/03/12}{Have old values for width in native mode}
% \begin{macrocode}
\setlength\@tempdima{\paperwidth}
\addtolength\@tempdima{-2in}
%<10pt> \setlength\@tempdimb{345\p@}
%<11pt> \setlength\@tempdimb{360\p@}
%<12pt> \setlength\@tempdimb{390\p@}
% \end{macrocode}
%
% Now we can set the |\textwidth|, depending on whether we will be
% setting one or two columns.
%