\documentclass[a4paper,10pt,twoside]{article} % 

\usepackage[utf8x]{inputenc} %
\usepackage[french,english]{babel} % éàùê
\usepackage{lastpage} % number of the last page
\usepackage{fancyhdr} % en-têtes
\usepackage{ragged2e} % \begin{center}
\usepackage{geometry} % marges
\usepackage[T1]{fontenc} % fonte
\usepackage{comment} % multi-line comments (\ifx \fi) 
\usepackage{lipsum} % Lorem ipsum 
%\usepackage{fullpage} %  margin
\usepackage{titlesec} % titres sstitres... personalisés
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor} % jeu de couleurs std
\usepackage[most]{tcolorbox} % boîtes 
\usepackage{mdframed} % boîtes
\usepackage{indentfirst} % indentation française
\usepackage{graphicx} % images
\usepackage{subfigure} % plusieurs images accolées
\usepackage{hyperref} % liens hypertexte internes et externes
\usepackage{verbatim}
\usepackage{changepage} % \begin{adjustwidth}{2cm}{2cm} \end{}
\usepackage{multicol} % \begin{multicols}{3} \end{multicols}
\usepackage{footnote} % better footnotes
\usepackage[stable]{footmisc} % footnotes in titles
\usepackage{capt-of} % captions with \captionof{figure}{caption}\label{fig:a}
\usepackage{eurosym} % € 
\usepackage{textcomp} % 
\usepackage{bookmark} % 
\usepackage{footnote} % \footnote in tabular
\usepackage{capt-of} % \ caption
\usepackage{listings} % blue typewriter
%~ \usepackage{fancyvrb} % 
\usepackage{setspace} % interligne


% spacing :
% \doublespacing
% \onehalfspacing 
% \singlespacing
%\begin{singlespace}
%
%\end{singlespace}
%\begin{spacing}{0.9}
%
%\end{spacing}



%\selectlanguage{english}

% listings : \begin,end : lstlisting in blue
\lstset{basicstyle=\ttfamily\color{blue}}

% save footnotes
\makesavenoteenv{tabular} 

% format de la page
\geometry{a4paper, margin=2.2cm}
\pagestyle{fancy}
\fancyhf{}

\lhead{Section \thesection}
\chead{En-tête centré}
\rhead{Sous-section \thesubsection}

\lfoot{\today}
\cfoot{Pied de page centré}
\rfoot{\thepage\ / \pageref{LastPage}}

% defines
\definecolor{myBlue}{RGB}{216, 216, 254} % bleu pour le cadre
\definecolor{myGrey}{RGB}{233, 234, 235} % gris pour le cadre
\newtcbox{\myBox}[1][]
{
width=0.9\linewidth
}
% hyperref config : couleur des liens internes/externes
\hypersetup{%
    pdfborder = {0 0 0},
    colorlinks,
    citecolor=red,
    filecolor=Darkgreen,
    linkcolor=blue,
    urlcolor=cyan!50!black!90
}
% hyphénation of monospace font : commande  \mttt
\newcommand\mttt[1]{{\normalfont\fontfamily{cmvtt}\selectfont #1}}

\begin{document}

\begin{titlepage}





\newcommand{\HRule}{\rule{\linewidth}{0.2mm}} 

\center 
 


\hfill \break \hfill \break \hfill \break \hfill \break \hfill \break

\textsc{\LARGE Organisation}\\[1.5cm] 
\textsc{\Large Matière}\\[0.5cm] 
\textsc{\large Sujet}\\[0.5cm] 



\HRule \\[0.6cm]
{ \huge Titre du compte-rendu}\\[0.4cm] 
\HRule \\[1.2cm]
 


\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Auteur(s) :}\\
Prénom \textsc{Nom}

Prénom2 \textsc{Nom2} 


\end{flushleft}
\end{minipage}
~
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Superviseur(s) :} \\
Prénom3 \textsc{Nom3} 

Prénom4 \textsc{Nom4}
\end{flushright}
\end{minipage}\\[4cm]



{\large \today}\\[3cm] 


