我使用 madrid 和 beaver 主题编写 latex 演示文稿。我想将演示文稿标题、研究所背景框、页脚标题字体颜色、页码和日期的颜色更改为 HTML 颜色代码#00a1e5
。下图标记了更改。。此处动机是框架标题。
将颜色主题更改为甲虫或其他任何颜色主题都不是我想要的,因为我希望标题、框架标题、日期、页脚标题后面的灰色背景保持相同的灰色。这是基本的工作代码。谢谢!
\documentclass{beamer}
\usetheme{Madrid}
\usecolortheme{beaver}
\makeatother
\usepackage{tikz}
\title{The title}
\author[The author]{\includegraphics[height=1cm,width=2cm]{hehe}\\The Author}
\institute[Inst.]{The Institute}
\date{\today}
\usepackage[timeinterval=60]{tdclock}
\begin{document}
\begin{frame}
\initclock
\maketitle
\end{frame}
\date{\tdhours : \tdminutes \ \ --- \cronominutes \ ' from start}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,yshift=2pt] at (current page.north east){\includegraphics[height=0.8cm]{hehe}};
\end{tikzpicture}}
\begin{frame}{Motivation}
Now the logo is visible
\end{frame}
\begin{frame}{Motivation}
\framesubtitle{A}
Now the logo is visible
\end{frame}
\end{document}
答案1
主题的颜色beaver
在 中设置beamercolorthemebeaver.sty
,并且主要基于\definecolor{darkred}{rgb}{0.8,0,0}
。您可以用 替换所有出现的darkred
,例如 ,myblue
并定义myblue
为\definecolor{myblue}{HTML}{00a1e5}
以获得所需的结果。
最好将颜色定义放在名为 的单独文件中beamercolorthememyblue.sty
,并用 替换\usecolortheme{beaver}
。\usecolortheme{myblue}
我基本上在以下代码中使用 完成了此操作filecontents
。我还haha
用示例图像替换了您的文件,以便可以对其进行编译。
\documentclass{beamer}
\usetheme{Madrid}
\begin{filecontents}{beamercolorthememyblue.sty}
\mode<presentation>
\definecolor{myblue}{HTML}{00a1e5}
\setbeamercolor{section in toc}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=myblue!80!gray}
\setbeamercolor*{palette primary}{fg=myblue!60!black,bg=gray!30!white}
\setbeamercolor*{palette secondary}{fg=myblue!70!black,bg=gray!15!white}
\setbeamercolor*{palette tertiary}{bg=myblue!80!black,fg=gray!10!white}
\setbeamercolor*{palette quaternary}{fg=myblue,bg=gray!5!white}
\setbeamercolor*{sidebar}{fg=myblue,bg=gray!15!white}
\setbeamercolor*{palette sidebar primary}{fg=myblue!10!black}
\setbeamercolor*{palette sidebar secondary}{fg=white}
\setbeamercolor*{palette sidebar tertiary}{fg=myblue!50!black}
\setbeamercolor*{palette sidebar quaternary}{fg=gray!10!white}
%\setbeamercolor*{titlelike}{parent=palette primary}
\setbeamercolor{titlelike}{parent=palette primary,fg=myblue}
\setbeamercolor{frametitle}{bg=gray!10!white}
\setbeamercolor{frametitle right}{bg=gray!60!white}
\setbeamercolor*{separation line}{}
\setbeamercolor*{fine separation line}{}
\mode
<all>
\end{filecontents}
\usecolortheme{myblue}
\usepackage{tikz}
\title{The title}
\author[The author]{\includegraphics[height=1cm,width=2cm]{example-image}\\The Author}
\institute[Inst.]{The Institute}
\date{\today}
\usepackage[timeinterval=60]{tdclock}
\begin{document}
\begin{frame}
\initclock
\maketitle
\end{frame}
\date{\tdhours : \tdminutes \ \ --- \cronominutes \ ' from start}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north east,yshift=2pt] at (current page.north east){\includegraphics[height=0.8cm]{example-image}};
\end{tikzpicture}}
\begin{frame}{Motivation}
Now the logo is visible
\end{frame}
\begin{frame}{Motivation}
\framesubtitle{A}
Now the logo is visible
\end{frame}
\end{document}