# \verbatim environment compatible with lingmacros \enumsentence

Using the verbatim environment inside an \enumsentence fails.

Here is a MWE:

\documentclass{article}
\usepackage{lingmacros}
\begin{document}
\enumsentence{
\begin{verbatim}
foo
\end{verbatim}
}
\end{document}


I can do a workaround using \texttt{ }, but then I have to escape a bunch of funny characters and in general I'd prefer verbatim for this.

Any suggestions?

-
What are the characters you have to escape? Can you make a "real life" example? –  egreg Dec 8 '12 at 10:02
in this example, i was working with many underscores, I had used vim s/_/\_/g and s/\$/\\\\/ to put the underscores and explicit line breaks throughout. But I was hoping for a more elegant solution. \cprotect seems to work without issue for this. –  apexofservice Dec 8 '12 at 21:18
Do you need typewriter type? Other special characters? –  egreg Dec 8 '12 at 21:24

Use the package cprotect. Here is the updated code:

\documentclass{article}
\usepackage{lingmacros}
\usepackage{cprotect}
\begin{document}
\cprotect\enumsentence{
\begin{verbatim}
foo
\end{verbatim}
}
\end{document}