3

I am working with no predefined theme.

It appears that with

\begin{frame}[c]
Hello world!
\end{frame}

the text is not fully vertically centered; it's a little bit too high.

I managed to solve this problem using the minipage environment:

\begin{frame}[c]
\begin{minipage}[c][\textheight][c]{\linewidth}
Hello world!
\end{minipage}
\end{frame}

Is there any other solution?

1 Answer 1

2

In beamerbaseframe.sty, we could find the definition of c option for frames:

\define@key{beamerframe}{c}[true]{% centered
  \beamer@frametopskip=0pt plus 1fill\relax%
  \beamer@framebottomskip=0pt plus 1.5fill\relax%
  \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
  \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
  \def\beamer@initfirstlineunskip{}%
}

To make text fully vertically centered, we only need to redefine it, making \beamer@frametopskip and \beamer@framebottomskip have the same fill:

\documentclass{beamer}
\makeatletter
\define@key{beamerframe}{c}[true]{% centered
  \beamer@frametopskip=0pt plus 1fill\relax%
  \beamer@framebottomskip=0pt plus 1fill\relax%
  \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
  \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
  \def\beamer@initfirstlineunskip{}%
}
\makeatother
\begin{document}
\begin{frame}[c]
Hello world!
\end{frame}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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