[Tex/LaTex] getting this “Couldn’t load requested aspect” error

errorslistings

I want to include some Matlab scripts in my thesis. Unfortunately, I can't get listings to work properly. If I try to compile the following code,

\documentclass[11pt]{report}
\usepackage{listings}
\begin{document}
Bla bla bla.
\end{document}

I get the following error:

Package Listings Error: Couldn't load requested
aspect\lst@RequireAspects\lst@loadaspects

Why is that happening and what can I do to remedy the problem?

Best Answer

The error is caused by listings not finding some required subpackages.

The complete distribution has the following files:

listings.cfg
lstdoc.sty
listings.sty
lstlang1.sty
lstlang2.sty
lstlang3.sty
lstmisc.sty

Of these, lstdoc.sty is only needed for typesetting the package documentation. My conjecture is that you only downloaded listings.sty, but not the other ones.

You can download them at http://www.ctan.org/tex-archive/macros/latex/contrib/listings and extract the files with the Makefile. However, since listings is included in all standard distributions, you shouldn't install it manually, but with the facilities provided by your TeX distribution.

Note: something more can be said if you specify what TeX distribution you're using.