\begin{figure}
    \centering
    \subfigure{\includegraphics[width=2.2cm]{../img/logo1.png}} 
    \hfill
    \subfigure{\includegraphics[width=2.2cm]{../img/logo2.jpg}}
    \hfill
\end{figure}


\vfill 


\end{titlepage}

\setcounter{tocdepth}{2}
\thispagestyle{empty}
\tableofcontents

\vfill
\pagebreak

\titleformat{\section}{\normalfont\Large\relax}{\thesection}{1em}{}[{\titlerule[0.2pt]}]
\titleformat{\subsection}{\normalfont\large\relax}{\thesubsection}{1em}{}[{\titlerule[0pt]}]
\titleformat{\subsubsection}{\normalfont\large\slshape\relax}{\thesubsubsection}{1em}{}[{\titlerule[0pt]}]

\newcounter{rq} % rq = 0
\stepcounter{rq} % rq = 1



\begin{abstract}


\lipsum[1]




\end{abstract}


\part{Exemples 1}

% uncomment following to reset section numbering (switch from \part 1 - 2)
%\setcounter{section}{0}
%\renewcommand*{\theHsection}{chX.\the\value{section}}
\section{Du texte simple}

\subsection{du texte}

\subsubsection*{sans contours}

Du texte

\lipsum[1]

\subsubsection{avec une boite exemple}

\begin{center}
\begin{mdframed}[backgroundcolor=myGrey,userdefinedwidth=15.55cm,align=center]
\begin{center}
\bfseries{Exemple}
\end{center}

\indent \lipsum[1]

\end{mdframed}
\end{center}


\subsection{le même texte}

\lipsum[2]

\subsection{dans une remarque}

\begin{center}
\begin{tabular}{|>{\columncolor{myBlue}} p{.75cm} | p{15cm} |}
  \hline
    \bfseries{R\arabic{rq}} & \lipsum[2]  \\
  \hline
\end{tabular}
\end{center}
\stepcounter{rq}


\part{Exemples 2}
% renumérotage des sections
\setcounter{section}{0}
\renewcommand*{\theHsection}{chX.\the\value{section}}

\section{Encore des exemples !}

\subsection{avec des marges plus grandes}



\begin{adjustwidth}{3cm}{3cm} 

\lipsum[3]

\end{adjustwidth}


\subsection{sur trois colonnes}

\begin{multicols}{3} 

\lipsum[4]

\end{multicols}



%
\begingroup
\begin{center}
\begin{tabular}{| p {1.8cm} | p {1.2cm} | p{1.2cm} |}
    \hline
    
      \cellcolor{blue!25}\bfseries{Foo} & \cellcolor{blue!15} bar1 & \cellcolor{blue!15} bar 2 \\
    \hline
      \cellcolor{blue!15} toto1 & 1 & 2\footnote{Du texte en pied de page.} \\
    \hline
      \cellcolor{blue!15} toto2\footnote{Encore du texte.} & 3 &\cellcolor{green!10} 4 \\
    
    \hline
\end{tabular}
\end{center}
\captionof{figure}{Foos --- bar/toto}\label{fig:foobar}
\endgroup



%
%~ \begin{center}
%~ \begin{tabular}{| p {1.8cm} | p {1.2cm} | p{1.2cm} |}
    %~ \hline
    %~ 
      %~ \cellcolor{blue!25}\bfseries{Foo} & \cellcolor{blue!15} bar1 & \cellcolor{blue!15} bar 2 \\
    %~ \hline
      %~ \cellcolor{blue!15} toto1 & 1 & 2\footnote{Blabla !} \\
    %~ \hline
      %~ \cellcolor{blue!15} toto2 & 3 &\cellcolor{green!10} 4 \\
    %~ 
    %~ \hline
%~ \end{tabular}
%~ \end{center}



\begin{lstlisting}

Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. 
Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis 
vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, 
erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et  
nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque 
a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, 
nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper 
vestibulum turpis. Pellentesque cursus luctus mauris.

\end{lstlisting}



\mttt{
\lipsum[3]
}

\begin{doublespace}

\lipsum[4]

\end{doublespace}


\begin{spacing}{1.2}

\lipsum[1]

\end{spacing}



\end{document}
