我有一个分为两列的投影仪框架。左列包含项目符号列表,其中的项目逐一出现(使用\begin{itemize}[<+->]
)。右列包含随项目变化的各种纵横比的图片(使用\only<x>{...}
)。
我的问题是,左列项目符号列表的布局会根据右列图片的纵横比而变化,这在播放演示文稿时会分散注意力。
这是一个简单的例子:
\documentclass[draft]{beamer}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\frametitle{Test}
\begin{columns}
\begin{column}{0.6\textwidth}
\begin{itemize}[<+->]
\item Somebody once told me the world is gonna roll me
\item I ain't the sharpest tool in the shed
\item She was looking kinda dumb with her finger and her thumb
\item In the shape of an L her forehead
\end{itemize}
\end{column}
\begin{column}{0.4\textwidth}
\only<1>{\includegraphics[width=\linewidth,height=1.5\linewidth]{fig1.png}}
\only<2-3>{\includegraphics[width=\linewidth,height=\linewidth]{fig2.png}}
\only<4>{\includegraphics[width=\linewidth,height=1.5\linewidth]{fig1.png}}
\end{column}
\end{columns}
\end{frame}
\end{document}
从结果中可以看出,根据图像的纵横比,文本并没有从一个子帧对齐到另一个子帧。
有没有办法让左侧的文本布局独立于右侧?
答案1
overlayarea
是你的朋友:
\documentclass[draft]{beamer}
\begin{document}
\begin{frame}
\frametitle{Test}
\begin{columns}
\begin{column}{0.6\textwidth}
\begin{itemize}[<+->]
\item Somebody once told me the world is gonna roll me
\item I ain't the sharpest tool in the shed
\item She was looking kinda dumb with her finger and her thumb
\item In the shape of an L her forehead
\end{itemize}
\end{column}
\begin{column}{0.4\textwidth}
\begin{overlayarea}{\linewidth}{1.5\linewidth}%
\includegraphics<1>[width=\linewidth,height=1.5\linewidth]{fig1.png}%
\includegraphics<2-3>[width=\linewidth,height=\linewidth]{fig2.png}%
\includegraphics<4>[width=\linewidth,height=1.5\linewidth]{fig1.png}%
\end{overlayarea}
\end{column}
\end{columns}
\end{frame}
\end{document}
顺便说一句:你不需要\usepackage{graphicx}
使用 beamer