\ProvidesClass{Pamhyr}[Pamhyr class]
\NeedsTeXFormat{LaTeX2e}
\ProcessOptions\relax
\LoadClass[11pt,a4paper]{article}

\usepackage[hmargin=2cm, vmargin=3cm]{geometry}
\usepackage[british,UKenglish,USenglish,english,american]{babel}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[absolute]{textpos}
\usepackage{titlesec}
\usepackage{amssymb}
\usepackage{tcolorbox}

\usepackage{enumitem}
\setlist[enumerate]{itemsep=-0.5em}
\setlist[itemize]{itemsep=-0.5em}

%%
%% Bibtex
%%

\bibliographystyle{plain}

%%
%% Colors
%%

\definecolor{primary}{HTML}{212121}
\definecolor{lightheadings}{HTML}{5c5c5c}
\definecolor{headings}{HTML}{212121}
\definecolor{links}{HTML}{e12121}

%%
%% Title
%%

\setlength{\columnsep}{20pt}
\setlength{\parskip}{0pt}      %% inter paragraph space

\renewcommand{\maketitle}{
    {
      \centering
      {
        \fontsize{35}{40}
        \selectfont
        \scshape
        Pamhyr2 \\
        \medskip
      }
      {
        %\centering
        \scshape
        \fontsize{20pt}{24pt}
        \selectfont
        A graphical user interface for 1D hydro-sedimentary modelling
        of rivers \\
        \medskip
      }
      \rule{3cm}{0.4pt}\\
      \vspace{0.3cm}
      {
        %\centering
        \scshape
        \fontsize{26pt}{24pt}
        \selectfont
        \@title \\
        Document licence: GPLv3 \\
        \medskip
        \includegraphics[width=3cm]{../images/GPLv3_Logo.png} \\
        \medskip
        \fontsize{14pt}{16pt}
        \selectfont
        © \@author \\
        \medskip
      }
      {
        %\centering
        %\scshape
        \fontsize{12pt}{14pt}
        \selectfont
        \@date
        %\medskip
      }\\
      \vspace{0.3cm}
      \rule{3cm}{0.4pt}\\
      \vspace{0.3cm}
      {
        \begin{minipage}[h]{0.24\textwidth}
          \includegraphics[width=4cm]{../../src/View/ui/ressources/Logo-INRAE.png}
        \end{minipage}
        \begin{minipage}[h]{0.24\textwidth}
          \includegraphics[width=4cm]{../images/riverly.png}
        \end{minipage}
      }\\
      \vspace{0.3cm}
      %%\rule{\textwidth}{0.4pt}
    }
}

%%
%% Verbatim
%%

\AtBeginEnvironment{verbatim}{\footnotesize}

%% Source code blocks
\usepackage{minted}
\usemintedstyle{emacs}
\setminted[c]{fontsize=\footnotesize,encoding=utf8,linenos}
\setminted[c++]{breaklines,fontsize=\footnotesize,encoding=utf8,linenos}
\setminted[python]{breaklines,fontsize=\footnotesize,encoding=utf8,linenos}
\setminted[shell]{breaklines,fontsize=\footnotesize,encoding=utf8}
\setminted[scheme]{breaklines,fontsize=\footnotesize,encoding=utf8}
\setminted[commun-lisp]{breaklines,fontsize=\footnotesize,encoding=utf8}
\setminted[text]{breaklines,fontsize=\footnotesize,encoding=utf8}
\setminted[llvm]{breaklines,fontsize=\footnotesize,encoding=utf8}

\BeforeBeginEnvironment{minted}{\begin{tcolorbox}[boxsep=0pt, left=0.1cm, right=0.1cm, arc=0pt, boxrule=0.5pt, colback=white]}%
\AfterEndEnvironment{minted}{\end{tcolorbox}}%

\makeatletter
\AtBeginEnvironment{minted}{\dontdofcolorbox}

\def\dontdofcolorbox{\renewcommand\fcolorbox[4][]{##4}}
\makeatother

\BeforeBeginEnvironment{verbatim}{\begin{tcolorbox}[boxsep=0pt, left=0.1cm, right=0.1cm, arc=0pt, boxrule=0.5pt, colback=white]}%
\AfterEndEnvironment{verbatim}{\end{tcolorbox}}%

\makeatletter
\AtBeginEnvironment{verbatim}{\dontdofcolorbox}

\def\dontdofcolorbox{\renewcommand\fcolorbox[4][]{##4}}
\makeatother
