I'm making a beamer presentation and within it I need a block diagram. I would like to incrementally generate the block diagram over multiple slides with a different text underneath it to explain what is happening. Is there a more efficient way to do this than replicating the code each frame? Additionally is it possible to have a fixed position for the picture, rather than have it move up/down depending on the text underneath it?
MWE
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix,graphs}
\usepackage{lipsum}
\begin{document}
\begin{frame}{System}
\begin{tikzpicture}
\matrix (m) [row sep = 2mm, column sep = 3mm, ampersand replacement=\&] {\node (A) [rectangle, draw] {A};\\
\node (C) {\phantom{C}};\\
};
\end{tikzpicture}
\begin{itemize}
\item Now only block A is visible
\end{itemize}
\end{frame}
\begin{frame}{System}
\begin{tikzpicture}
\matrix (m) [row sep = 2mm, column sep = 3mm, ampersand replacement=\&] {
\node (A) [rectangle, draw] {A}; \& \node (B) [rectangle, draw] {B};\\
\node (C) {\phantom{C}};\\
};
\graph [use existing nodes] {
A -> B;
};
\end{tikzpicture}
\begin{itemize}
\item Block B is easy enough to add
\end{itemize}
\end{frame}
\begin{frame}{System}
\begin{tikzpicture}
\matrix (m) [row sep = 2mm, column sep = 3mm, ampersand replacement=\&] {
\node (A) [rectangle, draw] {A}; \& \node (B) [rectangle, draw] {B};\\
\node (C) [rectangle, draw] {C};\\
};
\graph [use existing nodes] {
A -> B;
A -> C;
};
\end{tikzpicture}
\begin{itemize}
\item It's annoying to have to include \textbackslash phantom\{C\}
\end{itemize}
\end{frame}
\begin{frame}{System}
\begin{tikzpicture}
\matrix (m) [row sep = 2mm, column sep = 3mm, ampersand replacement=\&] {
\node (A) [rectangle, draw] {A}; \& \node (B) [rectangle, draw] {B};\\
\node (C) [rectangle, draw] {C};\\
};
\graph [use existing nodes] {
A -> B;
A -> C;
};
\end{tikzpicture}
\begin{itemize}
\item Having a long text underneath also changes figure position which I don't want. \lipsum
\end{itemize}
\end{frame}
\end{document}
Note: I won't have text as long as lipsum, my real block diagram and text should fit into one frame without any issue.
Thanks