centering titles when using the beamer class in latex
I want to center the frametitles on my talk. I understand tha开发者_运维百科t the beamer class has a built-in ability to center frametitles, but I can't figure out how to do it. It is something like:
\begin{frame}
\frametitle[alignment=center]{title}
\end{frame}
but that doesn't work.
Can I get a little help?
Try
\setbeamertemplate{frametitle}[default][center]
before all slides.
Manually, i always did it like this:
\begin{frame}
\frametitle{\centerline{Hello World!}}
\end{frame}
I think it's much better to put this code at preamble of your document. So you'll have both frame title and subtitle centered:
\makeatletter
\long\def\beamer@@frametitle[#1]#2{%
\beamer@ifempty{#2}{}{%
\gdef\insertframetitle{\centering{#2\ifnum\beamer@autobreakcount>0
\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}%
\gdef\beamer@frametitle{#2}%
\gdef\beamer@shortframetitle{#1}%
}%
}
\makeatother
精彩评论