I'm writing my dissertion using TeX. I would like to use a specific font in my
lstlisting source code. How can I use a specific font like Monaco or Arial? I usually found solutions with
basicstyle setted to
\ttfamily but it's not what I want.
You can't use a font in TeX unless it's known to the TeX system. For example Monaco isn't, unless you use XeLaTeX or LuaLaTeX on Mac OS X. A good typewriter font for
There's a clone of Courier
that sports a neat distinction between medium and bold weight (but might not agree with your main font).
However, you're not forced to use typewriter type for listings; if you say
you'll get whatever sans serif font is the default. You can change the default font by loading the suitable package; for example
will load a clone of Helvetica as the sans serif font and the above declaration will make this one the default. This package has a
If you're using XeLaTeX or LuaLaTeX as typesetting engines, then you can use whatever OpenType or TrueType font you have on your system. For example, after having loaded fontspec you can define a suitable command