![更改 latex beamer 的页码颜色](https://linux22.com/image/268700/%E6%9B%B4%E6%94%B9%20latex%20beamer%20%E7%9A%84%E9%A1%B5%E7%A0%81%E9%A2%9C%E8%89%B2.png)
我需要在 latex beamer 中将页码颜色改为黑色。我需要在以下代码中添加什么?
\defbeamertemplate{headline}{page number}{%
\vskip1pt%
\setbeamertemplate{footline}[page number]%
\usebeamertemplate{footline}%
}
\setbeamertemplate{headline}[page number]
答案1
page number
模板选项footline
位于beamerbaseauxtemplates.sty
:
\defbeamertemplate{footline}{page number}
{%
\hfill%
\usebeamercolor[fg]{page number in head/foot}%
\usebeamerfont{page number in head/foot}%
\insertpagenumber\,/\,\insertpresentationendpage\kern1em\vskip2pt%
}
因此,在设置 footline beamer 时,它将使用字体和颜色page number in head/foot
。您可以根据需要配置颜色,如下所示:
\documentclass{beamer}
\usepackage{lipsum}
\defbeamertemplate{headline}{page number}{%
\vskip1pt%
\setbeamertemplate{footline}[page number]%
\usebeamertemplate{footline}%
}
\setbeamertemplate{headline}[page number]
\setbeamercolor{page number in head/foot}{fg=green}
\setbeamerfont{page number in head/foot}{size=\large}
\begin{document}
\begin{frame}{Lorem ipsum}
\lipsum[1]
\end{frame}
\begin{frame}{Dolor sit amet}
\lipsum[2]
\end{frame}
\end{document}
要了解有关这些配置的更多信息,请阅读 beamer 手册的第 1.4、17 和 18 节。