% This is a combination of Pandoc templating and LaTeX
% Pandoc templating https://pandoc.org/MANUAL.html#templates
% See the README for help

$if(titlepage-geometry)$
\newgeometry{$for(titlepage-geometry)$$titlepage-geometry$$sep$,$endfor$}
$endif$
\begin{minipage}[b][0.95\textheight][s]{\textwidth}
\raggedright

% background sigle
$if(title-sigle)$
\This$if(title-bg-location)$$title-bg-location$$else$LL$endif$CornerWallPaper{$if(title-bg-size)$$title-bg-size$$else$0.2$endif$}{$title-sigle$}
$endif$

\vfill

% Title and subtitle
\setlength{\baselineskip}{26pt}
{\huge\bfseries\color{inrae}\nohyphens{$title$}}\\[0.7\baselineskip] 
$if(subtitle)${\color{inrae}\Large{$subtitle$}}\\[2\baselineskip]$endif$

\setlength{\baselineskip}{13pt}
\textbf{Date :} $date$\\[1\baselineskip]%

% Authors
\textbf{Auteur(s) :} %
$for(by-author)$
{$by-author.name.literal$}$sep$, 
$endfor$\\[1\baselineskip]

% % contributors
$if(contributor)$
\textbf{Contributeur(s) :} %
$for(contributor)$$contributor$$sep$, $endfor$
$endif$

% \vfill

% % how to cite
$if(how-to-cite)$
\noindent\rule{\linewidth}{0.4pt}\vspace{3pt}
\textbf{Citation\ : $how-to-cite$} 
\noindent\rule{\linewidth}{0.4pt}\\[1\baselineskip]
$endif$

\vfill

% Cover image
% $if(cover)$\includegraphics[width=4cm]{$cover$}$endif$

% \begin{center}
% \begin{tabular}{>{\centering}p{.2\linewidth}>{\centering}p{.03\linewidth}>{\raggedright}p{.6\linewidth}}
%     \raisebox{-0.5\height}{\includegraphics[height=3cm]{data-common/figure/logo/logo-mte.jpg}} & &
%     Travaux ayant bénéficié de l'appui du Ministère de la Transition Écologique dans le cadre de la convention SNRH-INRAE 2024 (décision attributive de subvention n° 2104326877)
%     \tabularnewline
% \end{tabular}
% \end{center}

% \vspace{1\baselineskip} 

%%%%%% Tagline at bottom
% \begin{center}
% \begin{tabular}{>{\raggedright}p{.25\linewidth}>{\raggedleft}p{.25\linewidth}}
%     \raisebox{-0.5\height}{\includegraphics[height=1cm]{data-common/figure/logo/logo-inrae.png}} &
%     \raisebox{-0.5\height}{\includegraphics[height=2cm]{data-common/figure/logo/logo-g-eau-adaptation.png}} \tabularnewline
% \end{tabular}
% \end{center}

\begin{minipage}{.4\textwidth}
\begin{flushleft}
    \includegraphics[height=1.3cm]{data-common/figure/logo/inrae-sigle-transparent.png}
    \hspace{12px}
    \includegraphics[height=1.3cm]{data-common/figure/logo/logo-so-ii-texte.png}
\end{flushleft}
\end{minipage}
\hspace{0.18\textwidth}
\begin{minipage}{.4\textwidth}
\begin{flushright}
{\color{inrae}
  INRAE - UMR G-EAU | {\color{soii}\Large so-ii}\ \\
  361 rue J.F. Breton - BP 5095 \\
  34196 Montpellier Cedex
}
\end{flushright}
\end{minipage}

\end{minipage}
$if(titlepage-geometry)$
\restoregeometry
$endif$