4

I am getting errors when compiling a LaTeX document with the beamer (v3.13) class when using bold shape in a title section:

\documentclass{beamer}

\begin{document}

\section{The \textbf{Section} Title}

\begin{frame}{Testing frame}
  This is a test.
\end{frame}

\end{document}

Compilation with pdflatex gives the error:

! Argument of \@gobble has an extra }.
<inserted text> 
                \par 
l.5     \section{The \textbf{Section} Title}

The error happens when using other font variations like slanted and italic.

Also the command \emph used in a section title gives an error:

! Undefined control sequence.
\beamer@sort #1#2->\long \def \beamer@todo 
                                           {#1}\def \beamer@ospec {}\beamer@...
l.5     \section{The \emph{Section} Title}

Are these known bugs or am I missing something? Is there any fix for them?

7

You will need to \protect these commands in sections

\documentclass{beamer}

\begin{document}

\section{The \protect\textbf{Section} Title}

\begin{frame}{Testing frame}
  This is a test.
\end{frame}

\end{document}

This is an underlying problem with some design decisions made when beamer was developed. Commands with overlay abilities are regrettable not set up to be 'robust', and it is not clear how this can be remedied without breaking existing beamer behaviour.

7

Note that beamer does a large amount of leg-work in making commands overlay aware. One drawback of this is some standard commands become fragile. You could use the \bfseries font switch (which is \protected by default) alternative:

\documentclass{beamer}% http://ctan.org/pkg/beamer

\begin{document}

\section{The {\bfseries Section} Title}

\begin{frame}{Testing frame}
  This is a test.
\end{frame}

\end{document}​
  • But it does not work for me when I sue \frametitle{\protect\textit{in vacuo}} – user2300369 Nov 21 '15 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.