I'm trying to uncover a TikZ image piece-by-piece like so:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{frame}{Linearity}
\begin{center}
\begin{tikzpicture}
\node (Ctx) {\visible<2->{$\Gamma$}};
\node[below right=0.5cm and 0.1cm of Ctx] (E) {$E$};
\node[below right=0.5cm and 0.1cm of E] (psi1) {\visible<3->{$\Psi_1$}};
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
However, this gives the following error message:
! Package tikz Error: Giving up on this path. Did you forget a semicolon?.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.16 \end{frame}
If I use \only
instead of \visible
, pdflatex
runs OK but the output jumps around when going from slide to slide, since the invisible nodes don't take up space and thus the E
node's position changes. So \visible
is what I need.
{{\visible<2->{$\Gamma$}}}
(and similarly for the other node). (An alternative strategy is to lay out coordinates to get the positioning right then to "hang" the nodes on the relevant spots afterwards; these nodes can safely be switched on and off via\node<2->
etc since they no longer play a part in the positioning.)