home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / lout / part23 < prev    next >
Encoding:
Text File  |  1993-06-19  |  82.6 KB  |  2,237 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v37i121:  lout - Lout document formatting system, v2, Part23/30
  4. Message-ID: <1993Jun2.030436.28741@sparky.imd.sterling.com>
  5. X-Md4-Signature: 1c5dc73ebcbdf9e0a18048b70904d879
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Wed, 2 Jun 1993 03:04:36 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 37, Issue 121
  13. Archive-name: lout/part23
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lout/doc/tr.fig/s8 lout/doc/tr.impl/s2.4
  21. #   lout/doc/tr.lout/ch1.04 lout/doc/tr.lout/ch3.02
  22. #   lout/doc/tr.lout/ch4.04 lout/font0/Symbo.AFM lout/z27.c
  23. # Wrapped by kent@sparky on Sun May 30 19:44:00 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 23 (of 30)."'
  27. if test -f 'lout/doc/tr.fig/s8' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'lout/doc/tr.fig/s8'\"
  29. else
  30.   echo shar: Extracting \"'lout/doc/tr.fig/s8'\" \(12131 characters\)
  31.   sed "s/^X//" >'lout/doc/tr.fig/s8' <<'END_OF_FILE'
  32. X@Section
  33. X   @Title { A Concise Reference for Fig }
  34. X@Begin
  35. X@PP
  36. XThe options to the @Code "@Fig" symbol, and their
  37. Xdefault values, are as follows.  The complete range of options is shown
  38. Xat right:
  39. X@ID @Tab
  40. X  hmargin { 1s }
  41. X  vmargin { 0.5vx }
  42. X  @Fmth { @Col @Code A ! @Col @Code " " ! @Col @Code B ! @Col @Code " " !
  43. X      @Col 1.0c @Wide ! @Col C }
  44. X  @Fmta { @Col @Code A ! @Col @Code "{" ! @Col @Code B ! @Col @Code "}" !
  45. X      @Col 1.0c @Wide ! @Col C }
  46. X{
  47. X@Rowh
  48. X  A { "@Fig" }
  49. X@Rowa
  50. X  A { "   maxlabels" }
  51. X  B { 200 }
  52. X  C { any whole number }
  53. X@Rowa
  54. X  A { "   linestyle" }
  55. X  B { solid }
  56. X  C { @Code "solid dashed cdashed dotted noline" }
  57. X@Rowa
  58. X  A { "   linewidth" }
  59. X  B { 0.5 pt }
  60. X  C { any Fig length (see below) }
  61. X@Rowa
  62. X  A { "   linecap"   }
  63. X  B { round  }
  64. X  C { @Code "butt round project" }
  65. X@Rowa
  66. X  A { "   dashlength"}
  67. X  B { 0.15 cm }
  68. X  C { any Fig length }
  69. X@Rowa
  70. X  A { "   paint"     }
  71. X  B { nopaint }
  72. X  C { @Code "nopaint white light grey gray dark black" }
  73. X@Rowa
  74. X  A { "   margin"    }
  75. X  B { 0.4c }
  76. X  C { any Lout length }
  77. X@Rowa
  78. X  A { "   arrow"     }
  79. X  B { noarrow }
  80. X  C { @Code "noarrow forward back both" }
  81. X@Rowa
  82. X  A { "   headstyle" }
  83. X  B { open }
  84. X  C { @Code "open halfopen closed" }
  85. X@Rowa
  86. X  A { "   headwidth" }
  87. X  B { 0.05 cm }
  88. X  C { any Fig length }
  89. X@Rowa
  90. X  A { "   headlength"}
  91. X  B { 0.15 cm }
  92. X  C { any Fig length }
  93. X}
  94. XThe @Code "linecap" option determines the shape of the ends of lines:
  95. X@Code "round" puts a round cap on them, which is the most useful in
  96. XFig;  @Code "butt" is a square end; and @Code "project" is a square end
  97. Xprojecting half a line width past the end of the line; it is useful for
  98. Xgetting sharp corners on rectangles and square dots in dotted lines.
  99. X@FootNote {
  100. XThe line joining options of PostScript are not reflected in Fig options
  101. Xbecause Fig strokes paths segment by segment, not all at once, and so
  102. Xthere are no line joins in the PostScript sense.  This was done to
  103. Ximprove the appearance of dashed and dotted lines.
  104. X}
  105. X@PP
  106. XThe following standard shapes take the same options as {@Code "@Fig"},
  107. Xexcept that they do not have @Code "maxlabels" or the last four
  108. X(arrow-drawing) options,
  109. Xand occasionally they have other options.  In most cases the default
  110. Xvalues of these options are taken from the enclosing {@Code "@Fig"}.
  111. XWhere there are extra options, or where a different default value is
  112. Xused, the option and its default value are shown.  The list also shows
  113. Xthe shape's labels, and how it is superimposed on its right parameter
  114. X(shown as a grey rectangle).  A larger margin will enlarge the right
  115. Xparameter and hence the shape as well.  Squares, polygons and circles
  116. Xhave a diameter equal to the larger of @Code xsize and {@Code ysize}.
  117. X@LP
  118. X@ID {
  119. X5c @Wide @Code "@Box"
  120. X||7ct
  121. X@Fig {
  122. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  123. Xlinestyle { noline }  margin { 0c }
  124. X@Box margin { 0c }
  125. X{ 2c @Wide 1c @High }
  126. X// @ShowLabels
  127. X}
  128. X}
  129. X
  130. X@LP
  131. X@ID {
  132. X5c @Wide @Code "@Square"
  133. X||7ct
  134. X@Fig {
  135. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  136. Xlinestyle { noline }  margin { 0c }
  137. X@Square margin { 0c }
  138. X{ 2c @Wide 1c @High }
  139. X// @ShowLabels
  140. X}
  141. X}
  142. X@LP
  143. X
  144. X@ID {
  145. X5c @Wide @Code "@Diamond"
  146. X||7ct
  147. X@Fig {
  148. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  149. Xlinestyle { noline }  margin { 0c }
  150. X@Diamond margin { 0c }
  151. X{ 2c @Wide 1c @High }
  152. X// @ShowLabels
  153. X}
  154. X}
  155. X
  156. X@LP
  157. X@ID {
  158. X5c @Wide @Code {
  159. X"@Polygon"
  160. X"   sides { 3 }"
  161. X"   angle { 180/sides }"
  162. X}
  163. X||7ct
  164. X@Fig {
  165. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  166. Xlinestyle { noline }  margin { 0c }
  167. X@Polygon margin { 0c }
  168. X{ 2c @Wide 1c @High }
  169. X|| @ShowLabels ||0.5c ... ||0.5c
  170. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  171. Xlinestyle { noline }  margin { 0c }
  172. X@Polygon sides { 12 } margin { 0c }
  173. X{ 2c @Wide 1c @High }
  174. X||1c ...
  175. X// @ShowLabels
  176. X}
  177. X}
  178. X
  179. X@ID {
  180. X5c @Wide @Code "@Ellipse"
  181. X||7ct
  182. X@Fig {
  183. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  184. Xlinestyle { noline }  margin { 0c }
  185. X@Ellipse margin { 0c }
  186. X{ 2c @Wide 1c @High }
  187. X// @ShowLabels
  188. X}
  189. X}
  190. X
  191. X@LP
  192. X@ID {
  193. X5c @Wide @Code "@Circle"
  194. X||7ct
  195. X@Fig {
  196. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  197. Xlinestyle { noline }  margin { 0c }
  198. X@Circle margin { 0c }
  199. X{ 2c @Wide 1c @High }
  200. X// @ShowLabels
  201. X}
  202. X}
  203. X@LP
  204. X
  205. XThe following standard shapes have the same options as
  206. X{@Code "@Fig"}, including the four arrow-drawing options,
  207. Xand occasionally they have others.  In each case the only difference
  208. Xbetween the line and arrow symbols is the default value of
  209. X{@Code "arrow"}, which lines take from {@Code "@Fig"} and arrows set
  210. Xto {@Code "forward"}.  The first four draw a line along the mark of the
  211. Xright parameter, which is not necessarily the same as its left or top
  212. Xedge.
  213. X@LP
  214. X@ID {
  215. X5c @Wide @Code {
  216. X"@HLine"
  217. X"   margin { 0c }"
  218. X}
  219. X||7ct
  220. X@Fig {
  221. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  222. Xlinestyle { noline }  margin { 0c }
  223. X@HLine
  224. X{ 2c @Wide 1c @High }
  225. X// @ShowLabels
  226. X}
  227. X}
  228. X
  229. X@ID {
  230. X5c @Wide @Code {
  231. X"@HArrow"
  232. X"   margin { 0c }"
  233. X"   arrow { forward }"
  234. X}
  235. X||7ct
  236. X@Fig {
  237. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  238. Xlinestyle { noline }  margin { 0c }
  239. X@HArrow
  240. X{ 2c @Wide 1c @High }
  241. X// @ShowLabels
  242. X}
  243. X}
  244. X
  245. X@ID {
  246. X5c @Wide @Code {
  247. X"@VLine"
  248. X"   margin { 0c }"
  249. X}
  250. X||7ct
  251. X@Fig {
  252. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  253. Xlinestyle { noline }  margin { 0c }
  254. X@VLine
  255. X{ 2c @Wide 1c @High }
  256. X// @ShowLabels
  257. X}
  258. X}
  259. X
  260. X@ID {
  261. X5c @Wide @Code {
  262. X"@VArrow"
  263. X"   margin { 0c }"
  264. X"   arrow { forward }"
  265. X}
  266. X||7ct
  267. X@Fig {
  268. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  269. Xlinestyle { noline }  margin { 0c }
  270. X@VArrow
  271. X{ 2c @Wide 1c @High }
  272. X// @ShowLabels
  273. X}
  274. X}
  275. X
  276. X@ID {
  277. X5c @Wide @Code {
  278. X"@Line"
  279. X"   from { 0 ysize }"
  280. X"   to { xsize 0 }"
  281. X"   margin { 0c }"
  282. X}
  283. X||7ct
  284. X@Fig {
  285. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  286. Xlinestyle { noline }  margin { 0c }
  287. X@Line
  288. X{ 2c @Wide 1c @High }
  289. X// @ShowLabels
  290. X}
  291. X}
  292. X
  293. X@ID {
  294. X5c @Wide @Code {
  295. X"@Arrow"
  296. X"   from { 0 ysize }"
  297. X"   to { xsize 0 }"
  298. X"   margin { 0c }"
  299. X"   arrow { forward }"
  300. X}
  301. X||7ct
  302. X@Fig {
  303. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  304. Xlinestyle { noline }  margin { 0c }
  305. X@Arrow
  306. X{ 2c @Wide 1c @High }
  307. X// @ShowLabels
  308. X}
  309. X}
  310. X
  311. X@ID {
  312. X5c @Wide @Code {
  313. X"@Arc"
  314. X"   from { 0 ysize }"
  315. X"   to { xsize 0 }"
  316. X"   ctr { 0 0 }"
  317. X"   direction { clockwise }"
  318. X"   margin { 0c }"
  319. X}
  320. X||7ct
  321. X@Fig {
  322. X@Figure shape { 0 0 xsize 0 xsize ysize 0 ysize 0 0 } paint { grey }
  323. Xlinestyle { noline }  margin { 0c }
  324. X@Arc
  325. X{ 2c @Wide 1c @High }
  326. X// @ShowLabels
  327. X}
  328. X}
  329. X
  330. XMore generally, the @Code "@Figure" symbol takes all the options of
  331. X@Code "@Fig" except {@Code "maxlabels"}, together with a @Code shape
  332. Xoption containing a sequence of points, and it connects each pair of
  333. Xpoints by a line or curve as specified by the following:
  334. X@ID @Tab
  335. X   vmargin { 0.5vx }
  336. X   @Fmta { @Col A ! @Col B }
  337. X{
  338. X@Rowa
  339. X  A { @I { point  point } }
  340. X  B { Straight line }
  341. X@Rowa
  342. X  A { @I { point } @Code "[" &0.5s @Code "]" @I { point } }
  343. X  B { Draw nothing }
  344. X@Rowa
  345. X  A { @I { point } @Code "[" @I point @Code "]" @I { point } }
  346. X  B { Anticlockwise circular or elliptical arc }
  347. X@Rowa
  348. X  A { @I { point } @Code "[" @I point @Code "clockwise ]" @I { point } }
  349. X  B { Clockwise circular or elliptical arc }
  350. X@Rowa
  351. X  A { @I { point } @Code "[" @I {point point} @Code "]" @I { point } }
  352. X  B { Bezier curve with two control points }
  353. X}
  354. X@LP
  355. XThe remaining symbols do not draw shapes.  They are
  356. X@ID lines @Break {
  357. X@I colour  @Code "@Colour"  @I object
  358. X@I colour  @Code "@Color"  @I object
  359. X}
  360. XPrint @I object in {@I colour}, which may be {@Code "white"},
  361. X{@Code "grey"}, {@Code "gray"}, {@Code "black"}, {@Code "red"},
  362. X{@Code "green"}, or {@Code "blue"} at least.
  363. X@ID lines @Break {
  364. X@Code "{" @I {number number number} @Code "} @RGBColour"  @I object
  365. X@Code "{" @I {number number number} @Code "} @RGBColor"  @I object
  366. X@Code "{" @I {number number number} @Code "} @HSBColour"  @I object
  367. X@Code "{" @I {number number number} @Code "} @HSBColor"  @I object
  368. X}
  369. XPrint @I object in the colour defined by the three numbers, using the
  370. Xred-green-blue or hue-saturation-brightness colour models.
  371. X@ID {
  372. X@I point  @Code "@Label"  @I label
  373. X}
  374. XWithin a shape, makes @I label stand for the point on the page denoted
  375. Xby {@I point}, which is not made part of the shape.  The label applies
  376. Xfrom here onwards until some other point is given this label, a
  377. Xrelabelling occurs, or the figure ends.
  378. X@ID {
  379. X@I label  @Code "::"  @I object
  380. X}
  381. XRelabel every labelled point in the right parameter (which may be an
  382. Xarbitrary Lout object), by adding {@I label}{@Code "@"} to the front of
  383. Xeach label.
  384. X@ID {
  385. X@Code "@Frame"  @I object
  386. X}
  387. XEquivalent to @Code "@Figure shape {xsize 0 @Label X 0 ysize @Label Y}"
  388. X@I object & .
  389. X@ID {
  390. X@I point  @Code "@BaseOf"  @I object
  391. X}
  392. XTranslate @I object so that its bottom left-hand corner appears at
  393. X{@I point}.  Lout thinks that the result is an empty object.
  394. X@ID {
  395. X@I point  @Code "@MarkOf"  @I object
  396. X}
  397. XTranslate @I object so that the point where its marks cross appears at
  398. X{@I point}.  Lout thinks that the result is an empty object.
  399. X@ID {
  400. X@Code "@ShowLabels"
  401. X}
  402. XDisplay all the labels of the figure created up to this point.
  403. X@PP
  404. XThe following lists define all the ways to specify lengths, angles and
  405. Xpoints.
  406. X@FootNote {
  407. XA length is represented in PostScript by a single number on the operand
  408. Xstack; so is an angle.  A point is represented by two numbers on the
  409. Xstack.  Those familiar with PostScript and willing to sacrifice portability
  410. Xand increase their risk of error can therefore write, for example,
  411. X@OneCol {@I length @Code "sqrt"} within a shape, to obtain a length which
  412. Xis the square root of another length, or @OneCol { @I point @Code "exch" }
  413. Xto obtain the reflection of a point about the main diagonal, and so on.
  414. X}
  415. XBrief explanations appear to the right, with the symbols' precedences in
  416. Xparentheses where appropriate.
  417. X@DP
  418. X@Tab
  419. X  vmargin { 0.5vx }
  420. X  @Fmth { @Col { &@DispIndent     A } ! @Col   }
  421. X  @Fmta { @Col { &@DispIndent &2s A } ! @Col B }
  422. X{
  423. X@Rowh A { @I length } vmargin { 0.2vx }
  424. X@Rowh
  425. X@Rowa
  426. X  A { 0 }
  427. X  B { zero }
  428. X@Rowa
  429. X  A { @Code xmark }
  430. X  B { distance to column mark }
  431. X@Rowa
  432. X  A { @Code ymark }
  433. X  B { distance to row mark }
  434. X@Rowa
  435. X  A { @Code xsize }
  436. X  B { distance to right boundary }
  437. X@Rowa
  438. X  A { @Code ysize }
  439. X  B { distance to top boundary }
  440. X@Rowa
  441. X  A { @I number @Code in }
  442. X  B { @I number inches (39) }
  443. X@Rowa
  444. X  A { @I number @Code cm }
  445. X  B { @I number centimetres (39) }
  446. X@Rowa
  447. X  A { @I number @Code pt }
  448. X  B { @I number points (39) }
  449. X@Rowa
  450. X  A { @I number @Code em }
  451. X  B { @I number ems (39) }
  452. X@Rowa
  453. X  A { @I number @Code sp }
  454. X  B { 1 sp is the current width of a space (39) }
  455. X@Rowa
  456. X  A { @I number @Code vs }
  457. X  B { 1 vs is the current inter-line space (39) }
  458. X@Rowa
  459. X  A { @I number @Code ft }
  460. X  B { 1 ft is the size of the current font (39) }
  461. X@Rowa
  462. X  A { @I point @Code "@Distance" @I point }
  463. X  B { distance between two points (35) }
  464. X@Rowa
  465. X  A { @I point @Code "@XDistance" @I point }
  466. X  B { horizontal distance between two points (35) }
  467. X@Rowa
  468. X  A { @I point @Code "@YDistance" @I point }
  469. X  B { vertical distance between two points (35) }
  470. X@Rowh
  471. X@Rowh
  472. X@Rowh A { @I angle } vmargin { 0.2vx }
  473. X@Rowh
  474. X@Rowa
  475. X  A { @I number @Code dg }
  476. X  B { @I number degrees (39) }
  477. X@Rowa
  478. X  A { @I number }
  479. X  B { @I number degrees (@Code dg is optional) }
  480. X@Rowa
  481. X  A { @I point @Code "@Angle" @I point }
  482. X  B { angle from first point to second (35) }
  483. X@Rowh
  484. X@Rowh
  485. X@Rowh A { @I point } vmargin { 0.2vx }
  486. X@Rowh
  487. X@Rowa
  488. X  A { @I {length  length} }
  489. X  B { @I x and @I y distance from origin (5) }
  490. X@Rowa
  491. X  A { @I length  @Code "<<"  @I angle }
  492. X  B { distance and angle from origin (38) }
  493. X@Rowa
  494. X  A { @I point  @Code "++"  @I point }
  495. X  B { vector sum of two points (36) }
  496. X@Rowa
  497. X  A { @I point  @Code "--"  @I point }
  498. X  B { vector difference of two points (36) }
  499. X@Rowa
  500. X  A { @I point  @Code "@Max"  @I point }
  501. X  B { vector maximum of two points (36) }
  502. X@Rowa
  503. X  A { @I point  @Code "@Min"  @I point }
  504. X  B { vector minimum of two points (36) }
  505. X@Rowa
  506. X  A { @I point  @Code "**"  @I number }
  507. X  B { multiplication of point by number (37) }
  508. X@Rowa
  509. X  A { @I label }
  510. X  B {  a previously defined label }
  511. X@Rowa
  512. X  A { @Code "@Prev"     }
  513. X  B {  the previous point in a shape }
  514. X}
  515. X@End @Section
  516. END_OF_FILE
  517.   if test 12131 -ne `wc -c <'lout/doc/tr.fig/s8'`; then
  518.     echo shar: \"'lout/doc/tr.fig/s8'\" unpacked with wrong size!
  519.   fi
  520.   # end of 'lout/doc/tr.fig/s8'
  521. fi
  522. if test -f 'lout/doc/tr.impl/s2.4' -a "${1}" != "-c" ; then 
  523.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s2.4'\"
  524. else
  525.   echo shar: Extracting \"'lout/doc/tr.impl/s2.4'\" \(12152 characters\)
  526.   sed "s/^X//" >'lout/doc/tr.impl/s2.4' <<'END_OF_FILE'
  527. X@SubSection
  528. X    @Tag { objects.impl }
  529. X    @Title { Implementation of objects and concatenation }
  530. X@Begin
  531. X@PP
  532. XIn this section we discuss the implementation of objects and concatenation,
  533. Xand especially mark alignment.  The first step is to use an operator
  534. Xprecedence parser to convert input such as
  535. X@ID @Code "a  |0.5i  b  /0.2i  c  |  d"
  536. Xinto parse trees such as
  537. X@ID @Eq {
  538. X@Fig {
  539. X@Tree {
  540. X@Node @FCircle fraction
  541. X@FirstSub {
  542. X   @Node @FCircle bar
  543. X   @FirstSub { @Node @FCircle a }
  544. X   @NextSub  { @Node @FEllipse 0.5i }
  545. X   @NextSub  { @Node @FCircle b }
  546. X}
  547. X@NextSub { @Node @FEllipse 0.2i }
  548. X@NextSub {
  549. X   @Node @FCircle bar
  550. X   @FirstSub { @Node @FCircle c }
  551. X   @NextSub  { @Node @FCircle   }
  552. X   @NextSub  { @Node @FCircle d }
  553. X}
  554. X}
  555. X}
  556. X}
  557. XMissing objects are replaced by empty objects, and sequences of
  558. Xconcatenation operators are consolidated:
  559. X@ID @Eq {
  560. X@Fig {
  561. X@Tree {
  562. X@Node @FCircle bar
  563. X@FirstSub { @Node @FCircle a }
  564. X@NextSub { @Node @FEllipse 0.2i }
  565. X@NextSub {
  566. X   @Node @FCircle bar
  567. X   @FirstSub { @Node @FCircle c     }
  568. X   @NextSub  { @Node @FEllipse 0.3i }
  569. X   @NextSub  { @Node @FCircle d     }
  570. X}
  571. X}
  572. X}
  573. X&2m ==> &2m
  574. X@Fig {
  575. X@Tree {
  576. X@Node @FCircle bar
  577. X@FirstSub { @Node @FCircle a     }
  578. X@NextSub  { @Node @FEllipse 0.2i }
  579. X@NextSub  { @Node @FCircle c     }
  580. X@NextSub  { @Node @FEllipse 0.3i }
  581. X@NextSub  { @Node @FCircle d     }
  582. X}
  583. X}
  584. X}
  585. Xto make manifest their associativity and reduce the depth of the tree
  586. Xfor efficiency later.
  587. X@PP
  588. XThe required semantic information is the size of each subobject,
  589. Xconsisting of four integers:  width to left and right of the
  590. Xdistinguished column mark, and height above and below the distinguished
  591. Xrow mark.  These numbers are always non-negative in Basser Lout, but
  592. Xthis restriction is unnecessary and should be dropped.
  593. X@PP
  594. XFor the leaves, which are simple words, the numbers are obtained from
  595. Xfont tables.  For the higher levels we apply recursive rules.  Suppose
  596. Xthat @Eq { hgap(x, g, y) } returns the desired distance between the
  597. Xcolumn marks of objects @Eq { x } and @Eq { y } when they are separated by
  598. Xgap @Eq { g }:  @Eq { right(x) + length(g) + left(y) } when the gap mode is
  599. Xedge-to-edge, the larger of @Eq { length(g) } and
  600. X@Eq { right(x) + left(y) } when the mode is mark-to-mark, and so on.  Given
  601. Xan object
  602. X@ID @Eq {
  603. XX = x sub 1 ````` bar g sub 1 ````` ... ````` { "-2p" @Font "^"}bar g sub i-1
  604. X````` x sub i ````` ... ````` bar g sub n-1 ````` x sub n
  605. X}
  606. Xwe may calculate its size as follows:
  607. X@ID @Eq {
  608. Xleft(X) ^= left( x sub 1 ) + hgap( x sub 1 , g sub 1 , x sub 2 )
  609. X+ ... + hgap( x sub i-1 , g sub i-1 , x sub i )
  610. X/1.4vx
  611. Xright(X) ^= hgap( x sub i , g sub i , x sub i+1 )
  612. X+ ... + hgap( x sub n-1 , g sub n-1 , x sub n ) + right( x sub n )
  613. X/1.4vx
  614. X"above"(X) ^= "above"(x sub 1 ) up ... up "above"(x sub n )
  615. X/1.4vx
  616. X"below"(X) ^= "below"(x sub 1 ) up ... up "below"(x sub n )
  617. X}
  618. Xwhere @Eq { non up } returns the larger of its two parameters.  Similar
  619. Xformulas are easily derived for the other operators.
  620. X@PP
  621. XFor purposes of exposition we will now make the simplifying
  622. Xassumptions that all gaps are {@Code "0i"}, all column marks lie at
  623. Xthe left edge, and all row marks lie at the top edge.  Then the size
  624. Xof each object can be expressed by just two numbers, width and
  625. Xheight, and the four formulas reduce to
  626. X@ID @Eq {
  627. Xwidth( x sub 1 rel bar ... rel bar x sub n ) ^=
  628. Xwidth( x sub 1 ) + ... + width( x sub n )
  629. X/1.4vx
  630. Xheight( x sub 1 rel bar ... rel bar x sub n ) ^=
  631. Xheight( x sub 1 ) up ... up height( x sub n )
  632. X}
  633. XThe corresponding formulas for vertical concatenation are
  634. X@ID @Eq {
  635. Xwidth( x sub 1 rel "/" ... rel "/" x sub n ) ^=
  636. Xwidth( x sub 1 ) up ... up width( x sub n )
  637. X/1.4vx
  638. Xheight( x sub 1 rel "/" ... rel "/" x sub n ) ^=
  639. Xheight( x sub 1 ) + ... + height( x sub n )
  640. X}
  641. XAccording to these formulas, the height of
  642. X@ID @Eq { @Fig { @Tree {
  643. X@Node @FCircle fraction
  644. X@LeftSub {
  645. X   @Node @FCircle bar
  646. X   @LeftSub  { @Node @FCircle a }
  647. X   @RightSub { @Node @FCircle b }
  648. X}
  649. X@RightSub {
  650. X   @Node @FCircle bar
  651. X   @LeftSub  { @Node @FCircle c }
  652. X   @RightSub { @Node @FCircle d }
  653. X}
  654. X}}}
  655. Xis
  656. X@ID @Eq {
  657. X[ height(a) up height(b)] + [ height(c) up height(d)]
  658. X}
  659. Xwhich is correct, but for width they yield
  660. X@ID @Eq {
  661. X[ width(a) + width(b)] up [ width(c) + width(d)]
  662. X}
  663. Xwhich is not, since it does not take the merging of column marks into
  664. Xaccount.  The asymmetry between horizontal and vertical has come
  665. Xabout because the row entries, such as @Eq {a} and {@Eq {b}}, are
  666. Xadjacent in the tree, but the column entries, such as @Eq {a} and
  667. X{@Eq {c}}, are not.  It would be possible to solve this cross-linking
  668. Xproblem by augmenting the size information stored in each node to
  669. Xrecord the number of marks and the size of each, but the author has
  670. Xpreferred the following method which makes structural changes to the
  671. Xtree instead.
  672. X@PP
  673. XIf @Eq { a } and @Eq { c } share a column mark, they each might as well
  674. Xhave width { @Eq {width(a) up width(c) }}, since all width calculations
  675. Xapply to entire columns.  Accordingly, we introduce a new operator,
  676. X@Eq {COL}, defined by
  677. X@ID @Eq { width( x sub 1 bin COL ... bin COL x sub n ) =
  678. Xwidth( x sub 1 ) up ... up width( x sub n )
  679. X}
  680. Xand replace both @Eq { a } and @Eq { c } by {@Eq { a bin COL c }}.  To
  681. Xprevent @Eq { COL } operators from disturbing height calculations, we
  682. Xdefine a binary operator called @Eq { SPLIT } by
  683. X@ID @Eq { width( x bin SPLIT y) ^= width(x)
  684. X/1.4vx
  685. Xheight( x bin SPLIT y) ^= height(y) }
  686. Xwhich switches height and width calculations onto different
  687. Xsubtrees.  Then the transformation
  688. X@ID @Eq {
  689. X@Fig { @Tree {
  690. X   @Node @FCircle a
  691. X}}
  692. X&2m ==> &2m
  693. X@Fig { @Tree {
  694. X   @Node @FEllipse SPLIT
  695. X   @LeftSub {
  696. X      @Node @FEllipse COL
  697. X      @LeftSub  { @Node @FCircle a }
  698. X      @RightSub { @Node @FCircle c }
  699. X   }
  700. X   @RightSub { @Node @FCircle a }
  701. X}}
  702. X}
  703. X# where @Eq { S } denotes a @Eq { SPLIT } node and @Eq { C } denotes a
  704. X# @Eq { COL } node,
  705. Xwidens @Eq { a } to @Eq {width(a) up width(c) } without affecting its height;
  706. Xit is applied to every object that shares its column mark with at least
  707. Xone other object.  A similar transformation involving a @Eq { ROW } operator
  708. Xdeals with shared row marks.  The effect on our little table is to replace
  709. X@ID @Eq { @Fig { @Tree {
  710. X@Node @FCircle fraction
  711. X@LeftSub {
  712. X   @Node @FCircle bar
  713. X   @LeftSub  { @Node @FCircle a }
  714. X   @RightSub { @Node @FCircle b }
  715. X}
  716. X@RightSub {
  717. X   @Node @FCircle bar
  718. X   @LeftSub  { @Node @FCircle c }
  719. X   @RightSub { @Node @FCircle d }
  720. X}
  721. X}}}
  722. Xby
  723. X@ID @Eq { @Fig maxlabels { "70" } { @Tree hmargin { "0.1c" } {
  724. X@Node @FCircle fraction
  725. X@FirstSub {
  726. X   @Node @FCircle bar
  727. X   @FirstSub  {
  728. X      @Node @FEllipse SPLIT
  729. X      @FirstSub {
  730. X         @Node @FEllipse COL
  731. X         @FirstSub  { @Node @FCircle a }
  732. X         @NextSub { @Node @FCircle c }
  733. X      }
  734. X      @NextSub {
  735. X         @Node @FEllipse ROW
  736. X         @FirstSub  { @Node @FCircle a }
  737. X         @NextSub { @Node @FCircle b }
  738. X      }
  739. X   }
  740. X   @NextSub {
  741. X      @Node @FEllipse SPLIT
  742. X      @FirstSub {
  743. X         @Node @FEllipse COL
  744. X         @FirstSub  { @Node @FCircle b }
  745. X         @NextSub { @Node @FCircle d }
  746. X      }
  747. X      @NextSub {
  748. X         @Node @FEllipse ROW
  749. X         @FirstSub  { @Node @FCircle a }
  750. X         @NextSub { @Node @FCircle b }
  751. X      }
  752. X   }
  753. X}
  754. X@NextSub {
  755. X   @Node @FCircle bar
  756. X   @FirstSub  {
  757. X      @Node @FEllipse SPLIT
  758. X      @FirstSub {
  759. X         @Node @FEllipse COL
  760. X         @FirstSub  { @Node @FCircle a }
  761. X         @NextSub { @Node @FCircle c }
  762. X      }
  763. X      @NextSub {
  764. X         @Node @FEllipse ROW
  765. X         @FirstSub  { @Node @FCircle c }
  766. X         @NextSub { @Node @FCircle d }
  767. X      }
  768. X   }
  769. X   @NextSub {
  770. X      @Node @FEllipse SPLIT
  771. X      @FirstSub {
  772. X         @Node @FEllipse COL
  773. X         @FirstSub  { @Node @FCircle b }
  774. X         @NextSub { @Node @FCircle d }
  775. X      }
  776. X      @NextSub {
  777. X         @Node @FEllipse ROW
  778. X         @FirstSub  { @Node @FCircle c }
  779. X         @NextSub { @Node @FCircle d }
  780. X      }
  781. X   }
  782. X}
  783. X}}}
  784. XIn fact, common subexpressions are identified (trivially) and the result
  785. Xis a directed acyclic graph; each affected leaf has two parents, one for
  786. Xwidth and one for height; and each @Eq { COL } or @Eq { ROW } node has
  787. Xone parent and one child for each object lying on the corresponding
  788. Xmark.  The data structure roughly doubles in size, and this occurs only
  789. Xrarely in practice.
  790. X@PP
  791. XThis method can cope with any legal input, including
  792. X@ID @Code {
  793. X"{  a  //  c  |  d  }  |  {  b  /  e  }"
  794. X"/  {  f  /  i  }  |  {  g  |  h  //  j  }"
  795. X}
  796. Xwhich produces overlapping spanning columns:
  797. X@ID @I @Fig {
  798. X    @FBox margin { 0.2c } width { 1.6c } 1.2f @Font a |
  799. X    @FBox margin { 0.2c } width { 0.6c } 1.2f @Font b |
  800. X//  @FBox margin { 0.2c } width { 0.6c } 1.2f @Font c |
  801. X    @FBox margin { 0.2c } width { 0.6c } 1.2f @Font d |
  802. X    @FBox margin { 0.2c } width { 0.6c } 1.2f @Font e |
  803. X//  @FBox margin { 0.2c } width { 0.6c } 1.2f @Font f |
  804. X    @FBox margin { 0.2c } width { 0.6c } 1.2f @Font g |
  805. X    @FBox margin { 0.2c } width { 0.6c } 1.2f @Font h |
  806. X//  @FBox margin { 0.2c } width { 0.6c } 1.2f @Font i |
  807. X    @FBox margin { 0.2c } width { 1.6c } 1.2f @Font j |
  808. X}
  809. XThe boxes have been added to clarify the structure.  The width of this
  810. Xobject is formally
  811. X@ID @Eq { ((width(a) up (x + y)) + z) up (x + ((y + z) up width(j))) }
  812. Xwhere
  813. X@IL
  814. X@ListItem @Eq { x = width(c) up width(`f`) up width(i) }
  815. X@ListItem @Eq { y = width(d`) up width(g) }
  816. X@ListItem @Eq { z = width(b) up width(e) up width(h) }
  817. X@EL
  818. XIt seems clear that @Eq { y } at least must appear twice in any
  819. Xexpression for the width of this object made out of simple addition
  820. Xand maxing operations, showing that an ordinary tree
  821. Xstructure is insufficient for overlapping spanning columns.  The Basser
  822. XLout interpreter actually rejects such structures, owing to the author's
  823. Xdoubts about the implementability of @I Constrained and @I AdjustSize
  824. X(Section {@NumberOf constraints}) on them; but with hindsight this caution
  825. Xwas unnecessary.
  826. X@PP
  827. XThe directed acyclic graph is ordered in the sense that the order of
  828. Xthe edges entering and leaving each node matters.  The structure is
  829. Xhighly dynamic, and traversals both with and against the arrows are
  830. Xrequired.  After a few ad-hoc attempts to extend the usual tree
  831. Xrepresentation had failed, the author developed a representation based
  832. Xon doubly linked lists of records denoting links, whose flexibility more
  833. Xthan compensated for the somewhat excessive memory consumption.  For example,
  834. X@ID @Eq { @Fig {
  835. X       A:: @FCircle a   |2c                  |2c  B:: @FCircle b
  836. X/1.5c  C:: @FCircle c   |    D:: @FCircle d
  837. X// A @JoinFigures arrow { forward } C
  838. X// A @JoinFigures arrow { forward } D
  839. X// B @JoinFigures arrow { forward } D
  840. X}}
  841. Xis represented by
  842. X@CD @Eq { @Fig maxlabels { "300" } {
  843. XA:: @DagBox mid { @BlackDot } base { a } |2c |2c |2c |2c
  844. XB:: @DagBox mid { @BlackDot } base { b }
  845. X/1c L:: @DagBox top { @BlackDot } mid { @BlackDot } base { LK }
  846. X|   M:: @DagBox top { @BlackDot } mid { @BlackDot } base { LK }
  847. X| | N:: @DagBox top { @BlackDot } mid { @BlackDot } base { LK }
  848. X/1c
  849. XC:: @DagBox top { @BlackDot } base { c } | |
  850. XD:: @DagBox top { @BlackDot } base { d }
  851. X// @TVShape nw { A@MID@CTR } ne { A@MID@CTR } sw {L@MID@CTR } se { M@MID@CTR }
  852. X// @TVShape nw { L@TOP@CTR } ne { L@TOP@CTR } sw {C@TOP@CTR } se { C@TOP@CTR }
  853. X// @TVShape nw { M@TOP@CTR } ne { N@TOP@CTR } sw {D@TOP@CTR } se { D@TOP@CTR }
  854. X// @TVShape nw { B@MID@CTR } ne { B@MID@CTR } sw {N@MID@CTR } se { N@MID@CTR }
  855. X}}
  856. Xwhere @Eq { LK } tags a record representing a link.  The first list
  857. Xin any node contains all the incoming links, the second contains the
  858. Xoutgoing ones.  The node serves as the header for both lists.  The
  859. Xrequired operations reduce to simple appends, deletes, and traversals
  860. Xof doubly linked lists, all having small constant cost.  There is a
  861. Xhighly tuned memory allocator, and care is taken to dispose of each node
  862. Xwhen the last incoming link is deleted, so that there is no need for
  863. Xgarbage collection.
  864. X@PP
  865. XIn normal use the number of nodes at higher levels of the dag is small
  866. Xin comparison with the leaves and their incoming links, so we may
  867. Xestimate the space complexity at about 60 bytes per input word (20 bytes
  868. Xper link, 40 per leaf node).  Careful optimization could easily halve
  869. Xthis, but since memory is reclaimed after printing each page there is
  870. Xlittle need.
  871. X@End @SubSection
  872. END_OF_FILE
  873.   if test 12152 -ne `wc -c <'lout/doc/tr.impl/s2.4'`; then
  874.     echo shar: \"'lout/doc/tr.impl/s2.4'\" unpacked with wrong size!
  875.   fi
  876.   # end of 'lout/doc/tr.impl/s2.4'
  877. fi
  878. if test -f 'lout/doc/tr.lout/ch1.04' -a "${1}" != "-c" ; then 
  879.   echo shar: Will not clobber existing file \"'lout/doc/tr.lout/ch1.04'\"
  880. else
  881.   echo shar: Extracting \"'lout/doc/tr.lout/ch1.04'\" \(10331 characters\)
  882.   sed "s/^X//" >'lout/doc/tr.lout/ch1.04' <<'END_OF_FILE'
  883. X@Section
  884. X   @Title { Galleys }
  885. X   @Tag { galleys }
  886. X@Begin
  887. X@PP
  888. XIt is time to pause and ask ourselves how close we are to achieving our
  889. Xaim of producing neatly formatted documents.  We can certainly produce
  890. Xthe pieces of a document, using the page layout definitions from Section
  891. X{@NumberOf definitions}:
  892. X@ID {
  893. X
  894. Xnohyphen @Break @LittlePageColumn {
  895. X@DP
  896. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  897. X@DP
  898. XIn the world of music England is supposed to be a mere province.  If she
  899. Xproduces an indifferent composer or performer, that is regarded
  900. Xelsewhere as perfectly normal and natural; but if foreign students of
  901. Xmusical history have to acknowledge a British musical genius, he is
  902. Xconsidered a freak.
  903. X@PP
  904. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  905. Xthe world's musical classics, as here, we find that we cannot omit this
  906. XEnglish master.
  907. X}
  908. X
  909. X||1c
  910. X
  911. X@LittlePageColumn
  912. X{ { 0.8f @Font 1 ^//0.2v}Blom, Eric.  @I {Some Great Composers.}  Oxford, 1944.
  913. X}
  914. X
  915. X||1c
  916. X
  917. X@Code {
  918. X       @LittlePage { "@TextPlace" //1rt "@FootSect" }
  919. X//     @LittlePage { "@TextPlace" //1rt "@FootSect" }
  920. X//     @LittlePage { "@TextPlace" //1rt "@FootSect" }
  921. X//0.2c 8p @Font "@PageList"
  922. X}
  923. X
  924. X}
  925. Xbut when we try to merge them together, we encounter two obstacles.
  926. X@PP
  927. XFirst, when an object is entered at a certain place in the document, it
  928. Xappears at that place.  But a footnote is naturally entered immediately
  929. Xafter the point it refers to (`{-2p @Font PURCELL}' in this case), yet it
  930. Xappears somewhere else: at the bottom of a page.
  931. X@PP
  932. XSecond, all our features build up larger objects out of smaller ones,
  933. Xbut the -2p @Font PURCELL object, for example, must be broken down into
  934. Xpage-sized pieces.  This occurs when the available space at the
  935. X`somewhere else' is insufficient to hold the entire object, so this
  936. Xsecond obstacle arises out of the first.
  937. X@PP
  938. XLout's last major feature, which we introduce to overcome these
  939. Xobstacles, is the @I galley
  940. Xgalley.feature @Index { Galleys }
  941. X(the name is borrowed from the galleys
  942. Xused in manual typesetting).  A galley is an object plus a cross
  943. Xreference which points to where the object is to appear.  The example
  944. Xabove has three galleys:
  945. X@ID {
  946. X
  947. X{
  948. X//0.1c
  949. X
  950. Xnohyphen @Break @LittlePageColumn {
  951. X@DP
  952. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  953. X@DP
  954. XIn the world of music England is supposed to be a mere province.  If she
  955. Xproduces an indifferent composer or performer, that is regarded
  956. Xelsewhere as perfectly normal and natural; but if foreign students of
  957. Xmusical history have to acknowledge a British musical genius, he is
  958. Xconsidered a freak.
  959. X@PP
  960. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  961. Xthe world's musical classics, as here, we find that we cannot omit this
  962. XEnglish master.
  963. X}  { //0.4c 180d @Rotate @Arrow 2.0c }
  964. X
  965. X}
  966. X
  967. X||0io ||4.8c
  968. X
  969. X@Code {
  970. X       @LittlePage { "@TextPlace" //1rt "@FootSect" }
  971. X//     @LittlePage { "@TextPlace" //1rt "@FootSect" }
  972. X//     @LittlePage { "@TextPlace" //1rt "@FootSect" }
  973. X//0.2c 8p @Font "@PageList"
  974. X}  180d @Rotate @Arrow 1i @I -2p @Font {to printer}
  975. X
  976. X||0io ||2.0c
  977. X{
  978. X//3.9c
  979. X
  980. X{ @Arrow 1.7c }  nohyphen @Break @LittlePageColumn
  981. X{ { 0.8f @Font 1 ^//0.2v}Blom, Eric.  @I {Some Great Composers.}  Oxford, 1944.
  982. X}
  983. X}
  984. X}
  985. XA galley replaces the invocation pointed to by its cross reference.  If
  986. Xspace is not sufficient there to hold it all, the remainder of the
  987. Xgalley is split off (the vertical concatenation symbol preceding it
  988. Xbeing discarded) and it replaces later invocations of the same symbol.
  989. XThis is exactly what is required to get text and footnotes onto pages.
  990. X@PP
  991. XTo create a galley, first define a symbol with a
  992. Xspecial @Code into
  993. Xinto @Index { @Code into clause }
  994. Xclause, like this:
  995. X@ID @Code {
  996. X"def @FootNote into { @FootPlace&&following }"
  997. X"   right x"
  998. X"{"
  999. X"   8p @Font x"
  1000. X"}"
  1001. X}
  1002. XAn invocation of such a symbol will then be a galley whose object is the
  1003. Xresult of the invocation, and whose cross reference is given by the
  1004. X@Code into clause.  The right parameter of the cross reference must be
  1005. Xeither @Code preceding or @Code following.
  1006. X@PP
  1007. XA symbol, like @Code "@FootPlace", which is the @I target of a galley,
  1008. Xtarget @Index { Target of a galley }
  1009. Xmust contain the special symbol @@Galley exactly once in its body; often
  1010. Xthis is all that the body contains:
  1011. X@ID @Code {
  1012. X"def  @FootPlace  {  @Galley  }"
  1013. X}
  1014. XIt is this special symbol that is replaced by the incoming galley, in
  1015. Xfact, not the @Code "@FootPlace" symbol as a whole.
  1016. X@PP
  1017. XA symbol which contains @@Galley, either directly within its body or
  1018. Xindirectly within the body of a symbol it invokes, is called a @I receptive
  1019. Xreceptive @Index { Receptive symbol }
  1020. Xsymbol, meaning receptive to galleys.  @Code "@FootPlace" is receptive, which
  1021. Xmakes @Code "@FootList", @Code "@FootSect" and @Code "@PageList"
  1022. Xreceptive since they invoke @Code "@FootPlace".  If no galley replaces
  1023. Xany @@Galley within some invocation of a receptive symbol, that
  1024. Xinvocation is replaced by @@Null.  The advantages of this rule for page
  1025. Xlayout were explained at the end of Section {@NumberOf definitions}.
  1026. X@PP
  1027. XLet us now follow through the construction of our example
  1028. Xdocument.  Initially there is just the one @I root
  1029. Xroot.galley @Index { Root galley }
  1030. Xgalley, containing an unexpanded invocation of @Code "@PageList":
  1031. X@ID { ||5c
  1032. X10p @Font @Code "@PageList"  180d @Rotate @Arrow 1i @I -2p @Font {to printer}
  1033. X}
  1034. XThen the -2p @Font PURCELL galley appears, targeted to a @Code
  1035. X"@TextPlace".  Lout knows that there is a @Code "@TextPlace" hidden
  1036. Xinside @Code "@PageList", so it expands @Code "@PageList":
  1037. X@ID {
  1038. X
  1039. X{
  1040. X//0.1c
  1041. X
  1042. Xnohyphen @Break @LittlePageColumn {
  1043. X@DP
  1044. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  1045. X@DP
  1046. XIn the world of music England is supposed to be a mere province.  If she
  1047. Xproduces an indifferent composer or performer, that is regarded
  1048. Xelsewhere as perfectly normal and natural; but if foreign students of
  1049. Xmusical history have to acknowledge a British musical genius, he is
  1050. Xconsidered a freak.
  1051. X@PP
  1052. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  1053. Xthe world's musical classics, as here, we find that we cannot omit this
  1054. XEnglish master.
  1055. X}  { //0.4c 180d @Rotate @Arrow 2.2c }
  1056. X}
  1057. X
  1058. X||0io ||5c
  1059. X
  1060. X@Code {
  1061. X       @LittlePage { "@TextPlace" //1rt "@FootSect" }
  1062. X//0.2c 8p @Font "@PageList"
  1063. X}  180d @Rotate @Arrow 1i @I -2p @Font {to printer}
  1064. X
  1065. X}
  1066. XAfter promoting the first line into @Code "@TextPlace", the footnote
  1067. Xgalley attached to it appears and demands an invocation of
  1068. X@Code "@FootPlace" following its attachment point
  1069. X(`{-2p @Font PURCELL}').  Such a @Code "@FootPlace" is found at
  1070. Xthe bottom of the first page, inside @Code "@FootSect", which is
  1071. Xaccordingly expanded, and the footnote is promoted onto the page:
  1072. X@ID {
  1073. X
  1074. X{
  1075. X//1.2c
  1076. X
  1077. Xnohyphen @Break @LittlePageColumn {
  1078. XIn the world of music England is supposed to be a mere province.  If she
  1079. Xproduces an indifferent composer or performer, that is regarded
  1080. Xelsewhere as perfectly normal and natural; but if foreign
  1081. Xstudents of musical history have to acknowledge a British musical genius,
  1082. Xhe is considered a freak.
  1083. X@PP
  1084. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  1085. Xthe world's musical classics, as here, we find that we cannot omit this
  1086. XEnglish master.
  1087. X}  180d @Rotate @Arrow 2.2c
  1088. X}
  1089. X
  1090. X||0io ||5c
  1091. X
  1092. X{
  1093. Xnohyphen @Break @LittleDocument
  1094. X//
  1095. X@LittleText {
  1096. X@DP
  1097. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  1098. X@LittleFootNote
  1099. X{ { 0.8f @Font 1 ^//0.2v}Blom, Eric.  @I {Some Great Composers.}  Oxford, 1944.
  1100. X//1vx @Code "@FootList"
  1101. X}
  1102. X//1vx @Code "@TextPlace" }
  1103. X//
  1104. X@LittleEndRun
  1105. X//0.2c 8p @Font @Code "@PageList"
  1106. X}  180d @Rotate @Arrow 1i -2p @Font @I {to printer}
  1107. X
  1108. X}
  1109. XNow the promotion of the -2p @Font PURCELL galley resumes.  When the
  1110. Xfirst page is filled, Lout searches forwards for another @Code "@TextPlace"
  1111. Xto receive the remainder, once again expanding a @Code "@PageList":
  1112. X@ID {
  1113. X
  1114. X{
  1115. X//4.85c
  1116. X
  1117. Xnohyphen @Break @LittlePageColumn {
  1118. Xperformer, that is regarded
  1119. Xelsewhere as perfectly normal and natural; but if foreign
  1120. Xstudents of musical history have to acknowledge a British musical genius,
  1121. Xhe is considered a freak.
  1122. X@PP
  1123. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  1124. Xthe world's musical classics, as here, we find that we cannot omit this
  1125. XEnglish master.
  1126. X}  180d @Rotate @Arrow 2.2c
  1127. X}
  1128. X
  1129. X||0io ||5c
  1130. X
  1131. X{
  1132. Xnohyphen @Break @LittleDocument
  1133. X//
  1134. X@LittleText {
  1135. X@DP
  1136. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  1137. X@LittleFootNote
  1138. X{ { 0.8f @Font 1 ^//0.2v}Blom, Eric.  @I {Some Great Composers.}  Oxford, 1944.
  1139. X}
  1140. X@DP
  1141. X      @HExpand {In the world of music}
  1142. X//1vx @HExpand {England is supposed to}
  1143. X//1vx @HExpand {be a mere province.  If}
  1144. X//1vx @HExpand {she produces an indifferent composer or}
  1145. X}
  1146. X//
  1147. X@LittleEndRun
  1148. X//     @LittlePage { @Code "@TextPlace" //1rt @Code "@FootSect" }
  1149. X//0.2c 8p @Font @Code "@PageList"
  1150. X}  180d @Rotate @Arrow 1i -2p @Font @I {to printer}
  1151. X
  1152. X}
  1153. Xand so on until the entire galley is promoted.  All these expansions and
  1154. Xreplacements are done with total
  1155. Xintegrity.  For example, if Lout finds after expanding @Code "@FootSect"
  1156. Xthat the page is too full to accept even the first line of the footnote,
  1157. X@Code "@FootSect" is reset to unexpanded and the search for a target for
  1158. Xthe footnote moves on.  And the cross reference direction, @Code
  1159. Xpreceding or @Code following, is always obeyed (although lack of space
  1160. Xsometimes prevents Lout from choosing the nearest target).  Only the
  1161. Xroot galley contains receptive symbols in our running example, but in
  1162. Xfact any galley may contain them, without restriction.
  1163. X@PP
  1164. XWhen footnotes are placed at the bottom of a page, they appear there in
  1165. Xfirst come, first served order.  To make galleys appear in sorted order, as
  1166. Xsorted.galley @Index { Sorted galleys }
  1167. Xis needed in bibliographies and indexes, a parameter or nested definition
  1168. Xwith the special name @@Key
  1169. Xkey. @Index { @@Key parameter }
  1170. Xis added to the galley definition, like this:
  1171. X@ID @Code {
  1172. X"def @IndexEntry into { @IndexPlace&&following }"
  1173. X"   left @Key"
  1174. X"   right x"
  1175. X"{ x }"
  1176. X}
  1177. XLike @@Tag, @@Key must be set to a simple word when the galley is invoked:
  1178. X@ID @Code {
  1179. X"cities @IndexEntry { cities, comparison of, 27 }"
  1180. X}
  1181. Xand this key is used to sort the galleys.  If several sorted galleys
  1182. Xwith the same key are sent to the same place, only one of them is
  1183. Xprinted, since the others are probably unwanted duplicates.
  1184. X@PP
  1185. XThe discussion of galleys is continued at a more detailed level in
  1186. XSection {@NumberOf targets}.
  1187. X@End @Section
  1188. END_OF_FILE
  1189.   if test 10331 -ne `wc -c <'lout/doc/tr.lout/ch1.04'`; then
  1190.     echo shar: \"'lout/doc/tr.lout/ch1.04'\" unpacked with wrong size!
  1191.   fi
  1192.   # end of 'lout/doc/tr.lout/ch1.04'
  1193. fi
  1194. if test -f 'lout/doc/tr.lout/ch3.02' -a "${1}" != "-c" ; then 
  1195.   echo shar: Will not clobber existing file \"'lout/doc/tr.lout/ch3.02'\"
  1196. else
  1197.   echo shar: Extracting \"'lout/doc/tr.lout/ch3.02'\" \(12202 characters\)
  1198.   sed "s/^X//" >'lout/doc/tr.lout/ch3.02' <<'END_OF_FILE'
  1199. X@Section
  1200. X   @Title { Concatenation symbols and paragraphs }
  1201. X   @Tag { concatenation }
  1202. X@Begin
  1203. X@PP
  1204. XThere are ten concatenation symbols, in three families:
  1205. Xconcatenation. @Index { Concatenation symbols }
  1206. X@ID @Tab
  1207. X   vmargin { 0.5vx }
  1208. X   @Fmta { @Col @Code A ! @Col @Code B ! @Col @Code C ! @Col @Code D ! @Col E }
  1209. X{
  1210. X@Rowa A { "/" } B { "^/" } C { "//" } D { "^//" } E { Vertical concatenation }
  1211. X@Rowa A { "|" } B { "^|" } C { "||" } D { "^||" } E { Horizontal concatenation }
  1212. X@Rowa A { "&" } B { "^&" } C {      } D {       } E {In-paragraph concatenation}
  1213. X}
  1214. XEach symbol produces an object which combines together the two
  1215. Xparameters.  The right parameter must be separated from the symbol by at
  1216. Xleast one white space character.
  1217. X@PP
  1218. XThe vertical concatenation symbol @Code "/" places its left parameter
  1219. Xvertical.concatenation @Index { Vertical concatenation }
  1220. Xabove its right parameter with their column marks aligned.  If one
  1221. Xparameter has more column marks than the other, empty columns are
  1222. Xinserted at the right to equalize the numbers.  The variant @Code "//"
  1223. Xignores column marks and left-justifies the objects.
  1224. X@PP
  1225. XThe horizontal concatenation symbols @Code "|" and @Code "||" are horizontal
  1226. Xhorizontal.concatenation @Index { Horizontal concatenation }
  1227. Xanalogues of @Code "/" and {@Code "//"}:  they place their two parameters side
  1228. Xby side, with row mark alignment or top-justification respectively.  The
  1229. Xin.paragraph.concatenation @Index { In-paragraph concatenation }
  1230. Xin-paragraph concatenation symbol @Code "&" produces horizontal concatenation
  1231. Xwithin a paragraph; its special properties are treated in detail at the
  1232. Xend of this section.
  1233. X@PP
  1234. XThe concatenation symbols in any one family are {@I{mutually associative}},
  1235. Xwhich means that
  1236. X@ID {
  1237. X@Code "{"  @I x  {@Code "|"}{@I p}  @I y  @Code "}"  {@Code "|"}{@I q}  @I z
  1238. X}
  1239. Xis always the same as
  1240. X@ID {
  1241. X@I x  {@Code "|"}{@I p}  @Code "{"  @I y  {@Code "|"}{@I q}  @I z  @Code "}"
  1242. X}
  1243. Xfor any objects {@I x}, {@I y}, and {@I z}, any gaps @I p and @I q (defined
  1244. Xbelow), and any choice of {@Code "|"}, {@Code "^|"}, {@Code "||"}, and
  1245. X{@Code "^||"}.  In practice we always omit such braces, since they are
  1246. Xredundant and can be misleading.  The result of the complete sequence of
  1247. Xconcatenations will be called the {@I{whole concatenation object}}, and
  1248. Xthe objects which make it up will be called the {@I components}.
  1249. X@PP
  1250. XOne mark is designated as the {@I {principal mark}}, usually the mark of
  1251. Xprincipal.mark @Index { Principal mark }
  1252. Xthe first component.  A later mark can be chosen for this honour by
  1253. Xattaching {@Code "^"} to the preceding concatenation symbol.  See Section
  1254. X{@NumberOf onerow} for examples.
  1255. X@PP
  1256. XA {@I gap},
  1257. Xgap @Index Gap
  1258. Xspecifying the distance between the two
  1259. Xparameters, may follow any concatenation symbol.  There may be no spaces
  1260. Xbetween a concatenation symbol and its gap.  A missing gap is taken
  1261. Xto be {@Code 0ie}.  The gap is effectively a third parameter of the
  1262. Xconcatenation symbol, and it may be an arbitrary object provided that it
  1263. Xevaluates to a juxtaposition of simple words.  In general, the gap must
  1264. Xbe enclosed in braces, like this:
  1265. X@ID @Code {
  1266. X"//{  @Style&&mystyle @Open { @TopMargin }  }"
  1267. X}
  1268. Xbut the braces may be omitted when the object is a juxtaposition of
  1269. Xsimple words or an invocation of a symbol without parameters, as in
  1270. X@Code "//0.3vx" and {@Code "||@Indent"}.
  1271. X@PP
  1272. XA gap consists of a length plus a gap mode.  A @I length
  1273. Xlength @Index { Length }
  1274. Xis represented by an unsigned decimal number followed
  1275. Xby a unit of measurement.  For example, @Code "2.5c" represents the
  1276. Xlength 2.5 centimetres.  Figure {@NumberOf units} gives the full range
  1277. Xof eleven units of measurement.
  1278. Xc.unit @Index { @Code c unit }
  1279. Xp.unit @Index { @Code p unit }
  1280. Xm.unit @Index { @Code m unit }
  1281. Xf.unit @Index { @Code f unit }
  1282. Xs.unit @Index { @Code s unit }
  1283. Xv.unit @Index { @Code v unit }
  1284. Xw.unit @Index { @Code w unit }
  1285. Xb.unit @Index { @Code b unit }
  1286. Xr.unit @Index { @Code r unit }
  1287. Xd.unit @Index { @Code d unit }
  1288. X
  1289. X@BeginFigures
  1290. X@Figure
  1291. X   @Caption { The eleven units of measurement provided by Lout. }
  1292. X   @Tag { units }
  1293. X@Begin
  1294. X   @Tab
  1295. X      vmargin { 0.3v }
  1296. X      side { yes }
  1297. X      @Fmta { @Col @Code A ! @Col B }
  1298. X   {
  1299. X      @Rowa above { yes } A { c } B { Centimetres. }
  1300. X      @Rowa A { i } B { Inches.
  1301. X}
  1302. X      @Rowa A { p } B { Points ({@Code 72p} = {@Code 1i}).
  1303. X}
  1304. X      @Rowa A { m } B { Ems ({@Code 12m} = {@Code 1i}).
  1305. X}
  1306. X      @Rowa A { f } B {
  1307. XOne @Code f equals the size of the current font, as specified by
  1308. Xthe @@Font symbol (Section {@NumberOf font}).  This unit is
  1309. Xappropriate for lengths that should change with the font size.
  1310. X}
  1311. X      @Rowa A { s } B {
  1312. XOne @Code s equals the preferred gap between two words in the
  1313. Xcurrent font, as specified in the definition of the font, or by the
  1314. X@@Space symbol (Section {@NumberOf break}).
  1315. X}
  1316. X      @Rowa A { v } B {
  1317. XOne @Code v equals the current gap between lines introduced during
  1318. Xparagraph breaking, as specified by the @@Break symbol (Section
  1319. X{@NumberOf break}).  This unit is appropriate for lengths, such as the
  1320. Xspaces between paragraphs, which should change with the inter-line gap.
  1321. X}
  1322. X      @Rowa A { w } B {
  1323. XOne @Code w equals the width of the following component, or its height if the
  1324. Xsymbol is vertical concatenation.
  1325. X}
  1326. X      @Rowa A { b } B {
  1327. XOne @Code b equals the width of the whole concatenation object,
  1328. Xor its height if the symbol is vertical concatenation.
  1329. X}
  1330. X      @Rowa A { r } B {
  1331. XOne @Code r equals one @Code b minus one {@Code w}.  This unit is used
  1332. Xfor centring and right justification.
  1333. X}
  1334. X      @Rowa below { yes } A { d } B {
  1335. XDegrees.  This unit may only be used with the @Code "@Rotate" symbol.
  1336. X}
  1337. X   }
  1338. X@End @Figure
  1339. X
  1340. X@PP
  1341. XA gap concludes with a {@I {gap mode}},
  1342. Xgap.mode @Index { Gap mode }
  1343. Xwhich is a single letter following the length, indicating how the length
  1344. Xis to be measured.  As shown in Figure {@NumberOf gapmodes},
  1345. X
  1346. X@Figure
  1347. X   @Tag { gapmodes }
  1348. X   @Caption { The six gap modes provided by Lout. }
  1349. X@Begin
  1350. X@Fig {
  1351. X{ /2.5vx Edge-to-edge |0.3i   {@Code "|"} &1p {@I l} &1p {@Code e}
  1352. X  /4vx Hyphenation    |0.3i   {@Code "|"} &1p {@I l} &1p {@Code h}
  1353. X  /4vx Overstrike     |0.3i   {@Code "|"} &1p {@I l} &1p {@Code o}
  1354. X  /4vx Mark-to-mark   |0.3i   {@Code "|"} &1p {@I l} &1p {@Code x}
  1355. X  /4vx Kerning        |0.3i   {@Code "|"} &1p {@I l} &1p {@Code k}
  1356. X  /4vx Tabulation     |0.3i   {@Code "|"} &1p {@I l} &1p {@Code t}
  1357. X}
  1358. X||0.5i
  1359. X@Box margin { 0c } 6c @Wide 13.2c @High 9p @Font
  1360. X{
  1361. X  @OneRow {
  1362. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1363. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1364. X     @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
  1365. X     @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
  1366. X  }
  1367. X  //4vx
  1368. X  @OneRow {
  1369. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1370. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1371. X     @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
  1372. X     @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
  1373. X  }
  1374. X  //4vx
  1375. X  @OneRow {
  1376. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1377. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1378. X     @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  1379. X     @At { 1.2c @Wide 1.7c @High } @Put { 3.3c @Wide { &0.5rt @I l } }
  1380. X  }
  1381. X  //4vx
  1382. X  @OneRow {
  1383. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1384. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1385. X     @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  1386. X     @At { 1.2c @Wide 1.7c @High }
  1387. X    @Put 3.3c @Wide { |0.5rt { max( {@I {l, a+b}}) } }
  1388. X     @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
  1389. X     @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
  1390. X     @At { 4c   @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
  1391. X     @At { 4c   @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
  1392. X  }
  1393. X  //4vx
  1394. X  @OneRow {
  1395. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1396. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1397. X     @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
  1398. X     @At { 1.2c @Wide 1.7c @High }
  1399. X    @Put { 3.3c @Wide { |0.5rt max( {@I {l, a, b}})}}
  1400. X     @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
  1401. X     @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
  1402. X     @At { 4c   @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
  1403. X     @At { 4c   @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
  1404. X  }
  1405. X  //4vx
  1406. X  @OneRow {
  1407. X     @At { 1c   @Wide 0.5c @High } @Put { @LBox 0.2co }
  1408. X     @At { 4c   @Wide 0.5c @High } @Put { @LBox 0.5co }
  1409. X     @At { 0.0c @Wide 1.6c @High } @Put { @DoubleArrow 4.0c }
  1410. X     @At { 2.8c @Wide 1.8c @High } @Put { @I l }
  1411. X  }
  1412. X  //5vx
  1413. X  @DoubleArrow 6c
  1414. X  //0.1c |0.5rt @I { current bound }
  1415. X}
  1416. X
  1417. X}
  1418. X@End @Figure
  1419. X@EndFigures
  1420. Xwith edge-to-edge gap mode
  1421. Xedge.to.edge @Index { Edge-to-edge gap mode }
  1422. Xe.gap.mode @Index { @Code e gap mode }
  1423. Xthe length @I l is measured from the trailing edge
  1424. Xof the first object to the leading edge of the second.  Edge-to-edge is the
  1425. Xdefault mode:  the @Code e may be omitted.  Hyphenation gap mode is
  1426. Xhyphenation.gap @Index { Hyphenation gap mode }
  1427. Xh.gap.mode @Index { @Code h gap mode }
  1428. Xsimilar, except as explained at the end of this section.
  1429. X@PP
  1430. XMark-to-mark,
  1431. Xmark.to.mark @Index { Mark-to-mark gap mode }
  1432. Xx.gap.mode @Index { @Code x gap mode }
  1433. Xoverstrike,
  1434. Xoverstrike @Index { Overstrike gap mode }
  1435. Xo.gap.mode @Index { @Code o gap mode }
  1436. Xand kerning
  1437. Xkerning @Index { Kerning gap mode }
  1438. Xk.gap.mode @Index { @Code k gap mode }
  1439. Xmeasure the length from the last mark
  1440. Xof the first object to the first mark of the second.  In the case of
  1441. Xmark-to-mark, if the length is too small to prevent the objects
  1442. Xoverlapping, it is widened until they no longer do.  Kerning also
  1443. Xwidens, with the aim of preventing the mark of either object from
  1444. Xoverlapping the other object; this mode is used for subscripts and
  1445. Xsuperscripts.
  1446. X@PP
  1447. Xtabulation @Index { Tabulation gap mode }
  1448. Xt.gap.mode @Index { @Code t gap mode }
  1449. Xcentring @Index { Centring }
  1450. Xright.justif @Index { Right justification }
  1451. XTabulation ignores the first object and places the leading edge of the
  1452. Xsecond object at a distance @I l from the left edge of the whole
  1453. Xconcatenation object.  It is the main user of the @Code b and @Code r
  1454. Xunits of measurement; for example, @Code "|1rt" will right-justify the
  1455. Xfollowing component, and @Code "|0.5rt" will centre it.
  1456. X@PP
  1457. XWhen two objects are separated only by zero or more white space
  1458. Xwhite.space.when @SubIndex { when significant }
  1459. Xspace.f.when @SubIndex { when significant }
  1460. Xcharacters (spaces, tabs, and newlines), Lout inserts
  1461. X{@Code "&"}{@I k}{@Code "s"} between the two objects, where @I k is the
  1462. Xnumber of spaces.  Precisely, @I k is determined by discarding all space
  1463. Xcharacters and tabs that precede newlines (these are invisible so are
  1464. Xbetter ignored), then counting 1 for each newline or space, and 8 for
  1465. Xeach tab character.
  1466. X@PP
  1467. XA sequence of two or more objects separated by @Code "&" symbols is a
  1468. Xparagraph.breaking.in.detail @SubIndex { in detail }
  1469. X{@I paragraph}.  Lout breaks paragraphs into lines automatically as
  1470. Xrequired, by converting some of the @Code "&" symbols into
  1471. X{@Code "//1vx"}.  Gaps of length 0 (other than hyphenation gaps) are not
  1472. Xeligible for this conversion.  `Optimal' line breaks are chosen, using a
  1473. Xmethod adapted from @TeX [{@Ref knuth84}].
  1474. Xtex @RawIndex { @TeX }
  1475. Xtex.optimal @SubIndex { optimal paragraph breaking }
  1476. X@PP
  1477. XIf an @Code "&" symbol whose gap has hyphenation mode
  1478. Xhyphenation @Index { Hyphenation gap mode }
  1479. Xtex.hyphenation @SubIndex { hyphenation }
  1480. Xis chosen for replacement by {@Code "//1vx"}, a hyphen will be appended to
  1481. Xthe preceding object, unless that object is a word which already ends with
  1482. Xa hyphen.  For example,
  1483. X@ID @Code {
  1484. XLong words may be "hyph &0ih enat &0ih ed."
  1485. X}
  1486. Xcould have the following result, depending where the line breaks fall:
  1487. X@ID 2i @Wide {
  1488. XLong words may be hyph &0ih enat &0ih ed.
  1489. X}
  1490. XBasser Lout inserts hyphenation gaps automatically as required, again
  1491. Xfollowing the method of @TeX, which approximates the hyphenations in
  1492. XWebster's dictionary.  To prevent the hyphenation of a single word,
  1493. Xenclose it in quotes.  Further control over paragraph breaking and
  1494. Xhyphenation is provided by the @@Break and @@Space symbols (Sections
  1495. X{@NumberOf break} and {@NumberOf space}).
  1496. X@End @Section
  1497. END_OF_FILE
  1498.   if test 12202 -ne `wc -c <'lout/doc/tr.lout/ch3.02'`; then
  1499.     echo shar: \"'lout/doc/tr.lout/ch3.02'\" unpacked with wrong size!
  1500.   fi
  1501.   # end of 'lout/doc/tr.lout/ch3.02'
  1502. fi
  1503. if test -f 'lout/doc/tr.lout/ch4.04' -a "${1}" != "-c" ; then 
  1504.   echo shar: Will not clobber existing file \"'lout/doc/tr.lout/ch4.04'\"
  1505. else
  1506.   echo shar: Extracting \"'lout/doc/tr.lout/ch4.04'\" \(10583 characters\)
  1507.   sed "s/^X//" >'lout/doc/tr.lout/ch4.04' <<'END_OF_FILE'
  1508. X@Section
  1509. X   @Title { Chapters and sections }
  1510. X   @Tag { chapters }
  1511. X@Begin
  1512. X@PP
  1513. XThe definitions of chapters and sections from the DocumentLayout package
  1514. Xchapters @Index { Chapters and sections }
  1515. Xform the subject of this section.  They allow a chapter to be entered
  1516. Xlike this:
  1517. Xdocument.layout.chapters @SubIndex { chapters and sections }
  1518. X@ID @Code {
  1519. X"@Chapter"
  1520. X"    @Title { ... }"
  1521. X"    @Tag { ... }"
  1522. X"@Begin"
  1523. X"    ..."
  1524. X"@End @Chapter"
  1525. X}
  1526. XWithin the chapter a sequence of sections may be included by writing
  1527. X@ID @Code {
  1528. X"@BeginSections"
  1529. X"@Section { ... }"
  1530. X"..."
  1531. X"@Section { ... }"
  1532. X"@EndSections"
  1533. X}
  1534. XThese are numbered automatically, and an entry is made for each in a
  1535. Xtable of contents.
  1536. X@PP
  1537. XThe user of the DocumentLayout package can find the number of the chapter or
  1538. Xsection with a given tag by writing @Code "@NumberOf tag" at any point
  1539. Xin the document.  This feature is based on the following definitions:
  1540. Xnumberof.example @Index { @Code "@NumberOf" example }
  1541. X@ID @Code {
  1542. X"export @Tag"
  1543. X"def @NumberMarker right @Tag { @Null }"
  1544. X""
  1545. X"def @NumberOf right x"
  1546. X"{  @NumberMarker&&x @Open { @Tag }  }"
  1547. X}
  1548. XEach chapter and section will contain one invocation of
  1549. X{@Code "@NumberMarker"}; a full explanation will be given later.
  1550. X@PP
  1551. XA sequence of places for receiving chapters is easily defined:
  1552. X@ID @Code {
  1553. X"export @Tag"
  1554. X"def @ChapterList right @Tag"
  1555. X"{"
  1556. X"    @Galley"
  1557. X"    //@ChapterGap  @ChapterList @Next @Tag"
  1558. X"}"
  1559. X}
  1560. X@Code "@ChapterGap" will usually be {@Code "1.1b"}, ensuring that each
  1561. Xchapter begins on a new page.  The @Code "@Chapter" galley itself is
  1562. Xdefined as follows:
  1563. Xchapter.example @Index { @Code "@Chapter" example }
  1564. X@IndentedList
  1565. X@LI @Code {
  1566. X"export @FootNote @BeginSections @EndSections @Section"
  1567. X"def @Chapter force into { @ChapterList&&preceding }"
  1568. X"    named @Tag {}"
  1569. X"    named @Title {}"
  1570. X"    named @RunningTitle { dft }"
  1571. X"    body @Body"
  1572. X"{"
  1573. X"    def @FootNote right x { @ColFootNote x }"
  1574. X""
  1575. X"    def @BeginSections ..."
  1576. X"    def @EndSections ..."
  1577. X"    def @Section ..."
  1578. X}
  1579. X@LI @Code {
  1580. X"    def @ChapterTitle"
  1581. X"    {"
  1582. X"        @ChapterNumbers @Case {"
  1583. X"            {Yes yes}  @Yield  { Chapter {@NumberOf @Tag}.  |2s  @Title }"
  1584. X"            else  @Yield  @Title"
  1585. X"        }"
  1586. X"    }"
  1587. X""
  1588. X"    def @ChapterNum"
  1589. X"    {"
  1590. X"        @ChapterNumbers @Case {"
  1591. X"            {Yes yes}  @Yield  { Chapter {@NumberOf @Tag} }"
  1592. X"            else  @Yield @Null"
  1593. X"        }"
  1594. X"    }"
  1595. X}
  1596. X@LI @Code {
  1597. X"        ragged @Break @BookTitleFormat @ChapterTitle"
  1598. X"    //  @NumberMarker {"
  1599. X"            @ChapterList&&@Tag @Open { @Tag }"
  1600. X"        }"
  1601. X"    //  @ChapterList&&preceding  @Tagged @Tag"
  1602. X"    //  @NumberMarker&&preceding @Tagged @Tag"
  1603. X"    //  @PageMarker&&preceding   @Tagged @Tag"
  1604. X"    //  { @ChapterTitle } @MajorContentsEntry {@PageOf @Tag}"
  1605. X"    //  @Runner"
  1606. X"            @FootEven { |0.5rt 0.8f @Font @B @PageNum }"
  1607. X"            @FootOdd  { |0.5rt 0.8f @Font @B @PageNum }"
  1608. X"    //  @Body"
  1609. X"    //@SectionGap @ChapRefSection"
  1610. X"    //  @Runner"
  1611. X"            @TopEven { @B @PageNum |1rt @I @ChapterNum }"
  1612. X"            @TopOdd  { @I {@RunningTitle @OrElse @Title} |1rt @B @PageNum }"
  1613. X"}"
  1614. X}
  1615. X@EndList
  1616. XWe will see the symbols for sections shortly.  Notice how their use has
  1617. Xbeen restricted to within the right parameter of {@Code "@Chapter"}, by
  1618. Xnesting them and using a body parameter.
  1619. X@PP
  1620. XThe meaning of @Code "@FootNote" within @Code "@Chapter" has been set
  1621. Xto {@Code "@ColFootNote"}, which produces a footnote targeted to
  1622. X{@Code "@ColFootList"} (see Section {@NumberOf pagelayout}).  In other
  1623. Xwords, footnotes within chapters go at the foot of the column, not at
  1624. Xthe foot of the page.  (Of course, in single-column books this
  1625. Xdistinction is insignificant.)  @Code "@ChapterTitle" and
  1626. X@Code "@ChapterNum" are trivial definitions which vary depending on
  1627. Xwhether the user has requested numbered chapters or not.
  1628. X@PP
  1629. XEach invocation of @Code "@Chapter" has its own unique {@Code "@Tag"},
  1630. Xeither supplied by the user or else inserted automatically by Lout.  We
  1631. Xnow trace the cross referencing of chapter numbers on a hypothetical
  1632. Xthird chapter whose tag is {@Code "euclid"}.
  1633. X@PP
  1634. X@Code "@ChapterList&&preceding @Tagged euclid" attaches @Code "euclid"
  1635. Xas an extra tag to the first invocation of @Code "@ChapterList"
  1636. Xpreceding itself in the final printed document.  But this
  1637. X@Code "@ChapterList" must be the target of the chapter, and so
  1638. X@ID @Code "@ChapterList&&euclid @Open { @Tag }"
  1639. Xis 3, the number of the chapter ({@Code "@Tag"} refers to the parameter
  1640. Xof {@Code "@ChapterList"}, not the parameter of {@Code "@Chapter"}).
  1641. X Consequently the invocation of
  1642. X@Code "@NumberMarker" within the chapter is equal to
  1643. X{@Code "@NumberMarker 3"}.
  1644. X@PP
  1645. X@Code "@NumberMarker&&preceding @Tagged euclid" attaches @Code "euclid"
  1646. Xto {@Code "@NumberMarker 3"} as an extra tag, and so
  1647. X{@Code "@NumberOf euclid"}, which expands to
  1648. X@ID @Code "@NumberMarker&&euclid @Open { @Tag }"
  1649. Xmust be equal to 3, as required.  This scheme could be simplified by
  1650. Xplacing the invocation of @Code "@NumberMarker" within
  1651. X@Code "@ChapterList" rather than within {@Code "@Chapter"}, but it turns
  1652. Xout that that scheme does not generalize well to sections and subsections.
  1653. X@PP
  1654. XThere is a trap for the unwary in the use of @Code preceding and
  1655. X{@Code following}.  Suppose that the invocation of @Code "@NumberMarker"
  1656. Xwithin @Code "@Chapter" is replaced by the seemingly equivalent
  1657. X@ID @Code "@NumberMarker { @ChapterList&&preceding @Open { @Tag } }"
  1658. XNow suppose that @Code "@NumberOf euclid" appears somewhere within
  1659. XChapter 7.  It will expand to
  1660. X@ID @Code "@NumberMarker&&euclid @Open { @Tag }"
  1661. Xwhich would now be equal to
  1662. X@ID @Code "@ChapterList&&preceding @Open { @Tag }"
  1663. Xwhose value, evaluated as it is within Chapter 7, is 7, not 3.  Use of
  1664. X@Code preceding or @Code following within the parameter
  1665. Xof a symbol, rather than within the body, is likely to be erroneous.
  1666. X@PP
  1667. XMuch of the remainder of the definition of @Code "@Chapter" is fairly
  1668. Xself-explanatory:  there is a heading, a tag sent to mark the page on
  1669. Xwhich the chapter begins, a @Code "@ContentsEntry" galley sent to the
  1670. Xtable of contents, galleys for the figures and tables of the chapter to
  1671. Xcollect in, @Code "@Body" where the body of the chapter goes, and
  1672. X@Code "@ChapRefSection" to hold a concluding list of references.  This
  1673. Xleaves only the two invocations of @Code "@Runner" to explain.
  1674. X@PP
  1675. XThe first @Code "@Runner" is just below the heading.  It will be the target
  1676. Xof the @Code "@Runner&&following" cross reference at the beginning of the
  1677. Xfirst page of the chapter (see Section {@NumberOf pagelayout}), which
  1678. Xconsequently will have null running headers and the given footers.
  1679. X@PP
  1680. XThe second @Code "@Runner" appears at the very end of the chapter, hence
  1681. Xon its last page.  Since no invocations of @Code "@Runner" lie between
  1682. Xit and the first {@Code "@Runner"}, it will be the target of
  1683. X@Code "@Runner&&following" on every page from the second page of the
  1684. Xchapter to the last, inclusive, and will supply the format of their
  1685. Xheaders and footers.
  1686. X@PP
  1687. XThe interested reader might care to predict the outcome in unusual
  1688. Xcases, such as when the heading occupies two pages, or when a chapter
  1689. Xoccupies only one, or (assuming a change to the gap between chapters)
  1690. Xwhen a chapter starts halfway down a page.  Such predictions can be made
  1691. Xwith great confidence.
  1692. X@PP
  1693. XThe expression @Code "@RunningTitle @OrElse @Title" appearing in the second
  1694. X@Code "@Runner" returns the value of the @Code "@RunningTitle" parameter
  1695. Xof @Code "@Chapter" if this is not equal to the default value
  1696. X{@Code "dft"}, or @Code "@Title" otherwise:
  1697. Xorelse.example @Index { @Code "@OrElse" example }
  1698. X@ID @Code {
  1699. X"def @OrElse"
  1700. X"    left x"
  1701. X"    right y"
  1702. X"{"
  1703. X"    x @Case {"
  1704. X"        dft  @Yield  y"
  1705. X"        else  @Yield  x"
  1706. X"    }"
  1707. X"}"
  1708. X}
  1709. XThis produces the effect of
  1710. X@ID @Code {
  1711. X"named  @RunningTitle  {  @Title  }"
  1712. X}
  1713. Xwhich unfortunately is not permissible as it stands, because @Code "@Title"
  1714. Xis not visible within the default value of {@Code "@RunningTitle"}.
  1715. X@PP
  1716. XFinally, the definitions for sections omitted earlier are as follows:
  1717. Xsection.example @Index { @Code "@Section" example }
  1718. X@IndentedList
  1719. X@LI @Code {
  1720. X"def @EndSectionsPlace { @Galley }"
  1721. X"def @EndSections force into { @EndSectionsPlace&&preceding } {}"
  1722. X"macro @BeginSections { //@SectionGap @SectionList 1 // @EndSectionsPlace // }"
  1723. X}
  1724. X@LI @Code {
  1725. X"def @Section force into { @SectionList&&preceding }"
  1726. X"    named @Tag {}"
  1727. X"    named @Title {}"
  1728. X"    named @RunningTitle { dft }"
  1729. X"    body @Body"
  1730. X"{"
  1731. X"    def @SectionTitle"
  1732. X"    {"
  1733. X"        @SectionNumbers @Case {"
  1734. X"            {Yes yes} @Yield { {@NumberOf @Tag}.  |2s  @Title }"
  1735. X"            else      @Yield @Title"
  1736. X"        }"
  1737. X"    }"
  1738. X""
  1739. X"        @Heading @Protect @SectionTitle"
  1740. X"    //  @NumberMarker {"
  1741. X"            {@ChapterList&&@Tag @Open { @Tag }}.{"
  1742. X"             @SectionList&&@Tag @Open { @Tag }}"
  1743. X"        }"
  1744. X"    //  @ChapterList&&preceding  @Tagged @Tag"
  1745. X"    //  @SectionList&&preceding  @Tagged @Tag"
  1746. X"    //  @NumberMarker&&preceding @Tagged @Tag"
  1747. X"    //  @PageMarker&&preceding   @Tagged @Tag"
  1748. X"    //  { &3f @SectionTitle } @ContentsEntry {@PageOf @Tag}"
  1749. X"    //0io @Body"
  1750. X"}"
  1751. X}
  1752. X@EndList
  1753. XThe @Code "@BeginSections" macro invokes {@Code "@SectionList"},
  1754. Xpreceded by the appropriate gap and followed by an @Code "@EndSectsPlace"
  1755. Xfor closing the list of sections when the @Code "@EndSections" symbol is
  1756. Xfound.  @Code "@Section" itself is just a copy of @Code "@Chapter" with
  1757. Xslight changes to the format.  The parameter of @Code "@NumberMarker" is
  1758. Xa simple generalization of the one within {@Code "@Chapter"}.  Notice
  1759. Xthat we have taken care that the value of this parameter be
  1760. Xa juxtaposition of simple words:  although
  1761. X@ID @Code {
  1762. X"{@ChapterList&&@Tag @Open { @Tag }}. &"
  1763. X"{@SectionList&&@Tag @Open { @Tag }}"
  1764. X}
  1765. Xis formally equivalent, @Code "&" is not permitted within a
  1766. X@Code "@Tag" parameter.
  1767. X@PP
  1768. XThe DocumentLayout package also contains definitions for subsections in the
  1769. Xsame style.  They raise the question of whether Lout is capable of
  1770. Xproducing subsections should the user place {@Code "@BeginSections"},
  1771. X{@Code "@Section"}, and {@Code "@EndSections"} within a {@I section},
  1772. Xand whether such nesting could proceed to arbitrary depth.  Arbitrary
  1773. Xnesting of sections within sections is available now, although the
  1774. Xnumbering would of course be wrong.  The author has worked out
  1775. Xdefinitions which provide correct numbering to arbitrary depth, with an
  1776. Xarbitrary format for each level.  These were not incorporated into
  1777. XDocumentLayout because the author considers sub-subsections to be poor
  1778. Xstyle, and he prefers separate names for the symbols at each level.
  1779. X@End @Section
  1780. END_OF_FILE
  1781.   if test 10583 -ne `wc -c <'lout/doc/tr.lout/ch4.04'`; then
  1782.     echo shar: \"'lout/doc/tr.lout/ch4.04'\" unpacked with wrong size!
  1783.   fi
  1784.   # end of 'lout/doc/tr.lout/ch4.04'
  1785. fi
  1786. if test -f 'lout/font0/Symbo.AFM' -a "${1}" != "-c" ; then 
  1787.   echo shar: Will not clobber existing file \"'lout/font0/Symbo.AFM'\"
  1788. else
  1789.   echo shar: Extracting \"'lout/font0/Symbo.AFM'\" \(9486 characters\)
  1790.   sed "s/^X//" >'lout/font0/Symbo.AFM' <<'END_OF_FILE'
  1791. XStartFontMetrics 2.0
  1792. XComment Copyright (c) 1984 Adobe Systems Incorporated.     All Rights Reserved.
  1793. XComment Creation Date:Thu Apr 16 08:46:05 PST 1987
  1794. XFontName Symbol
  1795. XEncodingScheme FontSpecific
  1796. XFullName Symbol
  1797. XFamilyName Symbol
  1798. XWeight Medium
  1799. XItalicAngle 0.0
  1800. XIsFixedPitch false
  1801. XUnderlinePosition -98
  1802. XUnderlineThickness 54
  1803. XVersion 001.003
  1804. XFontBBox -180 -293 1090 1010
  1805. XStartCharMetrics 189
  1806. XC 32 ; WX 250 ; N space ; B 0 0 0 0 ;
  1807. XC 33 ; WX 333 ; N exclam ; B 128 -17 240 673 ;
  1808. XC 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
  1809. XC 35 ; WX 500 ; N numbersign ; B 20 -17 481 673 ;
  1810. XC 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
  1811. XC 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
  1812. XC 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
  1813. XC 39 ; WX 439 ; N suchthat ; B 48 -17 414 499 ;
  1814. XC 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
  1815. XC 41 ; WX 333 ; N parenright ; B 30 -191 277 674 ;
  1816. XC 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
  1817. XC 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
  1818. XC 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
  1819. XC 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
  1820. XC 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
  1821. XC 47 ; WX 278 ; N slash ; B 0 -17 254 646 ;
  1822. XC 48 ; WX 500 ; N zero ; B 23 -17 471 685 ;
  1823. XC 49 ; WX 500 ; N one ; B 117 0 390 673 ;
  1824. XC 50 ; WX 500 ; N two ; B 25 0 475 686 ;
  1825. XC 51 ; WX 500 ; N three ; B 39 -17 435 687 ;
  1826. XC 52 ; WX 500 ; N four ; B 16 0 469 685 ;
  1827. XC 53 ; WX 500 ; N five ; B 28 -17 443 685 ;
  1828. XC 54 ; WX 500 ; N six ; B 36 -17 467 685 ;
  1829. XC 55 ; WX 500 ; N seven ; B 24 -17 448 673 ;
  1830. XC 56 ; WX 500 ; N eight ; B 54 -18 440 686 ;
  1831. XC 57 ; WX 500 ; N nine ; B 31 -17 460 685 ;
  1832. XC 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
  1833. XC 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
  1834. XC 60 ; WX 549 ; N less ; B 26 0 523 522 ;
  1835. XC 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
  1836. XC 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
  1837. XC 63 ; WX 444 ; N question ; B 70 -17 412 685 ;
  1838. XC 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
  1839. XC 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
  1840. XC 66 ; WX 667 ; N Beta ; B 29 0 592 672 ;
  1841. XC 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
  1842. XC 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
  1843. XC 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
  1844. XC 70 ; WX 763 ; N Phi ; B 26 0 741 672 ;
  1845. XC 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
  1846. XC 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
  1847. XC 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
  1848. XC 74 ; WX 631 ; N theta1 ; B 18 -17 623 689 ;
  1849. XC 75 ; WX 722 ; N Kappa ; B 35 0 722 672 ;
  1850. XC 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
  1851. XC 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
  1852. XC 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
  1853. XC 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
  1854. XC 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
  1855. XC 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
  1856. XC 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
  1857. XC 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
  1858. XC 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
  1859. XC 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
  1860. XC 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
  1861. XC 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
  1862. XC 88 ; WX 645 ; N Xi ; B 40 0 599 672 ;
  1863. XC 89 ; WX 795 ; N Psi ; B 15 0 781 683 ;
  1864. XC 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
  1865. XC 91 ; WX 333 ; N bracketleft ; B 86 -155 299 673 ;
  1866. XC 92 ; WX 863 ; N therefore ; B 163 0 701 478 ;
  1867. XC 93 ; WX 333 ; N bracketright ; B 33 -155 246 673 ;
  1868. XC 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
  1869. XC 95 ; WX 500 ; N underscore ; B -2 -252 502 -206 ;
  1870. XC 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
  1871. XC 97 ; WX 631 ; N alpha ; B 41 -17 622 500 ;
  1872. XC 98 ; WX 549 ; N beta ; B 61 -222 515 741 ;
  1873. XC 99 ; WX 549 ; N chi ; B 12 -231 522 500 ;
  1874. XC 100 ; WX 494 ; N delta ; B 40 -17 481 740 ;
  1875. XC 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
  1876. XC 102 ; WX 521 ; N phi ; B 27 -224 490 670 ;
  1877. XC 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
  1878. XC 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
  1879. XC 105 ; WX 329 ; N iota ; B 0 -18 301 503 ;
  1880. XC 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
  1881. XC 107 ; WX 549 ; N kappa ; B 33 0 558 502 ;
  1882. XC 108 ; WX 549 ; N lambda ; B 24 -18 548 739 ;
  1883. XC 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
  1884. XC 110 ; WX 521 ; N nu ; B -9 -17 475 507 ;
  1885. XC 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
  1886. XC 112 ; WX 549 ; N pi ; B 10 -20 530 486 ;
  1887. XC 113 ; WX 521 ; N theta ; B 43 -18 485 690 ;
  1888. XC 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
  1889. XC 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
  1890. XC 116 ; WX 439 ; N tau ; B 10 -18 418 500 ;
  1891. XC 117 ; WX 576 ; N upsilon ; B 7 -17 535 507 ;
  1892. XC 118 ; WX 713 ; N omega1 ; B 12 -17 671 583 ;
  1893. XC 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
  1894. XC 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
  1895. XC 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
  1896. XC 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
  1897. XC 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
  1898. XC 124 ; WX 200 ; N bar ; B 65 -177 135 673 ;
  1899. XC 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
  1900. XC 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
  1901. XC 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 684 ;
  1902. XC 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
  1903. XC 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
  1904. XC 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
  1905. XC 165 ; WX 713 ; N infinity ; B 25 124 689 404 ;
  1906. XC 166 ; WX 500 ; N florin ; B 2 -193 494 687 ;
  1907. XC 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
  1908. XC 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
  1909. XC 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
  1910. XC 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
  1911. XC 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
  1912. XC 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
  1913. XC 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
  1914. XC 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
  1915. XC 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
  1916. XC 176 ; WX 400 ; N degree ; B 50 385 350 684 ;
  1917. XC 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
  1918. XC 178 ; WX 411 ; N second ; B 20 459 413 737 ;
  1919. XC 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
  1920. XC 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
  1921. XC 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
  1922. XC 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
  1923. XC 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
  1924. XC 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
  1925. XC 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
  1926. XC 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
  1927. XC 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
  1928. XC 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
  1929. XC 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
  1930. XC 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
  1931. XC 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
  1932. XC 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
  1933. XC 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
  1934. XC 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
  1935. XC 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
  1936. XC 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
  1937. XC 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
  1938. XC 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
  1939. XC 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
  1940. XC 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
  1941. XC 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
  1942. XC 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
  1943. XC 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
  1944. XC 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
  1945. XC 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
  1946. XC 206 ; WX 713 ; N element ; B 45 0 505 468 ;
  1947. XC 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
  1948. XC 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
  1949. XC 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
  1950. XC 210 ; WX 790 ; N registerserif ; B 50 -20 740 670 ;
  1951. XC 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
  1952. XC 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
  1953. XC 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
  1954. XC 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
  1955. XC 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
  1956. XC 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
  1957. XC 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
  1958. XC 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
  1959. XC 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
  1960. XC 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
  1961. XC 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
  1962. XC 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
  1963. XC 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
  1964. XC 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
  1965. XC 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
  1966. XC 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
  1967. XC 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
  1968. XC 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
  1969. XC 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
  1970. XC 230 ; WX 384 ; N parenlefttp ; B 40 -293 436 926 ;
  1971. XC 231 ; WX 384 ; N parenleftex ; B 40 -85 92 925 ;
  1972. XC 232 ; WX 384 ; N parenleftbt ; B 40 -293 436 926 ;
  1973. XC 233 ; WX 384 ; N bracketlefttp ; B 0 -80 341 926 ;
  1974. XC 234 ; WX 384 ; N bracketleftex ; B 0 -79 55 925 ;
  1975. XC 235 ; WX 384 ; N bracketleftbt ; B 0 -80 340 926 ;
  1976. XC 236 ; WX 494 ; N bracelefttp ; B 201 -75 439 926 ;
  1977. XC 237 ; WX 494 ; N braceleftmid ; B 14 -85 255 935 ;
  1978. XC 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
  1979. XC 239 ; WX 494 ; N braceex ; B 201 -80 255 935 ;
  1980. XC 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
  1981. XC 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
  1982. XC 243 ; WX 686 ; N integraltp ; B 332 -83 715 922 ;
  1983. XC 244 ; WX 686 ; N integralex ; B 332 -88 415 975 ;
  1984. XC 245 ; WX 686 ; N integralbt ; B 39 -81 415 921 ;
  1985. XC 246 ; WX 384 ; N parenrighttp ; B 54 -293 450 926 ;
  1986. XC 247 ; WX 384 ; N parenrightex ; B 398 -85 450 925 ;
  1987. XC 248 ; WX 384 ; N parenrightbt ; B 54 -293 450 926 ;
  1988. XC 249 ; WX 384 ; N bracketrighttp ; B 22 -80 360 926 ;
  1989. XC 250 ; WX 384 ; N bracketrightex ; B 305 -79 360 925 ;
  1990. XC 251 ; WX 384 ; N bracketrightbt ; B 20 -80 360 926 ;
  1991. XC 252 ; WX 494 ; N bracerighttp ; B 17 -75 255 926 ;
  1992. XC 253 ; WX 494 ; N bracerightmid ; B 201 -85 442 935 ;
  1993. XC 254 ; WX 494 ; N bracerightbt ; B 17 -70 255 926 ;
  1994. XC -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
  1995. XEndCharMetrics
  1996. XEndFontMetrics
  1997. END_OF_FILE
  1998.   if test 9486 -ne `wc -c <'lout/font0/Symbo.AFM'`; then
  1999.     echo shar: \"'lout/font0/Symbo.AFM'\" unpacked with wrong size!
  2000.   fi
  2001.   # end of 'lout/font0/Symbo.AFM'
  2002. fi
  2003. if test -f 'lout/z27.c' -a "${1}" != "-c" ; then 
  2004.   echo shar: Will not clobber existing file \"'lout/z27.c'\"
  2005. else
  2006.   echo shar: Extracting \"'lout/z27.c'\" \(10847 characters\)
  2007.   sed "s/^X//" >'lout/z27.c' <<'END_OF_FILE'
  2008. X/*@z27.c:Debug Service:DebugInit(), Debug()@**********************************/
  2009. X/*                                                                           */
  2010. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  2011. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  2012. X/*                                                                           */
  2013. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  2014. X/*  Basser Department of Computer Science                                    */
  2015. X/*  The University of Sydney 2006                                            */
  2016. X/*  AUSTRALIA                                                                */
  2017. X/*                                                                           */
  2018. X/*  This program is free software; you can redistribute it and/or modify     */
  2019. X/*  it under the terms of the GNU General Public License as published by     */
  2020. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  2021. X/*  any later version.                                                       */
  2022. X/*                                                                           */
  2023. X/*  This program is distributed in the hope that it will be useful,          */
  2024. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  2025. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  2026. X/*  GNU General Public License for more details.                             */
  2027. X/*                                                                           */
  2028. X/*  You should have received a copy of the GNU General Public License        */
  2029. X/*  along with this program; if not, write to the Free Software              */
  2030. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  2031. X/*                                                                           */
  2032. X/*  FILE:         z27.c                                                      */
  2033. X/*  MODULE:       Debug Service                                              */
  2034. X/*  EXTERNS:      dbg[], DebugInit(), Debug()                                */
  2035. X/*                ProfileOn(), ProfileOff(), ProfilePrint()                  */
  2036. X/*                                                                           */
  2037. X/*****************************************************************************/
  2038. X#include "externs"
  2039. X
  2040. X#if DEBUG_ON
  2041. X
  2042. Xstruct dbs  dbg[] = {
  2043. X    (unsigned char *) "zz",    0, 0, 0,        /* - unused -                */
  2044. X    (unsigned char *) "sp",    0, 0, 0,        /* Supervise                 */
  2045. X    (unsigned char *) "la",    0, 0, 0,        /* Lexical Analyser          */
  2046. X    (unsigned char *) "fs",    0, 0, 0,        /* File Service              */
  2047. X    (unsigned char *) "ts",    0, 0, 0,        /* Token Service             */
  2048. X    (unsigned char *) "rd",    0, 0, 0,        /* Read Definitions          */
  2049. X    (unsigned char *) "op",    0, 0, 0,        /* Object Parser             */
  2050. X    (unsigned char *) "os",    0, 0, 0,        /* Object Service            */
  2051. X    (unsigned char *) "om",    0, 0, 0,        /* Object Manifest           */
  2052. X    (unsigned char *) "ce",    0, 0, 0,        /* Closure Expansion         */
  2053. X    (unsigned char *) "cr",    0, 0, 0,        /* Cross References          */
  2054. X    (unsigned char *) "ss",    0, 0, 0,        /* Style Service             */
  2055. X    (unsigned char *) "sf",    0, 0, 0,        /* Size Finder               */
  2056. X    (unsigned char *) "ob",    0, 0, 0,        /* Object Breaking           */
  2057. X    (unsigned char *) "of",    0, 0, 0,        /* Object Filling            */
  2058. X    (unsigned char *) "sc",    0, 0, 0,        /* Size Constraints          */
  2059. X    (unsigned char *) "sa",    0, 0, 0,        /* Size Adjustments          */
  2060. X    (unsigned char *) "gw",    0, 0, 0,        /* Gap Widths                */
  2061. X    (unsigned char *) "gt",    0, 0, 0,        /* Galley Transfer           */
  2062. X    (unsigned char *) "ga",    0, 0, 0,        /* Galley Attaching          */
  2063. X    (unsigned char *) "gf",    0, 0, 0,        /* Galley Flusher            */
  2064. X    (unsigned char *) "gm",    0, 0, 0,        /* Galley Maker              */
  2065. X    (unsigned char *) "gs",    0, 0, 0,        /* Galley Service            */
  2066. X    (unsigned char *) "gp",    0, 0, 0,        /* Galley Printer            */
  2067. X    (unsigned char *) "ft",    0, 0, 0,        /* Font Tables               */
  2068. X    (unsigned char *) "oe",    0, 0, 0,        /* Object Echo               */
  2069. X    (unsigned char *) "es",    0, 0, 0,        /* Echo Service              */
  2070. X    (unsigned char *) "zz",    0, 0, 0,        /* Debug Service (unused)    */
  2071. X    (unsigned char *) "yy",    0, 0, 0,        /* Error Service             */
  2072. X    (unsigned char *) "st",    0, 0, 0,        /* Symbol Table              */
  2073. X    (unsigned char *) "su",    0, 0, 0,        /* Symbol Uses               */
  2074. X    (unsigned char *) "ma",    0, 0, 0,        /* Memory Allocator          */
  2075. X    (unsigned char *) "cs",    0, 0, 0,        /* Counter Service           */
  2076. X    (unsigned char *) "bs",    0, 0, 0,        /* Database Service          */
  2077. X    (unsigned char *) "rs",    0, 0, 0,        /* Rotation Service          */
  2078. X    (unsigned char *) "tk",    0, 0, 0,        /* Time Keeper               */
  2079. X    (unsigned char *) "hy",    0, 0, 0,        /* Hyphenation               */
  2080. X    (unsigned char *) "pp",    0, 0, 0,        /* Profiling                 */
  2081. X    (unsigned char *) "",      0, 0, 0,        /* any                       */
  2082. X};
  2083. X
  2084. X
  2085. X/*****************************************************************************/
  2086. X/*                                                                           */
  2087. X/*  DebugInit(str)                                                           */
  2088. X/*                                                                           */
  2089. X/*  Turn on the debug flag given by str.                                     */
  2090. X/*                                                                           */
  2091. X/*****************************************************************************/
  2092. X
  2093. XDebugInit(str)
  2094. Xunsigned char *str;
  2095. X{ int j, urg;
  2096. X  for( urg = 0;  urg < 2 && str[urg+2] == 'd';  urg++ );
  2097. X  for( j = 1;  ;  j++ )
  2098. X  { if( strcmp(dbg[j].flag, &str[urg+2]) == 0 )  break;
  2099. X    if( strcmp(dbg[j].flag, ""         ) == 0 )
  2100. X      Error(FATAL, no_fpos, "unknown debug flag %s", str);
  2101. X  }
  2102. X  for( ;  urg >= 0;  urg-- )  dbg[j].on[urg] = dbg[ANY].on[urg] = TRUE;
  2103. X} /* end DebugInit */
  2104. X
  2105. X
  2106. X/*@@**************************************************************************/
  2107. X/*                                                                           */
  2108. X/*  Debug(category, urgency, str, p1, p2, p3, p4, p5, p6, p7, p8)            */
  2109. X/*                                                                           */
  2110. X/*  Print str on debug output, if the flag corresponding to the given        */
  2111. X/*  debug category and urgency is on.                                        */
  2112. X/*                                                                           */
  2113. X/*****************************************************************************/
  2114. X
  2115. X/*VARARGS3*/
  2116. XDebug(category, urgency, str, p1, p2, p3, p4, p5, p6, p7, p8)
  2117. Xint category, urgency;  unsigned char *str;  int p1, p2, p3, p4, p5, p6, p7, p8;
  2118. X{ static BOOLEAN first_message = TRUE;
  2119. X  if( first_message )
  2120. X  { fprintf(stderr, "\nLout Debug Output:\n");
  2121. X    first_message = FALSE;
  2122. X  }
  2123. X  fprintf(stderr, "%2s: ", dbg[category].flag);
  2124. X  fprintf(stderr, str, p1, p2, p3, p4, p5, p6, p7, p8);
  2125. X  fprintf(stderr, "\n");
  2126. X  fflush(stderr);
  2127. X} /* end Debug */
  2128. X
  2129. X
  2130. X#define MAXPROF    20
  2131. X#include <time.h>
  2132. X
  2133. Xstruct profrec
  2134. X{ unsigned char *label;            /* label of the profile              */
  2135. X  int calls;            /* number of calls with this label   */
  2136. X  long time;            /* total time of this label          */
  2137. X};
  2138. X
  2139. Xstatic struct profrec profstack[MAXPROF];
  2140. Xstatic struct profrec profstore[MAXPROF];
  2141. Xstatic int proftop = 0, profsize = 0;
  2142. X
  2143. X/*****************************************************************************/
  2144. X/*                                                                           */
  2145. X/*  ProfileOn(str)                                                           */
  2146. X/*                                                                           */
  2147. X/*  Start profiling label str.                                               */
  2148. X/*                                                                           */
  2149. X/*****************************************************************************/
  2150. X
  2151. XProfileOn(str)
  2152. Xunsigned char *str;
  2153. X{ int i;  long raw_time;
  2154. X  for( i = 0;  i < proftop;  i++ )
  2155. X  { if( strcmp(profstack[i].label, str) == 0 )
  2156. X    { for( i = 0;  i < proftop;  i++ )
  2157. X    fprintf(stderr, "profstack[%d] = %s\n", i, profstack[i].label);
  2158. X      Error(INTERN, no_fpos, "ProfileOn: %s restarted", str);
  2159. X    }
  2160. X  }
  2161. X  if( proftop == MAXPROF )  Error(INTERN, no_fpos, "ProfileOn: overflow");
  2162. X  time(&raw_time);
  2163. X  profstack[proftop].label = str;
  2164. X  profstack[proftop].time  = raw_time;
  2165. X  proftop++;
  2166. X} /* end ProfileOn */
  2167. X
  2168. X
  2169. X/*****************************************************************************/
  2170. X/*                                                                           */
  2171. X/*  ProfileOff(str)                                                          */
  2172. X/*                                                                           */
  2173. X/*  Stop profiling label str.                                                */
  2174. X/*                                                                           */
  2175. X/*****************************************************************************/
  2176. X
  2177. XProfileOff(str)
  2178. Xunsigned char *str;
  2179. X{ int i;  long raw_time;
  2180. X  if( proftop == 0 || strcmp(profstack[proftop-1].label, str) != 0 )
  2181. X    Error(INTERN, no_fpos, "ProfileOff: %s is not the current label", str);
  2182. X  for( i = 0;  i < profsize && strcmp(profstore[i].label, str) != 0; i++ );
  2183. X  if( i >= profsize )
  2184. X  { if( profsize == MAXPROF )  Error(INTERN, no_fpos, "ProfileOff: overflow");
  2185. X    profsize++;
  2186. X    profstore[i].label = str;
  2187. X    profstore[i].calls = 0;
  2188. X    profstore[i].time  = 0;
  2189. X  }
  2190. X  time(&raw_time);
  2191. X  profstore[i].calls += 1;
  2192. X  profstore[i].time  += (raw_time - profstack[proftop-1].time);
  2193. X  proftop--;
  2194. X} /* end ProfileOff */
  2195. X
  2196. X
  2197. X/*****************************************************************************/
  2198. X/*                                                                           */
  2199. X/*  ProfilePrint()                                                           */
  2200. X/*                                                                           */
  2201. X/*  Print results of profiling.                                              */
  2202. X/*                                                                           */
  2203. X/*****************************************************************************/
  2204. X
  2205. XProfilePrint()
  2206. X{ int i;
  2207. X  for( i = 0;  i < profsize;  i++ )
  2208. X  { fprintf(stderr, "Profile %-20s  %6d secs, %3d calls, %6.2f secs/call\n",
  2209. X    profstore[i].label, profstore[i].time, profstore[i].calls,
  2210. X    (float) profstore[i].time / profstore[i].calls );
  2211. X  }
  2212. X} /* end ProfilePrint */
  2213. X#endif
  2214. END_OF_FILE
  2215.   if test 10847 -ne `wc -c <'lout/z27.c'`; then
  2216.     echo shar: \"'lout/z27.c'\" unpacked with wrong size!
  2217.   fi
  2218.   # end of 'lout/z27.c'
  2219. fi
  2220. echo shar: End of archive 23 \(of 30\).
  2221. cp /dev/null ark23isdone
  2222. MISSING=""
  2223. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  2224.     if test ! -f ark${I}isdone ; then
  2225.     MISSING="${MISSING} ${I}"
  2226.     fi
  2227. done
  2228. if test "${MISSING}" = "" ; then
  2229.     echo You have unpacked all 30 archives.
  2230.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2231. else
  2232.     echo You still must unpack the following archives:
  2233.     echo "        " ${MISSING}
  2234. fi
  2235. exit 0
  2236. exit 0 # Just in case...
  2237.