I'm trying to write a \newcommand
for verbatim
:
\newcommand{\codeline}[1]{\begin{verbatim}{#1}\end{verbatim}}
and use it as
\codeline{int foo;}
but it gives an error "File ended while scanning use of \@xverbatim". How to fix it?
macrosverbatim
I'm trying to write a \newcommand
for verbatim
:
\newcommand{\codeline}[1]{\begin{verbatim}{#1}\end{verbatim}}
and use it as
\codeline{int foo;}
but it gives an error "File ended while scanning use of \@xverbatim". How to fix it?
Best Answer
If you want a simple implementation, go with
If you want more detailed control, you should go with
fancyvrb
orminted
packages.