pnas-new.cls 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % pnas-new.cls, v1.2, 2016/02/28
  3. %
  4. % This class file enables authors to prepare research
  5. % articles for submission to PNAS.
  6. %
  7. % Please note that whilst this template provides a
  8. % preview of the typeset manuscript for submission, it
  9. % will not necessarily be the final publication layout.
  10. %
  11. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  12. % This work may be distributed and/or modified under the
  13. % conditions of the LaTeX Project Public License, either
  14. % version 1.3 of this license or any later version.
  15. % The latest version of this license is in
  16. % http://www.latex-project.org/lppl.txt and
  17. % version 1.3 or later is part of all distributions
  18. % of LaTeX version 2005/12/01 or later.
  19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  20. %
  21. % For use with latex+dvipdfm, pdflatex, xelatex & lualatex
  22. % For compiling with plain latex, please use latex+dvipdfm
  23. % to produce the PDF, not dvis -> ps -> pdf nor dvipdf
  24. %
  25. \NeedsTeXFormat{LaTeX2e}
  26. \ProvidesClass{pnas-new}[28/02/2015, v1.2]
  27. \AtEndOfClass{\RequirePackage{microtype}}
  28. % Option for line numbers
  29. \newif\if@pnaslineno
  30. \DeclareOption{lineno}{\@pnaslinenotrue}
  31. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{extarticle}}
  32. \ProcessOptions*
  33. \LoadClass{extarticle}
  34. %% Fonts and language
  35. \RequirePackage[utf8]{inputenc}
  36. \RequirePackage[english]{babel}
  37. \RequirePackage{amsmath,amsfonts,amssymb}
  38. \RequirePackage{lmodern}
  39. \RequirePackage[scaled]{helvet}
  40. \RequirePackage[T1]{fontenc}
  41. \RequirePackage{lettrine} % For dropped capitals
  42. %% For the Significance Statement & footnote on the first page
  43. \RequirePackage{afterpage}
  44. \RequirePackage{ifpdf,ifxetex}
  45. \ifpdf\else
  46. \ifxetex\else
  47. \def\pgfsysdriver{pgfsys-dvipdfm.def}
  48. \pdfpagewidth=\paperwidth
  49. \pdfpageheight=\paperheight
  50. \fi\fi
  51. \RequirePackage{xcolor}
  52. \RequirePackage{tikz}
  53. \RequirePackage[framemethod=tikz]{mdframed}
  54. %% For single column equations and balancing the columns on final page
  55. \RequirePackage{widetext}
  56. %% Hyperlinking
  57. \RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
  58. %% Set up main title page fonts
  59. \newcommand{\headerfont}{\normalfont\sffamily\fontsize{7}{9} \selectfont}
  60. \newcommand{\footerfont}{\normalfont\sffamily\fontsize{7}{9} \selectfont}
  61. \newcommand{\titlefont}{\fontfamily{lmss}\bfseries\fontsize{22pt}{24pt}\selectfont}
  62. \newcommand{\dropcapfont}{\fontfamily{lmss}\bfseries\fontsize{26pt}{28pt}\selectfont}
  63. \newcommand{\datesfont}{\normalfont\sffamily\fontsize{7}{8}\selectfont}
  64. \newcommand{\absfont}{\normalfont\sffamily\bfseries\fontsize{8}{11}\selectfont}
  65. \newcommand{\keywordsfont}{\normalfont\rmfamily\fontsize{7}{10}\selectfont}
  66. \newcommand{\copyrightfont}{\normalfont\rmfamily\fontsize{6}{8}\selectfont}
  67. %% Set URL link color & font
  68. \renewcommand\UrlFont{\color{black}\sffamily}
  69. %% Author and affiliation
  70. \RequirePackage{authblk}
  71. \setlength{\affilsep}{8.5pt} % 16.5pts between base of author line and base of affil line
  72. \renewcommand\Authfont{\color{color0}\normalfont\sffamily\bfseries\fontsize{9}{11}\selectfont}
  73. \renewcommand\Affilfont{\color{color0}\normalfont\sffamily\fontsize{7}{8}\selectfont}
  74. \makeatletter
  75. \renewcommand\AB@affilsepx{; \protect\Affilfont}
  76. \makeatother
  77. \renewcommand\Authands{, and }
  78. %% Choose template type
  79. \newcommand*{\templatetype}[1]{%
  80. \RequirePackage{#1}}
  81. %% Options for element switching
  82. \RequirePackage{xifthen}
  83. \newboolean{shortarticle}
  84. \newboolean{singlecolumn}
  85. %% For numbering just one line of an equation
  86. \newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
  87. %% Watermark
  88. \usepackage[printwatermark]{xwatermark}
  89. \newboolean{displaywatermark}
  90. \setboolean{displaywatermark}{true} % Set to false to remove the watermark
  91. \ifthenelse{\boolean{displaywatermark}}{%
  92. \newwatermark[allpages,color=gray!20,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}}{}
  93. %% Copyright statement (not used)
  94. \newboolean{displaycopyright}
  95. \setboolean{displaycopyright}{false} % Confirmed as not required
  96. \RequirePackage{textcomp} % For copyright symbol styling
  97. \newcommand{\copyrightstatement}{\, \textcopyright\, 2015 by The National Academy of Sciences of the USA}
  98. %% Graphics, tables and other formatting
  99. \RequirePackage{graphicx,xcolor}
  100. \RequirePackage{colortbl}
  101. \RequirePackage{booktabs}
  102. \RequirePackage{algorithm}
  103. \RequirePackage[noend]{algpseudocode}
  104. \RequirePackage{changepage}
  105. \RequirePackage[twoside,%
  106. letterpaper,includeheadfoot,%
  107. layoutsize={8.125in,10.875in},%
  108. layouthoffset=0.1875in,%
  109. layoutvoffset=0.0625in,%
  110. left=38.5pt,%
  111. right=43pt,%
  112. top=43pt,% 10pt provided by headsep
  113. bottom=32pt,%
  114. headheight=0pt,% No Header
  115. headsep=10pt,%
  116. footskip=25pt]{geometry}
  117. \RequirePackage[labelfont={bf,sf},%
  118. labelsep=period,%
  119. figurename=Fig.]{caption}
  120. \setlength{\columnsep}{13.5pt} % Distance between the two columns of text
  121. \setlength{\parindent}{12pt} % Paragraph indent
  122. %% Set document color scheme
  123. \definecolor{black50}{gray}{0.5} % 50% black for hrules
  124. \definecolor{color0}{RGB}{0,0,0} % Base
  125. \definecolor{color1}{RGB}{59,90,198} % author email, doi
  126. \definecolor{color2}{RGB}{16,131,16} %
  127. % For sig statement box
  128. \definecolor{pnasbluetext}{RGB}{0,101,165} %
  129. \definecolor{pnasblueback}{RGB}{205,217,235} %
  130. %\definecolor{pnasbluetext}{RGB}{0,115,209} % Not used
  131. %\definecolor{pnasblueback}{RGB}{210,230,247} % Not used
  132. %% Bibliography
  133. \RequirePackage[numbers,sort&compress]{natbib}
  134. \setlength{\bibsep}{0.0pt}
  135. \bibliographystyle{pnas2011}
  136. \renewcommand{\bibsection}{} % Remove header
  137. \renewcommand\bibfont{\normalfont\sffamily\fontsize{6}{8}\selectfont} % set font to be sans serif
  138. \makeatletter
  139. \renewcommand\@biblabel[1]{ #1.} % Remove brackets from label
  140. \def\tagform@#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}}
  141. \renewcommand{\eqref}[1]{\textup{{\normalfont Eq.~(\ref{#1}}\normalfont)}}
  142. \makeatother
  143. %% Figure caption style
  144. \DeclareCaptionFormat{pnasformat}{\normalfont\sffamily\fontsize{7}{9}\selectfont#1#2#3}
  145. \captionsetup{format=pnasformat}
  146. %% Table style
  147. \RequirePackage{etoolbox}
  148. \captionsetup[table]{labelfont+={small},textfont+={small,sf,bf},skip=10pt,position=above}
  149. % booktabs provide nice spacing, but rule widths and distances need fixing
  150. \setlength{\heavyrulewidth}{0.5pt}
  151. \setlength{\lightrulewidth}{0.5pt}
  152. \setlength{\aboverulesep}{1.5pt}
  153. \setlength{\belowrulesep}{1.5pt}
  154. \setlength{\belowbottomsep}{10pt}
  155. \AtBeginEnvironment{tabular}{
  156. \sffamily\fontsize{7.5}{10}\selectfont
  157. }
  158. \newcommand{\addtabletext}[1]{{\setlength{\leftskip}{9pt}\fontsize{7}{9}\selectfont#1}}
  159. %% Equation numbering - use square brackets
  160. \makeatletter
  161. \renewcommand\tagform@[1]{\maketag@@@ {[\ignorespaces #1\unskip \@@italiccorr ]}}
  162. \makeatother
  163. %% Headers and footers
  164. \RequirePackage{fancyhdr} % custom headers/footers
  165. \RequirePackage{lastpage} % Number of pages in the document
  166. \pagestyle{fancy} % Enables the custom headers/footers
  167. %% For the line numbers overlay
  168. \def\leftlinenos{%
  169. \pgfmathtruncatemacro{\leftstartlineno}{2*(\thepage - 1)*62 + 1}%
  170. \pgfmathtruncatemacro{\leftendlineno}{(2*(\thepage - 1) + 1)*62}%
  171. \foreach \x in {\leftstartlineno,...,\leftendlineno}{\noindent\x\\}%
  172. }
  173. \def\rightlinenos{%
  174. \pgfmathtruncatemacro{\rightstartlineno}{(2*(\thepage - 1) + 1)*62 + 1}%
  175. \pgfmathtruncatemacro{\rightendlineno}{(2*\thepage)*62}%
  176. \foreach \x in {\rightstartlineno,...,\rightendlineno}{\noindent\x\\}%
  177. }
  178. \makeatletter
  179. \fancypagestyle{firststyle}{
  180. \fancyfoot[R]{\footerfont PNAS\hspace{7pt}|\hspace{7pt}\textbf{\today}\hspace{7pt}|\hspace{7pt}vol. XXX\hspace{7pt}|\hspace{7pt}no. XX\hspace{7pt}|\hspace{7pt}\textbf{\thepage\textendash\pageref{LastPage}}}
  181. \fancyfoot[L]{\footerfont\@ifundefined{@doi}{}{\@doi}}
  182. }
  183. \makeatother
  184. % Headers
  185. \fancyhead[LE,RO]{}
  186. \fancyhead[LO,RE]{}
  187. % Footers
  188. \lfoot{}%
  189. \cfoot{}%
  190. \rfoot{}%
  191. \makeatletter
  192. \fancyfoot[LE]{\footerfont\textbf{\thepage}\hspace{7pt}|\hspace{7pt}\@ifundefined{@doi}{}{\@doi}}
  193. \fancyfoot[RO]{\footerfont PNAS\hspace{7pt}|\hspace{7pt}\textbf{\today}\hspace{7pt}|\hspace{7pt}vol. XXX\hspace{7pt}|\hspace{7pt}no. XX\hspace{7pt}|\hspace{7pt}\textbf{\thepage}}
  194. \fancyfoot[RE,LO]{\footerfont\@ifundefined{@leadauthor}{}{\@leadauthor}\ifnum \value{authors} > 1\hspace{5pt}\textit{et al.}\fi}
  195. % Use footer routine for line numbers
  196. \AtBeginDocument{
  197. \if@pnaslineno
  198. \ifthenelse{\boolean{singlecolumn}}{
  199. % use lineno package if singlecolumn
  200. \RequirePackage{lineno}
  201. \linenumbers
  202. }{% use tikz if twocolumn
  203. \fancyfoot[C]{\begin{tikzpicture}[remember picture,overlay]
  204. \node at([xshift=1.5em,yshift=\dimexpr -0.0625in-53pt] current page.north west)[anchor=north west,text width=3em,font=\rmfamily,align=right] {\leftlinenos};%
  205. \node at([xshift=-1.5em,yshift=\dimexpr -0.0625in-53pt] current page.north east)[anchor=north east,text width=3em,font=\rmfamily,align=left] {\rightlinenos};%
  206. \end{tikzpicture}}
  207. }
  208. \fi
  209. }
  210. \makeatother
  211. \renewcommand{\headrulewidth}{0pt}% % No header rule
  212. \renewcommand{\footrulewidth}{0pt}% % No footer rule
  213. %% Section/subsection/paragraph set-up
  214. \RequirePackage[explicit]{titlesec}
  215. \renewcommand{\thesubsection}{\Alph{subsection}}
  216. \titleformat{\section}
  217. {\large\sffamily\bfseries}
  218. {\thesection.}
  219. {0.5em}
  220. {#1}
  221. []
  222. \titleformat{name=\section,numberless}
  223. {\large\sffamily\bfseries}
  224. {}
  225. {0em}
  226. {#1}
  227. []
  228. \titleformat{\subsection}[runin]
  229. {\sffamily\bfseries}
  230. {\thesubsection.}
  231. {0.5em}
  232. {#1. }
  233. []
  234. \titleformat{\subsubsection}[runin]
  235. {\sffamily\small\bfseries\itshape}
  236. {\thesubsubsection.}
  237. {0.5em}
  238. {#1. }
  239. []
  240. \titleformat{\paragraph}[runin]
  241. {\sffamily\small\bfseries}
  242. {}
  243. {0em}
  244. {#1}
  245. \titlespacing*{\section}{0pc}{3ex \@plus4pt \@minus3pt}{5pt}
  246. \titlespacing*{\subsection}{0pc}{2.5ex \@plus3pt \@minus2pt}{2pt}
  247. \titlespacing*{\subsubsection}{0pc}{2ex \@plus2.5pt \@minus1.5pt}{2pt}
  248. \titlespacing*{\paragraph}{0pc}{1.5ex \@plus2pt \@minus1pt}{12pt}
  249. %% Article meta data additional fields
  250. \newcommand{\additionalelement}[1]{\def\@additionalelement{#1}}
  251. \newcommand{\dates}[1]{\def\@dates{#1}}
  252. \newcommand{\doi}[1]{\def\@doi{#1}}
  253. \newcommand{\leadauthor}[1]{\def\@leadauthor{#1}}
  254. \newcommand{\etal}[1]{\def\@etal{#1}}
  255. \newcommand{\keywords}[1]{\def\@keywords{#1}}
  256. \newcommand{\authorcontributions}[1]{\def\@authorcontributions{#1}}
  257. \newcommand{\authordeclaration}[1]{\def\@authordeclaration{#1}}
  258. \newcommand{\equalauthors}[1]{\def\@equalauthors{#1}}
  259. \newcommand{\correspondingauthor}[1]{\def\@correspondingauthor{#1}}
  260. \newcommand{\significancestatement}[1]{\def\@significancestatement{#1}}
  261. \newcommand{\matmethods}[1]{\def\@matmethods{#1}}
  262. \newcommand{\acknow}[1]{\def\@acknow{#1}}
  263. %% Dropped capital for first letter of main text
  264. \newcommand{\dropcap}[1]{\lettrine[lines=2,lraise=0.05,findent=0.1em, nindent=0em]{{\dropcapfont{#1}}}{}}
  265. %% Abstract formatting
  266. \def\xabstract{abstract}
  267. \long\def\abstract#1\end#2{\def\two{#2}\ifx\two\xabstract
  268. \long\gdef\theabstract{\ignorespaces#1}
  269. \def\go{\end{abstract}}\else
  270. \typeout{^^J^^J PLEASE DO NOT USE ANY \string\begin\space \string\end^^J
  271. COMMANDS WITHIN ABSTRACT^^J^^J}#1\end{#2}
  272. \gdef\theabstract{\vskip12pt BADLY FORMED ABSTRACT: PLEASE DO
  273. NOT USE {\tt\string\begin...\string\end} COMMANDS WITHIN
  274. THE ABSTRACT\vskip12pt}\let\go\relax\fi
  275. \go}
  276. % Define an environment with abstract content and styling
  277. \newcommand{\abscontent}{
  278. \noindent
  279. {%
  280. \parbox{\dimexpr\linewidth}{%
  281. \vskip3pt%
  282. \absfont \theabstract
  283. }%
  284. }%
  285. \vskip10pt%
  286. \noindent
  287. {\parbox{\dimexpr\linewidth}{%
  288. {
  289. \keywordsfont \@ifundefined{@keywords}{}{\@keywords}}%
  290. }}%
  291. \vskip12pt%
  292. }
  293. % Option to format abstract differently for certain layouts (not used)
  294. \newcommand{\abscontentformatted}{
  295. \abscontent
  296. }
  297. %% Manual adjustment to line up main content with line numbers
  298. \newlength\pnas@vertadjust
  299. \newcommand\verticaladjustment[1]{\setlength{\pnas@vertadjust}{#1}}
  300. %% Custom title page
  301. \renewcommand{\@maketitle}{%
  302. {%
  303. \ifthenelse{\boolean{shortarticle}}
  304. {\ifthenelse{\boolean{singlecolumn}}{}{
  305. {\raggedright\baselineskip= 24pt\titlefont \@title\par}%
  306. \vskip10pt% 21pts between base of title and base of author line
  307. {\raggedright \@author\par}
  308. \vskip8pt% 16pts between base of affiliations and base of dates line
  309. {\raggedright \datesfont \@ifundefined{@dates}{}{\@dates}\par}
  310. \vskip12pt%
  311. }}
  312. {% else
  313. %
  314. \vskip10pt%
  315. {\raggedright\baselineskip= 24pt\titlefont \@title\par}%
  316. \vskip10pt% 21pts between base of title and base of author line
  317. {\raggedright \@author\par}
  318. \vskip8pt% 16pts between base of affiliations and base of dates line
  319. {\raggedright \datesfont \@ifundefined{@dates}{}{\@dates}\par}
  320. \vskip12pt
  321. {%
  322. \abscontent
  323. }%
  324. \vskip25pt%
  325. }%
  326. %%%
  327. \@additionalelement
  328. }%
  329. \vskip\pnas@vertadjust
  330. }%
  331. %% Footnotes set up
  332. \RequirePackage[flushmargin,ragged]{footmisc}
  333. \renewcommand*{\footnotelayout}{\normalfont\sffamily\fontsize{6}{8}\selectfont} % set the footnote font
  334. \renewcommand{\footnoterule}{% Set the footnote hrule style
  335. \kern -3pt
  336. {\color{black50} \hrule width 72pt height 0.25pt}
  337. \kern 2.5pt
  338. }
  339. %% Set up the acknowledgments field
  340. \titleclass{\acknow@section}{straight}[\part]
  341. \newcounter{acknow@section}
  342. \providecommand*{\toclevel@acknow@section}{0}
  343. % Format is set for research articles by default
  344. \titleformat{\acknow@section}[runin]
  345. {\sffamily\normalsize\bfseries}
  346. {}
  347. {0em}
  348. {#1.}
  349. []
  350. \titlespacing{\acknow@section}
  351. {0pt}
  352. {3.25ex plus 1ex minus .2ex}
  353. {1.5ex plus .2ex}
  354. \newcommand{\showacknow}{% Display acknowledgments section
  355. \@ifundefined{@acknow}{}{\acknow@section{ACKNOWLEDGMENTS}\small\@acknow}
  356. }
  357. %% Set up the materials&methods field
  358. \titleclass{\matmethods@section}{straight}[\part]
  359. \newcounter{matmethods@section}
  360. \providecommand*{\toclevel@matmethods@section}{0}
  361. % Format is set for research articles by default
  362. \titleformat{\matmethods@section}
  363. {\sffamily\normalsize\bfseries}
  364. {}
  365. {0em}
  366. {#1}
  367. []
  368. \titlespacing{\matmethods@section}
  369. {0pt}
  370. {3.25ex plus 1ex minus .2ex}
  371. {1.5ex plus .2ex}
  372. \newcommand{\showmatmethods}{% Display materials&methods section
  373. \@ifundefined{@matmethods}{}{\matmethods@section{Materials and Methods}{\small\noindent\@matmethods}}
  374. }
  375. %% Other packages
  376. \RequirePackage{enumitem} % For reducing bullet list item separation