/contrib/groff/contrib/mom/momdoc/typemacdoc.html

https://bitbucket.org/freebsd/freebsd-head/ · HTML · 235 lines · 205 code · 30 blank · 0 comment · 0 complexity · 23f6376eae4b9eab81920f399e2f16f9 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
  5. <title>Mom -- Typesetting macros in document processing</title>
  6. </head>
  7. <body bgcolor="#dfdfdf">
  8. <!====================================================================>
  9. <a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
  10. <a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
  11. <a href="toc.html">Back to Table of Contents</a>
  12. <p>
  13. <a name="TOP"></a>
  14. <a name="TYPESETTING">
  15. <h1 align="center"><u>USING TYPESETTING MACROS DURING DOCUMENT PROCESSING</u></h1>
  16. </a>
  17. During document processing, most of the
  18. <a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
  19. affect type in the document globally. For example, if you turn kerning
  20. off, pairwise kerning is disabled not only in paragraphs, but
  21. also in headers, footers, quotes, and so on.
  22. <p>
  23. Typesetting macros that alter margins and line lengths affect
  24. <a href="definitions.html#TERMS_RUNNING">running text</a>
  25. globally (or at least try to), but leave headers/footers and footnotes
  26. alone. (To indent footnotes, see the full explanation of the
  27. <a href="docelement.html#FOOTNOTE">FOOTNOTE</a>
  28. macro.)
  29. <p>
  30. <strong>Mom</strong>'s tabs
  31. (both
  32. <a href="typesetting.html#TYPESETTING_TABS">typesetting tabs</a>
  33. and
  34. <a href="typesetting.html#STRING_TABS">string tabs</a>)
  35. behave as expected in running text during document processing. Tab
  36. structures that do not exceed the line length of running text are
  37. preserved sensibly from page to page, and, if
  38. <a href="docprocessing.html#COLUMNS">COLUMNS</a>
  39. are enabled, from column to column.
  40. <p>
  41. Some typesetting macros, however, when used during document
  42. processing, behave in special ways. These are the macros that deal
  43. with the basic parameters of type style: horizontal and vertical
  44. margins, line length,
  45. <a href="definitions.html#TERMS_FAMILY">family</a>,
  46. <a href="definitions.html#TERMS_FONT">font</a>,
  47. <a href="definitions.html#TERMS_PS">point size</a>,
  48. <a href="definitions.html#TERMS_LEADING">leading</a>,
  49. and
  50. <a href="definitions.html#TERMS_QUAD">quad</a>.
  51. <p>
  52. <strong>Mom</strong> assumes that any changes to these parameters
  53. stem from a temporary need to set type in a style different from that
  54. provided by <strong>mom</strong>'s
  55. <a href="docelement.html#INDEX_DOCELEMENT">document element tags</a>.
  56. In other words, you need to do a bit of creative typesetting in the
  57. middle of a document.
  58. <p>
  59. The following lists those typesetting macros whose behaviour during
  60. document processing requires some explanation.
  61. (Please refer to
  62. <a href="#TB_MARGINS">Top and bottom margins in document processing</a>
  63. for information on how <strong>mom</strong> interprets
  64. <a href="typesetting.html#T_MARGIN">T_MARGIN</a>
  65. and
  66. <a href="typesetting.html#B_MARGIN">B_MARGIN</a>
  67. in document processing. Additionally, see
  68. <a href="#ADD_SPACE">ADD_SPACE</a>
  69. if you encounter the problem of trying to get <strong>mom</strong>
  70. to put space at the tops of pages after the first.)
  71. <pre>
  72. MACRO EFFECT DURING DOCUMENT PROCESSING
  73. ----- ---------------------------------
  74. L_MARGIN *The left margin of all running text
  75. assumes the new value.
  76. *The line length remains unaltered.
  77. *The header and footer left margin
  78. remain at the current document default.
  79. (You won't use this often by itself. Most
  80. likely, you'll use it in combination with
  81. R_MARGIN or LL.)
  82. R_MARGIN *The right margin of all running text
  83. assumes the new value. In other words,
  84. the line length is altered.
  85. *The header and footer right margin
  86. remain at the current document default.
  87. LL *The line length of all running text
  88. is set to the new value.
  89. *The header and footer line length remain
  90. at the current document default.
  91. FAMILY *Changes family for the duration of the
  92. current tag only. As soon as another document
  93. element tag is invoked, the family reverts to
  94. the current default for the new tag.
  95. FT *Changes font for the duration of the
  96. current tag only. As soon as another document
  97. element tag is entered, the font reverts
  98. to the current default for the new tag.
  99. N.B. -- \*[SLANT] and \*[BOLDER] affect
  100. paragraph text, and remain in effect for all
  101. paragraphs until turned off. If you want to
  102. use them in a macro that takes a string
  103. argument, include the escape in the string.
  104. \*[COND] and \*[EXT] behave similarly.
  105. PT_SIZE *Changes point size for the duration of the
  106. current tag only. As soon as another document
  107. element tag is entered, the point size reverts
  108. to the current document default for the new
  109. tag.
  110. LS *Changes line space for the duration of the
  111. current tag only. As soon as another document
  112. element tag is entered, the line space reverts to
  113. the current document default for the new
  114. tag.
  115. Using LS to temporarily change leading within a
  116. document will almost certainly result in a bottom
  117. margin that doesn't align with the bottom margin
  118. of subsequent pages. You'll need to use the SHIM
  119. macro to get mom back on track when you're ready
  120. to return to the document's default leading.
  121. QUAD *Changes quad for the duration of the
  122. current tag only. As soon as another document
  123. element tag is entered, the quad reverts to
  124. the current document default for the new
  125. tag.
  126. N.B. -- Line-for-line quadding macros
  127. (LEFT, CENTER, RIGHT) are also temporary,
  128. overridden by the QUAD value of any subsequent
  129. document element tag.
  130. </pre>
  131. <hr>
  132. <!=====================================================================>
  133. <a name="TB_MARGINS">
  134. <h2><u>Top and bottom margins in document processing</u></h2>
  135. </a>
  136. Normally, <strong>mom</strong> establishes the top and bottom margins
  137. of
  138. <a href="definitions.html#TERMS_RUNNING">running text</a>
  139. in documents from the values of <strong>HEADER_MARGIN +
  140. HEADER_GAP</strong> and <strong>FOOTER_MARGIN + FOOTER_GAP</strong>
  141. respectively. However, if you invoke
  142. <a href="typesetting.html#T_MARGIN">T_MARGIN</a>
  143. or
  144. <a href="typesetting.html#B_MARGIN">B_MARGIN</a>
  145. either before or after
  146. <a href="docelement.html#START">START</a>,
  147. they set the top and bottom margins of running text irrespective
  148. of <strong>HEADER_GAP</strong> and <strong>FOOTER_GAP</strong>.
  149. <p>
  150. Put another way, in document processing, <strong>T_MARGIN</strong>
  151. and <strong>B_MARGIN</strong> set the top and bottom margins of
  152. running text, but have no effect on the placement of
  153. <a href="definitions.html#TERMS_HEADER">headers</a>,
  154. <a href="definitions.html#TERMS_FOOTER">footers</a>,
  155. or page numbers.
  156. <a name="ADD_SPACE">
  157. <h2><u>ADD_SPACE</u></h2>
  158. </a>
  159. <p>
  160. Occasionally, you may want to insert space before the start of
  161. <a href="definitions.html#TERMS_RUNNING">running text</a>
  162. on pages after the first.
  163. <p>
  164. You might have tried using
  165. <a href="typesetting.html#ALD">ALD</a>
  166. or
  167. <a href="typesetting.html#SPACE">SPACE</a>
  168. and found it did nothing. This is because <strong>mom</strong>
  169. normally inhibits any extra space before the start of running text
  170. on pages after the first.
  171. <p>
  172. If you need the space, you must use the macro,
  173. <strong>ADD_SPACE</strong>, in conjuction with
  174. <a href="typesetting.html#NEWPAGE">NEWPAGE</a>.
  175. <strong>ADD_SPACE</strong> takes as its single argument the
  176. distance you want <strong>mom</strong> to advance from the normal
  177. baseline position at the top of the page. A
  178. <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
  179. is required.
  180. <p>
  181. For example, say you wanted to insert 2 inches of space before the
  182. start of running text on a page other than the first. You'd
  183. accomplish it with
  184. <p>
  185. <pre>
  186. .NEWPAGE
  187. .ADD_SPACE 2i
  188. </pre>
  189. which would terminate your current page, break to a new page,
  190. print the header (assuming headers are on) and insert 2 inches of
  191. space before the start of running text.
  192. <p>
  193. Since adding space in this way is almost sure to disrupt
  194. <strong>mom</strong>'s ability to guarantee perfectly flush bottom
  195. margins, I highly recommend using the
  196. <a href="docprocessing.html#SHIM">SHIM</a>
  197. macro immediately after <strong>ADD_SPACE</strong>.
  198. <p>
  199. <hr>
  200. <a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
  201. <a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
  202. <a href="#TOP">Top</a>&nbsp;&nbsp;
  203. <a href="toc.html">Back to Table of Contents</a>
  204. </body>
  205. </html>