-
Notifications
You must be signed in to change notification settings - Fork 0
/
agujournal2019.cls
1312 lines (1038 loc) · 39.7 KB
/
agujournal2019.cls
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
\def\currversion{April 16, 2019}
%****************************************************************%
%* *%
%* AGU Class File for all AGU Journals *%
%* *%
%* Written by Amy Hendrickson *%
%* TeXnology Inc.: 617 738-8029 *%
%* amyh@texnology.com *%
%* http://www.texnology.com *%
%* *%
%****************************************************************%
%%% Updates by Dangerous Curve typesetting@dangerouscurve.org
%%%
%%% 2017-07-14
%%% (Changes marked DC)
%%%
%%% Use BibLaTeX for change to APA style.
%%% Removed tracking-changes code.
%%%
%%%
%%% 2017-12-16
%%%
%%% Remove biblatex.
%%% Use apacite instead of agufull08,
%%% 2018-07-17 / NRV
%%% thanks to John Haiducek for help with citep error
%%% 2019-01-14 / NRV
%%% Removed natbib, changed instructions for cite commands, added Appendix heading
%%% 2019-4-16 / NRV
%%% Removed ulem to facilitate trackchanges
%%% Gave user more control over trackchanges options
%%% fixed typo in example citations
\ProvidesClass{agujournal2019}
[01/14/2019]
%% SEARCH BELOW FOR THE NUMBER TO FIND PARTICULAR MACRO GROUP
%% Macro Contents:
%% 0) Usepackage graphicx, colorx, other .sty files which we'll need to have available.
%% 1) Setting Default Dimensions
%% 2) Global Parameters
%% 3) Setting and Using Options
%% 4) Font Family declarations
%% 5) Running heads, Footnotes
%% 6) Title Page: Journal Name,
%% Title, Authors, Affils, Corresponding Authors, Author Notes, Key Points; abstract
%% 7) Section Commands
%% 8) Figure and Table Captions
%% 9) Listing
%% 10) Etc.: Hyphenation Library, Quote, Extract
%% 11) End Article: Appendix, Glossary, Acronyms, Notation, Acknowledgments
%% 12) Bibliography, References
%% 13) Track Changes
%% 14) Supporting Information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 0) Bringing in packages that we will need:
%% Nicer font choice than Computer Modern:
%\RequirePackage{newtxtext,newtxmath}
%% always will want this available
\RequirePackage{graphicx}
%% to get illustrations to print, in spite of being in Draft mode:
\setkeys{Gin}{draft=false}
%% xcolor.sty
\RequirePackage{xcolor}
\RequirePackage{url}
%% for better track changes
%\RequirePackage{trackchanges}
%% used for running head which is in light gray
\definecolor{ltgray}{cmyk}{.12,0,0,.3}
%% Line numbering
\RequirePackage{lineno}
%% add more space between text and number:
\advance\linenumbersep 12pt
%% this package makes paragraphs indent after section heads
\RequirePackage{indentfirst}
%% \RaggedRight makes the right margin go in and out; if this is commented out
%% the default will be a right justified margin.
\RequirePackage{ragged2e}
\RaggedRightParindent=24pt
\advance\RaggedRightRightskip 24pt
\RaggedRight
%% Defines \sidewaystable and \sidewaysfigure, preferred by AGU
\RequirePackage{rotating}
\newif\ifturnofflinenums
\let\savesidewaystable\sidewaystable
\let\savesidewaysfigure\sidewaysfigure
%% turns off line numbers in rotated tables and figures, aesthetic consideration,
%% not necessary.
\def\sidewaystable{\turnofflinenumstrue\savesidewaystable\centering}
\def\sidewaysfigure{\turnofflinenumstrue\savesidewaysfigure\centering}
%%xx Use apacite. DC
%% Formats bibliography, this .sty file needs to be entered later
% \RequirePackage{natbib}
%\PassOptionsToPackage{normalem}{ulem}
%\RequirePackage{ulem}
%% <== End Bringing in Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1) Setting Default Dimensions
%% Comment
%% parindent= indentation for every new paragraph
%% parskip= distance between paragraphs. Giving `plus .1pt' allows
%% a little stretch between paragraphs. If you don't like this stretch
%% you can set \parskip=0pt
\parindent=24pt
\parskip=8pt % plus .1pt
%% Comment
%% \textheight is distance from bottom of text, exclusive of running
%% foot, to top of text, exclusive of running head.
\textheight = 9.25in
%% Comment
%% \textwidth= Width of text in normal page. Can change this width locally
%% with either \leftskip/\rightskip or change in \hsize, but will
%% still be able to return to the normal width by setting \hsize=\textwidth
%% Running head normally uses \textwidth as its width so that a change
%% in \hsize in text will not change width of running head or feet.
\textwidth 5.5in
%% Comment
%% \voffset moves the printed page up or down on the physical page.
\advance\voffset-.25in
%% Comment
%% \hoffset moves the printed page left or right on the physical page.
\advance\hoffset.35in
%% Comment
%% Setting page dimensions
%% See p. 84-- 85 in LaTeX Companion, Goosins, Mittlebach and Samarin
%% or p. 555--556 in A Guide to LaTeX, Kopka and Daly, both Addison Wesley
%% books.
%% \topmargin space between top of page and running head
%% \headheight height of running head
%% \headsep space between running head and text
%% \topskip space between top of text and baseline of first line
%% of text
%% \footskip space between text and baseline of page number
%% \columnsep space between two column text
%% \columnseprule width of optional rule between columns, usually set to 0pt
%% \footnotesep Distance between two footnotes
%% \skip\footins Distance between text and footnote
%% \floatsep Distance between float and another
%% float for single col floats.
%% \textfloatsep Distance between float and text at top
%% or bottom of page.
%% \intextsep Distance between float and text if float is mid page
%% or mid column
%% \dblfloatsep For float spanning both columns in two column text,
%% above or below both columns, space between float and and float.
\topmargin0pt
\headheight 8pt
\headsep 6pt
\topskip 10pt
\footskip 36pt
\columnsep 10pt
\columnseprule 0pt
\footnotesep 6.65pt
\skip\footins 24pt plus .1pt minus .1pt
\floatsep 12pt plus 2pt minus 2pt
\textfloatsep 36pt plus 2pt minus 4pt
\intextsep 24pt plus 2pt minus 2pt
\dblfloatsep 12pt plus 2pt minus 2pt
\dbltextfloatsep 20pt plus 2pt minus 4pt
%% float placement, used by output routine
\@fptop 0pt plus 1fil
\@fpsep 8pt plus 2fil
\@fpbot 0pt plus 1fil
\@dblfptop 0pt plus 1fil
\@dblfpsep 8pt plus 2fil
\@dblfpbot 0pt plus 1fil
%% When using \marginpar, how wide can marginal note be?
\marginparwidth .75in
%% When using \marginpar, how much horizontal space between marginal
%% note and text
\setlength\marginparsep{40\p@}
%% When to push marginal note on to next page, minimum vertical space between
%% two marginal notes
\setlength\marginparpush{5\p@}
%% space added before trivlist, which is used in many other
%% macros, (for instance, verbatim environment)
%% if macro is called in vertical mode, otherwise only parskip
%% is added. Can set this without stretch if you don't like
%% the stretchy space added.
\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
%% Comment
%% Setting parameters that control float placement
%%
%% \topnumber counter holds the maximum number of
%% floats that can appear on the top of a text page.
%%
%% \topfraction indicates the maximum part of a text page that can be
%% occupied by floats at the top.
%%
%% \bottomnumber counter holds the maximum number of
%% floats that can appear on the bottom of a text page.
%%
%% \bottomfraction indicates the maximum part of a text page that can be
%% occupied by floats at the bottom.
%%
%% \totalnumber indicates the maximum number of floats that can appear on
%% any text page.
%%
%% \textfraction indicates the minimum part of a text page that has to be
%% occupied by text.
%%
%% \floatpagefraction indicates the minimum part of a page that has to be
%% occupied by floating objects before a `float page' is produced.
%%
%% \dbltopnumber counter holds the maximum number of
%% two column floats that can appear on the top of a two column text
%% page.
%%
%% \dbltopfraction indicates the maximum part of a two column text page that
%% can be occupied by two column floats at the top.
%%
%% \dblfloatpagefraction indicates the minimum part of a page that has to be
%% occupied by two column wide floating objects before a `float
%% page' is produced.
%%%
\setcounter{topnumber}{10}
\def\topfraction{.9}
\setcounter{bottomnumber}{10}
\def\bottomfraction{.1}
\setcounter{totalnumber}{10}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}
%% Setting Array and Table Spacing
%% distance between columns in array
\setlength\arraycolsep{5\p@}
%% distance between columns in tabular
\tabcolsep 6pt
%% width of lines in array
\setlength\arrayrulewidth{.4\p@}
%% horizontal space between two lines in array
\setlength\doublerulesep{2\p@}
%% space between two lines in tabular
\setlength\tabbingsep{\labelsep}
%% Minipage
%% minipage space
\skip\@mpfootins = \skip\footins
%% Framebox \fbox{} or \framebox{}
%% space between line in framebox and text within it
\setlength\fboxsep{3\p@}
%% width of ruled line in framebox
\setlength\fboxrule{.4\p@}
%%%%%%%%%%%%%%% <<== end dimensions
% 2) %%% Global parameters ==>>
%% Makes sure that there will not be any widow or club lines,
%% smaller numbers allow them occassionally, but you probably need
%% these set to 10000 so that there are never any
\widowpenalty10000
\clubpenalty10000
%% How many levels deep do you want sections to be numbered-- higher number
%% means more levels will be numbered. Here was are asking only for
%% sections to be numbered, not subsections, or subsubsection etc.
\setcounter{secnumdepth}{4}
%% To make left and right page position differently, and have
%% running heads be different on even and odd pages
\@twosidetrue
%% Marginal notes should be on the left on even numbered pages; on
%% right on odd numbered pages.
\@mparswitchtrue
%% Starting with one column text
\@twocolumnfalse
%% openbib will allow separate lines for parts of bibliography
%% entries, default is to run different parts of bib entry into a
%% paragraph form.
\newif\if@openbib
\@openbibfalse
%% Conditionals that we can set and use later
\newif\if@openright
\newif\if@mainmatter
\newif\if@restonecol
\newif\if@titlepage
\newif\ifdraft
\newif\ifnumlines
%% Comment
%% Set Names, to be used later, usually in more than one
%% macro.
\newcommand{\bibname}{Bibliography}
\newcommand{\figurename}{Figure}
\newcommand{\tablename}{Table}
\newcommand{\appendixname}{Appendix}
%%% <== end global parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 3) Declare Options and Use Default Options
\DeclareOption{draft}{\global\drafttrue}
\DeclareOption{linenumbers}{\global\numlinestrue}
\DeclareOption{final}{\setlength\overfullrule{0pt}\global\draftfalse}
\ExecuteOptions{letterpaper,10pt,onecolumn,final,openright}
\ProcessOptions
\ifnumlines
\linenumbers*[1]
\fi
%% <==== End Setting Options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 4) Font Family Info
%% Comment
%% When \ifdraft is true it will make the baselineskip = \draftskip
\newcount\draftskip
\draftskip=20
\newcommand{\@ptsize}{}
%% Comment
%% Set font sizes, normal baselineskip, for the range of sizes,
%% changing baselineskip to be larger if draft option is true
%% \setfontsize takes the first arg as the size of the font and
%% the second as the size of the baselineskip
%% \abovedisplayskip and \belowdisplayskip is the space before and
%% after an equation, adjusted in some sizes.
%% \Huge 25pt
%% \huge 20pt
%% \LARGE 17pt
%% \Large 14pt
%% \large 12pt
%% \normalsize 10 pt font
%% \small 9pt
%% \footnotesize 8pt
%% \scriptsize 7pt font
%% \tiny 5pt font
\renewcommand\normalsize{%
\ifdraft
\@setfontsize\normalsize\@xpt{\draftskip}
\else
\@setfontsize\normalsize\@xpt{12}
\fi
\abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
\belowdisplayskip \abovedisplayskip
\let\@listi\@listI}
\normalsize
\newcommand\bignormalsize{\@setfontsize\bignormalsize{10.5pt}{12}}
\newcommand\small{%
\ifdraft
\@setfontsize\small\@ixpt{\draftskip}%
\else
\@setfontsize\small\@ixpt{14}%
\fi
\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}%
\belowdisplayskip \abovedisplayskip
}
\newcommand\footnotesize{%
\ifdraft
\@setfontsize\footnotesize\@viiipt{\draftskip}%
\else
\@setfontsize\footnotesize\@viiipt{12}%
\fi
\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}%
\belowdisplayskip \abovedisplayskip
}
\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\newcommand\large{\ifdraft
\@setfontsize\large\@xiipt{\draftskip}
\else
\@setfontsize\large\@xiipt{14}
\fi
}
\newcommand\Large{\ifdraft
\@setfontsize\Large\@xivpt{\draftskip}
\else
\@setfontsize\Large\@xivpt{18}
\fi}
\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% These definitions accomodate older font typeface commands,
%% that are still in use.
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand{\cal}{\@fontswitch{\relax}{\mathcal}}
\DeclareRobustCommand{\mit}{\@fontswitch{\relax}{\mathnormal}}
%% end font family declarations
%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 5) Running heads and footnotes
%% Running heads ===>>>
%% unless we need these, leave these uncommented
\let\@mkboth\@gobbletwo
\let\chaptermark\@gobble
\let\sectionmark\@gobble
%%
\def\ps@headings{\def\@oddfoot{\centerline{\small --\the\c@page--}}
\let\@evenfoot\@oddfoot
%% \thejournalname set with \journalname{} command; if not you will get a request to set
%% the journal name with \journalname{}
\def\@oddhead{\vbox to 0pt{\vss\centerline{\color{ltgray}\small manuscript
submitted to {\it \thejournalname}}\vskip24pt}}
\let\@evenhead\@oddhead
}
%% After ps@headings is defined, now we use it to activate the definitions
\ps@headings
%%% Footnotes
%% save these definitions so that we can use them if
%% we don't like the redefinition
\let\savefootnote\footnote
\let\savefootnotetext\footnotetext
%%% ruled line above footnote
\renewcommand{\footnoterule}{%
\kern-3\p@
\hrule width .4\columnwidth
\kern 2.6\p@}
\let\savefootnoterule\footnoterule
% turn off footnote rule, line at bottom of page above footnotes
\let\footnoterule\relax
% can turn it back on by uncommenting
\let\footnoterule\savefootnoterule
% Making footnote indent 1em
\long\def\@makefntext#1{%
\noindent\hspace*{1em}\@makefnmark\,#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 6) Title Page:
%% Journal Name, running heads;
%% Title, Authors, Affils, Corresponding Authors, Author Notes, Key Points;
%% Starting article with abstract.
%% Set journal name:
\def\journalname#1{\def\thejournalname{#1}}
\journalname{Please set Journal Name by using {\tt\string\journalname}}
%% Article Title
\def\title#1{\global\c@footnote=0\relax%
{\centering \Large\bf #1 \vskip14pt}
\def\thetitle{#1}}
\def\authors#1{{\centering \normalsize\bf #1\vskip12pt}}
\def\affil#1{$^{#1}$\ignorespaces}
\def\affiliation#1#2{\vskip-.5\parskip\relax{\centering{\footnotesize
$^{#1}$#2\relax}\vskip-\parskip}}
\def\correspondingauthor#1#2{{\let\@thefnmark\relax\@footnotetext{\noindent\vrule
height 18pt width0pt\relax\hbox to-8pt{}{\small
Corresponding author: #1,
{\tt #2}}}}}
%% Used to send footnote to bottom of page when entered in \authors{} field.
\def\thanks#1{{\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
\long\def\@makefntext##1{\noindent\hskip-9pt\hb@xt@1.8em{%
\hss\@textsuperscript{\normalfont\@thefnmark}}##1}\footnote{#1}\
}}
\def\keypoints{\vskip24pt\vskip1sp\subsection*{Key Points:}
\begin{itemize}}
\def\endkeypoints{\end{itemize}}
\def\abstract{\newpage\noindent{\bf Abstract}\vskip-\parskip
\global\c@footnote=0\relax%
\noindent\ignorespaces}
\def\endabstract{\vskip18pt}
%% <== End Title page and Abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 7) Section Commands
% SectionCounters, Header Level Counters ===>>
%% the argument in square brackets is for the command that will reset
%% counter to zero
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
%% Header Level Counters ==>>
%% Change to any level will change the levels below
\renewcommand{\thesection} {\arabic{section}}
\renewcommand{\thesubsection} {\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\renewcommand{\theparagraph} {\thesubsubsection.\arabic{paragraph}}
\renewcommand{\thesubparagraph} {\theparagraph.\arabic{subparagraph}}
\newcommand{\@chapapp}{\chaptername}
%%% <<== End Header Level Counters
%% Definition printed here so that you can see what the various arguments are
%% when used for \section, \subsection, etc, below
%% \newcommand{\section}{\@startsection {section}{1}{\z@}...}
% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
% optional * [ALTHEADING]{HEADING}
% Generic command to start a section.
% NAME : e.g., 'subsection'
% LEVEL : a number, denoting depth of section -- e.g., chapter=1,
% section = 2, etc.
% INDENT : Indentation of heading from left margin
% BEFORESKIP : Absolute value = skip to leave above the heading.
% If negative, then paragraph indent of text following
% heading is suppressed.
% AFTERSKIP : if positive, then skip to leave below heading, else
% negative of skip to leave to right of run-in heading.
% STYLE : commands to set style
% If '*' missing, then increments the counter. If it is present, then
% there should be no [ALTHEADING] argument.
% Uses the counter 'secnumdepth' whose value is the highest section
% level that is to be numbered.
%% Startsection calls \@sect, the engine that formats each section
%% the minus dimensions are used to tell LaTeX not to indent
%% the text following the section head
%% (silly, isn't it? but built into LaTeX)
%% You can add things like underline or uppercase to the last arg
%% to get those effects in a section head
%% adds a little space after the section number, before following text.
\def\@seccntformat#1{\csname the#1\endcsname\ \ }
\newcommand\section{\@startsection {section}{1}{\z@}%
{\ifdraft18pt plus 1pt minus
1pt\else 12pt plus 1pt minus 1pt\fi}%
{1sp}%
{\bignormalsize\bfseries\boldmath}}
\newcommand\subsection{\@startsection{subsection}{2}{\parindent}%
{\ifdraft 12pt\else 8pt\fi}%
{1sp}%
{\normalfont\bf\boldmath}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}%
{\ifdraft 12pt\else 8pt\fi}%
{1sp}%
{\normalfont\itshape\bfseries}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\parindent}%
{3pt plus 1pt minus 1pt}%
{-1em}%
{\normalfont\normalsize\itshape}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3pt plus 1pt minus 1pt}%
{-1em}%
{\normalfont\normalsize\itshape}}
%%% <<=== end section commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 8) Figure and Table Captions ==>>>
\long\def\@caption#1[#2]#3{%
\par
\begingroup
\@parboxrestore
\normalsize
\linenumbers
\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
\endgroup}
\def\@float#1{%
\@ifnextchar[%
{\@xfloat{#1}}%
{\edef\reserved@a{\noexpand\@xfloat{#1}[\csname fps@#1\endcsname]}%
\reserved@a}}
\def\@dblfloat{%
\if@twocolumn\let\reserved@a\@dbflt\else\let\reserved@a\@float\fi
\reserved@a}
%% Name of Figure or Table is set with \figurename or \tablename above
%% \@float is what puts the text at the top or bottom of the page
%% \@dblfloat is for floats in two column text
\newcounter{figure}
\renewcommand{\thefigure}{\arabic{figure}}
\def\fps@figure{tbp} % position figure at top, bottom, or on its own page
\def\ftype@figure{1} % used for placing float in page
\def\ext@figure{lof} % send info to .lof file
\def\fnum@figure{\figurename~~\thefigure} % \figurename, defined above,
%% and the current state of figure counter
%% \begin{figure} calls up float and gives it the {figure} argument,
%% which is then used to call up the definitions above, by using
%% \csname fps@\captype\endcsname, for instance, to get \fps@figure;
%% adjusting the macro to do different things depending on whether
%% figure, table, environment, or other term is used.
\newenvironment{figure}
{\@float{figure}}
{\end@float}
%% figure in two column text
\newenvironment{figure*}
{\@dblfloat{figure}}
{\end@dblfloat}
%% Similar as the sequence of definitions above used for figure
\newcounter{table}
\renewcommand{\thetable}{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment{table}
{\@float{table}}
{\end@float}
\newenvironment{table*}
{\@dblfloat{table}}
{\end@dblfloat}
%%%%%%%%%%%%%%%%
%% Setting space between caption in table or figure and the
%% table or figure
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{10\p@}
%% to test in caption to see whether it is a figure or table
\def\xfigure{figure}
%% Variation on LaTeX code
%% Skips below caption
%% an extra 3pt if it is a table to give extra space between caption
%% and table, since caption for table goes above table.
%% \sbox\@tempboxa sets a temporary box so that we can measure
%% the width of the caption; if width is greater than .9\hsize
%% then make it format in a paragraph, otherwise center it.
%% Test to see if it a figure or table: \ifx\@captype\xfigure
%% If figure, \vskip\belowcaptionskip
\long\def\@makecaption#1#2{%
{\small
\ifx\@captype\xfigure
\vskip\abovecaptionskip\fi
{\ifturnofflinenums\else\ifnumlines\internallinenumbers\fi\fi
\sbox\@tempboxa{\bf#1.\quad \rm #2}%
\ifdim \wd\@tempboxa >.9\hsize
\bf #1.\quad\rm\relax #2\par
\else
{\centering
\bf #1.\rm\quad #2
\vskip1sp}
\fi}
%%
\ifx\@captype\xfigure\else
\vskip\belowcaptionskip\fi
}}
%% Code to get text in tables to extend all the way to left and right
%% of table. The LaTeX table macros are made to allow space to the
%% left and the right of tables to accomodate vertical ruled lines. But
%% most publishers don't want vertical ruled lines. If the authors
%% don't use the ruled lines there would be extra white space without
%% the changes below. This code is very complicated, but you can see
%% the changed part.
\def\xtable{table}
\def\@array[#1]#2{\setbox\@arstrutbox=\hbox{\vrule
height\arraystretch \ht\strutbox
depth\arraystretch \dp\strutbox
width\z@}\@mkpream{#2}\edef\@preamble{\halign \noexpand\@halignto
\bgroup%
\tabskip\z@\@arstrut\@preamble
\ifx\@captype\xtable\hskip-\tabcolsep\fi %% <==== Changed
\tabskip\z@ \cr}%
\let\@startpbox\@@startpbox \let\@endpbox\@@endpbox%
\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi%
\bgroup\let\par\relax%
\let\@sharp##\let\protect\relax \lineskip\z@\baselineskip\z@\@preamble}
%% Variation on code found in Latex.tex
\def\new@tabacol{\edef\@preamble{\@preamble\hskip0pt}}
\def\@tabclassz{\ifcase \@lastchclass\@acolampacol%
\or \@ampacol \or
\or \or \@addamp \or \@acolampacol\or \@firstampfalse
\ifx\@captype\xtable \new@tabacol\else\@tabacol \fi%
\fi%
\edef\@preamble{\@preamble%
\ifcase \@chnum%
\hfil\ignorespaces\@sharp\unskip\hfil%
\or \ignorespaces\@sharp\unskip\hfil%
\or \hfil\hskip\z@ \ignorespaces\@sharp\unskip\fi}}
%% This puts extra space between horizontal lines in tables.
%% If you want to use vertical lines in tables, you should use
%% \savehline rather than \hline, otherwise the vertical and
%% horizontal lines will not abutt.
%% \noalign is a command that allows the uses to put something
%% between lines in a table.
\let\savehline\hline
\def\hline{\noalign{\vskip3pt}\savehline\noalign{\vskip3pt}}
%% Simple macro for table notes, that makes sure that there is
%% a little space between the table and the notes, and that they
%% print in footnotesize.
\def\tablenotes{\vskip2pt\footnotesize}
\let\endtablenotes\relax
%%% <<=== end Figure and Table Captions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 9) Listing, ==>>
\def\@listI{\leftmargin\leftmargini
\parsep 0\p@ %\@plus2\p@ \@minus0\p@
\topsep 4\p@ %\@plus2\p@ \@minus0\p@
\itemsep1\p@ %\@plus2\p@ \@minus0\p@
}
\let\@listi\@listI
\@listi
\def\@listii {\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\topsep 4\p@ \@plus2\p@ \@minus\p@
\parsep 2\p@ \@plus\p@ \@minus\p@
\itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep 2\p@ \@plus\p@\@minus\p@
\parsep \z@
\partopsep \p@ \@plus\z@ \@minus\p@
\itemsep \topsep}
\def\@listiv {\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep}
\def\@listv {\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
%% amount left edge of text is indented relative to normal text
%% i is for first level in, ii is for second level in, etc.
\setlength\leftmargini {28pt}
\setlength\leftmarginii {11pt}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv {1.7em}
\setlength\leftmarginv {1em}
\setlength\leftmarginvi {1em}
%% default indentation for first level itemized lists
\setlength\leftmargin {\leftmargini}
%% horizontal distance between item and following text
\setlength \labelsep {6pt}
%% how wide should item be?
\setlength \labelwidth{\leftmargini}
%% subtract width of label separation
\addtolength\labelwidth{-\labelsep}
%% more listing defaults
\leftmargin\leftmargini
\labelwidth\leftmargini\advance\labelwidth-\labelsep
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
%% defining listing markers for enumerate
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{\alph{enumii}}
\renewcommand{\theenumiii}{\roman{enumiii}}
\renewcommand{\theenumiv}{\Alph{enumiv}}
%% using listing markers for enumerate
\newcommand{\labelenumi}{\theenumi.\hskip-2pt}
\newcommand{\labelenumii}{(\theenumii)}
\newcommand{\labelenumiii}{\theenumiii.}
\newcommand{\labelenumiv}{\theenumiv.}
%% crossreferencing for listing markers
\renewcommand{\p@enumii}{\theenumi}
\renewcommand{\p@enumiii}{\theenumi(\theenumii)}
\renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
%% listing markers for itemize (no crossreferencing needed)
\newcommand{\labelitemi}{\raise.4ex\hbox{\tiny$\bullet$}}
\newcommand{\labelitemii}{\normalfont\bfseries --}
\newcommand{\labelitemiii}{$\m@th\ast$}
\newcommand{\labelitemiv}{$\m@th\cdot$}
%% Setting up description listing environment
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*{\descriptionlabel}[1]{\hspace\labelsep
\normalfont\bfseries #1}
%%% <<=== end of listing commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 10) ETC.: Month/year, Hyphenation Library, Quote, Quotation, Extract
%% Month and Year
% Nice example of \ifcase which takes a counter and activates
% the slot following the counter that matches the same number;
% \month expands to a number, so ifcase will activate the slot
% matching that number. Can use it for setting date in draft
% footnote if desired. Not activated at this time.
\newcommand{\today}{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
% Hyphenation Library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Hyphenation Library, add to this
%% list if desired
\hyphenation{
dem-o-graph-ics
mi-cro-ec-o-nom-ic
or-gan-i-za-tion
or-gan-i-za-tions
ra-tion-ale
sys-tem-at-i-cal-ly
}
%%%% Quote, Quotation, Extract
%% \newenvironment produces a \begin{}..\end{} macro set.
%% \newenvironment{<name of macro>}{<definition for begin macro>}
%% {<definition for end macro>}
%% For long quotation which runs more than one paragraph,
%% uses list environment to indent text, supplies dummy
%% item, \item[], since one item is required for every listing
%% environment or you will get an error message.