\section{\textcolor{BEGERAD}{Concepts de base}}


\begin{frame}[t, fragile]
\frametitle{\bfseries Un premier exemple avec \TikZ}

\footnotesize

\begin{minipage}{.45\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw[options] (0,0) -- (2,3); 
\end{tikzpicture}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.45\textwidth} %
\hspace{1cm}
\begin{tikzpicture}
\draw (0,0) -- (2,3); 
\end{tikzpicture}
\end{minipage} %

%\vspace{0.5cm}
%\begin{minipage}{.95\textwidth}
{\scriptsize\begin{block}{Syntaxe:}
\begin{itemize}
\item \verb|\draw| :  fonction pour dessiner
\item \verb|[options]| : Options de ligne. Optionnel.
\item \verb| (0,0) -- (2,3)| :  coordonnées des points. Par default, les coordonnées sont ecrites en \texttt{cm}. Si l'on veut considerer d'autres systèmes, on doit le specifier~\verb|(0 in,0 in) -- (2 in,3 in)|
\item ``\verb|--|" : l'opérateur d'extension
\item  ``;" : fin de la commande !
\end{itemize}
\end{block}}
%\end{minipage}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Opérateur d'extension}

\footnotesize

L'opérateur d'extension permet de concaténer une séquence de segments.

\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (2,3) -- (3, -1) -- (4, 2); 
\end{tikzpicture}
\end{verbatim}

\begin{figure}
\centering
\begin{tikzpicture}
\draw (0,0) -- (2,3) -- (3, -1) -- (4, 2); 
\end{tikzpicture}
\end{figure}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries Commande ``;"}

\footnotesize

Permet d'écrire plusieurs commandes sur une seule ligne, ou permet d'écrire une seule commande sur plusieurs lignes :

\begin{verbatim}
\begin{tikzpicture}
\draw (0,1) -- (2,3); \draw (0, 3) -- (4, 2); 
\end{tikzpicture}
\end{verbatim}

\begin{figure}
\begin{tikzpicture}[scale=0.75]
\draw (0,1) -- (2,3); \draw (0, 3) -- (4, 2); 
\end{tikzpicture}
\end{figure}

\begin{minipage}{.45\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- 
			 (2,3) --
			(3, -1) -- (4, 2); 
\end{tikzpicture}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.45\textwidth} %
\begin{tikzpicture}[scale=0.75]
\draw (0,0) -- 
			 (2,3) --
			(3, -1) -- (4, 2); 
\end{tikzpicture}
\end{minipage} %

\end{frame}

\begin{frame}[ fragile]
\frametitle{\bfseries Placement des figures \TikZ}

\footnotesize

Lorsque une figure est faite, \LaTeX{} la place dans un carré ``imaginaire" qui englobe la figure dessinée!

\vspace{0.5cm}

\begin{minipage}{.5\textwidth} %
\begin{verbatim}
\fbox{
\begin{tikzpicture}
\draw (0,0) -- 
			 (2,3) --
			(3, -1) -- (4, 2); 
\end{tikzpicture}
}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.45\textwidth} %
\fbox{
\begin{tikzpicture}
\draw (0,0) -- 
			 (2,3) --
			(3, -1) -- (4, 2); 
\end{tikzpicture}
}
\end{minipage} %

\end{frame}

\begin{frame}[fragile]
\frametitle{\bfseries Placement des figures \TikZ}

\footnotesize

\begin{exampleblock}{Exemple}
\end{exampleblock}

\begin{verbatim}
Soit la ligne 
\begin{tikzpicture}
\draw (0,0) -- (3,0);
\end{tikzpicture}
, elle a été placée au milieu du texte.
\end{verbatim}

Soit la ligne 
\begin{tikzpicture}
\draw (0,0) -- (3,0);
\end{tikzpicture}, elle a été placée au milieu du texte.

\vspace{0.5cm}

\textbf{Ou encore:}

\begin{verbatim}
Soit la ligne \tikz \draw (0,0) -- (3,0);, elle a été
placée au milieu du texte.
\end{verbatim}

Soit la ligne \tikz \draw (0,0) -- (3,0);, elle a été placée au milieu du texte.

\end{frame}


\begin{frame}[fragile]
\frametitle{\bfseries Des figures \TikZ ne sont pas des ``figures" \LaTeX !}

\footnotesize

La figure \ref{fig:exemple_tikz} illustre l'utilisation de \TikZ comme figure \LaTeX.

\vspace{0.5cm}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2)
-- (2,0) -- (0,0); 
\end{tikzpicture}
\caption{Le premier exemple
\TikZ}
\label{fig:exemple_tikz}
\end{figure}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.4\textwidth} %

\begin{figure}[!htb]
\centering
\captionsetup{justification=centering}
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
\caption{Le premier exemple \TikZ}
\label{fig:exemple_tikz}
\end{figure}
\end{minipage} %
\smallskip

