프레임 제목 분할

프레임 제목 분할

나는 비머 클래스의 프레임 제목을 두 개의 동일한 열로 분할하여 왼쪽에 섹션 제목이 나타나고 오른쪽에 하위 섹션 제목(존재하는 경우)이 나타나도록 하고 싶습니다. 그리고 측면 색상도 다양하게 하면 좋을 것 같아요.

나는 다음을 사용하려고합니다 :

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

산출:

비머

관련 정보