home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 150_01 / roff.doc < prev    next >
Text File  |  1985-03-10  |  7KB  |  234 lines

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