我正在尝试制作如下动画:
- 幻灯片 1 应仅显示
Bullet 1
- 幻灯片 2 应
root
添加child1
- 幻灯片 3 应添加
child2
- 幻灯片 4 应添加
Bullet 2
提前致谢。
\documentclass{beamer} \mode<presentation>{\usetheme{Madrid}} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30] \tikzstyle{arrow} = [thick,->,>=stealth] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \begin{frame} \begin{itemize}[<+->] \item Bullet 1 \begin{tikzpicture}[node distance=3cm] \node (root) [process] {root}; \node (child1) [process, below of=root, xshift=-4cm] {child1}; \draw [arrow] (root.south) -- (child1.north); \node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2}; \draw<.(1)-> [arrow] (root.south) -- (child2.north); \end{tikzpicture} \item Bullet 2 \end{itemize} \end{frame} \end{document}
答案1
更新2:关于增量叠加规范的一些解释
叠加的细节可以是绝对或者相对的。
当它们是绝对的时候:
我们将幻灯片编号设为,<3>
这意味着该命令将在上可见slide #3
。
当它们是相对的时候:
这计数器的值 beamerpauses
用符号表示+
(请注意,该+
符号不是附加的)。
因此,如果幻灯片是number 3
并且顺序为:
- 指定
<+->
,则扩展为<3->
; - 指定
<+(1)->
,则扩展为<4->
; - 指定
<+(-1)-+>
,则扩展为<2-3>
;
另一个需要理解的符号是dot symbol .
当在覆盖规范中呈现时,它代表计数器的先前值。
因此,如果幻灯片是第 3 张且顺序如下:
- 指定
<.->
,则扩展为<2->
; - 指定
<.(1)->
,则扩展为<3->
; - 指定
<.(-1)-.>
,则扩展为<1-2>
;
更新 1:增加规格
\begin{document}
\begin{frame}
\begin{itemize}%[<+->]
\item<1-> Bullet 1
\begin{tikzpicture}[node distance=3cm]
\node<+(1)-> (root) [process] {root};
\node<.(1)-> (child1) [process, below of=root, xshift=-4cm] {child1};
\draw<.(1)-> [arrow] (root.south) -- (child1.north);
\node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2};
\draw<.(1)-> [arrow] (root.south) -- (child2.north);
\end{tikzpicture}
\item<+(1)-> Bullet 2
\end{itemize}
\end{frame}
\end{document}
旧答案:使用覆盖规范
\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}
\begin{itemize}[<+->]
\item Bullet 1
\begin{tikzpicture}[node distance=3cm]
\node<2-> (root) [process] {root};
\node<2-> (child1) [process, below of=root, xshift=-4cm] {child1};
\draw<2-> [arrow] (root.south) -- (child1.north);
\node<+(1)-> (child2) [process, below of=root, xshift=4cm] {child2};
\draw<.(1)-> [arrow] (root.south) -- (child2.north);
\end{tikzpicture}
\item<4-> Bullet 2
\end{itemize}
\end{frame}
\end{document}