在 itemize 中添加一个假物品作为占位符

在 itemize 中添加一个假物品作为占位符

如何在itemize环境中制作幻影项目?我想在我的投影仪幻灯片中“动画化”项目,这样当我从一张幻灯片转到另一张幻灯片时,新项目就会在正确的位置弹出。我对一个项目有解决方法,但对两个项目不起作用:

\documentclass[10pt]{beamer}
\usetheme{Warsaw} 
\usecolortheme{whale}
\usepackage{tikz}

\tikzset{sequencestyle/.style={minimum size=0.5cm, draw=gray, line width=1pt, inner sep = 2pt}}{}
\begin{document}

\begin{frame}{first slide}
\begin{itemize}
    \item This is first item.                                                   
    \item[]
    \item[]
\end{itemize}
\begin{tikzpicture}
\node [sequencestyle, fill=red, anchor=west, xshift=-\pgflinewidth] (node1) {A};
\node [sequencestyle, fill=blue, anchor=west, xshift=-\pgflinewidth] at (node1.east) (node1) {B};
\end{tikzpicture}
\end{frame}

\begin{frame}{second slide}
\begin{itemize}
    \item This is first item.
    \item This is second item.
    \item[]
\end{itemize}
\begin{tikzpicture}
\node [sequencestyle, fill=red, anchor=west, xshift=-\pgflinewidth] (node1) {A};
\node [sequencestyle, fill=blue, anchor=west, xshift=-\pgflinewidth] at (node1.east) (node1) {C};
\end{tikzpicture}
\end{frame}

\end{document}

我敢打赌这个问题在某个地方有答案,但我找不到。

编辑:我更新了代码。除了添加项目符号外,我还更新了一些图形元素。我添加了一些内容作为示例。

答案1

itemize您可以简单地使用具有叠加感知的事实并使用[<+->] 叠加选项。对于 tikzpicture 的元素,您还可以使用 TikZ 的命令具有叠加感知的事实:

\documentclass[10pt]{beamer}
\usepackage{tikz}

\usetheme{Warsaw} 
\usecolortheme{whale}

\tikzset{
sequencestyle/.style={minimum size=0.5cm, draw=gray, line width=1pt, inner sep = 2pt}
}

\begin{document}

\begin{frame}{first slide}
\begin{itemize}[<+->]
    \item This is the first item.
    \item This is the second item.
    \item This is the third item.
\end{itemize}

\begin{tikzpicture}
\node<1-> [sequencestyle, fill=red, anchor=west, xshift=-\pgflinewidth] (node1) {A};
\node<2-> [sequencestyle, fill=blue, anchor=west, xshift=-\pgflinewidth] at (node1.east) (node2) {B};
\node<3-> [sequencestyle, fill=green, anchor=west, xshift=-\pgflinewidth] at (node1.east) (node2) {C};
\end{tikzpicture}
\end{frame}

\end{document}

在此处输入图片描述

答案2

如果您希望保留项目符号但仅显示项目内容,则可以使用任何特定于幻灯片的叠加层。以下是使用 的一个\onslide<overlay>{<stuff>}

在此处输入图片描述

\documentclass[10pt]{beamer}% http://ctan.org/pkg/beamer
\usetheme{Warsaw} 
\usecolortheme{whale}

\begin{document}

\begin{frame}{Itemized slide}
\begin{itemize}
  \item This is the first item.
  \item \mbox{}\onslide<2->{This is the second item.}
  \item \mbox{}\onslide<3->{This is the third item.}
\end{itemize}
\end{frame}

\end{document}

相关内容