home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.OVER / s5 < prev    next >
Text File  |  1994-01-25  |  4KB  |  105 lines

  1. @Section
  2.    @Title { Galleys }
  3. @Begin
  4. @PP
  5. The fundamental problem with inserting text, footnotes, and floating
  6. figures into pages is that the process seems impossible to describe in
  7. functional terms.  A footnote is entered within a paragraph of text, but
  8. it appears somewhere else:  at the foot of a page.  Some new abstraction
  9. is needed to explain this.
  10. @PP
  11. The landscape of features that previous document formatting systems have
  12. intro&-duced at this point can best be described metaphorically, as an
  13. antediluvian swamp populated by dinosaurs and demons, whose air is
  14. filled with the piteous cries of docu&-ment format designers in torment.
  15. @PP
  16. Lout's solution to this problem is a feature called the @I galley, after
  17. the metal trays used in manual typesetting.  A galley consists of an
  18. object plus an indication that the object is to appear somewhere other
  19. than its invocation point.  For example,
  20. @ID {
  21. @LittlePageList 1
  22. // @LittleEndRunPlace
  23. //
  24. @LittleText {
  25. @Heading { Galleys }
  26. @PP
  27. The fundamental problem with inserting text, footnotes, and floating
  28. figures into pages is that the process seems impossible to describe in
  29. functional terms.  A footnote is entered within a para&-graph of text, but
  30. it appears somewhere else:  at the foot of a page.  Some new abstraction
  31. is needed to explain this.
  32. }
  33. //
  34. @LittleEndRun
  35. }
  36. is the result of the expression
  37. @ID @Code {
  38. "@PageList 1"
  39. "//"
  40. "@Text {"
  41. "@Heading { Galleys }"
  42. "@PP"
  43. "The fundamental ..."
  44. "... to explain this."
  45. "}"
  46. }
  47. The only new definitions required are these:
  48. @ID @Code {
  49. "def @TextPlace { @Galley }"
  50. ""
  51. "def @Text"
  52. "    into { @TextPlace&&preceding }"
  53. "    right x"
  54. "{ x }"
  55. }
  56. They say that @Code "@TextPlace" (which the reader will recall as lying
  57. within the pages of {@Code "@PageList"}) is a placeholder for an
  58. incoming galley, and that @Code "@Text" is a galley whose result is to
  59. appear, not where @Code "@Text" is invoked, but rather at some
  60. @Code "@TextPlace" preceding that point of invocation in the final
  61. printed document.
  62. @PP
  63. Although the abstraction can be understood in a static way, it is
  64. helpful to trace what happens when the Basser Lout batch formatter reads
  65. the expression above.
  66. @PP
  67. Since @Code "@PageList 1" indirectly con&-tains the special @Code "@Galley"
  68. symbol, it will be expanded only upon demand.  The discovery of the
  69. @Code "@Text" galley initiates a search for a {@Code "@TextPlace"},
  70. which is found within {@Code "@PageList 1"} and so forces one such
  71. expansion.  The available width at this @Code "@TextPlace" is six
  72. inches, so the @Code "@Text" galley is broken into six-inch components
  73. which are promoted one by one until the available height (nine inches)
  74. is exhausted.  Since the @Code "@Text" galley is not entirely consumed,
  75. a forward search of the docu&-ment is made, another @Code "@TextPlace" is
  76. found within the as yet unexpanded {@Code "@PageList 2"}, and the
  77. process is repeated.
  78. @PP
  79. The treatment of footnotes is the same, except that
  80. @ID @Code {
  81. "def @FootNote"
  82. "    into { @FootPlace&&following }"
  83. }
  84. is used to make the footnote appear later in the finished document than its
  85. invocation point.  Basser Lout suspends the promotion of text into pages
  86. just after the component containing the footnote's invocation point is
  87. promoted, switches to the placement of the footnote galley, then resumes
  88. the body text.
  89. @PP
  90. A collection of galleys all targeted to the same place may optionally
  91. appear sorted on a designated key, thus implementing sorted reference
  92. lists and indexes.  The author was obliged to make the sorting option a
  93. primitive feature, since it otherwise seems to require boolean operators
  94. which he preferred to exclude.
  95. @PP
  96. The @Code "@PageList" object which receives the @Code "@Text" galley
  97. can itself be viewed as a galley whose components are pages, and this
  98. leads to a dynamic view of Lout document assembly as a tree of galleys, each
  99. promoting into its parent, with the root galley promoting into the
  100. output file.  For example, the BookLayout package [{@Ref kingston92begin}]
  101. has @Code "@Section" galleys promoting into @Code "@Chapter" galleys
  102. promoting into a single @Code "@PageList" galley, which promotes into
  103. the output; no limit is imposed on the height of the tree.
  104. @End @Section
  105.