我想将使用 Tikz 制作的图表分部分动画化。基本上,我希望动画
- 先绘制框/节点然后 \pause
- 在框中显示文本然后 \pause
- 连续画一个箭头然后 \pause
- 绘制第二个框然后 \pause
- 写文字,然后写箭头,等等......
我尝试应用解决方案这里但我似乎无法让它在多条路径非同时的情况下工作。如能得到任何帮助我将不胜感激。提前致谢!
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[minimum size=1cm]
\node[draw,rectangle] (A) {A};
\node[draw,rectangle] (B) [right=of A] {B};
\node[draw,rectangle] (C) [right=of B] {C};
\draw[->] (A.east) -- (B.west);
\draw[->] (B.east) -- (C.west);
\end{tikzpicture}
\end{document}
答案1
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{frame}
\begin{tikzpicture}[minimum size=1cm]
\node<+->[draw,rectangle] (A) {\only<+->{A}};
\node<+> (B) [right=of A] {};
\node<+->[draw,rectangle] (B) [right=of A] {\only<+->{B}};
\node<+> (C) [right=of B] {};
\node<+->[draw,rectangle] (C) [right=of B] {\only<+->{C}};
\draw<3->[->] (A.east) -- (B.west);
\draw<6->[->] (B.east) -- (C.west);
\end{tikzpicture}
\end{frame}
\end{document}