我想根据主题更改投影仪演示文稿标题页中橙色水平线的颜色metropolis
。
\documentclass{beamer}
\usetheme{metropolis}
\title{How to change the color of the orange line?}
\date{May, 2022}
\author{Author}
\institute{University}
\begin{document}
\maketitle % Why this warning? Overfull \vbox (15.63992pt too high) detected at line 11
\end{document}
我试过了,但是没用
\definecolor{mygreen}{RGB}{33, 117, 0}
\setbeamertemplate{title separator}{fg=mygreen, bg=mygreen}
我也尝试了官方文档,第 21 页,但它也不起作用。
\usepackage{tikz}
\newlength{\metropolis@titleseparator@linewidth}
\setlength{\metropolis@titleseparator@linewidth}{0.4pt}
\setbeamertemplate{title separator}{
\begin{tikzpicture}
\fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
\end{tikzpicture}%
\par%
}
我是不是忽略了什么,或者这是一项比想象中更困难的任务?我以为有一个简单的单行命令,但也许我太乐观了。
ps 我注意到编译器在行处给出了警告\maketitle
,这是正常的吗?
Overfull \vbox (15.63992pt too high) detected at line 11
更新
第二段代码稍加修改即可(即我必须添加\makeatletter
并\fill[fg]
替换\fill[mygreen]
)
\definecolor{mygreen}{RGB}{33, 117, 0}
\usepackage{tikz}
\makeatletter
\setlength{\metropolis@titleseparator@linewidth}{1pt}
\setbeamertemplate{title separator}{
\begin{tikzpicture}
\fill[mygreen] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
\end{tikzpicture}%
\par%
}
答案1
使用\setbeamercolor
代替的\setbeamertemplate
方式:
\documentclass{beamer}
\usetheme{metropolis}
\title{How to change the color of the orange line?}
\date{May, 2022}
\author{Author}
\institute{University}
\definecolor{mygreen}{RGB}{33, 117, 0}
\setbeamercolor{title separator}{fg=mygreen, bg=mygreen}
\begin{document}
\maketitle % Why this warning? Overfull \vbox (15.63992pt too high) detected at line 11
\end{document}
这个警告肯定也与这个静默错误有关,因为在做出这个改变之后警告就消失了。