home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume21 / ro / part03 < prev    next >
Text File  |  1990-02-05  |  50KB  |  1,637 lines

  1. Subject:  v21i005:  A text formatter with some nroff-like capabilities, Part03/03
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: tcamp@dukeac.UUCP (Ted A. Campbell)
  7. Posting-number: Volume 21, Issue 5
  8. Archive-name: ro/part03
  9.  
  10. #! /bin/sh
  11. #
  12. # This is a shell archive.  Save this into a file, edit it
  13. # and delete all lines above this comment.  Then give this
  14. # file to sh by executing the command "sh file".  The files
  15. # will be extracted into the current directory owned by
  16. # you with default permissions.
  17. #
  18. # The files contained herein are:
  19. #
  20. # -rw-r--r--  1 tcamp   users     36027 Nov 24 12:50 ro.doc
  21. # -rw-r--r--  1 tcamp   users      6666 Nov 10 12:57 ro.qrf
  22. # -rw-r--r--  1 tcamp   users      2829 Nov 24 12:50 tmac.m
  23. # -rw-r--r--  1 tcamp   users       663 Nov 24 12:50 test.doc
  24. #
  25. echo 'x - ro.doc'
  26. if test -f ro.doc; then echo 'shar: not overwriting ro.doc'; else
  27. sed 's/^X//' << '________This_Is_The_END________' > ro.doc
  28. X..    \"-------------------------------------------------------
  29. X..    \"
  30. X..    \"    ro.doc
  31. X..    \"
  32. X..    \"    documentation for the ro text formatter
  33. X..    \"
  34. X..    \"    NOTE:  This documentation is in "ro" 
  35. X..    \"    format and will not read correctly unless 
  36. X..    \"    it is processed by ro and postprocessed by 
  37. X..    \"    an ro filter.  To read the document on 
  38. X..    \"    a computer with the "more" pager, the 
  39. X..    \"    command line:
  40. X..    \"
  41. X..    \"        ro ro.doc | termnull | more
  42. X..    \" 
  43. X..    \"    should work.
  44. X..    \"
  45. X..    \"-------------------------------------------------------
  46. X.so tmac.m
  47. X.PH "'ro v1.00''\*(DT'"
  48. X.PF "''Page  #''"
  49. X.nr Pi 5
  50. X.nr Ps 1
  51. X.ls 1
  52. X.ll 65
  53. X.sp 2
  54. X.ce
  55. X\fBRO.DOC\fR
  56. X.sp 1
  57. X.ce
  58. X\fBDocumentation for the RO Text Formatter\fR
  59. X.sp 2
  60. X.ce
  61. X\fICopyright Information\fR:
  62. X.nf
  63. X
  64. X    ro, version 1.00:
  65. X
  66. X    Portions copyright (c) 1989 by Ted A. Campbell
  67. X        Bywater Software
  68. X        P. O. Box 4023
  69. X        Duke Station
  70. X        Durham, NC  27706
  71. X
  72. X    Contains portions of ROFF4, Version 1.61
  73. X                (c) 1985 by Konrad Kwok
  74. X        20 3rd Street, Section M
  75. X        Fariview Park,
  76. X        Hong Kong
  77. X
  78. X    Contains portions of ROFF4, Version 1.60
  79. X                (c) 1983, 4 by Ernest E. Bergmann
  80. X        Physics, Building #16
  81. X        Lehigh University
  82. X        Bethlehem, Pa. 18015
  83. X.fi
  84. X.P
  85. X\"ro" and its predecessor ROFF4 are based on
  86. Xthe ROFF text processor described in Brian W. Kernigan
  87. Xand P. J. Plauger's now-classic text \fISoftware Tools\fR 
  88. X(Reading, MA: Addison-Wesley, 1976).  
  89. X.P
  90. XPermission is hereby granted for all commercial and
  91. Xnon-commercial reproduction and distribution of this
  92. Xmaterial provided this notice is included.
  93. X.ne 4
  94. X.sp 2
  95. X.ce
  96. X\fIGeneral Description\fR
  97. X.P
  98. X\"ro" is a text formatter.  It is based on the 
  99. XCP/M ROFF4 formatter, 
  100. Xwhich was an expanded version of ROFF, itself based on the
  101. Xformatter in Kernigan and Plauger's \fISoftware Tools\fR.  
  102. XIt is written in the C programming language, and has 
  103. Xbeen successfully compiled on both Unix and DOS 
  104. Xcomputers.  
  105. X.P
  106. X\"ro" is designed to be downwardly-compatible 
  107. Xwith the Unix-based "nroff" text formatter, 
  108. Xand efforts have been made to make this 
  109. Xversion of ro as much like nroff as possible, 
  110. Xalthough many nroff features (like 
  111. Xwithholding traps) are not yet implemented 
  112. Xin ro.  
  113. X\"ro" adds some features to nroff, such as 
  114. Xdebug and verbose modes (using the "-x" and "-v" 
  115. Xflags, respectively), and a number of predefined 
  116. Xcommands which are usually implemented as macros 
  117. Xin nroff (e.g., .HE, which sets a three-part 
  118. Xpage header).  
  119. X.P
  120. XIncluded with this implementation of ro 
  121. Xis a package of macros named "tmac.m".  
  122. XThis implements some of the macros 
  123. Xfound in the popular nroff-based 
  124. X\"-mm" macro package.  
  125. X.ne 8
  126. X.sp 2
  127. X.ce 
  128. X\fIUsing ro\fR
  129. X.sp 1
  130. X\fIInvoking the Program\fR:
  131. X.P
  132. X\"ro" is command-line based, 
  133. Xand by default takes its input 
  134. Xfrom "standard input."  
  135. XAll output is sent to "standard output."  
  136. XThe command 
  137. X.sp
  138. X.ti 5
  139. X\ro 
  140. X.sp
  141. Xby itself would simply read input from 
  142. Xthe keyboard and output to the screen.  
  143. XUtilizing the command-line "<" and ">" 
  144. Xoperators in Unix and DOS, you can redirect 
  145. Xboth the standard input and the standard output.  
  146. XThus the command 
  147. X.sp 
  148. X.ti 5
  149. X\ro <infile >outfile
  150. X.sp
  151. Xwould take its input from "infile" and send output 
  152. Xto "outfile."  
  153. X.P
  154. XIt is possible to send output 
  155. Xdirectly to the printer utilizing 
  156. Xoutput redirection.  In Unix, the command 
  157. X.sp
  158. X.ti 5
  159. X\ro <infile >/dev/lp
  160. X.sp
  161. Xwould take its input from "infile" and 
  162. Xsend the output to "/dev/lp", 
  163. Xwhich is usually implemented as the line printer.  
  164. XSimilarly, in DOS, the command 
  165. X.sp
  166. X.ti 5
  167. X\ro <infile >prn
  168. X.sp
  169. Xwould send output to the "PRN" device, 
  170. Xwhich is normally attached to the printer.  
  171. X\fBHowever\fR, it is usually undesirable 
  172. Xto send output directly to a printer 
  173. X(or the screen, for that matter), 
  174. Xsince ro output will likely 
  175. Xinclude unprocessed printer escape codes.  
  176. XFor this reason, it is deirable to use an 
  177. Xoutput "post-processor" (see below 
  178. Xunder \fIUsing a Post-Processor\fR).  
  179. X.P
  180. X\"ro" can also take its input from files named 
  181. Xdirectly on the command line (without the 
  182. X\"<" operator).  The command 
  183. X.sp
  184. X.ti 5
  185. X\ro infile
  186. X.sp
  187. Xwould read input directly from "filename", 
  188. Xand the command 
  189. X.sp 
  190. X.ti 5
  191. X\ro file1 file2 file3
  192. X.sp
  193. Xwould read input from files "file1", 
  194. X\"file2", and "file3" successively.  
  195. XNote that input must be from named files 
  196. X(and not from standard input) 
  197. Xif you wish to utilize the "-s" flag 
  198. Xoption (described below).  
  199. X.ne 4
  200. X.sp 2
  201. X\fICommand-Line Flags\fR
  202. X.P
  203. X\"ro" utilizes a number of command-line flags 
  204. Xto control the program.  
  205. XAll flags are processed before text input is received.  
  206. X.P
  207. XThe \fB-s\fR flag, causes the formatter to stop (pause)
  208. Xat the start of each page of output; a tone at the
  209. Xconsole is sounded and the program
  210. Xwaits until the RETURN key is pressed.  It
  211. Xis essential for printers that are fed single sheets
  212. Xat a time!
  213. X\fBPlease note\fR that to utilize this feature, 
  214. Xyou must name files directly on the command 
  215. Xline.  (This is because the key-press to resume 
  216. Xprinting must itself come from standard input.)  
  217. X.P
  218. XThe \fB-o[page or range]\fR flag 
  219. Xis used to selectively generate output of ONLY certain
  220. Xpages.  It is useful to retype pages that got "eaten"
  221. Xby the printer (Henry Harpending's aptly put language).
  222. XTo retype only page 23, say, make the option: -o23
  223. XTo retype pages 23 through 29 use: -o23-29
  224. XTo retype pages 23 to the end use: -23-
  225. XThese options changes the values of the internal
  226. Xvariables, FIRSTPAGE and LASTPAGE which originally
  227. Xhave the values of 1 and 30000, respectively.  
  228. X.P
  229. XThe comamnd-line flag \fB-f\fR will introduce a formfeed (0CH)
  230. Xinto the output stream at the bottom of every page.  
  231. XThis is usefull, e.g., if you want to output in compressed 
  232. Xpitch where the end of the printed page might not 
  233. Xcorrrespond to the end of the physical page.  
  234. X.P
  235. XThe flag \fB-v\fR turns on "verbose" mode.  
  236. XIn this mode, some chit-chatty messages are 
  237. Xprinted to "standard error" (almost always 
  238. Xthe console), including some rather important 
  239. Xerror messages.  Normally, only fatal error 
  240. Xmessages are printed when verbose mode is not on 
  241. X(because ro is expected 
  242. Xto do much of its work in the background).  
  243. X.P
  244. XThe option \fB-x\fR turns on the "debug" flag so as to
  245. Xprint out lots of diagnostics to the STDERR [console].
  246. XProbably only useful for those who are trying to
  247. Xtrace the operation of the formatter for elusive
  248. X\"bugs". 
  249. XSpecifying the "-x" flag will also turn on 
  250. Xthe "verbose" mode (but not \fIvice versa\fR).  
  251. X.ne 4
  252. X.sp 2
  253. X\fIDefault Values\fR
  254. X.P
  255. XUsing ro, you can make nice printouts of a file,
  256. Xwith as little or as much help from the program as you want,
  257. Xdepending on the commands.  There are default values for all
  258. Xparameters, so if you don't put any commands in at all, your
  259. Xfile will come out with filled, right-justified lines.  The
  260. Xdefault line-length is 65 characters; the default page-
  261. Xlength is 66 lines per page.  "Filled lines" means that as
  262. Xmany input words as possible are packed onto a line before
  263. Xit is printed; "non-filled" lines go through the formatter
  264. Xw/o rearrangement.  "Adjusted" or "right-justified" simply means that
  265. Xspaces are added between words to make all the right margins
  266. Xline up nicely.  To change a parameter, use the appropriate
  267. Xcommands below. All commands have the form of a period
  268. Xfollowed by two letters. A command line should have nothing
  269. Xon it but the command and its arguments (if any); any text
  270. Xwould be lost. 
  271. X.ne 4
  272. X.sp 2
  273. X\fIUsing a Postprocessor\fR
  274. X.P
  275. X\"ro" does not handle printer-specific control codes itself; 
  276. Xinstead, it sends out simple (but consistent) escape 
  277. Xsequences which have to be "post-processed" by another program 
  278. Xto fit a particular terminal or printer.  
  279. XThree example post-processors are provided 
  280. Xwith ro:  
  281. X.sp
  282. X.nf
  283. X    termnull     strips out all printer codes
  284. X    termansi    prepares sequences for an ANSI-
  285. X            compatible terminal
  286. X    termnx10    prepares sequences for the Star 
  287. X            NX10 printer
  288. X.fi
  289. X.sp
  290. XAll of these postprocessors take their input 
  291. Xfrom standard input, and send their output 
  292. Xto standard output.  
  293. X.P
  294. XYou can use the "|" ("pipe") operator 
  295. Xto send the output from ro directly to 
  296. Xa postprocessor, and you can use "|" again 
  297. Xto send the post-processor's output to 
  298. Xa print spooler, pager, or other program.  
  299. XHere are some useful examples:  The command
  300. X.sp
  301. X.ti +5
  302. X\ro filename | termnull | more
  303. X.sp
  304. Xinvoles ro with input from "filename", 
  305. Xpipes its output to termnull, where all 
  306. Xprinter sequences are stripped away, 
  307. Xand then sends its output to the "more"
  308. Xpager.  Utilizing this sequence, one 
  309. Xcould preview "filename" on any terminal, 
  310. Xalthough no printer-specific sequences would 
  311. Xbe shown.  For ANSI-compatible terminals 
  312. X(including DOS computers which have ANSI.SYS 
  313. Xinstalled), the sequence
  314. X.sp
  315. X.ti +5
  316. X\ro filename | termansi | more
  317. X.sp
  318. Xwould do the same as the previous command, 
  319. Xexcept that boldface would appear 
  320. Xin bold, and italics would appear underlined 
  321. Xin the output.  
  322. XThe Unix sequence
  323. X.sp 
  324. X.ti +5
  325. X\ro filename | termnx10 | lp
  326. X.sp
  327. Xwould take input from "filename", 
  328. Xset up sequences for the Star NX10 
  329. Xprinter, and send the output 
  330. Xto the "lp" print spooler.  
  331. XSimilarly, under DOS,
  332. X.sp 
  333. X.ti +5
  334. X\ro filename | termnull >prn
  335. X.sp 
  336. Xwould take input from "filename",
  337. Xstrip out all printer codes, and 
  338. Xsend the output to the PRN device 
  339. X(normally attached to the printer).  
  340. X.P
  341. XThe escape codes sent out by ro are simple, and are 
  342. Xlisted at the end of this document.  
  343. XWith these and the source code to termnx10 (included), 
  344. Xit should 
  345. Xbe relatively easy to write a post-processor 
  346. Xfor almost any terminal or device.  
  347. X.ne 8
  348. X.sp 2
  349. X.ce
  350. X\fIInput to ro\fR
  351. X.sp 1
  352. X\fIInput Text\fR
  353. X.P
  354. X\"ro" generally reads input until it can fill out 
  355. Xa complete line of text (specfied by the "line length" 
  356. Xvariable, set by the command .ll).  
  357. XBy default, it then "adjusts" or justifies these 
  358. Xinput line when putting them out.  
  359. XBoth the "filling" and the "adjustment" of lines 
  360. Xcan be toggled on and off (see the commands 
  361. Xdescribed below, .fi, .nf, .ad, .na).  
  362. X.P
  363. XExtra space will separate text sentences.  The sentence
  364. Xis recognized by a trailing ':',';','!','?', or a '.'.  For
  365. Xthe '.' there is the additional requirement that either two
  366. Xor more spaces must spaces must follow it, or that it is at the
  367. Xend of the source line.
  368. X.ne 4
  369. X.sp 2
  370. X\fIInput Commands and Their Arguments\fR
  371. X.P
  372. X\"ro" is controlled internally by commands 
  373. Xthat are identified by a period ('.') in the 
  374. Xfirst place on a line.  
  375. XBe carefull:  if you inadvertently place 
  376. Xa period in the first place in a line, 
  377. X\"ro" will try to interpret it 
  378. Xas a command.  
  379. X\"ro" commands are either one or two letters 
  380. Xin length, and are all case-sensitive, 
  381. Xi.e., the command 
  382. X.sp 
  383. X.ti +5
  384. X .In
  385. X.sp
  386. Xis different from the command
  387. X.sp 
  388. X.ti +5
  389. X .in
  390. X.sp
  391. Xand so on.  
  392. XBy convention, built-in commands are lower-case, 
  393. Xand macros (see below) are upper-case; 
  394. Xhowever, this is not a rule, and we have elected 
  395. Xto place all non-nroff compatible commands 
  396. Xin upper case, since this is how they appear 
  397. Xin nroff implementations.  
  398. X.P
  399. XA command argument can be either ABSOLUTE or RELATIVE : 
  400. X.br
  401. X.nf
  402. X.sp
  403. X .in     5       sets the indent value to 5 spaces
  404. X .in     +5      sets the indent value to the CURRENT value+5
  405. X .ls     -1      sets the line spacing to the current value-1
  406. X.fi
  407. X.P
  408. XAlso,  all commands have a minimum and maximum value
  409. Xthat will weed out any odd command settings (like setting
  410. Xthe line spacing to zero, for example. It won't let you do
  411. Xthat, but it could be changed (by recompiling 
  412. Xthe program).
  413. X.P
  414. XSome commands cause a "break", which is noted in the
  415. Xtable below.  Before such a command goes into effect, the
  416. Xcurrent line of text is put out, whether it is completely
  417. Xfilled or not. (this is what happens at the end of a
  418. Xparagraph, for example.)  A line beginning with spaces or a
  419. Xtab will cause a break, and will be indented by that many
  420. Xspaces (or tabs) regardless of the indent value at that time
  421. X(this is a "temporary indent", which can also be set
  422. Xexplicitly).  An all blank line also causes a break.  If you
  423. Xfind that some lines that are indented strangely, and it's
  424. Xnot obvious WHY, look at which commands are causing a break,
  425. Xand which aren't. For instance:
  426. X.sp
  427. X.nf
  428. X .fi
  429. X .ti 0
  430. X this is a line of text
  431. X .in 8
  432. X                                        <- blank line
  433. X more text for the machine to play with
  434. X.fi
  435. X.P
  436. XAt first glance it seems obvious that the line "this is a
  437. Xline of text" will be indented zero spaces, but it won't -
  438. Xit will be indented 8. The indent command does NOT cause a
  439. Xbreak (although the .ti does) so it will not cause the line
  440. Xto be put out before setting the indent value to 8.  Then,
  441. Xwhen the blank line is encountered, it will cause a break -
  442. Xand "this is a line of text" will be indented incorrectly.
  443. XThe above example will give the following lines.
  444. X.sp
  445. X.fi
  446. X.ti +5
  447. Xthis is a line of text
  448. X.sp
  449. X.ti +5
  450. Xmore text for the machine to play with
  451. X.br
  452. X.in
  453. X.P
  454. XIt is worthwhile considering placing a ".br", the
  455. Xbreak command, before each use of ".in".  
  456. X.P
  457. XCertain system variables are "stacked" to enable
  458. Xreversion to earlier environments instead of "hardcoded"
  459. Xdefaults.  For example:
  460. X.sp
  461. X.nf
  462. X .ls 1
  463. X  .
  464. X  .
  465. X .ls
  466. X.sp
  467. X.fi
  468. XThe first command will produce single line spacing (which is
  469. Xthe default, but which may have been set otherwise at the
  470. Xbeginning of the manuscript).  The second command causes
  471. Xresumption of the original line spacing (either the default
  472. Xor whatever had been chosen previously).  Stacked variables
  473. Xinclude: linespacing, indent column, line length,
  474. Xtranslation flag character, page length, top and bottom
  475. Xmargin sizes, unexpandable space character, output width,
  476. Xand tabsize.
  477. X.nf
  478. X.ne 8
  479. X.sp 4
  480. X*********************** Table of Commands *********************
  481. X
  482. X Command       Break?    Default stacked Function
  483. X -------       ------    ------- ------- ---------
  484. X
  485. XA. nroff-compatible commands (* denotes compatibility limitation)
  486. X   --------------------------------------------------------------
  487. X
  488. X .. string       no                      string is "mere" comment
  489. X                                         (or end of macro definition)
  490. X
  491. X .ad             no      initially on    turn right justification 
  492. X                                         on (use .na to turn off); 
  493. X                                         only applicable if 
  494. X                                         "filling" is also on.
  495. X
  496. X .bp n           yes     n =  +1         begin page numbered n
  497. X
  498. X .br             yes                     cause a break (this
  499. X                                         line is not justified)
  500. X
  501. X .ce n           yes     n = 1           center next n lines
  502. X
  503. X .di name (*)    no      junk.$$$        diversion file
  504. X                                         (see "PREPROCESSOR")
  505. X .de name        no                      define (multiline)
  506. X                                         macro ("PREPROCESSOR")
  507. X
  508. X .ds name string no      null string     define string replace-
  509. X                                          ment ("PREPROCESSOR")
  510. X
  511. X .em                                     end macro
  512. X                                         (see "PREPROCESSOR")
  513. X
  514. X .ex             no                      immediate abort back to
  515. X                                         system
  516. X
  517. X .fi             yes                     start filling lines
  518. X
  519. X .ig string      no                      "ignore" string (see ..)
  520. X
  521. X .in n           no      n = 10  Yes     set indent value to n
  522. X
  523. X .ll n           no      n = 65  Yes     set line length (right 
  524. X                                         margin)
  525. X
  526. X .ls n           no      n = 1   Yes     set line spacing to n
  527. X
  528. X .na             no      initially on    turn right justification 
  529. X                                         off (use .ad to turn on)
  530. X
  531. X .ne n           no/yes  n = 2           "need" n lines; if have
  532. X                                         them no action; else
  533. X                                         begins new page
  534. X
  535. X .nf             yes                     stop filling lines
  536. X
  537. X .nr name n      no      n=0     No      create or modify 
  538. X                                         register variable
  539. X                                         (see "PREPROCESSOR")
  540. X
  541. X .pl n           no      n = 66  Yes     sets page length to n
  542. X
  543. X .pm                                     print macros defined 
  544. X                                         (for debugging)
  545. X
  546. X .po         no      0       No      sets page offset (spaces 
  547. X                                         at left margin of every 
  548. X                                         line.  
  549. X
  550. X .so filename    no      ignored Yes     reads named file into
  551. X                                         input stream; cannot be
  552. X                                         invoked from keyboard
  553. X                                         input.
  554. X
  555. X .sp n           yes     n = 1           space down n lines
  556. X
  557. X .ta n           no      n = 8   Yes     sets value of tab space
  558. X
  559. X .tc c           no      ~       Yes     set translation flag
  560. X                                         character, see .tr
  561. X
  562. X .ti n           yes     n = 0           set temp. indent of n
  563. X
  564. X .tm string                              send message to terminal 
  565. X                                         (console); like a comment
  566. X                                         but displayed to
  567. X                                         operator during run.
  568. X
  569. X
  570. X.ne 8
  571. XB. non-nroff-compatible commands (must be upper-case)
  572. X   --------------------------------------------------
  573. X
  574. X .BJ             yes                     break with right
  575. X                                         justification (current
  576. X                                         line only)
  577. X
  578. X .DB n           no      n = 0(NO)       set debug flag 1 for
  579. X                                         diagnostics
  580. X
  581. X .EF /../../../  no      blanks          even footer titling
  582. X
  583. X .EH /../../../  no      blanks          even header titling
  584. X
  585. X .FF n           no      n = 1(yes)      initially, formfeeds
  586. X                                         are "off". Can turn
  587. X                                         them on.  Each page
  588. X                                         then terminated with
  589. X                                         one formfeed.
  590. X
  591. X .FO /../../../  no      empty           sets both even and odd
  592. X                                         page footers
  593. X
  594. X .HE /../../../  no      empty           sets both even and odd
  595. X                                         page headers
  596. X
  597. X .M1             no      n = 2   Yes     set topmost margin to n
  598. X
  599. X .M2             no      n = 2   Yes     set 2nd top margin to n
  600. X                                         lines
  601. X
  602. X .M3             no      n = 2   Yes     1st bottom margin to n
  603. X                                         lines
  604. X
  605. X .M4             no      n = 2   Yes     bottom-most margin to n
  606. X                                         lines
  607. X
  608. X .OF /../../../  no      empty           odd page footer title
  609. X
  610. X .OH /../../../  no      empty           odd page header title
  611. X
  612. X .SC c           no      blank   Yes     space character; the
  613. X                                         visible character
  614. X                                         that will be trans-
  615. X                                         literated to unexpanded
  616. X                                         blank.
  617. X
  618. X .SR                                     show registers defined
  619. X
  620. X .SS                                     show strings defined
  621. X
  622. X .ST n           no      n = 1   (yes)   stop (pause) at each page
  623. X                                         start; initially off;
  624. X                                         may also be enabled by
  625. X                                         the -s option.
  626. X
  627. X.ne 27
  628. X.sp 2
  629. XHere's what the page parameters look like:
  630. X
  631. X        |<--------output width ------------------------>|
  632. X
  633. X|- po --| ( "po = page offset")
  634. X_       _________________________________________________
  635. X|       |       top margin(m1) - (includes header)      |
  636. X|       |-----------------------------------------------|
  637. X|       |               top margin 2                    |
  638. X|       |-----------------------------------------------|
  639. XP       |       :                               :       |
  640. XA       |       :<-indent                       :       |
  641. XG       |       :                               :       |
  642. XE       |       :lots and lots of silly text and:       |
  643. XL       |       :other garbage. Get the picture?:       |
  644. XE       |          :This is a temp.  indentation:       |
  645. XN       |       :                               :       |
  646. XG       |       :               right margin -> :       |
  647. XT       |       :                               :       |
  648. XH       |       :                               :       |
  649. X|       |-----------------------------------------------|
  650. X|       |               margin 3                        |
  651. X|       |-----------------------------------------------|
  652. X|       |  margin 4 - (includes footer,perhaps ff)      |
  653. X-       -------------------------------------------------
  654. X
  655. X.fi
  656. XMinimum acceptable values for M1, M2, M3, and M4: if M1 is set
  657. Xto zero, no header will be shown (even if one was declared).
  658. XSimilarly, if M4 is set to zero, no footer will be displayed.
  659. X.P
  660. XTo change the default for any parameter, you must alter ro.h
  661. Xand recompile.
  662. X.ne 4
  663. X.sp 2
  664. X\fISome Notes on Input Commands\fR
  665. X.P
  666. X\fB".ce"\fR.  
  667. XIf you want to center lots of lines, but don't
  668. Xwant to count them, do something like this:
  669. X.sp
  670. X.nf
  671. X .ce     1000
  672. X lots and
  673. X lots of words to
  674. X be centered
  675. X .ce 0
  676. X.sp
  677. Xwill give the lines:
  678. X.ce 1000
  679. Xlots and
  680. Xlots of words to
  681. Xbe centered
  682. X.ce 0
  683. X.fi
  684. X.sp
  685. X.P
  686. X\fB".ti"\fR.  
  687. XA new paragraph may be caused by using the temporary indent
  688. Xcommand, like
  689. X.sp
  690. X.nf
  691. X .ti +5
  692. X.fi
  693. X.sp   
  694. Xor by simply beginning the paragraph with a tab.
  695. X.ne 4
  696. X.sp 2
  697. X\fIHeader and Footer Commands\fR
  698. X.P
  699. XA page number can be incorporated into any header or
  700. Xfooter by putting a "#" in the title where you want the number
  701. Xto go:
  702. X.nf
  703. X .he     //This is a witty header title for page #//
  704. X.fi
  705. XEach time this is printed at the top of a page, the current
  706. Xpage number will be substituted for the "#".
  707. XEach footer and header are ".in 0", even if text is
  708. Xindented.
  709. X.P
  710. XHeaders and footers are in three parts.  These parts are left
  711. Xjustified, centered, and right justifed.  Any of these three
  712. Xparts may be left out.  One may pick the
  713. Xheaders and footers separately for even and odd pages.  For
  714. Xexample, one could place even and odd page numbers at the
  715. Xbottom outside of each page by:
  716. X.sp
  717. X.nf
  718. X .EF /Page #///
  719. X .OF ///Page #/
  720. X.fi
  721. X.P
  722. XAny printable character, here the '/', can be used to
  723. Xdelimit the three strings that make up the titles, so long
  724. Xas it is not the backslash character ('\\') and is
  725. Xnot present in any of the three strings.
  726. X.P
  727. XThe program can be made to wait for the operator to
  728. Xload single sheets of paper by the -s option and/or by the
  729. Xcommand: .ST
  730. X.P
  731. XIf you want to send the output to a file, and don't want the
  732. Xpage breaks in there set margins 1-4 to zero.
  733. X.ne 4
  734. X.sp 2
  735. X\fIPrinter Control Input\fR
  736. X.P
  737. XAt present, ro recognizes only five sequences
  738. Xfor printer control.  These, with their input 
  739. Xsymbols, are:
  740. X.sp 
  741. X.nf
  742. X    \\fR    Switch to Roman Font
  743. X
  744. X     \\fI    Switch to \fIItalic\fR Font
  745. X
  746. X    \\fB    Switch to \fBBold\fR Font
  747. X
  748. X    \\u    Up \uone-half\d line
  749. X
  750. X    \\d    Down \done-half\u line
  751. X.fi
  752. X.sp
  753. XThe "Roman" (or perhaps "Regular") font turns off 
  754. Xboth Italic and Bold fonts.  The \\u and \\d 
  755. Xcommands are useful in depicting superscripts 
  756. Xand subscripts.  
  757. X.P
  758. XFonts can also be switched using the ".ft" 
  759. Xinput command.  For example, the command 
  760. X.sp
  761. X.ti +5
  762. X .ft R
  763. X.sp
  764. Xwould set the Roman font for subsequent input.  
  765. X.ne 8
  766. X.sp 2
  767. X.ce
  768. X\fIThe Preprocessor\fR
  769. X.sp 1
  770. X\fIString Definitions\fR
  771. X.P
  772. XIn the following we describe the advanced macro
  773. Xpreprocessing features of this formatter which provide users
  774. Xwith labor saving tools but which are probably not necessary
  775. Xat first.  The beginning user may be able to achieve most
  776. Xgoals without the "preprocessing", but by using an editor
  777. Xmore then otherwise.  The more advanced user will begin to
  778. Xappreciate these features more.
  779. X.P
  780. XFor example, in:
  781. X.sp
  782. XToday, \\*(da, is special.
  783. X.sp
  784. Xthe block, "\\*(da", would be replaced as this sentence is
  785. Xbeing input.  If a prior string definition of the form:
  786. X
  787. X .ds da "January 1, 1983"
  788. X.ds da "January 1, 1983"
  789. X
  790. Xhad been processed previously then the example, after text
  791. Xsubstitution, would become:
  792. X.sp
  793. X.ti +5
  794. XToday, \*(da, is special.
  795. X.P
  796. XThe string definition command, .ds, expects two arguments:  
  797. Xa name of one or two characters (case is significant), 
  798. Xand then either a single word (no whitespace) or 
  799. Xa string delimited by double quotation marks ("...").   
  800. XA single-letter string name is expanded on output 
  801. Xwhen the letter is preceded by "\\*".  
  802. XFor example, one could define a string N using 
  803. X.sp 
  804. X.ti +5
  805. X .ds N "Alfred E. Newman"
  806. X.sp
  807. Xand then whenever the sequence \\*N appears 
  808. Xin the input text, the string "\*N" would 
  809. Xbe output.  
  810. XA two-letter string name is expanded on output 
  811. Xwhen it is preceded by "\\*(".  
  812. XThus, in the example above, the string "da" 
  813. Xis defined, and output with "\\*(da", 
  814. Xyielding "\*(da".  Did it work?  
  815. X.ne 4
  816. X.sp 2
  817. X\fINumber Registers\fR
  818. X.P
  819. XSimilar to string definitions are number register
  820. Xvariables, which are created and modified with the \fB.nr\fR
  821. Xcommand.  Variables are useful for enumeration such as
  822. Xequation numbering:
  823. X.sp
  824. X.ti +5
  825. X .nr eq 1
  826. X.nr eq 1
  827. X.sp
  828. Xwould create a register named "eq" with the current value
  829. Xof 1.  The the text might use it with, say:
  830. X.sp
  831. X.ti +5
  832. Xx = y+1          \\n(eq
  833. X.sp
  834. Xwhich would be converted on input into:
  835. X.sp
  836. X.ti +5
  837. Xx = y+1          \n(eq
  838. X.sp
  839. XA subsequent instruction:
  840. X.sp
  841. X.ti +5
  842. X .nr eq +1
  843. X.nr eq +1
  844. X.sp
  845. Xwould take the current value of "eq" and increase it by 1
  846. X(so that it would now be 2 in our example:
  847. X.sp
  848. X.ti +5
  849. Xa = b+c          \\n(eq
  850. X.sp
  851. Xwould become:
  852. X.sp
  853. X.ti +5
  854. Xa = b+c          \n(eq
  855. X.P
  856. XNumber Register values are expanded on output 
  857. Xin a manner similar to string variables, except 
  858. Xthat "n" (must be lower-case) is used in place 
  859. Xof "*".  Thus the register variable "P" would 
  860. Xbe expanded by "\\nP", and the register "Pi" 
  861. Xwould be expanded by "\\n(Pi", just as "eq" 
  862. Xis expanded by "\\n(eq" above.   
  863. X.P
  864. XThere is a special, reserved insertion, \#\, which
  865. Xwill provide the current page number.  It should prove
  866. Xuseful in setting up tables of contents (see "diversions",
  867. Xbelow).  
  868. X.P
  869. XSince we have defined a special register name, '#',
  870. Xwe should comment on what happens if you create a register
  871. Xinstruction with that name, such as:
  872. X.sp
  873. X.ti +5
  874. X .nr # +1
  875. X.sp
  876. XYou will be changing the value of the page number of the
  877. XFOLLOWING pages.  This is useful for leaving gaps in the 
  878. Xpagination for later inclusion of full page illustrations.
  879. XThis feature is demonstrated (tested) in the file, MARGINS.
  880. XI wish to thank Henry Harpending for suggesting this.
  881. X.P
  882. X\"ro" includes some predefined number registers 
  883. Xthat are available to users.  These are:  
  884. X.sp
  885. X.nf
  886. X    dy    current day of the month
  887. X    mo    current month as integer (1-12)
  888. X    yr    current year -1900
  889. X.fi
  890. X.sp
  891. XThus, a user could say, 
  892. X\"Today's date is \\n(dy/\\n(mo/\\n(yr", 
  893. Xand this would be ouput as 
  894. X\"Today's date is \n(dy/\n(mo/\n(yr".  
  895. X.ne 4
  896. X.sp 2
  897. X\fIUsing Backslashes\fR
  898. X.P
  899. XThe backslash character has other properties.  
  900. XIt can be placed into the input by repeating
  901. Xit, namely, "\\\\" becomes "\\".  (useful for delaying
  902. Xsubstitutions).  For example, defining:
  903. X.sp
  904. X.ti +5
  905. X .ds EN "\\n(eq"
  906. X.ds EN "\\n(eq"
  907. X.sp
  908. Xwill identify "EN" with "\\n(eq" and so our equation
  909. Xexample above could have been:
  910. X.sp
  911. X.ti +5
  912. Xa = b + c          \*(EN
  913. X.sp
  914. XDelaying the evaluation of "eq" until EN is invoked
  915. X(instead of when it was defined) means that the proper
  916. Xnumbering of equations will occur instead of wrongly
  917. Xsupplying the value of "eq" from the time that EN was
  918. Xfirst created.
  919. XUtilizing this technique, 
  920. Xthe "tmac.m" package defines a macro for the 
  921. Xcurrent date, which is:  
  922. X.sp
  923. X.ti +5
  924. X .ds DT "19\\\\n(yr/\\\\n(mo/\\\\n(dy"
  925. X.ds DT "19\\n(yr/\\n(mo/\\n(dy"
  926. X.sp
  927. XThis would be expanded using "\\*(DT", 
  928. Xwhich would produce "\*(DT" (did it work?).  
  929. X.ne 4
  930. X.sp 2
  931. X\fIMacro Definitions\fR
  932. X.P
  933. X"Macro" definitions are used when we wish to
  934. Xidentify several lines with an insertion.  Such definitions
  935. Xare created with the .de ["define macro"] and completed with
  936. Xthe .. ["end macro"] commands.  For example, we might wish
  937. Xto use the following sequence over and over again at the
  938. Xstart of paragraphs:
  939. X.sp
  940. X.nf
  941. X .sp 1
  942. X .ne 2
  943. X .ti +5
  944. X.fi
  945. X.P
  946. Xto separate the paragraphs by blank lines, keep them from
  947. Xstarting excessively close to the bottom of the page, and
  948. Xindenting them 5 spaces to the right of the current left
  949. Xmargin.  
  950. X.nf
  951. X.sp
  952. X .de P
  953. X .sp 1
  954. X .ne 2
  955. X .ti +5
  956. X ..
  957. X.fi
  958. X.P
  959. XSubsequently, whenever we wished to start a paragraph we
  960. Xwould create a command line:
  961. X.sp
  962. X.ti +5
  963. X .P
  964. X.sp
  965. Xinstead of more tediously creating every time the three
  966. Xcommands we mentioned above.
  967. X.P
  968. XThe names of all macros, strings, and number
  969. Xregisters are "case sensitive".  That is to say that
  970. Xcapitalization and/or lower case are distinguished and, say,
  971. X.sp 
  972. X.ti +5
  973. X .p
  974. X.sp
  975. XWould not be recognized as the same as the sample macro we
  976. Xjust defined.  
  977. XThe macro is read until a line beginning with ".em" (end macro) 
  978. Xor simply ".." is reached.  
  979. X.P
  980. XA macro command may contain parameters(s). For example
  981. X.sp
  982. X.nf
  983. X .de He
  984. X $0
  985. X ..
  986. X.de He
  987. X$0
  988. X..
  989. X.fi
  990. X.sp
  991. Xdefines a simple macro for printing a heading.  
  992. XWhen the line ".He Heading" 
  993. Xappears at the beginning of a line, the word "Heading" 
  994. Xwill be printed, i.e.:
  995. X.sp
  996. X.He Heading
  997. X.P
  998. XThe maximum number of parameters for a macro is 10 ($0-$9). 
  999. XThe parameter(s) must be on the same line of the macro call. 
  1000. XThe parameters are separate by a non-alphanumeric character 
  1001. Xexcept '+' and '-' which
  1002. Xappear as the first character of the parameter line. If the 
  1003. Xfirst character is a alphanumeric character, then white space 
  1004. Xwill be assumed as the delimiter. An example can be found 
  1005. Xabove. If the require parameter(s) is/are not defined by the 
  1006. Xmacro call, then the parameter(s) will be treated as null 
  1007. Xstring.
  1008. X.ne 4
  1009. X.sp 2
  1010. X\fIDiversions\fR
  1011. X.P
  1012. XThere is another object formed and used somewhat
  1013. Xlike a macro;  it is called a "diversion (file)" and is
  1014. Xuseful for making lists such as references [notes] and
  1015. Xtables of contents.  A diversion is created or continued
  1016. Xwith the command: \fB.di\fR [diversion].  
  1017. XIt is ended with the same command 
  1018. X(the command to begin the diversion should 
  1019. Xhave a one- or two-letter name argument; 
  1020. Xthe command to end it should have no argument.  
  1021. XA diversion can grow to be quite large and is, in "ro", a
  1022. Xdisk file.  To "regurgitate" the diversion file, its 
  1023. Xname must be entered as a command at the beginning of a line.  
  1024. X.P
  1025. XFor example, the "tmac.m" macros define .FS 
  1026. X(start footnote -- actually and endnote) 
  1027. Xas including the command ".di no".  
  1028. XInternally, at this point, ro creates a disk file 
  1029. Xnamed "no_ro.div" and begins placing all input 
  1030. Xin this file.  
  1031. XThe macro ".FE" (footnote end) includes the command ".di".  
  1032. XAt this point the diversion to "no_ro.div" is 
  1033. Xceased, and input is again read as normal.  
  1034. XFor each .FS - .FE pair, this sequence is 
  1035. Xrepeated, so that the diversion file collects 
  1036. Xall the footnotes.  
  1037. XFinally, the macro ".PN" (printout notes) 
  1038. Xincludes the command ".no" which ro 
  1039. Xrecognizes as the signal to send out all 
  1040. Xthe material collected in the diversion file.  
  1041. X\".PN" is placed last in the text file, so that 
  1042. Xthe notes follow after the text.  
  1043. X.ne 8
  1044. X.sp 2
  1045. X.ce
  1046. X\fIUsing the tmac.m Macro Package\fR
  1047. X.P
  1048. XThe file "tmac.m" included with this distribution 
  1049. Xdefines some macros for use in processing documents.  
  1050. XThese are roughly equivalent to the nroff "-mm" macros
  1051. Xof similar names.  
  1052. XYou can very easily customize this package and add 
  1053. Xto it for your own uses.  
  1054. X.P
  1055. X\fIParagraph Control\fR.  
  1056. XUsing the tmac.m macros, the command 
  1057. X.sp 
  1058. X.ti +5
  1059. X .P
  1060. X.sp
  1061. Xis used to begin a paragraph.  
  1062. XThere are two number registers associated with 
  1063. Xthis command:  
  1064. X.sp
  1065. X.ti +5
  1066. X.nf
  1067. X     Ps        paragraph spacing, and 
  1068. X.ti +5
  1069. X     Pi        paragraph indent.  
  1070. X.fi
  1071. X.sp
  1072. XEach time .P is called, "Ps" lines are skipped, and a 
  1073. Xtemporary indent of "Pi" characters is set.  
  1074. X.P
  1075. X\fIThe Date String\fR.  
  1076. XWith the tmac.m package, the current date 
  1077. Xis stored in the string "DT" and can 
  1078. Xtherefore be output at any point with \\*(DT.  
  1079. XThis yields "\*(DT", and is used in the page 
  1080. Xheader for this documentation (see at the top of this page).  
  1081. X.P
  1082. X\fIEndnote Control\fR.  
  1083. XAlthough ro does not currently support footnotes 
  1084. X(because it does not implement a withholding trap), 
  1085. Xthere are three macros and a string definition to 
  1086. Xsupport endnotes.  These are:  
  1087. X.sp
  1088. X.nf
  1089. X    \\*F    prints current note number, superscript
  1090. X    .FS    starts text of note
  1091. X    .FE    ends text of note
  1092. X    .PN    prints out all notes collected
  1093. X.fi
  1094. X.sp
  1095. XThe command ".FS" begins diversion to a separate file, 
  1096. Xso you must be careful to end the text of the note with 
  1097. Xthe ".FE" command.  Also, be sure to include the ".PN" 
  1098. Xcommand at the point where you want the notes to be 
  1099. Xprinted out (normally at the very end of the file).
  1100. X.P
  1101. X\fIFont Control\fR.  
  1102. XThe tmac.m package contains three macros 
  1103. Xconsistent with the "-mm" package for switching 
  1104. Xfonts.  These are:
  1105. X.sp
  1106. X.nf
  1107. X    .R    switch to Roman (regular) font
  1108. X    .I    switch to Italic font
  1109. X    .B    switch to Bold font
  1110. X.fi
  1111. X.P
  1112. X\fIPage Header and Footer Control\fR.  
  1113. XThe tmac.m package defines two macros 
  1114. Xconsistent with "-mm" which reset page 
  1115. Xheaders and footers:  
  1116. X.sp
  1117. X.nf
  1118. X    .PH    page header
  1119. X    .PF    page footer
  1120. X.fi
  1121. X.sp
  1122. XNote that the arguments to these must be three-part titles 
  1123. Xenclosed in double quotation marks, e.g., 
  1124. X.sp
  1125. X.fi
  1126. X    .PH "'left'center'right'"
  1127. X.sp
  1128. XThis differs from the usage of the built-in .HE 
  1129. Xand .FO commands.  
  1130. X.P
  1131. X\fIText and Block Macros\fR.  
  1132. XFinally, the tmac.m package defines macros 
  1133. Xnot found in "-mm" that I have found helpful 
  1134. Xin writing papers.  These are:  
  1135. X.sp
  1136. X.nf
  1137. X    .TA    begin double-spaced text segment
  1138. X    .TZ    end double-spaced text segment
  1139. X    .BA    begin single-spaced indented block
  1140. X    .BZ    end single-spaced indented block
  1141. X.fi
  1142. X.ne 8
  1143. X.sp 2
  1144. X.ce
  1145. X\fIro Output and Post-Processor Development\fR
  1146. X.P
  1147. XThe five sequences to control the printer are 
  1148. Xsen, on output, as the ESCAPE character (0x1b hex, 
  1149. X27 decimal) followed by a single ASCII character.  
  1150. XThese sequences are:  
  1151. X.sp
  1152. X.nf
  1153. X    ESCAPE    'R'    Set Roman Font
  1154. X
  1155. X    ESCAPE     'I'    Set Italic Font
  1156. X
  1157. X    ESCAPE  'B'    Set Bold Font
  1158. X
  1159. X    ESCAPE    'u'    Up One-Half Line
  1160. X
  1161. X    ESCAPE    'd'    Down One-Half Line
  1162. X.fi
  1163. X.sp
  1164. XAn ro postprocessor should intercept any 
  1165. XESCAPE character, then determine based 
  1166. Xon the next character following it what 
  1167. Xcodes to send out.  
  1168. X.P
  1169. XAs an example, the folowing is the entire 
  1170. Xtext of the "termnx10" postprocessor.  
  1171. XIt should be relatively easy to alter 
  1172. Xthe escape code sequences here to suit any 
  1173. Xprinter.  
  1174. X\fBPlease note\fR that in the version below 
  1175. Xwe have had to doule each backslash character 
  1176. Xso that it would print correctly when output 
  1177. Xby ro.  If you want to cut this program 
  1178. Xout of ro.doc to compile it, you'll need 
  1179. Xto convert each double backslash to a single one.  
  1180. X.sp
  1181. X.nf
  1182. X
  1183. X#include "stdio.h"
  1184. X#include "term.h"
  1185. X
  1186. Xchar progname[] = "termnx10";
  1187. X
  1188. Xmain()
  1189. X    {
  1190. X    register int c;
  1191. X
  1192. X    while( !feof( stdin ))
  1193. X        {
  1194. X        c = getchar();
  1195. X        switch( c )
  1196. X            {
  1197. X            case ESCAPE:
  1198. X                getpc();
  1199. X                break;
  1200. X            case EOF:
  1201. X                break;
  1202. X            default:
  1203. X                putchar( c );
  1204. X                break;
  1205. X            }
  1206. X        }
  1207. X    }
  1208. X
  1209. Xgetpc()
  1210. X    {
  1211. X    register int c;
  1212. X
  1213. X    c = getchar();
  1214. X    switch( c )
  1215. X        {
  1216. X        case ROMAN:
  1217. X            roman();
  1218. X            break;
  1219. X        case ITALIC:
  1220. X            italic();
  1221. X            break;
  1222. X        case BOLD:
  1223. X            bold();
  1224. X            break;
  1225. X        case HALFUP:
  1226. X            halfup();
  1227. X            break;
  1228. X        case HALFDOWN:
  1229. X            halfdown();
  1230. X            break;
  1231. X        default:
  1232. X            fprintf( stderr, "%s:  unrecognized output escape sequence ESC-0x%x \n", progname, c );
  1233. X            break;
  1234. X        }
  1235. X    }
  1236. X
  1237. Xroman()
  1238. X    {
  1239. X    printf( "\\0335\\033H" );
  1240. X    }
  1241. X
  1242. Xitalic()
  1243. X    {
  1244. X    printf( "\\0334" );
  1245. X    }
  1246. X
  1247. Xbold()
  1248. X    {
  1249. X    printf( "\\033G" );
  1250. X    }
  1251. X
  1252. Xhalfup()
  1253. X    {
  1254. X    printf( "\\033j\\022" );
  1255. X    }
  1256. X
  1257. Xhalfdown()
  1258. X    {
  1259. X    printf( "\033J\022" );
  1260. X    }
  1261. X
  1262. X--------------------------------------------
  1263. X
  1264. XHere's the included "term.h" file:
  1265. X
  1266. X--------------------------------------------
  1267. X
  1268. X#define    ESCAPE        0x1b
  1269. X
  1270. X/**    Single-character printer code designations ***/
  1271. X
  1272. X#define    ROMAN        'R'    /* Restore "roman" or "regular" font */
  1273. X                /* Should turn off Bold and Italic */
  1274. X#define    ITALIC        'I'    /* Switch to italics or underline */
  1275. X#define    BOLD        'B'    /* Switch to bold */
  1276. X#define    HALFUP        'u'    /* Half-line up */
  1277. X#define    HALFDOWN    'd'    /* Half-line down */
  1278. X
  1279. X.fi
  1280. X
  1281. ________This_Is_The_END________
  1282. if test `wc -l < ro.doc` -ne 1254; then
  1283.     echo 'shar: ro.doc was damaged during transit (should have been 1254 bytes)'
  1284. fi
  1285. fi        ; : end of overwriting check
  1286. echo 'x - ro.qrf'
  1287. if test -f ro.qrf; then echo 'shar: not overwriting ro.qrf'; else
  1288. sed 's/^X//' << '________This_Is_The_END________' > ro.qrf
  1289. X*********************** Table of Commands *********************
  1290. X
  1291. X Command       Break?    Default stacked Function
  1292. X -------       ------    ------- ------- ---------
  1293. X
  1294. XA. nroff-compatible commands (* denotes compatibility limitation)
  1295. X   --------------------------------------------------------------
  1296. X
  1297. X .. string       no                      string is "mere" comment
  1298. X                                         (or end of macro definition)
  1299. X
  1300. X .ad             no      initially on    turn right justification 
  1301. X                                         on (use .na to turn off); 
  1302. X                                         only applicable if 
  1303. X                                         "filling" is also on.
  1304. X
  1305. X .bp n           yes     n =  +1         begin page numbered n
  1306. X
  1307. X .br             yes                     cause a break (this
  1308. X                                         line is not justified)
  1309. X
  1310. X .ce n           yes     n = 1           center next n lines
  1311. X
  1312. X .di name (*)    no      JUNK.$$$        diversion file
  1313. X                                         (see "PREPROCESSOR")
  1314. X .de name        no                      define (multiline)
  1315. X                                         macro ("PREPROCESSOR")
  1316. X
  1317. X .ds /../../../  no      null string     define string replace-
  1318. X                                          ment ("PREPROCESSOR")
  1319. X
  1320. X .ed (*)         no                      end diversion
  1321. X                                         (see "PREPROCESSOR")
  1322. X
  1323. X .em                                     end macro
  1324. X                                         (see "PREPROCESSOR")
  1325. X
  1326. X .ex             no                      immediate abort back to
  1327. X                                         system
  1328. X
  1329. X .fi             yes                     start filling lines
  1330. X
  1331. X .ig string      no                      "ignore" string(see ..)
  1332. X
  1333. X .in n           no      n = 10  Yes     set indent value to n
  1334. X
  1335. X .ll n           no      n = 70  Yes     sets line length (right 
  1336. X                                         margin) to n
  1337. X
  1338. X .ls n           no      n = 1   Yes     set line spacing to n
  1339. X
  1340. X .na             no      initially on    turn right justification 
  1341. X                                         off (use .ad to turn on)
  1342. X
  1343. X .ne n           no/yes  n = 2           "need" n lines; if have
  1344. X                                         them no action; else
  1345. X                                         begins new page
  1346. X
  1347. X .nf             yes                     stop filling lines
  1348. X
  1349. X .nr name n      no      n=0     No      create or modify 
  1350. X                                         register variable
  1351. X                                         (see "PREPROCESSOR")
  1352. X
  1353. X .pl n           no      n = 66  Yes     sets page length to n
  1354. X
  1355. X .pm             no                      prints currently defined
  1356. X                                         macros
  1357. X
  1358. X .so filename    no      ignored Yes     reads named file into
  1359. X                                         input stream; cannot be
  1360. X                                         invoked from keyboard
  1361. X                                         input.
  1362. X
  1363. X .sp n           yes     n = 1           space down n lines
  1364. X
  1365. X .ta n           no      n = 8   Yes     sets value of tab space
  1366. X
  1367. X .tc c           no      ~       Yes     set translation flag
  1368. X                                         character, see .tr
  1369. X
  1370. X .ti n           yes     n = 0           set temp. indent of n
  1371. X
  1372. X .tm string                              send message to terminal 
  1373. X                                         (console); like a comment
  1374. X                                         but displayed to
  1375. X                                         operator during run.
  1376. X
  1377. X
  1378. XB. non-nroff-compatible commands (must be upper-case)
  1379. X   --------------------------------------------------
  1380. X
  1381. X .BJ             yes                     break with right
  1382. X                                         justification (current
  1383. X                                         line only)
  1384. X
  1385. X .CF c           no      c = '^' Yes     to be used as a prefix
  1386. X                                         to a character that
  1387. X                                         controls print func-
  1388. X                                         tions such as ^+,^-
  1389. X                                         might be used to
  1390. X                                         bracket superscripts,
  1391. X                                         somewhat like
  1392. X                                         WORDSTAR(TM).
  1393. X
  1394. X .DB n           no      n = 0(NO)       set debug flag 1 for
  1395. X                                         diagnostics
  1396. X
  1397. X .EF /../../../  no      blanks          even footer titling
  1398. X
  1399. X .EH /../../../  no      blanks          even header titling
  1400. X
  1401. X .FF n           no      n = 1(yes)      initially, formfeeds
  1402. X                                         are "off". Can turn
  1403. X                                         them on.  Each page
  1404. X                                         then terminated with
  1405. X                                         one formfeed.
  1406. X
  1407. X .FO /../../../  no      empty           sets both even and odd
  1408. X                                         page footers
  1409. X
  1410. X .HE /../../../  no      empty           sets both even and odd
  1411. X                                         page headers
  1412. X
  1413. X .IC c           no      c = '\' Yes?    to specify the char-
  1414. X                                         acter used for macro
  1415. X                                         preprocessing to denote
  1416. X                                         the token that follows.
  1417. X
  1418. X .M1             no      n = 2   Yes     set topmost margin to n
  1419. X
  1420. X .M2             no      n = 2   Yes     set 2nd top margin to n
  1421. X                                         lines
  1422. X
  1423. X .M3             no      n = 2   Yes     1st bottom margin to n
  1424. X                                         lines
  1425. X
  1426. X .M4             no      n = 2   Yes     bottom-most margin to n
  1427. X                                         lines
  1428. X
  1429. X .OF /../../../  no      empty           odd page footer title
  1430. X
  1431. X .OH /../../../  no      empty           odd page header title
  1432. X
  1433. X .OW             no      n = 80          sets output width for
  1434. X                                         header and footer title
  1435. X
  1436. X .SC c           no      blank   Yes     space character; the
  1437. X                                         visible character
  1438. X                                         that will be trans-
  1439. X                                         literated to unexpanded
  1440. X                                         blank.
  1441. X
  1442. X .ST n           no      n=1(yes)        stop(pause)at each page
  1443. X                                         start; initially off;
  1444. X                                         may also be enabled by
  1445. X                                         the -s option.
  1446. X
  1447. X  -------------------------------------------------------------
  1448. X
  1449. ________This_Is_The_END________
  1450. if test `wc -l < ro.qrf` -ne 161; then
  1451.     echo 'shar: ro.qrf was damaged during transit (should have been 161 bytes)'
  1452. fi
  1453. fi        ; : end of overwriting check
  1454. echo 'x - tmac.m'
  1455. if test -f tmac.m; then echo 'shar: not overwriting tmac.m'; else
  1456. sed 's/^X//' << '________This_Is_The_END________' > tmac.m
  1457. X..    \"===================================================
  1458. X..    \"
  1459. X..    \"    tmac.m
  1460. X..    \"
  1461. X..    \"    text macros for the "ro" text formatter
  1462. X..    \"    by Ted A. Campbell
  1463. X..    \"
  1464. X..    \"===================================================
  1465. X..    \"
  1466. X..    \"===================================================
  1467. X..    \"    Reset top and bottom margin registers
  1468. X.M1 6
  1469. X.M2 2
  1470. X.M3 2
  1471. X.M4 6
  1472. X.ll 65
  1473. X.po 8
  1474. X..    \"===================================================
  1475. X..    \"    Number register "P" -- current page number 
  1476. X.nr P 0
  1477. X..    \"===================================================
  1478. X..    \"    String "DT" -- current date
  1479. X.ds DT "19\\n(yr/\\n(mo/\\n(dy"
  1480. X..    \"===================================================
  1481. X..    \"    Macro "PH" -- page header
  1482. X.de PH
  1483. X.nr P +1
  1484. X.HE $0
  1485. X..
  1486. X..    \"===================================================
  1487. X..    \"    Macro "PF" -- page footer
  1488. X.de PF
  1489. X.FO $0
  1490. X..
  1491. X..    \"===================================================
  1492. X..    \"    Number register "Ps" -- paragraph spacing
  1493. X.nr Ps 1
  1494. X..    \"===================================================
  1495. X..    \"    Number register "Pi" -- paragraph indent
  1496. X.nr Pi 0
  1497. X..    \"===================================================
  1498. X..    \"    Macro "P" -- begin paragraph
  1499. X.de P
  1500. X.sp \\n(Ps
  1501. X.ne 2
  1502. X.ti \\n(Pi
  1503. X..
  1504. X..    \"===================================================
  1505. X..    \"    Macro "R" -- set Roman font
  1506. X.de R
  1507. X.ft R
  1508. X..
  1509. X..    \"===================================================
  1510. X..    \"    Macro "I" -- set Italic font
  1511. X.de I
  1512. X.ft I
  1513. X..
  1514. X..    \"===================================================
  1515. X..    \"    Macro "B" -- set Bold font
  1516. X.de B
  1517. X.ft B
  1518. X..
  1519. X..    \"===================================================
  1520. X..    \"    Number register "Fn" -- current footnote number
  1521. X.nr Fn 1
  1522. X..    \"===================================================
  1523. X..    \"    String "F" -- print current footnote number superscript
  1524. X.ds F "\\u\\n(Fn\\d"
  1525. X..    \"===================================================
  1526. X..    \"    Macro "FS" -- start footnote
  1527. X.de FS
  1528. X.di no
  1529. X.sp
  1530. X.ti +5
  1531. X\\u\\n(Fn\\d
  1532. X..
  1533. X..    \"===================================================
  1534. X..    \"    Macro "FE" -- end footnote
  1535. X.de FE
  1536. X.di
  1537. X.nr Fn +1
  1538. X..
  1539. X..    \"===================================================
  1540. X..    \"    Macro "PN" -- print footnotes
  1541. X.de PN
  1542. X.sp 2
  1543. X.ls 1
  1544. X.na
  1545. X.ne 6
  1546. X.ce 
  1547. XNOTES
  1548. X.sp 1
  1549. X.no
  1550. X..
  1551. X..    \"===================================================
  1552. X..    \"    Macro "TA" -- text segment beginning 
  1553. X.de TA
  1554. X.ls 2
  1555. X.nr Pi 5
  1556. X.nr Ps 0
  1557. X.sp
  1558. X..
  1559. X..    \"===================================================
  1560. X..    \"    Macro "TZ" -- text segment ending
  1561. X.de TZ
  1562. X.ls 1
  1563. X.nr Ps 1
  1564. X..
  1565. X..    \"===================================================
  1566. X..    \"    Macro "BA" -- block segment beginnning
  1567. X.de BA
  1568. X.ls 1
  1569. X.nr Pi 0
  1570. X.nr Ps 1
  1571. X.in +5
  1572. X.ll -5
  1573. X.sp
  1574. X..
  1575. X..    \"===================================================
  1576. X..    \"    Macro "BZ" -- block segment ending
  1577. X.de BZ
  1578. X.in -5
  1579. X.ll +5
  1580. X..
  1581. X..    \"===================================================
  1582. X..    \"
  1583. X..    \"    End of tmac.m
  1584. X..    \"
  1585. X..    \"===================================================
  1586. ________This_Is_The_END________
  1587. if test `wc -l < tmac.m` -ne 129; then
  1588.     echo 'shar: tmac.m was damaged during transit (should have been 129 bytes)'
  1589. fi
  1590. fi        ; : end of overwriting check
  1591. echo 'x - test.doc'
  1592. if test -f test.doc; then echo 'shar: not overwriting test.doc'; else
  1593. sed 's/^X//' << '________This_Is_The_END________' > test.doc
  1594. X.so tmac.m
  1595. X.ls 2
  1596. X.nr Pi 5
  1597. X.ce
  1598. X\fBA Test Document\fR
  1599. X.P
  1600. XThis is a test document that has been written 
  1601. Xutilizing MicroEMACS 3.9e, and is intended 
  1602. Xto be formatted with the "ro" text formatter.  
  1603. X.P
  1604. XThis should be \usuper\dscript, 
  1605. Xand this should be \fIitalicized\fR, 
  1606. Xand this should be \fBbold\fR.  
  1607. XHow did it all come out?  
  1608. X.P
  1609. XThis sentence should be followed by 
  1610. Xthe first end note.\*F  
  1611. X.FS
  1612. XThis is the text of the first end note.
  1613. X.FE
  1614. XThis sentence should be followed 
  1615. Xby the second end note.\*F 
  1616. X.FS
  1617. XThis is the text of the second end note.  
  1618. X.FE
  1619. XThis sentence should be followed by 
  1620. Xthe third end note.\*F 
  1621. X.FS
  1622. XThis is the third end note.  
  1623. X.FE
  1624. X.sp 
  1625. X.PN
  1626. X
  1627. ________This_Is_The_END________
  1628. if test `wc -l < test.doc` -ne 33; then
  1629.     echo 'shar: test.doc was damaged during transit (should have been 33 bytes)'
  1630. fi
  1631. fi        ; : end of overwriting check
  1632. exit 0
  1633.  
  1634.  
  1635.