2

I have to draw and comment simulteanously a complex picture. I can calculate the slide number on witch the comment will appear, but I'd like this be done automaticaly. Is there a way to put labels or some other stuff to synchronise the comment and the drawing. For example to store the current slide number and reuse in the comment ?

Edit

I found almost a solution (I accept of course any other one). Still the problem that \Etape{2} works in the text of the \item, but not as overlay : \item<\Etape{2}->.

I don't know why.

\documentclass[xcolor=dvipsnames,professionalfont,french]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\makeatletter
\def\c@slideinframe{\beamer@slideinframe}
\def\beamerslideinframe{\beamer@slideinframe}
\makeatother


\usepackage{fourier,tikz,ifthen}
\usetikzlibrary{calc} 
\usepackage[french]{babel}

\tikzset{%
    small dot/.style={fill=black,circle,scale=.3}}

\usetheme{Madrid}               % thème
\setbeamertemplate{footline}{}

\setbeamercolor{palette primary}{fg=white, bg=MidnightBlue!90}
\setbeamercolor{background canvas}{bg=MidnightBlue!15}

\setbeamersize{text margin left=1 mm}
\setbeamersize{text margin right=1 mm}

\beamertemplatenavigationsymbolsempty

\xdef\EtapeCounter{1}

\newcommand{\MyLabel}{%
\pgfmathparse{int(1+\arabic{slideinframe})}%
\xdef\EtapeCounter{\EtapeCounter,\pgfmathresult}%
}

\newcommand{\Etape}[1]{%
\pgfmathparse{dim(\EtapeCounter)}%
\ifthenelse{%
    #1>\pgfmathresult}{%
    1%
    }{%
    \pgfmatharray{{\EtapeCounter}}{#1-1}%
    \pgfmathresult%
    }%
}

\begin{document}
\begin{frame}[label=bob]{Title}
\begin{columns}[onlytextwidth]

% #############################
%         Tikz Picture        #
% #############################

\column{\dimexpr\textwidth-4cm}
\begin{tikzpicture}

\coordinate (A) at (0,0) ;
\coordinate (B) at (4,0) ;
\coordinate (C) at (60:4) ;

\coordinate (K) at ($(C)!.5!(B)$) ;
\coordinate (J) at ($(A)!.5!(C)$) ;
\coordinate (I) at ($(A)!.5!(B)$) ;

\only<.>{\MyLabel} % Step 1

\foreach \Coor/\Text/\Pos in 
    {A/$A$/below,
    B/$B$/below,
    C/$C$/above%
    }
    \node<+->[small dot] at (\Coor) {} ;

\only<.>{\MyLabel} % Step 2


\draw<+-> (A)--(B) ;
\draw<+-> (C)--(B) ;
\draw<+-> (A)--(C) ;

\only<.>{\MyLabel} % Step 3

\foreach \Coor/\Text/\Pos in 
    {A/$A$/below,
    B/$B$/below,
    C/$C$/above%
    }
    \node<+->[small dot,label={[label distance=-2pt]\Pos:\Text}] at (\Coor) {} ;

\foreach \Coor/\Text/\Pos in 
    {I/$I$/below,
    J/$J$/left,
    K/$K$/right%
    }
    \node<+->[small dot,label={[label distance=-2pt]\Pos:\Text}] at (\Coor) {} ;



\end{tikzpicture}% -- Fin Tikz Picture

% #############################
%         Commentaires        #
% #############################


\column{4cm}
\begin{minipage}[t][8.3cm]{\linewidth}
\small

\begin{itemize}
\item<1-> Placer les points. \EtapeCounter

% works
\item<4-> \hyperlink{bob<4>}{Tracer les côtés. \Etape{2}}

% doesn't work
% \item<\Etape{2}-> \hyperlink{bob<4>}{Tracer les côtés. \Etape{2}}
\item<7-> Nommer les points.
\item<10-> PLacer les milieux.
\end{itemize}
\end{minipage}

\end{columns}

\end{frame}

\end{document}
Tarass
  • 16,912
  • What's the problem exactly? It compiles OK but I don't know what it should do exactly and not knowing French is likely not helping any. – cfr Jul 03 '15 at 22:23
  • See at the end, switch working and not working lines, it will not compile. I want to access dynamically at some steps of the drawing for hyperlink and overlay in the itemize part. Is it more clear ? – Tarass Jul 03 '15 at 22:30
  • What does \pgfmathparse{dim()} do? I can't find it in the manual. – cfr Jul 03 '15 at 22:52
  • Sorry, I had to sleep a little ;-) But you find it by your self. The remaining problem is maybe a problem of expanded macro at a bad time ... But maybe the method is wrong ... – Tarass Jul 04 '15 at 04:29
  • I tried to put \Etape{2} inside \xdef and \csname but in vain. It seems like \pgfmathparse is to difficult handle. What else do you expect beamer can do? – Symbol 1 Jul 06 '15 at 07:24
  • The hint is to use labels as overlay parameters. – Tarass Jul 06 '15 at 09:04

0 Answers0