TROFF(1) | User Commands | TROFF(1) |
troff - typeset or format documents
troff [-a] [-f] [-Fdir] [-i] [-mname] [-nN] [-olist] [-raN]
[-sN] [-Tdest] [-uN] [-z] [filename]...
troff formats text in the filenames for typesetting or laser printing. Input to troff is expected to consist of text interspersed with formatting requests and macros. If no filename argument is present, troff reads standard input. A minus sign (−) as a filename indicates that standard input should be read at that point in the list of input files.
The output of troff is usually piped through dpost(1) to create a printable postscript file (see EXAMPLES).
The following options are supported. They may appear in any order, but all must appear before the first filename.
-a
-f
-Fdir
-i
-mname
-nN
-olist
-q
-raN
-sN
-Tdest
post
-uN
-z
The following operand is supported:
filename
Example 1 Using troff
The following example shows how to print an input text file mytext, coded with formatting requests and macros. The input file contains equations and tables and must go through the tbl(1) and eqn(1) preprocessors before it is formatted by troff with ms macros, processed by dpost(1), and printed by lp(1):
tbl mytext | eqn | troff -ms | dpost | lp
/tmp/trtmp
/usr/share/lib/tmac/*
/usr/lib/font/*
/usr/share/lib/nterm/*
checknr(1), col(1), dpost(1), eqn(1), lp(1), man(1), nroff(1), tbl(1), attributes(7), man(7), me(7), ms(7)
troff is not 8-bit clean because it is by design based on 7-bit ASCII.
Previous documentation incorrectly described the numeric register yr as being the Last two digits of current year. yr is in actuality the number of years since 1900. To correctly obtain the last two digits of the current year through the year 2099, the definition given below of string register yy may be included in a document and subsequently used to display a two-digit year. Note that any other available one- or two-character register name may be substituted for yy.
.\" definition of new string register yy--last two digits of year .\" use yr (# of years since 1900) if it is < 100 .ie \n(yr<100 .ds yy \n(yr .el \{ .\" else, subtract 100 from yr, store in ny .nr ny \n(yr-100 .ie \n(ny>9 \{ .\" use ny if it is two digits .ds yy \n(ny .\" remove temporary number register ny .rr ny \} .el \{.ds yy 0 .\" if ny is one digit, append it to 0 .as yy \n(ny .rr ny \} \}
August 24, 2009 | OmniOS |