0

I'm trying to make a newcommand to print verbatim text using the \detokenize as follows:

\newcommand{\texcmd}[1]{%
    {\color{red!70}{\texttt{\detokenize{#1}}}}
}

When I use it to typeset a long command like \texcmd{\newcommand{\cmd}{def}}, it produces extra spaces as shown


enter image description here


How can I get rid of those unwanted spaces?

0 Answers0