[Tex/LaTex] How to change code example font in listings

fontslistings

Does anyone know how to change the font for code snippets in the listings package? I'd like to have a constant width font, rather the fancy variable-width looking font that it has by default.

Best Answer

As shown at page 28 of the manual, adding the option

basicstyle=\ttfamily

to the \lstset{} command would make what you ask.
Keep in mind to always read the packages documentation on your machine before posting.