\begin{itemize}
    \item Ça permet à la figure Ti\textit{k}{Z} d'avoir un comportement \texttt{flottant}!
\end{itemize}

\begin{exampleblock}{Remarque}
Ce format est le plus utilisé dans la ``vie réelle"!
\end{exampleblock}

\end{frame}

\begin{frame}[fragile]
\frametitle{\bfseries Redimensionner les figures \TikZ}

\footnotesize

Prenons le carré dessiné précédemment:

\vspace{.5cm}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2)
-- (2,0) -- (0,0); 
\end{tikzpicture}
\end{figure}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.4\textwidth} %
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
\end{figure}
\end{minipage} %

\vspace{1cm}

\only<2->{
\begin{minipage}{.65\textwidth} %
%\begin{block}{}
Comment on peut faire un carré $2 \times$ plus grand et un carré $2 \times$ plus petit? 
%\end{block}
\end{minipage} %
\begin{minipage}{.25\textwidth} %
\begin{figure}
\includegraphics[scale=0.10]{Figures/Emoji_Thinking}
\end{figure}
\end{minipage} %
}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries Redimensionner les figures \TikZ}

\footnotesize

\begin{minipage}{.40\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (0,4) --
(4,4) -- (4,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.55\textwidth} %
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\draw (0,0) -- (0,4) --(4,4) -- (4,0) -- (0,0); 
\node at (2, 2) {A};
\end{tikzpicture}
\caption{Carré $2\times$ plus grand}
\label{fig:exemple_carre_plus_grand}
\end{figure}
\end{minipage} %

\begin{minipage}{.40\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (0,1) --
(1,1) -- (1,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage} %
\begin{minipage}{.55\textwidth} %
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\draw (0,0) -- (0,1) -- (1,1) -- (1,0) -- (0,0); 
\node at (0.5, 0.5) {A};
\end{tikzpicture}
\caption{Carré $2\times$ plus petit}
\label{fig:exemple_carre_plus_petit}
\end{figure}
\end{minipage} %

\only<2->{
\begin{textblock*}{2cm}(9.6cm, -1.7cm)
\includegraphics[scale=0.07]{Figures/Emoji_Thumbs_Up}
\end{textblock*}
}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries Redimensionner les figures \TikZ}

\footnotesize

%\begin{block}{}
L’idée proposée avant marche bien, mais est-ce que cette approche est la plus pratique ? Et si on avait plusieurs coordonnées ?
%\end{block}

\begin{figure}
\includegraphics[scale=0.08]{Figures/Emoji_Des}
\end{figure}

\only<2->{
%\begin{block}{}
Heureusement, il y existe une fonction qui peut rendre notre vie bien plus facile~!
%\end{block}

\begin{figure}
\includegraphics[scale=0.15]{Figures/Emoji_Smile}
\end{figure}
}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries Redimensionner les figures \TikZ}

\footnotesize

\begin{minipage}{.40\textwidth} %
\begin{verbatim}
\begin{tikzpicture}[scale=2]
\draw (0,0) -- (0,2) -- (2,2)
 -- (2,0) -- (0,0); 
\end{tikzpicture}
\caption{Carré 2X plus grand}
\end{verbatim}
\end{minipage}
\begin{minipage}{.55\textwidth} %
\begin{figure}[!htb]
\centering
\captionsetup{justification=centering}
\begin{tikzpicture}[scale=2]
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\node at (1, 1) {A};
\end{tikzpicture}
\caption{Carré $2\times$ plus grand}
\label{fig:exemple_tikz_scale_grand}
\end{figure}
\end{minipage}

\begin{minipage}{.40\textwidth} %
\begin{verbatim}
\begin{tikzpicture}[scale=0.5]
\draw (0,0) -- (0,2) -- (2,2)
-- (2,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.55\textwidth} %
\begin{figure}[!htb]
\centering
\captionsetup{justification=centering}
\begin{tikzpicture}[scale=0.5]
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\node at (1, 1) {A};
\end{tikzpicture}
\caption{Carré $2\times$ plus petit}
\label{fig:exemple_tikz_scale_petit}
\end{figure}
\end{minipage}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries Redimensionner les figures \TikZ}

\footnotesize

