4

I am trying to get the frame title to always be displayed uppercase. I found errors with MakeUppercase and Beamer's insertsectionhead helpful, but the same command that worked with \insertsectionhead did not work with \insertframetitle. IOW, this works (from the linked question):

\documentclass[]{beamer}

\newcommand{\insertsectionHEAD}{%
\expandafter\insertsectionHEADaux%
    %\insertframetitle}
    \insertsectionhead}
\newcommand{\insertsectionHEADaux}[3]{#1{#2}{\MakeUppercase{#3}}}

\begin{document}
\section{Section 1}

\begin{frame}{Frame 1}

\insertsectionHEAD

\end{frame}
\end{document}

but exchanging the comment between lines 5 and 6 above causes compilation to fail.

I was able to get this second version to work:

\documentclass[]{beamer}

\setbeamertemplate{frametitle}{
      \expandafter\MakeUppercase\expandafter\insertframetitle
}

\begin{document}
\section{Section 1}

\begin{frame}%[allowframebreaks]
{Frame 1}

\tableofcontents

\end{frame}
\end{document}

but if you uncomment the [allowframebreaks] in the frame declaration you also get errors. The \tableofcontents also causes problems in some more complex code I have, but I was unable to reproduce the error in these MWEs.

2
  • 1
    The last one works if you substitute \MakeUppercase with \uppercase Commented Dec 9, 2013 at 21:27
  • @karlkoeller I can verify that, including in my more complex case. Thanks. Do you know why?
    – Leo
    Commented Dec 9, 2013 at 21:33

1 Answer 1

4

The problem is that allowframebreaks adds to Frame 1 in \insertframetitle also \usebeamertemplate that's not legal in \MakeUppercase.

My opinion is that if you want an uppercase title you should simply type it uppercase. However, this might work.

\documentclass[]{beamer}
\usepackage{textcase,regexpatch}

\setbeamertemplate{frametitle}{
  \makeatletter
  \regexpatchcmd{\insertframetitle}
    {(\c{usebeamertemplate}.*)\c{fi}}
    {\c{NoCaseChange}\cB\{\1\cE\}\c{fi}}
    {}{}%
  \makeatother
  \MakeTextUppercase{\insertframetitle}
}

\begin{document}
\section{Section 1}

\begin{frame}[allowframebreaks]
{Frame 1}

\tableofcontents

\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .