\documentclass[<%= @documentclassoption %>]{<%= @documentclass %>}
<%= latex_config %>
<%- if @config['texstyle'] -%>
<%-   [@config['texstyle']].flatten.each do |x| -%>
\usepackage{<%= x %>}
<%-   end -%>
<%- end -%>

%% backward compatibility (defined in config.erb)
\reviewbackcompatibilityhook

\begin{document}

%% begindocument hook
\ifdefined\reviewbegindocumenthook
\reviewbegindocumenthook
\fi

%% coverpage
\ifdefined\reviewcoverpagecont
\covermatter
\reviewcoverpagecont
\fi

%% frontmatter hook
\ifdefined\reviewfrontmatterhook
\reviewfrontmatterhook
\fi

%% title page
\ifdefined\reviewtitlepagecont
\reviewtitlepagecont
\fi

%% originaltitle
\ifdefined\revieworiginaltitlepagecont
\revieworiginaltitlepagecont
\fi

%% credit
\ifdefined\reviewcreditfilecont
\reviewcreditfilecont
\fi

%% preface
\ifdefined\reviewprefacefiles
\reviewprefacefiles
\fi

%% toc
\ifdefined\reviewtableofcontents
\reviewtableofcontents
\fi

%% mainmatter hook
\ifdefined\reviewmainmatterhook
\reviewmainmatterhook
\fi

%% chapters body
\ifdefined\reviewchapterfiles
\reviewchapterfiles
\fi

%% appendix hook
\ifdefined\reviewappendixhook
\reviewappendixhook
\fi

%% appendix body
\ifdefined\reviewappendixfiles
\reviewappendixfiles
\fi

%% backmatter hook
\ifdefined\reviewbackmatterhook
\reviewbackmatterhook
\fi

%% postdef body
\ifdefined\reviewpostdeffiles
\reviewpostdeffiles
\fi

%% index page
\ifdefined\reviewprintindex
\reviewprintindex
\fi

%% profile page
\ifdefined\reviewprofilepagecont
\reviewprofilepagecont
\fi

%% advfile page
\ifdefined\reviewadvfilepagecont
\reviewadvfilepagecont
\fi

%%% colophon page
\ifdefined\reviewcolophonpagecont
\reviewcolophonpagecont
\fi

%%% backcover page
\ifdefined\reviewbackcovercont
\reviewbackcovercont
\fi

%% enddocument hook
\ifdefined\reviewenddocumenthook
\reviewenddocumenthook
\fi

\end{document}
