\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{extension}[Mon test]
\RequirePackage[dvipsnames]{xcolor} % Gestion des couleurs en Latex
\RequirePackage{colortbl} % Coloration de tableaux
\RequirePackage[many]{tcolorbox} % Cadres complets

%%% −−−MISE EN PAGE−−−%%%
\RequirePackage[]{standalone}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[frenchb]{babel}
\RequirePackage[hmargin=2cm, vmargin=2cm]{geometry}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{colortbl}
\RequirePackage[many]{tcolorbox}
\RequirePackage[]{fancyhdr}
\RequirePackage[]{graphicx}
\RequirePackage[]{wrapfig}
\RequirePackage[]{float}
\RequirePackage[]{tabularx}
\RequirePackage{titlesec}
\RequirePackage[]{multirow}
\RequirePackage[]{booktabs}
\RequirePackage[labelsep=endash]{caption}
% \RequirePackage[labelsep=endash]{caption}
\RequirePackage[]{subfig}
\RequirePackage[backgroundcolor=green]{todonotes}
\RequirePackage{longtable}
\RequirePackage{hyperref}

%%%−−−PHYSIQUE ET CHIMIE−−−%%%
\RequirePackage[]{siunitx}
\RequirePackage[]{chemscheme}
\RequirePackage[image={}]{chemschemex}
\RequirePackage[version=4]{mhchem}
\RequirePackage[]{chemfig}
\RequirePackage[]{amsmath}
\RequirePackage[]{amssymb}
\RequirePackage[]{chemmacros}

%%%−−−PAGESTYLE---%%%
\fancyhead[L]{\small{\textsc{\partname~\thepart}}}
\fancyhead[R]{\small{\textsc{\leftmark}}}

%%%−−−FORMATS ET COMMANDES MATHS−−−%%%
% \titleformat*{\section}{\sf\Large\bfseries}
% \titleformat*{\subsection}{\sf\Large}
% \titleformat*{\subsubsection}{\sf\large}
% \titleformat*{\paragraph}{\sf\bfseries}
\captionsetup[table]{name=\textsc{Tableau}}
\addto\captionsfrench{\renewcommand{\partname}{Thème}}
\addto\captionsfrench{\renewcommand{\chaptername}{Fiche}}
\addto\captionsfrench{\renewcommand{\contentsname}{Fiches associées}}
\renewcommand{\arraystretch}{1.5}
% \renewcommand{\thesubsection}{\arabic{subsection}}
% \renewcommand{\thesubsubsection}{\arabic{subsection}.\arabic{subsubsection}}
\newcommand{\fl}{$\rightarrow$ }
\newcommand{\er}{\textsuperscript{er} }
\newcommand{\re}{\textsuperscript{re} }
\newcommand{\me}{\textsuperscript{me} }
\newcommand{\de}{\textsuperscript{de} }
\newcommand{\nd}{\textsuperscript{nd} }
\DeclareMathOperator{\grad}{\overrightarrow{grad}}

%%%−−−MACRO CHEMMACROS−−−%%%
\chemsetup{modules={all}}
\newcommand{\sstate}{\textsuperscript{\standardstate}}
\newcommand{\tstate}{\textsuperscript{\transitionstatesymbol}}

%%% −−−NOUVELLES COMMANDES − LES BOÎTES−−−%%%
\newtcolorbox[]{mybox}[2]{breakable,
  title=#1,
  arc=0pt,
  outer arc=0pt,
  colframe=#2!50!black,
  colback=#2!10!white,
}
\newcommand{\testbox}[1]{
  \begin{mybox}{Boîte de test}{red}
    #1
  \end{mybox}
}
%%%−−−PROJECTION−−−%%%
\newcommand{\projection}[1]{
  \begin{mybox}{Projection}{magenta}
    #1
  \end{mybox}
}

%%%−−−OBJECTIFS−−−%%%
\newcommand{\objectifs}[1]{
  \begin{mybox}{Objectifs}{blue}
    #1
  \end{mybox}
}

%%%−−−ÉLÉMENT IMPOSÉ−−−%%%
\newcommand{\titrelc}[1]{
  \begin{mybox}{Leçon de chimie}{gray}
    \centering
    #1
  \end{mybox}
}

\newcommand{\titrelp}[1]{
  \begin{mybox}{Leçon de physique}{gray}
    \centering
    #1
  \end{mybox}
}

\newcommand{\titremc}[1]{
  \begin{mybox}{Montage de chimie}{gray}
    \centering
    #1
  \end{mybox}
}

%%%−−−MANIPULATION−−−%%%
\newcommand{\manip}[1]{
  \begin{mybox}{Manipulation}{green}
    #1
  \end{mybox}
}

