[Tex/LaTex] Center content of frame in beamer class

beamer

Doesn't it bother anybody that the beamer class doesn't perfectly center the contents of frames vertically?

There is a bit more space below than above. Could anybody provide a solution on how to achieve a perfectly centered content and, more importantly, to make this the global setting?

Below is a (trivial) MWE.

\documentclass{beamer}

\begin{document}
    \begin{frame}
        This text is not perfectly centered vertically.
    \end{frame}
\end{document}

Best Answer

The textpos package lets you put your text at any position you specify on the page. In beamer class, the package must be loaded with the overlay option, this is not the case in other document classes. I also turned on the showboxes option just to compare with the perfect center calculated by tikz. In your final document, you can remove the showboxes option, or, add the \textblockrulecolor{white} command to hide the boxes. The latter command in my experience resulted in a more accurate positioning. But I have no idea why this was the case.

\documentclass{beamer}
\usepackage{tikz,lmodern}
\usepackage[absolute,overlay,showboxes]{textpos}
\begin{document}
\centering
\begin{frame}{title}
  This text is not perfectly centered vertically.
  \begin{tikzpicture}[overlay, remember picture]
    \draw (current page.north west)--(current page.south east) (current page.south west)--(current page.north east);
  \end{tikzpicture}

  \begin{textblock}{13.5}[.5,.5](8,8)
    This text is perfectly centered vertically and horizontally.
  \end{textblock}    
\end{frame}

\end{document}

enter image description here