9

How do I put the title in the center of a slide:

I have the following code:

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

% Uncomment these lines for an automatically generated outline.
%\begin{frame}{Outline}
%  \tableofcontents
%\end{frame}

\section{Outline}
\begin{frame}{Outline}

\begin{itemize}
  \item Semidefinite Relaxations over Rotation Matrices 
  \item Attitude Estimation of Satellite
  \item Future Work
\end{itemize}

\end{frame}  

The following is its image. How do I put the "Outline" in the center? (i.e. just horizontally shift "Outline" to the center.)

enter image description here

Werner
  • 603,163

1 Answers1

18

Set the template for frametitle to include a centered horizontal alignment:

\setbeamertemplate{frametitle}[default][center]

Here is a minimal example:

enter image description here

\documentclass{beamer}

\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764
\setbeamertemplate{frametitle}[default][center]

\begin{document}

\begin{frame}{Outline}

  Some regular content.

  \begin{itemize}
    \item Semidefinite Relaxations over Rotation Matrices 
    \item Attitude Estimation of Satellite
    \item Future Work
  \end{itemize}

\end{frame}  

\end{document}
Werner
  • 603,163
  • I am sorry, but how can I center the title in the main title page in this MWE? – Diaa Jul 05 '17 at 14:51
  • 1
    @DiaaAbidou: You can use \title{\makebox[\linewidth]{<title>}} - the title doesn't seem to be used elsewhere, so setting it in a box in the aforementioned way will centre it. – Werner Jul 05 '17 at 17:38
  • When revisiting your answer to my question, it fails to generate a multi-lined centered title for this MWE, so what is wrong here? – Diaa Aug 29 '17 at 04:56
  • @DiaaAbidou: For that you can try using \parbox{\linewidth} instead of \makebox[\linewidth]. – Werner Aug 29 '17 at 15:36