.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 ] [ .B \-l ] 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 .