home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / roff1.lbr / ROFF.DZC / ROFF.DOC
Encoding:
Text File  |  1993-10-25  |  7.5 KB  |  241 lines

  1. May 7, 1981
  2.  
  3.             ROFF
  4.  
  5.     This version of ROFF, based on the formatter  in  Kernighan
  6. and Plauger's book SOFTWARE TOOLS, is written in BDS C, and employs
  7. the  directed  i/o functions that go along with that package. Well,
  8. half of the directed I/O anyway - it doesn't use  redirected  input
  9. because  I wanted to be able to format more than one file at a run.
  10. Please ignore any "odd" comments to myself in ROFF1.C and  ROFF2.C;
  11. I tried to find them all but there may be a few extra silly remarks
  12. around.
  13.  
  14.     For more details on the directed I/O (NDIO in our version)
  15. see NDIO.C
  16.  
  17.  
  18. Sample calls:
  19.  
  20. A>roff filename1 filename2 filename3 +)
  21.  
  22.     this would send the formatted version of these three files
  23.     to the console and to the cp/m list device
  24.  
  25.  
  26. A>roff filename1 +)]>filename1
  27.  
  28.     this would format filename1 and send it to the list device,
  29.     console, robot-typewriter, and back to filename1.
  30.  
  31.  
  32.  
  33. For more details on using the directed I/O, see NDIO.C  Note the
  34. difference between ) which redirects to the list device with \n's
  35. expanded to \r \n, and } which redirects to the printer (same port)
  36. but without expanding \n's.  N.B.:  dio.c accepts +outfile as
  37. output to both file and console, ndio.c does not (it wants +>foo ).
  38.  
  39.  
  40.  
  41.         Using  ROFF,  you  can  make nice printouts of a file, with as
  42. little  or as much help from the program as you want, depending on the
  43. commands.  There  are  default  values  for  all parameters, so if you
  44. don't put any commands in at all, your file will come out with filled,
  45. right-justified  lines.   The  default line-length is  80  characters;
  46. the  default  page-length  is  66 lines per page. "Filled lines" means
  47. that  as many input words as possible are packed onto a line before it
  48. is   printed;   "non-filled"   lines  go  through  the  formatter  w/o
  49. rearrangement.  "Right-justified"  simply  means that spaces are added
  50. between words to make all the right margins line up nicely. 
  51.         To  set  a  parameter, use the appropriate commands below. All
  52. commands  have the form of a period followed by two letters. A command
  53. line  should  have nothing on it but the command and its arguments (if
  54. any); any text would be lost. 
  55.  
  56.         A command argument can be either ABSOLUTE or RELATIVE : 
  57.  
  58. .in    5    sets the indent value to 5 spaces
  59.  
  60. .in    +5    sets the indent value to the CURRENT value plus 5
  61.  
  62. .ls     -1    sets the line spacing value to the current value 
  63.                         minus one
  64.  
  65.         Also,  all commands have a minimum and maximum value that will
  66. weed out any odd command settings (like setting the line spacing to 
  67. zero, for example. It won't let you do that, but it could be changed 
  68. if you REALLY have a burning desire to do so).
  69.  
  70.         Some  commands  cause  a  "break", which is noted in the table
  71. below.  Before  such  a  command goes into effect, the current line of
  72. text  is  put  out,  whether  it is completely filled or not. (this is
  73. what  happens  at  the  end  of  a  paragraph,  for  example.)  A LINE
  74. BEGINNING  WITH  SPACES  OR  A  TAB  WILL  CAUSE  A BREAK, AND WILL BE
  75. INDENTED  BY THAT MANY SPACES (OR TABS) REGARDLESS OF THE INDENT VALUE
  76. AT  THAT  TIME  (this  is  a "temporary indent", which can also be set
  77. explicitly).  An all blank line also causes a break.  If you find that
  78. seem  to  have  some  lines that are indented strangely,  and it's not
  79. obvious WHY,  look  at which commands  are causing a break,  and which 
  80. aren't. For instance:
  81.  
  82. .fi
  83. .ti 0
  84. this is a line of text
  85. .in 8
  86.                     <- blank line
  87. more text for the machine to play with
  88.  
  89.  
  90. At first glance it seems obvious that the line "this is a line of text"
  91. will   be indented zero spaces,  but it won't - it will be indented  8.
  92. The indent  command  does  NOT cause a break   (although the .ti  does)
  93. so it will not cause the line to  be put out before  setting the indent
  94. value to 8.  Then,  when the  blank line is encountered,  it will cause
  95. a break - and "this is a line of text" will be indented incorrectly.
  96.  
  97.  
  98. *********************** Table of Commands *****************************
  99.  
  100. Command          Break?    Default        Function
  101. -------       ------    -------         ---------
  102. .bp n        yes    n =  +1        begin page numbered n
  103.  
  104. .br        yes            cause a break
  105.  
  106. .ce n        yes    n = 1        center next n lines
  107.  
  108. .fi        yes            start filling lines
  109.  
  110. .fo string    no    empty        sets footer to string
  111.  
  112. .he string    no    empty        sets header to string
  113.  
  114. .in n        no    n = 0        sets indent value to n
  115.  
  116. .ls n        no    n = 1        sets line spacing to n
  117.  
  118. .m1        no    n = 2        sets topmost margin to n
  119.  
  120. .m2        no    n = 2        sets 2nd top margin to n lines
  121.  
  122. .m3        no     n = 2        1st bottom margin to n lines
  123.  
  124. .m4        no    n = 2        bottom-most margin to n lines
  125.  
  126. .nf        yes            stop filling lines
  127.  
  128. .pl n        no     n = 66        sets page length to n
  129.  
  130. .rm n        no    n = 80        sets right margin to n
  131.  
  132. .sp n        yes    n = 1        space down n lines
  133.  
  134. .ti n        yes    n = 0        sets temporary indent of n
  135.  
  136. .ul n        no    n = 1        underline next n lines
  137.  
  138. ----------------------------------------------------------------------
  139.  
  140.  
  141.  
  142. Here's what the page parameters look like:
  143.  
  144. _    _________________________________________________
  145. |    |    top margin - (includes header)        |
  146. |    |-----------------------------------------------|
  147. |    |        top margin 2            |
  148. |    |-----------------------------------------------|
  149. P    |    :                :    |
  150. A    |    :<-indent            :    |
  151. G    |    :                :    |
  152. E    |    :lots and lots of silly text and:    |
  153. L    |    :other garbage. Get the picture?:    |
  154. E    |       :This is a temp.  indentation:    |
  155. N    |    :                :    |
  156. G    |    :        right margin -> :    |
  157. T    |    :                :    |
  158. H    |    :                :    |
  159. |    |-----------------------------------------------|
  160. |    |        margin 3            |
  161. |    |-----------------------------------------------|
  162. |    |    margin 4 - (includes footer)        |
  163. -    -------------------------------------------------
  164.  
  165.  
  166. To change the default for any parameter, simply alter ROFFGLOB
  167. recompile ROFF1.c and ROFF2.c, and re-clink them with NDIO.CRL
  168. (you can use DIO.CRL, but it doesn't have all the features of
  169. NDIO )
  170.  
  171.  
  172.  
  173. ************************************************************
  174. A Few Extra Comments on Some of the Commands:
  175. ************************************************************
  176.  
  177.                 If you want to center lots of lines, but don't
  178.         want to count them, do something like this:
  179.  
  180. .ce    1000
  181. lots and
  182. lots of words to
  183. be centered
  184. .ce 0
  185.  
  186.         --------------------------------------
  187.  
  188.         To underline a few words on a line:
  189.  
  190. .fi
  191. .ul
  192. Some
  193. of the words in
  194. .ul
  195. this
  196. sentence are 
  197. .ul
  198. underlined
  199. .nf
  200.  
  201.         WOULD PRODUCE:
  202.  
  203. Some of the words in this sentence are underlined.
  204. ----                 ----              -----------
  205.  
  206. (obviously you don't have to turn the fill on and off if it's
  207.  already on )
  208.  
  209.         ------------------------------------
  210.  
  211. A new paragrah may be caused by using the temporary indent
  212. command, like
  213.  
  214. .ti +5
  215.  
  216. or by simply beginning the paragraph with a tab, as you would if
  217. you were just typing.
  218.  
  219.         ------------------------------------
  220.  
  221. Headers and Footers.
  222.  
  223.         A page number can be incorporated into any header or
  224. footer by putting a "#" in the title where you want the number
  225. to go:
  226.  
  227. .he    This is a witty header title for page #
  228.  
  229. Each time this is printed at the top of a page, the current
  230. page number will be substituted for the "#".
  231.  
  232.         ------------------------------------
  233. If you want to send the output to a file, and don't want the page
  234. breaks in there ( that's what I did for this ) set margins 1-4 to
  235. zero.
  236. nce are 
  237. .ul
  238. underlined
  239. .nf
  240.  
  241.         WOULD PRO