Printing source code

Need a good way to print out source code on Linux? Use a2ps. For Java code (where not all of my colleagues adhere to the 80 columns lim^H^H^Hreligion), I use

    a2ps --media=A4 --chars-per-line=100 --line-numbers=1 filename.java

This prints out your code nicely in two smaller pages on each A4.

For color output, use:

    a2ps --prologue=color

To review the results of a2ps first, use the -o switch:

    a2ps filename.c -o temp.ps
    ggv temp.ps