[texhax] verbatim in beamer?

Lim Lian Tze liantze at gmail.com
Wed Mar 24 03:50:29 CET 2010


>
> It seems I can not use verbatim environment in beamer presentations.
> Is it true? I always get errors.
>

Use the "fragile" option for slides that contain verbatims:

\begin{frame}[fragile]
\frametitle{This slides contains verbatim text}
\begin{verbatim}
_iNum = 0;
\end{verbatim}
\end{frame}


> On the other hand, how do you guys show source code (c, c++, bash,
> etc)  with beamer? Is there any suggestion to try?
>

My personal preference is the listings package, but there are lots of other
alternatives. Don't forget you'll need the "fragile" option too if a slide
contains the lstlisting environment (from the listings package).


Best regards,
- Lian Tze -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20100324/425400e4/attachment.html>


More information about the texhax mailing list