框架标题采用新颜色

框架标题采用新颜色

我想使用马德里主题,我想在框架标题中实现水平阴影效果,颜色如下图所示

在此处输入图片描述

我尝试使用以下两个答案(a1a2):

\documentclass[xcolor=dvipsnames]{beamer}
\usecolortheme[named=blue]{structure}

%------------------------\AtBeginSubsection[]----------------------
\AtBeginSubsection[]{   
    \begin{frame}<beamer>[noframenumbering,plain]{Outline}
        \transsplitverticalout
        \tableofcontents[currentsection,currentsubsection]
    \end{frame}
}

\usetheme{Madrid}

%-----------------------------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%
}

\setbeamercolor{author in head/foot}{bg=black}
\setbeamercolor{title in head/foot}{bg=blue}
\setbeamercolor{page number in head/foot}{bg=black}

\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}{red!70!black}
     \colorlet{titleright}{white}

     \setbeamercolor*{frametitle}{fg=white}

   \makeatletter
   \pgfdeclarehorizontalshading[titleleft,titleright] 
    {beamer@frametitleshade} 
    {\paperheight}{%
     color(0pt)=(titleleft);
   color(\paperwidth)=(titleright)}
  \makeatother
\begin{document}

\begin{frame}{linear relation}

\end{frame}

\end{document}

在此处输入图片描述

然而,我注意到我失去了我以前的底部

在此处输入图片描述

答案1

您只需要注意组合修改的顺序。您的自定义脚注定义应在加载其他主题之后。

 \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}{yellow!30!white}
     \colorlet{titleright}{blue!30!black}

     \setbeamercolor*{frametitle}{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%
}  

\begin{document}

\begin{frame}{linear relation}

\end{frame}

\end{document}

在此处输入图片描述

相关内容