Use package option to \protect frame titles

Using \protect disables the MakeLowercase command which looks weird with titles
set in small caps. For all those who want to use \cite, \ref and co. can now use
the `protectframetitles` package option.
This commit is contained in:
Matthias Vogelgesang 2015-01-20 08:38:36 +01:00
parent 30a8dcd9ad
commit 181a0d6452
2 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,10 @@ progress bar underneath *each* frame title
![Progressbar](http://i.imgur.com/4BXHU4K.png)
In order to use `\cite`, `\ref` and similar commands in a frame title you have
to protect the title. This can be done automatically with the
`protectframetitle` option.
#### Commands

View File

@ -29,6 +29,10 @@
\@useTitleProgressBarfalse
\DeclareOption{titleprogressbar}{\@useTitleProgressBartrue}
\newif\if@protectFrameTitle
\@protectFrameTitlefalse
\DeclareOption{protectframetitle}{\@protectFrameTitletrue}
\ProcessOptions\relax
%}}}
@ -206,7 +210,11 @@
\setbeamertemplate{frametitle}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=2.5ex,dp=1.5ex]{frametitle}
\if@protectFrameTitle
\usebeamerfont{frametitle}\MakeLowercase{\protect\insertframetitle}%
\else
\usebeamerfont{frametitle}\MakeLowercase{\insertframetitle}%
\fi
\end{beamercolorbox}%
\if@useTitleProgressBar
\vspace{-.6em}