How can I modify the following command to make it work?
\newcommand{\code}[1]{\begingroup \fontsize{10pt}{10pt}\selectfont \begin{verbatim} #1 \end{verbatim} \endgroup}
I currently get the following error on the close of the following verbatim block:
! Undefined control sequence.
<argument> ...endgroup ^^M^^M$\eta_{xi} = r_{xi} -
q_i \cdot p_x$ \\^^M$q_i ...
l.227 \end{verbatim}



verbatimpackage, although passing code as arguments is not covered there. – Werner Feb 21 '14 at 16:53