\usepackage[latin1]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[table]{xcolor}
\usepackage{tkz-tab}
\usetikzlibrary{calc,shapes.symbols,shapes.geometric}
\usetikzlibrary{shadings}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{3pt}
\setlength{\cellspacebottomlimit}{3pt}
\makeatletter
\let\@startpbox@action\@startpbox
\makeatother
\usepackage[table]{xcolor}
%\RequirePackage{eso-pic}
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=orange]{hyperref}
\usepackage[explicit]{titlesec}
\usepackage{fancyhdr}
\usepackage{multido}
\usepackage{ifthen}
\usepackage{tabularx}
\usepackage{verbatim}
\usepackage[margin=2.5cm]{geometry}
\usepackage{kpfonts}
\usepackage[outline]{contour}
\usepackage{eurosym,mathrsfs}
\usepackage{enumitem}
\usepackage[np]{numprint}
\graphicspath{{images/}}
%%
\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%% Couleurs %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definecolor{chapitre}		{cmyk}{1.00,0.00,0.00,0.30}
\definecolor{section}		{cmyk}{0.27,0.95,0.85,0.19}
\definecolor{shadow}			{cmyk}{0.00,0.00,0.00,0.40}
\definecolor{definition}		{cmyk}{0.9,0.1,1,0.1}
\definecolor{exemple}		{cmyk}{0.9,0.61,0.33,0.17}
\definecolor{theoreme}		{cmyk}{0,0.95,0.91,0}
\definecolor{proposition}	{cmyk}{0.27,0.98,0.4,0.05}
\definecolor{notation}		{cmyk}{0.64,0.96,0,0}
\definecolor{exercice}		{cmyk}{0.11,0,0.84,0}
\definecolor{activite}		{cmyk}{0,0.07,0.67,0.03}
\definecolor{vide}			{cmyk}{0.5,0.1,0.23,0}

