[Tex/LaTex] Automatic horizontal centering of beamer frame content

beamerhorizontal alignment

I would like to set some global option so that the content of all beamer frames is horizontally centered with respect to the page. In other words, I want to achieve the effect of wrapping all frame content in \centering\par, but without actually having to type that in every frame:

\documentclass{beamer}
%% This is the sort of thing I want, but it only works in article mode
% \setbeamertemplate{frame begin}{\centering}
% \setbeamertemplate{frame end}{\par}
\begin{document}
\begin{frame}
  \framebox{Automatically centered -- how?}
\end{frame}
\begin{frame}
  \centering
  \framebox{Centered by hand}
  \par
\end{frame}
\end{document}

I have searched the documentation for some sort of hook that I can set, but to no avail. The tantalizingly named frame begin and frame end templates work only in article mode. How can this effect be achieved?

Best Answer

You could use centering

\documentclass[center]{beamer}

\begin{document}
\centering
\begin{frame}
  \framebox{Automatically centered!}
\end{frame}

\end{document}

result: screenshot