我正在寻找一些命令,以便将标题的 beamercolor 设置为灰色。我不想要标题。但如果我省略它,即使我使用\setbeamercolor{header}
...背景也会保持白色。
我认为我们必须做出改变\newenvironment{withoutheadline}...
但我不知道该怎么做。
这是我的代码:
\documentclass[serif,xcolor=dvipsnames, hyperref={pdfpagelabels=false}]{beamer}
\usetheme{Warsaw}
%\input{example_media/Warsaw_Headline}
\usecolortheme{whale}
%\makeatletter
%\newenvironment{withoutheadline}{
%\setbeamertemplate{headline}[default]
%\def\beamer@entrycode{\vspace*{-\headheight}}
%}{}
%\makeatother
\begin{document}
\section{ddd}
\subsection{jjjj}
\subsection{sjsj}
\frame{hi}
%\begin{withoutheadline}
{
\setbeamercolor{background canvas}{bg=darkgray}
\setbeamertemplate{headline}{\color{black}}
\begin{frame}
\Large \color[rgb]{1,1,1}Thank you for your attention!
\end{frame}
}
%\end{withoutheadline}
\end{document}
答案1
抱歉,但我不明白你的问题。你实际上已经解决了。你没有带标题的主题,如果你使用带标题的主题,就像下面的代码一样,你会看到你的环境可以正常工作!
\documentclass[serif,xcolor=dvipsnames, hyperref={pdfpagelabels=false}]{beamer}
\makeatletter
\newenvironment{withoutheadline}{
\setbeamertemplate{headline}[default]
\def\beamer@entrycode{\vspace*{-\headheight}}
}{}
\makeatother
\usetheme{CambridgeUS}
\begin{document}
\begin{withoutheadline}
\setbeamercolor{background canvas}{bg=darkgray}
\begin{frame}{\color[rgb]{0.5,0.5,0.5}Frame Title without Headline}
\Large \color[rgb]{1,1,1}Thank you for your attention!
\end{frame}
\end{withoutheadline}
\setbeamercolor{background canvas}{bg=darkgray}
\begin{frame}{\color[rgb]{0.5,0.5,0.5}Frame Title with Headline}
\Large \color[rgb]{1,1,1}Thank you for your attention!
\end{frame}
\end{document}