
ビーマー クラスのフレーム タイトルを 2 つの等しい列に分割して、左側にセクションのタイトルが表示され、右側にサブセクションのタイトル (存在する場合) が表示されるようにします。また、両側に異なる色があると便利です。
使用しようとしているもの:
\useoutertheme{split}
\setbeamertemplate{headline}[split]
しかし、タイトル内のすべてのセクションとサブセクションが、名前を付けずに作成されます。必要なのは現在のセクションとサブセクションだけです。
答え1
この場合、見出しを自分で再定義する必要があります。私は分割テーマをコピーし、ナビゲーション バーをそれぞれ と に置き換えまし\insertsection
た\insertsubsection
。
色を設定するには、次の\setbeamercolor{}
コマンドを使用する必要があります。
\setbeamercolor{section in head/foot}{fg=white, bg=red}
\setbeamercolor{subsection in head/foot}{fg=white, bg=blue}
完全な例:
\documentclass{beamer}
\setbeamertemplate{headline}{%
\leavevmode%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{section in head/foot}%
\hfill\insertsection\hspace*{1em}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{subsection in head/foot}%
\hspace*{1em}\insertsubsection%
\end{beamercolorbox}%
}
\setbeamercolor{section in head/foot}{fg=white, bg=red}
\setbeamercolor{subsection in head/foot}{fg=white, bg=blue}
\begin{document}
\section{My Section 1}
\subsection{My Subsection 1}
\begin{frame}{Frametitle}
Frame Content
\end{frame}
\subsection{My Subsection 2}
\begin{frame}{Frametitle}
Frame Content
\end{frame}
\section{My Section 2}
\subsection{My Subsection 1}
\begin{frame}{Frametitle}
Frame Content
\end{frame}
\subsection{My Subsection 2}
\begin{frame}{Frametitle}
Frame Content
\end{frame}
\end{document}
出力: