Beamerセクションタイトルの配置

Beamerセクションタイトルの配置

私は Metropolis をテーマにした LaTeX ビーマーを作成しています。セクション名が長くなった場合、セクション タイトルの長さを一定に保つために自動的に改行が追加されます。

\section{Bayesian Estimation for Regression Models}

ここに画像の説明を入力してください

または、mbox を使用して改行のないセクションを実現することもできます。

\section{\mbox{Bayesian Estimation for Regression Models}}

ここに画像の説明を入力してください

しかし、皆さんもご覧のとおり、mbox を使用した改行なしセクションのタイトルは右揃えになっています。タイトルを中央に配置するのを手伝ってもらえますか?

答え1

中央揃えのタイトルは他の右揃えのタイトルと合わないでしょう。代わりに、https://topanswers.xyz/tex?q=1041すべてのタイトルが収まるようにセクション ページの幅を広げるには:

\documentclass{beamer}

\usetheme{moloch}% modern fork of the metropolis theme

\makeatletter
\setbeamertemplate{section page}{
  \centering
  \begin{minipage}{\linewidth}
    \raggedright
    \usebeamercolor[fg]{section title}
    \usebeamerfont{section 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}
  \par
  \vspace{\baselineskip}
}
\makeatother

\begin{document}

\section{Bayesian Estimation for Regression Models}


\begin{frame}
test
\end{frame} 

\end{document}

ここに画像の説明を入力してください

関連情報