On a aussi la possibilité de redimensionner juste une des dimensions, c'est-à-dire, \texttt{x} et \texttt{y}.

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}[xscale=2]
\draw (0,0) -- (0,2) -- (2,2)
 -- (2,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{figure}[!htb]
\centering
\begin{tikzpicture}[xscale=2]
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
%\caption{Carré $2\times$ plus grand dans la dimension \texttt{x}}
\end{figure}
\end{minipage}
\smallskip

%\vspace{.25cm}
\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}[yscale=2]
\draw (0,0) -- (0,2) -- (2,2)
 -- (2,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{figure}[!t]
\centering
\begin{tikzpicture}[yscale=2]
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
%\caption{Carré $2\times$ plus grand dans la dimension \texttt{y}}
\end{figure}
\end{minipage}
\smallskip
\begin{textblock*}{7cm}(0cm, -1.5cm)
%\begin{minipage}{.95\textwidth}
{\tiny\begin{exampleblock}{Remarque}%\tiny
L'utilisation simultanée de \verb|xscale| et \verb|yscale| equivaut à \verb|scale|!
\end{exampleblock}}
%\end{minipage}
\end{textblock*}

\end{frame}


\begin{frame}[t, fragile]
	\frametitle{\bfseries Redimensionner les figures \TikZ (Bonus)}
	
	\footnotesize

\begin{block}{\texttt{resizebox}}
\end{block}

\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}[scale=1.5]
\draw (0,0) -- (0,2) --
   (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[scale=1.5]
\draw (0,0) -- (0,2) --
   (2,2) -- (2,0) -- (0,0); 
\node at (1, 1) {A};   
\end{tikzpicture}
\end{minipage}

\vspace{0.3cm}

\begin{minipage}{.48\textwidth}

\begin{verbatim}
\resizebox{3cm}{3cm}{
\begin{tikzpicture}
	\draw (0,0) -- (0,1) --
   (1,1) -- (1,0) -- (0,0); 
\end{tikzpicture}}
\end{verbatim}

\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\resizebox{3cm}{3cm}{\begin{tikzpicture}
	\draw (0,0) -- (0,1) -- (1,1) -- (1,0) -- (0,0); 
\node at (0.5, 0.5) {A};	
\end{tikzpicture}}
\end{minipage}



	
\end{frame}

\begin{frame}[fragile]
\frametitle{\bfseries Séparant le code \TikZ du corps du texte}

\footnotesize

\begin{minipage}{.55\textwidth} %
Mettre juste le code \TikZ dans un fichier externe.
\begin{verbatim}
\begin{figure}[!htb]
\centering
\input{example_latex2}
\caption{Le premier exemple
\TikZ}
\label{fig:exemple_tikz3}
\end{figure}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{figure}[!h]
\centering
\captionsetup{justification=centering}
\input{Examples/example_latex2}
\caption{Le premier exemple \TikZ}
\label{fig:exemple_tikz3}
\end{figure}
\end{minipage}

\vspace{0.5cm}


\begin{Verbatim}[frame=single]
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
\end{Verbatim} 



\end{frame}

\begin{frame}[fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

On peut toujours dessiner des formes en jouant avec des segments.

\vspace{1cm}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (0,3) --
(3,3) -- (3,0) -- (0,0);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) -- (0,3) -- (3,3) -- (3,0) -- (0,0);
\end{tikzpicture}
\end{minipage}

\vspace{1cm}

\only<2->{\TikZ possède des commandes spéciales qui nous permettent de dessiner certaines formes plus facilement!}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Rectangle}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) rectangle (3,3);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) rectangle (3,3);
\end{tikzpicture}
\end{minipage}

\vspace{1cm}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) rectangle (4,2);
\end{tikzpicture}
\end{minipage}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Parabole}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) parabola (4,4);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) parabola (4,4);
\end{tikzpicture}
\end{minipage}


\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Arcs}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) arc [radius = 1.5,
    start angle = 30,
    end angle = 270];
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) arc [radius = 1.5, start angle = 30, end angle = 270];
\draw [dashed] (0,0) arc [radius = 2, start angle = 30, end angle = 0];
\draw [fill=black] (0,0) circle (0.05cm);
\end{tikzpicture}
\end{minipage}

\begin{itemize}
\item \verb|(0,0)| le point inital de l'arc
\item \verb|arc| commande pour dessiner l'arc
\item \verb|radius|
\item \verb|start angle = 30| l'angle inital
\item \verb|end angle = 270| l'angle final
\item [] \textcolor{OGERAD}{\textbf{Remarque :} Les angles sont en degrés.}
\end{itemize}

\end{frame}



\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Arcs}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) arc [radius = 1.5,
    start angle = 0
    end angle = 360];
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) arc [radius = 1.5, start angle = 0, end angle = 360];
\end{tikzpicture}
\end{minipage}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Cercle}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\end{tikzpicture}
\end{minipage}


\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Cercle x Arcs}
\end{block}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}[scale=0.8]
\draw (0,0) circle (2cm);
\draw[fill=black] (0,0) circle (0.1cm);
\end{tikzpicture}
\end{minipage}

\begin{minipage}{.55\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) arc [radius = 2,
    start angle = 0
    end angle = 360];
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.4\textwidth} %
\begin{tikzpicture}[scale=0.8]
\draw (0,0) arc [radius = 2, start angle = 0, end angle = 360];
\draw[fill=black] (0,0) circle (0.1cm);
\end{tikzpicture}
\end{minipage}


\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries Des formes géométriques basiques}
\footnotesize

