8

I am trying to move some text to the bottom of a beamer slide. Why do \vspace*{\fill} and vfill not work? Luckily \begin{frame}[b]{Title} does the job for me (at least for most slides), but I would like to understand why the previously mentioned commands fail to do the job.

\documentclass{beamer}

\begin{document}

\begin{frame}[b]{Title}
    This text is correctly bottom aligned.
\end{frame}

\begin{frame}{Title}
    Text\\
    \vspace*{\fill}
    This text is not correctly bottom aligned.
\end{frame}

\begin{frame}{Title}
    Text
    \vfill
    This does not work either.
\end{frame}

\begin{frame}[c]{Title}
    Now I am not able to vertically center this text anymore.\\
    \vskip0pt plus 1filll
    This text is now bottom aligned.
\end{frame}

\end{document}

2 Answers 2

4

It seems like adding \vskip0pt plus 1filll before and after the text forces it to be aligned vertically. None of the other \vspace*{\fill} and \vfill appear to work in the same manner, though.

\begin{frame}[c]{Title}
    \vskip0pt plus 1filll
    This text is vertically aligned.\\
    \vskip0pt plus 1filll
    This text is bottom aligned.
\end{frame}
1

The motivation behind this difficulty is because beamer puts in considerable effort to manage the content on frames, with the possibility of automatically breaking them into different slides based on \pauses and/or overlay specification. Specifically, it inserts skips at the top and bottom of the frame, and these interfere with your skips.

If you want content spread across the frame it's best to set it inside a minipage of appropriate height (guessed based on whether it fits or is overfull):

enter image description here

\documentclass{beamer}

\begin{document}

\begin{frame}[b]{Title}
  This text is correctly bottom aligned.
\end{frame}

\begin{frame}[t]{Title}
  \begin{minipage}[t][0.8715\textheight]{\textwidth}
  Text
  
  \vspace{\fill}% or \vfill

  This text is correctly bottom aligned.
  \end{minipage}
\end{frame}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .