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

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

  • 1
    Does \pause really work in this situation? For me, it just generates errors. – user36296 Jun 12 '16 at 18:21
  • 1
    \pause was an errror... \action was the answer... – Omid Ghayour Jun 12 '16 at 19:27
  • @samcarter ^^ You have mail, I think ;). – cfr Jun 12 '16 at 19:50
  • Welcome to this quiet galactic backwater! – cfr Jun 12 '16 at 19:52
  • 1
    As quiet galactic backwaters go, it is pretty good - almost silent and definitely part of some galaxy or other, but a bit on the dry side. On the other hand, perhaps the lack of wateriness has its upside given that the place exists in intergalactic cyberspace. – cfr Jun 12 '16 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.