\begin{block}{Ellipse}
\end{block}

\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) ellipse (3cm and 1cm);
\end{tikzpicture}

\end{frame}


\begin{frame}[fragile]
\frametitle{\bfseries Grilles}
\footnotesize

\begin{minipage}{.48\textwidth} %
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) grid (5,5); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth} %
\begin{tikzpicture}
\draw (0,0) grid (5,5); 
\end{tikzpicture}
\end{minipage}

\end{frame}

%\begin{frame}[t, fragile]
%\frametitle{\bfseries Grilles}
%\footnotesize
%
%\begin{minipage}{.48\textwidth} %
%\begin{verbatim}
%\begin{tikzpicture}
%\draw[step=2cm, red,
%   very thin]
%   (0,0) grid (6,6); 
%\end{tikzpicture}
%\end{verbatim}
%\end{minipage}
%\begin{minipage}{.48\textwidth} %
%\begin{tikzpicture}[scale=0.75]
%\draw[step=2cm, red, very thin] (0,0) grid (6,6); 
%\end{tikzpicture}
%\end{minipage}
%
%\begin{block}{Remarque}
%Le pas défaut est de 1 cm!
%\end{block}
%
%\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Décorations sur les lignes}
\footnotesize

\begin{itemize}
\item Lorsque on prépare des figures \LaTeX{}, on a besoin de les rendre plus ``belles"
\item La pluspart des décorations peuvent être ajoutées en ajoutant des paramètres à la fonction \verb|\draw|!
\end{itemize}

\vspace{0.5cm}

\only<2->{
\begin{block}{Décorations}
\begin{enumerate}
\item Flèches et barres
\item Épaisseur des lignes (définie et personnalisée)
\item Lignes pointillées et lignes en tireté
\item Lignes courbées
\item Couleurs
\end{enumerate}
\end{block}
}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 1.  Flèches et barres}
\footnotesize

\begin{verbatim}
\draw (0,0) -- (3,3); 
\draw[->] (2,0) -- (5,3); 
\draw[>->] (4,0) -- (7,3);
\draw[<->] (6,0) -- (9,3);  
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) -- (3,3); 
\draw[->] (2,0) -- (5,3); 
\draw[>->] (4,0) -- (7,3);
\draw[<->] (6,0) -- (9,3);  
\end{tikzpicture}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 1.  Flèches et barres}
\footnotesize

\begin{verbatim}
\draw (0,0) -- (3,3); 
\draw[-|] (2,0) -- (5,3); 
\draw[|-] (4,0) -- (7,3);
\draw[|-|] (6,0) -- (9,3);
\draw[|-stealth] (8,0) -- (11,3);    
\end{verbatim}

\begin{tikzpicture}[scale = 0.9]
\draw (0,0) -- (3,3); 
\draw[-|] (2,0) -- (5,3); 
\draw[|-] (4,0) -- (7,3);
\draw[|->] (6,0) -- (9,3);
\draw[|-stealth] (8,0) -- (11,3);    
\end{tikzpicture}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 1.  Flèches et barres}
\footnotesize

\begin{itemize}
\item Les flèches (barres) seront toujours ajoutées aux extrémités du premier et du dernier segment (si c'est le cas).
\item \TikZ (défaut) n'a pas une commande pour mettre des flèches au milieu des segments. On a besoin de ``tricher"!
\end{itemize}

\vspace{0.5cm}

\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw[->] (0,1) -- (1,1); \draw (1, 1) -- (3,1);
\draw[->] (0,0.5) -- (1.5,0.5); \draw (1.5,0.5) -- (3,0.5);
\draw[->] (0,0) -- (3,0); 
\end{tikzpicture}
\end{verbatim}
\end{minipage}

\vspace{0.5cm}

\begin{figure}
\centering
\begin{tikzpicture}[scale=1.3]
\draw[->] (0,1) -- (1,1); \draw (1, 1) -- (3,1);
\draw[->] (0,0.5) -- (1.5,0.5); \draw (1.5,0.5) -- (3,0.5);
\draw[->] (0,0) -- (3,0); 
\end{tikzpicture}
\end{figure}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 1.  Flèches et barres (Bonus)}
\footnotesize

C'est très bien pour faire des axes.

\begin{verbatim}
\begin{tikzpicture}
\draw [<->] (0,3) -- (0,0) -- (3,0); 
\end{tikzpicture}
\end{verbatim}

\begin{figure}
\centering
\begin{tikzpicture}
\draw [<->] (0,3) -- (0,0) -- (3,0); 
\end{tikzpicture}
\end{figure}


\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 2.  Épaisseur des lignes }
\footnotesize

\begin{block}{Définies}
\end{block}

\begin{verbatim}
\draw[ultra thick] (0,2) -- (3,2); 
\draw[thick] (0,1.5) -- (3,1.5); 
\draw[thin] (0,1) -- (3,1); 
\draw (0,0.5) -- (3,0.5); 
\draw[help lines]  (0,0) -- (3,0); 
\end{verbatim}

