-
Notifications
You must be signed in to change notification settings - Fork 5
/
docswitch.sty
195 lines (171 loc) · 4.83 KB
/
docswitch.sty
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
% {% raw %}
% This file provides the functionality for switching between journals.
% \setjournal{<journalname>}
%
% Class names:
% revtex
% aastex
% emulateapj
% mnras
% lsstdescnote
%
% Journal names:
% apj (aastex61)
% apjl (emulateapj)
% prl (revtex)
% prd (revtex)
% mnras (mnras)
% tex (lsstdescnote)
%
% Alex Drlica-Wagner <[email protected]>
%
\RequirePackage{etoolbox}
\newtoggle{revtex}
\newtoggle{aastex}
\newtoggle{aastex61}
\newtoggle{mnras}
\newtoggle{emulateapj}
\newtoggle{lsstdescnote}
\newtoggle{default}
\newcommand{\toggle@class}[1]{%
% Initialize the toggles
\togglefalse{revtex}
\togglefalse{aastex}
\togglefalse{aastex61}
\togglefalse{mnras}
\togglefalse{emulateapj}
% Journals that map to revtex
\ifdefstring{#1}{revtex}{\toggletrue{revtex}}{}%
\ifdefstring{#1}{prl}{\toggletrue{revtex}}{}%
\ifdefstring{#1}{prd}{\toggletrue{revtex}}{}%
% Journals that map to aastex
\ifdefstring{#1}{aastex}{\toggletrue{aastex}}{}%
% Journals that map to aastex61
\ifdefstring{#1}{aastex61}{\toggletrue{aastex61}}{}%
\ifdefstring{#1}{apjl}{\toggletrue{aastex61}}{}%
\ifdefstring{#1}{apj}{\toggletrue{aastex61}}{}%
% Journals that map to emulateapj
\ifdefstring{#1}{emulateapj}{\toggletrue{emulateapj}}{}%
% Journals that map to mnras
\ifdefstring{#1}{mnras}{\toggletrue{mnras}}{}%
% Journals that map to lsstdescnote
\ifdefstring{#1}{lsstdescnote}{\toggletrue{lsstdescnote}}{}%
\ifdefstring{#1}{tex}{\toggletrue{lsstdescnote}}{}%
% Set default journal
\ifdefempty{#1}{\toggletrue{revtex}}{}%
}
\newcommand{\setjournal}[1]{
\toggle@class{#1}
% Set up some default values (revtex):
%\providecommand\docopts{aps,prl,reprint,superscriptaddress,
% floatfix,nofootinbib,showkeys,showpacs}
\providecommand\docopts{}
\providecommand\docclass{revtex4-1}
\providecommand\docmacros{aps_macros}
\providecommand\doctitle{
\input{\authlist}
\date{\today}
\maketitle
}
\providecommand\maketitlepre{}
\providecommand\maketitlepost{\doctitle}
\providecommand\dockeys{\keywords}
\ifdef{\authlist}{}{
\providecommand\authlist{authors}
}
\providecommand\tabletype{table}
\providecommand\hypopts{all}
\providecommand\bibsty{apsrev4-1}
\providecommand\linenums{}
% Set the values for lsstdescnote
\iftoggle{lsstdescnote}{
\renewcommand\docopts{modern}
\renewcommand\docclass{lsstdescnote}
\renewcommand\docmacros{aas_macros}
\renewcommand\doctitle{
\input{\authlist}
\maketitle
}
\renewcommand\tabletype{deluxetable}
\renewcommand\bibsty{apj}
}{}
% Journals derived from revtex
\iftoggle{revtex}{
\renewcommand\docopts{aps,prl,reprint,superscriptaddress,
floatfix,nofootinbib,showkeys,showpacs}
\renewcommand\docclass{revtex4-1}
\renewcommand\docmacros{aps_macros}
\renewcommand\doctitle{
\input{\authlist}
\date{\today}
\maketitle
}
\renewcommand\tabletype{table}
\renewcommand\bibsty{apsrev4-1}
% Use the defaults for PRL
\ifdefstring{#1}{prl}{
\renewcommand\docopts{aps,prl,reprint,superscriptaddress,
floatfix,nofootinbib,showkeys,showpacs}
}{}
% Set the values for PRD
\ifdefstring{#1}{prd}{
\renewcommand\docopts{aps,prd,preprint,superscriptaddress,
floatfix,nofootinbib,showkeys}
}{}
}{}
% Set the values for emulateapj
\iftoggle{emulateapj}{
\renewcommand\docopts{iop,revtex4-1}
\renewcommand\docclass{emulateapj}
\renewcommand\docmacros{aas_macros}
\renewcommand\doctitle{
\input{\authlist}
\maketitle
}
\renewcommand\hypopts{figure,figure*}
\renewcommand\tabletype{deluxetable*}
\renewcommand\bibsty{apj}
}{}
% Set the values for aastex
\iftoggle{aastex}{
\renewcommand\docopts{preprint}
\renewcommand\docclass{aastex}
\renewcommand\docmacros{aas_macros}
\renewcommand\doctitle{
\input{\authlist}
\maketitle
}
\renewcommand\tabletype{deluxetable}
\renewcommand\bibsty{apj}
}{}
% Set values for aastex61
\iftoggle{aastex61}{
\renewcommand\docopts{twocolumn}
\renewcommand\docclass{aastex61}
\renewcommand\docmacros{aas_macros}
\renewcommand\doctitle{
\input{\authlist}
}
\renewcommand\tabletype{deluxetable}
\renewcommand\bibsty{apj}
% Set the values for ApJ
\ifdefstring{#1}{apj}{
\renewcommand\docopts{twocolumn}
}{}
% Set the values for ApJL
\ifdefstring{#1}{apjl}{
\renewcommand\docopts{twocolumn,tighten}
}{}
}{}
% Set the values for MNRAS
\iftoggle{mnras}{
\renewcommand\docopts{a4paper,fleqn,usenatbib}
\renewcommand\docclass{mnras}
\renewcommand\docmacros{aas_macros}
\renewcommand\dockeys[1]{\begin{keywords}{##1}\end{keywords}}
\renewcommand\bibsty{mnras}
\renewcommand\maketitlepre{\doctitle}
\renewcommand\maketitlepost{}
}{}
}
% {% endraw %}