8

When I use \verb+...+ within beamer I get

! Missing $ inserted.
<inserted text> 
                $
l.6 \end{frame}

? 

What is going wrong and how do I fix this problem?

A minimal example is

\documentclass{beamer}

\begin{document}
\begin{frame}{Title}
Some text \verb+\int+
\end{frame}
\end{document}
  • Note to moderators: This question should be a reference question. Can somebody please make it community wiki? – Martin Thoma Aug 20 '14 at 17:13
  • @StefanKottwitz: You've answered another beamer/fragile question. Could you please extend my community wiki answer with an explanation how fragile works? – Martin Thoma Aug 20 '14 at 17:16
7

You can fix the problem by adding fragile:

\documentclass{beamer}

\begin{document}
    \begin{frame}[fragile]{Title}
        Some text \verb+\int+
    \end{frame}
\end{document}
  • 5
    It's worth expanding the answer with how fragile works maybe? :-) *or a link – 1010011010 Aug 20 '14 at 17:07
  • @1010011010 I don't know how it works. If you know it, please feel free to add it to the answer. That is one reason why I made my answer "Community wiki". – Martin Thoma Aug 20 '14 at 17:12

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.