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.LOUT / ch3.02 < prev    next >
Text File  |  1994-01-25  |  12KB  |  299 lines

  1. @Section
  2.    @Title { Concatenation symbols and paragraphs }
  3.    @Tag { concatenation }
  4. @Begin
  5. @PP
  6. There are ten concatenation symbols, in three families:
  7. concatenation. @Index { Concatenation symbols }
  8. @ID @Tab
  9.    vmargin { 0.5vx }
  10.    @Fmta { @Col @Code A ! @Col @Code B ! @Col @Code C ! @Col @Code D ! @Col E }
  11. {
  12. @Rowa A { "/" } B { "^/" } C { "//" } D { "^//" } E { Vertical concatenation }
  13. @Rowa A { "|" } B { "^|" } C { "||" } D { "^||" } E { Horizontal concatenation }
  14. @Rowa A { "&" } B { "^&" } C {      } D {       } E {In-paragraph concatenation}
  15. }
  16. Each symbol produces an object which combines together the two
  17. parameters.  The right parameter must be separated from the symbol by at
  18. least one white space character.
  19. @PP
  20. The vertical concatenation symbol @Code "/" places its left parameter
  21. vertical.concatenation @Index { Vertical concatenation }
  22. above its right parameter with their column marks aligned.  If one
  23. parameter has more column marks than the other, empty columns are
  24. inserted at the right to equalize the numbers.  The variant @Code "//"
  25. ignores column marks and left-justifies the objects.
  26. @PP
  27. The horizontal concatenation symbols @Code "|" and @Code "||" are horizontal
  28. horizontal.concatenation @Index { Horizontal concatenation }
  29. analogues of @Code "/" and {@Code "//"}:  they place their two parameters side
  30. by side, with row mark alignment or top-justification respectively.  The
  31. in.paragraph.concatenation @Index { In-paragraph concatenation }
  32. in-paragraph concatenation symbol @Code "&" produces horizontal concatenation
  33. within a paragraph; its special properties are treated in detail at the
  34. end of this section.
  35. @PP
  36. The concatenation symbols in any one family are {@I{mutually associative}},
  37. which means that
  38. @ID {
  39. @Code "{"  @I x  {@Code "|"}{@I p}  @I y  @Code "}"  {@Code "|"}{@I q}  @I z
  40. }
  41. is always the same as
  42. @ID {
  43. @I x  {@Code "|"}{@I p}  @Code "{"  @I y  {@Code "|"}{@I q}  @I z  @Code "}"
  44. }
  45. for any objects {@I x}, {@I y}, and {@I z}, any gaps @I p and @I q (defined
  46. below), and any choice of {@Code "|"}, {@Code "^|"}, {@Code "||"}, and
  47. {@Code "^||"}.  In practice we always omit such braces, since they are
  48. redundant and can be misleading.  The result of the complete sequence of
  49. concatenations will be called the {@I{whole concatenation object}}, and
  50. the objects which make it up will be called the {@I components}.
  51. @PP
  52. One mark is designated as the {@I {principal mark}}, usually the mark of
  53. principal.mark @Index { Principal mark }
  54. the first component.  A later mark can be chosen for this honour by
  55. attaching {@Code "^"} to the preceding concatenation symbol.  See Section
  56. {@NumberOf onerow} for examples.
  57. @PP
  58. A {@I gap},
  59. gap @Index Gap
  60. specifying the distance between the two
  61. parameters, may follow any concatenation symbol.  There may be no spaces
  62. between a concatenation symbol and its gap.  A missing gap is taken
  63. to be {@Code 0ie}.  The gap is effectively a third parameter of the
  64. concatenation symbol, and it may be an arbitrary object provided that it
  65. evaluates to a juxtaposition of simple words.  In general, the gap must
  66. be enclosed in braces, like this:
  67. @ID @Code {
  68. "//{  @Style&&mystyle @Open { @TopMargin }  }"
  69. }
  70. but the braces may be omitted when the object is a juxtaposition of
  71. simple words or an invocation of a symbol without parameters, as in
  72. @Code "//0.3vx" and {@Code "||@Indent"}.
  73. @PP
  74. A gap consists of a length plus a gap mode.  A @I length
  75. length @Index { Length }
  76. is represented by an decimal number (which may not be negative) followed
  77. by a unit of measurement.  For example, @Code "2.5c" represents the
  78. length 2.5 centimetres.  Figure {@NumberOf units} gives the full selection
  79. of units of measurement.
  80. c.unit @Index { @Code c unit }
  81. p.unit @Index { @Code p unit }
  82. m.unit @Index { @Code m unit }
  83. f.unit @Index { @Code f unit }
  84. s.unit @Index { @Code s unit }
  85. v.unit @Index { @Code v unit }
  86. w.unit @Index { @Code w unit }
  87. b.unit @Index { @Code b unit }
  88. r.unit @Index { @Code r unit }
  89. d.unit @Index { @Code d unit }
  90.  
  91. @BeginFigures
  92. @Figure
  93.    @Caption { The eleven units of measurement provided by Lout. }
  94.    @Tag { units }
  95. @Begin
  96.    @Tab
  97.       vmargin { 0.3v }
  98.       side { yes }
  99.       @Fmta { @Col @Code A ! @Col B }
  100.    {
  101.       @Rowa above { yes } A { c } B { Centimetres. }
  102.       @Rowa A { i } B { Inches.
  103. }
  104.       @Rowa A { p } B { Points ({@Code 72p} = {@Code 1i}).
  105. }
  106.       @Rowa A { m } B { Ems ({@Code 12m} = {@Code 1i}).
  107. }
  108.       @Rowa A { f } B {
  109. One @Code f equals the size of the current font, as specified by
  110. the @@Font symbol (Section {@NumberOf font}).  This unit is
  111. appropriate for lengths that should change with the font size.
  112. }
  113.       @Rowa A { s } B {
  114. One @Code s equals the preferred gap between two words in the
  115. current font, as specified in the definition of the font, or by the
  116. @@Space symbol (Section {@NumberOf break}).
  117. }
  118.       @Rowa A { v } B {
  119. One @Code v equals the current gap between lines introduced during
  120. paragraph breaking, as specified by the @@Break symbol (Section
  121. {@NumberOf break}).  This unit is appropriate for lengths, such as the
  122. spaces between paragraphs, which should change with the inter-line gap.
  123. }
  124.       @Rowa A { w } B {
  125. One @Code w equals the width of the following component, or its height if the
  126. symbol is vertical concatenation.
  127. }
  128.       @Rowa A { b } B {
  129. One @Code b equals the width of the whole concatenation object,
  130. or its height if the symbol is vertical concatenation.
  131. }
  132.       @Rowa A { r } B {
  133. One @Code r equals one @Code b minus one {@Code w}.  This unit is used
  134. for centring and right justification.
  135. }
  136.       @Rowa below { yes } A { d } B {
  137. Degrees.  This unit may only be used with the @Code "@Rotate" symbol.
  138. }
  139.    }
  140. @End @Figure
  141.  
  142. @PP
  143. A gap concludes with a {@I {gap mode}},
  144. gap.mode @Index { Gap mode }
  145. which is a single letter following the length, indicating how the length
  146. is to be measured.  As shown in Figure {@NumberOf gapmodes},
  147.  
  148. @Figure
  149.    @Tag { gapmodes }
  150.    @Caption { The six gap modes provided by Lout. }
  151. @Begin
  152. @Fig {
  153. { /2.5vx Edge-to-edge |0.3i   {@Code "|"} &1p {@I l} &1p {@Code e}
  154.   /4vx Hyphenation    |0.3i   {@Code "|"} &1p {@I l} &1p {@Code h}
  155.   /4vx Overstrike     |0.3i   {@Code "|"} &1p {@I l} &1p {@Code o}
  156.   /4vx Mark-to-mark   |0.3i   {@Code "|"} &1p {@I l} &1p {@Code x}
  157.   /4vx Kerning        |0.3i   {@Code "|"} &1p {@I l} &1p {@Code k}
  158.   /4vx Tabulation     |0.3i   {@Code "|"} &1p {@I l} &1p {@Code t}
  159. }
  160. ||0.5i
  161. @Box margin { 0c } 6c @Wide 13.2c @High 9p @Font
  162. {
  163.   @OneRow {
  164.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  165.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  166.      @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
  167.      @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
  168.   }
  169.   //4vx
  170.   @OneRow {
  171.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  172.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  173.      @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
  174.      @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
  175.   }
  176.   //4vx
  177.   @OneRow {
  178.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  179.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  180.      @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  181.      @At { 1.2c @Wide 1.7c @High } @Put { 3.3c @Wide { &0.5rt @I l } }
  182.   }
  183.   //4vx
  184.   @OneRow {
  185.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  186.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  187.      @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  188.      @At { 1.2c @Wide 1.7c @High }
  189.     @Put 3.3c @Wide { |0.5rt { max( {@I {l, a+b}}) } }
  190.      @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
  191.      @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
  192.      @At { 4c   @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
  193.      @At { 4c   @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
  194.   }
  195.   //4vx
  196.   @OneRow {
  197.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  198.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  199.      @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  200.      @At { 1.2c @Wide 1.7c @High }
  201.     @Put { 3.3c @Wide { |0.5rt max( {@I {l, a, b}})}}
  202.      @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
  203.      @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
  204.      @At { 4c   @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
  205.      @At { 4c   @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
  206.   }
  207.   //4vx
  208.   @OneRow {
  209.      @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  210.      @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  211.      @At { 0.0c @Wide 1.6c @High } @Put { @DoubleArrow 4.0c }
  212.      @At { 2.8c @Wide 1.8c @High } @Put { @I l }
  213.   }
  214.   //5vx
  215.   @DoubleArrow 6c
  216.   //0.1c |0.5rt @I { current bound }
  217. }
  218.  
  219. }
  220. @End @Figure
  221. @EndFigures
  222. with edge-to-edge gap mode
  223. edge.to.edge @Index { Edge-to-edge gap mode }
  224. e.gap.mode @Index { @Code e gap mode }
  225. the length @I l is measured from the trailing edge
  226. of the first object to the leading edge of the second.  Edge-to-edge is the
  227. default mode:  the @Code e may be omitted.  Hyphenation gap mode is
  228. hyphenation.gap @Index { Hyphenation gap mode }
  229. h.gap.mode @Index { @Code h gap mode }
  230. similar, except as explained at the end of this section.
  231. @PP
  232. Mark-to-mark,
  233. mark.to.mark @Index { Mark-to-mark gap mode }
  234. x.gap.mode @Index { @Code x gap mode }
  235. overstrike,
  236. overstrike @Index { Overstrike gap mode }
  237. o.gap.mode @Index { @Code o gap mode }
  238. and kerning
  239. kerning @Index { Kerning gap mode }
  240. k.gap.mode @Index { @Code k gap mode }
  241. measure the length from the last mark
  242. of the first object to the first mark of the second.  In the case of
  243. mark-to-mark, if the length is too small to prevent the objects
  244. overlapping, it is widened until they no longer do.  Kerning also
  245. widens, with the aim of preventing the mark of either object from
  246. overlapping the other object; this mode is used for subscripts and
  247. superscripts.
  248. @PP
  249. tabulation @Index { Tabulation gap mode }
  250. t.gap.mode @Index { @Code t gap mode }
  251. centring @Index { Centring }
  252. right.justif @Index { Right justification }
  253. Tabulation ignores the first object and places the leading edge of the
  254. second object at a distance @I l from the left edge of the whole
  255. concatenation object.  It is the main user of the @Code b and @Code r
  256. units of measurement; for example, @Code "|1rt" will right-justify the
  257. following component, and @Code "|0.5rt" will centre it.
  258. @PP
  259. When two objects are separated only by zero or more white space
  260. white.space.when @SubIndex { when significant }
  261. space.f.when @SubIndex { when significant }
  262. characters (spaces, tabs, and newlines), Lout inserts
  263. {@Code "&"}{@I k}{@Code "s"} between the two objects, where @I k is the
  264. number of spaces.  Precisely, @I k is determined by discarding all space
  265. characters and tabs that precede newlines (these are invisible so are
  266. better ignored), then counting 1 for each newline or space, and 8 for
  267. each tab character.
  268. @PP
  269. A sequence of two or more objects separated by @Code "&" symbols is a
  270. paragraph.breaking.in.detail @SubIndex { in detail }
  271. {@I paragraph}.  Lout breaks paragraphs into lines automatically as
  272. required, by converting some of the @Code "&" symbols into
  273. {@Code "//1vx"}.  Gaps of length 0 (other than hyphenation gaps) are not
  274. eligible for this conversion.  `Optimal' line breaks are chosen, using a
  275. method adapted from @TeX [{@Ref knuth84}].
  276. tex @RawIndex { @TeX }
  277. tex.optimal @SubIndex { optimal paragraph breaking }
  278. @PP
  279. If an @Code "&" symbol whose gap has hyphenation mode
  280. hyphenation @Index { Hyphenation gap mode }
  281. tex.hyphenation @SubIndex { hyphenation }
  282. is chosen for replacement by {@Code "//1vx"}, a hyphen will be appended to
  283. the preceding object, unless that object is a word which already ends with
  284. a hyphen.  For example,
  285. @ID @Code {
  286. Long words may be "hyph &0ih enat &0ih ed."
  287. }
  288. could have the following result, depending where the line breaks fall:
  289. @ID 2i @Wide {
  290. Long words may be hyph &0ih enat &0ih ed.
  291. }
  292. Basser Lout inserts hyphenation gaps automatically as required, again
  293. following the method of @TeX, which approximates the hyphenations in
  294. Webster's dictionary.  To prevent the hyphenation of a single word,
  295. enclose it in quotes.  Further control over paragraph breaking and
  296. hyphenation is provided by the @@Break and @@Space symbols (Sections
  297. {@NumberOf break} and {@NumberOf space}).
  298. @End @Section
  299.