\begin{figure}
\begin{tikzpicture}[scale=1.5]
\draw[ultra thick] (0,2) -- (3,2); 
\draw[thick] (0,1.5) -- (3,1.5); 
\draw[thin] (0,1) -- (3,1); 
\draw (0,0.5) -- (3,0.5); 
\draw[help lines]  (0,0) -- (3,0); 
\end{tikzpicture}
\end{figure}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 2.  Épaisseur des lignes }
\footnotesize

\begin{block}{Définies - Lignes d'aide}
\end{block}

Rendent les lignes plus ``grises", pâle et un peu plus étroites.

\begin{verbatim}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (5,5); 
\end{tikzpicture}
\end{verbatim}

\begin{minipage}{.48\textwidth} %
\begin{tikzpicture}[scale=0.65]
\draw[help lines] (0,0) grid (5,5); 
\end{tikzpicture}
\end{minipage}
\only<2->{
\begin{minipage}{.48\textwidth} %
\begin{tikzpicture}[scale=0.65]
\draw(0,0) grid (5,5); 
\end{tikzpicture}
\end{minipage}
}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 2.  Épaisseur des lignes }
\footnotesize

Utiliser des ``help lines" pour surligner des points.

\begin{verbatim}
\begin{tikzpicture}
\draw [<->] (0,5) -- (0,0) -- (5,0); 
\draw[help lines]  (0,2.5) -- (2.5,2.5) -- (2.5,0); 
\draw[thick]  (0,0) -- (5,5); 
\draw[fill=black] (2.5,2.5) circle (0.1cm);
\end{tikzpicture}
\end{verbatim}

\begin{figure}
\centering
\begin{tikzpicture}[scale=0.75]
\draw [<->] (0,5) -- (0,0) -- (5,0); 
\draw[help lines]  (0,2.5) -- (2.5,2.5) -- (2.5,0); 
\draw[thick]  (0,0) -- (5,5); 
\draw[fill=black] (2.5,2.5) circle (0.1cm);
\end{tikzpicture}
\end{figure}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 2.  Épaisseur des lignes }
\footnotesize

\begin{block}{Customisées}
\end{block}

\begin{verbatim}
\draw[line width=12] (0,1) -- (3,1);
\draw[line width=5] (0,0.5) -- (3,0.5);
\draw (0,0) -- (3,0); 
\end{verbatim}

\begin{figure}
\centering
\begin{tikzpicture}[scale=1.3]
\draw[line width=12] (0,1) -- (3,1);
\draw[line width=5] (0,0.5) -- (3,0.5);
\draw (0,0) -- (3,0); 
\end{tikzpicture}
\end{figure}

\begin{exampleblock}{Remarque}
La dimension par défaut est le \textit{point} (1 point $\approx 0.035$ cm).
\end{exampleblock}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 3.  Lignes pointillées et lignes en tireté }
\footnotesize

\begin{verbatim}
\begin{tikzpicture}
\draw[dashed, ->] (0,2) -- (3,2); 
\draw[dashed] (0,1.5) -- (3,1.5); 
\draw[dotted] (0,1) -- (3,1); 
\draw[dashed, ultra thick] (0,0.5) -- (3,0.5); 
\draw[dashed, ->] (0,0) -- (3,0); 
\end{tikzpicture}
\end{verbatim}

\vspace{0.5cm}

\begin{figure}
\centering
\begin{tikzpicture}[scale=1.2]
\draw[dashed, ->] (0,2) -- (3,2); 
\draw[dashed] (0,1.5) -- (3,1.5); 
\draw[dotted] (0,1) -- (3,1); 
\draw[dashed, ultra thick] (0,0.5) -- (3,0.5); 
\draw[dashed, ->] (0,0) -- (3,0); 
\end{tikzpicture}
\end{figure}


\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (2,2); 
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) -- (2,2); 
\end{tikzpicture}

\end{minipage}
\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) to
    [out=30,in=270] (2,2); 
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) to [out=30, in=270] (2,2); 
\end{tikzpicture}
\end{minipage}

\begin{block}<+->{}
\begin{minipage}{.95\textwidth}
\begin{itemize}
\item<+-> \verb|out|: Placer une aiguille avec une extremité sur le point \verb|(0,0)| et l'autre vers la droite, et ensuite la tourner dans le sens inverse des aiguilles d'une montre jusqu'à atteindre l'angle desiré.
\item<+-> \verb|in|: Placer une aiguille avec une extremité sur le point \verb|(2,2)| et l'autre vers la droite, et ensuite la tourner dans le sens inverse des aiguilles d'une montre jusqu'à atteindre l'angle desiré.
\end{itemize}
\end{minipage}
\end{block}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

