4

I have been writing the following code for a tikz-tree:

\documentclass{beamer}
\begin{document}    
\begin{frame}

\begin{figure}
\centering

\begin{tikzpicture} [nodes={draw, rectangle, fill=orange!30, sibling distance=10cm,minimum height=2em}, ->]

\node[fill=orange!30, rectangle]{0}
child { node {A} }
child [missing]
    child { node[fill=orange!30, rectangle] {F: 3} 
    child { node[fill=orange!30, rectangle] {G: 28} 
    {child {node{Z}}}
      child {node[fill=orange!30, rectangle] {L: 22}}
        child [missing]
      child {node {B: 296}}
    }}
child [missing]
child { node {C: 167} }
child [missing]
child { node {D: 92}};
\end{tikzpicture}

 \end{figure}
 \end{frame}
  \end{document}

I would like to have pause between generations: would you help me in doing so?

Thanks a lot :)

1dre

1dre
  • 419
  • 2
    Does http://tex.stackexchange.com/questions/313720/how-can-i-use-pause-for-each-level-in-beamer-presentation-to-appear-sequentiall, http://tex.stackexchange.com/questions/109950/using-beamer-overlays-with-forest-generated-trees or http://tex.stackexchange.com/questions/117309/step-by-step-revealing-of-tikz-tree-using-opacity-trick-and-overlays-in-beamer help? – samcarter_is_at_topanswers.xyz Jun 12 '16 at 17:15

1 Answers1

3

Copy the TikZ code...

Paste them under the original one... place... \action between them... and leave the last copy untouched... but in each copy inserted before... either start changing color to be invisible or if possible delete the codes corresponding to the generations...

\documentclass{beamer}
\usepackage{tikz}
\begin{document}    
\begin{frame}[label=CCS]
\frametitle{Motivations and Directions}
\framesubtitle{The Cache County Study (CCS)}

\begin{figure}
\centering

\begin{tikzpicture} [nodes={draw, rectangle, fill=orange!30, sibling distance=10cm,minimum height=2em}, ->]

\action<1>{\node[fill=orange!30, rectangle]{0};}

\action<2>{\node[fill=orange!30, rectangle]{0}
child { node {A} }
child [missing]
    child { node[fill=orange!30, rectangle] {F: 3} 
    }
child [missing]
child { node {C: 167} }
child [missing]
child { node {D: 92}};
}

\action<3>{\node[fill=orange!30, rectangle]{0}
child { node {A} }
child [missing]
    child { node[fill=orange!30, rectangle] {F: 3} 
    child { node[fill=orange!30, rectangle] {G: 28} 
    }}
child [missing]
child { node {C: 167} }
child [missing]
child { node {D: 92}};
}

\action<4>{\node[fill=orange!30, rectangle]{0}
child { node {A} }
child [missing]
    child { node[fill=orange!30, rectangle] {F: 3} 
    child { node[fill=orange!30, rectangle] {G: 28} 
    {child {node{Z}}}
    }}
child [missing]
child { node {C: 167} }
child [missing]
child { node {D: 92}};
}

\action<5>{\node[fill=orange!30, rectangle]{0}
child { node {A} }
child [missing]
    child { node[fill=orange!30, rectangle] {F: 3} 
    child { node[fill=orange!30, rectangle] {G: 28} 
    {child {node{Z}}}
      child {node[fill=orange!30, rectangle] {L: 22}}
        child [missing]
      child {node {B: 296}}
    }}
child [missing]
child { node {C: 167} }
child [missing]
child { node {D: 92}};
}



\end{tikzpicture}



\end{figure}
\end{frame}
\end{document}

incremental display of tree by level

cfr
  • 198,882