# How do you insert an inline verbatim?

I'm trying to add an inline verbatim into a \paragraph?

Was wondering how do you do that?

-
–  Marco Daniel Dec 6 '11 at 18:36

You need a work-around, since verbatim text is not allowed as arguments to a macro in general. verbdef is one such work-around:

\documentclass{article}
\usepackage{verbdef}% http://ctan.org/pkg/verbdef
\verbdef{\vtext}{verb text}
\begin{document}
\paragraph{Here is some \vtext.}
\end{document}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​


Similar functionality is provided by fancyvrb. You could also try cprotect:

\usepackage{cprotect}% http://ctan.org/pkg/cprotect
%...
\cprotect\paragraph{Here is some \verb|verb text|.}

-
You beat me by 3 seconds. :-) –  lockstep Dec 6 '11 at 18:35
hmmm... is there another way that I don't have to install the package? I know its rather trivial to install it but just wondering... I'm using MacTex distribution –  chutsu Dec 6 '11 at 18:44
Most of these package should be distributed with MacTeX. Moreover, the provided sources shows how to install the package (under the "Getting it" heading). –  Werner Dec 6 '11 at 18:48