5

I'm getting "Missing } inserted" error, when compiling with pdflatex and I really don't understand why. This is occurring in a beamer frame. Maybe someone comes up with something useful.

\documentclass{beamer}
...
\usepackage[utf8x]{inputenc}
\usepackage{default}
\usepackage{times}
\usepackage{graphics}
...
\begin{frame}\frametitle{3\textonehalf. Generace}

    \begin{block}{3\textonehalf. Generace}
        \begin{itemize}
            \item OOP
        \end{itemize}
    \end{block}

    \begin{exampleblock}{Jazyky 3\textonehalf. generace}
        \begin{itemize}
            \item první Smalltalk
            \item C{}\verb!++!, Objective-C, Object Pascal, Java
            \item statické / dynamické
        \end{itemize}
    \end{exampleblock}

\end{frame}
...

I get the error on the last line.

  • 2
    Use \begin{frame}[fragile] when the frame contains verbatim bits. – egreg May 13 '13 at 22:32
  • that's it, thanx :-) – Michal Artazov May 13 '13 at 22:37
  • 3
    Although there is no need to use verb there ++ or if you want, \texttt{++} would work – David Carlisle May 13 '13 at 22:40
  • 1
    @Werner -- the first example in section 3.13, "verbatim text" of the beamer manual starts with \begin{frame}[fragile]. i didn't know about this either, so think an answer might be helpful here. reopen? (might benefit from restating the question a bit.) – barbara beeton May 14 '13 at 13:06
  • 1
    @barbarabeeton: I've voted... – Werner May 14 '13 at 14:30
8

the problem, as pointed out by egreg, is that you need to specify

\begin{frame}[fragile]

when including verbatim material in the frame.

this is documented in the beamer manual (texdoc beamer) in section 3.1.3, "verbatim text". (it almost never hurts to check the manual, and the beamer manual is a good one.)

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.