|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Register |
Effect | ||
|
A |
Modifies the first page for memos and letters. If A is set to any nonzero number, the letterhead block is suppressed to accommodate personal stationery. | ||
|
C |
Sets the type of copy as follows: | ||
|
|
0 |
none (default) | |
|
|
1 |
OFFICIAL FILE COPY | |
|
|
2 |
DATE FILE COPY | |
|
|
3 |
DRAFT with single spacing, default paragraph style | |
|
|
4 |
DRAFT with double spacing, 10 en paragraph indent | |
|
|
5 |
double spacing with 10 en paragraph indent | |
|
D |
Sets debug mode. (Formatter will continue processing even if mm detects errors that would otherwise cause processing to stop.) | ||
|
E |
Controls the font of the subject/date/from fields on memos and letters. If D is 1, these fields are emboldened; if D is 0, the fields are printed in normal font. | ||
|
L |
Sets the length of the physical page to N (default 11 inches). Specify units with this option since N is scaled. | ||
|
N |
Specifies page numbering style as follows: | ||
|
|
0 |
All pages include header | |
|
|
1 |
Header replaces footer on page 1; all other pages have a header | |
|
|
2 |
Page 1 has no header; all other pages have a header | |
|
|
3 |
All pages use section-page as footer | |
|
|
4 |
No header on page 1; header on other pages only if .PH is defined | |
|
|
5 |
Same as 3, but section-figure | |
|
O |
Sets page offset (left margin) to N where N is a scaled value. | ||
|
P |
Specifies that pages are to be numbered starting with N. | ||
|
S |
Sets point size and vertical spacing for document. By default point size is 10, vertical spacing is 12. | ||
|
W |
Sets page width to N where N is a scaled value (default 6i). | ||
The -r option is useful if you have a file that will be printed somewhat differently over the course of its life. As an example, assume the first draft of your document has to be double spaced and have the word "DRAFT" at the bottom of every
page. Set the C register to 4 on your command line:
troff -mm -rC4 docname
As the document nears completion, you have to print it single spaced, but you still want the word "DRAFT" at the bottom of every page:
troff -mm -rC3 docname
When the document is complete, you can use -rC1 to print "OFFICIAL FILE COPY" at the bottom of each page, or you can use -rC0 to omit that line entirely.
The mm macros are the macros of choice throughout much of AT&T. This may explain why mm has been singled out for special treatment. Only mm has its own set of processing commands: mm, to process files with nroff, and mmt, to process files with
troff.
To format a file with mm or mmt, use a command of this form:
mm options filenames mmt options filenames
As is the case with the nroff and troff commands, the options must precede the filename(s).
The mm and mmt commands have their own set of options; however, they can pass arguments to nroff and troff, so you can use any nroff/troff option as an option to mm/mmt.
mm and mmt can initialize the number registers that can be initialized by the nroff and troff commands. (See Table 29.2.)
You can use either nroff or troff to process files that use the me, ms, or man macros. All of the options shown in Table 29.1 can be used; however, the -r option has limited use because all predefined number registers in me and ms have two-character
names.
Most of man's predefined number registers also have two-character names. You can set register s to 1 to reduce the page size from 8 1/2 by 11 to 5 1/2 by 8.
To substitute your own macro package for mm, ms, me, or man, you have a choice of two methods:
All other options to nroff and troff can be used just as you use them for mm, ms, me, or man. Remember that the -r option can be used only to initialize registers with one-character names.
Error messages are largely self explanatory. They can be generated by the system (if you type torff instead of troff), by nroff or troff, by the macro package, or by the preprocessors. (Chapter 23, Formatting Tables with tbl," Chapter 24,
"Formatting Equations with eqn," Chapter 25, "Drawing Pictures with pic," and Chapter 26, "Creating Graphs with grap" contain information about error messages generated by the proprocessors.
It doesn't really matter whether troff or mm generates a message; you have to correct the error. Errors usually fall into one of the following categories:
The one thing to remember is that the line number, helpfully supplied by troff, is the troff output line number. So it's not uncommon to be told that you have an error in line 1500 when your text file is 600 lines long. mm attempts to give you the
source file line number. Don't wager a large amount on its accuracy.
Sometimes documentation customers want electronic files as well as hard copy. If they can't handle troff, they may request ASCII files from you. There's a simple way of complying with this requestuse deroff.
deroff removes all troff requests, macros, and backslash constructs. It also removes tbl commands (that is, everything between the .TS and the .TE), equation commands (everything between the .EQ and the .EN or between the defined eqn delimiters). It can
follow a chain of included files, so if you've sourced in a file with .so or .nx, deroff operates on those files, too. This feature can be suppressed with the -i option, which simply removes the .so and .nx lines from your file.
Other options are -mm and -ml. -mm completely deletes any line that starts with a macro. This means all your headings will be gone. The -ml option invokes -mm and removes all lists.
This may be just as well. deroff doesn't do well with nested lists.
deroff, like nroff and troff, can process multiple files.
To use deroff, enter the following:
$ deroff options inputfilename > outputfilename
Don't forget to redirect the output to a file. You don't really want to see your denuded, deroffed file streaking across your screen, do you?
Printing is no easier than anything else within the UNIX system, but there are powerful tools to enable you to print just about anything you can imagine. From the simplest print command (lp) to the complexities of preprocessors, troff, and postprocessors, you can control the process and achieve outstanding results.
The man command consults a database of stored UNIX system commandsbasically everything that is in the system reference manualsand nroffs it to your screen. If you don't have all that documentation on a shelf in your office, the man command
can save the day.
man is simple to use:
man commandname
The output is far from beautiful, and it's slow. It's paged to your screen, so you press Enter when you're ready to go on to the next page. You can't backtrack, though. Once you leave the first screenthat is, the one with the command syntax on
itthe only way you can see it again is to run the man command a second time.
If your terminal has windowing or layering capabilities, man can is more useful, because you can look at it and type on your command line at the same time.
You can also print the output from man, but you may not know which printer the output is going to. If you work in a multi-printer environment, this can be a nuisance. Check with your system administrator.
Although the Source Code Control SystemSCCS for shortwas written to keep track of program code, it also makes a good archiving tool for documentation. It saves each version of a text filecode, troff input, and so onand
essentially enables only the owner to change the contents of the file. SCCS is described in detail in Chapter 30, "SCCS Version Control." You can use SCCS to control versions of a document that you often revise. You can also use SCCS on drafts of
a document. If you work with a publications group and your group doesn't have a good archiving and document control system, look into SCCS.