
%% =================================================================================================
%% Template structure for reference manuals
%% =================================================================================================

%% NEMO release version
\def \version{trunk}

%% Preamble
%% =================================================================================================

%% Document layout
\documentclass[draft, fontsize = 10pt,
twoside = semi, abstract = on,
open = right]{scrreprt}

%% Load configurations
\input{../../global/preamble}

%% End of common preamble between main and sub-files
%% Override custom cmds for full manual compilation
\newcommand{\onlyinsubfile}[1]{#1}
\newcommand{\notinsubfile}[1]{}

\begin{document}

\renewcommand{\onlyinsubfile}[1]{}
\renewcommand{\notinsubfile}[1]{#1}

\renewcommand{\biblio}{}
\renewcommand{\pindex}{}


%% Frontmatter
%% =================================================================================================

\pagenumbering{gobble}   %% Disable page numbering temporarily

%% Title page
\input{../../global/frontpage}

%% Footer for introductory parts (no header by cleaning default)
\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}

%% Information page (2nd page)
\input{../../global/info_page}

\clearpage

\pagenumbering{roman}
\input{introduction}

%% Table of Contents
\tableofcontents
\listoffigures \listoftables \listoflistings

\clearpage


%% Mainmatter
%% =================================================================================================

%% Headings for document body
\pagenumbering{arabic}
\lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark}
\ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}}

\include{chapters}


%% Appendix
%% =================================================================================================

\appendix   %% Chapter numbering with letters by now
\include{appendices}

%% Append coding rules for every manual
\input{../../global/coding_rules}


%% Backmatter
%% =================================================================================================

%% Bibliography
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\lohead{Bibliography} \rehead{Bibliography}
\bibliography{../main/bibliography}

\clearpage

%% Indexes
\phantomsection
\addcontentsline{toc}{chapter}{Indexes}
\lohead{Indexes} \rehead{Indexes}
\printindex[keys]
\printindex[modules]
\printindex[blocks]
\printindex[parameters]
\printindex[subroutines]

\end{document}
