Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
add comment

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}​
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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