I followed this answer to define a command such that underscores in its parameter can be kept.
However, this does not work if the command is called inside an environment that has been defined with NewEnviron
from environ
:
\documentclass[a4paper]{scrreprt}
\newcommand{\cmd}{\begingroup
\catcode`_=12 \cmdint}
\newcommand{\cmdint}[1]{%
\texttt{#1}%
\endgroup
}
\newenvironment{wrap}{}{}
\usepackage{environ}
\NewEnviron{wrap2}{\BODY}
\begin{document}
\cmd{some_test}
\begin{wrap}
\cmd{some_test}
\end{wrap}
\begin{wrap2}
\cmd{some_test}
\end{wrap2}
\end{document}
This compiles to
Say I can not do without environ
(I've actually been struggling for about an hour to get rid of it in my actual document, without success), how can I fix this?
verbatim
content then? – user31729 Apr 24 '15 at 16:44\input
but also for\texttt
. – Raphael Apr 24 '15 at 16:59