home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / f / pwtour.arc / ROFFGUID.DOC < prev    next >
Encoding:
Text File  |  1993-03-27  |  12.5 KB  |  465 lines

  1.  
  2. .                            ROFFTOUR
  3.  
  4.  
  5.  
  6.  
  7. 1. Introduction
  8.  
  9. This  document  describes  additional functionality added to ROFF to
  10. support  the  TOUR  (c)  Program.  No  changes   to   the   existing
  11. functionality of ROFF have been made. 
  12.  
  13. The  changes  made  support  decimalization.  Decimalization  is the
  14. automatic numbering of heading and subheading labels in a document. 
  15.  
  16. Some formatting control for headings has also been included. 
  17.  
  18.  
  19. 2. Extension to the Roff program
  20.  
  21.  
  22.  
  23. 2.1 Specifying heading labels
  24.  
  25. You may label sections of  a  document  by  using  a  heading  label
  26. directive.  Heading labels are entered by using the new .hl command.
  27. The command which labeled this section was 
  28.  
  29. .hl Specifying heading labels 
  30.  
  31. When the document  is  run-off'ed  ROFF  will  automatically  number
  32. heading  labels in sequence. This feature allows you to move section
  33. of document around  without  worrying  about  renumbering  sections.
  34. TOUR (c) is ideal for this purpose. 
  35.  
  36.  
  37. 2.2 Specifying sub-headings
  38.  
  39. If  you  are working on a more complicated document, you may wish to
  40. place  numbered  headings  within  headings.  Using  this   feature,
  41. sub-headings  are  also automatically numbered. The same .hl command
  42. is  used  to  specify  sub-headings.  Sub-headings,   however,   are
  43. bracketed by "set level" commands. The set level commands are 
  44.  
  45. .sl + 
  46.  
  47. to begin a series of sub-headings and 
  48.  
  49. .sl - 
  50.  
  51. to  end a series of sub-headings. Headings may be nested 8 deep with
  52. the new version of ROFF. For example 
  53.  
  54. .hl Top Level Label One
  55. .sl +
  56. .hl One-One
  57. .hl One-Two
  58. .sl -
  59. .hl Top Level Label Two
  60. .sl +
  61. .hl Two-one
  62. .sl +
  63.  
  64.  
  65. .                               1
  66.  
  67.  
  68. .                            ROFFTOUR
  69.  
  70.  
  71. .hl Two-one-one
  72. .hl Two-one-two
  73. .sl -
  74. .hl Two-two
  75. .sl -
  76. .hl Top Level Label Three
  77.  
  78. Any number of lines of text may follow a .hl command. Text does  not
  79. normally  follow a .sl + command, but it may follow a .sl - command.
  80. (It would function as a section summary.) 
  81.  
  82.  
  83. 2.3 Page formating for heading labels
  84.  
  85. Five additional commands help control  the  look  of  your  document
  86. when  you  use  heading  labels. In the (lazy) spirit of ROFF's ".M"
  87. commands, five ".D" commands have been added. They are 
  88.  
  89. .d1 <number of lines to skip before a heading label is printed>
  90. .d2 <additional skip before first sub-heading>
  91. .d3 <number of lines to skip after a heading label is printed>
  92. .d4 <number of spaces to indent sub-headings and text>
  93. .d5 <additional indent for text after heading label>
  94.  
  95. Note that .d4 and .d5 can be used to create "hanging titles". 
  96.  
  97.                               WARNING
  98.  
  99. The indent feature makes internal use of ROFF's .in command. If  you
  100. use  the  .in  command within your document, you should take care to
  101. use it in relative mode (with "+"'s and "-"'s) rather than  absolute
  102. mode. 
  103.  
  104.  
  105. 2.4 Periods in the first column
  106.  
  107. By  placing  two  periods  in  a row, ROFF now allows you to place a
  108. period in the first column. The first period is  stripped  by  ROFF,
  109. all successive periods will be output. For example, 
  110.  
  111. ..I want a period in the first column
  112.  
  113. would appear after processing
  114. .I want a period in the first column
  115.  
  116.  
  117. 3. Roff Command Reference
  118.  
  119. May 7, 1981
  120.  
  121.                         ROFF
  122.  
  123.         This version of ROFF, based on the formatter  in  Kernighan
  124. and Plauger's book SOFTWARE TOOLS, is written in BDS C, and employs
  125. the  directed  i/o functions that go along with that package. Well,
  126. half of the directed I/O anyway - it doesn't use  redirected  input
  127. because  I wanted to be able to format more than one file at a run.
  128. Please ignore any "odd" comments to myself in ROFF1.C and  ROFF2.C;
  129.  
  130.  
  131. .                               2
  132.  
  133.  
  134. .                            ROFFTOUR
  135.  
  136.  
  137. I tried to find them all but there may be a few extra silly remarks
  138. around.
  139.  
  140.         For more details on the directed I/O (NDIO in our version)
  141. see NDIO.C
  142.  
  143.  
  144. Sample calls:
  145.  
  146. A>roff filename1 filename2 filename3 +}
  147.  
  148.         this would send the formatted version of these three files
  149.         to the console and to the printer
  150.  
  151.  
  152. A>roff filename1 +}]>filename1
  153.  
  154.         this would format filename1 and send it to the printer,
  155.         console, robot-typewriter, and back to filename1.
  156.  
  157.  
  158.  
  159. For more details on using the directed I/O, see NDIO.C
  160.  
  161.  
  162.  
  163.         Using  ROFF,  you  can  make nice printouts of a file, with as
  164. little  or as much help from the program as you want, depending on the
  165. commands.  There  are  default  values  for  all parameters, so if you
  166. don't put any commands in at all, your file will come out with filled,
  167. right-justified  lines.   The  default line-length is  80  characters;
  168. the  default  page-length  is  66 lines per page. "Filled lines" means
  169. that  as many input words as possible are packed onto a line before it
  170. is   printed;   "non-filled"   lines  go  through  the  formatter  w/o
  171. rearrangement.  "Right-justified"  simply  means that spaces are added
  172. between words to make all the right margins line up nicely. 
  173.         To  set  a  parameter, use the appropriate commands below. All
  174. commands  have the form of a period followed by two letters. A command
  175. line  should  have nothing on it but the command and its arguments (if
  176. any); any text would be lost. 
  177.  
  178.         A command argument can be either ABSOLUTE or RELATIVE : 
  179.  
  180. .in    5    sets the indent value to 5 spaces
  181.  
  182. .in    +5    sets the indent value to the CURRENT value plus 5
  183.  
  184. .ls     -1    sets the line spacing value to the current value 
  185.                         minus one
  186.  
  187.         Also,  all commands have a minimum and maximum value that will
  188. weed out any odd command settings (like setting the line spacing to 
  189. zero, for example. It won't let you do that, but it could be changed 
  190. if you REALLY have a burning desire to do so).
  191.  
  192.         Some  commands  cause  a  "break", which is noted in the table
  193. below.  Before  such  a  command goes into effect, the current line of
  194. text  is  put  out,  whether  it is completely filled or not. (this is
  195.  
  196.  
  197. .                               3
  198.  
  199.  
  200. .                            ROFFTOUR
  201.  
  202.  
  203. what  happens  at  the  end  of  a  paragraph,  for  example.)  A line
  204. beginning  with  spaces  or  a  tab  will  cause  a break, and will be
  205. indented  by that many spaces (or tabs) regardless of the indent value
  206. at  that  time  (this  is  a "temporary indent", which can also be set
  207. explicitly).  An all blank line also causes a break.  If you find that
  208. seem  to  have  some  lines that are indented strangely,  and it's not
  209. obvious WHY,  look  at which commands  are causing a break,  and which 
  210. aren't. For instance:
  211.  
  212. .fi
  213. .ti 0
  214. this is a line of text
  215. .in 8
  216.                                         <- blank line
  217. more text for the machine to play with
  218.  
  219.  
  220. At first glance it seems obvious that the line "this is a line of text"
  221. will   be indented zero spaces,  but it won't - it will be indented  8.
  222. The indent  command  does  NOT cause a break   (although the .ti  does)
  223. so it will not cause the line to  be put out before  setting the indent
  224. value to 8.  Then,  when the  blank line is encountered,  it will cause
  225. a break - and "this is a line of text" will be indented incorrectly.
  226.  
  227.  
  228. *********************** Table of Commands *****************************
  229.  
  230. Command          Break?    Default        Function
  231. -------       ------    -------         ---------
  232. .bp n        yes    n =  +1        begin page numbered n
  233.  
  234. .br        yes            cause a break
  235.  
  236. .ce n        yes    n = 1        center next n lines
  237.  
  238. .fi        yes            start filling lines
  239.  
  240. .fo string    no    empty        sets footer to string
  241.  
  242. .he string    no    empty        sets header to string
  243.  
  244. .in n        no    n = 0        sets indent value to n
  245.  
  246. .ls n        no    n = 1        sets line spacing to n
  247.  
  248. .m1        no    n = 2        sets topmost margin to n
  249.  
  250. .m2        no    n = 2        sets 2nd top margin to n lines
  251.  
  252. .m3        no     n = 2        1st bottom margin to n lines
  253.  
  254. .m4        no    n = 2        bottom-most margin to n lines
  255.  
  256. .nf        yes            stop filling lines
  257.  
  258. .pl n        no     n = 66        sets page length to n
  259.  
  260. .rm n        no    n = 80        sets right margin to n
  261.  
  262.  
  263. .                               4
  264.  
  265.  
  266. .                            ROFFTOUR
  267.  
  268.  
  269.  
  270. .sp n        yes    n = 1        space down n lines
  271.  
  272. .ti n        yes    n = 0        sets temporary indent of n
  273.  
  274. .ul n        no    n = 1        underline next n lines
  275.  
  276. ----------------------------------------------------------------------
  277.  
  278.  
  279.  
  280. Here's what the page parameters look like:
  281.  
  282. _    _________________________________________________
  283. |    |    top margin - (includes header)        |
  284. |    |-----------------------------------------------|
  285. |    |        top margin 2            |
  286. |    |-----------------------------------------------|
  287. P    |    :                :    |
  288. A    |    :<-indent            :    |
  289. G    |    :                :    |
  290. E    |    :lots and lots of silly text and:    |
  291. L    |    :other garbage. Get the picture?:    |
  292. E    |       :This is a temp.  indentation:    |
  293. N    |    :                :    |
  294. G    |    :        right margin -> :    |
  295. T    |    :                :    |
  296. H    |    :                :    |
  297. |    |-----------------------------------------------|
  298. |    |        margin 3            |
  299. |    |-----------------------------------------------|
  300. |    |    margin 4 - (includes footer)        |
  301. -    -------------------------------------------------
  302.  
  303.  
  304. To change the default for any parameter, simply alter ROFFGLOB
  305. recompile ROFF1.c and ROFF2.c, and re-clink them with NDIO.CRL
  306. (you can use DIO.CRL, but it doesn't have all the features of
  307. NDIO )
  308.  
  309.  
  310.  
  311. ************************************************************
  312. A Few Extra Comments on Some of the Commands:
  313. ************************************************************
  314.  
  315.                 If you want to center lots of lines, but don't
  316.         want to count them, do something like this:
  317.  
  318. .ce    1000
  319. lots and
  320. lots of words to
  321. be centered
  322. .ce 0
  323.  
  324.         --------------------------------------
  325.  
  326.         To underline a few words on a line:
  327.  
  328.  
  329. .                               5
  330.  
  331.  
  332. .                            ROFFTOUR
  333.  
  334.  
  335.  
  336. .fi
  337. .ul
  338. Some
  339. of the words in
  340. .ul
  341. this
  342. sentence are 
  343. .ul
  344. underlined
  345.  
  346.         WOULD PRODUCE:
  347.  
  348. Some of the words in this sentence are underlined.
  349. ----                 ----              -----------
  350.  
  351. (obviously you don't have to turn the fill on and off if it's
  352.  already on )
  353.  
  354.         ------------------------------------
  355.  
  356. A new paragrah may be caused by using the temporary indent
  357. command, like
  358.  
  359. .ti +5
  360.  
  361. or by simply beginning the paragraph with a tab, as you would if
  362. you were just typing.
  363.  
  364.         ------------------------------------
  365.  
  366. Headers and Footers.
  367.  
  368.         A page number can be incorporated into any header or
  369. footer by putting a "#" in the title where you want the number
  370. to go:
  371.  
  372. .he    This is a witty header title for page #
  373.  
  374. Each time this is printed at the top of a page, the current
  375. page number will be substituted for the "#".
  376.  
  377.         ------------------------------------
  378. If you want to send the output to a file, and don't want the page
  379. breaks in there ( that's what I did for this ) set margins 1-4 to
  380. zero.
  381.  
  382.  
  383. 4. I/O redirection
  384.  
  385.  6 MAY 81 :: NDIOC.PAK distributed with ROFF.COM
  386. 25 Jan 85 :: Edited to form DIO.DOC by Ed Taychert
  387.  
  388.         To activate redirection: Four special arguments may be given
  389.         on the command line to the generated COM file...
  390.  
  391.                 >foo    causes "putchar" to place characters into the file
  392.                         named "foo" instead of to the console.
  393.  
  394.  
  395. .                               6
  396.  
  397.  
  398. .                            ROFFTOUR
  399.  
  400.  
  401.  
  402.                 +foo    like >foo except that the characters are ALSO sent
  403.                         to the console.
  404.  
  405.                 <foo    causes "getchar" to return characters from the file
  406.                         named "foo" instead of from the keyboard.
  407.  
  408.                 )    send to CPM list device
  409.  
  410.                 }    send to printer
  411.  
  412.                 ]    send to robot-typewriter
  413.  
  414.          (Note that there must never be any spaces between >,+,< or | and the
  415.           corresponding filename.)
  416.  
  417.         You can send the output to more than one thing at once, like so:
  418.                 A>ROFFTOUR infile +)}]>outfile
  419.  
  420.  
  421. 5. Use and Limitations
  422.  
  423. The  extensions  made  to  ROFF are paterned after DSR, a registered
  424. trademark of Digital Equipment Corporation. DSR is one of  Digital's
  425. runoff   programs.   ROFFTOUR   supports  only  a  subset  of  DSR's
  426. decimalization commands. In the future, ROFFTOUR  will  be  enhanced
  427. to   recognise  more  of  the  DSR  commands.  To  guarantee  upward
  428. compatability with furture versions of ROFFTOUR, do not use  numbers
  429. as the first charaters of a heading label. For example: 
  430.  
  431. .hl 4 Things to Remember 
  432.  
  433. will cause future problems, while 
  434.  
  435. .hl Four Things to Remember 
  436.  
  437. will always work. 
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461. .                               7
  462.  
  463.     }    send to printer
  464.  
  465.                 ]    send to robo