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.src < prev    next >
Text File  |  1990-02-14  |  7KB  |  174 lines

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