1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
.TH TGRIND 1
.UC 4
.SH NAME
tgrind \- grind nice program listings using TeX
.SH SYNOPSIS
.B tgrind
[
.B \-f
] [
.B \-
] [
.B \-n
] [
.B \-h
header
] [
.B \-d
<description file>
] [
.B \-l<language>
]
name ...
.SH DESCRIPTION
.I Tgrind
formats program sources in a nice style using
.IR TeX(1) .
Comments are placed in italics, keywords in bold face and strings in
typewriter font.
Source file line numbers appear in the right margin (every 10 lines).
The start of a function is indicated by the function name in large
type in the right margin.
.PP
In regular mode
.I tgrind
processes its input file(s) and passes them to
.I TeX(1)
for formating and output.
.PP
In format mode (i.e., when the
.B -f
flag is used),
.I tgrind
processes its input file(s) and writes the result to standard output.
This output can be saved for later editting, inclusion in a larger
document, etc.
.PP
The options are:
.IP \-f
forces format mode
.IP \-
take input from standard input
.IP \-n
don't boldface keywords
.IP \-h
specifies text to go on the left side of every output page (default is none)
.IP \-d
specifies the language definitions file (default is /usr/local/lib/vgrindefs)
.IP \-l
specifies the language to use. Currently known are PASCAL (-lp), RATFOR (-lr),
Modula-2 (-lm2), MODEL (-lm), C (-lc or the default), ISP (-li),
Yacc (-ly), Prolog (-lprolog), Icon (-lI), TeX (-ltex), CSH (-lcsh), and
Bourne Shell (-lsh).
.SH FILES
.ta 2i
tgrindmac.tex macro package
.br
/usr/local/lib/tfontedpr preprocessor
.br
/usr/local/lib/vgrindefs language descriptions
.SH AUTHOR
Van Jacobson, Lawrence Berkeley Laboratory (based on "vgrind"
by Dave Presotto & William Joy of UC Berkeley).
.SH SEE ALSO
tex(1), vgrind(1), vgrindefs(5)
.SH BUGS
.PP
The marginal\-function\-name mechanism depends on the quality
of the language description in
.IR vgrindefs .
The distributed
.I vgrindefs
fails to recognize many legal C function declarations.
.PP
Arbitrary formatting styles for programs mostly look bad.
The use of spaces to align source code often fails miserably (because
of the variable width output font). If you plan to
.I tgrind
your program, try to use tabs.
.PP
The indexing option of
.I vgrind
is missing. However, nice indices can be generated using the
.B -v
option of
.I ctags
together with appropriate TeX macros.
.PP
The
.B -f
flag means different things to
.I tgrind
and
.IR vgrind .
|