DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T t

⟦3193ebf49⟧ TextFile

    Length: 3711 (0xe7f)
    Types: TextFile
    Names: »tgrind.1«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦6abfa5b66⟧ »utils/tgrind.tar.Z« 
        └─⟦02e344965⟧ 
            └─⟦this⟧ »tgrind.1« 

TextFile

.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 formatting 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 editing, inclusion in a larger
document, etc.
.PP
The options are:
.TP
.B \-f
forces format mode
.TP
.B \-
take input from standard input
.TP
.B \-n
don't boldface keywords
.TP
.B \-h
specifies text to go on the left side of every output page (default is none)
.TP
.B \-d
specifies the language definitions file (default is /usr/local/lib/tgrindefs)
.TP
.B \-l
specifies the language to use.  Currently known are
C (-lc or the default),
C++ (-lcc),
TeX (-ltex),
Yacc (-ly),
Prolog (-lprolog),
Icon (-lI),
Motorola 68K assembler (-la68),
Pascal (-lp),
Modula-2 (-lm2),
Ratfor (-lr),
MODEL (-lm),
ISP (-li),
arbitrary source (-lsrc), 
CSH (-lcsh), and
Bourne Shell (-lsh).
.SH "Using Tgrind with LaTex"
Use the
.B \-f
option to tgrind to
produce file(s) of the code you want to include in a LaTeX document.
Edit the document and add a
.B tgrind
option to the
.B \edocumentstyle
command.  Then include the formatted code files, wrapping
each in a
.B tgrind
environment (i.e.,
.IR "\ebegin{tgrind} ... \eend{tgrind}" )
.PP
By default, the tgrind environment produces a vertical list of
vboxes (use the TeXBook to translate this sentence into English).
This is the most flexible format (in particular, the TeX page
builder will have the freedom to break the code across page(s)) but,
to handle some common but less flexible formats, an option
may follow the 
.IR \ebegin{tgrind} :
.TP
.B [c]
Center the code as a block.  This option will also prevent the code
from being broken across pages.
.TP
.B [n]
Number the lines.  Every 10th line has a small number placed in the
right margin (as in the normal tgrind output).
.TP
.B [b]
Box the code.  The code will be enclosed in a
.I vbox.
This allows the formatted code to be used in contexts where it
normally couldn't be.  E.g., math mode, a parbox, a vcenter, etc.
This will also prevent the code from being broken across pages.
.SH FILES
.ta 1.5i
tgrindmac.tex	macro package
.br
tgrind.sty	LaTeX style file
.br
/usr/local/lib/tfontedpr		preprocessor
.br
/usr/local/lib/tgrindefs		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 tgrindefs .
The distributed
.I tgrindefs
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 .