Beamer fragile frames

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.

Join 164 other subscribers

Archives

  • 2024 (5)
  • 2023 (8)
  • 2022 (15)
  • 2021 (19)
  • 2020 (1)
  • 2019 (1)
  • 2018 (2)
  • 2017 (1)
  • 2016 (2)
  • 2015 (5)
  • 2014 (5)
  • 2013 (2)
  • 2011 (7)
  • 2010 (10)
  • 2009 (50)
  • 2008 (28)
  • 2007 (31)
  • 2006 (8)

Category