我正在使用此处显示的自定义标题页SE帖子:
\documentclass{beamer}
\defbeamertemplate*{title page}{customized}[1][]
{
\usebeamerfont{title}\inserttitle\par
\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par
\bigskip
\usebeamerfont{author}\insertauthor\par
\usebeamerfont{institute}\insertinstitute\par
\usebeamerfont{date}\insertdate\par
\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic
}
\title{A customized title page}
\subtitle{for demonstration}
\author{Stefan Kottwitz}
\date{\today}
\begin{document}
\maketitle
\end{document}
但我不知道如何改变标题的颜色
在我的 .sty 文件中,我尝试添加
\setbeamercolor{title}{bg=red,fg=white
}
但没有效果
有任何想法吗?
答案1
如果希望标题采用模板的fg
和颜色,则必须更改模板,添加,如下所示:bg
title
title page
beamercolorbox
\begin{beamercolorbox}[wd=0.9\textwidth,sep=1em]{title}\usebeamerfont{title}\inserttitle\end{beamercolorbox}
然后,您可以按照示例应用颜色:
\documentclass{beamer}
\defbeamertemplate*{title page}{customized}[1][]
{
\begin{beamercolorbox}[wd=0.9\textwidth,sep=1em]{title}\usebeamerfont{title}\inserttitle\end{beamercolorbox}
\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par
\bigskip
\usebeamerfont{author}\insertauthor\par
\usebeamerfont{institute}\insertinstitute\par
\usebeamerfont{date}\insertdate\par
\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic
}
\setbeamercolor{title}{bg=red,fg=white}
\setbeamercolor{subtitle}{fg=blue}
\title{A customized title page}
\subtitle{for demonstration}
\author{Stefan Kottwitz}
\date{\today}
\begin{document}
\maketitle
\end{document}
请注意,您需要subtitle
适当设置颜色,否则它将是白色的。