home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / lout / part27 < prev    next >
Text File  |  1993-06-20  |  85KB  |  2,086 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v37i125:  lout - Lout document formatting system, v2, Part27/30
  4. Message-ID: <1993Jun2.030602.29090@sparky.imd.sterling.com>
  5. X-Md4-Signature: 858bc2b505e948c5f76112d2a6373592
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Wed, 2 Jun 1993 03:06:02 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 125
  13. Archive-name: lout/part27
  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.begin/s01 lout/doc/tr.begin/s07
  21. #   lout/doc/tr.begin/s10 lout/doc/tr.eq/s4 lout/doc/tr.fig/s2
  22. #   lout/doc/tr.fig/s6 lout/doc/tr.impl/s2.5 lout/doc/tr.impl/s4.0
  23. #   lout/doc/tr.impl/s5.3 lout/doc/tr.impl/s5.4 lout/doc/tr.impl/s5.5
  24. #   lout/doc/tr.impl/s6.2 lout/doc/tr.over/s4 lout/doc/tr.over/s5
  25. #   lout/doc/tr.tab/s6 lout/include/book lout/include/report
  26. # Wrapped by kent@sparky on Sun May 30 19:44:02 1993
  27. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  28. echo If this archive is complete, you will see the following message:
  29. echo '          "shar: End of archive 27 (of 30)."'
  30. if test -f 'lout/doc/tr.begin/s01' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'lout/doc/tr.begin/s01'\"
  32. else
  33.   echo shar: Extracting \"'lout/doc/tr.begin/s01'\" \(4181 characters\)
  34.   sed "s/^X//" >'lout/doc/tr.begin/s01' <<'END_OF_FILE'
  35. X@Section
  36. X   @Tag { intro }
  37. X   @Title { Introduction }
  38. X@Begin
  39. X@PP
  40. XThe Lout document formatting system has been designed with the
  41. Xneeds of the ordinary user very much in mind.  Although the features of Lout
  42. Xare virtually endless, and include mathematical equations, diagrams made
  43. Xfrom lines and shapes, bibliographic databases, and so on, the system is
  44. Xvery simple to use.
  45. X@PP
  46. XDocument formatting with Lout begins with the creation of a file like
  47. Xthe following:
  48. X@ID @Code {
  49. X"@Doc @Text @Begin"
  50. X"@Heading { Introduction }"
  51. X"@PP"
  52. X"For Virginia Woolf, @I Middlemarch"
  53. X"was `the magnificent book which"
  54. X"for all its imperfections is one"
  55. X"of the few English novels written"
  56. X"for grown-up people.'"
  57. X"@End @Text"
  58. X}
  59. XOrdinary words are mixed with symbols of special meaning, such as
  60. X{@Code "@Doc"}, {@Code "@Text"}, {@Code "@Heading"}, and
  61. X{@Code "@I"}.  Most symbols begin with {@Code "@"}, but some, like
  62. X{@Code "{"} and {@Code "}"}, do not.  It doesn't matter where the lines
  63. Xend:  the end of a line is treated the same as a single space.
  64. X@PP
  65. XThis file is then processed by the Basser Lout interpreter, for example
  66. Xby typing
  67. X@ID @Code "lout -idoc simple > simple.ps"
  68. Xon the Unix
  69. X@FootNote { Unix is a trademark of "AT&T" Bell Laboratories. &0io }
  70. Xoperating system, assuming that the file's name is
  71. X{@Code "simple"}.  The @Code "-idoc" part instructs Lout to include a
  72. Xspecial @I {setup file} called {@Code doc}, in which the symbols are
  73. Xdefined.  The output is the PostScript
  74. X@FootNote { PostScript is a trademark of Adobe Systems, Inc. &0io }
  75. Xfile {@Code "simple.ps"}, which is suitable for printing on most laser
  76. Xprinters and many other devices.  When printed, it will appear like this:
  77. X@ID {
  78. X@Heading { Introduction }
  79. X@PP
  80. XFor Virginia Woolf, @I Middlemarch was `the magnificent book which
  81. Xfor all its imperfections is one of the few English novels written
  82. Xfor grown-up people.'
  83. X}
  84. XThe meaning of each symbol is now clear.  @Code "@Doc @Text @Begin" and
  85. X@Code "@End @Text" have no visible effect, but they always bracket the
  86. Xdocument as a whole.  @Code "@Heading" makes the following thing into
  87. Xa heading; there is also @Code "@MajorHeading" for producing a large
  88. Xheading, and @Code "@MinorHeading" for a subheading.  The @Code "@PP"
  89. Xsymbol starts a paragraph whose first line is indented; also available
  90. Xare {@Code "@LP"} which omits the indent, {@Code "@DP"} which leaves the
  91. Xamount of vertical space used for displays, and {@Code "@NP"}, which
  92. Xstarts a new page or column (rarely used, since Lout does this
  93. Xautomatically when the old one fills).  Finally, @Code "@I" changes the
  94. Xfont of the following thing to {@I Italic}.
  95. X@PP
  96. XBraces are used to group parts of the document together so that nearby
  97. Xsymbols will affect the whole part.  For example,
  98. X@ID @Code "@I { Scenes of Clerical Life }"
  99. Xproduces {@I { Scenes of Clerical Life }}.  The braces around
  100. X@Code "Introduction" in the example above are not strictly necessary,
  101. Xsince a single word does not need to be grouped; but a longer heading
  102. Xwould require them.  Braces also help when a symbol must be immediately
  103. Xadjacent to another symbol or to a word:
  104. X@ID @Code "QuikWipe{@TradeMark}"
  105. Xhas result QuikWipe{@TradeMark}.  Without them Lout would confuse the
  106. Xtwo.  In a similar way, @Code "{@I Middlemarch}," produces
  107. X{@I Middlemarch}, with the comma not set in Italic.
  108. X@PP
  109. XCharacters like "{", which normally are symbols, will be
  110. Xtreated as ordinary words when enclosed in double quotes.  For example,
  111. X@Code "\"{\"" produces "{".  The characters
  112. X@ID @Code "/    |    &    {    }    #    @    ^"
  113. Xshould always be so enclosed, since otherwise they will have special
  114. Xeffects.
  115. X@PP
  116. XThe symbols described above form part of the {@I DocumentLayout @I package},
  117. Xa collection of symbols designed to make day-to-day document formatting
  118. Xeasy.  This package also provides symbols for producing displays and
  119. Xlists, numbered sections, subsections, and appendices, footnotes,
  120. Xfigures, tables, references, and cross references.  These are described
  121. Xin later sections of this report.  This same package may also be used to
  122. Xproduce technical reports and books, as described in Sections
  123. X@NumberOf reportlayout and {@NumberOf booklayout}.
  124. X@End @Section
  125. END_OF_FILE
  126.   if test 4181 -ne `wc -c <'lout/doc/tr.begin/s01'`; then
  127.     echo shar: \"'lout/doc/tr.begin/s01'\" unpacked with wrong size!
  128.   fi
  129.   # end of 'lout/doc/tr.begin/s01'
  130. fi
  131. if test -f 'lout/doc/tr.begin/s07' -a "${1}" != "-c" ; then 
  132.   echo shar: Will not clobber existing file \"'lout/doc/tr.begin/s07'\"
  133. else
  134.   echo shar: Extracting \"'lout/doc/tr.begin/s07'\" \(1777 characters\)
  135.   sed "s/^X//" >'lout/doc/tr.begin/s07' <<'END_OF_FILE'
  136. X@Section
  137. X   @Tag { sections }
  138. X   @Title { Sections }
  139. X@Begin
  140. X@PP
  141. XThe DocumentLayout package provides sections, like this:
  142. X@ID @Code {
  143. X"some introductory text."
  144. X"@BeginSections"
  145. X"@Section"
  146. X"    @Title { Introduction }"
  147. X"@Begin"
  148. X"@PP"
  149. X"..."
  150. X"..."
  151. X"@End @Section"
  152. X"@Section"
  153. X"    @Title { Displays and lists }"
  154. X"@Begin"
  155. X"@PP"
  156. X"..."
  157. X"..."
  158. X"@End @Section"
  159. X"@EndSections"
  160. X}
  161. X@Code "@BeginSections" and @Code "@EndSections" symbols must
  162. Xbracket the sections, and paragraph symbols are needed at the
  163. Xbeginning of each section but not before or after the whole group.  The
  164. X@Code "@Title" option of @Code "@Section" is made into a numbered heading,
  165. Xlike those in the present document, preceded by a conditional new page
  166. Xsymbol (Section {@NumberOf cnp}).  The body of each section is enclosed in
  167. X@Code "@Begin" and {@Code "@End @Section"}, although @Code "{" and @Code "}"
  168. Xare sufficient if preferred.  The former are more long-winded but less
  169. Xprone to error.
  170. X@PP
  171. XWithin sections one may choose to have a sequence of subsections.  These
  172. Xare introduced by @Code "@BeginSubSections" and concluded by
  173. X{@Code "@EndSubSections"}:
  174. X@ID @Code {
  175. X"in the following subsections."
  176. X"@BeginSubSections"
  177. X"@SubSection"
  178. X"    @Title { ... }"
  179. X"@Begin"
  180. X"@PP"
  181. X"..."
  182. X"@End @SubSection"
  183. X"@SubSection"
  184. X"    @Title { ... }"
  185. X"@Begin"
  186. X"@PP"
  187. X"..."
  188. X"@End @SubSection"
  189. X"@EndSubSections"
  190. X}
  191. XThe first subsection of the first section will be numbered 1.1, and so
  192. Xon.  There are no sub-subsections.  DocumentLayout also provides appendices
  193. Xin an exactly analogous way, using the symbols {@Code "@BeginAppendices"},
  194. X{@Code "@Appendix"}, and {@Code "@EndAppendices"}, and subappendices
  195. Xwithin any appendix using the symbols {@Code "@BeginSubAppendices"},
  196. X{@Code "@SubAppendix"}, and {@Code "@EndSubAppendices"}.
  197. X@End @Section
  198. END_OF_FILE
  199.   if test 1777 -ne `wc -c <'lout/doc/tr.begin/s07'`; then
  200.     echo shar: \"'lout/doc/tr.begin/s07'\" unpacked with wrong size!
  201.   fi
  202.   # end of 'lout/doc/tr.begin/s07'
  203. fi
  204. if test -f 'lout/doc/tr.begin/s10' -a "${1}" != "-c" ; then 
  205.   echo shar: Will not clobber existing file \"'lout/doc/tr.begin/s10'\"
  206. else
  207.   echo shar: Extracting \"'lout/doc/tr.begin/s10'\" \(4136 characters\)
  208.   sed "s/^X//" >'lout/doc/tr.begin/s10' <<'END_OF_FILE'
  209. X@Section
  210. X   @Tag { refs }
  211. X   @Title { References }
  212. X@Begin
  213. X@PP
  214. XThe method of handling references described in this section is rather
  215. Xelaborate, but it has many advantages.  The first step is to create a
  216. Xseparate @I {database file} containing @Code "@Reference" symbols.  Each
  217. Xis enclosed in braces, and has options chosen from
  218. X{@Code "@Tag"}, {@Code "@Type"}, {@Code "@Author"}, {@Code "@Title"},
  219. X{@Code "@Institution"}, {@Code "@Number"}, {@Code "@Publisher"},
  220. X{@Code "@Year"}, {@Code "@Proceedings"}, {@Code "@Journal"},
  221. X{@Code "@Volume"}, {@Code "@Pages"}, and {@Code "@Comment"}:
  222. X@IndentedList
  223. X@ListItem @Code {
  224. X"{ @Reference"
  225. X"     @Tag { strunk79 }"
  226. X"     @Type { Book }"
  227. X"     @Author { Strunk and White }"
  228. X"     @Title { The Elements of Style }"
  229. X"     @Publisher { MacMillan }"
  230. X"     @Year { 1979 }"
  231. X"}"
  232. X}
  233. X@ListItem @Code {
  234. X"{ @Reference"
  235. X"     @Tag { kingston92 }"
  236. X"     @Type { TechReport }"
  237. X"     @Author { Kingston, Jeffrey H. }"
  238. X"     @Title { Document Formatting"
  239. X"with Lout }"
  240. X"     @Number { 449 }"
  241. X"     @Institution { Basser Department"
  242. X"of Computer Science F09, University"
  243. X"of Sydney 2006, Australia }"
  244. X"     @Year { 1992 }"
  245. X"}"
  246. X}
  247. X@EndList
  248. XThe {@Code "@Tag"} and {@Code "@Type"} options are in fact compulsory; the
  249. Xfirst serves to name the reference, the second gives its type, which may
  250. Xbe {@Code "TechReport"}, {@Code "ConferencePaper"}, {@Code "JournalArticle"},
  251. X{@Code "PhD"}, or {@Code "Book"}, although a Lout expert will be able to add
  252. Xother types.  The type determines which other options must be present, as
  253. Xshown above, and how they will be printed.
  254. X@PP
  255. XSuppose this file is given the name @Code "myrefs.ld" (Basser Lout
  256. Xdatabase file names must end in {@Code ".ld"}).  To tell Lout to refer
  257. Xto this file as needed,
  258. X@ID @Code {
  259. X"@Database @Reference { myrefs }"
  260. X}
  261. Xis placed at the beginning of the document, before {@Code "@Doc"},
  262. X{@Code "@Report"}, or {@Code "@Book"}.
  263. X@PP
  264. XNow, with everything prepared,
  265. X@ID @Code {
  266. X"{@Ref kingston92}"
  267. X}
  268. Xfor example at any point in the document will cause the reference whose
  269. Xtag is @Code "kingston92" to be added to the nearest following
  270. Xreference list, indicated by the symbol {@Code "@ReferenceSection"}, unless
  271. Xit is already there.  Typically one would write
  272. X@ID @Code {
  273. X"... which ends our study."
  274. X"@DP"
  275. X"@ReferenceSection"
  276. X}
  277. Xat the very end of the document (although one could equally well have several
  278. X@Code "@ReferenceSection" symbols scattered through the document if desired);
  279. Xtechnical reports and books add @Code "@ReferenceSection" automatically
  280. Xwhen needed.  The references will appear in alphabetical order by tag, and
  281. Xthe @Code "@Ref" symbol will be replaced by the number of the reference,
  282. Xin this case {@Ref "kingston92"}.  @Code "@ReferenceSection" has a
  283. X@Code "@Title" option like {@Code "@Section"}, and it also has {@Code style},
  284. X{@Code indent}, {@Code gap} and {@Code start} options for contolling the
  285. Xappearance of the reference list, like {@Code "@RawIndentList"}.
  286. X@PP
  287. XIf a separate database file is not convenient for some reason, perhaps
  288. Xbecause it is desirable for the entire document to reside in one file,
  289. Xthe @Code "@Reference" symbols may be incorporated into the document
  290. Xitself, anywhere after {@Code "@Text @Begin"}.  Nothing will appear
  291. Xwhere they are typed in, but Lout will
  292. Xnotice them and treat them exactly as if they had come from a database
  293. Xfile.  In this case no @Code "@Database" symbol is needed.
  294. X@PP
  295. XA way to print references at any point in the document is provided by
  296. X{@Code "@RefPrint"}:
  297. X@ID @Code "{@RefPrint kingston92}"
  298. Xmight have result
  299. X@ID {@RefPrint kingston92}
  300. Xdepending on what references exist.
  301. X@PP
  302. XTo get section numbers, footnote numbers, cross references, and references
  303. Xright, Basser Lout has to process the document more than once (three times
  304. Xfor numbered references), and create special files whose names end
  305. Xin `.li' and `.ld'.  It will print warning messages on runs when this
  306. Xprocess is incomplete, and substitute question marks for the unknown
  307. Xvalues.  There should be only one document containing these features per
  308. XUnix directory, otherwise Basser Lout will confuse their special files.
  309. X@End @Section
  310. END_OF_FILE
  311.   if test 4136 -ne `wc -c <'lout/doc/tr.begin/s10'`; then
  312.     echo shar: \"'lout/doc/tr.begin/s10'\" unpacked with wrong size!
  313.   fi
  314.   # end of 'lout/doc/tr.begin/s10'
  315. fi
  316. if test -f 'lout/doc/tr.eq/s4' -a "${1}" != "-c" ; then 
  317.   echo shar: Will not clobber existing file \"'lout/doc/tr.eq/s4'\"
  318. else
  319.   echo shar: Extracting \"'lout/doc/tr.eq/s4'\" \(4293 characters\)
  320.   sed "s/^X//" >'lout/doc/tr.eq/s4' <<'END_OF_FILE'
  321. X@Section
  322. X   @Title { Features from Standard Lout }
  323. X@Begin
  324. X@PP
  325. XIn this section we summarize those features of standard Lout of most
  326. Xrelevance to equation formatting.  All are freely available within
  327. Xequations.  Full details may be found in the Lout reference manual
  328. X[{@Ref kingston92}].
  329. X@PP
  330. XStandard Lout uses the symbols {@Code "#"}, {@Code "{"}, {@Code "}"},
  331. X{@Code "&"}, {@Code "|"}, and @Code "/" for special purposes (the braces
  332. Xare used for grouping, for example).  To get these characters into
  333. Xequations without using their full names, enclose them in double quotes:
  334. X{@Code "\"{\""}, {@Code "\"}\""}, etc.  Any sequence of characters
  335. Xincluding spaces but not newlines may be so enclosed, and the effect is
  336. Xto turn off any special meaning that the symbols within it might have.
  337. X@PP
  338. XEq sets letters in Slope (Lout's name for Italic), digits in Base (i.e.
  339. XRoman), and other symbols in various fonts, mostly the Symbol font.  To
  340. Xchange fonts, use the @Code "@Font" symbol:
  341. X@ID {
  342. X@Code "Slope @Font \"2\""
  343. X|7ct
  344. X@Eq { Slope @Font "2" }
  345. X}
  346. XIn Eq it will often be necessary to enclose the right parameter in
  347. Xdouble quotes, because the symbol 2 includes a built-in change back to
  348. XBase font.  Changing fonts makes white space between objects in the
  349. Xright parameter appear in the result.  The @Code "@Font" operator also
  350. Xdoes size changes:
  351. X@IL
  352. X@LI {
  353. X@Code "sum"
  354. X|7ct
  355. X@Eq { sum }
  356. X}
  357. X@LI {
  358. X@Code "\"+2p\" @Font sum"
  359. X|7ct
  360. X@Eq { "+2p" @Font sum }
  361. X}
  362. X@LI {
  363. X@Code "2.0f @Font sum"
  364. X|7ct
  365. X@Eq { 2.0f @Font sum }
  366. X}
  367. X@EL
  368. XHere @Code "\"+2p\" @Font" sets its right parameter in a font two points
  369. Xlarger than it would otherwise have been; @Code "2.0f @Font" sets its
  370. Xright parameter in a font twice the original size.  Sizes should always
  371. Xbe specified relative to the enclosing size as we have done here, since
  372. Xthen they don't need to be changed if a decision is made to set the entire
  373. Xdocument in a different size.  It is necessary to enclose @Code "+2p" in
  374. Xdouble quotes within Eq, because otherwise the @Code "+" will be taken as
  375. Xthe Eq symbol for {@Eq { + }}.  The right parameter may be any object.
  376. X@PP
  377. XWhenever similar equations or parts of equations are being typed
  378. Xrepeatedly, @I definitions should be used to save time.  Suppose for
  379. Xexample that @OneCol @Eq { p sub i ` log sub 2 ` p sub i } occurs
  380. Xfrequently.  Then
  381. X@ID @Code "def epi { p sub i ` log sub 2 ` p sub i }"
  382. Xmakes the symbol @Code "epi" stand for the object between the braces:
  383. X@ID {
  384. X@Code "big sum from i=1 to n ` epi"
  385. X|7ct
  386. X@Eq { big sum from i=1 to n ` epi }
  387. X}
  388. XSymbols may be given parameters:
  389. X@ID @Code {
  390. X"def ep"
  391. X"   right x"
  392. X"{ p sub x ` log sub 2 ` p sub x"
  393. X"}"
  394. X}
  395. XThe parameter @Code x will be replaced by the object just to the right
  396. Xof {@Code "ep"}:
  397. X@ID {
  398. X@Code {
  399. X"big sum from j=1 to k ` ep i +"
  400. X"big sum from j=k+1 to n ep j"
  401. X}
  402. X||7ct
  403. X@Eq {
  404. Xbig sum from j=1 to k ` ep i +
  405. Xbig sum from j=k+1 to n ep j
  406. X}
  407. X}
  408. XThe precedence of such symbols will be 100 by default.
  409. X@PP
  410. XTo make the symbols of Eq available within such definitions, each must be
  411. Xpreceded by {@Code "import @Eq"}.  The best place to keep them is in the
  412. Xsetup file, which might then look like this:
  413. X@ID @Code {
  414. X"@SysInclude { ft  }"
  415. X"@SysInclude { dl  }"
  416. X"@SysInclude { eq  }"
  417. X""
  418. X"import @Eq"
  419. X"def epi { p sub i ` log sub 2 ` p sub i }"
  420. X""
  421. X"import @Eq"
  422. X"def ep right x { p sub x ` log sub 2 ` p sub x }"
  423. X""
  424. X"@Use { @DocumentLayout }"
  425. X}
  426. XUse of @Code "epi" and @Code "ep" outside equations will cause an error.
  427. X@PP
  428. XEquations can appear within a paragraph of text, or they can be
  429. Xdisplayed.  Eq's job is to produce a Lout object containing the
  430. Xequation; it neither knows nor cares where this equation goes.  To get
  431. Xan equation within a paragraph, simply place @Code "@Eq { ... }" at the
  432. Xdesired point.  To prevent it spreading over two lines, use
  433. X{@Code "@OneCol @Eq { ... }"}.  To display an equation, use a display
  434. Xsymbol from some other Lout package.  For example, the DocumentLayout package
  435. X[{@Ref kingston92begin}] has @Code "@IndentedDisplay" or @Code "@ID" for an
  436. Xindented display, and @Code "@CentredDisplay" or @Code "@CD" for a centred
  437. Xdisplay, so
  438. X@ID @Code "@CD @Eq { int supp pi on 0 sin ` x = 0 }"
  439. Xproduces
  440. X@CD @Eq { int supp pi on 0 sin ` x = 0 }
  441. XDocumentLayout also provides display symbols that make it easy to
  442. Xproduce aligned and numbered equations.
  443. X@End @Section
  444. END_OF_FILE
  445.   if test 4293 -ne `wc -c <'lout/doc/tr.eq/s4'`; then
  446.     echo shar: \"'lout/doc/tr.eq/s4'\" unpacked with wrong size!
  447.   fi
  448.   # end of 'lout/doc/tr.eq/s4'
  449. fi
  450. if test -f 'lout/doc/tr.fig/s2' -a "${1}" != "-c" ; then 
  451.   echo shar: Will not clobber existing file \"'lout/doc/tr.fig/s2'\"
  452. else
  453.   echo shar: Extracting \"'lout/doc/tr.fig/s2'\" \(4595 characters\)
  454.   sed "s/^X//" >'lout/doc/tr.fig/s2' <<'END_OF_FILE'
  455. X@Section
  456. X   @Title { Basic Shapes }
  457. X@Begin
  458. X@PP
  459. XFig has a repertoire of basic shapes, whose size varies depending on
  460. Xwhat they enclose:
  461. X@IL
  462. X@LI {
  463. X@Code "@Ellipse { hello, world }"
  464. X||7ct
  465. X@Fig {
  466. X@Ellipse { hello, world }
  467. X}
  468. X}
  469. X@LI {
  470. X@Code "@Box { 2c @High }"
  471. X||7ct
  472. X@Fig {
  473. X@Box { 2c @High }
  474. X}
  475. X}
  476. X@EL
  477. XThere are six such shapes: {@Code "@Box"}, {@Code "@Square"},
  478. X{@Code "@Diamond"}, {@Code "@Polygon"}, {@Code "@Ellipse"}, and
  479. X{@Code "@Circle"}; the result in each case is the right parameter,
  480. Xenclosed in a small margin, with the shape around it.
  481. X@PP
  482. XThere are options for changing the appearance of these shapes.  The
  483. Xboundary line's style may be {@Code solid}, {@Code dashed},
  484. X{@Code cdashed}, {@Code dotted}, or {@Code noline} (that is, no line is
  485. Xdrawn), and the length of the dashes may be changed:
  486. X@ID {
  487. X@Code {
  488. X"@Circle"
  489. X"   linestyle { cdashed }"
  490. X"   dashlength { 0.2 cm }"
  491. X"@Eq { X sub 2 }"
  492. X}
  493. X||7ct
  494. X@Fig {
  495. X@Circle
  496. X   linestyle { cdashed }
  497. X   dashlength { 0.2 cm }
  498. X@Eq { X sub 2 }
  499. X}
  500. X}
  501. XIf the line style is not mentioned, it becomes @Code solid by default.  The
  502. X@Code dashed option makes all dashes the same length; @Code cdashed
  503. Xhalves the length of the first and last dash on each segment, which
  504. Xlooks better in some cases.  The distance between dashes or dots will be
  505. Xat most {@Code dashlength}, reduced to make the dashes or dots fit evenly.
  506. X@PP
  507. XShapes may be painted {@Code black}, {@Code dark}, {@Code grey} or
  508. X{@Code gray}, {@Code light}, {@Code white}, or {@Code nopaint} (the default):
  509. X@ID {
  510. X@Code {
  511. X"@Box"
  512. X"   margin { 0c }"
  513. X"   paint { grey }"
  514. X"@Diamond"
  515. X"   linestyle { noline }"
  516. X"   paint { white }"
  517. X"{ hello, world }"
  518. X}
  519. X||7ct
  520. X@Fig {
  521. X@Box
  522. X   margin { 0c }
  523. X   paint { grey }
  524. X@Diamond
  525. X   linestyle { noline }
  526. X   paint { white }
  527. X{ hello, world }
  528. X}
  529. X}
  530. XHere, the right parameter of @Code "@Box" is a diamond containing
  531. X{@Code "hello, world"}.  There is no limit to the amount of this sort of
  532. Xnesting; the right parameter may be any Lout object.
  533. X@PP
  534. XWhen painting it is important to know what order things are done in,
  535. Xbecause anything put down earlier will disappear under the paint.  This
  536. Xis why @Code nopaint and @Code white are different.  Painting is done
  537. Xfirst, then boundaries, and finally the right parameter.
  538. X@PP
  539. XThe @Code "@Polygon" shape has a @Code sides option for specifying the number
  540. Xof sides, and an @Code angle option for specifying what angle anticlockwise
  541. Xfrom vertically beneath the centre the first corner will appear at:
  542. X@IL
  543. X@LI {
  544. X@Code {
  545. X"@Polygon"
  546. X"   sides { 5 }"
  547. X"{}"
  548. X}
  549. X||7ct
  550. X@Fig {
  551. X//0.5c 
  552. X@Polygon
  553. X   sides { 5 }
  554. X{}
  555. X}
  556. X}
  557. X
  558. X@LI {
  559. X@Code {
  560. X"@Polygon"
  561. X"   sides { 5 }"
  562. X"   angle { 0 dg }"
  563. X"{}"
  564. X}
  565. X||7ct
  566. X@Fig {
  567. X//0.5c 
  568. X@Polygon
  569. X   sides { 5 }
  570. X   angle { 0 dg }
  571. X{}
  572. X}
  573. X}
  574. X@EL
  575. XThe defaults are 3 sides and the angle that gives the polygon
  576. Xa horizontal base (i.e. 180 degrees divided by the number of sides).
  577. XThus the two cases with symmetry about a vertical axis are obtained 
  578. Xby the default angle and @Code "0 dg" respectively, which is convenient.
  579. X@PP
  580. XAlthough lines and arrows do not enclose things in the way that boxes
  581. Xand circles do, Fig treats them as it does the other shapes.  The line
  582. Xor arrow is drawn along the mark of the right parameter, either
  583. Xhorizontally or vertically:
  584. X@IL
  585. X@LI {
  586. X@Code "@HLine { //0.2c hello, world }"
  587. X||7ct
  588. X@Fig {
  589. X@HLine { //0.2c hello, world }
  590. X}
  591. X}
  592. X@LI {
  593. X@Code "@VArrow { 2c @High X ^|0.2c }"
  594. X||7ct
  595. X@Fig {
  596. X@VArrow { 2c @High X ^|0.2c }
  597. X}
  598. X}
  599. X@EL
  600. XThe usual line style options are available; the default margin is
  601. X{@Code "0c"}.  Arrows can be
  602. X{@Code forward} (the default), {@Code back}, {@Code both}, or
  603. X{@Code noarrow} (which just draws a line); the style of the arrowhead
  604. Xcan be {@Code open} (the default), {@Code halfopen}, or {@Code closed}:
  605. X@ID {
  606. X@Code {
  607. X"@HArrow"
  608. X"   arrow { both }"
  609. X"   headstyle { closed }"
  610. X"{ 3c @Wide }"
  611. X}
  612. X||7ct
  613. X@Fig {
  614. X@HArrow
  615. X   arrow { both }
  616. X   headstyle { closed }
  617. X{ 3c @Wide }
  618. X}
  619. X}
  620. XIt is also possible to change the shape of the arrowhead, using the
  621. X@Code headwidth and @Code headlength options:
  622. X@ID @Fig {
  623. X{
  624. X@Figure
  625. X   shape {
  626. X      {0 ysize} ** 0.4 @Label SB
  627. X      {0 ysize} ** 0.6 @Label ST
  628. X      {xsize 0} ** 0.7 @Label HB
  629. X      SB
  630. X      SB ++ HB
  631. X      HB
  632. X      {xsize 0} ++ {0 ysize} ** 0.5
  633. X      HB ++ {0 ysize}
  634. X      HB ++ ST
  635. X      ST
  636. X      SB
  637. X   }
  638. X   paint { grey }
  639. X{ 10c @Wide 3c @High }
  640. X//0.3c
  641. X7c @Wide {} & @HArrow headstyle { closed } arrow {both }
  642. X3c @Wide { //0.2c |0.5rt @I -2p @Font headlength }
  643. X} |0.3c @VArrow headstyle { closed } arrow {both }
  644. X1.5c @High { /0.5rt |0.2c @I -2p @Font headwidth |0io }
  645. X}
  646. XTheir default values are @Code "0.05 cm" and @Code "0.15 cm"
  647. Xrespectively.
  648. X@End @Section
  649. END_OF_FILE
  650.   if test 4595 -ne `wc -c <'lout/doc/tr.fig/s2'`; then
  651.     echo shar: \"'lout/doc/tr.fig/s2'\" unpacked with wrong size!
  652.   fi
  653.   # end of 'lout/doc/tr.fig/s2'
  654. fi
  655. if test -f 'lout/doc/tr.fig/s6' -a "${1}" != "-c" ; then 
  656.   echo shar: Will not clobber existing file \"'lout/doc/tr.fig/s6'\"
  657. else
  658.   echo shar: Extracting \"'lout/doc/tr.fig/s6'\" \(5044 characters\)
  659.   sed "s/^X//" >'lout/doc/tr.fig/s6' <<'END_OF_FILE'
  660. X@Section
  661. X   @Title { Putting it all together }
  662. X@Begin
  663. X@PP
  664. XIn this section we consider the problem of linking individual shapes
  665. Xtogether to form complex diagrams like this one:
  666. X@ID @Fig {
  667. X@Frame { 10c @Wide 6c @High }
  668. X// X**0.1 ++ Y**0.4 @BaseOf A:: @Square { @I A }
  669. X// X**0.4 ++ Y**0.7 @BaseOf B:: @Square { @I B }
  670. X// X**0.6 ++ Y**0.1 @BaseOf C:: @Square { @I C }
  671. X// X**0.8 ++ Y**0.6 @BaseOf D:: @Square { @I D }
  672. X// A @JoinFigures arrow { forward } B
  673. X// A @JoinFigures arrow { forward } C
  674. X// B @JoinFigures arrow { forward } C
  675. X// B @JoinFigures arrow { forward } D
  676. X// C @JoinFigures arrow { forward } D
  677. X}
  678. XWe already have several aids to hand:  the standard Lout symbols,
  679. Xespecially horizontal and vertical concatenation, rotation and scaling;
  680. Xthe ability to nest text, equations, and other figures (in fact
  681. Xarbitrary Lout objects) within our shapes; and the standard Lout
  682. Xdefinition mechanism.
  683. X@PP
  684. XThe default values of the various options -- @Code "solid" for
  685. X{@Code linestyle}, @Code noarrow for {@Code arrow}, and so on -- may be
  686. Xchanged by giving options to the @Code "@Fig" symbol:
  687. X@ID {
  688. X@Code {
  689. X"@Fig"
  690. X"   linestyle { noline }"
  691. X"   paint { black }"
  692. X"{"
  693. X"   @Circle |1c @Square"
  694. X"   /1c @Diamond | @Polygon"
  695. X"}"
  696. X}
  697. X||7ct
  698. X@Fig
  699. X   linestyle { noline }
  700. X   paint { black }
  701. X{
  702. X    @Circle |1c @Square
  703. X   /1c
  704. X   @Diamond | @Polygon
  705. X}
  706. X}
  707. XA complete list of options is given in the next section.
  708. X@PP
  709. XFig provides an additional aid: the symbols {@Code "@BaseOf"} and
  710. X{@Code "@MarkOf"}.  The right parameter of {@Code "@BaseOf"} is an
  711. Xarbitrary object, and its left parameter is a point.  As far as Lout
  712. Xis concerned, the result of @Code "@BaseOf" is always an empty object;
  713. Xbut the right parameter will appear on the page with the bottom left-hand
  714. Xcorner of its base at the point denoted by the left parameter.  We stress
  715. Xthat Lout has no idea that this is happening, and so cannot prevent the
  716. Xshifted object from writing over other objects or even going off the edge
  717. Xof the page.  Of course, this lack of discipline is just what is needed
  718. Xvery often in diagrams.
  719. X@PP
  720. XThe @Code "@MarkOf" symbol works in a similar way, except that the point
  721. Xwhere the object's marks cross (rather than its bottom left-hand corner)
  722. Xwill appear on the page at the point denoted by the left parameter.
  723. X@PP
  724. XWe can set up a coordinate system for a figure:
  725. X@ID @Code {
  726. X"@Figure shape { xsize 0 @Label X  0 ysize @Label Y }"
  727. X"{ 10c @Wide 6c @High }"
  728. X}
  729. XIn fact, Fig contains this shape under the name {@Code "@Frame"}, so we
  730. Xneed only write
  731. X@ID @Code "@Frame { 10c @Wide 6c @High }"
  732. XOf course, the right parameter may contain an arbitrary Lout object.
  733. X@PP
  734. XOnce the frame is set up, we can specify points by their @Code X and
  735. X@Code Y coordinates, as fractions of the total width and height:
  736. X@ID @Code "X ** 0.5  ++  Y ** 0.8"
  737. XTo place the squares in the diagram above, we can use
  738. X@ID @Code {
  739. X"//  X**0.1 ++ Y**0.4  @BaseOf  A:: @Square { @I A }"
  740. X"//  X**0.4 ++ Y**0.7  @BaseOf  B:: @Square { @I B }"
  741. X"//  X**0.6 ++ Y**0.1  @BaseOf  C:: @Square { @I C }"
  742. X"//  X**0.8 ++ Y**0.6  @BaseOf  D:: @Square { @I D }"
  743. X}
  744. XThe symbols' precedences are chosen so that this very common situation
  745. Xrequires no braces.  The result of this is
  746. X@ID @Fig {
  747. X@Box margin { 0c } @Frame { 10c @Wide 6c @High }
  748. X// X**0.1 ++ Y**0.4 @BaseOf A:: @Square { @I A }
  749. X// X**0.4 ++ Y**0.7 @BaseOf B:: @Square { @I B }
  750. X// X**0.6 ++ Y**0.1 @BaseOf C:: @Square { @I C }
  751. X// X**0.8 ++ Y**0.6 @BaseOf D:: @Square { @I D }
  752. X}
  753. X{@PageMark sumpoints} where we have drawn a box with margin 0 around the
  754. Xframe to make its extent clear.
  755. X@PP
  756. XNow the arrow from @I A to @I B starts on the boundary of @I A at the
  757. Xangle of a line drawn between the centres of @I A and {@I B}:
  758. X@ID @Code "A@CTR ++ { {A@CTR @Angle B@CTR} A@CIRCUM }"
  759. Xand a similar expression will yield the endpoint of the arrow.  Such
  760. Xexpressions should be placed into definitions if they are to be used often:
  761. X@ID @Code {
  762. X"import @Fig"
  763. X"def @JoinFigures"
  764. X"   left A"
  765. X"   named linestyle { solid }"
  766. X"   named dashlength { 0.15 cm }"
  767. X"   named arrow { noarrow }"
  768. X"   named linewidth { 0.5 pt }"
  769. X"   right B"
  770. X"{  @Arrow"
  771. X"      from { A\"@CTR\" ++ {{A\"@CTR\" @Angle B\"@CTR\"} A\"@CIRCUM\"} }"
  772. X"      to   { B\"@CTR\" ++ {{B\"@CTR\" @Angle A\"@CTR\"} B\"@CIRCUM\"} }"
  773. X"      linestyle { linestyle }"
  774. X"      dashlength { dashlength }"
  775. X"      arrow { arrow }"
  776. X"      linewidth { linewidth }"
  777. X"   {}"
  778. X"}"
  779. X}
  780. XDefinitions preceded by @Code "import @Fig" may use the symbols of
  781. XFig within them; they may themselves be used only within
  782. X@Code "@Fig { ... }".  Now, to the figure above we can add
  783. X@ID @Code {
  784. X"// A @JoinFigures arrow { forward } B"
  785. X"// A @JoinFigures arrow { forward } C"
  786. X"// B @JoinFigures arrow { forward } C"
  787. X"// B @JoinFigures arrow { forward } D"
  788. X"// C @JoinFigures arrow { forward } D"
  789. X}
  790. Xto obtain the diagram as it appears at the beginning of this
  791. Xsection.  Definitions are the best means of managing complexity in
  792. Xdiagrams, and serious users maintain a file of definitions which is
  793. Xincluded automatically by an @Code "@Include" command.
  794. X@End @Section
  795. END_OF_FILE
  796.   if test 5044 -ne `wc -c <'lout/doc/tr.fig/s6'`; then
  797.     echo shar: \"'lout/doc/tr.fig/s6'\" unpacked with wrong size!
  798.   fi
  799.   # end of 'lout/doc/tr.fig/s6'
  800. fi
  801. if test -f 'lout/doc/tr.impl/s2.5' -a "${1}" != "-c" ; then 
  802.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s2.5'\"
  803. else
  804.   echo shar: Extracting \"'lout/doc/tr.impl/s2.5'\" \(4418 characters\)
  805.   sed "s/^X//" >'lout/doc/tr.impl/s2.5' <<'END_OF_FILE'
  806. X@SubSection
  807. X    @Tag { style }
  808. X    @Title { Context-sensitive attributes of objects }
  809. X@Begin
  810. X@PP
  811. XAlthough we are free to place any object in any context, the context
  812. Xmust influence the appearance of the object, since otherwise
  813. X@ID @Code "A short paragraph of text."
  814. Xcould not appear in a variety of fonts, column widths, etc.  This
  815. Xinfluence cannot take the purely static form that block-structured
  816. Xlanguages use to associate values with identifiers, for then an operator
  817. Xcould not influence the appearance of its parameters; and a state
  818. Xvariable solution is not compatible with the overall functional design.
  819. X@PP
  820. XThe information needed from the context seems quite limited, comprising
  821. Xthe font family, face, and size to use, the style of paragraph breaking
  822. Xrequired, how much space to substitute between the words of paragraphs,
  823. Xand how much horizontal and vertical space is available to receive the
  824. Xobject.  These four items constitute the so-called `style information'
  825. Xof Lout.  As graphics rendering hardware improves, the style information
  826. Xwill probably grow to include colour and texture information.
  827. X@PP
  828. XThe way to deal with fonts at least is very clear:
  829. X@ID @Code "{ Times Slope 12p } @Font { Hello, world }"
  830. Xshould have result
  831. X@ID { { Times Slope 12p } @Font { Hello, world } }
  832. XLout also provides @Code "@Break" and @Code "@Space" symbols for
  833. Xcontrolling the paragraph breaking and space styles mentioned
  834. Xabove.  These work in the same way, returning their right
  835. Xparameters in the style of their left.  The implementation is very
  836. Xsimple:  one merely broadcasts the style information down into the parse
  837. Xtree of the right parameter.  A font, for example, is converted to an
  838. X8-bit internal name and stored in each leaf, while a breaking style is
  839. Xstored in the root node of each paragraph.
  840. X@PP
  841. XThe same language design can be used for available width and height,
  842. Xonly here the implementation is much more demanding:
  843. X@ID @Code {
  844. X"2i @Wide {"
  845. X"(1)  |0.1i  An example"
  846. X"containing a small"
  847. X"paragraph of filled text."
  848. X"}"
  849. X}
  850. Xis guaranteed to be two inches wide:
  851. X@ID {
  852. X2i @Wide {
  853. X(1)  |0.1i  An example
  854. Xcontaining a small
  855. Xparagraph of filled text.
  856. X}
  857. X}
  858. XOne must calculate that 1.9 inches minus the width of @Code "(1)" is
  859. Xavailable
  860. Xto the paragraph, and break it accordingly; Basser Lout does this in two
  861. Xstages.  In the first, upward-moving stage, widths are calculated using the
  862. Xformulae of Section {@NumberOf objects}, which assume that available
  863. Xspace is infinite.  If the upward movement reaches a @Eq { WIDE }
  864. Xnode, corresponding to a @Code "@Wide" operator, and
  865. Xthe calculated width exceeds that allowed, a second, downward-moving stage
  866. Xis initiated which attempts to reduce the width by finding and breaking
  867. Xparagraphs.  This second stage is quite routine except at @Code "|" nodes,
  868. Xwhose children are the columns of a table.  It is necessary to apportion
  869. Xthe available width (minus inter-column gaps) among the columns.  Basser
  870. XLout leaves narrow columns unbroken and breaks the remaining columns to
  871. Xequal width, using up all of the available space.
  872. X@PP
  873. XThe size of an object is not clearly determined when the upward-moving
  874. Xsize is less than the downward-moving available space, and the object
  875. Xcontains constructs that depend on available space (e.g. right
  876. Xjustification).  For example, in
  877. X@ID @Code "2i @Wide { Heading // a |1rt b }"
  878. Xit seems natural to assign a width of two inches to the subobject
  879. X@Code "a |1rt b" because of the right justification, but it would be
  880. Xequally plausible if the width of @Code Heading was assigned to the
  881. Xsubobject instead.  The author is conscious of having failed to resolve
  882. Xthis matter properly; an extra operator for controlling available space
  883. Xis probably necessary.
  884. X@PP
  885. XThe actual paragraph breaking is just a simple transformation on the
  886. Xparse tree; the real issue is how to describe the various styles:  ragged
  887. Xright, adjusted, outdented, and so on.  Their diversity suggests that
  888. Xthey should somehow be defined using more basic features; but then there
  889. Xare algorithms for high-quality paragraph breaking, which presumably
  890. Xmust be built-in.  This dilemma was not clearly grasped by the author in
  891. X1985, and he included a built-in paragraph breaker, with the @Code
  892. X"@Break" operator selecting from a fixed set of styles.  A much better
  893. Xsolution based on galleys will be given in Section {@NumberOf horizontal},
  894. Xbut, regrettably, it is not implemented.
  895. X@End @SubSection
  896. END_OF_FILE
  897.   if test 4418 -ne `wc -c <'lout/doc/tr.impl/s2.5'`; then
  898.     echo shar: \"'lout/doc/tr.impl/s2.5'\" unpacked with wrong size!
  899.   fi
  900.   # end of 'lout/doc/tr.impl/s2.5'
  901. fi
  902. if test -f 'lout/doc/tr.impl/s4.0' -a "${1}" != "-c" ; then 
  903.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s4.0'\"
  904. else
  905.   echo shar: Extracting \"'lout/doc/tr.impl/s4.0'\" \(4101 characters\)
  906.   sed "s/^X//" >'lout/doc/tr.impl/s4.0' <<'END_OF_FILE'
  907. X@Section
  908. X    @Tag { functional }
  909. X    @Title { Implementation of the functional subset }
  910. X@Begin
  911. X@PP
  912. XThe objects and definitions of Lout are very similar to those found in
  913. Xother functional languages, and they form a natural subset of the
  914. Xlanguage.  So we pause here and present an overview of the Basser Lout
  915. Xobject evaluation algorithm.
  916. X@PP
  917. XThe problem is to take an unsized object (pure parse tree), its
  918. Xenvironment (Section {@NumberOf defs.impl}), and its style
  919. X(Section {@NumberOf style}), and to produce a PostScript file for
  920. Xrendering the object on an output device.  This file is essentially a
  921. Xsequence of instructions to print a given string of characters in a
  922. Xgiven font at a given point.
  923. X@PP
  924. XBefore the algorithm begins, the parse tree must be obtained, either by
  925. Xparsing input or by copying from the symbol table.  Afterwards the data
  926. Xstructure must be disposed.  The algorithm proper consists of five
  927. Xpasses, each a recursive traversal of the structure from the root down
  928. Xto the leaves and back.
  929. X@DP
  930. X@I {1.  Evaluation of unsized objects.}  On the way down, calculate
  931. Xenvironments and replace non-recursive, non-receptive symbols by their
  932. Xbodies (Section {@NumberOf defs.impl}); broadcast fonts to the leaves,
  933. Xand paragraph breaking and spacing styles to the paragraph nodes.  On the
  934. Xway back up, delete @Eq { FONT }, @Eq { BREAK }, and @Eq { SPACE } nodes,
  935. Xand insert @Eq { SPLIT }, @Eq { COL }, and @Eq { ROW } nodes
  936. X(Section {@NumberOf objects}).
  937. X@DP
  938. X@I {2.  Width calculations and breaking.}  Calculate the width of every
  939. Xsubobject from the bottom up.  As described in Section {@NumberOf objects},
  940. X@Eq { WIDE } nodes may trigger object breaking sub-traversals during this pass.
  941. X@DP
  942. X@I {3.  Height calculations.}  Calculate the height of every subobject,
  943. Xfrom the bottom up.
  944. X@DP
  945. X@I {4.  Horizontal coordinates.}  Calculate the horizontal coordinate of
  946. Xeach subobject from the top down, and store each leaf's coordinate in
  947. Xthe leaf.
  948. X@DP
  949. X@I {5.  Vertical coordinates and PostScript generation.}  Calculate the
  950. Xvertical coordinate of every subobject from the top down, and at each
  951. Xleaf, retrieve the character string, font, and horizontal coordinate,
  952. Xand print the PostScript instruction for rendering that leaf.
  953. X@DP
  954. XFigure {@NumberOf components} gives the amount of code required for each
  955. X
  956. X@Figure
  957. X    @Tag { components }
  958. X    @Caption { Major components of the Basser Lout interpreter, showing
  959. Xthe approximate number of lines of C code.  }
  960. X@Begin
  961. X@Tab
  962. X   vmargin { 0.5vx }
  963. X   @Fmta { @Col @RR A ! @Col B ! @Col @RR C }
  964. X   @Fmtb { @Col @RR A ! @Col B ! @Col     C }
  965. X{
  966. X   @Rowa A { 1. } B { Initialization } C { 200 }
  967. X   @Rowa A { 2. } B { Memory allocation, ordered dag operations } C { 400 }
  968. X   @Rowa A { 3. } B { Lexical analysis, macros, file handling } C { 1,350 }
  969. X   @Rowa A { 4. } B { Parsing of objects and definitions } C { 1,150 }
  970. X   @Rowa A { 5. } B { Symbol table and call graph } C { 600 }
  971. X   @Rowa A { 6. } B { Evaluation of pure parse trees } C { 1,650 }
  972. X   @Rowa A { 7. } B { Reading, storing, and scaling of fonts } C { 600 }
  973. X   @Rowa A { 8. } B { Cross references and databases } C { 1,000 }
  974. X   @Rowa A { 9. } B { Width and height calculations, and breaking } C { 700 }
  975. X   @Rowa A { 10. } B { @I Constrained and @I AdjustSize } C { 700 }
  976. X   @Rowa A { 11. } B { Transfer of sized objects into galley tree } C { 450 }
  977. X   @Rowa A { 12. } B { Galley flushing algorithm } C { 1,500 }
  978. X   @Rowa A { 13. } B { Coordinate calculations and PostScript output } C { 700 }
  979. X   @Rowa A { 14. } B { Debugging and error handling } C { 1,200 }
  980. X   @Rowb vmargin { 0.1c } C { @Line }
  981. X   @Rowa C { 12,200 }
  982. X}
  983. X@End @Figure
  984. X
  985. Xpass.  Symmetry between horizontal and vertical is exploited throughout
  986. XBasser Lout, and passes 2 and 3, as well as 4 and 5, are executed on
  987. Xshared code.
  988. X@PP
  989. XThe author can see no simple way to reduce the number of passes.  The
  990. Xintroduction of horizontal galleys (Section {@NumberOf horizontal})
  991. Xwould remove the need for the object breaking transformations within this
  992. Xalgorithm that are the principal obstacles in the way of the merging of
  993. Xpasses 2 and 3.
  994. X@End @Section
  995. END_OF_FILE
  996.   if test 4101 -ne `wc -c <'lout/doc/tr.impl/s4.0'`; then
  997.     echo shar: \"'lout/doc/tr.impl/s4.0'\" unpacked with wrong size!
  998.   fi
  999.   # end of 'lout/doc/tr.impl/s4.0'
  1000. fi
  1001. if test -f 'lout/doc/tr.impl/s5.3' -a "${1}" != "-c" ; then 
  1002.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s5.3'\"
  1003. else
  1004.   echo shar: Extracting \"'lout/doc/tr.impl/s5.3'\" \(4681 characters\)
  1005.   sed "s/^X//" >'lout/doc/tr.impl/s5.3' <<'END_OF_FILE'
  1006. X@SubSection
  1007. X    @Tag { constraints }
  1008. X    @Title { Size constraints and size adjustments }
  1009. X@Begin
  1010. X@PP
  1011. XThe galley flushing algorithm needs to know the available width and
  1012. Xheight at each receptive symbol.  These symbols may lie within
  1013. Xarbitrarily complex objects, and they may compete with each other for
  1014. Xavailable space (as body text and footnote targets do), so this
  1015. Xinformation must be extracted from the tree structure when required.
  1016. X@PP
  1017. XFor example, consider the object
  1018. X@ID @Code "5i  @Wide  {  a  /  b  }"
  1019. Xand suppose that the width of @Code { a } is @Eq { 1i, 2i } (@Eq {1i} to
  1020. Xthe left of the mark, @Eq { 2i } to the right).  What then is the
  1021. Xavailable width at {@Code { b }}?  If we let the width of @Code b be
  1022. X@Eq {l,r}, we must have
  1023. X@ID @Eq { (1i up l) + (2i up r) <= 5i }
  1024. Xwith the @Eq {non up } (i.e. max) operations arising from mark
  1025. Xalignment.  Eliminating them gives
  1026. X@ID @Eq {
  1027. Xmatrix {
  1028. X    { 1i + 2i ^<= 5i }
  1029. Xmabove    { l  + 2i ^<= 5i }
  1030. Xmabove    { 1i + r  ^<= 5i }
  1031. Xmabove    { l  + r  ^<= 5i }
  1032. X}
  1033. X}
  1034. Xand since we assume that @Code a fits into the available space, the
  1035. Xfirst inequality may be dropped, leaving
  1036. X@ID @Eq {
  1037. Xmatrix {
  1038. X    { l     ^<= 3i }
  1039. Xmabove    { l + r ^<= 5i }
  1040. Xmabove    { r     ^<= 4i }
  1041. X}
  1042. X}
  1043. XObject @Code b may have width @Eq {l, r} for any @Eq { l } and
  1044. X@Eq { r } satisfying these inequalities, and no others.
  1045. X@PP
  1046. XHere is another example:
  1047. X@ID @Code "5i  @High  {  a  /2ix  b  }"
  1048. XAssuming that @Code a has height @Eq {1i,1i}, the height @Eq {l, r} of
  1049. X@Code b must satisfy
  1050. X@ID @Eq { 1i + ((1i + l) up 2i) + r <= 5i }
  1051. XThis time the @Eq { non up } operation arises from the mark-to-mark gap
  1052. Xmode, which will widen the @Eq { 2i } gap if necessary to prevent
  1053. X@Code a and @Code b from overlapping.  This inequality can be rewritten as
  1054. X@ID @Eq {
  1055. Xmatrix {
  1056. X    { l     ^<= infinity }
  1057. Xmabove    { l + r ^<= 3i       }
  1058. Xmabove    { r     ^<= 2i       }
  1059. X}
  1060. X}
  1061. XIn general, Lout is designed so that the available width or height at
  1062. Xany point can be expressed by three inequalities of the form
  1063. X@ID @Eq {
  1064. Xmatrix {
  1065. X    { l     ^<= x }
  1066. Xmabove    { l + r ^<= y }
  1067. Xmabove    { r     ^<= z }
  1068. X}
  1069. X}
  1070. Xwhere @Eq {x }, @Eq {y} and @Eq {z} may be @Eq { infinity }.  We
  1071. Xabbreviate these three inequalities to @Eq { l, r <= x, y, z }, and we
  1072. Xcall @Eq {x, y, z} a {@I{size constraint}}.
  1073. X@PP
  1074. XThe two examples above showed how to propagate the size constraint
  1075. X@Eq { infinity, 5i, infinity } for
  1076. X@Code "a / b" down one level to the child {@Code b}.  Basser Lout
  1077. Xcontains a complete set of general rules for all node types, too
  1078. Xcomplicated to give here.  Instead, we give just one example of how
  1079. Xthese rules are derived, using the object
  1080. X@ID {
  1081. X@Eq {x sub 1}  @Code "/"  @Eq {x sub 2}  @Code "/"  @Eq {ldots}  @Code
  1082. X"/"  @Eq {x sub n}
  1083. X}
  1084. Xwhere @Eq { x sub j } has width @Eq { l sub j , r sub j } for all @Eq {j}.
  1085. X@PP
  1086. XSuppose the whole object has width constraint @OneCol @Eq {X,Y,Z}, and we
  1087. Xrequire the width constraint of {@Eq { x sub i }}.  Let
  1088. X@Eq { L = max sub j ` l sub j } and @Eq { R = max sub j ` r sub j },
  1089. Xso that @OneCol @Eq {L, R} is the width of the whole object.  We assume
  1090. X@Eq {L, R <= X,Y,Z}.  Then @Eq { x sub i } can be enlarged to any size
  1091. X@Eq { l sub i ` , r sub i } satisfying
  1092. X@ID @Eq { ( l sub i up L), ( r sub i up R) <= X, Y, Z }
  1093. Xwhich expands to eight inequalities:
  1094. X@ID @Eq {
  1095. Xmatrix {
  1096. X         { l sub i           ^<= X }
  1097. Xmabove   { L                 ^<= X }
  1098. Xmabove   { l sub i + r sub i ^<= Y }
  1099. Xmabove   { l sub i + R       ^<= Y }
  1100. Xmabove   { L + r sub i       ^<= Y }
  1101. Xmabove   { L + R             ^<= Y }
  1102. Xmabove   { r sub i           ^<= Z }
  1103. Xmabove   { R                 ^<= Z }
  1104. X}
  1105. X}
  1106. XThree are already known, and slightly rearranging the others gives
  1107. X@ID @Eq {
  1108. Xmatrix {
  1109. X         { l sub i           ^<= X     }
  1110. Xmabove   { l sub i           ^<= Y - R }
  1111. Xmabove   { l sub i + r sub i ^<= Y     }
  1112. Xmabove   { r sub i           ^<= Z     }
  1113. Xmabove   { r sub i           ^<= Y - L }
  1114. X}
  1115. X}
  1116. XTherefore the width constraint of @Eq { x sub i } is
  1117. X@ID @Eq { min(X, Y-R), Y, min(Z, Y-L) }
  1118. XThe size constraint of any node can be found by climbing the tree to a
  1119. X@I WIDE or @I HIGH node where the constraint is trivial, then propagating
  1120. Xit back down to the node, and this is the function of procedure
  1121. X{@I Constrained} in Basser Lout.
  1122. X@PP
  1123. XAfter some components have been promoted into a target, the sizes stored
  1124. Xin its parent and higher ancestors must be adjusted to reflect the
  1125. Xincreased size.  This is done by yet another set of recursive rules,
  1126. Xupward-moving this time, which cease as soon as some ancestor's size
  1127. Xdoes not change.  These rules are embodied in procedure @I AdjustSize
  1128. Xof Basser Lout.  The adjustment must be done before relinquishing
  1129. Xcontrol to any other galley, but not after every component.
  1130. X@End @SubSection
  1131. END_OF_FILE
  1132.   if test 4681 -ne `wc -c <'lout/doc/tr.impl/s5.3'`; then
  1133.     echo shar: \"'lout/doc/tr.impl/s5.3'\" unpacked with wrong size!
  1134.   fi
  1135.   # end of 'lout/doc/tr.impl/s5.3'
  1136. fi
  1137. if test -f 'lout/doc/tr.impl/s5.4' -a "${1}" != "-c" ; then 
  1138.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s5.4'\"
  1139. else
  1140.   echo shar: Extracting \"'lout/doc/tr.impl/s5.4'\" \(4726 characters\)
  1141.   sed "s/^X//" >'lout/doc/tr.impl/s5.4' <<'END_OF_FILE'
  1142. X@SubSection
  1143. X    @Tag { lookahead }
  1144. X    @Title { The limited lookahead problem }
  1145. X@Begin
  1146. X@PP
  1147. XBasser Lout assumes that there will be enough internal memory to hold
  1148. Xthe symbol table plus a few pages, but not an entire document.  This
  1149. Xsection describes the consequent problems and how they were solved.
  1150. XOther interpreters, notably interactive editors running on virtual
  1151. Xmemory systems, would not necessarily need this assumption.
  1152. X@PP
  1153. XAlthough Basser Lout can read and format any legal input, its memory
  1154. Xconsumption will be optimized when the bulk of the document resides in
  1155. Xgalleys whose targets can be identified at the moment they are
  1156. Xencountered.  Let us take the typical example of a root galley which
  1157. Xis a list of pages, a @Code "@BodyText" galley targeted into the
  1158. Xpages, @Code "@Chapter" galleys targeted into {@Code "@BodyText"},
  1159. Xand @Code "@Section" galleys targeted into the @Code "@Chapter"
  1160. Xgalleys:
  1161. X@ID @Code {
  1162. X"@PageList"
  1163. X"//"
  1164. X"@BodyText"
  1165. X"//"
  1166. X"@Chapter {"
  1167. X"    @Section { ... }"
  1168. X"    @Section { ... }"
  1169. X"    ..."
  1170. X"    @Section { ... }"
  1171. X"}"
  1172. X"@Chapter {"
  1173. X"    ..."
  1174. X"}"
  1175. X}
  1176. XBasser Lout is able to read and process such galleys one paragraph at
  1177. Xa time (strictly, from one @Code "//" at the outer level of a galley
  1178. Xto the next), as we now describe.
  1179. X@PP
  1180. XWhen the parser encounters the beginning of a galley, like @Code "@Chapter"
  1181. Xor {@Code "@Section"}, it initiates a new galley process.  The special
  1182. Xreceptive symbol @Code "@Input" is substituted for the as yet
  1183. Xunread right parameter of the galley.  As each paragraph of the right
  1184. Xparameter is read, it is deleted from the parse tree and injected into
  1185. Xthe galley's {@Code "@Input"}.  The galley is then resumed.  The parser
  1186. Xthus acts as an extra
  1187. Xconcurrent process; it has low priority, so that input is read only when
  1188. Xthere is nothing else to do.  Since galleys may be nested, a stack of
  1189. X@Code "@Input" symbols is needed, each with its own environment and
  1190. Xstyle.  If a galley is encountered for which a target is not immediately
  1191. Xidentifiable (a footnote, for example), it is read in its entirety and
  1192. Xhung in pure parse tree form from an @I UNATTACHED index in the usual way,
  1193. Xwith an environment but without a style.  It will be flushed later
  1194. Xwhen its component is promoted.
  1195. X@PP
  1196. XIn addition to producing a steady flow of components from input, we must
  1197. Xalso ensure that receptive symbols do not unduly block their
  1198. Xpromotion.  The @Code "@FootSect" symbol at the foot of each page is a
  1199. Xtypical example:  until it is deleted the page cannot be printed.
  1200. X@PP
  1201. XReceptive symbols are expanded only on demand, so @Code "@FootSect" can
  1202. Xbe deleted as soon as we can prove that it is not wanted.  The symbol
  1203. Xtable can tell us that only @Code "@FootNote" galleys (with
  1204. X@Code "@FootPlace&&following" targets) want it, so it might be possible
  1205. Xto deduce that @Code "@FootSect" may be deleted as soon as body text
  1206. Xenters the following page.
  1207. X@PP
  1208. XThe author was unable to make this work, so Basser Lout requires the
  1209. Xuser to identify those galleys which will carry the bulk of the document
  1210. X({@Code "@Chapter"}, {@Code "@Section"}, {@Code "@BodyText"}) as
  1211. X{@I {forcing galleys}}, by writing @Code "force into" instead of
  1212. X@Code "into" in their definitions.  As described in the previous
  1213. Xsection, when a forcing galley attaches to a target, all receptive
  1214. Xsymbols preceding the target in its galley are deleted, removing all
  1215. Ximpediments to flushing.  For example, when a forcing body text galley
  1216. Xenters a new page, the @Code "@FootSect" symbol on the preceding page
  1217. Xwill be deleted.  It seems likely that a system which could afford to
  1218. Xwait until all input was read before deleting any receptive symbols
  1219. Xwould not need forcing galleys.
  1220. X@PP
  1221. XGalleys whose targets are a long way from their invocation points can be
  1222. Xa problem.  If the direction is {@Code "following"}, such galleys are
  1223. Xheld in internal memory for a long time, unless they are to be
  1224. Xsorted.  If the direction is
  1225. X{@Code "preceding"}, then either the entire intervening document must be
  1226. Xheld in memory (prevented by the target from flushing), or else some
  1227. Xforcing galley prematurely deletes the target, leaving the galley bereft.
  1228. X@PP
  1229. XThe typical example of the latter case occurs when the galley is an
  1230. Xentry in the table of contents, launched backwards from the beginning of
  1231. Xa chapter or section.  Its target in the table of contents will have
  1232. Xbeen deleted long before, to permit the rest of the document to print,
  1233. Xso the galley ultimately emerges as an unattached galley promoted out of
  1234. Xthe root galley.  All such galleys are written to an auxiliary file,
  1235. Xindexed by the missing target.  On the next run, just before that target
  1236. Xis deleted, the auxiliary file is checked and any galleys for it are
  1237. Xread in and flushed.
  1238. X@End @SubSection
  1239. END_OF_FILE
  1240.   if test 4726 -ne `wc -c <'lout/doc/tr.impl/s5.4'`; then
  1241.     echo shar: \"'lout/doc/tr.impl/s5.4'\" unpacked with wrong size!
  1242.   fi
  1243.   # end of 'lout/doc/tr.impl/s5.4'
  1244. fi
  1245. if test -f 'lout/doc/tr.impl/s5.5' -a "${1}" != "-c" ; then 
  1246.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s5.5'\"
  1247. else
  1248.   echo shar: Extracting \"'lout/doc/tr.impl/s5.5'\" \(4791 characters\)
  1249.   sed "s/^X//" >'lout/doc/tr.impl/s5.5' <<'END_OF_FILE'
  1250. X@SubSection
  1251. X    @Tag { horizontal }
  1252. X    @Title { Horizontal galleys }
  1253. X@Begin
  1254. X@PP
  1255. XThere is a strong analogy between breaking a column of text into
  1256. Xpage-sized pieces, and breaking a paragraph into line-sized pieces.  In
  1257. Xfact, the two differ only in direction:  vertical for body text,
  1258. Xhorizontal for paragraphs.  In this section we define {@I{horizontal
  1259. Xgalleys}}, and show how they provide an unlimited number of paragraph
  1260. Xbreaking styles, as well as solve some other problems.  Regrettably,
  1261. Xlack of time has prevented their incorporation into the Basser Lout
  1262. Xinterpreter.
  1263. X@PP
  1264. XImagine a galley whose components are separated by horizontal
  1265. Xconcatenation operators instead of vertical ones, perhaps indicated by a
  1266. X@Code { horizontally into } clause.  Then all object breaking, including
  1267. Xparagraph breaking, could be replaced by galley component promotion like
  1268. Xthis:
  1269. X@ID @Code {
  1270. X"def @Paragraph right x"
  1271. X"{"
  1272. X"    def @LinePlace { @Galley }"
  1273. X""
  1274. X"    def @LineList"
  1275. X"    {"
  1276. X"        @HExpand @LinePlace"
  1277. X"        //1vx  @LineList"
  1278. X"    }"
  1279. X""
  1280. X"    def @Par horizontally into { @LinePlace&&preceding }"
  1281. X"        right x"
  1282. X"    { x }"
  1283. X""
  1284. X"    @LineList  //  @Par { 0.2i @Wide {}  &0i  x  &1rt }"
  1285. X"}"
  1286. X}
  1287. XThe @Code "@HExpand" operator, which is a primitive of Basser Lout,
  1288. Xhorizontally expands the gaps in its right parameter until the result
  1289. Xfills the available space, thus implementing line adjustment, except
  1290. Xwhen the parameter contains tabulation gaps like {@Code "&1rt"}, which
  1291. Xcause the parameter to be already expanded.  The result of
  1292. X@ID @Code "@Paragraph { A short paragraph of text. }"
  1293. Xwould then be something like
  1294. X@ID 1.5i @Wide {
  1295. X0.2i @Wide {} & A short paragraph of text.
  1296. X}
  1297. Xdepending on the available horizontal space.  An unlimited range of
  1298. Xparagraph breaking styles could be defined, including ragged right, ragged
  1299. Xleft, break-and-center, and so on.
  1300. X@PP
  1301. XIn Basser Lout, indented paragraphs are produced by preceding them with
  1302. Xa horizontal concatenation operator, for example {@Code "|0.5i"}.  This
  1303. Xhas the unfortunate effect of making an indented paragraph into a single
  1304. Xcomponent of the enclosing galley, so that it will always be kept
  1305. Xtogether on one page.  Horizontal galleys solve this problem with a
  1306. Xsimple change to {@Code "@LineList"}:
  1307. X@ID @Code {
  1308. X"def @LineList"
  1309. X"{"
  1310. X"    |0.5i  @HExpand @LinePlace"
  1311. X"    //1vx  @LineList"
  1312. X"}"
  1313. X}
  1314. Xshowing the flexibility that comes from bringing the full power of the
  1315. XLout language to bear on paragraph layout.  It is easy to make provision
  1316. Xfor a tag on the first line.
  1317. X@PP
  1318. XAlthough Basser Lout permits receptive symbols within paragraphs, they
  1319. Xare of little use, because their available width is calculated after
  1320. Xparagraph breaking, and the incoming galley cannot spread over more than
  1321. Xone line.  With horizontal galleys, such symbols would have infinite
  1322. Xavailable width, and we could easily produce a filled paragraph of
  1323. Xfootnotes like this:
  1324. X@ID 3.5i @Wide {
  1325. X@OneRow { -2p @Font 1 ^/0.3vo } & See Jones and Saunders (1982). &2m
  1326. X@OneRow { -2p @Font 2 ^/0.3vo } & Or so Jacobsen (1973) asserts. &2m
  1327. X@OneRow { -2p @Font 3 ^/0.3vo } & {@I ibid}, p. 327.
  1328. X}
  1329. Xbased on an infinite horizontal sequence of @Code "@FootPlace" symbols
  1330. Xinside a horizontal galley.
  1331. X@PP
  1332. XWhen body text is placed on pages, the length of each column varies
  1333. Xdepending on the available vertical space.  Horizontal galleys could
  1334. Xanalogously produce lines of varying length, and so could fill
  1335. Xnon-rectangular shapes.
  1336. X@PP
  1337. XAn important theoretical benefit of horizontal galleys is that they
  1338. Xwould permit horizontal and vertical to be treated in a perfectly
  1339. Xsymmetrical way, whereas at present paragraph breaking is horizontal
  1340. Xonly, and galley breaking is vertical only.  This must simplify the
  1341. Xtreatment of non-European languages which fill in unusual directions,
  1342. Xalthough it is not itself sufficient to implement them.
  1343. X@PP
  1344. XThere are a few minor problems with horizontal galleys.  First, the
  1345. Xsyntactic overhead of enclosing each paragraph in @Code "@Paragraph { ... }"
  1346. Xor whatever is unacceptable.  Permitting user-defined operators to have lower
  1347. Xprecedence than the white space between two words might help here.  Second,
  1348. Xthe built-in paragraph breaker includes hyphenation, and it permits line
  1349. Xbreaks in the input to determine line breaks in the output, if
  1350. Xdesired.  These features must somehow be preserved.  Finally, we have
  1351. Xexplained how the Basser Lout interpreter assigns equal width to the
  1352. Xwider columns of tables (Section {@NumberOf style}).  The equivalent
  1353. Xsituation in vertical galleys occurs when two receptive symbols compete
  1354. Xfor vertical space (e.g. @Code "@TextPlace" and {@Code "@FootSect"}),
  1355. Xand there it is conventional to grant as much as required to the first
  1356. Xarrival.  It is not clear to the author how these different approaches
  1357. Xcan be reconciled.
  1358. X@End @SubSection
  1359. END_OF_FILE
  1360.   if test 4791 -ne `wc -c <'lout/doc/tr.impl/s5.5'`; then
  1361.     echo shar: \"'lout/doc/tr.impl/s5.5'\" unpacked with wrong size!
  1362.   fi
  1363.   # end of 'lout/doc/tr.impl/s5.5'
  1364. fi
  1365. if test -f 'lout/doc/tr.impl/s6.2' -a "${1}" != "-c" ; then 
  1366.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s6.2'\"
  1367. else
  1368.   echo shar: Extracting \"'lout/doc/tr.impl/s6.2'\" \(4579 characters\)
  1369.   sed "s/^X//" >'lout/doc/tr.impl/s6.2' <<'END_OF_FILE'
  1370. X@SubSection
  1371. X    @Tag { cross.impl }
  1372. X    @Title { Implementation of cross references }
  1373. X@Begin
  1374. X@PP
  1375. XBefore an object can be sized and printed, the values of any cross
  1376. Xreferences within it must be known.  If they refer to invocations that
  1377. Xhave not yet been read, there is a problem.  Scribe [7]
  1378. Xsolves it by capitalizing on the fact that documents are formatted
  1379. Xrepeatedly during the drafting process.  All tagged invocations are
  1380. Xcopied to an auxiliary file during the first run, and indexed for quick
  1381. Xretrieval on the second.  A new auxiliary file is written during the second
  1382. Xrun, for retrieval on the third, and so on.  Cross references always lag
  1383. Xone run behind the rest of the document; a perfect copy may be produced
  1384. Xby formatting the same version twice, except in a few pathological cases
  1385. Xthat fail to converge.
  1386. X@PP
  1387. XCross referencing in Lout is implemented on top of a simple database
  1388. Xsystem.  Each database is either writable or readable but not both at
  1389. Xonce, and holds a set of key-value entries:  the keys are @S ASCII
  1390. Xstrings, and the values are Lout objects, possibly with environments,
  1391. Xwritten in Lout source.  Operations are provided for writing an entry,
  1392. Xconverting from writable to readable, retrieval by key, and sequential
  1393. Xretrieval in key order.
  1394. X@PP
  1395. XThe implementation, which is quite unsophisticated, employs one or more
  1396. X@S ASCII {@I{ database files}}, containing the values, and one @S ASCII
  1397. X{@I{ index file}} per database, containing the keys.  To write an entry,
  1398. Xthe value is first appended to a database file, then a line like
  1399. X@ID @Code "@Chapter&&intro  ch1.ld  57"
  1400. Xis appended to the index file, giving the file and offset where the value
  1401. Xis stored.  To convert from writable to readable, the index file is
  1402. Xsorted.  Then retrieval by key requires a binary search of the index
  1403. Xfile and one seek into a database file, and sequential retrieval by key
  1404. Xis trivial.
  1405. X@PP
  1406. XThis database system is used in several ways.  For an external database,
  1407. Xsay of bibliographic references, the user creates the database file of
  1408. Xvalues (without environments), Lout creates the index file whenever it
  1409. Xcannot find one, and retrievals by key proceed as usual.  Cross
  1410. Xreferences with tags other than @Code preceding and @Code following are
  1411. Xtreated as described above, by writing all tagged invocations (with
  1412. Xenvironments) to a single database, which is converted to readable at
  1413. Xthe end of the run for retrievals on the next run.  Sorted galleys, such
  1414. Xas index entries, are written out indexed by target and key and retrieved
  1415. Xsequentially on the next run.  Unsorted galleys with preceding targets
  1416. Xwhich pop off the top of the root galley without finding a target, such
  1417. Xas entries in tables of contents, are treated similarly, except that they
  1418. Xare indexed by target and a sequence number that preserves their relative
  1419. Xorder during the sort.
  1420. X@PP
  1421. XWhen Lout processes a multi-file document, one cross reference database
  1422. Xfile is written for each input file, but they share a common index
  1423. Xfile.  At end of run, the new index file is sorted and merged with the
  1424. Xold one in such a way as to preserve entries relating to files not read
  1425. Xon the current run.  This provides some support for piecemeal
  1426. Xformatting, but eventually the files must all be formatted together.
  1427. X@PP
  1428. XWhen a @Code preceding or @Code following cross reference is found,
  1429. Xit is attached to a galley index of type @Eq { CROSS_PREC } or
  1430. X{@Eq { CROSS_FOLL }}, together with an automatically generated tag composed
  1431. Xof the current file name and a sequence number.  When a tagged
  1432. Xinvocation is found, it is attached to a @Eq { CROSS_TARG } index.  These
  1433. Xgalley indexes are carried along through the dynamic tree, and
  1434. Xeventually pop off the top of the root galley, at which point it is easy
  1435. Xto determine which cross references refer to which invocations, since
  1436. Xthe indexes are now in final printed document order.  Each referenced
  1437. Xinvocation is then written to the cross reference database, multiply indexed 
  1438. Xby the generated tags of the associated cross references.  On the next
  1439. Xrun, when the same @Code preceding and @Code following cross references
  1440. Xare found, chances are good that the same tags will be generated, and
  1441. Xthe appropriate values can be retrieved from the database immediately.
  1442. X@PP
  1443. XThis approach was the genesis of the @Code "@Tagged" operator, whose
  1444. Ximplementation is now immediate: for each @Code "@Tagged" operator we
  1445. Xproduce one @Eq { CROSS_PREC } or @Eq { CROSS_FOLL } galley index,
  1446. Xreplacing the generated tag with the right parameter of the @Code "@Tagged"
  1447. Xoperator.  Nothing more is required.
  1448. X@End @SubSection
  1449. END_OF_FILE
  1450.   if test 4579 -ne `wc -c <'lout/doc/tr.impl/s6.2'`; then
  1451.     echo shar: \"'lout/doc/tr.impl/s6.2'\" unpacked with wrong size!
  1452.   fi
  1453.   # end of 'lout/doc/tr.impl/s6.2'
  1454. fi
  1455. if test -f 'lout/doc/tr.over/s4' -a "${1}" != "-c" ; then 
  1456.   echo shar: Will not clobber existing file \"'lout/doc/tr.over/s4'\"
  1457. else
  1458.   echo shar: Extracting \"'lout/doc/tr.over/s4'\" \(5064 characters\)
  1459.   sed "s/^X//" >'lout/doc/tr.over/s4' <<'END_OF_FILE'
  1460. X@Section
  1461. X   @Title { Definitions }
  1462. X@Begin
  1463. X@PP
  1464. XLout permits the user to define operators which take objects as
  1465. Xparameters and return objects as results.  This feature, unremarkable
  1466. Xin itself, has some surprising applications, most notably to a problem
  1467. Xwhich is the litmus test of flexibility in document formatting:  the
  1468. Xspecification of page layout.
  1469. X@PP
  1470. XThe use of operators in document formatting seems to have been pioneered
  1471. Xby the eqn equation formatting language of Kernighan and Cherry
  1472. X[{@Ref kernighan75}].  In eqn, the mathematical formula
  1473. X@ID @Eq { { x sup 2 + 1 } over 4 }
  1474. Xfor example is expressed as
  1475. X@ID @Code "{ x sup 2 + 1 } over 4"
  1476. XThis identical expression is also used in Lout, but in Lout the operators
  1477. X({@Code "sup"}, {@Code over} and so on) have visible definitions which
  1478. Xare easy to modify and extend.
  1479. X@PP
  1480. XFor example, here is the definition of the @Code over operator as it
  1481. Xappears in the Eq equation formatting package [{@Ref kingston92eq}]:
  1482. X@ID @Code {
  1483. X"def over"
  1484. X"    precedence 54"
  1485. X"    associativity left"
  1486. X"    left x"
  1487. X"    right y"
  1488. X"{"
  1489. X"    @OneRow @OneCol"
  1490. X"    {"
  1491. X"        |0.5rt  x"
  1492. X"        ^//0.2f  @HLine"
  1493. X"        //0.2f  |0.5rt  y"
  1494. X"    }"
  1495. X"}"
  1496. X}
  1497. XInvokations of @Code over return the object between the braces, with the
  1498. Xformal parameters @Code x and @Code y replaced by actual parameters
  1499. Xwhich are objects found to the left and right of the @Code over symbol.
  1500. X@PP
  1501. XThe body of @Code over makes a good demonstration of the way in which
  1502. XLout's operators combine together.  All are Lout primitives except
  1503. X{@Code "@HLine"}, which calls upon Lout's graphics primitives to draw a
  1504. Xhorizontal line.  The @Code "//" and @Code "^//" operators are variants
  1505. Xof vertical concatenation which omit mark alignment; the separation
  1506. Xis 0.2 times the current font size.  The two @Code "|0.5rt" operators
  1507. Xcenter each parameter in the column.  Finally, the @Code "@OneRow" and
  1508. X@Code "^//" operators work together to ensure that only one horizontal
  1509. Xmark protrudes, rather than three; the result has the structure
  1510. X@ID @ShowMarks @Eq { { x sup 2 + 1 } over 4 }
  1511. Xand so will be aligned correctly with adjacent parts of the equation.
  1512. X@PP
  1513. XAs is usual in functional languages, sequences are obtained by recursive
  1514. Xdefinitions.  For example, the `leaders' often seen in tables of
  1515. Xcontents can be generated by the definition
  1516. X@ID @Code {
  1517. X"def @Leaders"
  1518. X"{"
  1519. X"    ..   @Leaders"
  1520. X"}"
  1521. X}
  1522. XWhite space after @Code "{" and before @Code "}" is not
  1523. Xsignificant.  The recursion stops when space runs out, so
  1524. X@ID @Code {
  1525. X"1.5i @Wide {"
  1526. X"Chapter 1  @Leaders  5"
  1527. X"}"
  1528. X}
  1529. Xhas result
  1530. X@ID {
  1531. X1.5i @Wide {
  1532. XChapter 1  @Leaders  5
  1533. X}
  1534. X}
  1535. XThe final invokation of @Code "@Leaders" is deleted along with any
  1536. Xpreceding concatenation operator (or white space in this case).
  1537. X@PP
  1538. XThe specification of page layout is a major problem for many document
  1539. Xformatters, because the model of a document as a sequence of pages is
  1540. Xbuilt-in, and an armada of tedious commands is required to communicate
  1541. Xwith this model:  commands for setting page width and height, margins,
  1542. Xcolumns, page header and footer lines, and so on.  Even with all these
  1543. Xcommands, the formatter will be unable to do such a simple thing as draw
  1544. Xa box around each page, if there is no command for it.
  1545. X@PP
  1546. XLout has no built-in model and no such commands.  Instead, a page is an
  1547. Xobject like any other:
  1548. X@ID @Code {
  1549. X"def @Page"
  1550. X"    right x"
  1551. X"{"
  1552. X"    8i @Wide 11i @High"
  1553. X"    {"
  1554. X"        //1i ||1i x ||1i"
  1555. X"        //1i"
  1556. X"    }"
  1557. X"}"
  1558. X}
  1559. XThe result of @Code "@Page" is an eight by eleven inch object containing
  1560. Xthe right parameter within one inch margins.  A document is a vertical
  1561. Xconcatenation of numbered pages:
  1562. X@ID @Code {
  1563. X"def @PageList"
  1564. X"    right @PageNum"
  1565. X"{"
  1566. X"    @Page"
  1567. X"    {"
  1568. X"        |0.5rt  - @PageNum -"
  1569. X"        //0.2i  @TextPlace"
  1570. X"        //1rt   @FootSect"
  1571. X"    }"
  1572. X"    //0i"
  1573. X"    @PageList"
  1574. X"        @Next @PageNum"
  1575. X"}"
  1576. X}
  1577. XThe @Code "@Next" operator is a Lout primitive that returns its right
  1578. Xparameter plus one; all automatic numbering is effected by combining
  1579. Xthis operator with recursion.  The result of @Code "@PageList 1" is
  1580. Xthe object
  1581. X@ID {
  1582. X@LittlePage {
  1583. X|0.5rt - 1 -
  1584. X//1.2vx @Code "@TextPlace"
  1585. X//1rt @Code "@FootSect"
  1586. X}
  1587. X//
  1588. X@LittlePage {
  1589. X|0.5rt - 2 -
  1590. X//1.2vx @Code "@TextPlace"
  1591. X//1rt @Code "@FootSect"
  1592. X}
  1593. X//0.2c
  1594. X8p @Font @Code "@PageList 3"
  1595. X}
  1596. Xwhich has the potential to expand to infinitely many pages.
  1597. X@PP
  1598. XWe conclude this example by defining @Code "@FootSect" to be a small
  1599. Xhoriz&-ontal line above a list of @Code "@FootPlace" symbols:
  1600. X@IL
  1601. X@LI @Code {
  1602. X"def @FootList"
  1603. X"{"
  1604. X"    @FootPlace"
  1605. X"    //0.1i @FootList"
  1606. X"}"
  1607. X}
  1608. X@LI @Code {
  1609. X"def @FootSect"
  1610. X"{"
  1611. X"    1i @Wide @HLine"
  1612. X"    //0.1i @FootList"
  1613. X"}"
  1614. X}
  1615. X@EL
  1616. XThis method of specifying page layout is infinitely more flexible than
  1617. Xthe other, since the full resources of the language may be brought to
  1618. Xbear.  Of course, the {@Code "@PageList"}, {@Code "@FootSect"}, and
  1619. X{@Code "@FootList"} symbols must be expanded only on demand, and we have
  1620. Xyet to see how the {@Code "@TextPlace"} and {@Code "@FootPlace"} symbols
  1621. Xcan be replaced by actual text and footnotes.
  1622. X@End @Section
  1623. END_OF_FILE
  1624.   if test 5064 -ne `wc -c <'lout/doc/tr.over/s4'`; then
  1625.     echo shar: \"'lout/doc/tr.over/s4'\" unpacked with wrong size!
  1626.   fi
  1627.   # end of 'lout/doc/tr.over/s4'
  1628. fi
  1629. if test -f 'lout/doc/tr.over/s5' -a "${1}" != "-c" ; then 
  1630.   echo shar: Will not clobber existing file \"'lout/doc/tr.over/s5'\"
  1631. else
  1632.   echo shar: Extracting \"'lout/doc/tr.over/s5'\" \(4210 characters\)
  1633.   sed "s/^X//" >'lout/doc/tr.over/s5' <<'END_OF_FILE'
  1634. X@Section
  1635. X   @Title { Galleys }
  1636. X@Begin
  1637. X@PP
  1638. XThe fundamental problem with inserting text, footnotes, and floating
  1639. Xfigures into pages is that the process seems impossible to describe in
  1640. Xfunctional terms.  A footnote is entered within a paragraph of text, but
  1641. Xit appears somewhere else:  at the foot of a page.  Some new abstraction
  1642. Xis needed to explain this.
  1643. X@PP
  1644. XThe landscape of features that previous document formatting systems have
  1645. Xintro&-duced at this point can best be described metaphorically, as an
  1646. Xantediluvian swamp populated by dinosaurs and demons, whose air is
  1647. Xfilled with the piteous cries of docu&-ment format designers in torment.
  1648. X@PP
  1649. XLout's solution to this problem is a feature called the @I galley, after
  1650. Xthe metal trays used in manual typesetting.  A galley consists of an
  1651. Xobject plus an indication that the object is to appear somewhere other
  1652. Xthan its invokation point.  For example,
  1653. X@ID {
  1654. X@LittlePageList 1
  1655. X// @LittleEndRunPlace
  1656. X//
  1657. X@LittleText {
  1658. X@Heading { Galleys }
  1659. X@PP
  1660. XThe fundamental problem with inserting text, footnotes, and floating
  1661. Xfigures into pages is that the process seems impossible to describe in
  1662. Xfunctional terms.  A footnote is entered within a para&-graph of text, but
  1663. Xit appears somewhere else:  at the foot of a page.  Some new abstraction
  1664. Xis needed to explain this.
  1665. X}
  1666. X//
  1667. X@LittleEndRun
  1668. X}
  1669. Xis the result of the expression
  1670. X@ID @Code {
  1671. X"@PageList 1"
  1672. X"//"
  1673. X"@Text {"
  1674. X"@Heading { Galleys }"
  1675. X"@PP"
  1676. X"The fundamental ..."
  1677. X"... to explain this."
  1678. X"}"
  1679. X}
  1680. XThe only new definitions required are these:
  1681. X@ID @Code {
  1682. X"def @TextPlace { @Galley }"
  1683. X""
  1684. X"def @Text"
  1685. X"    into { @TextPlace&&preceding }"
  1686. X"    right x"
  1687. X"{ x }"
  1688. X}
  1689. XThey say that @Code "@TextPlace" (which the reader will recall as lying
  1690. Xwithin the pages of {@Code "@PageList"}) is a placeholder for an
  1691. Xincoming galley, and that @Code "@Text" is a galley whose result is to
  1692. Xappear, not where @Code "@Text" is invoked, but rather at some
  1693. X@Code "@TextPlace" preceding that point of invokation in the final
  1694. Xprinted document.
  1695. X@PP
  1696. XAlthough the abstraction can be understood in a static way, it is
  1697. Xhelpful to trace what happens when the Basser Lout batch formatter reads
  1698. Xthe expression above.
  1699. X@PP
  1700. XSince @Code "@PageList 1" indirectly con&-tains the special @Code "@Galley"
  1701. Xsymbol, it will be expanded only upon demand.  The discovery of the
  1702. X@Code "@Text" galley initiates a search for a {@Code "@TextPlace"},
  1703. Xwhich is found within {@Code "@PageList 1"} and so forces one such
  1704. Xexpansion.  The available width at this @Code "@TextPlace" is six
  1705. Xinches, so the @Code "@Text" galley is broken into six-inch components
  1706. Xwhich are promoted one by one until the available height (nine inches)
  1707. Xis exhausted.  Since the @Code "@Text" galley is not entirely consumed,
  1708. Xa forward search of the docu&-ment is made, another @Code "@TextPlace" is
  1709. Xfound within the as yet unexpanded {@Code "@PageList 2"}, and the
  1710. Xprocess is repeated.
  1711. X@PP
  1712. XThe treatment of footnotes is the same, except that
  1713. X@ID @Code {
  1714. X"def @FootNote"
  1715. X"    into { @FootPlace&&following }"
  1716. X}
  1717. Xis used to make the footnote appear later in the finished document than its
  1718. Xinvokation point.  Basser Lout suspends the promotion of text into pages
  1719. Xjust after the component containing the footnote's invokation point is
  1720. Xpromoted, switches to the placement of the footnote galley, then resumes
  1721. Xthe body text.
  1722. X@PP
  1723. XA collection of galleys all targeted to the same place may optionally
  1724. Xappear sorted on a designated key, thus implementing sorted reference
  1725. Xlists and indexes.  The author was obliged to make the sorting option a
  1726. Xprimitive feature, since it otherwise seems to require boolean operators
  1727. Xwhich he preferred to exclude.
  1728. X@PP
  1729. XThe @Code "@PageList" object which receives the @Code "@Text" galley
  1730. Xcan itself be viewed as a galley whose components are pages, and this
  1731. Xleads to a dynamic view of Lout document assembly as a tree of galleys, each
  1732. Xpromoting into its parent, with the root galley promoting into the
  1733. Xoutput file.  For example, the BookLayout package [{@Ref kingston92begin}]
  1734. Xhas @Code "@Section" galleys promoting into @Code "@Chapter" galleys
  1735. Xpromoting into a single @Code "@PageList" galley, which promotes into
  1736. Xthe output; no limit is imposed on the height of the tree.
  1737. X@End @Section
  1738. END_OF_FILE
  1739.   if test 4210 -ne `wc -c <'lout/doc/tr.over/s5'`; then
  1740.     echo shar: \"'lout/doc/tr.over/s5'\" unpacked with wrong size!
  1741.   fi
  1742.   # end of 'lout/doc/tr.over/s5'
  1743. fi
  1744. if test -f 'lout/doc/tr.tab/s6' -a "${1}" != "-c" ; then 
  1745.   echo shar: Will not clobber existing file \"'lout/doc/tr.tab/s6'\"
  1746. else
  1747.   echo shar: Extracting \"'lout/doc/tr.tab/s6'\" \(4698 characters\)
  1748.   sed "s/^X//" >'lout/doc/tr.tab/s6' <<'END_OF_FILE'
  1749. X@Section
  1750. X   @Title { Rules, boxes, multi-page tables, etc. }
  1751. X@Begin
  1752. X@PP
  1753. XTab draws four kinds of rules.  @I {Above rules} go across the table
  1754. Xabove a specified row; @I {below rules} go across the table below a
  1755. Xrow.  @I {Between rules} go down the table between any two columns, but
  1756. Xnot before the first or after the last; and @I { side rules } go down
  1757. Xthe two sides:
  1758. X@ID @Code {
  1759. X"@Tab"
  1760. X"    above { no }"
  1761. X"    below { yes }"
  1762. X"    between { single }"
  1763. X"    side { double }"
  1764. X"    @Fmta { ... }"
  1765. X"..."
  1766. X}
  1767. XEach option may have the value @Code no (no rules), @Code yes or
  1768. X@Code single (draw single rules), or @Code double (draw double
  1769. Xrules).  Omitting an option is equivalent to giving it the value
  1770. X{@Code no}.  A rule below one row exactly overstrikes a rule above the
  1771. Xnext, unless a page break intervenes.
  1772. X@PP
  1773. XThese options to @Code "@Tab" will draw all possible rules of the given
  1774. Xtype.  If only some are wanted, there are {@Code above} and
  1775. X{@Code below} options (but no {@Code side} option) for each row symbol:
  1776. X@ID @Code {
  1777. X"@Rowf"
  1778. X"    above { yes }"
  1779. X"    below { double }"
  1780. X"    A { ... }"
  1781. X"    ..."
  1782. X}
  1783. Xand there is a @Code between option for the @Code "!" symbol that
  1784. Xseparates columns in the format options:
  1785. X@ID @Code "@Col A  ! between { double }  @Col B"
  1786. XThe symbols @Code "!!" and @Code "!!!" are abbreviations for
  1787. X@Code "! between { single }" and {@Code "! between { double }"}.  All
  1788. Xthese options override the corresponding @Code "@Tab" options when they
  1789. Xare present; when they are absent, the @Code "@Tab" options hold sway.
  1790. X@PP
  1791. XIt is not hard to assemble a single box around a table, using side
  1792. Xrules, a rule above the first row, and a rule below the last:
  1793. X@ID @Code {
  1794. X"@Tab"
  1795. X"    side { single }"
  1796. X"{"
  1797. X"    @Rowa above { single } ..."
  1798. X"    ..."
  1799. X"    @Rowj below { single } ..."
  1800. X"}"
  1801. X}
  1802. XDouble boxes around a table should be assembled using the following recipe:
  1803. X@ID @Code {
  1804. X"@Tab"
  1805. X"    side { double }"
  1806. X"{"
  1807. X"    @Rowa above { doubleboxabove } ..."
  1808. X"    ..."
  1809. X"    @Rowj below { doubleboxbelow } ..."
  1810. X"}"
  1811. X}
  1812. XThis is a little tedious, but the result is good.
  1813. X@PP
  1814. XThe symbols @Code "@Line" and @Code "@DoubleLine" produce horizontal
  1815. Xsingle and double lines of the width of the column.  Two other symbols,
  1816. X@Code "@Rule" and {@Code "@DoubleRule"}, produce lines which extend into
  1817. Xthe adjacent margins as well.  For example,
  1818. X@CD {
  1819. X@Tab
  1820. X    @Fmta { @Col A }
  1821. X{
  1822. X    @Rowa A { 5^.46 }
  1823. X    @Rowa A { 128^.2 }
  1824. X    @Rowa A { 3^.4159 }
  1825. X    @Rowa A { 5772^ }
  1826. X    @Rowa A { @Line } vmargin { 0i }
  1827. X    @Rowa A { 5909^.0759 }
  1828. X}
  1829. X}
  1830. Xis produced by
  1831. X@ID @Code {
  1832. X"@Tab"
  1833. X"    @Fmta { @Col A }"
  1834. X"{"
  1835. X"    @Rowa A { 5^.46 }"
  1836. X"    @Rowa A { 128^.2 }"
  1837. X"    @Rowa A { 3^.4159 }"
  1838. X"    @Rowa A { 5772^ }"
  1839. X"    @Rowa A { @Line } vmargin { 0i }"
  1840. X"    @Rowa A { 5909^.0759 }"
  1841. X"}"
  1842. X}
  1843. XOwing to problems behind the scenes, @Code "@Rule" and @Code "@DoubleRule"
  1844. Xfail in aligned columns.
  1845. X@PP
  1846. XThe @Code "@Tab" symbol has a @Code "linewidth" option which determines
  1847. Xthe thickness of all the lines:
  1848. X@ID @Code {
  1849. X"@Tab"
  1850. X"    linewidth { 0.5 pt }"
  1851. X}
  1852. Xshows the default value, 0.5 points.  This cannot be overridden within
  1853. Xthe table.  Double rules are drawn with their centres three line widths
  1854. Xapart.  Tab thinks that rules and double rules occupy no space, so thick
  1855. Xrules may require larger margins.
  1856. X@PP
  1857. XThe tables produced by Tab permit page breaks between any two rows.  The
  1858. Xchoice of page breaks can either be left to Lout, or it can be forced by
  1859. Xplacing the new page symbol @Code "@NP" between two rows.  To
  1860. Xensure that each part of a multi-page table is boxed, the rows preceding
  1861. Xthe page breaks must have @Code below rules, and the rows following them
  1862. Xmust have @Code above rules.  The @Code "@IndentedDisplay" and
  1863. X@Code "@CentredDisplay" symbols of the DocumentLayout package prevent
  1864. Xpage breaks in the thing displayed, so they cannot be used to display
  1865. Xmulti-page tables; a multi-page table should be displayed at the left
  1866. Xmargin by preceding and following it with {@Code "@DP"}.  To prevent
  1867. Xpage breaks within a small table, either use one of the
  1868. Xdisplay symbols just mentioned or else use @Code "@OneRow @Tab ...".
  1869. X@PP
  1870. XThe @Code "@HAdjust" symbol from standard Lout can be used to widen a
  1871. Xtable's columns until it occupies the full column width.  The
  1872. Xrecommended arrangement is
  1873. X@ID @Code {
  1874. X"@DP"
  1875. X"@HAdjust @Tab"
  1876. X"   ..."
  1877. X"@DP"
  1878. X}
  1879. Xsince @Code "@HAdjust" is not effective within displays.
  1880. X@PP
  1881. XExpert users might occasionally find a use for the @Code "@MarkRow"
  1882. Xsymbols.  There is one of them for each @Code "@Row" symbol
  1883. X({@Code "@MarkRowa"} for {@Code "@Rowa"}, etc.).  A @Code "@MarkRow"
  1884. Xsymbol causes the principal mark of the table to pass through that row,
  1885. Xpermitting its alignment with horizontally adjacent objects.
  1886. X@End @Section
  1887. END_OF_FILE
  1888.   if test 4698 -ne `wc -c <'lout/doc/tr.tab/s6'`; then
  1889.     echo shar: \"'lout/doc/tr.tab/s6'\" unpacked with wrong size!
  1890.   fi
  1891.   # end of 'lout/doc/tr.tab/s6'
  1892. fi
  1893. if test -f 'lout/include/book' -a "${1}" != "-c" ; then 
  1894.   echo shar: Will not clobber existing file \"'lout/include/book'\"
  1895. else
  1896.   echo shar: Extracting \"'lout/include/book'\" \(4131 characters\)
  1897.   sed "s/^X//" >'lout/include/book' <<'END_OF_FILE'
  1898. X
  1899. X###############################################################################
  1900. X#                                                                             #
  1901. X#  Setup file for invoking @DocumentLayout for books                          #
  1902. X#                                                                             #
  1903. X#  Jeffrey H. Kingston                                                        #
  1904. X#  22 December 1992                                                           #
  1905. X#                                                                             #
  1906. X###############################################################################
  1907. X
  1908. X@SysInclude { ft  }
  1909. X@SysInclude { dl  }
  1910. X# @SysInclude { eq  }
  1911. X# @SysInclude { tab }
  1912. X# @SysInclude { pas }
  1913. X# @SysInclude { fig }
  1914. X
  1915. X@Use { @DocumentLayout
  1916. X  # @InitialFont       {  Times Base 12p } # initial font
  1917. X  # @InitialBreak      {  adjust 1.20fx  } # initial break
  1918. X  # @Hyphenate         {  Yes            } # Want hyphenation? Yes or No
  1919. X  # @MajorHeadingFont  {  Bold 2.0f      } # font for major headings
  1920. X  # @HeadingFont       {  Bold           } # font for ordinary headings
  1921. X  # @MinorHeadingFont  {  Bold           } # font for minor headings
  1922. X  # @BookCoverFont     {  Helvetica Base } # font for book cover
  1923. X
  1924. X  # @ParaGap           {  1.30vx         } # gap between paragraphs
  1925. X  # @ParaIndent        {  2.00f          } # paragraph first-line indent
  1926. X
  1927. X  # @DispGap           {  1.00v          } # gap above and below displays
  1928. X  # @DispIndent        {  2.00f          } # @IndentedDisplay indent
  1929. X  # @DefaultIndent     {  0.5rt          } # @Display indent
  1930. X  # @WideIndent        {  4.00f          } # @WideTaggedList indent
  1931. X  # @VeryWideIndent    {  8.00f          } # @VeryWideTaggedList indent
  1932. X
  1933. X  # @PageWidth         { 21.00c          } # width of page
  1934. X  # @PageHeight        { 29.70c          } # height of page
  1935. X  # @PageMargin        {  2.50c          } # size of all four margins
  1936. X  # @Columns           {  Single         } # Single, Double, Multi
  1937. X  # @DoubleColWidth    {  7.50c          } # column width used by Double
  1938. X  # @MultiColWidth     {  4.67c          } # column width used by Multi
  1939. X  # @ColGap            {  1.00c          } # gap between columns
  1940. X  # @TopGap            {  0.75c          } # gap between figures
  1941. X  # @MidGap            {  0.75c          } # gap above and below body text
  1942. X
  1943. X  # @FootNoteFont      {  0.80f          } # font for footnotes
  1944. X  # @FootNoteBreak     {  1.20fx         } # break for footnotes
  1945. X  # @FootLen           {  2.00c          } # footnote line and indent size
  1946. X  # @ColFootLen        {  1.20c          } # @FootLen when Double, Multi
  1947. X  # @FootGap           {  0.20c          } # gap between footnotes
  1948. X
  1949. X    @MakeIndex         {  Yes            } # Want index? Yes or No
  1950. X  # @IndexColumns      {  Double         } # Single, Double, Multi
  1951. X
  1952. X    @TableOfContents   {  Yes            } # Want contents? Yes or No
  1953. X  # @MajorContentsGap  {  1.30v          } # gap above major entry
  1954. X  # @ContentsGap       {  1.00v          } # gap above ordinary entry
  1955. X
  1956. X  # @ChapterNumbers    {  Yes            } # Yes or No            
  1957. X  # @SectionNumbers    {  Yes            } # Yes or No            
  1958. X  # @SubSectionNumbers {  Yes            } # Yes or No            
  1959. X  # @AppendixNumbers   {  Yes            } # Yes or No            
  1960. X  # @SubAppendixNumbers{  Yes            } # Yes or No            
  1961. X  # @ChapterGap        {  1.10b          } # gap before each chapter
  1962. X  # @SectionGap        {  2.00v          } # gap before each section
  1963. X  # @SubSectionGap     {  1.50v          } # gap before each subsection
  1964. X    @AppendixGap       {  1.10b          } # gap before each appendix
  1965. X  # @SubAppendixGap    {  2.00v          } # gap before each subappendix
  1966. X
  1967. X  # @PageNumbers       {  Yes            } # Want page numbers? Yes or No
  1968. X  # @FirstPageNumber   {  1              } # Number of first page 
  1969. X  # @PageOneTopFormat  { @Null               }
  1970. X  # @PageOneFootFormat { @Null               }
  1971. X  # @PageTopFormat     { |0.5rt - @PageNum - }
  1972. X  # @PageFootFormat    { @Null               }
  1973. X    @BookTitleFormat   { {Bold 2.0f} @Font {//2.0f @Title //0.5f} } 
  1974. X}
  1975. END_OF_FILE
  1976.   if test 4131 -ne `wc -c <'lout/include/book'`; then
  1977.     echo shar: \"'lout/include/book'\" unpacked with wrong size!
  1978.   fi
  1979.   # end of 'lout/include/book'
  1980. fi
  1981. if test -f 'lout/include/report' -a "${1}" != "-c" ; then 
  1982.   echo shar: Will not clobber existing file \"'lout/include/report'\"
  1983. else
  1984.   echo shar: Extracting \"'lout/include/report'\" \(4110 characters\)
  1985.   sed "s/^X//" >'lout/include/report' <<'END_OF_FILE'
  1986. X
  1987. X###############################################################################
  1988. X#                                                                             #
  1989. X#  Setup file for invoking @DocumentLayout for technical reports              #
  1990. X#                                                                             #
  1991. X#  Jeffrey H. Kingston                                                        #
  1992. X#  22 December 1992                                                           #
  1993. X#                                                                             #
  1994. X###############################################################################
  1995. X
  1996. X@SysInclude { ft  }
  1997. X@SysInclude { dl  }
  1998. X# @SysInclude { eq  }
  1999. X# @SysInclude { tab }
  2000. X# @SysInclude { pas }
  2001. X# @SysInclude { fig }
  2002. X
  2003. X@Use { @DocumentLayout
  2004. X  # @InitialFont       {  Times Base 12p } # initial font
  2005. X  # @InitialBreak      {  adjust 1.20fx  } # initial break
  2006. X  # @Hyphenate         {  Yes            } # Want hyphenation? Yes or No
  2007. X  # @MajorHeadingFont  {  Bold 2.0f      } # font for major headings
  2008. X  # @HeadingFont       {  Bold           } # font for ordinary headings
  2009. X  # @MinorHeadingFont  {  Bold           } # font for minor headings
  2010. X  # @BookCoverFont     {  Helvetica Base } # font for book cover
  2011. X
  2012. X  # @ParaGap           {  1.30vx         } # gap between paragraphs
  2013. X  # @ParaIndent        {  2.00f          } # paragraph first-line indent
  2014. X
  2015. X  # @DispGap           {  1.00v          } # gap above and below displays
  2016. X  # @DispIndent        {  2.00f          } # @IndentedDisplay indent
  2017. X  # @DefaultIndent     {  0.5rt          } # @Display indent
  2018. X  # @WideIndent        {  4.00f          } # @WideTaggedList indent
  2019. X  # @VeryWideIndent    {  8.00f          } # @VeryWideTaggedList indent
  2020. X
  2021. X  # @PageWidth         { 21.00c          } # width of page
  2022. X  # @PageHeight        { 29.70c          } # height of page
  2023. X  # @PageMargin        {  2.50c          } # size of all four margins
  2024. X  # @Columns           {  Single         } # Single, Double, Multi
  2025. X  # @DoubleColWidth    {  7.50c          } # column width used by Double
  2026. X  # @MultiColWidth     {  4.67c          } # column width used by Multi
  2027. X  # @ColGap            {  1.00c          } # gap between columns
  2028. X  # @TopGap            {  0.75c          } # gap between figures
  2029. X  # @MidGap            {  0.75c          } # gap above and below body text
  2030. X
  2031. X  # @FootNoteFont      {  0.80f          } # font for footnotes
  2032. X  # @FootNoteBreak     {  1.20fx         } # break for footnotes
  2033. X  # @FootLen           {  2.00c          } # footnote line and indent size
  2034. X  # @ColFootLen        {  1.20c          } # @FootLen when Double, Multi
  2035. X  # @FootGap           {  0.20c          } # gap between footnotes
  2036. X
  2037. X  # @MakeIndex         {  No             } # Want index? Yes or No
  2038. X  # @IndexColumns      {  Double         } # Single, Double, Multi
  2039. X
  2040. X  # @TableOfContents   {  No             } # Want contents? Yes or No
  2041. X  # @MajorContentsGap  {  1.30v          } # gap above major entry
  2042. X  # @ContentsGap       {  1.00v          } # gap above ordinary entry
  2043. X
  2044. X  # @ChapterNumbers    {  Yes            } # Yes or No            
  2045. X  # @SectionNumbers    {  Yes            } # Yes or No            
  2046. X  # @SubSectionNumbers {  Yes            } # Yes or No            
  2047. X  # @AppendixNumbers   {  Yes            } # Yes or No            
  2048. X  # @SubAppendixNumbers{  Yes            } # Yes or No            
  2049. X  # @ChapterGap        {  1.10b          } # gap before each chapter
  2050. X  # @SectionGap        {  2.00v          } # gap before each section
  2051. X  # @SubSectionGap     {  1.50v          } # gap before each subsection
  2052. X  # @AppendixGap       {  2.00v          } # gap before each appendix
  2053. X  # @SubAppendixGap    {  2.00v          } # gap before each subappendix
  2054. X
  2055. X  # @PageNumbers       {  Yes            } # Want page numbers? Yes or No
  2056. X  # @FirstPageNumber   {  1              } # Number of first page 
  2057. X  # @PageOneTopFormat  { @Null               }
  2058. X  # @PageOneFootFormat { @Null               }
  2059. X  # @PageTopFormat     { |0.5rt - @PageNum - }
  2060. X  # @PageFootFormat    { @Null               }
  2061. X  # @BookTitleFormat   { Bold @Font @Title   } 
  2062. X}
  2063. END_OF_FILE
  2064.   if test 4110 -ne `wc -c <'lout/include/report'`; then
  2065.     echo shar: \"'lout/include/report'\" unpacked with wrong size!
  2066.   fi
  2067.   # end of 'lout/include/report'
  2068. fi
  2069. echo shar: End of archive 27 \(of 30\).
  2070. cp /dev/null ark27isdone
  2071. MISSING=""
  2072. 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
  2073.     if test ! -f ark${I}isdone ; then
  2074.     MISSING="${MISSING} ${I}"
  2075.     fi
  2076. done
  2077. if test "${MISSING}" = "" ; then
  2078.     echo You have unpacked all 30 archives.
  2079.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2080. else
  2081.     echo You still must unpack the following archives:
  2082.     echo "        " ${MISSING}
  2083. fi
  2084. exit 0
  2085. exit 0 # Just in case...
  2086.