Prenez compte que l'opérateur \verb|to| peut être utilisé pour dessiner des lignes droites. En fait, on peut même les mélanger.

\vspace{1cm}
\begin{minipage}{0.45\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) to (2,3); 
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) to (2,3); 
\end{tikzpicture}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (2,3) to (5,0);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw (0,0) -- (2,3) to (5,0);
\end{tikzpicture}

\end{minipage}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

Cependant, afin de rendre le code plus lisible et organisé, on va restreindre l'utilisation de ``to" pour dessiner des courbes et ``\verb|--|" pour faire des lignes droites. C'est juste une bonne pratique.

\begin{verbatim}
\begin{tikzpicture}
\draw (0,0) -- (2,3); 
\draw (0,0) to [out=30, in=270] (2,3); 
\end{tikzpicture}
\end{verbatim}

\begin{figure}
\begin{tikzpicture}
\draw (0,0) -- (2,3); 
\draw (0,0) to [out=30, in=270] (2,3); 
\end{tikzpicture}
\end{figure}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

\begin{block}{Des coins ronds}
\end{block}

\begin{minipage}{.49\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\draw [<->,
rounded corners]
(0,3) -- (0,0) -- (3,0); 
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw [<->, rounded corners] (0,3) -- (0,0) -- (3,0); 
\end{tikzpicture}

\end{minipage}
\begin{minipage}{.49\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\draw[rounded corners] 
(0,0) rectangle (3,3);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw[rounded corners]  (0,0) rectangle (3,3);
\end{tikzpicture}
\end{minipage}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

\begin{block}{Un exemple un peu plus élaboré}
\end{block}

\begin{figure}[!h]
\centering
\begin{tikzpicture}[scale=0.4]
%\draw[line width=0.05cm] (5,2) to [out=110,in=220] (5,4.5) to [out=40,in=250] (8,5) to [out=80,in=250] (7,7) to [out=60,in=90] (14,3) to [out=270,in=0] (5,-3);
\draw[line width=0.05cm] (5,2) to [out=110,in=220] (5,4.5) to [out=40,in=250] (8,5) to [out=80,in=250] (7,7) to [out=60,in=90] (14,3) to [out=270,in=0] (5,-3) to [out=180,in=180] (5,-2.8);
\draw[line width=0.05cm] (9,4.2) to [out=90,in=90] (13,3) to [out=270,in=0] (5,-2.8);
\draw[line width=0.05cm] (10.6,1.8) to [out=90,in=270] (10.5,3) to [out=90,in=270] (9,4.2); 
\draw[line width=0.05cm] (10.6,1.8) to [out=270,in=70] (10.8,0) to [out=250,in=0] (5.4,-2);
\draw[line width=0.05cm] (5.4,-1.8) to [out=180,in=180] (5.4,-2);
\draw[line width=0.05cm] (5.4,-1.8) to [out=10,in=260] (10,1.5) to [out=90,in=0] (8,1.5) to [out=180,in=40] (6.5,1.5) to [out=220,in=0] (4.5,-1.4);
\draw[line width=0.05cm] (1.8,1.7) to [out=270,in=90] (1,0) to [out=270,in=180] (4.5,-1.4);
\draw[line width=0.05cm] (1.8,1.7) to [out=100,in=270] (1.5,3) to [out=90,in=300] (3.5,4.5) to [out=120,in=90] (-1,3) to [out=270,in=180] (4.1,-2) to [out=0,in=0] (4.3,-2.5);
\draw[line width=0.05cm] (4,4.5) to [out=50,in=310] (4.3,7) to [out=140,in=90] (-2,3) to [out=270,in=190] (4.3,-2.5);
\draw[line width=0.05cm] (3.2,1.7) to [out=60,in=270] (3.4,3) to [out=90,in=220] (4,4.5);
\draw[line width=0.05cm] (3.2,1.7) to [out=250,in=90] (2.4,1);
\draw[line width=0.05cm] (5,-1.6) to [out=200,in=270] (2.4,1); 
\draw[line width=0.05cm] (5,-1.6) to [out=20,in=270] (8,1.8) to [out=80,in=270] (8.5,3) to [out=90,in=340] (8,4.5) to [out=190,in=30] (6,1.5) to [out=220,in=270](3.4,1.5);
\end{tikzpicture}
\end{figure}

\end{frame}



\begin{frame}[t, fragile]
\frametitle{\bfseries 4.   Lignes courbées}
\footnotesize

\begin{block}{Un exemple un peu plus élaboré}
\end{block}

\newsavebox\myv

\begin{lrbox}{\myv}\begin{minipage}{1.8\textwidth}
		\begin{verbatim}
\begin{tikzpicture}[scale=0.4]
\draw[line width=0.05cm] (5,2) to [out=110,in=220] (5,4.5) to [out=40,in=250]
    (8,5) to [out=80,in=250] (7,7) to [out=60,in=90] (14,3) to [out=270,in=0]
   (5,-3) to [out=180,in=180] (5,-2.8);
\draw[line width=0.05cm] (9,4.2) to [out=90,in=90]
    (13,3) to [out=270,in=0] (5,-2.8);
\draw[line width=0.05cm] (10.6,1.8) to [out=90,in=270]
    (10.5,3) to [out=90,in=270] (9,4.2); 
\draw[line width=0.05cm] (10.6,1.8) to [out=270,in=70]
    (10.8,0) to [out=250,in=0] (5.4,-2);
\draw[line width=0.05cm] (5.4,-1.8) to [out=180,in=180] (5.4,-2);
\draw[line width=0.05cm] (5.4,-1.8) to [out=10,in=260] (10,1.5) to [out=90,in=0]
    (8,1.5) to [out=180,in=40] (6.5,1.5) to [out=220,in=0] (4.5,-1.4);
\draw[line width=0.05cm] (1.8,1.7) to [out=270,in=90]
    (1,0) to [out=270,in=180] (4.5,-1.4);
\draw[line width=0.05cm] (1.8,1.7) to [out=100,in=270] (1.5,3) to [out=90,in=300]
    (3.5,4.5) to [out=120,in=90] (-1,3) to [out=270,in=180]
    (4.1,-2) to [out=0,in=0] (4.3,-2.5);
\draw[line width=0.05cm] (4,4.5) to [out=50,in=310] (4.3,7) to [out=140,in=90]
    (-2,3) to [out=270,in=190] (4.3,-2.5);
\draw[line width=0.05cm] (3.2,1.7) to [out=60,in=270]
    (3.4,3) to [out=90,in=220] (4,4.5);
\draw[line width=0.05cm] (3.2,1.7) to [out=250,in=90] (2.4,1);
\draw[line width=0.05cm] (5,-1.6) to [out=200,in=270] (2.4,1); 
\draw[line width=0.05cm] (5,-1.6) to [out=20,in=270] (8,1.8) to [out=80,in=270]
    (8.5,3) to [out=90,in=340] (8,4.5) to [out=190,in=30]
    (6,1.5) to [out=220,in=270](3.4,1.5);
\end{tikzpicture}
\end{verbatim}
\end{minipage}\end{lrbox}
\resizebox{0.95\textwidth}{!}{\usebox\myv}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\footnotesize

\begin{verbatim}
\begin{tikzpicture}
\draw [line width = 6, red] (0,0) to (1,0);
\end{tikzpicture}
\end{verbatim}

\begin{figure}[!h]
\centering
\begin{minipage}{.3\textwidth} %
\begin{tikzpicture}
\node[right] at (1,0){Red};
\draw [line width = 6, red] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Green};
\draw [line width = 6, green] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Blue};
\draw [line width = 6, blue] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Cyan};
\draw [line width = 6, cyan] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Magenta};
\draw [line width = 6,magenta] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Yellow};
\draw [line width = 6, yellow] (0,0) to (1,0);
\end{tikzpicture}
\end{minipage} %
\begin{minipage}{.3\textwidth} %
\begin{tikzpicture}
\node[right] at (1,0){Black};
\draw [line width = 6, black] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Gray};
\draw [line width = 6, gray] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Darkgray};
\draw [line width = 6, darkgray] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Lightgray};
\draw [line width = 6, lightgray] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Brown};
\draw [line width = 6, brown] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Lime};
\draw [line width = 6, lime] (0,0) to (1,0);
\end{tikzpicture}
\end{minipage}
\begin{minipage}{.3\textwidth} %
\begin{tikzpicture}
\node[right] at (1,0){Olive};
\draw [line width = 6, olive] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Orange};
\draw [line width = 6, orange] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Pink};
\draw [line width = 6, pink] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Purple};
\draw [line width = 6, purple] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Teal};
\draw [line width = 6, teal] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\node[right] at (1,0){Violete};
\draw [line width = 6, violet] (0,0) to (1,0);
\end{tikzpicture}
\end{minipage}
\end{figure}

