3

I am trying to use tikz and beamer overlays to reveal a graph with some nodes that contain a little amount of text node by node. However, the middle note (that is the first node that is uncovered) and the top node (which is the second node) move between the second and the third slide. Is there a way to suppress this such that it looks like the nodes are being revealed in the same position that they have on the final slide (that is no jumping of already revealed nodes between slides). Here is a MWE of my code:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tikz-cd}

\usetikzlibrary{shapes}


\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
%Middle Node
\node<1->[shape=ellipse,draw,minimum size=1.5em, text width=5em,align=center,thick] at (0,0) (Middle) {Middle Node};
%Top Node
\node<2->[shape=ellipse,draw, text width=7em,align=center,outer sep=0,thick] at (0,3) (Top) {\scriptsize This is the top node};
\draw<2->[->,>=stealth, thick] (Middle) -- (Top);
%Top left
\node<3->[shape=ellipse,draw, text width=6em,align=center,outer sep=0,thick] at (-4,2) (TopL) {\scriptsize Top left node};
\draw<3->[->,>=stealth, thick] (Middle) -- (TopL);

%Top right node
\node<4->[shape=ellipse,draw, text width=6.2em,align=center,outer sep=0,thick] at (4,2) (TopR) {\scriptsize The top right node is here};
\draw<4->[->,>=stealth, thick] (Middle) -- (TopR);

%Bottom right
\node<6->[shape=ellipse,draw, text width=5em,align=center,outer sep=0,thick] at (4,-1.5) (BottomR) {\scriptsize Bottom Right Node here};
\draw<6->[->,>=stealth, thick] (Middle) -- (BottomR);

%Bottom
\node<7->[shape=ellipse,draw, text width=6em,align=center,outer sep=0,thick] at (0,-2.5) (bottom) {\scriptsize Hey I am the bottom node};
\draw<7->[->,>=stealth, thick] (Middle) -- (bottom);

\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

1 Answer 1

4

If you use \node<3-> etc. the nodes will only be present on the specified overlays and thus the size of your tikz picture will change on each overlay.

To avoid the problem, you could use the overlay-beamer-styles library and uncover the nodes on the selected overlays. This way, they will be present on all overlays, and just not be visible before they are uncovered:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tikz-cd}
\usetikzlibrary{overlay-beamer-styles}

\usetikzlibrary{shapes}


\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
%Middle Node
\node[shape=ellipse,draw,minimum size=1.5em, text width=5em,align=center,thick,visible on=<1->] at (0,0) (Middle) {Middle Node};
%Top Node
\node[shape=ellipse,draw, text width=7em,align=center,outer sep=0,thick,visible on=<2->] at (0,3) (Top) {\scriptsize This is the top node};
\draw[->,>=stealth, thick,visible on=<2->] (Middle) -- (Top);
%Top left
\node[shape=ellipse,draw, text width=6em,align=center,outer sep=0,thick,visible on=<3->] at (-4,2) (TopL) {\scriptsize Top left node};
\draw[->,>=stealth, thick,visible on=<3->] (Middle) -- (TopL);

%Top right node
\node[shape=ellipse,draw, text width=6.2em,align=center,outer sep=0,thick,visible on=<4->] at (4,2) (TopR) {\scriptsize The top right node is here};
\draw[->,>=stealth, thick,visible on=<4->] (Middle) -- (TopR);

%Bottom right
\node[shape=ellipse,draw, text width=5em,align=center,outer sep=0,thick,visible on=<6->] at (4,-1.5) (BottomR) {\scriptsize Bottom Right Node here};
\draw[->,>=stealth, thick,visible on=<6->] (Middle) -- (BottomR);

%Bottom
\node[shape=ellipse,draw, text width=6em,align=center,outer sep=0,thick,visible on=<7->] at (0,-2.5) (bottom) {\scriptsize Hey I am the bottom node};
\draw[->,>=stealth, thick,visible on=<7->] (Middle) -- (bottom);

\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

enter image description here

2

You must log in to answer this question.

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