\NeedsTeXFormat{LaTeX2e}

%%%%%%%%%%%%%%%%%
%  Raccourcis  %
%%%%%%%%%%%%%%%%%

%  Ensembles 
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
%\newcommand{\D}{\mathbb{D}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}

% intervalles ouvert ouvert
\newcommand{\intOO}[2]{\left]{#1}\,{;}\,{#2}\right[}
% intervalles ouvert fermé 
\newcommand{\intOF}[2]{\left]{#1}\,{;}\,{#2}\right]}
% intervalles fermé ouvert
\newcommand{\intFO}[2]{\left[{#1}\,{;}\,{#2}\right[}
% intervalles fermé fermé
\newcommand{\intFF}[2]{\left[{#1}\,{;}\,{#2}\right]}


%% Vecteurs
% représentation d'un vecteur
\renewcommand{\vec}[1]{\overrightarrow{#1}}
% Norme d'un vecteur
\newcommand{\norme}[1]{||\vec{#1}||}
% Produit scalaire 
\newcommand{\scal}[2]{\vec{#1} \cdot \vec{#2}}
\newcommand{\vectCoord}[2]{%
    {\renewcommand{\arraystretch}{1}%
    \left(\begin{array}{c} #1 \\ #2 \end{array}  \right)%
    }%
}

%% Proba
\newcommand{\coefBino}[2]{\vectCoord{#1}{#2}}

%% Logique
\renewcommand{\equiv}{\Leftrightarrow}

%% Calculatrice
\usepackage{listings}
\newcommand{\calc}[1]{\Ovalbox{\lstinline|#1|}}
%\newcommand{\calc}[1]{\verb!#1!}

%% Autres
\newcommand{\TODO}[1]{\textcolor{red}{note(#1)}}

%% Poser des opérations
% \RequirePackage[letterspace=500]{microtype}
% \newcommand{\poseOP}[3]{%
%     \textls{
%     $\begin{array}{cr}
%         & #1 \\[-0.3cm]
%         #2 & #3 \\
%         \hline
%         &
%     \end{array}$}
% }

% Icones
\newcommand{\icon}[2][scale=0.4]{%
\includegraphics[#1]{/media/documents/Cours/Prof/Enseignements/Clipart/icons/#2.png}%
}

% Icones des compétences

\newcommand{\Cher}[1][scale=0.4]{%
    \icon[#1]{card-pick}
}
\newcommand{\Mod}[1][scale=0.4]{%
    \icon[#1]{processor}
}
\newcommand{\Rep}[1][scale=0.4]{%
    \icon[#1]{chart}
}
\newcommand{\Rai}[1][scale=0.4]{%
    \icon[#1]{brain}
    %\icon[#1]{gears}
}
\newcommand{\Cal}[1][scale=0.4]{%
    \icon[#1]{computing}
}
\newcommand{\Com}[1][scale=0.4]{%
    \icon[#1]{conversation}
}
\newcommand{\Con}[1][scale=0.4]{%
    \icon[#1]{book-cover}
}


% ##########################
% Tikz shortcuts
% ##########################

% Les dessins
\RequirePackage{tikz}

%% le cercle trigo
\newcommand{\cercleTrigo}%
{%
    \draw[->, very thick] (-1.2,0) -- (1.3, 0);
    \draw[->, very thick] (0,-1.2) -- (0,1.3);
    \draw[very thick] (0,0) circle (1);
    \draw (0,0) node[below left] {$O$};
    \draw (1,0) node[below right] {$I$};
    \draw (0,1) node[above left] {$J$};
}

%% Le repère orthonormé avec la grille
%%% \repere{xmin}{xmax}{ymin}{ymax}
\newcommand{\repere}[4]%
{%
        \draw[very thin, gray] (#1,#3) grid (#2,#4);
        \draw[->, very thick] (#1,0) -- (#2,0);
        \draw[->, very thick] (0,#3) -- (0,#4);
        \draw (0,0) node[below right, scale=0.7 ] {$O$};
        \draw (0,1) node {-} node[left] {$J$};
        \draw (1,0) node[rotate=90] {-} node[below] {$I$};
    }
\newcommand{\repereNoGrid}[4]%
{%
        \draw[->, very thick] (#1,0) -- (#2,0);
        \draw[->, very thick] (0,#3) -- (0,#4);
    }

%% Diagramme boite
%%% \boxplot{Vertical Center}{min}{Q1}{Me}{Q3}{Max}
\newcommand{\boxplot}[6]%
{%
    \filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
    \draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5}) node[above] {$Min$};
    \draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5}) node[above] {$Q_1$};
    \draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5}) node[above] {$Me$};
    \draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5}) node[above] {$Q_3$};
    \draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5}) node[above] {$Max$};

    \draw (#2, #1) -- (#3, #1);
    \draw (#5, #1) -- (#6, #1);

    %\draw ({(#2 +#3)/2}, #1) node[above] {25\%};
    %\draw ({(#3 +#4)/2}, #1) node[above] {25\%};
    %\draw ({(#4 +#5)/2}, #1) node[above] {25\%};
    %\draw ({(#5 +#6)/2}, #1) node[above] {25\%};

}
\newcommand{\boxplotNoNames}[6]%
{%
    \filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
    \draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5});
    \draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5});
    \draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5});
    \draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5});
    \draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5});

    \draw (#2, #1) -- (#3, #1);
    \draw (#5, #1) -- (#6, #1);
}

