如何更改标题部分框的背景颜色?

如何更改标题部分框的背景颜色?

我想将包含各部分的标题框的颜色从白色更改为“大纲”一词的颜色,并将此框中各部分的名称的颜色从红色更改为框架标题的背景颜色。这是我当前的输出

在此处输入图片描述

我的代码

\documentclass{beamer}
\mode<presentation>
{
  \usetheme{Madrid}      % or try Darmstadt, Madrid, Warsaw, ...
  \usecolortheme{beaver} % or try albatross, beaver, crane, ...
  \usefonttheme{serif}  % or try serif, structurebold, ...
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
} 

 \usepackage[english]{babel}
 \usepackage[utf8x]{inputenc}
 \usepackage{xcolor}
 \usepackage{listings}
 \lstset
 {
 language=[LaTeX]TeX,
 breaklines=true,
 basicstyle=\tt\scriptsize,
 %commentstyle=\color{green}
 keywordstyle=\color{blue},
 %stringstyle=\color{black}
 identifierstyle=\color{magenta},
}

\title[latex in collaboration]{latex in collaboration}
\author{Alexandre Bernardino}
\institute{ISR/IST}
\date{March 9, 2015}

\AtBeginSection[]
 {
 \begin{frame}<beamer>
 \frametitle{Outline}
 \tableofcontents[currentsection,currentsubsection]
 \end{frame}
 }
 \makeatother
 \setbeamertemplate{footline}{\hspace*{.2cm}\scriptsize{\insertshorttitle
 \hspace*{3.5cm} \insertframenumber / \inserttotalframenumber}
 \vspace{4pt}} 
 \makeatletter
 \setbeamertemplate{navigation symbols}{}
  \makeatletter
  \setbeamertemplate{headline}{%
 \leavevmode%
 \hbox{%
 \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette 
   quaternary}%               
  \insertsectionnavigationhorizontal{\paperwidth}{}{}
  \end{beamercolorbox}%
  }
  }

 \makeatother
 \begin{document}

  \begin{frame}
  \titlepage
   \end{frame}

   % Uncomment these lines for an automatically generated outline.
   \begin{frame}{Outline}
    \tableofcontents
    \end{frame}

    \section{Introduction}
    \section{Some History}
    \section{First Steps}
     \section{\LaTeX{} Basics}

     \end{document}

先感谢您。

答案1

您可以使用以下方式控制导航栏的颜色

\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}

第一个命令改变当前部分和其他部分的颜色,第二个命令改变背景颜色。

梅威瑟:

\documentclass{beamer}

\usetheme{Madrid}      
\usecolortheme{beaver} 
\setbeamercolor{section in head/foot}{bg=gray!10!white, fg=gray!10!white}
\setbeamercolor{palette quaternary}{bg=darkred}

\title[latex in collaboration]{latex in collaboration}
\author{Alexandre Bernardino}
\institute{ISR/IST}
\date{March 9, 2015}

\setbeamertemplate{headline}{%
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette 
     quaternary}%               
            \insertsectionnavigationhorizontal{\paperwidth}{}{}
        \end{beamercolorbox}%
    }
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}
\frametitle{test}
content...
\end{frame}

\section{Some History}
\begin{frame}
content...
\end{frame}


\section{First Steps}
\begin{frame}
content...
\end{frame}

\section{\LaTeX{} Basics}

\begin{frame}
content...
\end{frame}

\end{document}

在此处输入图片描述

相关内容