Please consider the following example. Does anyone has an idea why I cannot use the listings-environment within the tabularx-environment?
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{listings}
\usepackage{lipsum}
\begin{document}
\newenvironment{foo}{\tabularx{\textwidth}{p{2cm}X}}{\endtabularx}
\newcommand{\M}{\textit{Mathematica }}
\newcommand{\C}[1]{\texttt{#1}}
\newcommand{\LongText}{This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text. This is a long text.}
\lipsum[1-3]
\begin{tabularx}{\textwidth}{p{2cm}X}
Whatever & \LongText \LongText \\
Something else & \LongText \LongText \\
Code & \begin{lstlisting} for i=0 do... \end{lstlisting}
\end{tabularx}
\end{document}