-
Notifications
You must be signed in to change notification settings - Fork 8
/
gsajnl.cls
333 lines (290 loc) · 10 KB
/
gsajnl.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
% This class file is provided for authors submitting to the
% Genetics Society of America's GENETICS Journal
%
% Version: 1.9, 2019/12/10
%
% Produced by Overleaf (www.overleaf.com)
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{gsajnl}[2019/12/10, v1.9]
\AtEndOfClass{\RequirePackage{microtype}}
% Options for element switching
\RequirePackage{xifthen}
\newboolean{displaycopyright}
\newboolean{displaylineno}
\setboolean{displaylineno}{false}
\DeclareOption{lineno}{\setboolean{displaylineno}{true}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
\ProcessOptions*
\LoadClass{extarticle}
% April 16, 2016:
% Line numbers
% v1.8 April 12, 2018: make sure line numbers are
% displayed in outer margins of columns; so
% remove "running" option somehow gets it right
\RequirePackage[switch,pagewise]{lineno}
% Fonts and language
\RequirePackage[utf8]{inputenc}
\RequirePackage[english]{babel}
\RequirePackage{amsmath,amsfonts,amssymb}
\RequirePackage{mathpazo}
\RequirePackage[scaled]{helvet}
\RequirePackage[T1]{fontenc}
\RequirePackage{url}
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
\RequirePackage{lettrine}
\newcommand{\watermarkfont}{\color{black50}\normalfont\fontsize{10}{12}\selectfont}
\newcommand{\headerfont}{\color{color2}\normalfont\sffamily\bfseries\fontsize{10}{12}\selectfont}
\newcommand{\titlefont}{\normalfont\sffamily\bfseries\fontsize{21}{23}\selectfont}
\newcommand{\datesfont}{\normalfont\sffamily\itshape\fontsize{8}{10}\selectfont}
\renewcommand\UrlFont{\color{color1}\sffamily}
\newcommand{\absfont}{\normalfont\sffamily\linespread{1.2}\fontsize{10}{12}\selectfont}
\newcommand{\keywordsfont}{\normalfont\sffamily\linespread{1.2}\fontsize{8}{10}\selectfont}
\newcommand{\copyrightfont}{\normalfont\sffamily\fontsize{7}{9}\selectfont}
\RequirePackage{datetime}
\newdateformat{monthyeardate}{%
\monthname[\THEMONTH] \THEYEAR}
\RequirePackage{enumitem}
\setlist[itemize]{noitemsep}
% Author and affiliation
\RequirePackage{authblk}
\setlength{\affilsep}{0.1em}
\renewcommand\Authfont{\color{color0}\normalfont\sffamily\bfseries\fontsize{9}{13}\selectfont}
\renewcommand\Affilfont{\color{color0}\normalfont\sffamily\fontsize{8}{10}\selectfont}
% \makeatletter
\renewcommand\AB@affilsepx{, \protect\Affilfont}
% \makeatother
\renewcommand\Authands{ and }
% Choose article type
\newcommand*{\articletype}[1]{%
\RequirePackage{styles/#1}}
% Copyright statement
\RequirePackage{textcomp} % For copyright symbol styling
\newcommand{\copyrightstatement}{Copyright \, \textcopyright\, \the\year{} by the Genetics Society of America}
% v1.6: Remove copyright statement from PDF
\AtBeginDocument{\setboolean{displaycopyright}{false}}
% Graphics, tables and other formatting
\RequirePackage{graphicx,xcolor}
\RequirePackage{colortbl}
\RequirePackage{booktabs}
\RequirePackage{tikz}
\RequirePackage{algorithm}
\RequirePackage[noend]{algpseudocode}
\RequirePackage{changepage}
\RequirePackage[left=48pt,%
right=42pt,%
top=48pt,%
bottom=60pt,%
headheight=15pt,%
headsep=10pt,%
letterpaper,twoside]{geometry}%
\RequirePackage[labelfont={bf,sf},%
labelsep=space,%
figurename=Figure,%
singlelinecheck=off,%
justification=RaggedRight]{caption}
\setlength{\columnsep}{24pt} % Distance between the two columns of text
\setlength{\parindent}{12pt} % Paragraph indent
% Set document color scheme
\definecolor{black50}{gray}{0.5} % 50% black for hrules
\definecolor{color0}{RGB}{0,0,0} % Base color
\definecolor{color1}{RGB}{59,90,198} % unused
% color2 defined by the specific article type style file
% Bibliography
\usepackage{natbib} \bibpunct{(}{)}{;}{author-year}{}{,}
\bibliographystyle{genetics}
\addto{\captionsenglish}{\renewcommand{\refname}{Literature Cited}}
\setlength{\bibsep}{0.0pt}
% Table style
\arrayrulecolor{color0} % Set the color of the horizontal rules
\renewcommand{\arraystretch}{1.5} % Increased line spacing
\captionsetup[table]{position=below} % Reduce spacing below caption
% Algorithm style
% \makeatletter
\newcommand\fs@coloruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@coloruled
\def\@fs@pre{\kern2pt}%
\def\@fs@post{\kern2pt{\color{color2}\hrule}\relax}%
\def\@fs@mid{\kern2pt{\color{color2}\hrule}\kern2pt}%
\let\@fs@iftopcapt\iftrue}
% \makeatother
\floatstyle{coloruled}
\restylefloat{algorithm}
% Headers and footers
\RequirePackage{fancyhdr} % custom headers/footers
\RequirePackage{lastpage} % Number of pages in the document
\pagestyle{fancy} % Enables the custom headers/footers
\fancypagestyle{firststyle}{
% \fancyhead[R]{{\watermarkfont GENETICS |} \headerfont \articletypename}
% v1.6: Remove volume and month information
% \fancyfoot[R]{\footnotesize Genetics, Vol. XXX, XXXX–XXXX \hspace{1em} \monthyeardate\today \hspace{2em} \thepage\ }
% \fancyfoot[R]{\footnotesize Genetics\hspace{2em}\thepage}
}
% Headers
\fancyhead[LO,RE,LE,RO]{} % Blank headers for non-title pages.
% Footers
\lfoot{}
\cfoot{}
\rfoot{}
% \makeatletter
\fancyfoot[LE]{\thepage\ \hspace{2em} \@runningauthor \hspace{0.2em}}
\fancyfoot[RO]{\@runningtitle \hspace{2em} \thepage\ }
% \makeatother
\fancyfoot[LO,RE]{}
\renewcommand{\headrulewidth}{0pt}% % No header rule
\renewcommand{\footrulewidth}{0pt}% % No footer rule
%% 13 July 2016: make sure sections are unnumbered
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{0}
% Section/subsection/paragraph set-up
\RequirePackage[explicit]{titlesec}
\renewcommand{\thesubsection}{\Alph{subsection}}
\titleformat{\section}
{\large\sffamily\bfseries}
{\thesection.}
{0.5em}
{#1}
[]
\titleformat{name=\section,numberless}
{\large\sffamily\bfseries}
{}
{0em}
{#1}
[]
\titleformat{\subsection}
{\sffamily\bfseries\itshape}
{\thesubsection.}
{0.5em}
{#1}
[]
\titleformat{\subsubsection}[runin]
{\sffamily\bfseries\itshape}
{\thesubsubsection.}
{0.5em}
{#1}
[]
\titleformat{\paragraph}[runin]
{\sffamily\small\bfseries}
{}
{0em}
{#1}
\titlespacing*{\section}{0pc}{3ex \@plus4pt \@minus3pt}{5pt}
\titlespacing*{\subsection}{0pc}{2.5ex \@plus3pt \@minus2pt}{2pt}
\titlespacing*{\subsubsection}{0pc}{2ex \@plus2.5pt \@minus1.5pt}{2pt}
\titlespacing*{\paragraph}{0pc}{1.5ex \@plus2pt \@minus1pt}{12pt}
% Article meta data additional fields
\newcommand{\runningauthor}[1]{\def\@runningauthor{#1}}
%% Backward compatibility
\newcommand{\correspondingauthor}[1]{\runningauthor{#1}}
\newcommand{\keywords}[1]{\def\@keywords{#1}}
\newcommand{\runningtitle}[1]{\def\@runningtitle{#1}}
\newcommand{\keywordname}{KEYWORDS} % Defines the keywords heading name
% Colored margin box
\newcommand{\marginmark}{
\begin{textblock}{2}(200,9.5)
% \begin{tikzpicture}
% \fill[color=color2] (0,0) rectangle (1.2,0.25);
% \end{tikzpicture}
\end{textblock}
}
\def\xabstract{abstract}
\long\def\abstract#1\end#2{\def\two{#2}\ifx\two\xabstract
\long\gdef\theabstract{\ignorespaces#1}
\def\go{\end{abstract}}\else
\typeout{^^J^^J PLEASE DO NOT USE ANY \string\begin\space \string\end^^J
COMMANDS WITHIN ABSTRACT^^J^^J}#1\end{#2}
\gdef\theabstract{\vskip12pt BADLY FORMED ABSTRACT: PLEASE DO
NOT USE {\tt\string\begin...\string\end} COMMANDS WITHIN
THE ABSTRACT\vskip12pt}\let\go\relax\fi
\go}
% Set environment for abstract content and styling
\newcommand{\abscontent}{
\noindent
{%
\parbox{\dimexpr\linewidth}{%
%% v1.8: turn on line numbers
\ifthenelse{\boolean{displaylineno}}{\internallinenumbers}{}%
{\absfont\bfseries ABSTRACT} \absfont \theabstract
}%
\vskip10pt%
\noindent
\parbox{\dimexpr\linewidth-2\fboxsep\relax}{%
%% v1.8: turn on line numbers
\ifthenelse{\boolean{displaylineno}}{\internallinenumbers}{}%
{\keywordsfont\bfseries\keywordname}\hspace*{0.1em} \keywordsfont \@keywords%
}%
}%
}%
% Custom title page
\renewcommand{\@maketitle}{\bgroup\setlength{\parindent}{0pt}
\begin{flushright}
{%
\vskip76pt%
{\raggedleft \titlefont \@title\par}%
\vskip11pt
{\raggedleft \@author\par}
\vskip51pt%
}%
\end{flushright}\egroup
{%
{\color{black50}\rule{\linewidth}{0.5pt}}
\vskip12pt%
\abscontent
}%
\vskip25pt%
}%
% Other packages
\RequirePackage{enumitem} % For reducing bullet list item separation
\RequirePackage{tabularx}
\RequirePackage[flushmargin,ragged]{footmisc}
\newlength{\myFootnoteWidth}%
\newlength{\myFootnoteLabel}%
\setlength{\myFootnoteLabel}{0.5em}
\renewcommand{\@makefntext}[1]{%
\setlength{\myFootnoteWidth}{\columnwidth}%
\addtolength{\myFootnoteWidth}{-\myFootnoteLabel}%
\noindent\makebox[\myFootnoteLabel][r]{\@makefnmark\ }%
\parbox[t]{\myFootnoteWidth}{#1}
}
% Commands to set the footnote for the front page.
\renewcommand{\footnoterule}{%
\kern -3pt
{\color{black50} \hrule width \columnwidth height 0.5pt}
\kern 2.5pt
}
\newcommand{\@authfootnote}[2]{%
\begingroup
\setlength{\myFootnoteLabel}{0em}
\renewcommand\thefootnote{}\footnote{\footnotelayout\copyrightfont\textsuperscript{#1}#2}%
\endgroup%
}
\newcommand\blfootnote[1]{%
\@authfootnote{}{#1}%
% \begingroup
% \setlength{\myFootnoteLabel}{0em}
% \renewcommand\thefootnote{}\footnote{#1}%
% \addtocounter{footnote}{-1}%
% \addtocounter{Hfootnote}{-1}%
% \endgroup%
}
\newcommand\correspondingauthoraffiliation[2]{%
\@authfootnote{#1}{#2}%
% \begingroup
% \setlength{\myFootnoteLabel}{0em}
% \renewcommand\thefootnote{}\footnote{\footnotelayout\copyrightfont\textsuperscript{1}#1}%
% \endgroup
%% v1.8: turn on line numbers after this
\ifthenelse{\boolean{displaylineno}}{\par\linenumbers}{}
}
\newcommand{\equalcontrib}[1]{\@authfootnote{#1}{These authors contributed equally to this work.}}
\newcommand{\firstpagefootnote}{\blfootnote{\copyrightfont \ifthenelse{\boolean{displaycopyright}}{\copyrightstatement}{}\\%
% doi: 10.1534/genetics.XXX.XXXXXX \\%
Manuscript compiled: \today%
}}
\newenvironment{tableminipage}[1]{\begin{minipage}{#1}\renewcommand\footnoterule{ \kern -1ex}%
\setlength{\myFootnoteLabel}{0.5em}%
}{\end{minipage}}
% Package to enable absolute positioning of figures
\RequirePackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\textblockorigin{0mm}{0mm} % start everything near the top-left corner