Ou définissez vos propres couleurs!

\verb!\definecolor{BGERAD}{RGB}{0,82,155}!

\begin{tikzpicture}
\node[right] at (1,0){Bleu GERAD};
\draw [line width = 6, BGERAD] (0,0) to (1,0);
\end{tikzpicture}



\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\footnotesize

\begin{block}{Colorer des lignes}
\end{block}

\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw [->,
    line width = 2,
    red] (0,0) -- (3,3);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw [->, line width = 2, red] (0,0) -- (3,3);
\end{tikzpicture}

\end{minipage}
\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw [<->,
    thick, cyan]
    (0,0) to [out=90,in=180]
    (1,1) to [out=0,in=180]
    (2.5,0) to [out=0,in=-135]
    (4,1) ;
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}

\draw [<->,thick, cyan] (0,0) to [out=90,in=180] (1,1)
to [out=0,in=180] (2.5,0) to [out=0,in=-135] (4,1) ;
\end{tikzpicture}

\end{minipage}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\footnotesize

\begin{block}{Colorer des figures bien définies}
\end{block}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue]
  (0,0) rectangle (3,3);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[scale=0.5]
\draw[fill=blue] (0,0) rectangle (3,3);
\end{tikzpicture}
\end{minipage}

\vspace{0.5cm}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue, red]
  (0,0) rectangle (3,3);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[scale=0.5]
