Beamer fragile frames

September 22nd, 2008

If you want to include verbatim text, say for some program code, in a frame in beamer, you have to pass the fragile option to the frame, like so:

\begin{frame}[fragile]
\frametitle{a fragile frame}
\begin{verbatim}
some verbatim text here
\end{verbatim}
\end{frame}

Though latex usually doesn’t really care about whitespace at the beginning of a line, in this case it does. If you don’t have your begin and end frame statements at the beginning of a line when you are trying to use the fragile option, your document will not compile. It’s frustrating.

p.s. also note that you can’t use verbatim text with overlays in beamer.

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

One Response to “Beamer fragile frames”

  1. On November 8th, 2008 at 6:47 pm
    Christoph Bartoschek wrote:

    You should note that there is the semiverbatim environment which allows overlays.

Leave a Reply

You can use some basic tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>