我认为这是一个非常基本的问题,但不知何故我不知道如何解决它。我正在与beamer
班级,想创建有两列的幻灯片。其中一列只包含几行文本,但我希望行与行之间有灵活的间距。不幸的是,这\vspace{\stretch{1}}
似乎在环境中不再起作用column
。
一个简短的示例代码:
\documentclass{beamer}
\begin{document}
\begin{frame}
The text on this line should be nicely separated\dots
\vspace{\stretch{1}}
\dots from the text on this line. (Which is the case here.)
\end{frame}
\begin{frame}
\begin{columns}
\begin{column}{0.5\textwidth}
Imagine some graphics here.
\end{column}
\begin{column}{0.5\textwidth}
The text on this line should be nicely separated\dots
\vspace{\stretch{1}}
\dots from the text on this line. (Which is not the case here.)
\end{column}
\end{columns}
\end{frame}
\end{document}
答案1
一种选择是使用minipage
s 而不是columns
环境;使用可选参数,minipage
您可以指定的高度minipage
,这允许您使用\vfill
(或\vspace{\stretch{1}}
):
\documentclass{beamer}
\begin{document}
\begin{frame}
The text on this line should be nicely separated\dots
\vspace{\stretch{1}}
\dots from the text on this line. (Which is the case here.)
\end{frame}
\begin{frame}
\begin{minipage}[c]{0.5\textwidth}
Imagine some graphics here.
\end{minipage}%
\begin{minipage}[c][.5\textheight][c]{0.5\textwidth}
The text on this line should be nicely separated\dots
\vfill
\dots from the text on this line. (Which is also the case here.)
\end{minipage}
\end{frame}
\end{document}
答案2
如果你\tracingmacros
按照如下所示插入,则会看到列以
\endcolumn ->\end {minipage}\hfill \end {actionenv}\@ignoretrue
这表明该列是一个 mininpage。垂直框永远不会拉伸,它们始终是指定的大小,或内容的自然未拉伸大小。如果希望拉伸粘连在列内起作用,则需要minipage
使用其附加可选参数指定垂直尺寸。使用 grep 几分钟即可显示它的位置,并在下面重新定义相应的定义。这会使列有点太高,但可以通过肉眼或通过检查 beamer 的其他部分来更改该值,以查看它实际使用的框架垂直尺寸。
\documentclass{beamer}
\makeatletter
\expandafter\def\csname beamerx@\string\beamer@columnenv\endcsname#1#2#3{%
\beamer@colclose
\def\beamer@colclose{}%
\begin{actionenv}#3\setkeys {beamer@col}{#1}%
\dimen@\textheight
\advance\dimen@-\footheight
\advance\dimen@-\headheight
\begin {minipage}[\beamer@colalign][\dimen@][c]{#2}%
\leavevmode \raggedright \beamer@colheadskip \ignorespaces}
\makeatother
\begin{document}
\begin{frame}
The text on this line should be nicely separated\dots
\vspace{\stretch{1}}
\dots from the text on this line. (Which is the case here.)
\end{frame}
\begin{frame}
\begin{columns}
\begin{column}{0.5\textwidth}
Imagine some graphics here.
\end{column}
\begin{column}{0.5\textwidth}
The text on this line should be nicely separated\dots
\vspace{\stretch{1}}
\dots from the text on this line. (Which is not the case here.)
\tracingmacros2
\end{column}
\end{columns}
\end{frame}
\end{document}