6

I'm writing my thesis slides in beamer. I need to align vertically at center the slide's contents when I use the [allowframebreaks] option in the frame environment and the \newpage to start a new slide.

As the next example:

    \begin{frame}[allowframebreaks]
                    \frametitle{Outline}
                    Some text....

                    \newpage
                    Some text....
                    \begin{figure}[!ht]
                         \input{myimage.pdf_tex}
                    \end{figure}

                    \newpage
                    Some text....
                    \begin{figure}[!ht]
                         \input{myimage2.pdf_tex}
                    \end{figure}
         \end{frame}

Here both figures are always in the top of it's slide, but not in the vertical center. I need to center the content after breaking to a new slide with \newpage.

Thanks in advance. I really appreciate your help.

1
  • Remember that there is technically no need to use a floating environment in a presentation. So you don't need to wrap things inside a figure environment.
    – Werner
    Aug 22, 2012 at 6:06

1 Answer 1

7

From beamer manual:

By default, all material for a slide is vertically centered. You can change this using the following class options:

\documentclass[t]{beamer}

Place text of slides at the (vertical) top of the slides. This corresponds to a vertical “flush.” You can override this for individual frames using the c or b option.

\documentclass[c]{beamer}

Place text of slides at the (vertical) center of the slides. This is the default. You can override this for individual frames using the t or b option.

So you can use something like next code to vertically center your "broken" frames:

\documentclass[t]{beamer} %<- 'c' is default option, 't' forces top aligned
\usepackage{lipsum}
\begin{document}
\begin{frame}[c,allowframebreaks]{centered frame} %<- 'c' forces to forget default
\lipsum[2]
\framebreak %<- with '\newpage' first frame is top aligned
\lipsum[5]
\end{frame}
\begin{frame}[allowframebreaks]{top aligned frame}
\lipsum[2]
\framebreak
\lipsum[5]
\end{frame}
\end{document}

enter image description here

You used \newpage to break the frame but beamer says:

You can insert \break, \nobreak, and \penalty commands to control where breaks should occur. The commands \pagebreak and \nopagebreak also work, including their options. [...] The command \framebreak is a shorthand for \pagebreak and \noframebreak is a shorthand for \nopagebreak.

If you uses \newpage first slide is top aligned, so use \break or \framebreak.

Just a last comment from beamer manual talking about allowframebreaks option:

The use of this option is evil. In a (good) presentation you prepare each slide carefully and think twice before putting something on a certain slide rather than on some different slide. Using the allowframebreaks option invites the creation of horrible, endless presentations that resemble more a “paper projected on the wall” than a presentation. Nevertheless, the option does have its uses. Most noticeably, it can be convenient for automatically splitting bibliographies or long equations.

1
  • Thanks @Ignasi now I can make my slides. I really appreciate your help. Aug 22, 2012 at 14:01

You must log in to answer this question.

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