home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / textutil / jgpsuite / xmp / EXNOTE < prev    next >
Encoding:
Text File  |  1992-01-13  |  11.7 KB  |  270 lines

  1. .cpi 10 1 60
  2. .hd
  3. /
  4. .if \o
  5. .col
  6. Page \p|Notes|\s0
  7. .else
  8. .col
  9. \s0|Notes|Page \p
  10. .fi
  11.  
  12. /
  13. .ft
  14. :
  15.  
  16. .col
  17. 30/11/87|(C) JGLaski, 1988|29/7/89
  18.  
  19. :
  20. .parind 0
  21. .setst :\s1=38:
  22. .setst ::
  23. .ftnt
  24. *.cpi 12 1 72
  25. .sp 8       This will be ignored in JGDoc
  26. .ht 8
  27. .bar -
  28. .setst :\t:
  29. *\R\&\T *.nost
  30. \&)\t*
  31. .endnt
  32. *.page
  33. .bar -
  34.  
  35. Here is the beginning of the chapnotes
  36.  
  37. .bar -
  38.  
  39. .col
  40. |Chapnotes|
  41.  
  42. .ht 8
  43. .setst :\t:
  44. *\R\#\T *
  45. .nost
  46. \#)*
  47. .endno 10
  48. .ftno a
  49.  
  50. .col
  51. |Notes \(A demonstration that footnotes can be set from within the fields of
  52. ..cols; of course the opening and closing brackets must be in matched
  53. positions, or chaos will ensue.\)|
  54.  
  55. This document serves as both documentation and example for Endnotes and
  56. Footnotes. Moreover, they serve as a paradigm for any JGPrint job for which
  57. notes are required, and I would strongly suggest that you start by using the
  58. same directives as are used here, and then modify them to adapt to your specific
  59. requirements. Indeed, I should be suprised if any modifications are needed
  60. except for reseting the odd margins here, and possibly not using .ftno to move
  61. away from numeric footnotes, for the vast majority of jobs.
  62.  
  63. The following directives set up the three strings and the base for the
  64. footnotes in this document:
  65. .nofj
  66. ..ftnt
  67. *.cpi 12
  68. ..sp 8
  69. ..ht 8
  70. ..bar -
  71. ..setst :\\t:
  72. *\\R\\&\\T *.nost
  73. \\&)\\t*
  74. ..ftno a
  75. .fj
  76. Similarly, these directives set up the three strings and the base for the
  77. endnotes and chapnotes in this document:
  78. .nofj
  79. ..endnt
  80. *.page
  81. ..bar  -
  82.  
  83. Here is the beginning of the chapnotes
  84.  
  85. ..bar -
  86.  
  87. ..col
  88. |Endnotes|
  89.  
  90. ..ht 8
  91. ..setst :\\t:
  92. *\\R\\#\\T *
  93. ..nost
  94. \\#)*
  95. ..endno 10
  96. .fj
  97. The actual footnotes and endnotes are taken from the \\(...\\) and \\[...\\]
  98. brackets in the body of the text. When JGPrinting to screen, long footnotes
  99. provoke prompts "Long footnote OK? / Enddoc" to enable missing \\) to be
  100. caught. It is, of course, absurd to use these facilities on such a little
  101. document other than for demonstration purposes. I find complicated uses of
  102. note usage require checking, possibly printing testing texts made up of small
  103. extracts, before a final print.
  104.  
  105. In each case, three strings are defined: the first specifies how the notes are
  106. separated from the body of the text; the second specifies a string to be put in
  107. the body at the point to which a note applies; the third specifies a string at
  108. the beginning of the corresponding note.
  109.  
  110. Syntactically, the facilities for Endnotes and Footnotes are almost identical.
  111. \[\tThe dotties .FTNT and .ENDNT each require three strings as an argument,
  112. only the second of which is interpreted within the text where the note is
  113. refered to; .FTNO takes a character, .ENDNO takes a numerical argument.\]
  114. \(The dotties .FTNT and .ENDNT each require three strings as an argument, only
  115. the second of which is interpreted within the text where the note is refered
  116. to; .FTNO takes a character, .ENDNO  takes a numerical argument\) Admittedly
  117. ..CHAPNT has no analogue for footnotes and the configuration parameter
  118. FtPgRestart has no analogue for endnotes, but these make available auxiliary
  119. flexibilities that are not central to handling notes. \[\t}\\(, \\) and \\&
  120. are analogous to \\[, \\] and \\#.\] \(\\(, \\) and \\& are analogous to \\[,
  121. \\] and \\#.\)
  122.  
  123. How JGPrint deals with them, however, is very different, and this has
  124. consequences for setting the strings in .FT/ENDNT and within the beginning of
  125. the body of the note that is put out. This example produces, as closely as
  126. appropriate, endnotes and footnotes with the same layout. Examining the body
  127. of the text, you will see slight, but necessary \[\t}The positioning of the
  128. tab (\\t) in the third string of .FTNT is more convenient than putting it at
  129. the beginning of each footnote, but doing it as for the endnotes will work;
  130. most importantly, putting the endnote tab in the third ..ENDNT string rather
  131. than in the body will lead to chaos. Try it!\] \(The positioning of the tab
  132. (\\t) in the third string of .FTNT is more convenient than putting it at the
  133. beginning of each footnote, but doing it as for the endnotes will work; most
  134. importantly, putting the endnote tab in the third .ENDNT string rather than in
  135. the body will lead to chaos. Try it!\) differences to achieve this. The third
  136. string of .ENDNT begins with a new line, whereas that for .FTNT does not. The
  137. second string of .FTNT ends with a tab (\\t), whereas the analogous endnote
  138. tab appears explicitly at the beginning of each note. The first strings
  139. following .ENDNT and .FTNT are completely different, but, since they are
  140. intended to produce different separations between the text and the notes, this
  141. difference, though larger, is not significant.
  142.  
  143. The margins have been moved to the left since the footnotes have been set to
  144. appear with the same width as the body but at 12 cpi, and as this cannot be
  145. shown on the screen, the margins set avoid line overflow.
  146.  
  147. There are three differences between the treatment of endnotes and footnotes,
  148. of which the first is by far the most important.
  149.  
  150. This first difference is between what happens to the body of the note, that
  151. which is between \\[ and \\] or between \\( and \\). The endnote text is
  152. simply copied through without interpretation to a file 'endnt~~'; the only
  153. backslash that is looked for is the matching \\]. The footnote text has to be
  154. interpreted before being copied through \[\t}it is held in vectors in the
  155. store, and is therefore expensive in space\] \(it is held in vectors in the
  156. store, and is therefore expensive in space\) since JGPrint needs to know the
  157. depth on the page to leave for the footnotes. Consequently, the current line
  158. and word are stored and restored, and, for each footnote starts again from the
  159. leftmost column. The second difference follows from this; each footnote begins
  160. on a new line.
  161.  
  162. This second difference is the reason why the .nost in the .ENDNT directive has
  163. to begin on a newline, whereas in the .FTNT directive it can immediately
  164. follow the seperator '*'\[\t}This note is put in to demonstrate that if a
  165. footnote is so long that it would cause a page to overflow, it and the line it
  166. belongs to are forced over to the next page. Another consequence is that you
  167. can put footnotes into endnotes, but not Endnotes into footnotes. There is a
  168. bad case of the pagebreak bug for \\p and \\m, thus \p, if the footnote is
  169. forced over the page, but I expect the preceeding example is the only one that
  170. will ever occur in practical use.
  171. I have to make this long enough to force over, as you
  172. can see by the space left above on the previous page (footnote only).\] \(This
  173. note is put in to demonstrate that if a footnote is so long that it would
  174. cause a page to overflow, it and the line it belongs to are forced over to the
  175. next page. Another consequence is that you can put footnotes into endnotes,
  176. but not Endnotes into footnotes. There is a bad case of the pagebreak bug for
  177. \\p and \\m, thus \p, if the footnote is forcrd over the page, but I expect
  178. the preceeding example is the only one that will ever occur in practical use.
  179. I have to make this long enough to force over, as you can see by the space
  180. left above on the previous page (footnote only).
  181.  
  182. I have had to go over into extra paragraphs and space consuming bars to manage
  183. this as the text now stands.
  184. .bar - 4 40
  185. .bar -
  186. .bar - 40 50
  187. .col
  188. |Long enough?|
  189. \);  also the tab (\\t) in the second string would be interpreted in .ENDNT at
  190. the line position where the note occurs, so that the tab would produce either
  191. an apparantly random number of spaces or a confusing diagnostic.
  192.  
  193. .chapnt
  194. *.hd
  195. /
  196.  
  197. .col
  198. |Endnotes|
  199.  
  200. /
  201. .page
  202. .ht 8
  203. .setst :\t:
  204. *\R\#\T *
  205.  
  206. .bar -
  207.  
  208. Here is the end of the chapnotes
  209.  
  210. .bar -
  211. .fig 3
  212.  
  213. ..ENDNO sets the next note nunber, and is restricted to be numeric \[\t}This
  214. was the original for both kinds of notes. The change shows how how experience
  215. informs imagination informs design.\] \(This was the original for both kinds
  216. of notes. The change shows how experience informs imagination informs
  217. design.\), whereas .FTNO sets the base from which numbering begins on each
  218. page and the next note number, and is set by any character that follows.
  219. \[\t}If the character is 0, the notes numbers are numeric starting from 1; 10
  220. follows 9. Otherwise they are ascii; b follows a, + follows *. Special
  221. characters can be defined by the user for this purpose, 'dagger', double dagger
  222. etc. Note that these cannot be taken from the IBM standard extended character
  223. sets, which does not provide them adjacently. Many\-charactered note numbers (*,
  224. ** or Roman numbers) cannot be provided via \\#/&; They can of course be
  225. provided explicitly with null strings following .FTNT/ENDNT)\] \(If the
  226. character is 1, the notes numbers are numeric; 10 follows 9. Otherwise they are
  227. ascii; b follows a, + follows *. Special characters can be defined by the user
  228. for this purpose, 'dagger', double dagger etc. Note that these cannot be taken
  229. from the IBM standard extended character sets, which does not provide them
  230. adjacently. Many\-charactered note numbers (*, ** or Roman numbers) cannot be
  231. provided via \\#/&; They can of course be provided explicitly with null strings
  232. following ..FTNT/ENDNT)\) There is a small bug in the design here, since a .FTNO
  233. on a page on which there has already been a footnote will cause inconsistent
  234. references: the numbers in the text are as specified above; the numbering of the
  235. footnotes will begin with the number/character set by .FTNO. It is not a heavy
  236. burden on the user to require .FTNO to be use only in the prologue, or at the
  237. top of a page \(Code could be written to hold a FTNO reset to the top of the
  238. next page, but this seemed more trouble than it was worth\) \[\t}Code could be
  239. written to hold a FTNO reset to the top of the next page, but this seemed more
  240. trouble than it was worth\].
  241.  
  242. Footnotes are good candidates for the title of  the most complicated part of JGPrint's
  243. design \[\t}Rivals for complication are horizontal tabs and section numbers.\]
  244. \(Rivals for complication are horizontal tabs and section numbers.\), keeping
  245. track of the required layout, the residue depth on the page, the numbering of
  246. the notes on the page, the vectors in which these are held. This example is
  247. quite a comprehensive test, and other tests have been made. However, this is
  248. an area in which I would not be suprised if I had overlooked some rare
  249. condition.
  250.  
  251. Footnotes are held in store until they can be put out, and this is
  252. space\-consuming; there is always the danger of running out of available space
  253. if your footnote usage resembles the Variorum Edition of Shakespeare's plays.
  254. Footnotes go through several stages af construction and analysis, and I reckon
  255. I am close to the limit of the number of facilities in JGPrint before its
  256. coding spirals out of control. But I had this idea in my bath last night......
  257.  
  258. Footnotes, endnotes, included files and strings and .IF directives can all be
  259. properly nested and will work correctly. However if the nesting is invalid,
  260. chaos will result. This is the major case in which I decided not to go to the
  261. complication of keeping track and providing diagnostics. I reckoned that such
  262. use would be sufficiently rare for users to take a great deal of care when
  263. setting out texts that would require these facilities simultaneously, and that
  264. nesting would not be deep and it would be easy to see that they did not get
  265. knotted. On implementations for larger machines, I could put diagnostics in if
  266. there was a genuine call for them; it would be space\-consuming. With my
  267. fingers crossed, I now demonstrate a footnote in an endnote, and and endnote
  268. from a footnote. \[\t}This endnote has a footnote \(This foootnote comes from
  269. an endnote.\).\] \(This footnote refers to an endnote\[\t}This endnote
  270. qualifies a footnote.\].\).