\draw[red, fill=blue] (0,0) rectangle (3,3);
\end{tikzpicture}
\end{minipage}

\vspace{0.5cm}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue, blue]
  (0,0) rectangle (3,3);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[scale=0.5]
\draw[blue, fill=blue] (0,0) rectangle (3,3);
\end{tikzpicture}
\end{minipage}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\footnotesize

\begin{block}{Colorer des figures bien définies}
\end{block}

\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw[fill=yellow]
(0,0) circle (2cm);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}
\draw[fill=yellow] (0,0) circle (2cm);
\end{tikzpicture}

\end{minipage}
\begin{minipage}{.48\textwidth}
\begin{verbatim}
\begin{tikzpicture}
\draw[fill=pink]
(0,0) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}[scale=0.8]
\draw[fill=pink] (0,0) ellipse (3cm and 1cm);
\end{tikzpicture}

\end{minipage}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\footnotesize

\begin{block}{Mélanger des couleurs}
\end{block}

\begin{minipage}{.48\textwidth}

\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue!30!red]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}

\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue!50!red]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}

\begin{verbatim}
\begin{tikzpicture}
\draw[fill=blue!70!red]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}

\end{minipage}
\begin{minipage}{.48\textwidth}

\begin{tikzpicture}[scale=0.85]
\draw[fill=blue!30!red] (0,0) rectangle (4,2);
\end{tikzpicture}

\begin{tikzpicture}[scale=0.85]
\draw[fill=blue!50!red] (0,0) rectangle (4,2);
\end{tikzpicture}

\begin{tikzpicture}[scale=0.85]
\draw[fill=blue!70!red] (0,0) rectangle (4,2);
\end{tikzpicture}
\end{minipage}

\begin{textblock*}{8cm}(1cm, 0cm)
\begin{minipage}{.95\textwidth}
{\tiny\begin{exampleblock}{Remarque}%\tiny
Ajouter \verb|\usepackage{xcolor}| avant \verb|\usepackage{tikz}|!
\end{exampleblock}}
\end{minipage}
\end{textblock*}

\end{frame}


\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\scriptsize

\begin{block}{Dégradé}
\end{block}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\shade[top color=green,
   bottom color=yellow]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[rounded corners,ultra thick]
\shade[top color=green,bottom color=yellow](0,0) rectangle (4,2);
\end{tikzpicture}
\end{minipage}
\smallskip
%\vspace{0.3cm}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\shade[left color=green,
   right color=yellow]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[rounded corners,ultra thick]
\shade[left color=green,right color=yellow] (0,0) rectangle (4,2);
\end{tikzpicture}
\end{minipage}
\smallskip
%\vspace{0.3cm}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\shadedraw[inner color=blue,
   outer color=yellow, draw=green]
   (0,0) rectangle (4,2);
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.48\textwidth}
\centering
\begin{tikzpicture}[rounded corners,ultra thick]
\shadedraw[inner color=blue,outer color=yellow,draw=green] (0,0) rectangle (4,2);
\end{tikzpicture}
\end{minipage}

\end{frame}

\begin{frame}[t, fragile]
\frametitle{\bfseries 5.  Couleurs}
\scriptsize

\begin{block}{Dégradé}
\end{block}

\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\shade[ball color=red]
    (0,0) circle (1cm);
\end{tikzpicture}
\end{verbatim}
\vfill
\begin{tikzpicture}
\draw[green] (0,0) to [out=90, in=200] (1,2);
\draw[green] (0.68, 1.85) to [out=180, in=60] (-1,1.5);
\draw[green] (-1,1.5) to [out=320, in=180] (0.2,1.2);
\shade[ball color=red] (0,0) circle (1cm);
\end{tikzpicture}
\end{minipage}
%
\begin{minipage}{.48\textwidth}
\centering
\begin{verbatim}
\begin{tikzpicture}
\shade[ball color=green]
    (0,0) rectangle (2,4);
\end{tikzpicture}
\end{verbatim}

\begin{tikzpicture}[rounded corners,ultra thick, scale = 0.85]
\shade[ball color=green] (0,0) rectangle (2,3);
\node[inner sep=0pt] (SuperMario) at (1,4.3) {\only<2->{\includegraphics[width=0.3\textwidth]{Figures/Super_Mario}}};
\end{tikzpicture}

\end{minipage}

\end{frame}
