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.IMPL / s5.5 < prev    next >
Text File  |  1994-01-25  |  5KB  |  110 lines

  1. @SubSection
  2.     @Tag { horizontal }
  3.     @Title { Horizontal galleys }
  4. @Begin
  5. @PP
  6. There is a strong analogy between breaking a column of text into
  7. page-sized pieces, and breaking a paragraph into line-sized pieces.  In
  8. fact, the two differ only in direction:  vertical for body text,
  9. horizontal for paragraphs.  In this section we define {@I{horizontal
  10. galleys}}, and show how they provide an unlimited number of paragraph
  11. breaking styles, as well as solve some other problems.  Regrettably,
  12. lack of time has prevented their incorporation into the Basser Lout
  13. interpreter.
  14. @PP
  15. Imagine a galley whose components are separated by horizontal
  16. concatenation operators instead of vertical ones, perhaps indicated by a
  17. @Code { horizontally into } clause.  Then all object breaking, including
  18. paragraph breaking, could be replaced by galley component promotion like
  19. this:
  20. @ID @Code {
  21. "def @Paragraph right x"
  22. "{"
  23. "    def @LinePlace { @Galley }"
  24. ""
  25. "    def @LineList"
  26. "    {"
  27. "        @HExpand @LinePlace"
  28. "        //1vx  @LineList"
  29. "    }"
  30. ""
  31. "    def @Par horizontally into { @LinePlace&&preceding }"
  32. "        right x"
  33. "    { x }"
  34. ""
  35. "    @LineList  //  @Par { 0.2i @Wide {}  &0i  x  &1rt }"
  36. "}"
  37. }
  38. The @Code "@HExpand" operator, which is a primitive of Basser Lout,
  39. horizontally expands the gaps in its right parameter until the result
  40. fills the available space, thus implementing line adjustment, except
  41. when the parameter contains tabulation gaps like {@Code "&1rt"}, which
  42. cause the parameter to be already expanded.  The result of
  43. @ID @Code "@Paragraph { A short paragraph of text. }"
  44. would then be something like
  45. @ID 1.5i @Wide {
  46. 0.2i @Wide {} & A short paragraph of text.
  47. }
  48. depending on the available horizontal space.  An unlimited range of
  49. paragraph breaking styles could be defined, including ragged right, ragged
  50. left, break-and-center, and so on.
  51. @PP
  52. In Basser Lout, indented paragraphs are produced by preceding them with
  53. a horizontal concatenation operator, for example {@Code "|0.5i"}.  This
  54. has the unfortunate effect of making an indented paragraph into a single
  55. component of the enclosing galley, so that it will always be kept
  56. together on one page.  Horizontal galleys solve this problem with a
  57. simple change to {@Code "@LineList"}:
  58. @ID @Code {
  59. "def @LineList"
  60. "{"
  61. "    |0.5i  @HExpand @LinePlace"
  62. "    //1vx  @LineList"
  63. "}"
  64. }
  65. showing the flexibility that comes from bringing the full power of the
  66. Lout language to bear on paragraph layout.  It is easy to make provision
  67. for a tag on the first line.
  68. @PP
  69. Although Basser Lout permits receptive symbols within paragraphs, they
  70. are of little use, because their available width is calculated after
  71. paragraph breaking, and the incoming galley cannot spread over more than
  72. one line.  With horizontal galleys, such symbols would have infinite
  73. available width, and we could easily produce a filled paragraph of
  74. footnotes like this:
  75. @ID 3.5i @Wide {
  76. @OneRow { -2p @Font 1 ^/0.3vo } & See Jones and Saunders (1982). &2m
  77. @OneRow { -2p @Font 2 ^/0.3vo } & Or so Jacobsen (1973) asserts. &2m
  78. @OneRow { -2p @Font 3 ^/0.3vo } & {@I ibid}, p. 327.
  79. }
  80. based on an infinite horizontal sequence of @Code "@FootPlace" symbols
  81. inside a horizontal galley.
  82. @PP
  83. When body text is placed on pages, the length of each column varies
  84. depending on the available vertical space.  Horizontal galleys could
  85. analogously produce lines of varying length, and so could fill
  86. non-rectangular shapes.
  87. @PP
  88. An important theoretical benefit of horizontal galleys is that they
  89. would permit horizontal and vertical to be treated in a perfectly
  90. symmetrical way, whereas at present paragraph breaking is horizontal
  91. only, and galley breaking is vertical only.  This must simplify the
  92. treatment of non-European languages which fill in unusual directions,
  93. although it is not itself sufficient to implement them.
  94. @PP
  95. There are a few minor problems with horizontal galleys.  First, the
  96. syntactic overhead of enclosing each paragraph in @Code "@Paragraph { ... }"
  97. or whatever is unacceptable.  Permitting user-defined operators to have lower
  98. precedence than the white space between two words might help here.  Second,
  99. the built-in paragraph breaker includes hyphenation, and it permits line
  100. breaks in the input to determine line breaks in the output, if
  101. desired.  These features must somehow be preserved.  Finally, we have
  102. explained how the Basser Lout interpreter assigns equal width to the
  103. wider columns of tables (Section {@NumberOf style}).  The equivalent
  104. situation in vertical galleys occurs when two receptive symbols compete
  105. for vertical space (e.g. @Code "@TextPlace" and {@Code "@FootSect"}),
  106. and there it is conventional to grant as much as required to the first
  107. arrival.  It is not clear to the author how these different approaches
  108. can be reconciled.
  109. @End @SubSection
  110.