
%% ==============================================================================
%% Template structure for reference manual
%% ==============================================================================

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

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

%% Document layout
\documentclass[twoside = semi, abstract = on]{scrreprt}

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

\dominitoc

%% 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
%% ==============================================================================

%% Disable page numbering temporarily
\pagenumbering{gobble}

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

%\maketitle
%\emptythanks

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

%% Headings for introductory parts (no header, simple footer)
\ofoot{\engine\ Reference Manual}\ifoot{\pagemark}
\pagenumbering{roman}

%% Foreword
%\input{foreword}

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

\clearpage


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

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

\include{chapters}


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

%% Chapter numbering is reset with letters now
\appendix

\include{appendices}

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


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

%\backmatter   %% Chapter numbering off

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

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

\end{document}
