%% ==============================================================================
%% SI3 Reference Manual
%% ==============================================================================


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

%% Document layout
\documentclass[draft]{scrreport}

%% Custom style (.sty)
\usepackage{../../global/packages}
\hypersetup{
  pdftitle={Sea Ice modelling Integrated Initiative (SI³) -- The NEMO sea ice engine},
  pdfauthor={NEMO Sea Ice Working Group},
  colorlinks
}

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

\makeindex

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

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


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

\title{Sea Ice modelling Integrated Initiative (SI$^3$) \\ The NEMO sea ice engine
%  \small{\textcolor{red}{First draft documentation. Needs completion and rewriting.}}
}
\author{NEMO Sea Ice Working Group\thanks{
    TBD
  }
}
\date{\today}

%% Title and information pages
\input{../../global/frontpages}

%% Citation embedded
\textsf{
``{\bfseries Sea Ice modelling Integrated Initiative (SI$^3$) -- The NEMO sea ice engine}'', 
NEMO Sea Ice Working Group, 
{\em Scientific Notes of Climate Modelling Center (31)} -- ISSN 1288-1619, 
Institut Pierre-Simon Laplace (IPSL), 
\href{http://doi.org/10.5281/zenodo.1471689}{doi:10.5281/zenodo.1471689}
}

\newpage
%\frontmatter   %% Chapter numbering off and Roman numerals for page numbers
\pagenumbering{roman}

%\subfile{../subfiles/foreword}            %% Foreword


%% ToC i.e. Table of Contents
\newpage
\dominitoc
\tableofcontents

\clearpage

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

%\mainmatter   %% Chapter numbering on, page numbering is reset with Arabic numerals
\pagenumbering{arabic}

\graphicspath{{../../figures/SI3/}}

\subfile{../subfiles/todolist}

% Introduction

\subfile{../subfiles/introduction}

% Chapters

\subfile{../subfiles/chap_model_basics}
\subfile{../subfiles/chap_domain}
\subfile{../subfiles/chap_dynamics}
\subfile{../subfiles/chap_transport}
\subfile{../subfiles/chap_ridging_rafting}
\subfile{../subfiles/chap_radiative_transfer}
\subfile{../subfiles/chap_thermo}
\subfile{../subfiles/chap_interfaces}
\subfile{../subfiles/chap_output_diagnostics}
\subfile{../subfiles/chap_single_category_use}
\subfile{../subfiles/chap_bdy_agrif}
\subfile{../subfiles/chap_miscellaneous}

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

%\appendix   % Chapter numbering is reset with letters now


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

%\backmatter   %% Chapter numbering off

%% Bibliography
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{../main/SI3_manual}
%\bibliography{/Users/ioulianikolskaia/Boulot/LIBRARY/BIBTEX/Martin_biblio.bib} 

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

\end{document}
