根据这个答案, 我们有
\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=blue]{structure}
%------------------------\AtBeginSubsection[]----------------------
\AtBeginSubsection[]{
\begin{frame}<beamer>[noframenumbering,plain]{Outline}
\transsplitverticalout
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
\usetheme{Madrid}
%----------------------------------------------------------------
\setbeamercolor{author in head/foot}{bg=blue!30!black}
\setbeamercolor{title in head/foot}{bg=yellow!30!white,fg=blue!30!black}
\setbeamercolor{page number in head/foot}{bg=blue!30!black,fg=white}
%----------------------------------------------------------------
\title[The essential numerical range and the Olsen problem]{The
essential numerical range and the Olsen problem}
\author[{Student} (University of ....)]{Student}
\useoutertheme{shadow}
\usepackage{tikz}
\usetikzlibrary{shadings}
%-----------------------------------------------------------------------
\colorlet{titleleft}{blue!30!black}
\colorlet{titleright}{blue!30!black}
\setbeamercolor*{frametitle}{fg=white}
\setbeamercolor*{subsection in head/foot}{bg=yellow!30!white,fg=blue!30!black}
%-----------------------------------------------------------------------
\makeatletter
\pgfdeclarehorizontalshading[titleleft,titleright]
{beamer@frametitleshade}
{\paperheight}{%
color(0pt)=(titleleft);
color(\paperwidth)=(titleright)}
\makeatother
%-----------------------------footline-----------------------------
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
% \hspace*{3em}
% \insertframenumber{} / \inserttotalframenumber\hspace*{1ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{page number in head/foot}%
% \usebeamerfont{title in head/foot}\insertshorttitle\hspace*{3em}
\insertframenumber{} / \inserttotalframenumber
\end{beamercolorbox}%
}%
\vskip0pt%
}
%--------------------------------------------------
\colorlet{myblue}{blue!30!black}
\colorlet{myyellow}{yellow!30!white}
\setbeamercolor{author in head/foot}{bg=myblue}
\setbeamercolor{title in head/foot}{bg=myyellow,fg=myblue}
\setbeamercolor{page number in head/foot}{bg=myblue,fg=white}
\setbeamercolor*{subsection in head/foot}{bg=myyellow,fg=myblue}
\colorlet{titleleft}{myblue} %<----- left half of frame title background color
\colorlet{titleright}{myblue} %<----- right half of frame title background color
\setbeamercolor*{frametitle}{fg=white} %<---- Color of the frame title text
%---------------------------------------------------------------
\begin{document}
\section{Introduction}
\section{Positive linear relations}
\section{Lattice linear relations}
\section{Domination by a positive compact relation.}
\subsection{Linear relation}
\subsection{Riesz spaces}
\begin{frame}{Linear relations}
\end{frame}
\end{document}
我想将标题框的颜色更改为 ,例如 ,
grey
并将blue
部分颜色更改为 ,blue
而不是black
。
答案1
要将页眉中章节标题的背景颜色从黑色更改为蓝色,请添加\setbeamercolor*{section in head/foot}{bg=myblue, fg=white}
和要将框架标题的背景颜色从蓝色更改为灰色,请\colorlet{titleleft}{myblue} \colorlet{titleright}{myblue}
替换\colorlet{titleleft}{gray} \colorlet{titleright}{gray}
。
正如 A Diyanat 已经解释的那样他们的答案,bg
改变了背景颜色,fg
改变了字体颜色。
根据评论中的要求,这里是完整的 MWE,其中包含一些希望有用的解释性注释:
\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=blue]{structure}
%------------------------\AtBeginSubsection[]----------------------
\AtBeginSubsection[]{
\begin{frame}<beamer>[noframenumbering,plain]{Outline}
\transsplitverticalout
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
\usetheme{Madrid}
\useoutertheme{shadow}
%-----------------custom frame title background--------------------
\makeatletter
\pgfdeclarehorizontalshading[titleleft,titleright]
{beamer@frametitleshade}
{\paperheight}{%
color(0pt)=(titleleft);
color(\paperwidth)=(titleright)}
\makeatother
%-----------------------------footline-----------------------------
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
% \hspace*{3em}
% \insertframenumber{} / \inserttotalframenumber\hspace*{1ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.25ex,dp=1ex,center]{page number in head/foot}%
% \usebeamerfont{title in head/foot}\insertshorttitle\hspace*{3em}
\insertframenumber{} / \inserttotalframenumber
\end{beamercolorbox}%
}%
\vskip0pt%
}
%%%%% Custom color definitions used in the head and foot line of the frames %%%%%
\colorlet{myblue}{blue!30!black} %<----- define the new color myblue
\colorlet{myyellow}{yellow!30!white} %<----- define the new color myyellow
\setbeamercolor{author in head/foot}{bg=myblue} %<----- background color of author in footline
\setbeamercolor{title in head/foot}{bg=myyellow,fg=myblue} %<----- background color and font color for presentation title in footline
\setbeamercolor{page number in head/foot}{bg=myblue,fg=white} %<----- background and font color fot page numbers in the footline
\setbeamercolor*{section in head/foot}{bg=myblue, fg=white} %<----- background and font color for the sections in the header
\setbeamercolor*{subsection in head/foot}{bg=myyellow,fg=myblue} %<----- background and font color for the subsections in the header
\colorlet{titleleft}{gray} %<----- left half of frame title background color
\colorlet{titleright}{gray} %<----- right half of frame title background color
\setbeamercolor*{frametitle}{fg=white} %<---- Color of the frame title text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Title and Author Information %%%%%
\title[The essential numerical range and the Olsen problem]{The
essential numerical range and the Olsen problem}
\author[{Student} (University of ....)]{Student}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{Introduction}
\section{Positive linear relations}
\section{Lattice linear relations}
\section{Domination by a positive compact relation.}
\subsection{Linear relation}
\subsection{Riesz spaces}
\begin{frame}{Linear relations}
\end{frame}
\end{document}
答案2
要更改投影仪框架的前景色和背景色,可以使用以下几行:
\colorlet{titleleft}{gray!80} %<----- left half of frame title background color
\colorlet{titleright}{gray!60} %<----- right half of frame title background color
\setbeamercolor*{frametitle}{fg=white} %<---- Color of the frame title text
对于更改左框架标题,我们有:
\setbeamercolor{palette quaternary}{bg=Blue,fg=red}
值得注意的是,“fg”和“bg”分别表示前景色和背景色。总之,请考虑以下示例:
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Madrid}
\useoutertheme{shadow}
\makeatletter
\pgfdeclarehorizontalshading[titleleft,titleright]
{beamer@frametitleshade}
{\paperheight}{%
color(0pt)=(titleleft);
color(\paperwidth)=(titleright)}
\makeatother
\colorlet{titleleft}{gray!80}
\colorlet{titleright}{gray!60}
\setbeamercolor*{frametitle}{fg=white}
\setbeamercolor{palette quaternary}{bg=Blue,fg=white}
\begin{document}
\section{Introduction}
\section{Positive linear relations}
\begin{frame}{Linear relations}
Example.
\end{frame}
\end{document}