分割框架標題

分割框架標題

我想將投影機類別中的框架標題拆分為兩個相等的列,以便在左側顯示該部分的標題,在右側顯示該小節的標題(如果存在)。另外,側面的不同顏色會很好。

我正在嘗試使用:

\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}

輸出:

投影儀

相關內容