4

I am trying to animate as follows:

  1. Slide 1 should show only Bullet 1
  2. Slide 2 should add root and child1
  3. Slide 3 should add child2
  4. Slide 4 should add Bullet 2

Thanks in advance.

\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}


\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}

\begin{itemize}[<+->]
\item Bullet 1

\begin{tikzpicture}[node distance=3cm]

\node (root) [process] {root};
\node (child1) [process, below of=root, xshift=-4cm] {child1};
\draw [arrow] (root.south) -- (child1.north);


\node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2};
\draw<.(1)-> [arrow] (root.south) -- (child2.north);


\end{tikzpicture}

\item Bullet 2
\end{itemize}
\end{frame}

\end{document}

1 Answer 1

4

Update 2 :Some explanations on incremental overlays specifications

The specifics of overlays can be absolute or relative.

When they are absolute:

we put the slide number as <3> which means that this command will be visible on slide #3.

When they are relative:

the value of the counter beamerpauses is represented by the + symbol (Please note the + sign is not an addition).

So if the slide is number 3 and an order:

  • specifies <+->, then this is expanded to <3->;
  • specifies <+(1)->, then this is expanded to <4->;
  • specifies <+(-1)-+>, then this is expanded to <2-3>;

The other symbol to understand is the dot symbol . When presented in an overlay specification, it represents the previous value of the counter.

So if the slide is number 3 and an order:

  • specifies <.->, then this is expanded to <2->;
  • specifies <.(1)->, then this is expanded to <3->;
  • specifies <.(-1)-.>, then this is expanded to <1-2>;

Update 1: With Incremental Specifications

\begin{document}
\begin{frame}

\begin{itemize}%[<+->]
\item<1-> Bullet 1

\begin{tikzpicture}[node distance=3cm]

\node<+(1)-> (root) [process] {root};
\node<.(1)-> (child1) [process, below of=root, xshift=-4cm] {child1};
\draw<.(1)-> [arrow] (root.south) -- (child1.north);


\node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2};
\draw<.(1)-> [arrow] (root.south) -- (child2.north);


\end{tikzpicture}

\item<+(1)-> Bullet 2
\end{itemize}
\end{frame}

\end{document}

Old answer: With overlay specifications

\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}


\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}

\begin{itemize}[<+->]
\item Bullet 1

\begin{tikzpicture}[node distance=3cm]

\node<2-> (root) [process] {root};
\node<2-> (child1) [process, below of=root, xshift=-4cm] {child1};
\draw<2-> [arrow] (root.south) -- (child1.north);


\node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2};
\draw<.(1)-> [arrow] (root.south) -- (child2.north);


\end{tikzpicture}

\item<4-> Bullet 2
\end{itemize}
\end{frame}

\end{document}
4
  • Perfect. Seems like I am confusing overlay and incremental specifications. Maybe you can point to some nice resource which explains with examples specifically about incremental specifications (only and not overlay specs). Thanks!
    – Curious
    Commented Aug 7, 2020 at 8:31
  • 1
    @Curious I added some explanations, is it clearer now?
    – AndréC
    Commented Aug 7, 2020 at 12:04
  • Fantastic, thanks a lot for a nice and clear explanation.
    – Curious
    Commented Aug 7, 2020 at 12:09
  • Please change the title of your question so that it really represents your problem and thus allows search engines to index it correctly. For example "How does Beamer's incremental specification work?"
    – AndréC
    Commented Aug 7, 2020 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .