\documentclass[author-year]{elsarticle} %review=doublespace preprint=single 5p=2 column
\usepackage{amsmath, amsfonts, amssymb}  % extended mathematics
\usepackage{ifxetex}
\ifxetex
  \usepackage{fontspec,xltxtra,xunicode}
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \setmainfont[Mapping=tex-text]{TeX Gyre Pagella}
  \setsansfont[Mapping=tex-text]{DejaVu Sans}
  \setmonofont{Bitstream Vera Sans Mono}
\else
  \usepackage[mathletters]{ucs}
  \usepackage[utf8x]{inputenc}
\fi

% My package additions
\usepackage[hyphens]{url}
\usepackage{lineno} % add 
%\linenumbers % turns line numbering on 
\bibliographystyle{elsarticle-harv}
\biboptions{sort&compress} % For natbib
\usepackage{graphicx}
\usepackage{booktabs} % book-quality tables

%% Redefines the elsarticle footer
\makeatletter
\def\ps@pprintTitle{%
 \let\@oddhead\@empty
 \let\@evenhead\@empty
 \def\@oddfoot{\it \hfill\today}%
 \let\@evenfoot\@oddfoot}
\makeatother

% A modified page layout
\textwidth 6.75in
\oddsidemargin -0.15in
\evensidemargin -0.15in
\textheight 9in
\topmargin -0.5in


\usepackage{microtype}
\usepackage{fancyhdr}
\pagestyle{fancy}
\pagenumbering{arabic}

\usepackage{listings}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}


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


%%% Syntax Highlighting for code  %%%
%%% Adapted from knitr book %%% 
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
\newcommand{\RegionMarkerTok}[1]{{#1}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\NormalTok}[1]{{#1}}
\usepackage{enumerate}
\usepackage{ctable}
\usepackage{float}

% This is needed because raggedright in table elements redefines \\:
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
\let\PBS=\PreserveBackslash
\usepackage[normalem]{ulem}
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}

% Configure hyperlinks package
\usepackage[breaklinks=true,linktocpage,pdftitle={$title$},pdfauthor={$for(author)$$author$$sep$; $endfor$},xetex,colorlinks]{hyperref}
\hypersetup{breaklinks=true, pdfborder={0 0 0}}

% Pandoc toggle for numbering sections (defaults to be off)
$if(numbersections)$
$else$
\setcounter{secnumdepth}{0}
$endif$


\VerbatimFootnotes % allows verbatim text in footnotes

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



\begin{document}
\begin{frontmatter}
  \title{$title$}
  \author[cpb]{Carl Boettiger\corref{cor1}}
  \author[stats]{Duncan Temple Lang}
  \author[cpb]{Peter C. Wainwright}
  \ead{cboettig@ucdavis.edu}
  \cortext[cor1]{Corresponding author, cboettig@ucdavis.edu}
  \address[cpb]{Center for Population Biology, University of California, Davis, California 95616}
  \address[stats]{Department of Statistics, University of California, Davis, California 95616}
 \end{frontmatter}


$body$


\bibliography{$biblio-files$}


\end{document}
