The listings package is quite nice and very flexible (e.g. different sizes for comments and code).
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.
For simple document, I sometimes use verbatim, but listing is nice for big chunk of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With