From 181a0d645271f359a4334cec63a98badc582993f Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 20 Jan 2015 08:38:36 +0100 Subject: [PATCH] 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. --- README.md | 4 ++++ beamerthemem.sty | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 54144ab..30d5c99 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/beamerthemem.sty b/beamerthemem.sty index af134a7..f3a8aa6 100644 --- a/beamerthemem.sty +++ b/beamerthemem.sty @@ -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}