Thursday, May 18, 2006

pretty print command in unix.

As we know, in xemacs, there is one option which can print text in pretty format. But do you know how to realize it in the normal command line in unix? Here they are:

enscript -E -p output_filename source_filename


here are some nice examples (copy from manual):
---------------------------------
PRINTING EXAMPLES
Following printing examples assume that enscript uses the default con-
figuration. If default actions have been changed from the configura-
tion files, some examples will behave differently.

enscript foo.txt
Print file foo.txt to the default printer.

enscript -Possu foo.txt
Print file foo.txt to printer ossu.

enscript -pfoo.ps foo.txt
Print file foo.txt, but leave PostScript output to file foo.ps.

enscript -2 foo.txt
Print file foo.txt to two columns.

enscript -2r foo.txt
Print file to two columns and rotate output 90 degrees (land-
scape).

enscript -DDuplex:true foo.txt
Print file in duplex (two side) mode (printer dependent).

enscript -G2rE -U2 foo.c
My default code printing command: gaudy header, two columns,
landscape, code highlighting, 2-up printing.

enscript -E --color -Whtml --toc -pfoo.html *.h *.c
A nice HTML report of your project's C source files.

No comments: