home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 304_01 / ma.doc < prev    next >
Text File  |  1990-02-14  |  9KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.                           USING "MA."
  6.  
  7.                          E. E. Bergmann
  8.  
  9.  
  10. I.INTRODUCTIONI.INTRODUCTIONI.INTRODUCTION
  11.  
  12.      The  file,  "ma.",  is  a  collection  of device independent
  13. macros and initializations.  It is the first such file for  ROFF5
  14. and  so  will  benefit  from further testing and will probably be
  15. enhanced in the future.
  16.  
  17.      It is normally preceeded by a  printer  initialization  file
  18. and followed  by the file or files to be formatted.  For example,
  19. I am using an Okidata Microline 92 printer (so I use the  printer
  20. initialization  file,  "ml92.")  and  I  wish to generate a three
  21. chapter  work  contained  in  files,  "chap1.",   "chap2.",   and
  22. "chap3.".  Assuming that the relevent files are all accessed from
  23. the current directory, my command line may look like:
  24.  
  25. C>roff5 ml92 ma chap1 chap2 chap3 )
  26.  
  27. A second example is to print this documentation:
  28.  
  29. C>roff5 ml92 ma ma.src )
  30.  
  31.      The  purpose of the final ")" is, of course, to redirect the
  32. output of the roff5 formatter to the printer;  it  is  equivalent
  33. to "}prn".  We have generated the file, "ma.doc" by using:
  34.  
  35. C>roff5 ma ma.doc }ma.doc
  36.  
  37.  
  38.  
  39. II.SIMPLE MACROSII.SIMPLE MACROSII.SIMPLE MACROS
  40.  
  41.      We  have  developed  a  few simple macros which we recommend
  42. studying their "source code"  in  the  "ma."  file  to  begin  to
  43. understand  writing  one's  own  macros  for special needs and to
  44. modify to suit one's own tastes.
  45.  
  46.      PAGINATION will start placing page numbers at the top center
  47. of each page.  In the file it is  automatically  invoked  by  the
  48. line:   ".wh 10 PAGINATION"  which  will  start  it  when we have
  49. gotten into the first page.  Since the top of page 1  is  already
  50. done, pagination will first be visible on the top of page 2.
  51.  
  52.      Major section  headings  are  achieved with the H macro.  We
  53. provide for left alignment with roman  numerals  and  bold  type.
  54. For  example,  the  header  for this section was created with the
  55. line, '.H "SIMPLE MACROS"'.
  56.  
  57.      Each paragraph is preceded by the macro command line,  ".P".
  58. The  default  style  is  controlled by a number of registers that
  59. could be changed to suit taste.  The spacing  between  paragraphs
  60. is Ps lines;  its default value is 1 blank line.  The register Pt
  61. is   1   or   0   depending   upon   wanting  to  indent  or  not
  62. (respectively).  The size of the indent relative to  the  current
  63.  
  64.  
  65.                      DOCUMENTATION FOR "MA."
  66.  
  67.  
  68.                                -2-
  69.  
  70.  
  71. margin  is  controlled  by  the  number  register  Pi which has a
  72. default value of 5.
  73.  
  74.      To enhance the ".rl" ruler command of roff5, we have a macro
  75. command, ".RL" which will act like the  original  when  given  an
  76. argument,  but  will  give  a  reasonable  default  ruler when no
  77. argument is supplied.
  78.  
  79.      When we are in fill mode (the default), we can  conveniently
  80. number equations  or  expressions  with  the  ".En" request.  For
  81. example, we can get:
  82.  
  83. a = b + c                                                     (1)
  84.  
  85.                            d = e + f                          (2)
  86.  
  87. (examine the source of this file to see how it was done!)
  88.  
  89.      Another quick macro line is '.signed "E. E. Bergmann"' which
  90. provides a simple way to end some documents, such as this one.
  91.  
  92.  
  93. III.COMPOUND MACROSIII.COMPOUND MACROSIII.COMPOUND MACROS
  94.  
  95.      Many of the useful macros work  in  cooperation  to  achieve
  96. their results.    The  naming of these macros was chosen to align
  97. reasonably well with the macro packages used in UNIX(R  by  AT&T)
  98. for their  text  formatters.   We recommend reading books such as
  99.                                         1
  100. "troff Typsetting for UNIX(tm) Systems."
  101.  
  102.      For example, the pair of macro commands,  ".RS"  and  ".RF",
  103. which  are  to  handle  reference  starts  and  finishes,  are  a
  104. convenient way to provide a means to collect all ones  references
  105. at the  end  of  the paper, chapter, or book.  The references are
  106. also automatically numbered at the same time.  To use  them,  one
  107. generally  wants  to place in the text a superscripted referenmce
  108. number.  This is achieved with the defined string (created in the
  109. macro  package  with  the  ".ds"  command),  \rn\  at  the   text
  110. location.   Immediately  after  this place in the source file one
  111. should start a new line with the command, ".RS".   The  following
  112. lines  contain  the text that is to be collected as the reference
  113. information and printed  at  the  end  of  the  document.    This
  114. reference  information  is  terminated  with a new line beginning
  115.                                                    2
  116. with the macro command, ".RF" (reference finished).
  117.  
  118.      One can place the same reference  in  several  places.    To
  119. create  a copy of the \rn\ named, say, "TAG" to be used later for
  120. the same reference number, one places the name in  the  reference
  121. start:  ".RS TAG".    Later,  for  this  same reference, one uses
  122. \TAG\ instead of \rn\.
  123.  
  124.      A very  similar  set  of  commands  exists  for  figures  or
  125. illustrations.    The   numbering   of   illustrations   is  done
  126. automatically using the i# number register.  The  figure  caption
  127. is placed after the macro command line, ".IS <tag>", and followed
  128. by the  macro  command  line,  ".IE".   The <tag> is optional and
  129.  
  130.  
  131.                      DOCUMENTATION FOR "MA."
  132.  
  133.  
  134.                                -3-
  135.  
  136.  
  137. serves the analogous function we previously described for ".RS".
  138.  
  139.      The production of footnotes (at the bottom  of  the  current
  140. page,  instead  of  references  that  appear  at  the  end of the
  141. document), has proven the most trying for me.  I have included  a
  142. demo  file,  "fs."  to  excercise  the relevent macros in a large
  143. variety of conditions.  We provide the  option  of  automatically
  144. numbering  or  of  other  means such as "*" or "**" to label each
  145. footnote.  The numbering  of  footnotes  will  run  consecutively
  146. throughout  the document unless one resets the counter, f# with a
  147. command of the form:  ".nr f# 1".  A lot of the complexity arises
  148. because the amount of space needed on the page varies and one may
  149. run  out  of  space   on   the   current   page   under   certain
  150. circumstances.    We   have   striven   to   handle   all   cases
  151. automatically.
  152.  
  153.      We use the ".FS" and ".FE" (footnote start and footnote end)
  154. in a manner similar to the ".RS",".RF",  and  ".IS",".IE"  pairs.
  155. However,   the  optional  use  of  a  <tag>  in  ".FS  <tag>"  is
  156. different;  here we would use for the <tag> a "*", "**", etc.  to
  157. substitute for automatically numbering.*
  158.  
  159.      To  mark  where  there  is  an  automatic  numbering  for  a
  160.                                                             1
  161. footnote, one uses \fn\ as I have at the end of  this  line.   To
  162. change  the  spacing  before  each  footnote,  change  the number
  163. register, "Fs";  its default value is 0.
  164.  
  165.  
  166. IV.CONCLUDING MACROSIV.CONCLUDING MACROSIV.CONCLUDING MACROS
  167.  
  168.      We have provided a "finish" macro that is the initial choice
  169. of end macro (achieved by using ".em  finish").    This  "finish"
  170. will  complete  the  production of any remaining footnotes at the
  171. end  of  the  document,  generate  one  or  more  new  pages  for
  172. references (if needed), and, if needed, one or more pages for the
  173. illustration captions listing.
  174.  
  175.      It  should  be educational to examine how this documentation
  176. was created as well as by studying the contents  of  "ma.".    It
  177. should be emphasized that this macro package is neither necessary
  178. nor complete.    One  may be happy without using a macro package,
  179. since the  basic  ROFF5  formatter  does  most  needed  functions
  180. without further elaboration.  One may have very complex needs and
  181. wish  to  achieve  a  uniform  set  of  documents  with automatic
  182. numbering and sub-numbering, in which case,  this  initial  macro
  183. package may provide a starting point.
  184.  
  185.  
  186.  
  187.  
  188.                                              E. E. Bergmann
  189.                                              730 Seneca Street
  190.                                              Bethlehem, PA 18015
  191. __________
  192. *As I have just done here.
  193. 1. I have just demonstrated an automatic numbered footnote here!
  194.  
  195.  
  196.  
  197.                      DOCUMENTATION FOR "MA."
  198.  
  199.  
  200.                                -4-
  201.  
  202.  
  203.                            REFERENCES                           __________                           REFERENCES                           __________                           REFERENCES                           __________
  204. 1
  205.  Sandra L. Emerson and Karen  Paulsell,  "troff  Typesetting  for
  206. UNIX(tm)   Systems,"   Prentiss-Hall   (New  Jersey,  1987)  ISBN
  207. 0-13-930959-4.
  208. 2
  209.  I just could not resist creating a reference here to show off!
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                      DOCUMENTATION FOR "MA."
  264.  
  265.