xref: /csrg-svn/local/transcript/man/psgrind.l (revision 32184)
1*32184Sedward .\"	@(#)psgrind.l	1.2 09/15/87
232183Sedward .TH PSGRIND 1
3*32184Sedward .if t .ds PS P\s-2OST\s+2S\s-2CRIPT\s+2
4*32184Sedward .if n .ds PS PostScript
532183Sedward .SH NAME
6*32184Sedward psgrind \- convert C source files to \*(PS for printing
732183Sedward .SH SYNOPSIS
832183Sedward .B psgrind
932183Sedward [
1032183Sedward .I options
1132183Sedward ] [
1232183Sedward .I files
1332183Sedward ]
1432183Sedward .SH DESCRIPTION
1532183Sedward .I psgrind
1632183Sedward reads in C source files, converts them to \*(PS format, and spools them for
1732183Sedward printing on a \*(PS printer.  The different fonts used for the different
1832183Sedward syntactic elements of C source code may be specified on the command line.
1932183Sedward .I Psgrind
2032183Sedward is also much faster than any other grind program since it outputs a
2132183Sedward direct printer language without going through a normal document formatter
2232183Sedward as other pretty source printers must.
2332183Sedward .sp
2432183Sedward The five syntactic categories that
2532183Sedward .I psgrind
2632183Sedward recognizes and displays in different ways are page headings (which are
2732183Sedward actually not part of the C source code), the ``body'' or main text,
2832183Sedward keywords, which are C reserved words, literal strings and comments.
2932183Sedward Normally, the heading and keywords are set in a bold Helvetica font,
3032183Sedward the comments in a slanted Helvetica font, the body in a normal Helvetica
3132183Sedward font and literal strings and character constants in Courier font.
3232183Sedward .sp
3332183Sedward All the above fonts may be changed, see the
3432183Sedward .BR \-H ,
3532183Sedward .BR \-B ,
3632183Sedward .BR \-K ,
3732183Sedward .BR \-L
3832183Sedward and
3932183Sedward .B -C
4032183Sedward options.
4132183Sedward All these options take as their argument a font specfication.
4232183Sedward These font specifications have two parts:
4332183Sedward A font name as known to \*(PS (e.g., Times-Roman, Times-BoldItalic,
4432183Sedward Helvetica, Courier), and a
4532183Sedward point size (1 point = 1/72 inch\-8 point is a good small font).
4632183Sedward So ``Courier-Bold8'' is 8 point Courier Bold, ``Helvetica12'' is 12 point
4732183Sedward Helvetica.
4832183Sedward .sp
4932183Sedward The environment variable PSGRIND may be used to specify defaults.  The
5032183Sedward value of PSGRIND is parsed as a string of arguments
5132183Sedward .I before
5232183Sedward the arguments
5332183Sedward that appear on the command line.  For example setting the
5432183Sedward environment variable PSGRIND to the string ``-B Times-Roman12''
5532183Sedward sets your default body font to 12 point Times Roman.
5632183Sedward .sp
5732183Sedward The possible options are:
5832183Sedward .TP
5932183Sedward .B \-2
6032183Sedward Sets two column mode.
6132183Sedward .TP
6232183Sedward .B \-1
6332183Sedward Force one column mode.
6432183Sedward .TP
6532183Sedward .B \-g
6632183Sedward Causes the fact that a file is garbage to be ignored.  Normally, any file
6732183Sedward with more than a small number of non-printing characters is suspected of
6832183Sedward being garbage, and not printed\-this option means ``print it anyway.''
6932183Sedward .TP
7032183Sedward .B \-o
7132183Sedward If
7232183Sedward .I psgrind
7332183Sedward cannot find characters in a font, the missing characters are listed.
7432183Sedward .TP
7532183Sedward .BI \-p " file"
7632183Sedward Causes the \*(PS file to be written to the named file rather than
7732183Sedward being spooled for printing.  As a special case,
7832183Sedward .B \-p
7932183Sedward .B \-
8032183Sedward will send the \*(PS to the standard output.
8132183Sedward .TP
8232183Sedward .B \-r
8332183Sedward Causes the output to be rotated 90 degrees on the page (landscape mode).
8432183Sedward This is good for output that requires a wide page or for program listings
8532183Sedward when used in conjunction with two column mode.
8632183Sedward ``psgrind -2r
8732183Sedward .IR files ''
8832183Sedward is a nice way to get program listings.
8932183Sedward .TP
9032183Sedward .B \-R
9132183Sedward Force portrait (non-rotated) mode.
9232183Sedward .TP
9332183Sedward .B \-k
9432183Sedward Enable page prefeed (if the printer supports it).  This allows
9532183Sedward simple documents (e.g., program listings in one font)
9632183Sedward to print somewhat faster by keeping the printer
9732183Sedward running between pages.
9832183Sedward .TP
9932183Sedward .BI \-s " pagespec"
10032183Sedward Allows you to specify a range (or several ranges) of pages to be printed.
10132183Sedward .I Pagespec
10232183Sedward is a string, not containing spaces, of the form ``pagerange[,pagespec]''.
10332183Sedward .I Pagerange
10432183Sedward may be a single page number or a range
10532183Sedward of the form ``N-M'' which means print pages N through M.
10632183Sedward -N means print from the beginning of the docment to page N.
10732183Sedward M- means print from page M to the end of the document.
10832183Sedward .TP
10932183Sedward .BI \-H " font"
11032183Sedward This allows the respecification of the font used to print running
11132183Sedward titles listing the source file name and current page number.
11232183Sedward The option argument to
11332183Sedward .BR \-H ,
11432183Sedward and the other font options,
11532183Sedward should be a font specification as described above.
11632183Sedward .TP
11732183Sedward .BI \-B " font"
11832183Sedward This allows one to respecify the font to be used for the main body
11932183Sedward of the source, that not set specially in another font.
12032183Sedward .TP
12132183Sedward .BI \-K " font"
12232183Sedward This option allows the respecification of the font used to show
12332183Sedward keywords as separate from normal body text.
12432183Sedward .TP
12532183Sedward .BI \-L " font"
12632183Sedward This option allows the respecification of the font used to show
12732183Sedward string and character constants (literals) separate from normal body text.
12832183Sedward .TP
12932183Sedward .BI \-C " font"
13032183Sedward This option respecifies the font used to print comment text to
13132183Sedward show its separateness from normal text.
13232183Sedward .PP
13332183Sedward The following options are passed on as is to
13432183Sedward .I lpr.
13532183Sedward .TP
13632183Sedward .BI \-P printer
13732183Sedward Causes the output to be sent to the named printer.
13832183Sedward .TP
13932183Sedward .BI \-# n
14032183Sedward Causes n copies of the output to be produced.  The default is one.
14132183Sedward .TP
14232183Sedward .B \-m
14332183Sedward Causes the printer daemon to send mail upon job completion.
14432183Sedward .TP
14532183Sedward .B \-h
14632183Sedward Suppress the printing of the burst page.
14732183Sedward .TP
14832183Sedward .BI \-J " name"
14932183Sedward Set the job name for use on the burst page.  Otherwise, the name of the
15032183Sedward first input file will be used.
15132183Sedward .SH ENVIRONMENT
15232183Sedward .PP
15332183Sedward .IP PSGRIND
15432183Sedward string of options to be used by
15532183Sedward .I psgrind.
15632183Sedward .IP METRICS
15732183Sedward path name of a directory to use instead of
15832183Sedward /usr/lib/ps for font metric files.
15932183Sedward .IP PRINTER
16032183Sedward the name of a printer (as in the
16132183Sedward .B \-P
16232183Sedward option) for
16332183Sedward .I lpr
16432183Sedward to use.  If no
16532183Sedward .B \-P
16632183Sedward option is specified,
16732183Sedward .I lpr
16832183Sedward will use this printer.  If
16932183Sedward .B \-P
17032183Sedward is not specified and
17132183Sedward PRINTER is not defined in the environment,
17232183Sedward .I psgrind
17332183Sedward will spool to a printer named ``PostScript''.
17432183Sedward .SH FILES
17532183Sedward .TP 2.2i
17632183Sedward /usr/local/lib/ps/*.afm
17732183Sedward font metrics files.
17832183Sedward .TP
17932183Sedward /usr/local/lib/ps/psgrind.pro
18032183Sedward prologue for
18132183Sedward .I psgrind
18232183Sedward \*(PS files.
18332183Sedward .TP
18432183Sedward lpr
18532183Sedward Printer spooler
18632183Sedward .br
18732183Sedward .SH "SEE ALSO"
18832183Sedward enscript(1), lpr(1)
18932183Sedward .SH AUTHOR
19032183Sedward John Coker,
19132183Sedward .br
19232183Sedward University of California, Berkeley
19332183Sedward .br
19432183Sedward This code is based on the
19532183Sedward .I enscript
19632183Sedward utility from Adobe Systems, Inc.
19732183Sedward .fi
19832183Sedward .SH BUGS
19932183Sedward If you give the
20032183Sedward .B \-p
20132183Sedward argument after the file to be converted,
20232183Sedward .I psgrind
20332183Sedward will lie and tell you that the file has been put in the right
20432183Sedward place, when in fact it is in some obscure temporary file.  Always give
20532183Sedward the
20632183Sedward .B \-p
20732183Sedward argument first.
20832183Sedward .sp
20932183Sedward Long lines are not truncated in 2 column mode.  Line truncation may be
21032183Sedward off by a little bit as printer margins vary.  There should be a
21132183Sedward ``wrap'' option and multiple (truncated or wrapped) columns.
21232183Sedward .sp
21332183Sedward .I Psgrind
21432183Sedward generates temporary files which are spooled for printing.  The temporary file
21532183Sedward names are used by the spooling software (e.g.,
21632183Sedward .IR lpq ),
21732183Sedward rather than the symbolic job name passed to
21832183Sedward .IR lpr .
21932183Sedward .SH NOTES
22032183Sedward \*(PS is a trademark of Adobe Systems, Incorporated.
22132183Sedward .br
22232183Sedward Times is a trademark of Allied Corporation.
22332183Sedward .br
22432183Sedward Helvetica is a registered trademark of Allied Corporation.
225