For making a report of my work, I am facing a problem of writing varbatim too frequently. So, I need a workout. Say, I define a newcommand as (for example)
\newcommand{\uve}{\textbf{In verbatim}} %there must be something more
now, if I invoke
\uve <some text>
the effect should be as
\textbf{in verbatim}
\begin{verbatim}
<some text>
\end{verbatim}
I tried using
\providecommand{\uve}[1]{\\\textbf{In Verbatim:~}\begin{verbatim}{#1}\end{verbatim}}
and failed, with error: Runaway argument?
{/}\end {verbatim}<some text>^^M\stat Complete\ETC.
! File ended while scanning use of \@xverbatim.
<inserted text>
Kindly help.
Edit after 3 comments
For my present purpose, \verb
is sufficient. but, I need to define an environment (sorry, not a command as I put in OP) that will give me:
\begin{verbenv}
some text
\end{verbenv}
will directly give me:
**In verbatim:** Some text
\begin{codeframe}{example}
... not much save in typing.verbatim
is pretty special, since it must end with\end{verbatim}
. Hence, taking this environment as a part of a control sequence or new environment will get an ERROR. The packagefancyvrb
will help you.<some text>
contain any weird characters?