# errors with MakeUppercase and Beamer's insertsectionhead

I'm trying to use \MakeUppercase on \insertsectionhead of the beamer class:

\documentclass[]{beamer}
\begin{document}
\section{Section 1}
\begin{frame}{Frame 1}
\end{frame}
\end{document}


Unfortunately this example produces an endless series of errors. Any ideas?

• Try substituting {\MakeUppercase\protect\insertsectionhead} for \MakeUppercase{\insertsectionhead}. – jub0bs May 5 '13 at 7:26
• Thank you for your answer. This eliminates the errors, but the sectiontext is still not uppercase. – Benjamin May 5 '13 at 8:07

You have to expand \insertsectionhead before applying \MakeUppercase:

\documentclass[]{beamer}

\begin{document}
\section{Section 1}

\begin{frame}{Frame 1}

\end{frame}
\end{document}


In your case \insertsectionhead expands to

\hyperlink{Navigation\the\c@page}{Section 1}


so we add before it \insertsectionHEADaux that gets \hyperlink as argument #1, Navigation\the\c@page as #2 and Section 1 as #3, and eventually

\hyperlink{Navigation \the\c@page}{\MakeUppercase{Section 1}}


is executed. In this way the link name is not uppercased.

A different solution is patching the commands responsible for defining \insertsectionhead; this might be better, because it doesn't require different commands in the document.

\documentclass[]{beamer}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\sectionentry}
{}{}
\patchcmd{\beamer@section}
{}{}
\makeatother

\begin{document}

\section{Section 1}

\begin{frame}{Frame 1}

\end{frame}
\end{document}

• Thanks a lot for the solution and the detailed explanation. – Benjamin May 5 '13 at 10:42
• @Benjamin You're welcome. I added a different solution. – egreg May 5 '13 at 11:04
• Do you know why your first solution won't work with \insertframetitle? IOW, replace line 4 with \expandafter\insertsectionHEADaux\insertframetitle} and you get many errors. I tried a few combinations of \protect and [fragile], but no luck. TIA! – Leo Dec 9 '13 at 20:40
• @Leo That probably warrants a different question – egreg Dec 9 '13 at 20:50
• Thanks @egreg. Here it is: tex.stackexchange.com/questions/149231 – Leo Dec 9 '13 at 21:19
\documentclass[]{beamer}
\begin{document}
\section{Section 1}
\begin{frame}{Frame 1}

Just a little expansion control. Please note that this does tweak the appearance of the current \insertsection, the stored string it self is still lowercase. And it may break the pdf links.