tags:

views:

318

answers:

2

Hi folks,

What's the best way to include some code snippets in a beamer presentation?

I've already tried verbatim, and lstlisting environments - both destroyed my presentation.

+2  A: 

I recently used something like

\verbatiminput{blah.c}

in a beamer presentation, and it worked alright for me...

Wanna post your code?

freedrull
+3  A: 

Use the [fragile] option:

\begin{frame}[fragile]
\begin{verbatim}
...
\end{verbatim}
\end{frame}
mkluwe
I've already tried this, with a strange result. The slide with code looks OK, but all slides before have paper size changed to A4.
m01
That is *very* strange indeed, as the "paper size" should be 128mm times 96mm to reflect the 4:3 ratio of most beamers output. You didn't fiddle around with that setting, did you?
mkluwe