\definecolor{cyan}			{cmyk}{1,0,0,0}
\definecolor{ciel}			{cmyk}{0.25,0.08,0.01,0}
\definecolor{bleu}			{cmyk}{0.96,0.66,0.11,0.02}
\definecolor{bleunuit}		{cmyk}{0.85,0.41,0.42,0.13}
\definecolor{vert}			{cmyk}{0.87,0.19,0.93,0.07}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%% Tables des matières %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addto\captionsfrench{\renewcommand{\contentsname}{Sommaire}}
\newcommand{\chaptertoccolor}{bleunuit}
\renewcommand*\l@chapter[2]{%
  \ifnum\c@tocdepth>\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      \def\@linkcolor{\chaptertoccolor}%
      \color{\chaptertoccolor}{\mathversion{bold}\fontfamily{phv}\fontseries{bx}\fontsize{12}{14}\fontshape{sc}\selectfont#1}\nobreak\
       \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfil\nobreak\hb@xt@\@pnumwidth{\hss
        \def\@linkcolor{\chaptertoccolor}%
        \color{\chaptertoccolor}\fontfamily{phv}\fontseries{bx}\fontsize{12}{14}\fontshape{sc}\selectfont#2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
\def\@dottedtocline#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent #2\relax\@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima #3\relax
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {\fontfamily{phv}\selectfont#4}\nobreak
     \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill
     \nobreak
     \hb@xt@\@pnumwidth{\hfil\fontfamily{phv}\selectfont #5}%
     \par}%
  \fi}
\def\contentsline#1#2#3#4{%
  \ifx\\#4\\%
    \csname l@#1\endcsname{#2}{#3}%
  \else
      \csname l@#1\endcsname{\hyper@linkstart{link}{#4}{#2}\hyper@linkend}{%
        \hyper@linkstart{link}{#4}{#3}\hyper@linkend
      }%
  \fi
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% En-têtes et pieds de page %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]%
{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
\renewcommand{\sectionmark}[1]%
{\markright{\MakeUppercase{\thechapter.\ #1}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\newcommand{\helv}{%
\fontfamily{phv}\itshape\fontsize{9}{11}\selectfont}
\fancyhf{}
\fancyhead[LE,RO]{\begin{tikzpicture}\node[rounded corners,fill=exemple!10,text=bleunuit] {\fontfamily{phv}\fontseries{b}\selectfont\thepage};\end{tikzpicture}}
\fancyhead[LO]{\fontfamily{phv}\fontseries{b}\selectfont\color{bleunuit}\rightmark}
\fancyhead[RE]{\fontfamily{phv}\fontseries{b}\selectfont\color{bleunuit}\leftmark}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%% Titres de chapitres %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\titleformat{\chapter}
  {\fontfamily{phv}\fontseries{b}\Huge}
  {}{0pt}
  {%
	\begin{tikzpicture}
  		\node[rounded corners,fill=bleunuit,inner sep=1pt] 
  		{
  			\begin{minipage}{\textwidth}
  				\begin{center}
  					\begin{tikzpicture}
  						\foreach \i in {0,2,...,100} 
  						{
  						\edef\i{\the\numexpr(100-\i)}
  						\node at (0,0)
  						{%
  						\contourlength{\dimexpr0.05pt*\i}
  						\contour{bleunuit!\i}{\color{bleunuit}#1}
  						};
						}
						\ifnum\thechapter=0
							\node[scale=2,text=bleunuit!50!white,opacity=0.2] at (0,0) {\fontfamily{phv}\fontseries{bx}\selectfont#1};
						\else
							\node[scale=3,text=bleunuit!50!white,opacity=0.5] at (0,0) {\fontfamily{phv}\fontseries{bx}\selectfont\thechapter};
						\fi
					\end{tikzpicture}
				\end{center}
			\end{minipage}
		};
  		\end{tikzpicture}
  }
\titlespacing*{\chapter}{0pt}{0pt}{10pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% Titres des sections %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\titleformat{\section}
	{\fontfamily{phv}\fontseries{b}\large}
	{}{0pt}
	{%
		\begin{tikzpicture}
			\shade[left color=white,right color=section] (0,-.2) rectangle +(0.99\linewidth,.4);
			\node[fill=white,left,text=section] at (\linewidth,0) {#1};
		\end{tikzpicture}
	}
\titlespacing*{\section}{0em}{0em}{0em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% Environnement "cadre" %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newsavebox{\contenu@cadre}

\def\notation{notation}
\def\definition{definition}
\def\theoreme{theoreme}
\def\exempleB{exemple}
\def\proposition{proposition}
\def\exercice{exercice}
\def\activite{activite}

\pgfdeclarelayer{background layer}
\pgfsetlayers{background layer,main}

\newcounter{propositioncnt}
\newcounter{theoremecnt}
\newcounter{exercicecnt}
\newcounter{videcnt}
\newcounter{exemplecnt}
\newcounter{notationcnt}
\newcounter{definitioncnt}
\newcounter{activitecnt}

\newcounter{proposition}[chapter]
\newcounter{theoreme}[chapter]
\newcounter{exercice}[chapter]
\newcounter{exemple}[chapter]
\newcounter{notation}[chapter]
\newcounter{definition}[chapter]
\newcounter{activite}[chapter]

\renewcommand{\theproposition}{\thechapter.\arabic{proposition}}
\renewcommand{\thetheoreme}{\thechapter.\arabic{theoreme}}
\renewcommand{\theexercice}{\thechapter.\arabic{exercice}}
\renewcommand{\theexemple}{\thechapter.\arabic{exemple}}
\renewcommand{\thenotation}{\thechapter.\arabic{notation}}
\renewcommand{\thedefinition}{\thechapter.\arabic{definition}}
\renewcommand{\theactivite}{\thechapter.\arabic{activite}}

\newenvironment{enonce}[3]
{%
	\begin{trivlist}\item
   		\noindent
   			\begin{tikzpicture}[fill=#2,text=black]
   				\node[inner ysep=2pt,inner xsep=4pt] (textbox) {\iffalse`}\fi
   				\hspace{-4pt}
     			\begin{minipage}{\dimexpr\linewidth}
     				\hspace{-4pt}
     				\begin{tikzpicture}
     					\node[inner sep=4pt] (titlebox) {%
       						\begin{minipage}{\dimexpr\linewidth-4pt}
       						\ifcat%
       						$\detokenize{#1}$\else
       							\fontfamily{phv}\fontsize{14}{16}\bfseries\selectfont#1%
       	\ifnum\thedefinitioncnt=1
			\refstepcounter{definition}
			\thedefinition
		\else
			\ifnum\thenotationcnt=1
				\refstepcounter{notation}
				\thenotation
			\else
				\ifnum\thetheoremecnt=1
					\refstepcounter{theoreme}
					\thetheoreme
				\else
					\ifnum\theexemplecnt=1
						\stepcounter{exemple}
						\theexemple
					\else
						\ifnum\thepropositioncnt=1
							\refstepcounter{proposition}
							\theproposition
						\else
							\ifnum\theexercicecnt=1
								\refstepcounter{exercice}
								\theexercice
							\else
								\ifnum\theactivitecnt=1
									\refstepcounter{activite}
									\theactivite
								\fi
							\fi
						\fi
					\fi
				\fi
			\fi
		\fi
       							\normalfont
       						\fi
       						\ifcat%
       						$\detokenize{#3}$\else
								\ifcat%
       								$\detokenize{#1}$       														\fontfamily{phv}\fontsize{14}{16}\bfseries\selectfont#3
       							\else
       								\space
       								\fontfamily{phv}\fontsize{10}{12}\selectfont#3
       							\fi
       						\fi
       						\end{minipage}\hspace{4pt}};
     					\begin{pgfonlayer}{background layer}
     						\shade[rounded corners,left color=#2!10,right color=white] 
        					(titlebox.south west) [rounded corners] --
        					(titlebox.north west) -- 
        					(titlebox.north east) [rounded corners=0pt] -- 
        					(titlebox.south east) -- cycle;
     					\end{pgfonlayer}
   					\end{tikzpicture}
}
{%
	\end{minipage}\egroup;
   \draw (textbox.south west) [rounded corners] -- 
         (textbox.north west) -- 
         (textbox.north east) [rounded corners=0pt] -- 
         (textbox.south east) -- cycle;
   \end{tikzpicture}
\end{trivlist}
}

\define@cmdkey [PAS] {cadre} {style}{}
\define@cmdkey [PAS] {cadre} {titre}{}
\define@cmdkey [PAS] {cadre} {color}{}
\presetkeys    [PAS] {cadre} {titre=,style=,color=}{}

\newenvironment*{cadre}[1][]
{%
\setkeys[PAS]{cadre}{#1}
\ifx\cmdPAS@cadre@style\definition
	\setcounter{definitioncnt}{1}
	\setcounter{notationcnt}{0}
	\setcounter{theoremecnt}{0}
	\setcounter{exemplecnt}{0}
	\setcounter{propositioncnt}{0}
	\setcounter{exercicecnt}{0}
	\setcounter{activitecnt}{0}
	\setcounter{videcnt}{0}
	\enonce{Définition}{definition}{\cmdPAS@cadre@titre}
\else
	\ifx\cmdPAS@cadre@style\notation
		\setcounter{definitioncnt}{0}
		\setcounter{notationcnt}{1}
		\setcounter{theoremecnt}{0}
		\setcounter{exemplecnt}{0}
		\setcounter{propositioncnt}{0}
		\setcounter{exercicecnt}{0}
		\setcounter{activitecnt}{0}
		\setcounter{videcnt}{0}
		\enonce{Notation}{notation}{\cmdPAS@cadre@titre}
	\else
		\ifx\cmdPAS@cadre@style\theoreme
			\setcounter{definitioncnt}{0}
			\setcounter{notationcnt}{0}
			\setcounter{theoremecnt}{1}
			\setcounter{exemplecnt}{0}
			\setcounter{propositioncnt}{0}
			\setcounter{exercicecnt}{0}
			\setcounter{activitecnt}{0}
			\setcounter{videcnt}{0}
			\enonce{Théorème}{theoreme}{\cmdPAS@cadre@titre}
		\else
			\ifx\cmdPAS@cadre@style\exempleB
				\setcounter{definitioncnt}{0}
				\setcounter{notationcnt}{0}
				\setcounter{theoremecnt}{0}
				\setcounter{exemplecnt}{1}
				\setcounter{propositioncnt}{0}
				\setcounter{exercicecnt}{0}
				\setcounter{activitecnt}{0}
				\setcounter{videcnt}{0}
				\enonce{Exemple}{exemple}{\cmdPAS@cadre@titre}
			\else
				\ifx\cmdPAS@cadre@style\proposition
					\setcounter{definitioncnt}{0}
					\setcounter{notationcnt}{0}
					\setcounter{theoremecnt}{0}
					\setcounter{exemplecnt}{0}
					\setcounter{propositioncnt}{1}
					\setcounter{exercicecnt}{0}
					\setcounter{activitecnt}{0}
					\setcounter{videcnt}{0}
					\enonce{Proposition}{proposition}{\cmdPAS@cadre@titre}
				\else
					\ifx\cmdPAS@cadre@style\exercice
						\setcounter{definitioncnt}{0}
						\setcounter{notationcnt}{0}
						\setcounter{theoremecnt}{0}
						\setcounter{exemplecnt}{0}
						\setcounter{propositioncnt}{0}
						\setcounter{exercicecnt}{1}
						\setcounter{activitecnt}{0}
						\setcounter{videcnt}{0}
						\enonce{Exercice}{exercice}{\cmdPAS@cadre@titre}
					\else
						\ifx\cmdPAS@cadre@style\activite
							\setcounter{definitioncnt}{0}
							\setcounter{notationcnt}{0}
							\setcounter{theoremecnt}{0}
							\setcounter{exemplecnt}{0}
							\setcounter{propositioncnt}{0}
							\setcounter{exercicecnt}{0}
							\setcounter{activitecnt}{1}
							\setcounter{videcnt}{0}
							\enonce{Activité}{activite}{\cmdPAS@cadre@titre}
						\else
							\enonce{}{\cmdPAS@cadre@color}{\cmdPAS@cadre@titre}
						\setcounter{definitioncnt}{0}
						\setcounter{notationcnt}{0}
						\setcounter{theoremecnt}{0}
						\setcounter{exemplecnt}{0}
						\setcounter{propositioncnt}{0}
						\setcounter{exercicecnt}{0}
						\setcounter{activitecnt}{0}
						\setcounter{videcnt}{1}
						\fi
					\fi
				\fi
			\fi
		\fi
	\fi
\fi
}
{
	\endenonce
	\setcounter{definitioncnt}{0}
	\setcounter{notationcnt}{0}
	\setcounter{theoremecnt}{0}
	\setcounter{exemplecnt}{0}
	\setcounter{propositioncnt}{0}
	\setcounter{exercicecnt}{0}
	\setcounter{videcnt}{0}
	\setcounter{activitecnt}{0}
	
}

%<--------------- Commande "bold" ---------->

\newcommand{\bold}[1]
{%
	{%
		\ifnum\thedefinitioncnt=1
			\color{definition}
		\else
			\ifnum\thenotationcnt=1
				\color{notation}
			\else
				\ifnum\thetheoremecnt=1
					\color{theoreme}
				\else
					\ifnum\theexemplecnt=1
						\color{exemple}
					\else
						\ifnum\thepropositioncnt=1
							\color{proposition}
						\else
							\ifnum\theexercicecnt=1
								\color{exercice}
							\else
								\ifnum\theactivitecnt=1
									\color{activite}
								\else
									\ifnum\thevidecnt=1
										\color{vide}
									\else
										\color{black}
									\fi
								\fi
							\fi
						\fi
					\fi
				\fi
			\fi
		\fi
		\index{#1}
		\fontfamily{phv}\bfseries\selectfont#1\normalfont%
	}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%% \maketitle %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfdeclareradialshading{monarcenciel}{\pgfpoint{0cm}{0cm}}%
{color(0cm)=(blue!50!black); color(5mm)=(blue); color(10mm)=(blue!50);
 color(15mm)=(violet!50); color(20mm)=(blue); color(25mm)=(violet)}

\renewcommand{\maketitle}
{%
	\newpage
	\newgeometry{margin=0cm}
	\parindent -0.1em
	\begin{tikzpicture}
	\shade[shading=monarcenciel] 
    (current page.south west) rectangle (current page.north east);
	\clip (current page.south west) rectangle (current page.north east);
	\node[white] at ($0.5*(current page.north west)+0.5*(current page.north east)+(0,-3em)$) {\helv\today};
	\foreach \i in {0,2,...,100} {
  		\edef\i{\the\numexpr(100-\i)}
  		\node[scale=3] at ($(current page.center)+(0,2)$) {\contourlength{\dimexpr0.05pt*\i}\contour{chapitre!\i}{\Huge\helv\textcolor{blue!50!black}{La proportionnalité}}};
  		\node[scale=3] (title) at ($(current page.center)+(0,-2)$) {\contourlength{\dimexpr0.05pt*\i}\contour{chapitre!\i}{\Huge\helv\textcolor{blue!50!black}{au collège}}};
	}
	\node[below,text=white] at ($(title.south)+(0,-10em)+(0.05,-0.05)$) {\helv\Huge\@author};
	\end{tikzpicture}
	\restoregeometry
	\pagestyle{fancy}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% Environnement des exercices %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcounter{PASexoscount} % compteur désignant le n° de l'exercice
\newcounter{tmpexo}
\newsavebox{\PASdiff}

\newenvironment*{exo}[2][]
{%
	\setcounter{tmpexo}{0}
	% On définit la boite qui va contenir les étoiles
	\begin{lrbox}{\PASdiff}
		\multido{\i=1+1}{#1}
		{%
			\begin{tikzpicture}[every node/.style={inner sep=-2pt,outer sep=0pt}]
				\ifnum\i=1		
					\node (n1) {$\bigstar$};
				\else
					\setcounter{tmpexo}{\i-1}
					\node[right] (n\i) at ($(n\thetmpexo.east)+(2pt,0)$) {$\bigstar$};
					\stepcounter{tmpexo}
				\fi
			\end{tikzpicture}
		}
	\end{lrbox}
	\stepcounter{PASexoscount}
	\def\titre{%
	\helv#2\hfill
	%\raisebox{-5pt}{%
	\usebox{\PASdiff}
	%}
	\afftxtcor{%
	Correction p. \pageref{corrige-\thechapter-\thePASexoscount}}
	}
	\begin{cadre}[style=exercice,titre={\titre}]
}
{%
	\vskip 2ex
	\end{cadre}
}
\newcommand{\afftxtcor}[1]{%
\hskip 1em
\raisebox{-4pt}
{%
\begin{tikzpicture}
\node[inner ysep=2pt,rounded corners,thick,draw] {\fontfamily{phv}\fontsize{10}{12}\selectfont#1};
\end{tikzpicture}
}
}
%---------
% Environnement "correction"

%% Portion de code pour écrire dans un fichier %% Merci pg ...

\newwrite{\output@stream@corrige}
\newcommand{\OuvrirFlux}[1]{% ouvre le flux de fichier
  \immediate\openout\output@stream@corrige #1}
\newcommand{\FermerFlux}{% ferme le flux de fichier
  \immediate\closeout\output@stream@corrige}
\newcommand{\EcritureFlux}[1]{% écrit un court texte dans le fichier
  \immediate\write\output@stream@corrige{\unexpanded{#1}}}
\newcommand{\CommencerExportFlux}{% commence l'écriture prolongée
   \bgroup\@bsphack
   \let\do\@makeother\dospecials
   \catcode`\^^M\active
   \def\verbatim@processline{%
     \immediate\write\output@stream@corrige{\the\verbatim@line}}%
   \verbatim@start}
\ifdefined\ArreterExportFlux % arrête l'écriture prolongée
  \newcommand{\ArreterExportFlux}{\@esphack\egroup}
\else
  \def\ArreterExportFlux{\@esphack\egroup}
\fi

\newenvironment{correction}
  {\OuvrirFlux{Corrections/\thechapter-\thePASexoscount.tex}%
   \EcritureFlux{\begin{corrige}[\thechapter]{\i}}%
   \CommencerExportFlux}
  {\ArreterExportFlux%
   \EcritureFlux{\end{corrige}}%
   \FermerFlux}

\newenvironment{corrige}[2][]
  {\par\vspace*{1em}%
   \label{corrige-#1-#2}
   \noindent%
   \begin{tikzpicture}
   \node (titre) at (0,0) {\fontfamily{phv}\fontsize{10}{12}\fontseries{b}\selectfont Exercice #2};
   \filldraw[fill=exercice!20,draw=exercice] (titre.south west) [rounded corners] --  (titre.north west) -- (titre.north east)[rounded corners=0pt] --  (titre.south east) -- cycle;
    \node (titre) at (0,0) {\fontfamily{phv}\fontsize{10}{12}\fontseries{b}\selectfont Exercice #2};
    \draw[exercice] (titre.south east) -- ($(titre.south east)+(14cm,0)$);
   \end{tikzpicture}\par
   }
  {\vspace*{1em}}

%---------
% Affiche les corrections

\newcommand*\AfficheCorrections
{%
	\begin{tikzpicture}
		\node[fill=bleu!20,draw=bleunuit,thick,text=bleunuit,rounded corners]{%
		\begin{minipage}{\textwidth}%
		   \centering\Huge\fontfamily{phv}\fontseries{bx}\selectfont Corrections
		\end{minipage}
		};
	\end{tikzpicture}
	\multido{\i=1+1}\thePASexoscount{%
		\input{Corrections/\thechapter-\i.tex}
	}
	\setcounter{PASexoscount}{0}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Adaptation des environnements %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{defin}[1][]
{\begin{cadre}[style=definition,titre={#1}]}
{\vskip 2em\end{cadre}}

\newenvironment{prop}[1][]
{\begin{cadre}[style=proposition,titre={#1}]}
{\vskip 2em\end{cadre}}

\newenvironment{exemple}[1][]
{\begin{cadre}[style=exemple,titre={#1}]}
{\vskip 2em\end{cadre}}

\newenvironment{act}[1][]
{\begin{cadre}[style=activite,titre={#1}]}
{\vskip 2em\end{cadre}}

\newenvironment{methode}[1][]
{%
\ifx#1\@empty\def\titre{}\else\def\titre{ : #1}\fi
\begin{cadre}[style=vide,titre={Méthode \titre},color=bleunuit]}
{\vskip 2em\end{cadre}}

\newenvironment{att}
{\begin{cadre}[style=vide,titre={Attention},color=bleunuit]}
{\vskip 2em\end{cadre}}

\newenvironment{rem}
{\begin{cadre}[style=vide,titre={Remarque},color=bleunuit]}
{\vskip 2em\end{cadre}}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% Environnement enumerate %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlist[enumerate,1]{label=\fcolorbox{exercice}{exercice!20}{\bfseries\arabic*}}
\setlist[enumerate,2]{label=\textcolor{definition}{(\alph*)}}

\makeatother
