\documentclass[a4paper,fleqn,usenatbib]{mnras}

\usepackage{newtxtext,newtxmath}

\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}

\usepackage{booktabs}

$if(texpackages)$
$for(texpackages)$
\usepackage
$if(opts)$
[
$for(opts)$
$opts$,
$endfor$
]
$endif$
{$texpackages.name$}
$endfor$
$endif$

$if(preambleinput)$
$for(preambleinput)$
\input{$preambleinput$}
$endfor$
$endif$

\title[$shorttitle$]{$title$}

\author[$shortauthors$]{
$for(author)$
$author.name$,
$if(author.affiliation)$
$for(author.affiliation)$
$$^{a}$$
$endfor$
$endif$
$if(author.email)$
\thanks{E-mail: $author.email$}
$endif$
$endfor$
\\
$for(author)$
$if(author.affiliation)$
$for(author.affiliation)$
$$^{a}$$ $author.affiliation$\\
$endfor$
$endif$
$endfor$
}


\date{
Accepted 
$if(accepted)$
$accepted$.
$else$
XXX.
$endif$
Received
$if(received)$
$received$;
$else$
YYY;
$endif$
in original form
$if(originalform)$
$originalform$;
$else$
ZZZ
$endif$
}

$if(pubyear)$
\pubyear{$pubyear$}
$endif$

\begin{document}
\label{firstpage}
\pagerange{\pageref{firstpage}--\pageref{lastpage}}
\maketitle

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

$if(keywords)$
\begin{keywords}
$for(keywords)$
    $keywords$ --- 
$endfor$
\end{keywords}
$endif$

$body$

$if(bibliography)$
$for(bibliography)$
\bibliography{$bibliography$}
$endfor$
$endif$

\end{document}
