Possible Duplicate:
set the font family for lstlisting
I need to change the font while using the listings-package since my TeX template seems to interfere with standard listings settings (the code text appears in some calligraphic font which looks really stupid for source code).
I already tried using basicstyle=\ttfamily as an option, but this only changes the character spaces. Is there a way to completely switch the font to e.g. Courier?
Any help appreciated, I couldn't find anything on this in the package manual or google...
EDIT: The link from Peter Grill ( set the font family for lstlisting ) solved my problem, thanks a lot! (And sorry for the duplicate!)
listingsone. If you only need the typewriter font for code, try writing\def\ttfamily{lmtt}OR\usepackage{courier}in the preamble, and then\basicstyle=\ttfamilyin yourlistingssettings. Or show us a minimal example, please. Note that if your code is in italics, Computer Modern or Latin Modern (the default fonts) are much more "calligraphic" than Courier or other mono fonts. – ienissei Jun 28 '12 at 06:52