Make code in LaTeX look *nice* [closed]

Solution 1:

The listings package is quite nice and very flexible (e.g. different sizes for comments and code).

Solution 2:

It turns out that lstlisting is able to format code nicely, but requires a lot of tweaking.

Wikibooks has a good example for the parameters you can tweak.

Solution 3:

For simple document, I sometimes use verbatim, but listing is nice for big chunk of code.