Hi everyone
I would like to save myself some typing by creating a macro for typesetting sourcecode examples. I would like to do something like this:
\newcommand{\pythonCode}[1] {\begin{lstlisting}[backgroundcolor=\color{pythonColor}]}#1\end{lstlisting}}
or this:
\newenvironment{pythonCode}[0]
{\begin{lstlisting}[backgroundcolor=\color{pythonColor}]}
{\end{pythonCode}
However, both of these approaches produce errors. Can somebody provide assistance on how solve such a problem? thank you
General ⇒ Problems with newcommand and newenviornment
NEW: TikZ book now 40% off at Amazon.com for a short time.

Problems with newcommand and newenviornment
Hi,
try the \lstnewenvironment command, described in the section Environments of the package documentation (pp 40ff)
try the \lstnewenvironment command, described in the section Environments of the package documentation (pp 40ff)
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Problems with newcommand and newenviornment
awesome, this worked great. thank you