home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / wroff / part01 / doc / wroff.1.w next >
Encoding:
Text File  |  1991-12-11  |  15.1 KB  |  421 lines

  1. .fo \f0Bill Walker/page #/October 27, 1989\fP
  2. .NAME wroff
  3. .SYNOPSIS
  4. wroff [-sdpk] [-b n] [-e n] [-o outfile] [-t #] filelist
  5.  
  6. .FUNCTION
  7. wroff is a general text formatting program.  Options:
  8. .sp
  9. .nf
  10. .in +5
  11. Switch              Action
  12. .in +2
  13.  
  14. -p        Do not effect font changes (default is p)
  15. -b        begin printing with page n (default 1)
  16. -e        end printing with page n (default 32767)
  17. -o        place output on outfile
  18. -k        do not use formfeeds to advance to new page
  19. -s              scan text for errors only - do not print
  20. -t #        expand tabstops (default 8 spaces)
  21.             (use -t 0 to retain tab characters)
  22. -v        print version number -- no text processing
  23.  
  24. .in -7
  25. .fi
  26. .PP
  27. Switch "-p" causes special characters such as
  28. those that produce italics or boldface not to be output.
  29. An unrecognized command will cause wroff to terminate.  
  30. .PP
  31. When writing to standard output, wroff does not emit special
  32. characters.  This allows work to be previewed on the screen
  33. before it is printed.  However, the screen only approximates
  34. the true output.
  35. .PP
  36. The wroff commands are discussed in the following pages.
  37. .BUGS
  38. The "preview" mechanism should provide more realistic output.
  39. .bp
  40. .in 5
  41. .nf
  42. .ce 2
  43. .bd 2
  44. .it 1
  45. Wroff
  46. Commands
  47. .sp 2
  48. \fT
  49. Command           default           Effect
  50.  
  51. .cc !
  52. !in +2
  53. .bd n              1             boldface next n lines
  54. .bp n            next            advance to next page
  55. .br              none            break
  56. .cc c             .              change command char to c
  57. .ce n             1              center next n lines
  58. .dc c             /              change delimiter to c in titles 
  59. .de name         none            start macro definition
  60. .di XX        none         start diversion to XX
  61. .ed         none         end diversion
  62. .en              none            end macro definition
  63. .et         none         end transparent mode
  64. .fi              true            set fill on
  65. .fm  fontname    P18bl         mount font on post M
  66. .fo string    "/page #/"     define footer
  67. .gx x          0         move horizontally x dots 
  68. .gy y          0         move vertically y dots
  69. .he string     none         define header
  70. .hr n           0         horizontal rule, length n
  71. .if (expr) XX               if (expr) is true, call macro XX
  72. .in n             10             set left margin to n  
  73. .it n              1             italicize next n lines
  74. .ju              true            justify right margin
  75. .lp str             none         label indented paragraph
  76. .ls n              1             set line spacing to n
  77. .m3 n          24         margin (dots) before footer
  78. .ne n              1             need n lines
  79. .nf n            false,n=2       set fill off, theshold to n
  80. .nj              false           do not justify right margin
  81. .pc c              #             set page char to c
  82. .pl n             480            set page length to n dots
  83.                     (48 per vertical inch )
  84. .pm n          10             place paragraph labels left
  85.                   by this much (characters)
  86. .rj n         current         process left jagged, right justified
  87.                 right margin     use .rj 0 to turn off
  88. .rm n             70             set right margin to n
  89. .rt         none         reset traps
  90. .so name         none            source a file
  91. .sp n              1             space down n lines
  92. .ti n              0             temporary indent by n
  93. .tf string    "l c r"         title format
  94. .tl XX string     none           set variable XX to string
  95. .tm          none         enter transparent mode
  96. .vr n           0         vertical rule, length n
  97. .vs n           12             vertical spacing between lines
  98.                     (dots)
  99. .ul n              1             underline next n lines
  100. .wh n  XX     none         set trap XX at vertical position n
  101. ..         none         comment line
  102. \\fc              none            embedded font change
  103.                    (c = B, I, M, T, U, P, 0, 1, 2)
  104. \\{XX}          none          interpolate macro XX
  105. \\(reg)          none        interpolate register reg as an integer
  106. \\(regC)        none            interpolate register reg as a character
  107. \\[expr]    none        evaluate register expression
  108. \\f|        none        provide "anchor" in nonfill mode
  109.  
  110. !cc .
  111. .bp
  112. \fP
  113. .ce
  114. \fIVariables\fP
  115. .nf
  116.  
  117. All measurements in "dots"
  118. .sp 2
  119.      registers and default values
  120.  
  121.     # =  1         \f| start at page 1 
  122.     A =  2         \f| the next page 
  123.     B = 24         \f| bottom margin of 24 dots 
  124.     C = 0        \f| center this many lines 
  125.     D = 0         \f| vertical length of last diversion 
  126.     E = 0          \f| italicize next n lines 
  127.     F = 0         \f| current font 
  128.     G = 0         \f| boldface next n lines 
  129.     H = TRUE      \f| justify lines 
  130.     I = TRUE       \f| start in FILLMODE = TRUE 
  131.     J = '/'     \f| a SLASH mark 
  132.     L = 300     \f| left margin of 300 dots  - 1 inch 
  133.     M = 0        \f| temporary indent 
  134.     O = '#'       \f| page character 
  135.     P = 480     \f| page length 
  136.     Q = 0         \f| number of printable characters in outbuf 
  137.     R = 2100    \f| right margin of 2100 dots - 7 inches 
  138.     S = 1         \f| line spacing 
  139.     T = 0         \f| top margin of 0 dots 
  140.     U = 30        \f| width of a space character in dots 
  141.     V = 10         \f| current vertical spacing 
  142.     W = 10         \f| indented paragraph start  in characters 
  143.     X = 0         \f| current horizontal position 
  144.     Y = REG('T')    \f| current vertical position 
  145.     Z = FALSE     \f| underline state 
  146.     ! = 8         \f| tabstops every 8 characters 
  147.     _ = 24         \f| margin before footer 
  148. .bp
  149. .fi
  150. .ce 10
  151. \fIWroff Commands\fP
  152. .ce 0
  153. .sp 2
  154. .de CMD
  155. .in 20
  156. .sp
  157. .lp $1 $2
  158. .en
  159.  
  160. .CMD bd
  161. "bd n" is used to boldface the next n lines.  If n is not specified,
  162. the
  163. default is to boldface the next line.
  164. Since \fBwroff\fP supports in-line font changes, this command is
  165. not really very useful.
  166. .CMD bp
  167. "bp n" is used to advance to the next page and number it "n".  If 
  168. "n" is not specified, the default is to number pages
  169. sequentially.
  170. .CMD br
  171. The "br" command will always cause any collected output to
  172. be printed.
  173. .CMD cc
  174. The "command character" is the character that preceeds an embedded command.
  175. The character defaults to a ".", but can be changed to any
  176. character by issuing "cc c", where c is any character.
  177. .CMD ce
  178. "ce n" centers the next n lines.  If n is not specified, the
  179. default is to center the next line.
  180. .CMD dc
  181. In titles, such as the footers and headers, the fields are
  182. delineated by using a "delimiter character".  For instance,
  183. the default footer is "/page #/".  The "/" delimits the
  184. fields.  This delimiter (default "/") can be changed by
  185. using the "dc c" command.
  186. .CMD de
  187. This command starts a macro definition.  Use "de name" to
  188. begin the definition of a macro named "name".  There is no
  189. default name.  A macro definition will continue until the
  190. "en" command is recognized. 
  191. .CMD di
  192. Start a diversion named "name" by issuing "di name".  Text
  193. is copied into the diversion until the "ed" command is
  194. found.
  195. .CMD ed
  196. End a diversion.  
  197. .CMD en
  198. End a macro.  Caution:  if you define a macro, be sure to
  199. end it!
  200. .CMD et
  201. End transparent print.  Any lines between "tm" and "et" will
  202. be copied to the output without any processing (other than
  203. for margins ).
  204. .CMD fi
  205. "fi" tells \fBwroff\fP to begin to fill lines.  That means
  206. that both the left and the right margins will appear
  207. straight.
  208. .CMD fm
  209. The "fm name" command mounts a font with the given name on
  210. font post "M".  To access that font, use \\fM to start, and
  211. \\fP to return to the previous font.
  212. There is a list of available fonts at the end of this
  213. document.
  214. .CMD fo
  215. "fo string" defines the page footer to be "string".  The
  216. string is constructed by examining the title format string,
  217. which is defined by "tf", and replacing any page character
  218. by the current page number.  (See "pc" to change the page
  219. character.)
  220. The placement of the footer on the page can be controled by
  221. using "m3". 
  222. .CMD gx
  223. "gx x" is the "go to x" command.  "x" is measured in "dots"
  224. from the left printable margin.  There are 300 "dots" to an
  225. inch.  "gx" is used to move horizontally across a page.
  226. .CMD gy
  227. "gy y" is the "go to y" command.  "y" is measured in "dots"
  228. from the top printable margin.   There are 48 "dots" to an
  229. inch.  "gy" is used to move vertically in a page.
  230. .CMD he
  231. "he string" sets the page header, in the same way that "fo"
  232. sets the footer.
  233. .CMD hr
  234. "hr n" draws a horizontal rule (a line) from the current x position
  235. to the right.  This line is of length n (default 0) in dots.
  236. .CMD if
  237. "if (expr) macname" will evaluate the expression and execute the
  238. macro names "macname" if the expression is true. 
  239. If the expression is an arithmetic expression, the evaluator
  240. regards "0" as "TRUE".
  241. .CMD in
  242. The "in n" command controls the left margin.  The default for n is 10.
  243. In contrast to other commands, n is measured in deci-inches.  The default
  244. left margin is therefore 1 inch from the left printable margin.
  245. .CMD it
  246. "it n" will italicize the next n lines.  The default is to italicize 
  247. one line.  Since \fBwroff\fP supports in-line font changes, this command
  248. is not really useful.
  249. .CMD ju
  250. Issuing "ju" will cause right margin justification to take place.  To
  251. gain a "ragged right" margin, turn justification off with "nj".
  252. .CMD lp
  253. Use "lp str" to label a paragraph with the string "str".  This label is
  254. placed to the left of the paragraph a distance of 10 deci-inches.  This
  255. distance can be changed with the "pm" command.
  256. .CMD ls
  257. Use "ls n" to set the line spacing to n.  (The default is 1).  For instance,
  258. to double space output, use "ls 2".
  259. .CMD m3
  260. Before placing a footer, wroff provides a small margin.  The default is to provide
  261. one-half inch (24 dots), and then place the footer.  This can be changed
  262. by using "m3 n", where n is measured in dots. (48 dots per vertical inch.)
  263. .CMD ne
  264. "ne n" means that \fBwroff\fP should guarantee that there 
  265. is at least n lines left on the current page (default n=1).  If this much
  266. space does not remain on the current page, \fBwroff\fP will turn up a new
  267. page before proceeding.
  268. .CMD nf
  269. The "nf" command causes \fBwroff\fP to process in non-fill
  270. mode.  In fill mode, as many words as possible are packed on
  271. a line before the line is printed.  If "justify" mode (see
  272. "ju" and "nj") is also on, the right margin is also
  273. justified.  The "nf" command turns fill mode off, and in
  274. effect causes lines to appear as they are typed.  This is
  275. especially useful for tables.  The "anchor" character (see
  276. below) will be helpful in making tables line up properly.
  277. .CMD nj
  278. Enter "non-justify" mode.  
  279. In non-justify mode, the right margin is not justified.
  280. Non-justify mode can coexist with fill mode to pack as many
  281. words as possible on a line, without squaring up the right
  282. margin.  The default mode is "justify".
  283. .CMD pc
  284. In headers or footers, the (default) symbol "#" is used to represent
  285. something that should be replaced with the current page
  286. number.  The symbol "#" can be changed to any character c by
  287. using "pc c".
  288. .CMD pl
  289. "pl n" is used to set the length of a page to n dots.
  290. (default is n=480, or 10 inches)  This command is little
  291. used, unless you use odd sized paper in your laser printer.
  292. .CMD pm
  293. See the "lp" command above.  The "pm n" command (default
  294. n=10) sets the margin for a paragraph label.  The parameter
  295. n is measured in deci-inches.
  296. .CMD rj
  297. Use the "rj" command to cause text to be justified on the
  298. right, with a ragged left margin.  This is useful for
  299. "glitzy" work.
  300. .CMD rm
  301. The "rm n" command sets the right margin.  "n" is measured
  302. in deci-inches, with a default of 70 (7 inches).
  303. .CMD rt
  304. When "traps" (see "wh") are placed on a page, the
  305. traps are "sprung" as the location at which they are placed
  306. is passed.  A "sprung" trap will not be sprung a second time
  307. on the same page.  If you want to "reset" a trap for some
  308. reason (perhaps you used "gy" to move above it), use "rt"
  309. to reset \fIall\fP the traps on a page.  It is not possible
  310. to selectively reset traps.
  311. .CMD so
  312. Source an external file.  "so filename" will attempt to
  313. locate file "filename" and include it as though it were part
  314. of the current file.  Nested "so" commands are legal.  i.e.
  315. a file that is 'sourced' may in turn 'source' another file.
  316. .CMD sp
  317. Space down n lines by using "sp n".  The default for n is
  318. 1.
  319. .CMD ti
  320. Use "ti n" (default n=0) to indent \fIonly the next line\fP
  321. by n deci-inches.  (Think "temporary indent")
  322. .CMD tf
  323. A "title format" is a string that tells the tl command
  324. (below) how to interpret a given string.
  325. The current title format is used to interpolate strings
  326. using the "tl" command.
  327. The default title format is "l c r", meaning to interpret
  328. the string as having three fields, delimited by "/" (see
  329. "dc").  The first field will be left-justified, the second
  330. field will be centered, and the third
  331. field
  332. will be 
  333. right justified, all within printed fields computed from the
  334. number of fields specified in the title format.  
  335. To place the second field at the right of the center printed
  336. field, use "tf l r r".
  337. .CMD tl
  338. "tl string" is used to interpolate the string into the output, where the
  339. string is formatted according to the current 'title format'.  (See "tf".)
  340. .CMD tm
  341. Enter transparent print mode.  No further processing is done
  342. on text, but the text is copied directly from input to
  343. output until command "et" is encountered.  No font changes
  344. are executed, and \fBwroff\fP is likely to lose track of
  345. current positions on the page.  Use "tm" only \fIin
  346. extremis\fP.
  347. .CMD vr
  348. Draw a vertical line n dots (48 per inch) long starting at the current
  349. position.  Note that the positive direction is "down" the
  350. page.
  351. .CMD vs
  352. Adjust the vertical spacing between lines of print.  This is
  353. often useful to help "squeeze" a document onto a single
  354. page.  "vs -1" will squeeze lines closer together by 1
  355. vertical dot.  The default is to space by 12 dots.
  356. .CMD ul
  357. Use "ul n" to underline the next n lines.  (default n = 1)
  358. .CMD wh
  359. Set a trap.
  360. The "wh" command has an unusual syntax.  The command "wh n
  361. NAME" will execute macro "NAME" when the current vertical position
  362. on the page passes position n.  The syntax "wh -24 NP" would
  363. fire macro NP when the current vertical position was within
  364. 24 dots of the bottom of the page.  The macro must be
  365. defined elsewhere.  Beware of firing undefined macros.  A
  366. macro must be defined before the trap is fired, but need not
  367. be defined before the trap is set.  It is legal to change a
  368. macro definition without resetting a trap.
  369. .CMD .
  370. The ".." command is a comment marker.  Actually,
  371. the command should really be "CMDCHAR .", where the CMDCHAR
  372. is set by the "cc" command.  The rest of a line after ".."
  373. is taken as a comment.
  374. .in 10
  375. .bp
  376. .ce 
  377. \fBIn-Line Actions\fP
  378. .sp 3
  379. .PP
  380. \fBwroff\fP has the ability to deal with various fonts.  It can also 
  381. interpolate the value of a variable into the output stream, or call a
  382. macro from anywhere within a line.  
  383. All of this is accomplished with "In-Line Actions".  
  384. .PP
  385. In-Line Actions
  386. can be placed anywhere within a line of text.
  387. (This is opposed to \fIembedded commands\fP, which were
  388. discussed above, and which must appear on a line by
  389. themselves.)  The "backslash" symbol (\\) is used to signal
  390. \fBwroff\fP that an in-line action is present.
  391. .PP
  392. The possible in-line actions are listed below:
  393. .nf
  394. .sp 2
  395. command        \f|Action
  396. .in +2
  397. \\fc        \f|in-line font change
  398.         \f|  where c = B, I, M, T, U, P, 0, 1, 2, other
  399.         \f|  B -    \f|boldface
  400.         \f|  I -    \f|italicize
  401.         \f|  M -    \f|mountable
  402.         \f|  T -    \f|Courier (fixed)
  403.         \f|  U -    \f|toggle underline
  404.         \f|  P -    \f|return to previous
  405.         \f|  0 -    \f|default font (Times Roman)
  406.         \f|  1 -    \f|Presentation 18 point
  407.         \f|  2 -    \f|Helvetica 6 point
  408.         \f| other -    \f|interpolate "other" char
  409.  
  410. \\{XX}        \f|interpolate macro named XX
  411. \\(reg)        \f|interpolate the value of register reg
  412.         \f|  as an integer
  413. \\(regC)    \f|interpolate the value of register reg
  414.         \f|  as a character
  415. \\[expr]    \f|evaluate register expression -
  416.         \f|  do not interpolate, see \\(reg) above
  417. \\f|        \f|place "anchor" in text
  418. .sp 2
  419. .in -2
  420. .fi
  421.