%%%−−−PHASE DE MANIPULATION−−−%%%
\newcommand{\pdm}[1]{
  \begin{mybox}{Phase de manipulation}{magenta}
    #1
  \end{mybox}
}

\newcommand{\test}[1]{
  \begin{tcolorbox}[
    breakable,
    arc=0pt,
    outer arc=0pt,
    ]
    #1
  \end{tcolorbox}
}

\newcommand{\theme}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{black},
	colframe=black,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{black}{Thème -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}

% \newcommand{\element}[1]{\vspace{0.3cm}
% \begin{tcolorbox}[breakable,
% 	enhanced jigsaw,
% 	oversize,
% 	rightrule=0pt,
% 	toprule=0pt,
% 	bottomrule=0pt,
% 	colback=white,
% 	arc=0pt,
% 	outer arc=0pt,
% 	fonttitle=\normalsize\sffamily\bfseries,
% 	titlerule=0pt,
% 	bottomtitle=0pt,
% 	top=0pt,
% 	bottom=0pt,
% 	left=5pt,
% 	before skip = 0.3cm,
% 	after skip = 0.3cm,
% 	blanker, 
% 	borderline west={1.5pt}{-20pt}{gray},
% 	colframe=gray,
% 	width=\textwidth,
% 	left skip = 20pt]
%         \textbf{\textcolor{gray}{Elément imposé -- }} #1
% \end{tcolorbox}
%  \vspace{0.15cm}}

\newcommand{\defi}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{red},
	colframe=red,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{red}{Définition -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}
 
\newcommand{\ex}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{green},
	colframe=green,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{green}{Exemple -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}
 
\newcommand{\expe}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{purple},
	colframe=purple,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{purple}{Expérience -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}} 

\newcommand{\biblio}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{violet},
	colframe=violet,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{violet}{Biblio -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}

 
% \newcommand{\remarque}[1]{\vspace{0.3cm}
% \begin{tcolorbox}[breakable,
% 	enhanced jigsaw,
% 	oversize,
% 	rightrule=0pt,
% 	toprule=0pt,
% 	bottomrule=0pt,
% 	colback=white,
% 	arc=0pt,
% 	outer arc=0pt,
% 	fonttitle=\normalsize\sffamily\bfseries,
% 	titlerule=0pt,
% 	bottomtitle=0pt,
% 	top=0pt,
% 	bottom=0pt,
% 	left=5pt,
% 	before skip = 0.3cm,
% 	after skip = 0.3cm,
% 	blanker, 
% 	borderline west={1.5pt}{-20pt}{orange},
% 	colframe=orange,
% 	width=\textwidth,
% 	left skip = 20pt]
%         \textbf{\textcolor{orange}{Remarque -- }} #1
% \end{tcolorbox}
%  \vspace{0.15cm}}
 
 \newcommand{\transition}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{cyan},
	colframe=cyan,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{cyan}{Transition -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}
 
\newcommand{\proj}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{magenta},
	colframe=magenta,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{magenta}{Projection -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}
 
 \newcommand{\obj}[1]{\vspace{0.3cm}
\begin{tcolorbox}[breakable,
	enhanced jigsaw,
	oversize,
	rightrule=0pt,
	toprule=0pt,
	bottomrule=0pt,
	colback=white,
	arc=0pt,
	outer arc=0pt,
	fonttitle=\normalsize\sffamily\bfseries,
	titlerule=0pt,
	bottomtitle=0pt,
	top=0pt,
	bottom=0pt,
	left=5pt,
	before skip = 0.3cm,
	after skip = 0.3cm,
	blanker, 
	borderline west={1.5pt}{-20pt}{blue},
	colframe=blue,
	width=\textwidth,
	left skip = 20pt]
        \textbf{\textcolor{blue}{Objectifs -- }} #1
\end{tcolorbox}
 \vspace{0.15cm}}

\newcommand{\histoire}[1]{%
  \begin{tcolorbox}[breakable,
    outer arc=0pt,
    arc=0pt,
    ]
   \paragraph{Histoire} #1 
  \end{tcolorbox}
}

\newcommand{\exemple}[1]{%
  \begin{tcolorbox}[breakable,
    outer arc=0pt,
    arc=0pt,
    ]
   \paragraph{Exemple} #1 
  \end{tcolorbox}
}

\newcommand{\remarque}[1]{%
  \begin{tcolorbox}[breakable,
    outer arc=0pt,
    arc=0pt,
    ]
   \paragraph{Remarque} #1 
  \end{tcolorbox}
}


\newcommand{\experience}[1]{%
  \begin{tcolorbox}[breakable,
    outer arc=0pt,
    arc=0pt,
    ]
   \paragraph{Expérience} #1 
  \end{tcolorbox}
}