next up previous contents
Next: LaTeX Up: Document Preparation Previous: Document Preparation

nroff and troff

A document preparation package that comes with most UNIX systems is nroff-troff. The command troff is used to process a document for viewing on a graphics terminal or a laser printer, while the nroff command is used to produce output on a lineprinter or a character-mapped screen. Input documents for these commands consist of text with formatting commands that indicate the typestyle and organization of the output document. A UNIX reference book or the online manual pages are places where you can learn the syntax of nroff-troff documents.

There is a considerable amount of documentation written using nroff. Even if you choose to use a more powerful text preparation system, you need to be familiar with nroff conversions so that the documentation provided with a program can be viewed in a readable form.

A nroff formatted document is recognizable by the formatting statements that start with a period, such as '.PP' and '.TH'.

To get an ascii approximation of a nroff formatted file, use the nroff command with output redirected to another file:

nroff <filename> > <outfilename>

This output file is a printable ascii file. View the document with the more command before sending it to a printer to make sure the document looks the way you want it to

If the document was formatted for use as an online manual page, use the -man argument for the best results:

nroff -man <filename> > <outfilename>
*or*
nroff -man <filename> | more

Do not attempt to use troff to print documents on the laser printers here. Although the troff command's sole purpose is to produce documents printable on a laser printer, it is not supported on any of the Computer Science Department's printers. Attempts to use troff even on small 'test' documents can generate hundreds of pages of output, with only a few meaningless characters on each page, so please don't try.


next up previous contents
Next: LaTeX Up: Document Preparation Previous: Document Preparation

Larry Latour
Fri Sep 12 08:12:59 EDT 1997