16

I have the following code in my Beamer slide code:

\begin{frame}
\frametitle{selections}

\begin{tabular}{ll}
sample 1 &
\begin{minipage}{3in}
\begin{verbatim}
sample 2
\end{verbatim}
\end{minipage}\\
\end{tabular}

\end{frame}

When I try to compile, it breaks with the following error:

Runaway argument?
sample 2 \end {verbatim} \end {minipage}\\ \end {tabular} 
! Paragraph ended before \verbatim@ was complete.
<to be read again> 
                   \par 
l.965 \end{frame}

? 

I'm not sure what's wrong. Could anyone offer me guidance?

  • 1
    Try \begin{frame}[fragile] (untested as you didn't provide a complete example). – Ulrike Fischer Jul 23 '15 at 12:55
  • 1
    @UlrikeFischer Would you like to provide an answer? – Gonzalo Medina Jul 23 '15 at 14:06
26

Use \begin{frame}[fragile]. This option is needed when the content contains verbatim.

  • Hi @Ulrike Fischer. Thank you very much for your solution. If you don't mind my asking, how did you know this to be the solution? How would one interpret the error message as being that the standard frame cannot really contain the verbatim environment? Is there documentation that details this? – d3pd Jul 23 '15 at 16:01
  • 1
    The documentation of beamer describes this problem in various places. And you really not the first getting errors due to verbatim content. When I see the trigger words "beamer + verbatim + error" the first guess is "missing fragile option". – Ulrike Fischer Jul 23 '15 at 16:25
  • 1
    Thank you so much for this - because it also holds when an environment is implicitly verbatim, which may not be immediately evident. (Such as in SageTeX.) – kcrisman Jan 7 '17 at 4:19
  • I am having this same error, but I am not using "frame" at all. I am using "texttt" and the text within that seems perfectly normal. Any idea at all what I should look for. Would really like to know WHY "fragile" help and how that understanding might help with my problem. – AgilePro Oct 30 '18 at 19:35
  • @AgilePro ask a new question with a minimal example. – Ulrike Fischer Oct 30 '18 at 21:47

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.