我如何交替图像并只为第一幅图像添加标题?

我如何交替图像并只为第一幅图像添加标题?

我正在尝试创建一个带有交替图像的逐项列表beamer。我已经让列表部分和图像正常工作,但当我尝试添加标题时,事情就崩溃了。基本上,我只想为第一张图片添加标题。每当我尝试只做那一件事时,标题也会显示在后面的图片上。

我读了这篇文章: 如何在 LaTeX beamer 中交替图形 并能够改进,但解决方法是给后面的图像添加标题,但我不想这样做。如果不添加标题,原始标题会保留下来,有时图像会向下移动。

这是我现在得到的代码:(如果它看起来很笨拙,请原谅我,我是新手)

\documentclass{beamer}
\usepackage{beamerthemeshadow}
\usepackage{graphicx}
\setbeamertemplate{caption}[] 
\begin{document}
\frame{
\begin{columns}
\begin{column}{5cm}
\begin{itemize}
\item<1-> founded en el a\~{n}o de 
\item<2-> populaci\'{o}n de m\'{a}s de 5000 personas
\item<3-> Hay un colegio de aproximamente 500 estudiantes
\end{itemize}
\vspace{1cm} 
\end{column}
\begin{column}{8cm}
\begin{figure} 
\includegraphics<1>[scale=0.25]{downtown} 
\def\figurename{Image}
\caption{\only<1>{Foto por }\only<2>{Lago Flor}\only<3>{Colegio de Saranac Lake}}
\begin{center}
\includegraphics<2>[scale=0.5]{lakeflower}
\end{center}
\includegraphics<3>[scale=.21]{slhs}
\end{figure}
\end{column}
\end{columns}}
\end{document}

我尝试过只使用,\only<1>但后面的图像出现时会出现相同的标题。我尝试了\onslide一下,但没有成功。我尝试将后面的图像制作成自己的图形,但这也没有解决问题。

我正在使用带有嵌入式 PDF 查看器的 Texmaker,尽管我在外部查看器中打开了输出,但看起来是一样的。我正在使用模式pdflatex

如果有人对此有想法,我很乐意听听。我觉得我缺少一些可以实现这一点的基本要素。我总是可以复制幻灯片并解决这个问题,但我觉得一定有更好的方法。

答案1

这是一个最小的例子,可以让你随意显示字幕:

在此处输入图片描述

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}

\section{La Ciudad}
\begin{frame}{La Ciudad de Saranac Lake}
  \begin{columns}
    \begin{column}{5cm}
      \begin{itemize}
        \item<1-> founded en el a\~{n}o de 
        \item<2-> populaci\'{o}n de m\'{a}s de 5000 personas
        \item<3-> Hay un colegio de aproximamente 500 estudiantes
      \end{itemize}
      \vspace{1cm} 
    \end{column}

    \begin{column}{8cm}
      \begin{figure}
        \centering
        \includegraphics<1>[scale=0.15]{tiger}%
        \includegraphics<2>[scale=0.15]{tiger}%
        \includegraphics<3>[scale=0.15]{tiger}%

        \only<1>{{\usebeamercolor[fg]{caption name}Image:} Foto por}%
        \only<2>{Lago Flor}%
        \only<3>{Colegio de Saranac Lake}
      \end{figure}
    \end{column}
  \end{columns}
\end{frame}

\end{document}

关于上述示例的一些提示:

  • 我不得不使用不同的图像。我用的是tiger.eps
  • 尝试缩进你的代码。这将提高阅读和调试的效率;
  • 您无需使用宏\caption来设置图形标题。就像我在示例中使用的那样,您只需将常规文本设置为标题即可。我过去\usebeamercolor[fg]{caption name}获得与常规相同的格式\caption
  • 为了完整性,为了表明您可以随意管理标题,我为三个图形中的每一个都添加了一个“标题”,您可以保留/删除它。

相关内容