UK TeX FAQ -- question 151

### Code listings in LaTeX

'Pretty' code listings are sometimes considered worthwhile by the neurotically æsthetic programmer, but they have a serious place in the typesetting of dissertations by computer science and other students who are expected to write programs. Simple verbatim listings are commonly useful, as well.

Verbatim listings are dealt with elsewhere. 'Pretty' listings are generally provided by means of a pre-compiler, but the listings package manages to do the job within LaTeX.

The lgrind system is a well-established pre-compiler, with all the facilities one might need and a wide repertoire of languages.

The tiny_c2l system is more recent: users are encouraged to generate their own driver files for languages it doesn't already deal with.

The C++2LaTeX system comes with strong recommendations for use with C and C++.

`C++2LaTeX`
  support/C++2LaTeX-1_1pl1.tar.gz
`lgrind`
  support/lgrind.tar.gz
`listings.sty`
  macros/latex/contrib/supported/listings.tar.gz
`tiny_c2l`
  support/tiny_c2l.tar.gz