6

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?

8

You could use centering

\documentclass[center]{beamer}

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

\end{document}

result: screenshot

  • It works! And so simple too. I feel really stupid for not thinking of just moving the \centering command to the document-level scope. Thanks! – deprecated Oct 24 '12 at 17:05

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.