在 Beamer 演示文稿的一页上,我想删除标题。我希望保留背景,但删除部分和子部分的名称。如何做到这一点?
\setbeamertemplate{headline}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{top}
\vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{bottom}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
} \mode <all>
答案1
如果要抑制完整的标题,您可以本地重新定义模板headline
为空:
\documentclass{beamer}
\usetheme{CambridgeUS}
\begin{document}
\begin{frame}
test frame
\end{frame}
\begingroup
\setbeamertemplate{headline}{}
\begin{frame}
test frame with empty headline
\end{frame}
\endgroup
\begin{frame}
test frame
\end{frame}
\end{document}
如果您只想隐藏部分和子部分的导航信息,则需要做更多工作;您需要重新定义headline
所用外部主题中定义的模板。例如,使用给定的headline
模板可以定义一个命令,例如\nosecinhead
,隐藏某些框架标题中的导航栏;要使用此命令,您只需说
\begingroup
\nosecinhead
正确的前 \begin{frame}
, 进而
\endgroup
正确的后 \end{frame}
,如下例所示(我假设top
和bottom
颜色已经在某处定义;我提供了一些特别指定仅作为示例):
\documentclass[svgnames,x11names]{beamer}
\setbeamercolor{top}{fg=white,bg=red}
\setbeamercolor{bottom}{fg=white,bg=blue}
\setbeamercolor{lower separation line head}{bg=LightSteelBlue3}
\newcommand\nosecinhead{%
\setbeamertemplate{headline}
{%
\begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{top}
\vskip2pt\mbox{}
\end{beamercolorbox}%
\begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{bottom}
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}%
}
\begin{document}
\section{test}
\begin{frame}
test frame
\end{frame}
\begingroup
\nosecinhead
\begin{frame}
test frame with modified headline
\end{frame}
\endgroup
\begin{frame}
test frame
\end{frame}
\end{document}
答案2
\documentclass{beamer}
\title{How to use Beamer}
\subtitle{from novice to professional}
\author{Aggresive User}
\date{\today}
\institute{\TeX\ User Group}
\usetheme{AnnArbor}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Table of Contents}
\tableofcontents
\end{frame}
\bgroup
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{example-grid-100x100pt.pdf}}
\begin{frame}[plain]
What is your next question \scalebox{10}{\bf ?}
\end{frame}
\egroup
\end{document}