I have a simple command which takes one argument. Now I want to pass a small listing-environment to the command.
Here is the code:
\documentclass{article}
\usepackage{listings}
\begin{document}
\newcommand{\test}[1]{ #1 }
\test
{%
\begin{lstlisting}
asdf
\end{lstlisting}
}%
\end{document}
While compiling I get this error:
Package Listings Warning: Text dropped after begin of listing on input line 12.
(/usr/share/texmf-texlive/tex/latex/base/omscmr.fd))
*
Any suggestions would be great appreciated.