-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemulateapj_2008.cls
1691 lines (1523 loc) · 55.6 KB
/
emulateapj_2008.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
%% This is emulateapj.cls, version April 20, 2008
%% For the latest version check http://hea-www.harvard.edu/~alexey/emulateapj
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright 2000-2008 Alexey Vikhlinin
%%
%% The first version of this package was written by Maxim Markevitch.
%% Pieces of AASTeX code are used for compatibility with aastex.cls.
%%
%% This program can be redistributed and/or modified under the terms of
%% the LaTeX Project Public License available from CTAN archives in
%% macros/latex/base/lppl.txt. This means you are free to use and
%% distribute this package; however, if you modify anything, please
%% change the file name and remove the author's email address.
%%
%% Alexey Vikhlinin <[email protected]>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% `emulateapj' is a LaTeX2e class to emulate the Astrophysical Journal
%% (ApJ) page layout. The page length of the resulting document is very
%% close to that in ApJ when Times fonts are used instead of the LaTeX
%% default CM fonts.
%%
%% If a manuscript is prepared for ApJ submission using the standard
%% American Astronomical Society LaTeX macros and the `aastex' style
%% (see instructions for authors on the ApJ web site), the only thing
%% required from the user should be to replace \documentclass{aastex}
%% with \documentclass{emulateapj}, and perhaps resize figures as
%% desired and replace {deluxetable} with {deluxetable*}. Possible minor
%% problems are described below.
%%
%% emulateapj requires revtex4.cls. If you don't have it already, it can be
%% downloaded from http://publish.aps.org/revtex4/ (it's a small package).
%% Other extrnal packages used are latexsym, graphicx, amssymb, longtable,
%% epsf. They should already be present in the modern TeX distributions; if
%% not, download them from www.ctan.org.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Release notes (02/09/03):
%%
%% 1) This is a complete rewrite of emulateapj. The package is now
%% based on revtex instead of aastex + multicol.
%%
%% 2) The {deluxetable} environment is re-implemented (the problem with the
%% the aastex's deluxetable is it does not float). There is also a new
%% environment {deluxetable*} (absent in aastex) to set a floating table
%% two-column wide. Known problems:
%% (a) \rotate doesn't work (too difficult to implement). Solution:
%% - load package lscape (\usepackage{lscape} in the header)
%% - move table at the end of the paper after references
%% - \clearpage before the table
%% - \LongTables if the table will span more than 1 page (see next item)
%% - put the table inside the landscape environment and \clearpage
%% at the end:
%% \clearpage
%% \LongTables % optionally
%% \begin{landscape}
%% \begin{deluxetable}
%% ....
%% \end{deluxetable}
%% \clearpage
%% \end{landscape}
%%
%% 3) Multi-page tables cannot be set properly inside the main text; you
%% need to move the table to the end of the paper (after the references) and
%% issue the command \LongTables before it.
%%
%% 4) By default, deluxetables are typeset with \footnotesize. If you want
%% to use a different size, use, e.g., \tabletypesize{\normalsize} _outside_
%% the deluxetable environment. If you need to increase interline spacing
%% in the tables, use \def\arraystretch{1.XXX} also _outside_ deluxetables.
%%
%% 5) Option `onecolumn' (as in \documentclass[onecolumn]{emulateapj})
%% sets the whole paper (except the reference section) in one column
%% as done by the ApJ for papers with long equations.
%%
%% 6) Options `apj' and `apjl' (\documentclass[apj]{emulateapj}) change the
%% spacing of the references (the default is ApJL wide spacing), and
%% also the spacing between figures and text (last check with printed
%% Journal in 4/2005).
%%
%% 7) By default, appendix subsections are not numbered:
%% APPENDIX
%% Derivation of Equations
%% If you want them numbered (`A. Derivation of Equations'), use the option
%% \documentclass[numberedappendix]{emulateapj}
%%
%% It is recommended to use the {appendix} environment instead of the
%% \appendix command. Equation (and optionally also table and figure)
%% counters are reset within the {appendix} to something like A1,A2,B1
%% etc. The counters are restored at \end{appendix} because sometimes we
%% want to place figures and tables belonging to the main matter at the
%% end of the paper.
%%
%% 8) By default, the comment in the upper-left corner of the title page and
%% under the abstract will say "Draft version \today". There are additional
%% commands \journalinfo{} and \submitted{} (the latter is equivalent to the
%% aastex \slugcomment{} which also works) to change those comments. Used
%% alone, \submitted{} will act on both those places.
%%
%% 9) The \title command sets the entire title, including math, in upper
%% case. If this is undesirable, use \lowercase{} macro, e.g.,
%% \title{UPPER CASE OK HERE \lowercase{$a+b=c$}}.
%%
%% 10) On the last page where the references or appendix start, there
%% may be problems with placement of footnotes. There is a command
%% \lastpagefoot notes which can be issued somewhere before those
%% footnotes. It will result in the remaining footnotes set together at
%% the end of the text, properly adjusted.
%%
%% 11) There may be problems with single-column figure placements on the
%% last page; try moving the figure around or explicitly specifying the [t]
%% placement. There may also be minor column misalignments on
%% complicated pages with footnotes, sections, etc.; these are too difficult
%% to fix.
%%
%% 12) Any footnotes in the paper title should be set as
%% \title{Title\footnotemark[1]} \footnotetext[1]{text} (with foootnotetext
%% outside the title), rather that simply a \footnote{}.
%%
%% NOTE that if you use the footnote in the title, the footnote counter for
%% the main text will be wrong. You need to reset it manually _after_ the
%% first \section. For example, if the frontmatter footnotes (title +
%% affiliations) stop at 3, you need \setcounter{footnote}{3}
%%
%% 13) \label's within the deluxetable environments should go INSIDE the
%% \tablecaption{...} command or after \tablehead
%%
%% 14) ... if, however, you use \tablenum [not recommended], \label should
%% go IMMEDIATELY AFTER the \tablenum command
%%
%% 15) Marc Audard reports that if the bibliography is exactly finishing the
%% page, and the next page should be a table, latex is not working. If an
%% empty character (\mbox{~}) is added after (or before) the bibliography,
%% i.e., starting a new page, the problem disappears.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Change Log
%%
%% 2/14/3: fixed several bugs in deluxetable and footnotes inside the title.
%%
%% 3/3/3: Table caption is made in two lines. works only in {table} or
%% {table*}, but not in {deluxetable}
%%
%% 3/3/3: Redefine p@subsection etc. for ApJ-style cross-references.
%%
%% 3/16/3: Define \tablerefs
%%
%% 3/25/3: Fix two-column references in the onecolumn mode (see
%% \set@column@hsize{2})
%%
%% 4/9/3: Change the definition of \tablenotemark. It is less general but
%% works in the table caption. Also, put the body of deluxetable*
%% inside a minipage to fix table footnotes.
%%
%% 5/14/3: Change section title font sizes. They are now different for 'apj'
%% and 'apjl' options
%%
%% 7/8/3: redefine NAT@sort@cites after loding revtex4 to prevent citations
%% from being sorted
%%
%% 7/15/3: Fix \and in the author list
%%
%% 7/17/3: Make \colhead to center column titles by default
%%
%% 7/27/3: Redefile \@biblabel to remove the numbered list from thebibliography
%%
%% 9/08/3: Further fixes to cutinhead: define @ptabularcr and use LT@cols
%%
%% 10/08/3: Copy definitions for \anchor and \url from aastex.
%%
%% 10/10/3: define \paragraph, \subparagraph. suppress section numbering
%% below \subsection. If you want subsubsections numbered, use
%% \setcounter{secnumdepth}{3}
%% in the header
%%
%% 11/13/3: add 'unsortedaddress' option to revtex4 to prevent groupin the
%% authors by the institute
%%
%% 11/26/3: define \def\blankaffiliation{~} after revtex4 to prevent \and's
%% from combining
%%
%% 2/10/4: implement \tablewidth; works as documented in aastex;
%% change format for caption of deluxetables from Table 1. Title to
%% Table 1.
%% Title
%% Make table notes of the same width as the table.
%% Fix tabletypesize for table notes
%%
%% 2/12/4: fix \tablewidth: \tablewidth{0pt} gives natural size (as does no
%% \tablewidth at all)
%% Remove dot after "Table 1."
%% Also change format to Table 1--- Continued
%%
%% 2/19/4: implement \tablenum within deluxetable; abstract paragraphs
%% indented;
%%
%% 3/19/4: if no \tablehead is given, \startdata still prints out the caption
%%
%% 4/2/4: remove a spurious space from the definition of \tablehead
%%
%% 4/12/4: Due to popular demand, define \tablecomments and \tablerefs for
%% ordinary {table}s.
%%
%% 6/6/4: Proper implementation of \sidehead in the deluxetable
%%
%% 6/21/4: Fix issues with table heading which were introduced when I tried
%% to implement deluxetable's _without_ any heading.
%%
%% 6/22/4: correct implementation of \tablenotetext in the \LongTable mode
%% (they previously generated plain footnotes at the end of the table)
%%
%% 9/21/4: fix bug fix figure and table numbers in the appendicies
%%
%% 10/8/4: add \object \facility \dataset from aastex
%%
%% 11/26/4: Change floats-to-text distance to 5mm in ApJLetter style and
%% 7mm in ApJ style (verified with Journal version in Dec 2004)
%%
%% 4/21/5: change \renewcommand{\dbltopfraction}{0.85}; add
%% \renewcommand{\dblfloatpagefraction}{0.85}
%% \setcounter{topnumber}{9}
%% \setcounter{bottomnumber}{9}
%% \setcounter{totalnumber}{20}
%% \setcounter{dbltopnumber}{9}
%%
%% 11/27/5: Add parameters to fine-tune spacing to deluxetables:
%% \abovedeluxetableskip % = 0 by default
%% \belowdeluxetableskip % = 0
%%
%% Use these to fiddle with the spacing, e.g.
%% \setlength{\abovetableskipamount}{-1\baselineskip}
%%
%% 12/14/5: no more explicit setting of tabcolsep inside deluxetables (so
%% the user has control over this parameter)
%%
%% 05/04/6: redefine \tableline as \hrule; otherwise it weirdly interact
%% with my implementation of deluxetable
%%
%% 08/13/6: Collect altaffiltext into token and issue \altaffiliation
%% only once. This overcomes the problem with 2**n processing
%% time for long affiliation lists.
%%
%% 08/29/6: fix a problem with alignment of last row in deluxetables
%%
%% 09/06/6: Change code of tablenotetext in all deluxetables (otherwise
%% the change introduced on 6/22/4 sometimes causes the notes to
%% disappear)
%%
%% 09/19/6: Correct propagation of the [apj] and [apjl] for subsection
%% formatting
%%
%% 09/19/6: Appendix no longer changes the numbering for figure and
%% unless the [appendixfloats] option is selected
%%
%% 09/22/6 Fix a bug with last row in deluxetables after \LongTables
%%
%% 10/04/6 redefine tablenotetext again because hyperref incompatibly
%% changes the definition of \footnotetext
%%
%% 10/04/6 Fix spacing before thebilbiography and refereneces
%% (\vspace*->\vspace)
%%
%% 12/01/6 Add \par to the definition of \tablenotetext (to make sure
%% each note is in a separate block)
%%
%% 02/7/07 By popular demand, \tablenotetext is reintroduced in the
%% regular {table} environments. BEWARE: the use of this
%% feature makes your documents non-portable as \tablenotetext
%% is not a part of standard LaTeX
%%
%% 03/7/07 Misc. fixes to \lastpagefootnotes
%%
%% 04/21/07 introduce \affil@mark to facilitate integration with the
%% MinionPro package; slightly change the spacing in the
%% altaffiltext mark
%%
%% 03/31/08 new option [tighten] to facilitate grid typesetting (by
%% setting negative lineskiplimit etc). Correspondingly increase
%% v-spacing at \enddata in the tables
%%
%% 04/15/08 improve table@note@skip (put it inside spew@tblnotes)
%%
%% 04/17/08 set baselinestretch to 1
%%
%% 04/20/08 Fix above and below display skips (too much of negative stretch
%% was possible)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\emulapj@ver{04/20/08}
\ProvidesClass{emulateapj}
\newif\if@two@col
\DeclareOption{twocolumn}{\@two@coltrue}
\DeclareOption{onecolumn}{\@two@colfalse}
\newlength{\bibbaselineskip}\setlength{\bibbaselineskip}{3.075mm}
\newif\if@apj@letter
\DeclareOption{apj}{
\setlength{\bibbaselineskip}{2.7mm}
\def\apjsecfont{\normalsize}
\def\secnum@size{\small}
\def\subsecnum@size{\normalsize}
\@apj@letterfalse
}
\DeclareOption{apjl}{
\setlength{\bibbaselineskip}{3.075mm}
\def\apjsecfont{\footnotesize}
\def\secnum@size{\small}
\def\subsecnum@size{\small}
\@apj@lettertrue
}
\DeclareOption{tighten}{
% lineskiplimits to facilitate grid typesetting
\lineskiplimit=-2mm
}
\def\AppendixApjSectionMarkInTitle#1{\relax}
\DeclareOption{numberedappendix}{
\def\AppendixApjSectionMarkInTitle#1{#1.\ }
}
\newif\if@number@appendix@floats\@number@appendix@floatsfalse
\DeclareOption{appendixfloats}{
\@number@appendix@floatstrue
}
\def\center@table@notes{%
\def\@spew@tblnotes{%
\centerline{\begin{minipage}{\pt@width}\spew@tblnotes\end{minipage}}%
}%
}
\def\left@just@table@notes{%
\def\@spew@tblnotes{\spew@tblnotes}%
}
\left@just@table@notes
\ExecuteOptions{apjl,twocolumn}
\ProcessOptions
\let\@startsection@from@latex=\@startsection
\if@two@col
\LoadClass[twocolumn,nofootinbib,showkeys,twoside,floatfix,unsortedaddress]{revtex4}
\else
\LoadClass[nofootinbib,showkeys,twoside,floatfix,unsortedaddress]{revtex4}
\fi
\def\blankaffiliation{~}%
% Restore natbib package without sorting.
\def\NAT@sort{0}
\def\NAT@sort@cites#1{\edef\NAT@cite@list{#1}}
\RequirePackage{latexsym}%
\RequirePackage{graphicx}%
\RequirePackage{amssymb}%
\RequirePackage{longtable}%
\newcommand{\bibstyle@aas}{\bibpunct{(}{)}{;}{a}{}{,}}%
\@citestyle{aas}%
\let\@startsection=\@startsection@from@latex
\def\baselinestretch{1.0}
\AtBeginDocument{\def\arraystretch{1.0}}
\RequirePackage{epsf,graphicx}
%%%%%%%% The following code is taken from size10.clo; it fixes
%%%%%%%% aastex's definition of type sizes
\renewcommand\normalsize{%
\@setfontsize\normalsize\@xpt{10.56}
\abovedisplayskip 2.2mm \@plus2\p@ \@minus1\p@
\abovedisplayshortskip \z@ \@plus3\p@
\belowdisplayshortskip 2.2mm \@plus2\p@ \@minus1\p@
\belowdisplayskip \abovedisplayskip
\let\@listi\@listI}
\normalsize
\renewcommand\small{%
\@setfontsize\small\@ixpt{9.68}%
\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
}
\renewcommand\footnotesize{%
\@setfontsize\footnotesize\@viiipt{8.36}%
\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
}
\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
\renewcommand\large{\@setfontsize\large\@xiipt{14}}
\renewcommand\Large{\@setfontsize\Large\@xivpt{18}}
\renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
\renewcommand\huge{\@setfontsize\huge\@xxpt{25}}
\renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
\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@}
\setlength\headheight{12\p@}
\def\@listi{\leftmargin\leftmargini
\parsep 4\p@ \@plus2\p@ \@minus\p@
\topsep 8\p@ \@plus2\p@ \@minus4\p@
\itemsep4\p@ \@plus2\p@ \@minus\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}
% ****************************************************
% * TWO AND SINGLE ONE COLUMN STYLES: AV *
% ****************************************************
%
%%%%% include atbeginend.sty by AV:
% Copy \begin and \end to \BeginEnvironment and \EndEnvironment
\let\BeginEnvironment=\begin
\let\EndEnvironment=\end
%% \ifundefined from TeXbook
\def\IfUnDef#1{\expandafter\ifx\csname#1\endcsname\relax}
% Null command needed to eat its argument
\def\NullCom#1{}
\def\begin#1{%
% if defined \BeforeBeg for this environment, execute it
\IfUnDef{BeforeBeg#1}\else\csname BeforeBeg#1\endcsname\fi%
\IfUnDef{AfterBeg#1}% This is done to skip the command for environments
% which can take arguments, like multicols; YOU MUST NOT
% USE \AfterBegin{...}{...} for such environments!
\let\SaveBegEnd=\BeginEnvironment%
\else
% Start this environment
\BeginEnvironment{#1}%
% and execute code after \begin{environment}
\csname AfterBeg#1\endcsname
\let\SaveBegEnd=\NullCom
\fi
\SaveBegEnd{#1}
}
\def\end#1{%
% execute code before \end{environment}
\IfUnDef{BeforeEnd#1}\else\csname BeforeEnd#1\endcsname\fi%
% close this environment
\EndEnvironment{#1}
% and execute code after \begin{environment}
\IfUnDef{AfterEnd#1}\else\csname AfterEnd#1\endcsname\fi%
}
\long\def\BeforeBegin#1#2{\expandafter\gdef\csname BeforeBeg#1\endcsname {#2}}
\long\def\BeforeEnd #1#2{\expandafter\gdef\csname BeforeEnd#1\endcsname {#2}}
\long\def\AfterBegin #1#2{\expandafter\gdef\csname AfterBeg#1\endcsname {#2}}
\long\def\AfterEnd #1#2{\expandafter\gdef\csname AfterEnd#1\endcsname{#2}}
%%%% end of atbeginend.sty
% ****************************************
% * PAGE LAYOUT *
% ****************************************
% Page size, spacing parameters, etc.
\textwidth=7.1in
\columnsep=0.3125in
\parindent=0.125in
\voffset=-20mm
\hoffset=-7.5mm
\topmargin=0in
\headheight=.15in
\headsep=0.5in
\oddsidemargin=0in
\evensidemargin=0in
\parskip=0cm
%\tolerance=600 % 3x "normal" value; cuts down on overfull complaints
%% AV,MM, to have 64 lines per column, with textheight 25cm:
\textheight=64\baselineskip
\textheight=\baselinestretch\textheight
\ifdim\textheight>25.2cm\textheight=25.0cm\fi
\topskip\baselineskip
\maxdepth\baselineskip
\let\tighten=\relax
\let\tightenlines=\tighten
\let\singlespace=\relax
\let\doublespace=\relax
\def\eqsecnum{
\@newctr{equation}[section]
\def\theequation{\hbox{\normalsize\arabic{section}-\arabic{equation}}}}
%% running heads:
\def\lefthead#1{\gdef\@versohead{#1}} \lefthead{\relax}
\def\righthead#1{\gdef\@rectohead{#1}} \righthead{\relax}
\let\shorttitle=\lefthead % New AASTEX commands
\let\shortauthors\righthead % New AASTEX commands
%% MM Create "apjheads" page style:
\def\ps@apjheads{\let\@mkboth\markboth
\def\@evenfoot{}
\def\@evenhead{\lower9mm\hbox to\textwidth{
\rm\thepage\hfil \rm\@rectohead \hfil}}}
\def\@oddfoot{}
\def\@oddhead{\lower9mm\hbox to\textwidth{
\hfil\rm\@versohead\hfil \rm\thepage}}
\@twosidetrue
\ps@apjheads
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TITLE PAGE %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\long\def\frontmatter@title@above{
\vspace*{-\headsep}\vspace*{\headheight}
\footnotesize
{\footnotesize\textsc{\@journalinfo}}\par
{\scriptsize Preprint typeset using \LaTeX\ style emulateapj v.\
\emulapj@ver}\par\vspace*{-\baselineskip}\vspace*{0.625in}
}%
\def\frontmatter@title@produce{%
\begingroup
\frontmatter@title@above
\frontmatter@title@format
\@title
\@ifx{\@title@aux\@title@aux@cleared}{}{%
\expandafter\frontmatter@footnote\expandafter{\@title@aux}%
}%
\par
%% \class@warn{Unused short title ignored}%
\frontmatter@title@below
\endgroup
}%
\renewcommand\title[2][]{%
\def\@title{\uppercase{#2}}%
\def\@shorttitle{#1}%
\let\@AF@join\@title@join
}%
\def\frontmatter@title@format{\normalsize\centering}
\def\frontmatter@title@below{\vspace*{-2.63\baselineskip\vspace*{0.25in}}}%
\def\frontmatter@above@affilgroup{\vspace*{0.25in}}%
\def\frontmatter@authorformat{\small\scshape\centering}%
\def\frontmatter@affiliationfont{\normalfont\footnotesize}%
\def\frontmatter@finalspace{\vspace*{-\baselineskip}\vspace*{0.375in}}
\def\@separator{\\}%
\def\frontmatter@footnote#1{%
\begingroup
\@booleanfalse\temp@sw
\def\@tempa{#1}%
\let\@tempb\@empty
\def\@TBN@opr{\y@match\@tempa}%
\@FMN@list
\temp@sw{%
\expandafter\frontmatter@footnotemark
\expandafter{\@tempb}%
}{%
\def\@thefnmark{\relax}
\frontmatter@footnotetext{#1}
}%
\endgroup
}%
\newcounter{front@matter@foot@note}\setcounter{front@matter@foot@note}{0}
\def\frontmatter@above@affiliation{\vspace*{0.5mm}}%
\renewcommand\affiliation[1]{%
\move@AU\move@AF%
\begingroup%
\@affiliation{\hspace*{2mm}#1}%
}%
\let\affil=\affiliation
\def\affil@mark#1{\textsuperscript{#1}}
\def\affile@mark@pad{0.2em}
\def\altaffilmark#1{\affil@mark{#1}}
% Fight poor revtex algorithm for altaffiliation:
\def\@alt@affil@kill@next@symbol#1{\relax}
\newtoks\alt@affil@toks \alt@affil@toks{\@alt@affil@kill@next@symbol}
\newtoks\alt@affil@toks@count \alt@affil@toks@count{}
\def\altaffiltext#1#2{%
\global\alt@affil@toks\expandafter{\the\alt@affil@toks\\\hspace*{3mm}\affil@mark{#1}\hspace*{\affile@mark@pad}#2}%
\global\alt@affil@toks@count\expandafter{\the\alt@affil@toks@count\stepcounter{front@matter@foot@note}}%
}
\let\@author@finish@revtex=\@author@finish
\def\@author@finish{%
\if!\the\alt@affil@toks@count!%
\relax
\else
\altaffiliation{\the\alt@affil@toks}\the\alt@affil@toks@count
\fi
\@author@finish@revtex
}
%\def\altaffiltext#1#2{\altaffiliation{\hspace*{3mm}\textsuperscript{#1}\hspace*{0.7mm}#2}\stepcounter{front@matter@foot@note}}
%% end altaffiliation
\let\old@foot@note@mark=\footnotemark
\let\old@foot@note@text=\footnotetext
\def\footnotemark[#1]{\altaffilmark{#1}}
\def\footnotetext[#1]#2{\altaffiltext{#1}{#2}}
% ABSTRACT
\def\frontmatter@abstractfont{\normalsize\parindent=0.125in}%
\def\frontmatter@abstractwidth{6in}
\def\frontmatter@preabstractspace{0.0\baselineskip}
\def\frontmatter@postabstractspace{0.0\baselineskip}
\def\abstractname{ABSTRACT}
\long\def\frontmatter@abstractheading{%
\vspace*{-\baselineskip}\vspace*{1.5pt}
\centerline{\itshape\footnotesize\@submitted}
\vspace*{0.13189in}
\begingroup
\centering
\abstractname
\vskip 1mm
\par
\endgroup
\everypar{\rightskip=0.5in\leftskip=\rightskip}\par
}%
% Redefine the LaTeX \and command for this style.
\def\and{\author{\vspace*{-0.2in}and\vspace*{-0.558cm}}\noaffiliation}
\def\@listand{\@ifnum{\@tempcnta=\tw@}{\andname\space}{}}%
% ****************************************
% * KEYWORDS *
% ****************************************
\def\@keys@name{\textit{Subject headings:}\/~\mbox{}}%
\newlength{\keys@width}
\def\frontmatter@keys@format{\vspace*{0.5mm}%
\settowidth{\keys@width}{\normalsize\@keys@name}%
\rightskip=0.5in\leftskip=\rightskip\parindent=0pt%
\hangindent=\keys@width\hangafter=1\normalsize}%
\def\@keywords@produce#1{%
\showKEYS@sw{%
\begingroup%
\frontmatter@keys@format%
\@keys@name#1\par
\endgroup
}{%
\@if@empty{#1}{}{%
\class@warn{If you want your keywords to appear in your output, use document class option showkeys}%
}%
}%
}%
\let\subjectheadings=\keywords
% ****************************************
% * FOOTNOTES *
% ****************************************
% Modify code from revtex:
\def\@xfootnotemark@ltx[#1]{%
\begingroup
% \csname c@\@mpfn\endcsname #1\relax
\unrestored@protected@xdef\@thefnmark{#1}%
\endgroup
\H@@footnotemark
}%
% Modify code from LaTeX to fix footnotes:
\def\@xfootnotenext[#1]{%
\begingroup
% \csname c@\@mpfn\endcsname #1\relax
\unrestored@protected@xdef\@thefnmark{#1}%
\endgroup
\@footnotetext}
% Footnotes on the last page: user issues \lastpagefootnotes. It catches all
% footnotes and issues them before \begin{refernces} or
% \begin{\thebibliography} or \begin{appendix}, whichever comes first,
% at the end of right column.
\newcounter{lastfootnote}
\let\orig@footnote=\footnote
%
\def\spit@out@footnotes@{\addtocounter{footnote}{-\c@lastfootnote}\vspace*{-\baselineskip}\vspace*{\skip\footins}\bgroup\footnotesize\lastfootnote\par\egroup\let\footnote=\orig@footnote}
%
\let\spit@out@footnotes\relax
%
\long\def\lastpagefootnotes{%
\setcounter{lastfootnote}{0}
\long\gdef\lastfootnote{\mbox{}}
\let\spit@out@footnotes\spit@out@footnotes@
\long\def\footnote##1{\refstepcounter{lastfootnote}\footnotemark\g@addto@macro\lastfootnote{\\[\footnotesep]\refstepcounter{footnote}\mbox{}\hspace*{3mm}\textsuperscript{\thefootnote}~##1}}
\BeforeBegin{appendix}{\spit@out@footnotes\let\spit@out@footnotes\relax}
\BeforeBegin{references}{\spit@out@footnotes\let\spit@out@footnotes\relax}
\BeforeBegin{thebibliography}{\spit@out@footnotes\let\spit@out@footnotes\relax}
% in case \lastpagefootnotes were given inside \begin{appendix}\end{appendix},
\BeforeEnd{appendix}{\spit@out@footnotes\let\spit@out@footnotes\relax}
\AfterEnd{appendix}{\let\footnote=\orig@footnote}
\AfterEnd{references}{\let\footnote=\orig@footnote}
\AfterEnd{thebibliography}{\let\footnote=\orig@footnote}
}
\let\lastpagefootnote=\lastpagefootnotes
% this command is copied from the original revtex, but adds space above
% footnote (if any) above the references.
\@namedef{balance@2}{%
\expandafter\balance@two\csname col@1\endcsname\@outputbox
% Avoid a bug by preventing a restore when leaving this group
\global\setbox\csname col@1\endcsname\box\csname col@1\endcsname
\@ifvoid\footbox{}{%
\global\setbox\footbox\vbox{%
\setbox\z@\box\@tempboxa
\let\recover@footins\relax
\balance@two\footbox\@tempboxa
\vskip\skip\footins
\hb@xt@\textwidth{\box\footbox\hfil\box\@tempboxa}%
}%
}%
}%
\skip\footins 4.5mm plus 1mm minus 1mm
\footnotesep 0pt
\let\footnoterule\relax
\def\@makefntext#1{\mbox{}\hspace*{3mm}\@makefnmark~#1}
\def\notetoeditor#1{}% % We do not need notes to editor in the preprint
\def\placetable#1{}% % We do not need notes to editor in the preprint
\def\placefigure#1{}% % We do not need notes to editor in the preprint
% ****************************************
% * SECTIONS *
% ****************************************
\setcounter{secnumdepth}{3}
\newif\if@firstsection \@firstsectiontrue
\def\section{%
\if@firstsection\@firstsectionfalse
\maketitle\setcounter{footnote}{\thefront@matter@foot@note}
\let\footnotetext=\old@foot@note@text
\let\footnotemark=\old@foot@note@mark
\fi
\@startsection{section}{1}{\z@}{9pt plus 2pt minus 1pt}{4pt}{\apjsecfont\center}}
\def\subsection{\@startsection{subsection}{2}{\z@}{9pt plus 1pt minus 1pt}{4pt}%
{\normalsize\itshape \center}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{2ex plus 1ex minus .2ex}{1ex plus .2ex}{\small\itshape \center}}
\def\paragraph{\@startsection{paragraph}{4}{\z@}%
{1.5ex plus 1ex minus .2ex}{-0.5\parindent}{\small\it}}
\def\subparagraph{\@startsection{subparagraph}{5}{\z@}%
{1ex plus 1ex minus .2ex}{-0.5\parindent}{\small\it}}
\def\thesection{\@arabic{\c@section}}
\def\thesubsection{\thesection.\@arabic{\c@subsection}}
\def\thesubsubsection{\thesubsection.\@arabic{\c@subsubsection}}
\def\theparagraph{\thesubsubsection.\@arabic{\c@paragraph}}
\def\p@section {}
\def\p@subsection {}
\def\p@subsubsection {}
\def\p@paragraph {}
\def\p@subparagraph {}
\def\sec@upcase#1{\uppercase{#1}}
\def\subsec@upcase#1{\relax{#1}}
%
% How the section number will appear in the section title - AV
\def\ApjSectionMarkInTitle#1{#1.\ }
\def\ApjSectionpenalty{0}
\def\@sect#1#2#3#4#5#6[#7]#8%
{\@tempskipa #5\relax
\ifdim \@tempskipa >\z@ \begingroup
#6\relax
\ifnum #2>\c@secnumdepth \def \@svsec {}\else
\refstepcounter{#1} \edef \@svsec {\ApjSectionMarkInTitle
{\csname the#1\endcsname}}\fi
\@hangfrom {\hskip #3\relax
\ifnum #2=1{\secnum@size {\rm\@svsec~}}%
\else {\subsecnum@size {\rm\@svsec~}}\fi }%
{\interlinepenalty \@M
\ifnum #2=1\sec@upcase{#8}%
\else \subsec@upcase{#8}\fi\par}\endgroup
\csname #1mark\endcsname {#7}\addcontentsline{toc}{#1}%
{\ifnum #2>\c@secnumdepth \else \protect \numberline
{\csname the#1\endcsname }\fi #7}%
\else
\ifnum #2>\c@secnumdepth \def \@svsec {}\else
\refstepcounter{#1} \edef \@svsec {\ApjSectionMarkInTitle
{\csname the#1\endcsname}}\fi
\def \@svsechd {#6\hskip #3%
\ifnum #2=1{\secnum@size{\rm\@svsec~}}\else{\subsecnum@size{\rm\@svsec~}}\fi%
\ifnum #2=1\sec@upcase{#8}\else\subsec@upcase{#8}\fi%
\ifnum #2=4\hskip 0.4ex{\rm ---}\fi%
\csname #1mark\endcsname {#7}\addcontentsline{toc}{#1}%
{\ifnum #2>\c@secnumdepth \else \protect \numberline {\csname
the#1\endcsname }\fi #7}}\fi \@xsect {#5} \penalty \ApjSectionpenalty
%-refstepcounter is now within a group. So \@currentlabel, which is normally
%-set by \refstepcounter is hidden within a group. Need to set it manually.
\protected@edef\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}
}
\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
\ifdim \@tempskipa>\z@
\begingroup #4\@hangfrom{\hskip #1}{\interlinepenalty \@M
\sec@upcase{#5}\par}\endgroup
\else \def\@svsechd{#4\hskip #1\relax \sec@upcase{#5}}\fi
\@xsect{#3}
% MM:
\penalty \ApjSectionpenalty}
\def\acknowledgments{\vskip 5.8mm plus 1mm minus 1mm}
\let\acknowledgements=\acknowledgments % second spelling
% ****************************************
% * APPENDIX *
% ****************************************
\newcounter{remember@figure@num}
\newcounter{remember@table@num}
\renewenvironment{appendix}[0]{
\onecolumngrid
\vskip 10pt plus 2pt minus 1pt
\noindent\mbox{}\hfill{\apjsecfont APPENDIX}\hfill\mbox{}\par
\nopagebreak\medskip\@nobreaktrue\def\ApjSectionpenalty{\@M}
\@firstsectionfalse
\setcounter{section}{0}
\setcounter{subsection}{0}
\setcounter{equation}{0}
\setcounter{remember@figure@num}{\c@figure}
\setcounter{remember@table@num}{\c@table}
% \def\fnum@figure{Figure \Alph{section}\thefigure:}
% \def\fnum@table{Table \Alph{section}\thetable:}
\def\thesection{\Alph{section}}
\def\theequation{\hbox{\Alph{section}\arabic{equation}}}
\if@number@appendix@floats
\setcounter{figure}{0}
\setcounter{table}{0}
\def\thefigure{\thesection\@arabic\c@figure}
\def\thetable{\thesection\@arabic\c@table}
\fi
%
% Do not use appendix numbers in the titles
\def\ApjSectionMarkInTitle{\AppendixApjSectionMarkInTitle}
\def\section{\setcounter{equation}{0}\if@number@appendix@floats\setcounter{figure}{0}\setcounter{table}{0}\fi\@startsection {section}{1}{\z@}
{10pt}{5pt}{\centering\scshape\apjsecfont}}
%
%
}{%
\if@number@appendix@floats
\setcounter{figure}{\c@remember@figure@num}%
\setcounter{table}{\c@remember@table@num}%
\fi
}
% ****************************************
% * BIBLIOGRAPHY *
% ****************************************
\renewenvironment{references}[0]{
\onecolumngrid
\par
\vspace{10pt plus 3pt}
\noindent \makebox[\textwidth][c]{\small\scshape REFERENCES}
\par
\vspace*{4pt plus 3pt}
\set@column@hsize{2}\twocolumngrid
\parindent=0cm \parskip=0cm
\def\baselinestretch{1.0}
\footnotesize \baselineskip=\baselinestretch\bibbaselineskip plus 1pt
minus 1pt \interlinepenalty \@M
\hyphenpenalty=10000
\frenchspacing % AV - to get right spacing after ``et al.''
\def\refpar{\par\hangindent=1.2em\hangafter=1}}
{
\onecolumngrid
}
% redefine thebibliography
% redefine thebibliography
% remove numbers from the reference list
\def\@biblabel#1{\relax}
\newdimen\bibindent
\renewenvironment{thebibliography}[1]{
\onecolumngrid
\par
\raggedright
\vspace{10pt plus 3pt}
\noindent \makebox[\textwidth][c]{\footnotesize REFERENCES}
\par
\vspace*{4pt plus 3pt}
\set@column@hsize{2}\twocolumngrid
\list{}%
{
\parindent=0pt \parskip=0pt \parsep=0pt % AV
\bibindent=0pt %
\def\baselinestretch{1.0}
\footnotesize \baselineskip=\bibbaselineskip \interlinepenalty \@M % AV
\frenchspacing % AV - to get right spacing after ``et al.''
\hyphenpenalty=10000
\itemindent=-1.0em %
\itemsep=0pt %
\listparindent=0pt %
\settowidth\labelwidth{0pt} %
\labelsep=0pt %
\leftmargin=1.0em
\advance\leftmargin\labelsep
%%% \usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\relax}}%
\sloppy\clubpenalty4000\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
\onecolumngrid
}
% %% AV:
\def\reference{\@ifnextchar\bgroup {\@reference}
{\@latexerr{Missing key on reference command}
{Each reference command should have a key corresponding to a markcite somewhere in the text}}}
\def\@reference#1{\refpar}
%% subtitle header and journal info:
\def\submitted#1{\gdef\@submitted{#1}}
\def\journalinfo#1{\gdef\@journalinfo{#1}}
\def\subtitle{
\vspace*{-12mm}
\noindent
{\scriptsize {\sc \@journalinfo} \\
Preprint typeset using \LaTeX\ style emulateapj v.\ \emulapj@ver}
}