%% ==============================================================================
%% TOP Reference Manual
%% ==============================================================================


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

%% Document layout
\documentclass{book}

%% Custom style (.sty)
\usepackage{../../NEMO/main/NEMO_manual}
\hypersetup{
  pdftitle={TOP – Tracers in Ocean Paradigm – The NEMO Tracers engine},
  pdfauthor={NEMO TOP Working Group},
  colorlinks
}

%% Include references and index for single subfile compilation
\newcommand{\biblio}{\bibliography{../main/TOP_manual}}
\newcommand{\pindex}{\printindex}

\makeindex

%% End of common preamble between main and sub-files
\begin{document}

%% Override custom cmds for full manual compilation
\renewcommand{\biblio}{}
\renewcommand{\pindex}{}


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

\graphicspath{{../../figures/logos/}}

%% Frontpage
\title{
  \includegraphics[height=0.05\textheight]{CMCC}\hfill
  \includegraphics[height=0.05\textheight]{CNRS}\hfill
  \includegraphics[height=0.05\textheight]{MOI} \hfill
  \includegraphics[height=0.05\textheight]{UKMO}\hfill
  \includegraphics[height=0.05\textheight]{NERC}       \\
  {\Huge TOP \\}
  {\Large Tracer in Ocean Paradigm -- The NEMO Passive Tracer engine}\\
  \small \textcolor{red}{First draft documentation. Needs completion and rewriting}. \\
}
\author{The NEMO-TOP Group
  \thanks{
    Eth\'{e} Christian, Lovato Thomas, Aumont Olivier, Palmi\'{e}ri Julien,
    Mouchet Anne, Nurser Georges, Yool Andrew
  }\\
  \textit{Issue 27, Notes du P\^{o}le de mod\'{e}lisation} \\
  \textit{Institut Pierre-Simon Laplace (IPSL)}            \\
  \textit{ISSN 1288-1619}
}
\date{\today}

\maketitle
\frontmatter

%% ToC i.e. Table of Contents

\dominitoc
\tableofcontents


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

\mainmatter

\graphicspath{{../../figures/TOP/}}

\subfile{../subfiles/introduction}
\subfile{../subfiles/model_description}
\subfile{../subfiles/model_setup}
\subfile{../subfiles/miscellaneous}

%% Appendix

%\appendix
%% Backmatter
%% ==============================================================================

\backmatter

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

%% Index
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}
