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}