如何更改章节标题页的前景色

如何更改章节标题页的前景色

我有一个基本的投影仪演示文稿:

\documentclass[aspectratio=169]{beamer}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{courier}
\usepackage[T1]{fontenc}

% -----------
% Set ISRIC style

\usetheme{example}

% -- Section title pages
\AtBeginSection[]{
  \begin{frame}
  \vfill
  \centering
  \begin{block}{}
  \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
    \usebeamerfont{title}\insertsectionhead\par%
  \end{beamercolorbox}
  \end{block}
  \vfill
  \end{frame}
}

%----------------
% Title and authors

\title{My presentation}

\subtitle{Coded with \LaTeX}

\author[Jane Smith]{Jane Smith}

\institute[Institute of LaTeX Learning]{Institute of LaTeX Learning}

\date{\today}

%====================================================================
\begin{document}

%----------------
% Title frame

{ \setbeamertemplate{footline}{} % no footer on title
\begin{frame}
\titlepage 
\end{frame} 
}

%----------------
% Table of contents

\begin{frame}
\frametitle{Outline}
\tableofcontents
% You might wish to add the option [pausesections]
\end{frame}

%------------------------------------------------
\section{First Section} % Sections can be created in order to organize your presentation into discrete blocks, all sections and subsections are automatically printed in the table of contents as an overview of the talk
%------------------------------------------------

\subsection{Subsection Example} % A subsection can be created just before a set of slides with a common theme to further break down your presentation into chunks

\begin{frame}
\frametitle{Paragraphs of Text}
Sed iaculis dapibus gravida. Morbi sed tortor erat, nec interdum arcu. Sed id lorem lectus. Quisque viverra augue id sem ornare non aliquam nibh tristique. Aenean in ligula nisl. Nulla sed tellus ipsum. Donec vestibulum ligula non lorem vulputate fermentum accumsan neque mollis.\\~\\

Sed diam enim, sagittis nec condimentum sit amet, ullamcorper sit amet libero. Aliquam vel dui orci, a porta odio. Nullam id suscipit ipsum. Aenean lobortis commodo sem, ut commodo leo gravida vitae. Pellentesque vehicula ante iaculis arcu pretium rutrum eget sit amet purus. Integer ornare nulla quis neque ultrices lobortis. Vestibulum ultrices tincidunt libero, quis commodo erat ullamcorper id.
\end{frame}

%----------------
\end {document}

我想调整 Section 元素的前景,因此生成了这个样式文件:

\mode<presentation>
\ProcessOptionsBeamer

% ---------------------------------
% color definitions
\definecolor{ocre}  {RGB}{139,  40, 34}

% ---------------------------------
% set colors of elements
\setbeamercolor{section}{fg=ocre}
\setbeamercolor{section in toc}{fg=ocre}
\setbeamercolor{section title}{fg=ocre}

% ---------------------------------
% settings for Boxes
\setbeamertemplate{blocks}[rounded][shadow=true]

\mode
<all>

在目录中,Section 元素前景按预期进行了修改:

在此处输入图片描述

然而,在章节标题页中它仍然以默认样式显示:

在此处输入图片描述

我错过了什么?

答案1

您可以使用section title适合您的颜色beamercolorbox来代替颜色title

\documentclass[aspectratio=169]{beamer}

\definecolor{ocre}{RGB}{139,40,34}
\setbeamercolor{section title}{fg=ocre}
\setbeamertemplate{blocks}[rounded][shadow=true]


% -- Section title pages
\AtBeginSection[]{
  \begin{frame}
  \vfill
  \centering
  \begin{block}{}
  \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{section title}%<- Change here
    \usebeamerfont{title}\insertsectionhead\par%
  \end{beamercolorbox}
  \end{block}
  \vfill
  \end{frame}
}

\begin{document}

\section{First Section} 

\begin{frame}
\end{frame}

\end{document}

在此处输入图片描述

相关内容