Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I think this is a very basic problem but somehow I don't know how to solve it. I am working with the beamer class and want to create slides where there are two columns. One of the two columns contains only a few lines of text but I want the lines be separated by a flexible amount of space. Unfortunately the \vspace{\stretch{1}} seems not to work anymore in the column environment.

A short example-code:

\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}
share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  diabonas Mar 7 '12 at 14:43
    
Thanks, this solved my problem! Although the question why it does not work with columns is still open. –  user12430 Mar 8 '12 at 7:04

2 Answers 2

An option could be to use minipages instead of the columns environment; using the optional arguments of minipage you can specify the height of the minipage and this allows you to use \vfill (or \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}
share|improve this answer

If you insert \tracingmacros as seen below then you will see that the column end with

\endcolumn ->\end {minipage}\hfill \end {actionenv}\@ignoretrue 

which shows the column is a mininpage. Vertical boxes never stretch they are always the size specified, or the natural unstretched size of their contents. If you want stretch glue to have an effect within the column you will need to specify the vertical size of the minipage using its additional optional arguments. A couple of minutes with grep shows where this is and the appropriate definition is redefined below. this makes the column a bit too high, but the value can be changed either by eye, or by checking other parts of beamer to see what size it really uses for the vertical size of a frame.

\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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.