\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}

\usepackage{f1000_styles}

\usepackage[pdfborder={0 0 0}]{hyperref}

$if(natbib)$
\usepackage[$if(natbiboptions)$$natbiboptions$$else$numbers$endif$]{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$unsrtnat$endif$}
$if(letcitecitep)$\let\cite\citep$endif$
$endif$
$if(biblatex)$
\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
$for(bibliography)$
\addbibresource{$bibliography$}
$endfor$
$endif$

%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
  \ifdim\Gin@nat@width>\linewidth
    \linewidth
  \else
    \Gin@nat@width
  \fi
}
\makeatother

$if(highlighting-macros)$
$highlighting-macros$
$endif$

% disable code chunks background
%\renewenvironment{Shaded}{}{}

$if(numbersections)$
$else$
% disable section numbers
\setcounter{secnumdepth}{0}
$endif$

\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}


$for(header-includes)$
$header-includes$
$endfor$

\begin{document}
\pagestyle{front}

$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}

$endif$
$if(author)$
%% AUTH AFFIL %%

$endif$
$if(title)$
\maketitle
\thispagestyle{front}

$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}

$endif$
$if(keywords)$
\section*{Keywords}
$for(keywords)$$keywords$$sep$, $endfor$

$endif$

\clearpage
\pagestyle{main}

$for(include-before)$
$include-before$

$endfor$
$if(toc)$
{
$if(colorlinks)$
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
$endif$
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}
$endif$
$if(lot)$
\listoftables
$endif$
$if(lof)$
\listoffigures
$endif$
$body$

$if(natbib)$
$if(bibliography)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
{\small\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}}

$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$

$endif$
$for(include-after)$
$include-after$

$endfor$
\end{document}
