-1

So, let's say I want to make a teaching video. I could certainly use beamer to create a kind of slideshow, and talk over it. But I would like to do some illustrations in geometry.

The particular problem I have is teaching some business calc students about related rates. I would like to draw a rectangle, a diagonal through the rectangle, and labels and so forth. This is very easy with tikz.

BUT, I would like to use the pause function with beamer too. So, for instance.

(1) draw a rectangle, pause

(2) draw a diagonal through the rectangle, pause

(3) label the lengths, pause

etc.

Is anything like this possible? Maybe with something other than tikz and/or beamer?

Thanks!

Ben W
  • 203

2 Answers2

3

\node, \draw etc. are overlay aware, so you can use e.g. \node<-> ... Or you can use \visible/\only/\uncover for one or more TikZ constructions. Or you can use \pause inside the tikzpicture.

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\node<+-> [minimum size=3cm,draw] (a) {};
\draw<+-> (a.south east) -- (a.north west);
\visible<+->{\node [above] at (a.north) {$x$};}
\node<+-> [right] at (a.east) {$y$};
\node<+-> [above right] at (a.center) {$D$};

\pause
\node [draw,circle,minimum size=2cm] at (5,0) {};
\end{tikzpicture}
\end{frame}
\end{document}
Torbjørn T.
  • 206,688
2

Here is something that shows how you can do it:

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{tikz}
\usepackage{xcolor}

\begin{document}
\begin{frame}
 \begin{center}
 \begin{minipage}{0.4\textwidth}
 \begin{itemize}
  \item<1-> Lets Start with the triangle:
  \item<2-> We added the red line 
  \item<3> We added the blue line
 \end{itemize}
 \end{minipage}
 \hspace*{10pt}
 \begin{minipage}{0.4\textwidth}
 \foreach \i in {1,...,3}{
 \only<\i>{
 \begin{tikzpicture}
  \draw[-](0,0)--(4,0)--(4,3)--cycle;
  \ifnum \i>1
  \draw[-,red](0,0) node[left] {A}--(4,1.5) node[right] {B};
  \else
  \node[left] at (0,0) {\phantom{A}};
  \node[left] at (4,1.5) {\phantom{B}};
  \fi
  \ifnum \i>2
  \draw[-,blue] (2,0) node[below] {D}--(4,3) node[above] {C};
  \else
  \node[below] at (2,0) {\phantom{D}};
  \node[above] at (4,3) {\phantom{C}};
  \fi
 \end{tikzpicture}
 }}
 \end{minipage}
 \end{center}

\end{frame}


\end{document}

You have to be careful with the 'phantom' part (in more complex situations you may need to take a look here). The phantom or the link needed to keep constant the positioning.

An easier way than the link above is to put some nodes with phantom letters (like mine) around your total shape. your

Result:

enter image description here

enter image description here

enter image description here

koleygr
  • 20,105