0

I would like to center only the section titles in the beamer metropolis theme, without changing the other defaults (in particular I would like to keep the progress bar).

I have tried the following, which did not work

\usepackage{sectsty}
\allsectionsfont{\centering}

and the following which worked for the normal titlepage but not for section titles (perhaps I'm using the wrong name?)

\setbeamertemplate{section page}{ % also used section and section title
%  \raggedright%  % <-- Comment here
  \linespread{1.0}%
  \inserttitle%
  \par%
  \vspace*{0.5em}
}
0

Answer: I was able to do it by removing the \raggedright command from the section page and include \centering instead before the section title

 % Center Section titles 
    \setbeamertemplate{section page}{
    \begin{center} % add center if missing
    \begin{minipage}{22em}
    \usebeamercolor[fg]{section title}
    \usebeamerfont{section title}
    %\raggedright % comment out raggedright
    \centering % add centering here to center title
    \insertsectionhead\\[-1ex]
    \usebeamertemplate*{progress bar in section page}
    \par
    \ifx\insertsubsectionhead\@empty\else%
    \usebeamercolor[fg]{subsection title}%
    \usebeamerfont{subsection title}%
    \insertsubsectionhead
    \fi
    \end{minipage}
    \end{center}
    \par
    \vspace{\baselineskip}
    }

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.