如何更改 Beamer 模板的颜色?

如何更改 Beamer 模板的颜色?

好的。我正在尝试更改我的 beamer 模板的颜色。我正在使用 Copenhagen 和 wolverine。

以下是幻灯片的样子以及我正在使用的代码。

在此处输入图片描述

\documentclass[t,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Copenhagen}
\usecolortheme{wolverine}
\beamertemplatenavigationsymbolsempty   % Removes the interactive buttons
\setbeamertemplate{headline}{}  % Removes the header sections

% ADDS SLIDE NUMBERS
%\newcommand*\oldmacro{}%
%\let\oldmacro\insertshorttitle%
%\renewcommand*\insertshorttitle{%
%   \oldmacro\hfill%
%   \insertframenumber\,/\,\inserttotalframenumber}

% Additional packages needed
\usepackage{amsmath} % For ???
\usepackage{dsfont}  % For mathds font
\usepackage{hologo}  % For BibTeX font
\usepackage{lmodern} % For ???

%Information to be included in the title page:
 \title{Central Bank Watching}

 \author{NAME}

 \institute[University]
 {
   University \newline \newline March 2019
 }

\date[\today]{}

\titlegraphic{\flushleft \includegraphics[scale=0.25]{UNI.png}}

% The below defines the footer such that it is:
% First Last (Institution) || Title           frame / frame total
\setbeamertemplate{footline}{%
  \leavevmode%
  \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor~(\insertshortinstitute)
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber
  \end{beamercolorbox}}%
  \vskip0pt%
}

% The below is used for creating section pages
\makeatletter
\setbeamertemplate{section page}
{
    \begin{centering}
    \begin{beamercolorbox}[sep=12pt,center,colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]{part title}
    \usebeamerfont{section title}\insertsection\par
    \end{beamercolorbox}
    \end{centering}
}
% \setbeamertemplate{section page}[default][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\setbeamertemplate{subsection page}[default][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother

\AtBeginSection[]{
    \begin{frame}[plain,c]
        \sectionpage
    \end{frame}
}

\begin{document}

\frame{\titlepage}

...

\end{document}

我想将黄色更改为以下 RGB:69、91、196

将橙色设置为以下 RGB:168、178、85

我怎样才能做到这一点?

谢谢!

答案1

添加

\definecolor{aa}{RGB}{69, 91, 196}
\definecolor{bb}{RGB}{168, 178, 85}
\setbeamercolor*{palette primary}{bg=aa}
\setbeamercolor*{palette quaternary}{bg=bb}

成功了。

或者,您可以像这样手动更改单个颜色:

\setbeamercolor{title}{bg=aa}

但如果您不知道特定模板如何设置,则需要进行更多的反复试验。

在此处输入图片描述

\documentclass[t,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Copenhagen}
\usecolortheme{wolverine}
\beamertemplatenavigationsymbolsempty   % Removes the interactive buttons
\setbeamertemplate{headline}{}  % Removes the header sections

\definecolor{aa}{RGB}{69, 91, 196}
\definecolor{bb}{RGB}{168, 178, 85}
\setbeamercolor*{palette primary}{bg=aa}
\setbeamercolor*{palette quaternary}{bg=bb}



% ADDS SLIDE NUMBERS
%\newcommand*\oldmacro{}%
%\let\oldmacro\insertshorttitle%
%\renewcommand*\insertshorttitle{%
%   \oldmacro\hfill%
%   \insertframenumber\,/\,\inserttotalframenumber}

% Additional packages needed
\usepackage{amsmath} % For ???
\usepackage{dsfont}  % For mathds font
\usepackage{hologo}  % For BibTeX font
\usepackage{lmodern} % For ???

%Information to be included in the title page:
 \title{Central Bank Watching}

 \author{NAME}

 \institute[University]
 {
     University \newline \newline March 2019
 }

\date[\today]{}

\titlegraphic{\flushleft \includegraphics[scale=0.25]{UNI.png}}

% The below defines the footer such that it is:
% First Last (Institution) || Title           frame / frame total
\setbeamertemplate{footline}{%
    \leavevmode%
    \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm plus1fill,rightskip=.3cm]{author in head/foot}%
        \usebeamerfont{author in head/foot}\insertshortauthor~(\insertshortinstitute)
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
        \usebeamerfont{title in head/foot}\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber
    \end{beamercolorbox}}%
    \vskip0pt%
}

% The below is used for creating section pages
\makeatletter
\setbeamertemplate{section page}
{
        \begin{centering}
        \begin{beamercolorbox}[sep=12pt,center,colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]{part title}
        \usebeamerfont{section title}\insertsection\par
        \end{beamercolorbox}
        \end{centering}
}
% \setbeamertemplate{section page}[default][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\setbeamertemplate{subsection page}[default][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother

\AtBeginSection[]{
        \begin{frame}[plain,c]
                \sectionpage
        \end{frame}
}

\begin{document}

\frame{\titlepage}

...

\end{document}

相关内容