Beamer:如何避免图像因下方文本的长度而发生偏移?

Beamer:如何避免图像因下方文本的长度而发生偏移?

我有以下代码:

\documentclass{beamer}

\usepackage[utf8]{inputenc}

%Information to be included in the title page:
\title{Sample title}
\author{Anonymous}
\institute{ShareLaTeX}
\date{2014}

\begin{document}
\frame{\titlepage}

\begin{frame}
\frametitle{Sample frame title}

\begin{figure}
    \centering
    \includegraphics[scale=0.5]{smallcat.jpg}
    \caption{Smallcat}
    \label{fig:my_label}
\end{figure}

Sunny, yesterday my life was filled with rain
Sunny, you smiled at me and really eased the pain
The dark days are gone, and the bright days are here
My Sunny one shines so sincere
Sunny one so true, I love you

Sunny, thank you for the sunshine bouquet
Sunny, thank you for the love you brought my way
You gave to me your all and all
Now I feel ten feet tall
Sunny one so true, I love you

\end{frame}

\begin{frame}
\frametitle{Sample frame title}


\begin{figure}
    \centering
    \includegraphics[scale=0.5]{smallcat.jpg}
    \caption{Smallcat}
    \label{fig:my_label}
\end{figure}
Sunny, thank you for the truth you let me see

\end{frame}
\end{document}

生成以下两张幻灯片:

在此处输入图片描述

在此处输入图片描述

请注意,由于文本太长,第二张幻灯片中的猫的图像已经向下移动。

我如何确保猫的图像保持在第一张幻灯片的位置?

答案1

你似乎有点反对叠加,但考虑到你能实现的控制,我强烈建议你这样做。此外,未来的调整也变得轻而易举。抛开其他不谈,想想一个简单的场景,你已经把同一张图片放在十张幻灯片的顶部,现在你想稍微调整一下大小。叠加不是更好的解决方案吗?


\documentclass{beamer}

\usepackage[utf8]{inputenc}

%Information to be included in the title page:
\title{Sample title}
\author{Anonymous}
\institute{ShareLaTeX}
\date{2014}

\begin{document}
\frame{\titlepage}

\begin{frame}
\frametitle{Sample frame title}

\begin{figure}
    \centering
    \includegraphics[scale=0.5]{smallcat.jpg}
    \caption{Smallcat}
    \label{fig:my_label}
\end{figure}

\begin{overprint}
  \onslide<+>

  Sunny, yesterday my life was filled with rain Sunny, you smiled at
  me and really eased the pain The dark days are gone, and the bright
  days are here My Sunny one shines so sincere Sunny one so true, I
  love you

  Sunny, thank you for the sunshine bouquet Sunny, thank you for the
  love you brought my way You gave to me your all and all Now I feel
  ten feet tall Sunny one so true, I love you

  \onslide<+>

  Sunny, thank you for the truth you let me see
\end{overprint}

\end{frame}
\end{document}

之前的部分\begin{overprint}是静态部分。在你的情况下,它是图形。\begin{overprint} 和之间的部分\end{overprint}是动态或覆盖部分。每个部分\onslide都会启动不同的显示。

要了解有关此动态特性的更多信息,请参阅第9.5 动态更改文本或图像beamer 文档


在此处输入图片描述

相关内容