home *** CD-ROM | disk | FTP | other *** search
- .fo \f0Bill Walker/page #/October 27, 1989\fP
- .NAME wroff
- .SYNOPSIS
- wroff [-sdpk] [-b n] [-e n] [-o outfile] [-t #] filelist
-
- .FUNCTION
- wroff is a general text formatting program. Options:
- .sp
- .nf
- .in +5
- Switch Action
- .in +2
-
- -p Do not effect font changes (default is p)
- -b begin printing with page n (default 1)
- -e end printing with page n (default 32767)
- -o place output on outfile
- -k do not use formfeeds to advance to new page
- -s scan text for errors only - do not print
- -t # expand tabstops (default 8 spaces)
- (use -t 0 to retain tab characters)
- -v print version number -- no text processing
-
- .in -7
- .fi
- .PP
- Switch "-p" causes special characters such as
- those that produce italics or boldface not to be output.
- An unrecognized command will cause wroff to terminate.
- .PP
- When writing to standard output, wroff does not emit special
- characters. This allows work to be previewed on the screen
- before it is printed. However, the screen only approximates
- the true output.
- .PP
- The wroff commands are discussed in the following pages.
- .BUGS
- The "preview" mechanism should provide more realistic output.
- .bp
- .in 5
- .nf
- .ce 2
- .bd 2
- .it 1
- Wroff
- Commands
- .sp 2
- \fT
- Command default Effect
-
- .cc !
- !in +2
- .bd n 1 boldface next n lines
- .bp n next advance to next page
- .br none break
- .cc c . change command char to c
- .ce n 1 center next n lines
- .dc c / change delimiter to c in titles
- .de name none start macro definition
- .di XX none start diversion to XX
- .ed none end diversion
- .en none end macro definition
- .et none end transparent mode
- .fi true set fill on
- .fm fontname P18bl mount font on post M
- .fo string "/page #/" define footer
- .gx x 0 move horizontally x dots
- .gy y 0 move vertically y dots
- .he string none define header
- .hr n 0 horizontal rule, length n
- .if (expr) XX if (expr) is true, call macro XX
- .in n 10 set left margin to n
- .it n 1 italicize next n lines
- .ju true justify right margin
- .lp str none label indented paragraph
- .ls n 1 set line spacing to n
- .m3 n 24 margin (dots) before footer
- .ne n 1 need n lines
- .nf n false,n=2 set fill off, theshold to n
- .nj false do not justify right margin
- .pc c # set page char to c
- .pl n 480 set page length to n dots
- (48 per vertical inch )
- .pm n 10 place paragraph labels left
- by this much (characters)
- .rj n current process left jagged, right justified
- right margin use .rj 0 to turn off
- .rm n 70 set right margin to n
- .rt none reset traps
- .so name none source a file
- .sp n 1 space down n lines
- .ti n 0 temporary indent by n
- .tf string "l c r" title format
- .tl XX string none set variable XX to string
- .tm none enter transparent mode
- .vr n 0 vertical rule, length n
- .vs n 12 vertical spacing between lines
- (dots)
- .ul n 1 underline next n lines
- .wh n XX none set trap XX at vertical position n
- .. none comment line
- \\fc none embedded font change
- (c = B, I, M, T, U, P, 0, 1, 2)
- \\{XX} none interpolate macro XX
- \\(reg) none interpolate register reg as an integer
- \\(regC) none interpolate register reg as a character
- \\[expr] none evaluate register expression
- \\f| none provide "anchor" in nonfill mode
-
- !cc .
- .bp
- \fP
- .ce
- \fIVariables\fP
- .nf
-
- All measurements in "dots"
- .sp 2
- registers and default values
-
- # = 1 \f| start at page 1
- A = 2 \f| the next page
- B = 24 \f| bottom margin of 24 dots
- C = 0 \f| center this many lines
- D = 0 \f| vertical length of last diversion
- E = 0 \f| italicize next n lines
- F = 0 \f| current font
- G = 0 \f| boldface next n lines
- H = TRUE \f| justify lines
- I = TRUE \f| start in FILLMODE = TRUE
- J = '/' \f| a SLASH mark
- L = 300 \f| left margin of 300 dots - 1 inch
- M = 0 \f| temporary indent
- O = '#' \f| page character
- P = 480 \f| page length
- Q = 0 \f| number of printable characters in outbuf
- R = 2100 \f| right margin of 2100 dots - 7 inches
- S = 1 \f| line spacing
- T = 0 \f| top margin of 0 dots
- U = 30 \f| width of a space character in dots
- V = 10 \f| current vertical spacing
- W = 10 \f| indented paragraph start in characters
- X = 0 \f| current horizontal position
- Y = REG('T') \f| current vertical position
- Z = FALSE \f| underline state
- ! = 8 \f| tabstops every 8 characters
- _ = 24 \f| margin before footer
- .bp
- .fi
- .ce 10
- \fIWroff Commands\fP
- .ce 0
- .sp 2
- .de CMD
- .in 20
- .sp
- .lp $1 $2
- .en
-
- .CMD bd
- "bd n" is used to boldface the next n lines. If n is not specified,
- the
- default is to boldface the next line.
- Since \fBwroff\fP supports in-line font changes, this command is
- not really very useful.
- .CMD bp
- "bp n" is used to advance to the next page and number it "n". If
- "n" is not specified, the default is to number pages
- sequentially.
- .CMD br
- The "br" command will always cause any collected output to
- be printed.
- .CMD cc
- The "command character" is the character that preceeds an embedded command.
- The character defaults to a ".", but can be changed to any
- character by issuing "cc c", where c is any character.
- .CMD ce
- "ce n" centers the next n lines. If n is not specified, the
- default is to center the next line.
- .CMD dc
- In titles, such as the footers and headers, the fields are
- delineated by using a "delimiter character". For instance,
- the default footer is "/page #/". The "/" delimits the
- fields. This delimiter (default "/") can be changed by
- using the "dc c" command.
- .CMD de
- This command starts a macro definition. Use "de name" to
- begin the definition of a macro named "name". There is no
- default name. A macro definition will continue until the
- "en" command is recognized.
- .CMD di
- Start a diversion named "name" by issuing "di name". Text
- is copied into the diversion until the "ed" command is
- found.
- .CMD ed
- End a diversion.
- .CMD en
- End a macro. Caution: if you define a macro, be sure to
- end it!
- .CMD et
- End transparent print. Any lines between "tm" and "et" will
- be copied to the output without any processing (other than
- for margins ).
- .CMD fi
- "fi" tells \fBwroff\fP to begin to fill lines. That means
- that both the left and the right margins will appear
- straight.
- .CMD fm
- The "fm name" command mounts a font with the given name on
- font post "M". To access that font, use \\fM to start, and
- \\fP to return to the previous font.
- There is a list of available fonts at the end of this
- document.
- .CMD fo
- "fo string" defines the page footer to be "string". The
- string is constructed by examining the title format string,
- which is defined by "tf", and replacing any page character
- by the current page number. (See "pc" to change the page
- character.)
- The placement of the footer on the page can be controled by
- using "m3".
- .CMD gx
- "gx x" is the "go to x" command. "x" is measured in "dots"
- from the left printable margin. There are 300 "dots" to an
- inch. "gx" is used to move horizontally across a page.
- .CMD gy
- "gy y" is the "go to y" command. "y" is measured in "dots"
- from the top printable margin. There are 48 "dots" to an
- inch. "gy" is used to move vertically in a page.
- .CMD he
- "he string" sets the page header, in the same way that "fo"
- sets the footer.
- .CMD hr
- "hr n" draws a horizontal rule (a line) from the current x position
- to the right. This line is of length n (default 0) in dots.
- .CMD if
- "if (expr) macname" will evaluate the expression and execute the
- macro names "macname" if the expression is true.
- If the expression is an arithmetic expression, the evaluator
- regards "0" as "TRUE".
- .CMD in
- The "in n" command controls the left margin. The default for n is 10.
- In contrast to other commands, n is measured in deci-inches. The default
- left margin is therefore 1 inch from the left printable margin.
- .CMD it
- "it n" will italicize the next n lines. The default is to italicize
- one line. Since \fBwroff\fP supports in-line font changes, this command
- is not really useful.
- .CMD ju
- Issuing "ju" will cause right margin justification to take place. To
- gain a "ragged right" margin, turn justification off with "nj".
- .CMD lp
- Use "lp str" to label a paragraph with the string "str". This label is
- placed to the left of the paragraph a distance of 10 deci-inches. This
- distance can be changed with the "pm" command.
- .CMD ls
- Use "ls n" to set the line spacing to n. (The default is 1). For instance,
- to double space output, use "ls 2".
- .CMD m3
- Before placing a footer, wroff provides a small margin. The default is to provide
- one-half inch (24 dots), and then place the footer. This can be changed
- by using "m3 n", where n is measured in dots. (48 dots per vertical inch.)
- .CMD ne
- "ne n" means that \fBwroff\fP should guarantee that there
- is at least n lines left on the current page (default n=1). If this much
- space does not remain on the current page, \fBwroff\fP will turn up a new
- page before proceeding.
- .CMD nf
- The "nf" command causes \fBwroff\fP to process in non-fill
- mode. In fill mode, as many words as possible are packed on
- a line before the line is printed. If "justify" mode (see
- "ju" and "nj") is also on, the right margin is also
- justified. The "nf" command turns fill mode off, and in
- effect causes lines to appear as they are typed. This is
- especially useful for tables. The "anchor" character (see
- below) will be helpful in making tables line up properly.
- .CMD nj
- Enter "non-justify" mode.
- In non-justify mode, the right margin is not justified.
- Non-justify mode can coexist with fill mode to pack as many
- words as possible on a line, without squaring up the right
- margin. The default mode is "justify".
- .CMD pc
- In headers or footers, the (default) symbol "#" is used to represent
- something that should be replaced with the current page
- number. The symbol "#" can be changed to any character c by
- using "pc c".
- .CMD pl
- "pl n" is used to set the length of a page to n dots.
- (default is n=480, or 10 inches) This command is little
- used, unless you use odd sized paper in your laser printer.
- .CMD pm
- See the "lp" command above. The "pm n" command (default
- n=10) sets the margin for a paragraph label. The parameter
- n is measured in deci-inches.
- .CMD rj
- Use the "rj" command to cause text to be justified on the
- right, with a ragged left margin. This is useful for
- "glitzy" work.
- .CMD rm
- The "rm n" command sets the right margin. "n" is measured
- in deci-inches, with a default of 70 (7 inches).
- .CMD rt
- When "traps" (see "wh") are placed on a page, the
- traps are "sprung" as the location at which they are placed
- is passed. A "sprung" trap will not be sprung a second time
- on the same page. If you want to "reset" a trap for some
- reason (perhaps you used "gy" to move above it), use "rt"
- to reset \fIall\fP the traps on a page. It is not possible
- to selectively reset traps.
- .CMD so
- Source an external file. "so filename" will attempt to
- locate file "filename" and include it as though it were part
- of the current file. Nested "so" commands are legal. i.e.
- a file that is 'sourced' may in turn 'source' another file.
- .CMD sp
- Space down n lines by using "sp n". The default for n is
- 1.
- .CMD ti
- Use "ti n" (default n=0) to indent \fIonly the next line\fP
- by n deci-inches. (Think "temporary indent")
- .CMD tf
- A "title format" is a string that tells the tl command
- (below) how to interpret a given string.
- The current title format is used to interpolate strings
- using the "tl" command.
- The default title format is "l c r", meaning to interpret
- the string as having three fields, delimited by "/" (see
- "dc"). The first field will be left-justified, the second
- field will be centered, and the third
- field
- will be
- right justified, all within printed fields computed from the
- number of fields specified in the title format.
- To place the second field at the right of the center printed
- field, use "tf l r r".
- .CMD tl
- "tl string" is used to interpolate the string into the output, where the
- string is formatted according to the current 'title format'. (See "tf".)
- .CMD tm
- Enter transparent print mode. No further processing is done
- on text, but the text is copied directly from input to
- output until command "et" is encountered. No font changes
- are executed, and \fBwroff\fP is likely to lose track of
- current positions on the page. Use "tm" only \fIin
- extremis\fP.
- .CMD vr
- Draw a vertical line n dots (48 per inch) long starting at the current
- position. Note that the positive direction is "down" the
- page.
- .CMD vs
- Adjust the vertical spacing between lines of print. This is
- often useful to help "squeeze" a document onto a single
- page. "vs -1" will squeeze lines closer together by 1
- vertical dot. The default is to space by 12 dots.
- .CMD ul
- Use "ul n" to underline the next n lines. (default n = 1)
- .CMD wh
- Set a trap.
- The "wh" command has an unusual syntax. The command "wh n
- NAME" will execute macro "NAME" when the current vertical position
- on the page passes position n. The syntax "wh -24 NP" would
- fire macro NP when the current vertical position was within
- 24 dots of the bottom of the page. The macro must be
- defined elsewhere. Beware of firing undefined macros. A
- macro must be defined before the trap is fired, but need not
- be defined before the trap is set. It is legal to change a
- macro definition without resetting a trap.
- .CMD .
- The ".." command is a comment marker. Actually,
- the command should really be "CMDCHAR .", where the CMDCHAR
- is set by the "cc" command. The rest of a line after ".."
- is taken as a comment.
- .in 10
- .bp
- .ce
- \fBIn-Line Actions\fP
- .sp 3
- .PP
- \fBwroff\fP has the ability to deal with various fonts. It can also
- interpolate the value of a variable into the output stream, or call a
- macro from anywhere within a line.
- All of this is accomplished with "In-Line Actions".
- .PP
- In-Line Actions
- can be placed anywhere within a line of text.
- (This is opposed to \fIembedded commands\fP, which were
- discussed above, and which must appear on a line by
- themselves.) The "backslash" symbol (\\) is used to signal
- \fBwroff\fP that an in-line action is present.
- .PP
- The possible in-line actions are listed below:
- .nf
- .sp 2
- command \f|Action
- .in +2
- \\fc \f|in-line font change
- \f| where c = B, I, M, T, U, P, 0, 1, 2, other
- \f| B - \f|boldface
- \f| I - \f|italicize
- \f| M - \f|mountable
- \f| T - \f|Courier (fixed)
- \f| U - \f|toggle underline
- \f| P - \f|return to previous
- \f| 0 - \f|default font (Times Roman)
- \f| 1 - \f|Presentation 18 point
- \f| 2 - \f|Helvetica 6 point
- \f| other - \f|interpolate "other" char
-
- \\{XX} \f|interpolate macro named XX
- \\(reg) \f|interpolate the value of register reg
- \f| as an integer
- \\(regC) \f|interpolate the value of register reg
- \f| as a character
- \\[expr] \f|evaluate register expression -
- \f| do not interpolate, see \\(reg) above
- \\f| \f|place "anchor" in text
- .sp 2
- .in -2
- .fi
-