\section{\textcolor{BEGERAD}{Vite fait, bien fait}}
%\setbeamercovered{invisible}
\begin{frame}[t,fragile]
\frametitle{\bfseries Vite fait, bien fait}
\framesubtitle{Ou comment se simplifier la vie}
\begin{columns}
\begin{column}{0.4\linewidth}
%\tableofcontents[currentsection,hideothersubsections]
\end{column}
\hfill
\begin{column}{0.5\linewidth}
\includegraphics[trim=0.5cm 0cm 0cm 0cm,clip=true,width=4.5cm]{Figures/ampoule.jpg}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 1}
\begin{figure}
\includegraphics[width=9cm]{exemple1.jpg}
\end{figure}
\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 1}
%\newcommand\myMathFunction[1]%
%{%
%    \pgfmathparse{1950+10*#1}%
%    \pgfmathprintnumber[]{\pgfmathresult}%
%}

\normalsize

\begin{figure}
\begin{tikzpicture}[scale=0.5]
\tikzstyle{fleche} = [->,very thick]
\draw[->,very thick] (0,0)--(12,0);
\def\h{0.1}
\def\z{2}
\foreach \i in {0,...,11} \draw (\i,\h)--(\i,-\h) node[below] {\i};
\tikzstyle{evenement} = [fill=blue!50,font=\scriptsize]
\uncover<2->{


\node[evenement] (debut) at (2,\z) {\scriptsize il était une fois};
\node[evenement] (milieu) at (4,-\z) {\scriptsize une reine};
\node[evenement] (milieu2) at (7,\z) {\scriptsize un roi};
\node[evenement,fill=pink] (fin) at (11,-\z) {\scriptsize fin heureuse};
}
\uncover<3->{
\foreach \nom/\pos in {debut/3, milieu/5, milieu2/7, fin/11}
\draw[fleche] (\nom) -- (\pos, 0);

}
\end{tikzpicture}
\end{figure}

\only<1>{
\tiny{
\ttfamily
\textbackslash draw[->,very thick] (0,0)--(12,0);\\

\textbf{\textbackslash def\green{\textbackslash h}\{0.1\}}\\

\textbf{\textbackslash foreach \red{\textbackslash i} in \{0,...,11\} }\\
\hspace{1cm}	\textbackslash draw (\red{\textbackslash i},\green{\textbackslash h})--(\red{\textbackslash i},-\green{\textbackslash h}) node[below] \{\red{\textbackslash i}\};
}
}

\only<2>{
\tiny{
\ttfamily
\textbf{\textbackslash def\green{\textbackslash z}\{2\}}\\
\textbf{\textbackslash tikzstyle\{evenement\} = [fill=blue!50,font=\textbackslash large]}\\
\textbackslash node[\textbf{evenement}] (debut) at (2,\green{\textbackslash z}) \{il était une fois\};\\
\textbackslash node[\textbf{evenement}] (milieu) at (4,-\green{\textbackslash z}) \{une reine\};\\
\textbackslash node[\textbf{evenement}] (milieu2) at (7,\green{\textbackslash z}) \{un roi\};\\
\textbackslash node[\textbf{evenement,fill=pink}] (fin) at (11,-\green{\textbackslash z}) \{fin heureuse\};

}
}

\only<3>{
\tiny{
\ttfamily
\textbf{\textbackslash tikzstyle\{fleche\} = [->,very thick]}\\
\textbackslash draw[\textbf{fleche}] (debut)--(3,0);\\
\textbackslash draw[\textbf{fleche}] (milieu2)--(7,0);\\
\textbackslash draw[\textbf{fleche}] (milieu)--(5,0);\\
\textbackslash draw[\textbf{fleche}] (fin)--(11,0);

}
}

\end{frame}


\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 1: finitions}
%\newcommand\myMathFunction[1]%
%{%
%    \pgfmathparse{1950+10*#1}%
%    \pgfmathprintnumber[]{\pgfmathresult}%
%}

\normalsize

\begin{figure}
\begin{tikzpicture}[scale=0.7]
\tikzstyle{fleche} = [->,very thick]
\draw[->,very thick] (0,0)--(12,0);
\def\h{0.1}
\def\z{2.5}
\foreach \i in {0,...,11} \draw (\i,\h)--(\i,-\h) node[below,gray] {\i};
\tikzstyle{evenement} = [fill=blue!60!green!20,draw,rounded corners=5pt,minimum height=1cm,minimum width=2cm,font=\large]

\node[evenement] (debut) at (2,\z) { il était une fois};
\node[evenement] (milieu) at (4,-\z) { une reine};
\node[evenement] (milieu2) at (7,\z) { un roi};
\node[evenement,fill=red!40!pink] (fin) at (11,-\z) {fin heureuse};

\draw[fleche] (debut.south)to[bend right](3,0);
\draw[fleche] (milieu2.south)to [bend left](7,0);
\draw[fleche] (milieu.north)to[bend right](5,0);
\draw[fleche] (fin.north)--(11,0);

\end{tikzpicture}
\end{figure}
\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 1: animations}
%\newcommand\myMathFunction[1]%
%{%
%    \pgfmathparse{1950+10*#1}%
%    \pgfmathprintnumber[]{\pgfmathresult}%
%}

\normalsize

\begin{figure}
\begin{tikzpicture}[scale=0.7]
\tikzstyle{fleche} = [->,very thick]
\draw[->,very thick] (0,0)--(12,0);
\def\h{0.1}
\def\z{2.5}
\foreach \i in {0,...,11} \draw (\i,\h)--(\i,-\h) node[below,gray] {\i};
\tikzstyle{evenement} = [fill=blue!60!green!20,draw,rounded corners=5pt,minimum height=1cm,minimum width=2cm,font=\large]
\only<2->{
\node[evenement] (debut) at (2,\z) { il était une fois};
\draw[fleche] (debut.south)to[bend right](3,0);
}
\only<3->{
\node[evenement] (milieu) at (4,-\z) { une reine};
\draw[fleche] (milieu.north)to[bend right](5,0);
}
\only<4->{
\node[evenement] (milieu2) at (7,\z) { un roi};
\draw[fleche] (milieu2.south)to [bend left](7,0);
}
\only<5->{
\node[evenement,fill=red!40!pink] (fin) at (11,-\z) {fin heureuse};
\draw[fleche] (fin.north)--(11,0);
}


\end{tikzpicture}
\end{figure}
\footnotesize Dans un beamer, utiliser les fonctions \texttt{\textbf{\textbackslash only }} et \texttt{\textbf{\textbackslash uncover}}.\\
\only<2->{\texttt{
\textbf{\textbackslash only<2->}\{
\textbackslash node[evenement] (debut) at (4,-\textbackslash z) \{il etait une fois\};
\}\\
}}
\only<3->{\texttt{
\textbf{\textbackslash only<3->}\{
\hspace{1cm}... "une reine"... \};
}}

\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 1: animations}
%\newcommand\myMathFunction[1]%
%{%
%    \pgfmathparse{1950+10*#1}%
%    \pgfmathprintnumber[]{\pgfmathresult}%
%}

\normalsize

\begin{figure}
\begin{tikzpicture}[scale=0.7]
\tikzstyle{fleche} = [->,very thick]
\draw[->,very thick] (0,0)--(12,0);
\def\h{0.1}
\def\z{2.5}
\foreach \i in {0,...,11} \draw (\i,\h)--(\i,-\h) node[below,gray] {\i};
\tikzstyle{evenement} = [fill=blue!60!green!20,draw,rounded corners=5pt,minimum height=1cm,minimum width=2cm,font=\large]
\uncover<2->{
\node[evenement] (debut) at (2,\z) { il était une fois};
\draw[fleche] (debut.south)to[bend right](3,0);
}
\uncover<3->{
\node[evenement] (milieu) at (4,-\z) { une reine};
\draw[fleche] (milieu.north)to[bend right](5,0);
}
\uncover<4->{
\node[evenement] (milieu2) at (7,\z) { un roi};
\draw[fleche] (milieu2.south)to [bend left](7,0);

\node[evenement,fill=red!40!pink] (fin) at (11,-\z) {fin heureuse};
\draw[fleche] (fin.north)--(11,0);
}

\end{tikzpicture}
\end{figure}
\footnotesize Dans un beamer, utiliser les fonctions \texttt{\textbf{\textbackslash only }} et \texttt{\textbf{\textbackslash uncover}}.\\
\uncover<2->{\texttt{
\textbf{\textbackslash uncover<2->}\{
\textbackslash node[evenement] (debut) at (4,-\textbackslash z) \{il etait une fois\};
\}\\
}}
\uncover<3->{\texttt{
\textbf{\textbackslash uncover<3->}\{
\hspace{1cm}... "une reine"... \};
}}

\end{frame}


\begin{frame}[t,fragile]
\frametitle{\bfseries Exemple 2}
\begin{figure}
\includegraphics[width=9cm]{exemple2.jpg}
\end{figure}
\end{frame}



%======================================
% Exemple 2
%======================================
\begin{frame}<handout:1-3>[t,fragile]
\frametitle{\bfseries Exemple 2}
%\newcommand\myMathFunction[1]%
%{%
%    \pgfmathparse{1950+10*#1}%
%    \pgfmathprintnumber[]{\pgfmathresult}%
%}

\scriptsize

\begin{figure}
\begin{tikzpicture}[scale=0.6]
\def\hA{2}

%\uncover<5,6>{
%\draw[step=0.4cm,help lines] (0,0) grid (6,4);
%}

\tikzstyle{noeud}=[draw,circle,inner sep=2pt]
\node[noeud] (A) at (0,\hA) {A};
\node[noeud] (B) at (2,\hA) {B};
\node[noeud] (C) at (4,\hA){C};
\node[noeud] (D) at (5,\hA/2){D};
\node[noeud] (E) at (1,0){E};
\node[noeud]  (F) at (3,0){F};

\tikzstyle{fleche}=[->,thick]
%\draw[fleche] (A) -- (B);
%\draw[fleche] (B) -- (C);
%\draw[fleche] (E) -- (F);
%\draw[fleche] (F) -- (D);
%\draw[fleche] (E) -- (B);
%\draw[fleche] (B) -- (F);
%\draw[fleche] (F) -- (C);
%\draw[fleche] (C) -- (D);

\uncover<2-|handout:2->{
\foreach \n in {A,E,F} \draw[<-,red] (\n)--++(-0.5,-0.8);
\foreach \n in {B,C,D} \draw[->,blue] (\n)--++(0.5,0.8);
}
\uncover<3-|handout:3>{
\foreach \a/\b in {A/B,B/C,E/F,F/D,E/B,B/F,F/C,C/D} \draw[fleche] (\a)--(\b);
}
\uncover<4,5|handout:3>{
\node[red] at (0,\hA/2) {entrées};
\node[blue] at (5,\hA+1) {sortie};
}

%\uncover<6,7>{
%\node[red] at (-0.2,\hA/2-0.2) {entrées};
%\node[blue] at (5-0.2,\hA+1+0.2) {sortie};
%}
\end{tikzpicture}
\end{figure}
%

\only<1|handout:1>{
\scriptsize{
\ttfamily
\textbf{\textbackslash def\textbackslash hA\{2\}}\\
\textbf{\textbackslash tikzstyle\{noeud\}=[draw,circle,inner sep=2pt]}\\
\textbackslash node[noeud] (A) at (0,\textbackslash hA) \{A\};\\
\textbackslash node[noeud] (B) at (2,\textbackslash hA) \{B\};\\
\textbackslash node[noeud] (C) at (4,\textbackslash hA)\{C\};\\
\textbackslash node[noeud] (D) at (5,\textbackslash hA/2)\{D\};\\
\textbackslash node[noeud] (E) at (1,0)\{E\};\\
\textbackslash node[noeud]  (F) at (3,0)\{F\};\\
}
}

\only<2,3|handout:2>{
\scriptsize{
\ttfamily
\textbackslash foreach \textbackslash n in \{B,C,D\} \\
\hspace{2cm} \textbackslash draw[->,blue] (\textbackslash n)\textbf{--++}(0.5,0.8);\\
\textbf{\textbackslash foreach \textbackslash n in \{A,E,F\} }\\
\hspace{2cm}\textbackslash draw[<-,red] (\textbackslash n)\textbf{--++}(-0.5,-0.8);\\
\vspace{\baselineskip}

}
}

\only<3|handout:3>{
\scriptsize{
\ttfamily
\textbf{\textbackslash foreach \textbackslash a/\textbackslash b in \{A/B,B/C,E/F,F/D,E/B,B/F,F/C,C/D\}}\\
 \hspace{2cm}\textbackslash draw[->,thick] (\textbackslash a)--(\textbackslash b);

}
}


\scriptsize{
\ttfamily
\only<4-|handout:3>{\textbackslash node[red] at (0,\textbackslash hA/2) \{entrées\};\\
\textbackslash node[blue] at (5,\textbackslash hA+1) \{sortie\};\\
}
%\only<5>{
%\textbf{\textbackslash draw[step=0.2cm,help lines] (0,0) grid (6,4);}
%}
%\only<6>{\textbackslash node[red] at (-0.2,\textbackslash hA/2-0.2) \{entrées\};\\
%\textbackslash node[blue] at (5-0.2,\textbackslash hA+1+0.2) \{sortie\};\\

%}

}

\end{frame}

\begin{frame}[t,fragile]
\frametitle{\bfseries Résumé}
\large

\begin{itemize}
\item définir des noeuds ou des coordonnées\\
\texttt{\textbackslash coordinate (A) at (0,1);} (utile si on veut seulement réutiliser le point)

\item définir des styles \texttt{\textbf{tikzstyle}} (voir aussi \texttt{\textbackslash tikzset})

\item définir des variables \texttt{\textbf{def}} ou \texttt{\textbf{newcommand}}\\

\item coordonnées relatives \texttt{\textbf{--++}}
\item afficher la grille \texttt{\textbf{grid}}
\item utiliser les boucles: \texttt{\textbf{\textbackslash foreach}}

\end{itemize}
\end{frame}
%
%
%\begin{frame}[t,fragile]
%\frametitle{\bfseries Fonction coordinate}
%
%
%\end{frame}

