UNIX Tip of the Week

enscript


Often when printing code listings or other text, it is preferred to use a slightly smaller font size than normal, and print "two up" per side of printed output.

enscript allows for this and more. There are a great many options to enscript; the following may be used as an alias to print two pages of text per page of Postscript output.

alias lptwo enscript --columns=2 --font=Courier@7 --fancy-header --borders --landscape --media=Letter $*

If you copy the above incantation into your .cshrc file, the next time you log in you can use lptwo to print two-up.


Enscript is a general-purpose ASCII-to-Postscript formatter and has a great many options:

SYNOPSIS
       enscript  [-12BcgGhjkKlmOqrRvVzZ]  [-#  copies] [-a pages]
       [-A align] [-b header] [-C[start_line]] [-d  printer]  [-D
       key[:value]]   [-e[char]]   [-E[lang]]   [-f   font]   [-F
       header_font] [-H[num]] [-i indent] [-I filter] [-J  title]
       [-L  lines_per_page]  [-M  media] [-n copies] [-N newline]
       [-o outputfile] [-o -] [-p outputfile] [-p -] [-P printer]
       [-s baselineskip] [-S key[:value]] [-t title] [-T tabsize]
       [-u[text]] [-U num] [-W language] [-X encoding]  [filename
       ...]

As always, the man page is absolutely spellbinding.


Revised: January 15, 2001