我正在准备一个主题如下的演示文稿:
\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}