サイドバータブのハイライトセクションをカスタマイズする方法

サイドバータブのハイライトセクションをカスタマイズする方法

次のテーマでプレゼンテーションを準備しています。

\useoutertheme[height=0pt,width=3cm,left]{sidebar}
\usecolortheme{dove,sidebartab}

強調表示されたセクション/サブセクションのフォントの色を変更し、太字にしたいと思います。

\documentclass{beamer}

\useoutertheme[height=0pt,width=3cm,left]{sidebar}
\usecolortheme{dove,sidebartab}

\setbeamercolor{section in sidebar}{fg=white, bg=black}
\setbeamerfont{section in sidebar}{series=\bfseries}

\begin{document}

\section{Section 1}

\section{Subsection 1.1}

\begin{frame}
    abc
\end{frame} 

\section{Subsection 1.2}

\section{Section 2}

\section{Subsection 2.1}

\section{Subsection 2.2}

\begin{frame}
    abc
\end{frame} 

\end{document}

残念ながら、\setbeamerfont{section in sidebar}{series=\bfseries}強調表示されたセクション/サブセクションだけでなく、すべてのセクション/サブセクションが太字になります。

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

答え1

変更したい\setbeamercolor{section in sidebar}{fg=blue, bg=red}

\documentclass{beamer}

\useoutertheme[height=0pt,width=3cm,left]{sidebar}
\usecolortheme{dove,sidebartab}

\setbeamercolor{section in sidebar}{fg=blue, bg=red}



\begin{document}

\section{test}

\begin{frame}
    abc
\end{frame} 

\section{testtest}

\begin{frame}
    abc
\end{frame} 

\end{document}

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


フォントを太字以外の状態に戻すには、次の操作を実行します。

\documentclass{beamer}

\useoutertheme[height=0pt,width=3cm,left]{sidebar}
\usecolortheme{dove,sidebartab}

%Colours
\setbeamercolor{section in sidebar}{fg=blue, bg=red}

% Fonts
\setbeamerfont{section in sidebar}{series=\bfseries}
\setbeamerfont{section in sidebar shaded}{series=\normalfont}

\makeatletter
\setbeamertemplate{section in sidebar shaded}
{%
  \vbox{%
    \vskip1ex%
    \beamer@sidebarformat{3pt}{section in sidebar shaded}{\usebeamerfont{section in sidebar shaded}\insertsectionhead}%
  }%
}
\makeatother

\begin{document}

\section{Section 1}

\begin{frame}
    abc
\end{frame} 


\section{Subsection 1.1}

\begin{frame}
    abc
\end{frame} 

\section{Subsection 1.2}

\section{Section 2}

\section{Subsection 2.1}

\section{Subsection 2.2}

\begin{frame}
    abc
\end{frame} 

\end{document}

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

関連情報