forked from econ-ark/HARK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecontex.cls
More file actions
360 lines (300 loc) · 10.8 KB
/
econtex.cls
File metadata and controls
360 lines (300 loc) · 10.8 KB
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
%%% LaTeX class for economics
%%%
%%% author: Christopher Carroll
%%% license: LaTeX Project Public License
%%%
%%% Modified from style itaxpf by Arne Henningsen
%%% version: 1.0 (09 July 2007)
%%% license: LaTeX Project Public License
%%%
%%% Further information is available at
%%% http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
%%%
%%% This document class is based on the "scrartcl" class
%%% from the KOMA script bundle. For documentation, Google KOMA-Script Documentation
%%%
%%% The corresponding BibTeX style file "econtex.bst" should be used
%%% for the bibliography: \bibliographystyle{econtex}
%%%
%%% In addition to the options for scrartcl, this package includes an additional option
%%% titlepage = include a title page (with command "\maketitle", or "\maketitleWithForcedDate{}")
%%%
%%% If an abstract is defined by \begin{abstract}\end{abstract} before \maketitle is invoked,
%%% it will appear on the title page
%%%
%%% If the titlepage option is invoked:
%%% \keywords can be used to show keywords below the abstract
%%% \jelclass can be used to show JEL classifications below the abstract
%%% \thanks{text of the thank-you footnote} produces a footnote at the bottom of the page containing the text
\ProvidesClass{econtex}[2016/05/27 LaTeX class for economics papers, handouts, and exam questions written by Christopher Carroll]
\NeedsTeXFormat{LaTeX2e}
% \RequirePackage{rotating}
\RequirePackage{ifthen}
\RequirePackage{chngpage}
% If unspecified whether pdf output (instead of dvi) is being used, determine that it SHOULD be
\newif\ifdvi\dvitrue
\@ifundefined{pdfoutput}{}{\ifnum\pdfoutput>0 \dvifalse\fi}
% permit double spacing
\RequirePackage{setspace}
%\doublespacing
% option to include a title page
\newcounter{IncludeTitlePage}
\setcounter{IncludeTitlePage}{0}
\DeclareOption{titlepage}{\setcounter{IncludeTitlePage}{1}}
% pass any options on to the scrartcl class and load this class with some options
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\LoadClass[fontsize=12pt,english,numbers=noenddot,captions=tableheading,captions=nooneline]{scrartcl}
% pointlessnumbers = do not add final dot after ordinary section numbers
% tablecaptionabove = use \captionabove for captions above rather than below tables
% noonelinecaption = do not treat one-line captions differently
% use new TeX encoding scheme (T1), which contains accented (European) letters,
% to make European hyphenations work
\RequirePackage[T1]{fontenc}
% use babel package and set language to english
\RequirePackage[english]{babel}
% spacing around formulas
\AtBeginDocument{
\setlength{\abovedisplayshortskip}{6pt}
\setlength{\belowdisplayshortskip}{6pt}
\setlength{\abovedisplayskip}{6pt}
\setlength{\belowdisplayskip}{6pt}
\allowdisplaybreaks % Permits LaTeX to break long formulas across pages (?)
}
%% Added the above info to the definition of normalsize
\def\normalsize{\@setfontsize \normalsize \@xiipt {14.5}
\abovedisplayskip 6\p@ \@plus 3\p@ \@minus 3\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip 6pt \belowdisplayshortskip 6pt
\let \@listi \@listI}
\normalsize
% Don't indent the second and later lines of footnotes
\deffootnote[1em]{0.0em}{1em}{\textsuperscript{\thefootnotemark}}
% spacing around captions and floats
\setlength{\abovecaptionskip}{6pt}
\setlength{\belowcaptionskip}{3pt}
\setlength{\floatsep}{0pt}
\setlength{\textfloatsep}{20pt}
\setlength{\intextsep}{15pt}
\RequirePackage{calc}
\newenvironment{Description}
{\begin{list}{}{\let\makelabel\Descriptionlabel
\setlength\labelwidth{75pt}
\setlength\labelsep{0pt}
\setlength\leftmargin{75pt}
\setlength\itemindent{0pt}
}}
{\end{list}}
\newcommand*\Descriptionlabel[1]{\textbf{#1}\hfil}
\RequirePackage{cancel,verbatim,
amsmath,amssymb,amsfonts,amsthm
,threeparttable,dcolumn,multicol,multirow,booktabs % table environment extensions
,latexsym
,afterpage
,endnotes
,moreverb
,hhline % Allow double hlines
,tipa % Define more characters, in particular the \textthorn character
,color
}
\RequirePackage{econtex}
\RequirePackage[mathscr]{eucal}
\RequirePackage[normalem]{ulem}
\providecommand\bmmax{0} % Prevent boldmath package from using up too much memory
\RequirePackage{bm} % Allow bold math
\RequirePackage{bbm} % Blackbord math
% font for URLs
\RequirePackage{url}
\def\UrlFont{\ttfamily}
\usepackage[econtex]{optional} % Enable the control of compilation using options passed on startup
\opt{EndFloats}{\RequirePackage[noheads,nolists,tablesfirst,nomarkers]{endfloat}}
% page format, margins if PrintGeom option is invoked
\opt{PrintGeom}{
\RequirePackage{geometry}
\geometry{letterpaper, tmargin=1.4in, bmargin=1.4in, lmargin=1.25in,
rmargin=1.25in, headheight=0in, headsep=0in, footskip=0.5in }
}
\opt{JournalFormatting}{ % BEJM requires 1.5 inch margins
\RequirePackage{geometry}
\geometry{letterpaper, tmargin=1.5in, bmargin=1.5in, lmargin=1.5in,
rmargin=1.5in, headheight=0in, headsep=0in, footskip=0.5in }
}
\providecommand{\textSizeDefault}{\normalsize}
\opt{bigWide}{\renewcommand{\textSizeDefault}{\large}}
\providecommand{\abstractSizeDefault}{\small}
\opt{bigWide}{\renewcommand{\abstractSizeDefault}{\normalsize}}
%% formatting section headers
\setkomafont{section}{\normalfont \Large \bfseries}
\setkomafont{subsection}{\normalfont \large}
\setkomafont{subsubsection}{\normalfont \itshape}
% citations and bibliography
\RequirePackage[authoryear]{natbib}
\AtBeginDocument{\renewcommand{\refname}{\clearpage References}
\renewcommand\@makefnmark
{\mbox{\textsuperscript{\tiny\@thefnmark}}} % Restore footnote defn after titlepage redefines it
\ifdvi
\renewcommand{\ushort}{\underline} % ushort seems to not work properly for tex4ht (which compiles using dvi)
\fi
}
% captions of figures and tables
\setcapwidth[c]{\textwidth}
% \setcapindent*{0pt}
\setkomafont{captionlabel}{\centering \bfseries}
\setkomafont{caption}{\centering}
\renewcommand{\captionformat}{~ }
\newcommand{\forcedate}[1]{\newcommand{\@forcedate}{#1}}
% titlepage with title, author(s), and date
\renewcommand{\maketitle}{
\ifthenelse{ \isundefined\@forcedate }{
\ClassWarningNoLine{econtex}{{\protect\forcedate} is undefined in the .tex file; please define it and rerun}}{}
\ifthenelse{\equal{\theIncludeTitlePage}{1}}{
\let\footnotesize\scriptsize
\thispagestyle{empty}
\vspace*{0mm}
\enlargethispage{0.4in}
}{}
\begin{center}
\begin{LARGE}
\begin{spacing}{1.00}
\textbf{\@title}
\end{spacing}
\end{LARGE}\medskip\medskip\medskip
{\normalsize \@date \par}
{\tiny{~}\par}
\ifthenelse{\equal{\theIncludeTitlePage}{1}}{
\vspace*{3mm}
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
}{}
\end{center}
}
\newcommand{\maketitleWithForcedDate}[1]{
\ClassWarningNoLine{econtex}{\protect\maketitleWithForcedDate{} is deprecated. To set a date different from the current one, just use the \protect\date{(string desired to signify paper date)}}
\ifthenelse{\equal{\theIncludeTitlePage}{1}}{
\let\footnotesize\scriptsize
\thispagestyle{empty}
\vspace*{0mm}
\enlargethispage{0.4in}
}{}
\begin{center}
\begin{LARGE}
\begin{spacing}{1.00}
\textbf{\@title}
\end{spacing}
\end{LARGE}\medskip\medskip\medskip
{\normalsize #1 \par}
{\tiny{~}\par}
\ifthenelse{\equal{\theIncludeTitlePage}{1}}{
\vspace*{3mm}
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
}{}
\end{center}
}
% abstract, keywords, JEL classification
\newcommand{\keywords}[1]{\newcommand{\@keywords}{#1}}
\newcommand{\jelclass}[1]{\newcommand{\@jelclass}{#1}}
\newcommand{\aspublished}[1]{\newcommand{\@aspublished}{#1}}
\renewenvironment{abstract}{%
\begin{spacing}{0.9}
\noindent {\tiny \phantom{.}} \\ % Trick to get proper spacing in html
\noindent \hrule height 0.4pt depth 0.0pt width \textwidth \relax
\vspace*{4mm}
\abstractSizeDefault
\noindent \textbf{Abstract}\\
\indent
}{%
\noindent {\tiny \phantom{.}} \\ % Trick to get proper spacing in html
\noindent \hrule height 0.4pt depth 0.0pt width \textwidth \relax
\vspace*{0mm}
\ifthenelse{ \isundefined\@keywords }{
\ClassWarningNoLine{econtex}{No keywords specified.
Please use the command \protect\keywords}
}{
}
\end{spacing}
\begin{quote}
\begin{Description}
\item[\textbf{Keywords~}] \@keywords
\ifthenelse{ \isundefined\@jelclass }{
\ClassWarningNoLine{econtex}{No JEL classification specified.
Please use the command \protect\jelclass}
}{
\item[\textbf{JEL codes~}] \@jelclass
}
\end{Description}
\ifthenelse{ \isundefined\@aspublished }{
}{
{
\vspace{0.1in}\@aspublished}
}\end{quote}
}
\setcounter{footnote}{0}%
\medskip
% avoid clubs and widows
\clubpenalty=1000 % penalty for breaking a page with only one sentence; set to 10000 to prohibit
\widowpenalty=10000
% \displaywidowpenalty=10000
\hbadness 3000 % LaTeX default is 1000, which is too finicky - set to 10000 to get rid of complaints
% increase stretchability of the spaces (avoid overfull hboxes)
\setlength{\emergencystretch}{3em}
\pagestyle{plain}
\thispagestyle{empty}
\newcommand{\titlepagefinish}{\newpage
\renewcommand\@makefnmark
{\mbox{\textsuperscript{\tiny\@thefnmark}}}
}
\RequirePackage[multiple]{footmisc}
\RequirePackage{manyfoot,perpage}
\DefineFNsymbols{blank}[text]{{} {} {} {} {}}
\setfnsymbol{blank}
\DeclareNewFootnote{B}[fnsymbol]
\MakePerPage{footnoteB}
\renewcommand{\thanks}{\footnoteB}
\newcommand{\thanksFooter}{\footnoteB}
\hfuzz2pt % Don't bother to report over-full boxes if over-edge is < 2pt
%%%%%%%%%% Added by Amy Hendrickson, TeXnology Inc.
%% Amy change, Feb 28, 2011 ==>>
%%% Generalization of the author and authorinfo commands, based on
%%% the original code.
%% Sample use:
%% \author{Christopher D. Carroll\authNum \\
%% \and
%% Jiri Slacalek\authNum \\
%% \and
%% Martin Sommer\authNum \\
%% \and
%% Another Name\authNum
%% \and
%% Still Another Name\authNum
%% }
\newcounter{authornum} % Use either \num or (preferred) \authNum to denote authors
\def\num{\global\advance\c@authornum by 1\textsuperscript{\tiny \the\c@authornum}}
\def\authNum{\global\advance\c@authornum by 1\textsuperscript{\tiny \the\c@authornum}}
%% \begin{authorsinfo}...\end{authorsinfo}
%% Now used:
%% \begin{authorsinfo}
%% \name{First author: info}
%% \\
%% \name{Second author: info}
%% \\
%% \name{Third author: info}
%% (and so on for as many authors
%% as you have)
%% \end{authorsinfo}
%% (note: the \\ doesn't do anything, but makes it easier to
%% see the separate author names.)
\newcounter{bottomauthor}
\def\authorsinfo{\global\c@bottomauthor=0\setbox0=\vbox\bgroup\footnotesize
\let\\ \relax
}
\def\endauthorsinfo{\egroup
\footnoteB{\unvbox0}
}
\def\name#1{\global\advance\c@bottomauthor by 1\textsuperscript{\tiny \the\c@bottomauthor}{#1}{~~~~}}