headline
在我见过的大多数示例中,横跨顶部宽度或侧面高度的投影仪会显示部分/子部分/子子部分标签。我是否可以生成一个标题/大标题,该标题/大标题是幻灯片大小或长度的指定部分/百分比,具体取决于它是否沿特定边缘放置?
我考虑将标题放置为沿顶部的缩短的矩形,并在其旁边放置另一个“矩形”以显示带有徽标的框架标题。
\setbeamertemplate{frametitle}
{\vskip 0.25pt
\leavevmode
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.8ex,dp=1ex]{frametitle}%
\insertsection\insertsubsection\\
\raggedright\hspace*{5em}\Large\insertframetitle
\end{beamercolorbox}
}%
\vspace{-25pt}
\hfill
\includegraphics[width=1cm]{UCFLOGO}
\hspace*{0.0cm}
\vskip0pt
%{\color{ucfBlack}\rule{\textwidth}{0.4mm}}
}
%footer
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle\hspace*{3em}
\insertframenumber{} / \inserttotalframenumber\hspace*{1ex}
\end{beamercolorbox}}%
\vskip0pt%
}
答案1
取决于主题,但在大多数标准主题中这应该是可能的。
由于您没有为标题提供任何代码,我将miniframe
在下文中使用外部主题的标题:
\defbeamertemplate*{headline}{miniframes theme}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
要调整宽度,你必须做两件事
- 指定
beamercolorbox
es宽度wd={⟨width⟩}
- 通过修改来调整导航元素的宽度
\insertnavigation{\paperwidth}
因此,对于横跨半页的标题:
\documentclass{beamer}
\usecolortheme{whale}
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt, wd=.5\paperwidth]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.5\paperwidth]{section in head/foot}
\vskip2pt\insertnavigation{.5\paperwidth}\vskip2pt
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt, wd=.5\paperwidth]{lower separation line head}
\end{beamercolorbox}
}
\begin{document}
\section{1}\begin{frame}\end{frame}
\section{2}\begin{frame}\end{frame}
\section{3}\begin{frame}\end{frame}
\section{4}\begin{frame}\end{frame}
\section{5}\begin{frame}\end{frame}
\section{6}\begin{frame}\end{frame}
\section{7}\begin{frame}\end{frame}
\section{8}\begin{frame}\end{frame}
\section{9}\begin{frame}\end{frame}
\section{10}\begin{frame}\end{frame}
\end{document}
(加载颜色主题只是为了让事物更加清晰可见)