投影机中的人物四处移动

投影机中的人物四处移动

这是MWE我的代码:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\mode<presentation> {
\usetheme{Frankfurt}
\usecolortheme{dolphin}
}

\begin{document}

\begin{frame}

\begin{columns}[c]

\column{.7\textwidth}
\only<1>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
  \end{tikzpicture}
}
\only<2>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \draw[green,thick,rounded corners] (4.8,5.2) ellipse (0.28 and 1.5);
    \draw[->, line width=2pt, -triangle 60] (6.3,5.2) -- (5.2,5.2);
  \end{tikzpicture}
}
\only<3>{
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \draw[green,thick,rounded corners] (5.8,3) ellipse (0.28 and 1.5);
    \draw[->, line width=2pt, -triangle 60] (7.1,3) -- (6.1,3);
  \end{tikzpicture}
}

\column{.35\textwidth}
\vspace{-1.cm}
\setbeamercolor{normal text}{fg=gray,bg=}
\setbeamercolor{alerted text}{fg=black,bg=}
\usebeamercolor{normal text}
\begin{itemize}
\item \alert<+>{Some text goes here sdsdf sdfsdfsdfsdf.}\\[4ex]
\item \alert<+>{Some more text here sdfdsf.}\\[4ex]
\item \alert<+>{And some text here.}
\end{itemize}

\end{columns}

\end{frame}

\end{document}

这将创建三张包含相同图像的幻灯片:

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

单独看时可能不明显,但灰色方块在幻灯片中并不保持固定位置。如何让它停止移动?

这是我使用的灰色方块:在此处输入图片描述

答案1

正如 Claudio 所指出的,如果您不希望内容从一张幻灯片移动到下一张幻灯片,则应该使用\visible而不是:\only

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\mode<presentation> {
\usetheme{Frankfurt}
\usecolortheme{dolphin}
}


\begin{document}

\begin{frame}

\begin{columns}[c]

\column{.7\textwidth}
  \begin{tikzpicture}
    \node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=0.9\textwidth]{fig.png}};
    \visible<2>{
        \draw[green,thick,rounded corners] (4.8,5.2) ellipse (0.28 and 1.5);
        \draw[->, line width=2pt, -triangle 60] (6.3,5.2) -- (5.2,5.2);
    }
    \visible<3>{
        \draw[green,thick,rounded corners] (5.8,3) ellipse (0.28 and 1.5);
        \draw[->, line width=2pt, -triangle 60] (7.1,3) -- (6.1,3);
    }
  \end{tikzpicture}


\column{.35\textwidth}
\vspace{-1.cm}
\setbeamercolor{normal text}{fg=gray,bg=}
\setbeamercolor{alerted text}{fg=black,bg=}
\usebeamercolor{normal text}
\begin{itemize}
\item \alert<+>{Some text goes here sdsdf sdfsdfsdfsdf.}\\[4ex]
\item \alert<+>{Some more text here sdfdsf.}\\[4ex]
\item \alert<+>{And some text here.}
\end{itemize}

\end{columns}

\end{frame}

\end{document}

相关内容