\documentclass[11pt,openright]{book}
\usepackage[a4paper]{geometry}
% BEFORE fancyhdr

\usepackage{fancyhdr}
\fancypagestyle{plain}

\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}
\fancyfoot{}

\input{common-headers}

\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{mpo-definition}{Définition}[section]
\newtheorem{mpo-proposition}{Proposition}[section]
\newtheorem{mpo-corollaire}[mpo-proposition]{Corollaire}
\theoremstyle{definition}
\newtheorem{mpo-exemple}{Exemple}[section]

% For nested empth
% http://tex.stackexchange.com/questions/318374/emph-not-working-well-in-amsthms-plain-style-using-xelatex-or-lualatex
\ExplSyntaxOn
\cs_set:cpn {th@plain} { \int_zero:N \l__fontspec_em_int \em }
\ExplSyntaxOff

\usepackage{placeins} % \FloatBarrier

\usepackage{listings}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{tabularx}

\lstdefinestyle{code}{
  belowcaptionskip=1\baselineskip,
  breaklines=true,
  %xleftmargin=\parindent,
  showstringspaces=false,
  basicstyle=\ttfamily,
  keywordstyle=\bfseries\color{green!40!black},
  commentstyle=\itshape\color{purple!40!black},
  identifierstyle=\color{black},
  stringstyle=\color{orange}
}
\lstdefinestyle{framed}{
  frame=tb,
  basicstyle=\footnotesize\ttfamily,
  %xleftmargin=\parindent
}
\lstdefinestyle{mgs}{
  style=code,
  language=Caml,
  basicstyle=\footnotesize\ttfamily,
  morekeywords={trans,=>,gbf},
  morecomment=[l]{//}
}
\lstdefinestyle{ocaml}{
  style=code,
  language=Caml,
  basicstyle=\footnotesize\ttfamily,
}
\lstdefinestyle{sbgp}{
  style=code,
  style=framed,
  string=[s]{"}{"},
  stringstyle=\it
  %language=Java
}
\lstdefinestyle{c}{
  style=code,
  style=framed,
  language=C
}

\lstnewenvironment{MGScode}{\lstset{escapechar=@,style=mgs}}{}
\lstnewenvironment{SBGPcode}{\lstset{escapechar=@,style=sbgp}}{}
\lstnewenvironment{OCAMLcode}{\lstset{escapechar=@,style=ocaml}}{}
\lstnewenvironment{Ccode}{\lstset{escapechar=@,style=c}}{}
\newcommand\ç{\lstinline[style=code]}

\newenvironment{shell}% Courtesy of scolobb
  {\\[2mm]\texttt\bgroup\indent\ignorespaces}%
  {\egroup\\[2mm]\noindent}

\usepackage[
french,
linesnumbered,
vlined,
boxed,
commentsnumbered,
titlenotnumbered]{algorithm2e}

\usepackage[
  backend=biber,
  style=numeric,
  maxbibnames=99,
  doi=false,
  url=false,
  isbn=false,
  eprint=false,
  defernumbers=true,
  refsection=chapter,
]{biblatex}
\addbibresource{biblio/these2016.bib}
\addbibresource{biblio/standards.bib}

\usepackage{hyperref}
\hypersetup{pdfauthor={Martin Potier},
            pdftitle={\@title},
            pdfsubject={Thèse de doctorat en Informatique},
            pdfkeywords={},
            pdfproducer={XeteX},
            pdfcreator={Xetex}}

\graphicspath{{figures/}}

\usepackage{caption}
\usepackage{subcaption}

\usepackage{enumitem}
\setlist[itemize]{noitemsep}

\usepackage{minitoc}
\mtcselectlanguage{french}
\usepackage{setspace}






\title{%
Un cadre théorique pour l'intégration des niveaux d'organisation dans les
modèles. Applications à l'activité spatiale et à la simulation de grandes
populations de bactéries.%
}
\author{Martin \textsc{Potier}}%
\date{{\small Version du \today}\xspace}

\input{sigles}

% Réglages pour les paragraphes
\setlength{\parindent}{1em}
\setlength{\parskip}{1ex}

\newcommand{\makeway}{%
  \clearpage{\pagestyle{empty}\cleardoublepage}}

\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  \hbox{}
  \thispagestyle{empty}
  \newpage
  \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother


\begin{document}
%coupures
\hyphenation{quel-ques}
\hyphenation{u-ni-ver-sum}
\hyphenation{con-cer-ne}
\hyphenation{é-vè-ne-ments}
\hyphenation{e-ve-ne-ments}

% Change itemize bullet
\renewcommand\labelitemi{\tikz{\filldraw (0,0) circle (2pt);}}

\makeatletter
\begin{titlepage}\centering
  {\bf UNIVERSITÉ PARIS-EST\par
  ÉCOLE DOCTORALE MSTIC}\par
  \vspace*{\fill}
  {\LARGE\bf THÈSE DE DOCTORAT}\\
  pour obtenir le titre de\par
  \vspace*{1cm}
  {\LARGE\bf Docteur de l'Université Paris-Est}\par
  \vspace*{1cm}
  {\bf Spécialité : Informatique}\par
  défendue par\par
  \vspace*{1cm}
  {\Large \@author}\par
  \vspace*{1cm}
  {\Large\bf \@title}\par
  \vspace*{\fill}
  Directeur de thèse : Olivier \textsc{Michel}\\
  préparée au LACL\par
  \vspace*{\fill}
  \begin{flushleft}
    Soutenue le 6 juillet 2017 devant le jury composé de:\par
  \end{flushleft}
  \begin{tabularx}{\textwidth}{lXl}
    \hline
    \emph{Rapporteurs}: & Arnaud \textsc{Banos} & CNRS — Géographie-Cités\\
                        & Hanna \textsc{Klaudel} & Université d'Évry — IBISC\\
    \emph{Examinateurs}:& Hugues \textsc{Berry} & INRIA\\
                        & Nathalie \textsc{Corson} & Université du Havre — LMAH\\
                        & Jean-Louis \textsc{Giavitto} & CNRS — IRCAM \\
                        & Lisandru \textsc{Muzy} & CNRS — MS\&N\\
    \emph{Encadrant}:   & Antoine \textsc{Spicher} & Université Paris-Est Créteil — LACL \\
    \emph{Directeur}:   & Olivier \textsc{Michel} & Université Paris-Est Créteil — LACL \\
    \hline
  \end{tabularx}\par
\end{titlepage}
\makeatother

\makeway\thispagestyle{empty}
\vspace*{\fill}
\noindent
Thèse préparée au LACL\\
(Laboratoire d'Algorithmique Complexité et Logique)

\vspace{6mm}\noindent
LACL\\
Faculté des Sciences et Technologie\\
61 avenue du Général De Gaulle\\
\num{94010} Créteil

\vspace{6mm}\noindent
\makeatletter
\@date rédigée avec \LaTeX
\makeatother

\newgeometry{a4paper,top=2.5cm, bottom=2cm, left=2.5cm, right=2.5cm}
\include{remerciements}
\restoregeometry

\pagenumbering{roman}
\setcounter{tocdepth}{2}
\dominitoc
\tableofcontents
\listoffigures
\pagestyle{fancy}

\makeway\thispagestyle{empty}
% DONE: wordcloud (www.jasondavies.com/wordcloud)
\begin{tikzpicture}[remember picture,overlay]
  \node at (current page.center) {%
    \includegraphics[width=1.2\textwidth]{wordcloud.pdf}%
  };
\end{tikzpicture}
\makeway\pagenumbering{arabic}

\include{partie-introduction}
\include{partie-multi-modele}\printbibliography[heading=subbibliography]
\include{partie-activite}\printbibliography[heading=subbibliography]
\include{partie-otb}\printbibliography[heading=subbibliography]
\include{partie-conclusion}

\makeway
\newgeometry{a4paper,top=2.5cm, bottom=2cm, left=2.5cm, right=2.5cm}
\include{resume}
\restoregeometry

\end{document}
