home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / lout / part30 < prev    next >
Encoding:
Text File  |  1993-08-11  |  73.8 KB  |  2,180 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v38i098:  lout - Lout document formatting system, v2.05, Part30/35
  4. Message-ID: <1993Aug10.132252.18938@sparky.sterling.com>
  5. X-Md4-Signature: feb02a7c4c6ace1f90a9ff44068f5565
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Tue, 10 Aug 1993 13:22:52 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 38, Issue 98
  13. Archive-name: lout/part30
  14. Environment: UNIX
  15. Supersedes: lout: Volume 37, Issue 99-128
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  data/loutrefs.ld doc/tr.begin/s03 doc/tr.eq/s6
  22. #   doc/tr.fig/s3 doc/tr.impl/oldrefs.ld doc/tr.impl/s3.3
  23. #   doc/tr.lout/ch1.01 doc/tr.lout/ch2.01 doc/tr.lout/ch2.05
  24. #   include/tab_prepend z28.c z32.c
  25. # Wrapped by kent@sparky on Sun Aug  8 12:29:32 1993
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 30 (of 35)."'
  29. if test -f 'data/loutrefs.ld' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'data/loutrefs.ld'\"
  31. else
  32.   echo shar: Extracting \"'data/loutrefs.ld'\" \(5693 characters\)
  33.   sed "s/^X//" >'data/loutrefs.ld' <<'END_OF_FILE'
  34. X{ @Reference
  35. X     @Tag { knuth84 }
  36. X     @Type { Book }
  37. X     @Author { Knuth, Donald E. }
  38. X     @Title { The T{ /0.2fo E}XBook }
  39. X     @Publisher { Addison-Wesley }
  40. X     @Year { 1984 }
  41. X}
  42. X
  43. X{ @Reference
  44. X     @Tag { adobe90 }
  45. X     @Type { Book }
  46. X     @Author { Adobe Systems, Inc. }
  47. X     @Title { PostScript Language Reference Manual, Second Edition }
  48. X     @Publisher { Addison-Wesley }
  49. X     @Year { 1990 }
  50. X}
  51. X
  52. X{ @Reference
  53. X     @Tag { reid80 }
  54. X     @Type { ConferencePaper }
  55. X     @Author { Reid, Brian K. }
  56. X     @Title { A High-Level Approach to Computer Document Production }
  57. X     @Proceedings { Proceedings of the 7th Symposium on the Principles
  58. Xof Programming Languages (POPL), Las Vegas NV }
  59. X     @Pages { 24--31 }
  60. X     @Year { 1980 }
  61. X}
  62. X
  63. X{ @Reference
  64. X     @Tag { strunk79 }
  65. X     @Type { Book }
  66. X     @Author { Strunk, William and White, E. B. }
  67. X     @Title { The Elements of Style }
  68. X     @Publisher { Macmillan, third edition }
  69. X     @Year { 1979 }
  70. X}
  71. X
  72. X{ @Reference
  73. X     @Tag { ossanna76 }
  74. X     @Type { TechReport }
  75. X     @Author { Joseph F. Ossanna }
  76. X     @Title { "Nroff/Troff" User's Manual }
  77. X     @Number { 54 }
  78. X     @Institution { Bell Laboratories, Murray Hill, NJ 07974 }
  79. X     @Year { 1976 }
  80. X}
  81. X
  82. X{ @Reference
  83. X     @Tag { kernighan75 }
  84. X     @Type { JournalArticle }
  85. X     @Author { Kernighan, Brian W. and Cherry, Lorinda L. }
  86. X     @Title { A system for typesetting mathematics }
  87. X     @Journal { Communications of the ACM }
  88. X     @Volume { 18 }
  89. X     @Pages { 182--193 }
  90. X     @Year { 1975 }
  91. X}
  92. X
  93. X{ @Reference
  94. X     @Tag { lesk76 }
  95. X     @Type { TechReport }
  96. X     @Author { Lesk, M. E. }
  97. X     @Title { Tbl -- a program to format tables }
  98. X     @Number { 49 }
  99. X     @Institution { Bell Laboratories, Murray Hill, NJ 07974 }
  100. X     @Year { 1976 }
  101. X}
  102. X
  103. X{ @Reference
  104. X     @Tag { kernighan82 }
  105. X     @Type { JournalArticle }
  106. X     @Author { Kernighan, Brian W. }
  107. X     @Title { PIC -- A language for typesetting graphics}
  108. X     @Journal { Software Practice and Experience }
  109. X     @Volume { 12 }
  110. X     @Pages { 1--21 }
  111. X     @Year { 1982 }
  112. X}
  113. X
  114. X{ @Reference
  115. X     @Tag { kingston93basser }
  116. X     @Type { Software }
  117. X     @Author { Kingston, Jeffrey H. }
  118. X     @Title { The Basser Lout Document Formatter, Version 2.05 }
  119. X     @Year { 1993 }
  120. X     @Comment { Computer program, publicly available in the
  121. X@I jeff subdirectory of the home directory of @I ftp to host
  122. X@I ftp.cs.su.oz.au with login name @I anonymous or @I ftp and any
  123. Xnon-empty password (e.g. {@I none}).  Lout distributions are also
  124. Xavailable from the comp.sources.misc newsgroup.  All enquiries to
  125. X"jeff@cs.su.oz.au". }
  126. X}
  127. X
  128. X{ @Reference
  129. X     @Tag { kingston92 }
  130. X     @Type { TechReport }
  131. X     @Author { Kingston, Jeffrey H. }
  132. X     @Title { Document Formatting with Lout (Second Edition) }
  133. X     @Number { 449 }
  134. X     @Institution { Basser Department of Computer
  135. XScience F09, University of Sydney 2006, Australia }
  136. X     @Year { 1992 }
  137. X}
  138. X
  139. X{ @Reference
  140. X     @Tag { kingston92begin }
  141. X     @Type { TechReport }
  142. X     @Author { Kingston, Jeffrey H. }
  143. X     @Title { A beginners' guide to Lout }
  144. X     @Number { 450 }
  145. X     @Institution { Basser Department of Computer
  146. XScience F09, University of Sydney 2006, Australia }
  147. X     @Year { 1992 }
  148. X}
  149. X
  150. X{ @Reference
  151. X     @Tag { kingston92eq }
  152. X     @Type { TechReport }
  153. X     @Author { Kingston, Jeffrey H. }
  154. X     @Title { Eq -- a Lout package for typesetting mathematics }
  155. X     @Number { 452 }
  156. X     @Institution { Basser Department of Computer
  157. XScience F09, University of Sydney 2006, Australia }
  158. X     @Year { 1992 }
  159. X     @Comment { Contains an appendix describing the Pas Pascal
  160. Xformatter. }
  161. X}
  162. X
  163. X{ @Reference
  164. X     @Tag { kingston92fig }
  165. X     @Type { TechReport }
  166. X     @Author { Kingston, Jeffrey H. }
  167. X     @Title { Fig -- a Lout package for drawing figures }
  168. X     @Number { 453 }
  169. X     @Institution { Basser Department of Computer
  170. XScience F09, University of Sydney 2006, Australia }
  171. X     @Year { 1992 }
  172. X}
  173. X
  174. X{ @Reference
  175. X     @Tag { kingston91over }
  176. X     @Type { TechReport }
  177. X     @Author { Kingston, Jeffrey H. }
  178. X     @Title { A new approach to document formatting }
  179. X     @Number { 412 }
  180. X     @Institution { Basser Department of Computer
  181. XScience F09, University of Sydney 2006, Australia }
  182. X     @Year { 1991 }
  183. X}
  184. X
  185. X{ @Reference
  186. X     @Tag { kingston92tab }
  187. X     @Type { TechReport }
  188. X     @Author { Kingston, Jeffrey H. }
  189. X     @Title { Tab -- a Lout package for formatting tables }
  190. X     @Number { 451 }
  191. X     @Institution { Basser Department of Computer
  192. XScience F09, University of Sydney 2006, Australia }
  193. X     @Year { 1992 }
  194. X}
  195. X
  196. X{ @Reference
  197. X     @Tag { kingston92design }
  198. X     @Type { TechReport }
  199. X     @Author { Kingston, Jeffrey H. }
  200. X     @Title { The design and implementation of the Lout document formatting language }
  201. X     @Number { 442 }
  202. X     @Institution { Basser Department of Computer
  203. XScience F09, University of Sydney 2006, Australia }
  204. X     @Year { 1992 }
  205. X     @Comment { To appear in @I { Software---Practice and Experience. } }
  206. X}
  207. X
  208. X{ @Reference
  209. X     @Tag { wirth71 }
  210. X     @Type { JournalArticle }
  211. X     @Author { Wirth, N. }
  212. X     @Title { The programming language Pascal }
  213. X     @Journal { Acta Informatica }
  214. X     @Volume { 1 }
  215. X     @Year { 1975 }
  216. X     @Pages { 35--63 }
  217. X}
  218. X
  219. X{ @Reference
  220. X     @Tag { brooks91 }
  221. X     @Type { JournalArticle }
  222. X     @Author { Brooks, Kenneth P. }
  223. X     @Title { Lilac: a two-view document editor }
  224. X     @Journal { IEEE Computer }
  225. X     @Volume { @Null }
  226. X     @Pages { 7--19 }
  227. X     @Year { 1991 }
  228. X}
  229. X
  230. X{ @Reference
  231. X     @Tag { furuta82 }
  232. X     @Type { JournalArticle }
  233. X     @Author { Furuta, Richard, Scofield, Jeffrey,
  234. Xand Shaw, Alan }
  235. X     @Title { Document formatting systems:  survey,
  236. Xconcepts, and issues }
  237. X     @Journal { Computing Surveys }
  238. X     @Volume { 14 }
  239. X     @Pages { 417--472 }
  240. X     @Year { 1982 }
  241. X}
  242. END_OF_FILE
  243.   if test 5693 -ne `wc -c <'data/loutrefs.ld'`; then
  244.     echo shar: \"'data/loutrefs.ld'\" unpacked with wrong size!
  245.   fi
  246.   # end of 'data/loutrefs.ld'
  247. fi
  248. if test -f 'doc/tr.begin/s03' -a "${1}" != "-c" ; then 
  249.   echo shar: Will not clobber existing file \"'doc/tr.begin/s03'\"
  250. else
  251.   echo shar: Extracting \"'doc/tr.begin/s03'\" \(5189 characters\)
  252.   sed "s/^X//" >'doc/tr.begin/s03' <<'END_OF_FILE'
  253. X@Section
  254. X   @Tag { lists }
  255. X   @Title { Lists }
  256. X@Begin
  257. X@PP
  258. XWe have just seen that consecutive displays are awkward to space
  259. Xcorrectly.  Provided they are not aligned or numbered,
  260. Xthese are better treated as a {@I list}:
  261. X@ID @Code {
  262. X"... preceding text."
  263. X"@IndentedList"
  264. X"@ListItem @I Emma"
  265. X"@ListItem @I { Mansfield Park }"
  266. X"@EndList"
  267. X"following text ..."
  268. X}
  269. XThere are {@Code "@LeftList"}, {@Code "@IndentedList"}, and
  270. X@Code "@CentredList" (or {@Code "@CenteredList"}) symbols; each item is
  271. Xintroduced by {@Code "@ListItem"}, and the list ends with
  272. X{@Code "@EndList"}.  There may be any number of items; @Code "@DP"
  273. Xsymbols are inserted before, between, and after them.
  274. X@PP
  275. XA variety of automatically generated tags is available for indented
  276. Xlists.  Here is the full set, showing the first tag produced:
  277. X@ID {
  278. X     @Code "@NumberedList"    |1c    1.
  279. X/1vx @Code "@ParenNumberedList" |    (1)
  280. X/1vx @Code "@RomanList"        |    i.
  281. X/1vx @Code "@ParenRomanList"    |    (i)
  282. X/1vx @Code "@UCRomanList"    |    I.
  283. X/1vx @Code "@ParenUCRomanList"    |    (I)
  284. X/1vx @Code "@AlphaList"        |    a.
  285. X/1vx @Code "@ParenAlphaList"    |    (a)
  286. X/1vx @Code "@UCAlphaList"    |    A.
  287. X/1vx @Code "@ParenUCAlphaList"    |    (A)
  288. X/1vx @Code "@BulletList"    |    @Bullet
  289. X/1vx @Code "@StarList"        |    @Star
  290. X/1vx @Code "@DashList"        |    --
  291. X}
  292. XThe Roman numerals end at c (100), and the alphabet ends
  293. Xat z (26), but ordinary numbers have no limit.  For example,
  294. X@ID @Code {
  295. X"@Heading { Quiz }"
  296. X"@NumberedList"
  297. X"@ListItem { Which American"
  298. X"statesman owned a"
  299. X"two-storey clock? }"
  300. X"@ListItem { Which Yankee"
  301. X"commander cut a swathe of"
  302. X"destruction through the"
  303. X"State of Georgia? }"
  304. X"@EndList"
  305. X}
  306. Xhas result
  307. X@ID {
  308. X@Heading { Quiz }
  309. X@DP
  310. X@RawNumberedList
  311. X@ListItem { Which American
  312. Xstatesman owned a
  313. Xtwo-storey clock? }
  314. X@ListItem { Which Yankee
  315. Xcommander cut a swathe of
  316. Xdestruction through the
  317. XState of Georgia? }
  318. X@EndList
  319. X}
  320. XAlternatively, the tags may be supplied by the author, using the
  321. X@Code "@TaggedList" symbol and its variants @Code "@WideTaggedList" and
  322. X{@Code "@VeryWideTaggedList"}, which leave a wider indent for the tags:
  323. X@ID @Code {
  324. X"@WideTaggedList"
  325. X"{ 9 a.m. } @TagItem { Breakfast in"
  326. X"the Ipamena Lounge, served with"
  327. X"Irish coffee and fresh croissants. }"
  328. X"{ 10 a.m. } @TagItem { Prof. A. Smith"
  329. X"speaks on `The Wealth of Nations.' }"
  330. X"@EndList"
  331. X}
  332. Xhas result
  333. X@ID {
  334. X@RawWideTaggedList
  335. X{ 9 a.m. } @TagItem { Breakfast in
  336. Xthe Ipamena Lounge, served with
  337. XIrish coffee and fresh croissants. }
  338. X{ 10 a.m. } @TagItem { Prof. A. Smith
  339. Xspeaks on `The Wealth of Nations.' }
  340. X@EndList
  341. X}
  342. XEach @Code "@TagItem" symbol uses the thing just preceding it as the tag.
  343. X@PP
  344. XEach of these lists also has a `raw' version which omits the preceding
  345. Xand following space.  These are mainly used when an item is itself a list:
  346. X@ID @Code {
  347. X"@ParenNumberedList"
  348. X"@ListItem {"
  349. X"   @RawParenRomanList"
  350. X"   @ListItem { MV Nominees,"
  351. X"hereinafter called the vendor, ... }"
  352. X"   @EndList"
  353. X"}"
  354. X"@EndList"
  355. X}
  356. Xhas result
  357. X@ID {
  358. X@RawParenNumberedList
  359. X@ListItem {
  360. X   @RawParenRomanList
  361. X   @ListItem { MV Nominees,
  362. Xhereinafter called the vendor, ... }
  363. X   @EndList
  364. X}
  365. X@EndList
  366. X}
  367. XIf @Code "@ParenRomanList" had been used instead of
  368. X{@Code "@RawParenRomanList"}, (1) and (i) would have appeared on
  369. Xdifferent lines.
  370. X@PP
  371. XIn cases where it is desired to have a paragraph symbol following a raw
  372. Xlist, owing to problems behind the scenes this symbol should be placed
  373. Xbefore the first {@Code "@ListItem"} or {@Code "@TagItem"}, not after
  374. Xthe @Code "@EndList" as would naturally be expected.
  375. X@PP
  376. XA finer control over the appearance of lists is obtained with
  377. X@Code "@RawIndentedList" and {@Code "@RawTaggedList"}.  These
  378. Xhave {@I options}:  optional subsidiary symbols which modify the
  379. Xresult.  For example,
  380. X@ID @Code {
  381. X"@RawIndentedList"
  382. X"     style { [tag] }"
  383. X"     indent { 0.5i }"
  384. X"     gap { 0.3v }"
  385. X"     start { 5 }"
  386. X"@ListItem { ... }"
  387. X"@ListItem { ... }"
  388. X"@EndList"
  389. X}
  390. Xshows the four options available with {@Code "@RawIndentedList"}, namely
  391. X{@Code style}, @Code {indent}, {@Code gap}, and {@Code start}.  It
  392. Xhas result
  393. X@ID {
  394. X@RawIndentedList
  395. X     style { [tag] }
  396. X     indent { 0.5i }
  397. X     gap { 0.3v }
  398. X     start { 5 }
  399. X@ListItem { ... }
  400. X@ListItem { ... }
  401. X@EndList
  402. X}
  403. XThe @Code style option determines the appearance of each tag, any
  404. X@Code tag symbol
  405. Xwithin it being replaced by the number of the item.  If numbers are not
  406. Xwanted in the tag, @Code tag may be omitted.  The other options
  407. Xdetermine the indent, the gap between items, and the number of the first
  408. Xitem.  In general, options may be given in any order, and if omitted
  409. Xwill revert to a reasonable standard value.  @Code "@RawTaggedList" works
  410. Xin a similar way, except that @Code tag is replaced by the tag supplied
  411. Xby the @Code "@TagItem" symbol, and there is no @Code start option.  The
  412. Xsymbol @Code "@DP" may be used above or below the list to produce the
  413. Xusual amount of space.
  414. X@PP
  415. XIndividual list items are kept together on one page or column.  However,
  416. Xa new page may be started between two list items.
  417. X@PP
  418. XEvery symbol introduced in this section has an abbreviated form consisting
  419. Xof @Code "@" followed by its capital letters only.  For example,
  420. X@Code "@RawNumberedList" abbreviates to {@Code "@RNL"}, and
  421. X@Code "@ListItem" to {@Code "@LI"}.
  422. X@End @Section
  423. END_OF_FILE
  424.   if test 5189 -ne `wc -c <'doc/tr.begin/s03'`; then
  425.     echo shar: \"'doc/tr.begin/s03'\" unpacked with wrong size!
  426.   fi
  427.   # end of 'doc/tr.begin/s03'
  428. fi
  429. if test -f 'doc/tr.eq/s6' -a "${1}" != "-c" ; then 
  430.   echo shar: Will not clobber existing file \"'doc/tr.eq/s6'\"
  431. else
  432.   echo shar: Extracting \"'doc/tr.eq/s6'\" \(5589 characters\)
  433.   sed "s/^X//" >'doc/tr.eq/s6' <<'END_OF_FILE'
  434. X@Appendix
  435. X    @Title { Pas -- a Lout Package for Printing Pascal Programs }
  436. X@Begin
  437. X@PP
  438. XPas
  439. X@Reference
  440. X   @Tag { jensen75 }
  441. X   @Type { Book }
  442. X   @Author { Jensen, K. and Wirth, N. }
  443. X   @Title { Pascal User Manual and Report }
  444. X   @Publisher { Springer-Verlag }
  445. X   @Year { 1975 }
  446. Xis a package of definitions for printing Pascal programs
  447. X[{@Ref jensen75}] neatly with the Lout document formatter
  448. X[{@Ref kingston92}].  No attempt is made to follow any particular
  449. Xprinting standard; the design simply reflects the author's taste.
  450. X@PP
  451. XThe package is so simple that there is very little to say about
  452. Xit.  To use Pas, place @Code "@SysInclude { pas }" in the setup file,
  453. Xor type @Code "-ipas" in the command line.  A Pascal program is
  454. Xentered like this, where the @Code "@ID" symbol from the DocumentLayout
  455. Xpackage [{@Ref kingston92begin}] has been used to obtain an indented display:
  456. X@ID @Code {
  457. X"@ID @Pas {"
  458. X"procedure PriDelete(x: PriEntry; var Q: PriorityQueue);"
  459. X"    var i: integer;"
  460. X"begin"
  461. X"    with Q^ do begin"
  462. X"        size := size - 1;"
  463. X"        if x^.back <= size then"
  464. X"        begin"
  465. X"            i := x^.back;"
  466. X"            A[i] := A[size + 1];"
  467. X"            A[i]^.back := i;"
  468. X"            PriAddRoot(i, Q);"
  469. X"            PriAddLeaf(i, Q)"
  470. X"        end"
  471. X"    end"
  472. X"end;"
  473. X"}"
  474. X}
  475. XThe result will come out like this:
  476. X@ID @Pas {
  477. Xprocedure PriDelete(x: PriEntry; var Q: PriorityQueue);
  478. X    var i: integer;
  479. Xbegin
  480. X    with Q^ do begin
  481. X    size := size - 1;
  482. X    if x^.back <= size then
  483. X    begin
  484. X        i := x^.back;
  485. X        A[i] := A[size + 1];
  486. X        A[i]^.back := i;
  487. X        PriAddRoot(i, Q);
  488. X        PriAddLeaf(i, Q)
  489. X    end
  490. X    end
  491. Xend;
  492. X}
  493. XBlank lines, line breaks, indents and spaces in the input are respected, with a
  494. Xtab being considered equal to eight spaces.  @Code "@Pas" can also be used
  495. Xwithin a paragraph to produce Pascal fragments like @Pas { A[i..j] }.  Use
  496. X@Code "@OneCol @Pas { ... }" to prevent the result from breaking over two
  497. Xlines.
  498. X@PP
  499. X@Code "@Pas" does not attempt to rearrange the program in any way.  Each
  500. Xitem is simply printed according to the following plan:
  501. X@ID {
  502. X7c @Wide {
  503. X      @Code and     |2.5ct @Pas { and }
  504. X//1vx @Code array     |2.5ct @Pas { array }
  505. X//1vx @Code begin     |2.5ct @Pas { begin }
  506. X//1vx @Code case     |2.5ct @Pas { case }
  507. X//1vx @Code const     |2.5ct @Pas { const }
  508. X//1vx @Code div     |2.5ct @Pas { div }
  509. X//1vx @Code do         |2.5ct @Pas { do }
  510. X//1vx @Code downto     |2.5ct @Pas { downto }
  511. X//1vx @Code else     |2.5ct @Pas { else }
  512. X//1vx @Code end     |2.5ct @Pas { end }
  513. X//1vx @Code file     |2.5ct @Pas { file }
  514. X//1vx @Code for     |2.5ct @Pas { for }
  515. X//1vx @Code forward    |2.5ct @Pas { forward }
  516. X//1vx @Code function     |2.5ct @Pas { function }
  517. X//1vx @Code goto     |2.5ct @Pas { goto }
  518. X//1vx @Code if         |2.5ct @Pas { if }
  519. X//1vx @Code in         |2.5ct @Pas { in }
  520. X//1vx @Code label     |2.5ct @Pas { label }
  521. X//1vx @Code mod     |2.5ct @Pas { mod }
  522. X//1vx @Code nil     |2.5ct @Pas { nil }
  523. X//1vx @Code not     |2.5ct @Pas { not }
  524. X//1vx @Code of         |2.5ct @Pas { of }
  525. X//1vx @Code or         |2.5ct @Pas { or }
  526. X//1vx @Code otherwise     |2.5ct @Pas { otherwise }
  527. X//1vx @Code packed     |2.5ct @Pas { packed }
  528. X//1vx @Code procedure     |2.5ct @Pas { procedure }
  529. X//1vx @Code program     |2.5ct @Pas { program }
  530. X//1vx @Code record     |2.5ct @Pas { record }
  531. X//1vx @Code repeat     |2.5ct @Pas { repeat }
  532. X//1vx @Code set     |2.5ct @Pas { set }
  533. X//1vx @Code then     |2.5ct @Pas { then }
  534. X//1vx @Code to         |2.5ct @Pas { to }
  535. X//1vx @Code type     |2.5ct @Pas { type }
  536. X//1vx @Code until     |2.5ct @Pas { until }
  537. X//1vx @Code var     |2.5ct @Pas { var }
  538. X//1vx @Code while     |2.5ct @Pas { while }
  539. X//1vx @Code with     |2.5ct @Pas { with }
  540. X} | 7c @Wide {
  541. X      @Code "0"        |2.5ct @Pas { 0 }
  542. X//1vx @Code "1"        |2.5ct @Pas { 1 }
  543. X//1vx @Code "2"        |2.5ct @Pas { 2 }
  544. X//1vx @Code "3"        |2.5ct @Pas { 3 }
  545. X//1vx @Code "4"        |2.5ct @Pas { 4 }
  546. X//1vx @Code "5"        |2.5ct @Pas { 5 }
  547. X//1vx @Code "6"        |2.5ct @Pas { 6 }
  548. X//1vx @Code "7"        |2.5ct @Pas { 7 }
  549. X//1vx @Code "8"        |2.5ct @Pas { 8 }
  550. X//1vx @Code "9"        |2.5ct @Pas { 9 }
  551. X//1vx @Code "."        |2.5ct @Pas { . }
  552. X//1vx @Code ","        |2.5ct @Pas { , }
  553. X//1vx @Code ":"        |2.5ct @Pas { : }
  554. X//1vx @Code ";"        |2.5ct @Pas { ; }
  555. X//1vx @Code "'"        |2.5ct @Pas { ' }
  556. X//1vx @Code "`"        |2.5ct @Pas { ` }
  557. X//1vx @Code "+"        |2.5ct @Pas { + }
  558. X//1vx @Code "-"        |2.5ct @Pas { - }
  559. X//1vx @Code "*"        |2.5ct @Pas { * }
  560. X//1vx @Code "/"        |2.5ct @Pas { / }
  561. X//1vx @Code "("        |2.5ct @Pas { ( }
  562. X//1vx @Code ")"        |2.5ct @Pas { ) }
  563. X//1vx @Code "["        |2.5ct @Pas { [ }
  564. X//1vx @Code "]"        |2.5ct @Pas { ] }
  565. X//1vx @Code "^"        |2.5ct @Pas { ^ }
  566. X//1vx @Code ".."    |2.5ct @Pas { .. }
  567. X//1vx @Code "="        |2.5ct @Pas { = }
  568. X//1vx @Code "<"        |2.5ct @Pas { < }
  569. X//1vx @Code ">"        |2.5ct @Pas { > }
  570. X//1vx @Code "<>"    |2.5ct @Pas { <> }
  571. X//1vx @Code "<="    |2.5ct @Pas { <= }
  572. X//1vx @Code ">="    |2.5ct @Pas { >= }
  573. X//1vx @Code ":="    |2.5ct @Pas { := }
  574. X}
  575. X}
  576. XAnything not mentioned here will appear in italic font.
  577. X@PP
  578. XPascal character strings need a little attention before formatting by
  579. XPas.  Their interiors are best enclosed in double quotes to prevent the
  580. Xabove transformations from occurring inside them.  Any @Code "\\" or
  581. X@Code "\"" characters inside strings will need to be replaced by
  582. X@Code "\\\\" and @Code "\\\"" respectively, and the opening quote should
  583. Xbe replaced by {@Code "`"}.
  584. X@PP
  585. XSimilar remarks apply to Pascal comments; don't forget that @Code "{"
  586. Xand @Code "}" must be enclosed in double quotes.  Alternatively, a
  587. X@Code "@Com" symbol can be placed in front of a comment enclosed
  588. Xin braces.  It will add literal braces:
  589. X@ID @Code {
  590. X"@Com { A Pascal comment }"
  591. X}
  592. Xhas result
  593. X@ID @Pas {
  594. X@Com { A Pascal comment }
  595. X}
  596. XIt may still be necessary to enclose the interior in double quotes.
  597. X@End @Appendix
  598. END_OF_FILE
  599.   if test 5589 -ne `wc -c <'doc/tr.eq/s6'`; then
  600.     echo shar: \"'doc/tr.eq/s6'\" unpacked with wrong size!
  601.   fi
  602.   # end of 'doc/tr.eq/s6'
  603. fi
  604. if test -f 'doc/tr.fig/s3' -a "${1}" != "-c" ; then 
  605.   echo shar: Will not clobber existing file \"'doc/tr.fig/s3'\"
  606. else
  607.   echo shar: Extracting \"'doc/tr.fig/s3'\" \(5295 characters\)
  608.   sed "s/^X//" >'doc/tr.fig/s3' <<'END_OF_FILE'
  609. X@Section
  610. X   @Title { Creating New Shapes }
  611. X@Begin
  612. X@PP
  613. XIf the needed shape is not provided by Fig, it can be created
  614. Xusing the @Code "@Figure" symbol.  @Code "@Figure" takes all the options
  615. Xwe have already seen, plus another one called {@Code shape}.  For
  616. Xexample,
  617. X@ID {
  618. X@Code {
  619. X"@Figure"
  620. X"   shape {"
  621. X"      0 0  xsize 0"
  622. X"      0 ysize  0 0"
  623. X"   }"
  624. X"{ 3c @High 2c @Wide }"
  625. X}
  626. X||7ct
  627. X@Fig {
  628. X@Figure
  629. X   shape { 0 0  xsize 0
  630. X           0 ysize  0 0
  631. X         }
  632. X{ 3c @High 2c @Wide }
  633. X}
  634. X}
  635. XThe pairs of numbers define points in a coordinate system whose origin
  636. Xis the lower left corner of the right parameter; the upper right corner
  637. Xis @Code xsize {@Code ysize}, and the point where the
  638. Xright parameter's marks cross is {@Code "xmark ymark"}:
  639. X@ID 10p @Font
  640. X{
  641. X   { &1rt @I ysize /0ik &1rt @I ymark /0ik &1rt 0 } |0.4c
  642. X   {  /
  643. X      |0ik @ShowMarks { 1c @High 1.5c @Wide ^| 3c @Wide ^/ 2c @High }
  644. X      |0ik /
  645. X   }
  646. X   /0.3c
  647. X   | 0 | @I xmark | @I xsize
  648. X}
  649. XThis arrangement is identical with that for the @Code "@Graphic"
  650. Xsymbol of basic Lout.  A sequence of points defines a shape, like
  651. Xthe triangle above.  Arrowheads are drawn pointing forwards from the
  652. Xlast segment and backwards from the first, as requested; the @Code margin
  653. Xoption has default value {@Code 0c}.
  654. X@PP
  655. XNormally, the points are connected by straight lines to form the shape,
  656. Xwhich is then painted and drawn in the usual way, depending on the other
  657. Xoptions.
  658. X@PP
  659. XIf two points in the shape are separated by {@Code {"[" &0.5s "]"}}, no
  660. Xline will be drawn between them.  This permits a shape to consist of two
  661. Xor more disconnected parts.
  662. X@PP
  663. XIf two points in the shape are separated by
  664. X{@Code "[" & @Eq{x ``` y} & @Code "]"}, where
  665. X@Eq {x} and @Eq {y} are numbers, the two points will be joined by an
  666. Xanticlockwise arc whose centre is the point @Eq {(x, y)}.  This arc
  667. Xwill be circular if possible, otherwise it will be part of an ellipse
  668. Xwhose axes are oriented horizontally and vertically.  The notation
  669. X@Code "[" & @Eq {x ``` y} @Code "clockwise]" makes the arc go
  670. Xclockwise.  For example,
  671. X@ID {
  672. X@Code {
  673. X"@Figure"
  674. X"   shape {"
  675. X"      0 -0.5 cm"
  676. X"      0 0.5 cm"
  677. X"      1 cm 0  0 -0.5 cm [" &0.5s "]"
  678. X"      1 cm 0 [ 1.1 cm 0 ]"
  679. X"      1 cm 0"
  680. X"   }"
  681. X"{}"
  682. X}
  683. X||7ct
  684. X@Fig { //0.5c
  685. X@Figure
  686. X   shape { 0 -0.5 cm  0 0.5 cm
  687. X           1 cm 0  0 -0.5 cm []
  688. X           1 cm 0 [ 1.1 cm 0 ] 1 cm 0
  689. X         }
  690. X{}
  691. X}
  692. X}
  693. XWe have recklessly disregarded the size of the right parameter when
  694. Xdrawing this shape, a dangerous thing to do since Lout thinks that the
  695. Xfigure is the same size as its right parameter.
  696. X@PP
  697. XFinally, two points may be separated by
  698. X@Eq { [x sub 1 ``` y sub 1 ```  x sub 2 ``` y sub 2 & ] }, which requests that a
  699. XBezier curve be drawn between them with control points
  700. X@Eq { (x sub 1 & , y sub 1 & ) } and
  701. X@Eq { (x sub 2 & , y sub 2 & ) }:
  702. X@ID @Fig {
  703. X@Figure
  704. X   margin { 0c }
  705. X   shape { 1 cm 2 cm 4 cm 3.5 cm  9 cm 2 cm 2 cm 0.6 cm }
  706. X   linestyle { dashed }
  707. X@Figure
  708. X   margin { 0c }
  709. X   shape { 1 cm 2 cm [4 cm 3.5 cm  9 cm 2 cm] 2 cm 0.6 cm }
  710. X{ 7c @Wide 4c @High }
  711. X
  712. X// { -0.3  cm 2.0 cm } @BaseOf @Eq { (x sub 0 & , y sub 0 & )}
  713. X// {  4.2  cm 3.5 cm } @BaseOf @Eq { (x sub 1 & , y sub 1 & )}
  714. X// {  9.1  cm 2.0 cm } @BaseOf @Eq { (x sub 2 & , y sub 2 & )}
  715. X// {  2.1  cm 0.0 cm } @BaseOf @Eq { (x sub 3 & , y sub 3 & )}
  716. X}
  717. XThe curve is attracted toward the control points, without reaching
  718. Xthem; it is tangent to the straight line from the start point to the
  719. Xfirst control point, and from the second control point to the finishing
  720. Xpoint, and it lies wholly inside the quadrilateral formed by the four
  721. Xpoints.  Owing to the author's laziness, dashes and dots do not fit as
  722. Xneatly onto Bezier curves as they do onto lines and arcs.
  723. X @Code "@Figure" should be general enough to draw most shapes; for
  724. Xexample, all the other shapes ({@Code "@Box"}, {@Code "@Circle"}, etc.)
  725. Xare just instances of {@Code "@Figure"}.  When it is inadequate, one
  726. Xcan fall back to the standard @Code "@Graphic" symbol.
  727. X@PP
  728. XLines, arrows and arcs at any angle can be produced using {@Code "@Figure"}:
  729. X@ID {
  730. X@Code {
  731. X"@Figure"
  732. X"   shape { 0 0  xsize ysize }"
  733. X"   arrow { forward }"
  734. X"{ 2c @High 3c @Wide }"
  735. X}
  736. X||7ct
  737. X@Fig {
  738. X@Figure
  739. X   shape { 0 0  xsize ysize }
  740. X   arrow { forward }
  741. X{ 2c @High 3c @Wide }
  742. X}
  743. X}
  744. XHowever, for convenience there are symbols @Code "@Line" and @Code
  745. X"@Arrow" which have two options, @Code "from" and {@Code "to"}, for
  746. Xspecifying the endpoints:
  747. X@ID {
  748. X@Code {
  749. X"@Arrow"
  750. X"   from { 0 0 }"
  751. X"   to { xsize ysize }"
  752. X"{ 2c @High 3c @Wide }"
  753. X}
  754. X||7ct
  755. X@Fig {
  756. X@Arrow
  757. X   from { 0 0 }
  758. X   to { xsize ysize }
  759. X{ 2c @High 3c @Wide }
  760. X}
  761. X}
  762. XThere is also an @Code "@Arc" symbol, which draws a circular or
  763. Xelliptical arc from one point to another about a given centre, with
  764. Xthe usual options:
  765. X@ID {
  766. X@Code {
  767. X"@Arc"
  768. X"   from { 0 0 }"
  769. X"   to { xsize ysize }"
  770. X"   ctr { 0 ysize }"
  771. X"   direction { anticlockwise }"
  772. X"   arrow { forward }"
  773. X"   linestyle { dashed }"
  774. X"{ 2c @High 3c @Wide }"
  775. X}
  776. X||7ct
  777. X@Fig {
  778. X@Arc
  779. X   from { 0 0 }
  780. X   to { xsize ysize }
  781. X   ctr { 0 ysize }
  782. X   direction { anticlockwise }
  783. X   arrow { forward }
  784. X   linestyle { dashed }
  785. X{ 2c @High 3c @Wide }
  786. X}
  787. X}
  788. XThe arc goes either @Code clockwise (the default) or @Code anticlockwise
  789. Xabout the centre, depending on the @Code direction option.  Any
  790. Xarrowhead will point in a direction tangent to the arc.
  791. X@End @Section
  792. END_OF_FILE
  793.   if test 5295 -ne `wc -c <'doc/tr.fig/s3'`; then
  794.     echo shar: \"'doc/tr.fig/s3'\" unpacked with wrong size!
  795.   fi
  796.   # end of 'doc/tr.fig/s3'
  797. fi
  798. if test -f 'doc/tr.impl/oldrefs.ld' -a "${1}" != "-c" ; then 
  799.   echo shar: Will not clobber existing file \"'doc/tr.impl/oldrefs.ld'\"
  800. else
  801.   echo shar: Extracting \"'doc/tr.impl/oldrefs.ld'\" \(5587 characters\)
  802.   sed "s/^X//" >'doc/tr.impl/oldrefs.ld' <<'END_OF_FILE'
  803. X{ @Reference
  804. X     @Tag { knuth84 }
  805. X     @Type { Book }
  806. X     @Author { Knuth, Donald E. }
  807. X     @Title { The T{ /0.2fo E}XBook }
  808. X     @Publisher { Addison-Wesley }
  809. X     @Year { 1984 }
  810. X}
  811. X
  812. X{ @Reference
  813. X     @Tag { adobe85 }
  814. X     @Type { Book }
  815. X     @Author { Adobe Systems, Inc. }
  816. X     @Title { PostScript Language Reference Manual }
  817. X     @Publisher { Addison-Wesley }
  818. X     @Year { 1985 }
  819. X}
  820. X
  821. X{ @Reference
  822. X     @Tag { reid80 }
  823. X     @Type { ConferencePaper }
  824. X     @Author { Reid, Brian K. }
  825. X     @Title { A High-Level Approach to Computer Document Production }
  826. X     @Proceedings { Proceedings of the 7th Symposium on the Principles
  827. Xof Programming Languages (POPL), Las Vegas NV }
  828. X     @Pages { 24--31 }
  829. X     @Year { 1980 }
  830. X}
  831. X
  832. X{ @Reference
  833. X     @Tag { strunk79 }
  834. X     @Type { Book }
  835. X     @Author { Strunk, William and White, E. B. }
  836. X     @Title { The Elements of Style }
  837. X     @Publisher { Macmillan, third edition }
  838. X     @Year { 1979 }
  839. X}
  840. X
  841. X{ @Reference
  842. X     @Tag { ossanna76 }
  843. X     @Type { TechReport }
  844. X     @Author { Joseph F. Ossanna }
  845. X     @Title { "Nroff/Troff" User's Manual }
  846. X     @Number { 54 }
  847. X     @Institution { Bell Laboratories, Murray Hill, NJ 07974 }
  848. X     @Year { 1976 }
  849. X}
  850. X
  851. X{ @Reference
  852. X     @Tag { kernighan75 }
  853. X     @Type { JournalArticle }
  854. X     @Author { Kernighan, Brian W. and Cherry, Lorinda L. }
  855. X     @Title { A system for typesetting mathematics }
  856. X     @Journal { Communications of the ACM }
  857. X     @Volume { 18 }
  858. X     @Pages { 182--193 }
  859. X     @Year { 1975 }
  860. X}
  861. X
  862. X{ @Reference
  863. X     @Tag { lesk76 }
  864. X     @Type { TechReport }
  865. X     @Author { Lesk, M. E. }
  866. X     @Title { Tbl -- a program to format tables }
  867. X     @Number { 49 }
  868. X     @Institution { Bell Laboratories, Murray Hill, NJ 07974 }
  869. X     @Year { 1976 }
  870. X}
  871. X
  872. X{ @Reference
  873. X     @Tag { kernighan82 }
  874. X     @Type { JournalArticle }
  875. X     @Author { Kernighan, Brian W. }
  876. X     @Title { PIC -- A language for typesetting graphics}
  877. X     @Journal { Software Practice and Experience }
  878. X     @Volume { 12 }
  879. X     @Pages { 1--21 }
  880. X     @Year { 1982 }
  881. X}
  882. X
  883. X{ @Reference
  884. X     @Tag { kingston91 }
  885. X     @Type { TechReport }
  886. X     @Author { Kingston, Jeffrey H. }
  887. X     @Title { Document Formatting with Lout }
  888. X     @Number { 408 }
  889. X     @Institution { Basser Department of Computer
  890. XScience F09, University of Sydney 2006, Australia }
  891. X     @Year { 1991 }
  892. X}
  893. X
  894. X{ @Reference
  895. X     @Tag { kingston91basser }
  896. X     @Type { Software }
  897. X     @Author { Kingston, Jeffrey H. }
  898. X     @Title { The Basser Lout Document Formatter }
  899. X     @Year { 1991 }
  900. X     @Comment { Computer program; Version 2 publicly available
  901. Xin the @I jeff subdirectory of the home directory of @I ftp to host
  902. X@I ftp.cs.su.oz.au with login name @I anonymous or @I ftp and any
  903. Xnon-empty password.  Distribution via email is available for
  904. Xnon-{@I ftp} sites.  All enquiries to "jeff@cs.su.oz.au". }
  905. X}
  906. X
  907. X{ @Reference
  908. X     @Tag { kingston91begin }
  909. X     @Type { TechReport }
  910. X     @Author { Kingston, Jeffrey H. }
  911. X     @Title { A beginners' guide to Lout }
  912. X     @Number { 409 }
  913. X     @Institution { Basser Department of Computer
  914. XScience F09, University of Sydney 2006, Australia }
  915. X     @Year { 1991 }
  916. X}
  917. X
  918. X{ @Reference
  919. X     @Tag { kingston91eq }
  920. X     @Type { TechReport }
  921. X     @Author { Kingston, Jeffrey H. }
  922. X     @Title { Eq -- a Lout package for typesetting mathematics }
  923. X     @Number { 410 }
  924. X     @Institution { Basser Department of Computer
  925. XScience F09, University of Sydney 2006, Australia }
  926. X     @Year { 1991 }
  927. X     @Comment { (Contains an appendix describing the Pas Pascal formatter.) }
  928. X}
  929. X
  930. X{ @Reference
  931. X     @Tag { kingston91fig }
  932. X     @Type { TechReport }
  933. X     @Author { Kingston, Jeffrey H. }
  934. X     @Title { Fig -- a Lout package for drawing figures }
  935. X     @Number { 411 }
  936. X     @Institution { Basser Department of Computer
  937. XScience F09, University of Sydney 2006, Australia }
  938. X     @Year { 1991 }
  939. X}
  940. X
  941. X{ @Reference
  942. X     @Tag { kingston91over }
  943. X     @Type { TechReport }
  944. X     @Author { Kingston, Jeffrey H. }
  945. X     @Title { A new approach to document formatting }
  946. X     @Number { 412 }
  947. X     @Institution { Basser Department of Computer
  948. XScience F09, University of Sydney 2006, Australia }
  949. X     @Year { 1991 }
  950. X}
  951. X
  952. X{ @Reference
  953. X     @Tag { kingston91tab }
  954. X     @Type { TechReport }
  955. X     @Author { Kingston, Jeffrey H. }
  956. X     @Title { Tab -- a Lout package for formatting tables }
  957. X     @Number { 413 }
  958. X     @Institution { Basser Department of Computer
  959. XScience F09, University of Sydney 2006, Australia }
  960. X     @Year { 1991 }
  961. X}
  962. X
  963. X{ @Reference
  964. X     @Tag { kingston91design }
  965. X     @Type { TechReport }
  966. X     @Author { Kingston, Jeffrey H. }
  967. X     @Title { The design and implementation of a document formatting language }
  968. X     @Number { @Null }
  969. X     @Institution { Basser Department of Computer
  970. XScience F09, University of Sydney 2006, Australia }
  971. X     @Year { 1991 }
  972. X     @Comment { @I { In preparation. } }
  973. X}
  974. X
  975. X{ @Reference
  976. X     @Tag { wirth71 }
  977. X     @Type { JournalArticle }
  978. X     @Author { Wirth, N. }
  979. X     @Title { The programming language Pascal }
  980. X     @Journal { Acta Informatica }
  981. X     @Volume { 1 }
  982. X     @Year { 1975 }
  983. X     @Pages { 35--63 }
  984. X}
  985. X
  986. X{ @Reference
  987. X     @Tag { brooks91 }
  988. X     @Type { JournalArticle }
  989. X     @Author { Brooks, Kenneth P. }
  990. X     @Title { Lilac: a two-view document editor }
  991. X     @Journal { IEEE Computer }
  992. X     @Volume { @Null }
  993. X     @Pages { 7--19 }
  994. X     @Year { 1991 }
  995. X}
  996. X
  997. X{ @Reference
  998. X     @Tag { furuta82 }
  999. X     @Type { JournalArticle }
  1000. X     @Author { Furuta, Richard, Scofield, Jeffrey,
  1001. Xand Shaw, Alan }
  1002. X     @Title { Document formatting systems:  survey,
  1003. Xconcepts, and issues }
  1004. X     @Journal { Computing Surveys }
  1005. X     @Volume { 14 }
  1006. X     @Pages { 417--472 }
  1007. X     @Year { 1982 }
  1008. X}
  1009. END_OF_FILE
  1010.   if test 5587 -ne `wc -c <'doc/tr.impl/oldrefs.ld'`; then
  1011.     echo shar: \"'doc/tr.impl/oldrefs.ld'\" unpacked with wrong size!
  1012.   fi
  1013.   # end of 'doc/tr.impl/oldrefs.ld'
  1014. fi
  1015. if test -f 'doc/tr.impl/s3.3' -a "${1}" != "-c" ; then 
  1016.   echo shar: Will not clobber existing file \"'doc/tr.impl/s3.3'\"
  1017. else
  1018.   echo shar: Extracting \"'doc/tr.impl/s3.3'\" \(5264 characters\)
  1019.   sed "s/^X//" >'doc/tr.impl/s3.3' <<'END_OF_FILE'
  1020. X@SubSection
  1021. X    @Tag { modules }
  1022. X    @Title { Modules }
  1023. X@Begin
  1024. X@PP
  1025. XIt is well accepted that the visibility of symbols is not adequately
  1026. Xcontrolled by Algol block structure.  The author is aware of several
  1027. Xmajor problems of this kind in document formatting.
  1028. X@PP
  1029. XOne problem is that some symbols should be visible only within
  1030. Xrestricted parts of a document.  For example, we naturally expect
  1031. Xequation formatting to be accomplished like this:
  1032. X@ID @Code {
  1033. X"surrounding text"
  1034. X"@Eq { {x sup 2  +  1} over 4 }"
  1035. X"surrounding text"
  1036. X}
  1037. Xwith the symbols {@Code "sup"}, {@Code "over"}, etc., visible only within
  1038. Xthe equation, not in the surrounding text.
  1039. X@PP
  1040. XIt seems natural to define these symbols within {@Code "@Eq"}, since
  1041. Xthey are local to equations.  It only remains then to decree that
  1042. Xsymbols local to @Code "@Eq" are to be visible within its actual right
  1043. Xparameter, and this is done by replacing the right formal parameter with a
  1044. X@I body parameter:
  1045. X@ID @Code {
  1046. X"export sup over"
  1047. X"def @Eq"
  1048. X"    body @Body"
  1049. X"{"
  1050. X"    def sup ..."
  1051. X"    def over ..."
  1052. X""
  1053. X"    Slope @Font @Body"
  1054. X"}"
  1055. X}
  1056. XThe @Code export clause lists the identifiers which are permitted to be
  1057. Xvisible outside their usual range, the body of {@Code "@Eq"}; and the
  1058. X@Code body declaration imports them into (makes them visible within)
  1059. Xthe actual right parameter of each invocation of {@Code "@Eq"}.  This
  1060. Xarrangement has proven very convenient for defining a variety of
  1061. Xspecial-purpose packages.
  1062. X@PP
  1063. XAnother problem arises when global symbols, such as the ones used for
  1064. Xheadings and paragraph separators, call on values that the non-expert
  1065. Xuser will need to modify, such as the initial font or paragraph
  1066. Xindent.  These values are like parameters of the document as a whole, so
  1067. Xit is natural to try this:
  1068. X@ID @Code {
  1069. X"export @Heading @PP ..."
  1070. X"def @BookLayout"
  1071. X"    named @InitialFont { Times Base 12p }"
  1072. X"    named @InitialBreak { adjust 14p }"
  1073. X"    named @ColumnWidth { 6i }"
  1074. X"    ..."
  1075. X"{"
  1076. X"    def @Heading ..."
  1077. X"    def @PP ..."
  1078. X"}"
  1079. X}
  1080. XNow @Code "@Heading" and @Code "@PP" may invoke @Code "@InitialFont"
  1081. Xand the other parameters.  To make @Code "@Heading" and @Code "@PP"
  1082. Xvisible throughout the document, we need only add a body parameter to
  1083. X@Code "@BookLayout" and present the entire document as
  1084. X@ID @Code {
  1085. X"@BookLayout"
  1086. X"    @InitialFont { Helvetica Base 10p }"
  1087. X"    @InitialBreak { adjust 12p }"
  1088. X"{"
  1089. X"    The document."
  1090. X"}"
  1091. X}
  1092. Xbut for practical reasons given below we prefer not to enclose the
  1093. Xentire document in braces.  Instead, we write
  1094. X@ID @Code {
  1095. X"@Use { @BookLayout"
  1096. X"    @InitialFont { Helvetica Base 10p }"
  1097. X"    @InitialBreak { adjust 12p }"
  1098. X"}"
  1099. X"The document."
  1100. X}
  1101. Xwhich has the same effect:  @Code "@Use" makes the exported symbols of
  1102. X@Code "@BookLayout" visible for the remainder of the document, and is
  1103. Xpermitted only at the beginning.
  1104. X@PP
  1105. XThe third feature that affects visibility, and which will prove useful
  1106. Xfor cross referencing (Section {@NumberOf cross}), is the @Code "@Open"
  1107. Xsymbol.  It makes the exported symbols of its left parameter visible
  1108. Xwithin its right parameter, and is therefore similar to the Pascal @Code
  1109. Xwith statement.
  1110. X@PP
  1111. XIt could be argued that Lout is over-supplied with these visibility modifying
  1112. Xfeatures: the body parameter, @Code "@Use" and @Code "@Open" do not seem
  1113. Xsufficiently different from each another.  The @Code "@Open" symbol is
  1114. Xthe most general, being capable of replacing the other two.  For
  1115. Xexample,
  1116. X@ID @Code {
  1117. X"@Use { x }"
  1118. X"@Use { y }"
  1119. X"Body of document"
  1120. X}
  1121. Xcan be replaced by
  1122. X@ID @Code {
  1123. X"x @Open {"
  1124. X"y @Open {"
  1125. X"Body of document"
  1126. X"}}"
  1127. X}
  1128. Xand, taking the @Code "@Eq" symbol above as example, we could eliminate
  1129. Xits body parameter, add
  1130. X@ID @Code "def @Body right x { Slope @Font x }"
  1131. Xto the exported definitions of {@Code "@Eq"}, and replace
  1132. X@ID @Code "@Eq { object }"
  1133. Xby
  1134. X@ID @Code "@Eq @Open { @Body { object } }"
  1135. XIf @Code "@Eq" is a galley (Section {@NumberOf galleys}), @Code "@Body"
  1136. Xmust take over that function.  But one would not want to write these
  1137. Xclumsy expressions in practice, and the enclosure of large quantities
  1138. Xof input in extra braces could cause Basser Lout to run out of memory
  1139. X(Section {@NumberOf lookahead}).
  1140. X@PP
  1141. XA quite separate kind of visibility problem arises when expert
  1142. Xusers wish to define an object or operator for repeated use within, say,
  1143. Xequations:
  1144. X@ID @Code "def isum { sum from i=1 to n }"
  1145. XAs it stands this can only be placed within the @Code "@Eq" package itself, 
  1146. Xwhere @Code "sum" and the other symbols are visible, but it is not desirable
  1147. Xto modify the source code of a standard package.  Lout provides an
  1148. X@Code "import" clause to solve this problem:
  1149. X@ID @Code {
  1150. X"import @Eq"
  1151. X"def isum { sum from i=1 to n }"
  1152. X}
  1153. Xmay appear after @Code "@Eq" is defined, and it will make the exported symbols
  1154. Xof @Code "@Eq" visible within the body of {@Code "isum"}.  This feature
  1155. Xcomplicates the treatment of environments (Section {@NumberOf defs.impl}),
  1156. Xand even introduces an insecurity, when @Code isum is invoked outside an
  1157. Xequation.  A simpler approach would be to allow only one symbol in an
  1158. X@Code import clause, and treat the following definition exactly like a
  1159. Xlocal definition of that symbol; but then it would not be possible
  1160. Xto define symbols using the resources of more than one of the standard
  1161. Xpackages.
  1162. X@End @SubSection
  1163. END_OF_FILE
  1164.   if test 5264 -ne `wc -c <'doc/tr.impl/s3.3'`; then
  1165.     echo shar: \"'doc/tr.impl/s3.3'\" unpacked with wrong size!
  1166.   fi
  1167.   # end of 'doc/tr.impl/s3.3'
  1168. fi
  1169. if test -f 'doc/tr.lout/ch1.01' -a "${1}" != "-c" ; then 
  1170.   echo shar: Will not clobber existing file \"'doc/tr.lout/ch1.01'\"
  1171. else
  1172.   echo shar: Extracting \"'doc/tr.lout/ch1.01'\" \(6589 characters\)
  1173.   sed "s/^X//" >'doc/tr.lout/ch1.01' <<'END_OF_FILE'
  1174. X@Section
  1175. X  @Title { Objects }
  1176. X  @Tag { objects }
  1177. X@Begin
  1178. X@PP
  1179. XSince our aim is to produce neatly formatted documents, we should begin by
  1180. Xlooking at a typical example of such a document:
  1181. X@ID {
  1182. Xnohyphen @Break @LittleDocument
  1183. X//
  1184. X@LittleText {
  1185. X@DP
  1186. X|0.5rt {@B PURCELL}{ 0.8f @Font 1 ^//0.2v}
  1187. X@LittleFootNote
  1188. X{ { 0.8f @Font 1 ^//0.2v}Blom, Eric.  @I {Some Great Composers.}  Oxford, 1944.
  1189. X}
  1190. X@DP
  1191. XIn the world of music England is supposed to be a mere province.  If she
  1192. Xproduces an indifferent composer or performer, that is regarded
  1193. Xelsewhere as perfectly normal and natural; but if foreign students of
  1194. Xmusical history have to acknowledge a British musical genius, he is
  1195. Xconsidered a freak.
  1196. X@PP
  1197. XSuch a freak is Henry Purcell.  Yet if we make a choice of fifteen of
  1198. Xthe world's musical classics, as here, we find that we cannot omit this
  1199. XEnglish master.
  1200. X}
  1201. X//
  1202. X@LittleEndRun
  1203. X}
  1204. XIt is a large rectangle made from three smaller rectangles -- its
  1205. Xpages.  Each page is made of lines; each line is made of words,
  1206. Xalthough it makes sense for any rectangle (even a complete document) to
  1207. Xbe part of a line, provided it is not too large.
  1208. X@PP
  1209. XLout deals with something a little more complicated than rectangles:
  1210. X@I objects.  An object
  1211. Xobjec @Index { Object }
  1212. Xis a rectangle with at least one @I {column mark}
  1213. Xcolumn.mark @Index { Column mark }
  1214. Xmark.alignment @Index { Mark alignment }
  1215. Xalignment @RawIndex { Alignment @I see mark alignment }
  1216. Xprotruding above and below it, and at least one @I {row mark}
  1217. Xrow.mark @Index { Row mark }
  1218. Xprotruding to the left and right.  The simplest objects contain words like
  1219. Xmetempsychosis, and have one mark of each type:
  1220. X@ID {
  1221. X@ShowMarks metempsychosis
  1222. X}
  1223. XThe rectangle exactly encloses the word; its column mark is at the left
  1224. Xedge, and its row mark passes through the middle of the lower-case
  1225. Xletters.  The rectangle and marks do not appear on the printed page, but
  1226. Xto understand what Lout is doing you have to imagine them.
  1227. X@PP
  1228. XTo place two objects side by side, we separate them by the
  1229. Xsymbol @Code "|", which denotes the act of @I {horizontal
  1230. Xconcatenation}.  So, if we write
  1231. X@ID {
  1232. X@Code "USA  |  Australia"
  1233. X}
  1234. Xthe result will be the object
  1235. X@ID {
  1236. X@ShowMarks USA | @ShowMarks Australia
  1237. X}
  1238. XNotice that this object has two column marks, but still only one row mark,
  1239. Xbecause @Code "|" merges the two row marks
  1240. Xtogether.  This merging of row marks fixes the vertical
  1241. Xposition of each object with respect to the other, but it does not
  1242. Xdetermine how far apart they are.  This distance, or {@I gap},
  1243. Xmay be given just after the symbol, as in @Code "|0.5i" for example,
  1244. Xwhich specifies horizontal concatenation with a gap of half an inch.  If
  1245. Xno gap is given, it is assumed to be {@Code "0i"}.
  1246. X@PP
  1247. X@I {Vertical concatenation} & , denoted by the symbol {@Code "/"},
  1248. Xis the same apart from the change of direction:
  1249. X@ID {
  1250. X@Code "Australia  /0.1i  USA"
  1251. X}
  1252. Xhas result
  1253. X@ID {
  1254. X@ShowMarks Australia /0.1i
  1255. X@ShowMarks USA
  1256. X}
  1257. XThe usual merging of marks occurs, and now the gap determines the
  1258. Xvertical separation.  Horizontal and vertical can be combined:
  1259. X@ID  @Code {
  1260. X             |1m  USA         |1m  "|0.2i" |1m   Australia
  1261. X/1vx "/0.1i" |    Washington  |    "|"     |     Canberra
  1262. X}
  1263. Xhas result
  1264. X@ID {
  1265. X      @ShowMarks USA &
  1266. X      { 0 ymark moveto xsize 10 pt add ymark lineto [ 3 pt ] 0 setdash stroke }
  1267. X      @Graphic {1c @Wide }
  1268. X      |0.2i @ShowMarks Australia
  1269. X/0.1i @ShowMarks Washington  |     @ShowMarks Canberra
  1270. X}
  1271. Xtables @Index { Tables }
  1272. XThere are several things to note carefully here.  White space (including
  1273. Xtabs and newlines) adjacent to a concatenation symbol is ignored, so
  1274. Xit may be used freely to lay out the expression clearly.  The symbol
  1275. X@Code "|" takes precedence over {@Code "/"}, which means that the rows
  1276. Xare formed first, then vertically concatenated.  The symbol @Code "/" will
  1277. Xmerge two or more column marks, creating multiple
  1278. Xcolumns (and @Code "|" will merge two or more row marks).  This
  1279. Ximplies that the gap @Code "0.2i" used above is between
  1280. Xcolumns, not individual items in columns; a gap in the second row
  1281. Xwould therefore be redundant, and so is omitted.
  1282. X@PP
  1283. XA variant of @Code "/" called @Code "//" left-justifies
  1284. Xtwo objects instead of merging their marks.
  1285. X@PP
  1286. XBy enclosing an object in braces, it is possible to override the
  1287. Xbraces @Index { Braces }
  1288. Xset precedences.  Here is another expression for the table
  1289. Xabove, in which the columns are formed first:
  1290. X@ID  @Code {
  1291. X             |1m "{ USA"       |1m "/0.1i" |1m "Washington }"
  1292. X/1vx "|0.2i" |   "{ Australia" |   "/"     |   "Canberra }"
  1293. X}
  1294. XBraces have no effect other than to alter the grouping.
  1295. X@PP
  1296. X@I {Paragraph breaking} occurs when an object is too wide to fit
  1297. Xparagraph.breaking @Index { Paragraph breaking }
  1298. Xinto the space available to it; by breaking its paragraphs into lines,
  1299. Xits width is reduced to an acceptable amount.  The available
  1300. Xspace is determined by the @@Wide symbol, whose form is
  1301. X@ID  {
  1302. X@I length  @@Wide  @I object
  1303. X}
  1304. Xand whose result is the given object modified to have exactly the given
  1305. Xlength.  For example, the expression
  1306. X@ID  @Code {
  1307. X"5i @Wide {"
  1308. X"Macbeth was very ambitious.  This led him to wish to become"
  1309. X"king of Scotland.  The witches told him that this wish of"
  1310. X"his would come true.  The king of Scotland at this time was"
  1311. X"Duncan.  Encouraged by his wife, Macbeth murdered Duncan.  He"
  1312. X"was thus enabled to succeed Duncan as king.  (51 words)"
  1313. X"|0.5i"
  1314. X"Encouraged by his wife, Macbeth achieved his ambition and"
  1315. X"realized the prediction of the witches by murdering Duncan"
  1316. X"and becoming king of Scotland in his place.  (26 words)"
  1317. X"}"
  1318. X}
  1319. Xhas for its result the following five inch wide object [{@Ref strunk79}]:
  1320. X@ID {
  1321. X5i @Wide {
  1322. XMacbeth was very ambitious.  This led him to wish to become king
  1323. Xof Scotland.  The witches told him that this wish of his would
  1324. Xcome true.  The king of Scotland at this time was Duncan.  Encouraged
  1325. Xby his wife, Macbeth murdered Duncan.  He was thus enabled to succeed
  1326. XDuncan as king.  (51 words)
  1327. X|0.5i
  1328. XEncouraged by his wife, Macbeth achieved his ambition and realized
  1329. Xthe prediction of the witches by murdering Duncan and becoming king of
  1330. XScotland in his place.  (26 words)
  1331. X}
  1332. X}
  1333. XA paragraph of text can be included anywhere, and it will be broken
  1334. Xautomatically if necessary to fit the available space.  The spaces
  1335. Xbetween words are converted by Lout into concatenation symbols.
  1336. X@PP
  1337. XThese are the most significant of Lout's object-building symbols.  There
  1338. Xare others, for changing fonts, controlling paragraph breaking, printing
  1339. Xgraphical objects like boxes and circles, and so on, but
  1340. Xthey do not add anything new in principle.
  1341. X@End @Section
  1342. END_OF_FILE
  1343.   if test 6589 -ne `wc -c <'doc/tr.lout/ch1.01'`; then
  1344.     echo shar: \"'doc/tr.lout/ch1.01'\" unpacked with wrong size!
  1345.   fi
  1346.   # end of 'doc/tr.lout/ch1.01'
  1347. fi
  1348. if test -f 'doc/tr.lout/ch2.01' -a "${1}" != "-c" ; then 
  1349.   echo shar: Will not clobber existing file \"'doc/tr.lout/ch2.01'\"
  1350. else
  1351.   echo shar: Extracting \"'doc/tr.lout/ch2.01'\" \(6408 characters\)
  1352.   sed "s/^X//" >'doc/tr.lout/ch2.01' <<'END_OF_FILE'
  1353. X@Section
  1354. X  @Tag { lexical }
  1355. X  @Title { Lexical structure (words, spaces, symbols) and macros }
  1356. X@Begin
  1357. X@PP
  1358. XThe input to Lout consists of a sequence of @I {textual units},
  1359. Xtextual.unit @Index {Textual unit }
  1360. Xwhich may be
  1361. Xeither {@I{white spaces}},
  1362. X@I identifiers,
  1363. X@I delimiters,
  1364. Xor
  1365. X@I {literal words}.  Each
  1366. Xis a sequence of @I characters chosen from:
  1367. Xletter @Index { Letter character }
  1368. Xother @Index { Other character }
  1369. Xquote @Index { Quote character }
  1370. Xescape @Index { Escape character }
  1371. Xcomment.char @Index { Comment character }
  1372. X@ID @Tab
  1373. X    vmargin { 0.5vx }
  1374. X    @Fmta { @Col A ! @Col B }
  1375. X{
  1376. X@Rowa A { letter      } B { @Code "@ab-zAB-Z" }
  1377. X@Rowa A { white space } B { @I { space  tab  newline } }
  1378. X@Rowa A { quote       } B { @Code "\"" }
  1379. X@Rowa A { escape      } B { @Code "\\" }
  1380. X@Rowa A { comment     } B { @Code "#" }
  1381. X@Rowa A { other       } B { @Code "!$%&'()*+,-./0123456789:;<=>?[]^_`{|}~" }
  1382. X}
  1383. XNotice that @Code "@" is classed as a letter.  Version 2.05 of Basser
  1384. XLout accepts the accented letters of the ISO-LATIN-1 character set
  1385. X(depending on how it is installed), and these are also classed as
  1386. Xletters.  The ten digits are classed as `other' characters, and in
  1387. Xfact the `other' class contains all 8-bit characters (except octal 0)
  1388. Xnot assigned to previous classes.
  1389. X@PP
  1390. XA @I {white space} is a sequence of one or more white space characters.
  1391. Xwhite.space @Index { White space }
  1392. Xspace.f @Index { Space }
  1393. X@PP
  1394. XAn @I identifier is a sequence of one or more letters which is the name of a
  1395. Xidentifier @Index { Identifier }
  1396. Xsymbol.  It is conventional but not essential to begin identifiers with
  1397. X{@Code "@"};  Basser Lout will print a warning message if it finds an
  1398. Xunquoted literal word (see below) beginning with {@Code "@"}, since such
  1399. Xwords are usually misspelt identifiers.  The ten digits are not letters
  1400. Xand may not appear in identifiers.  The complete list of predefined
  1401. Xidentifiers is
  1402. X@ID @Code {
  1403. X{     "@Begin"
  1404. X  @JL "@Break"
  1405. X  @JL "@Case"
  1406. X  @JL "@Char"
  1407. X  @JL "@Database"
  1408. X  @JL "@End"
  1409. X  @JL "@Font"
  1410. X  @JL "@Galley"
  1411. X  @JL "@Graphic"
  1412. X  @JL "@HAdjust"
  1413. X  @JL "@HContract"
  1414. X  @JL "@HExpand"
  1415. X  @JL "@High"
  1416. X  @JL "@HScale"
  1417. X  @JL "@Include"
  1418. X} |4.4cx {
  1419. X      "@IncludeGraphic"
  1420. X  @JL "@Key"
  1421. X  @JL "@LClos"
  1422. X  @JL "@LEnv"
  1423. X  @JL "@LInput"
  1424. X  @JL "@LVis"
  1425. X  @JL "@Moment"
  1426. X  @JL "@Next"
  1427. X  @JL "@Null"
  1428. X  @JL "@OneCol"
  1429. X  @JL "@OneRow"
  1430. X  @JL "@Open"
  1431. X  @JL "@PAdjust"
  1432. X  @JL "@PrependGraphic"
  1433. X  @JL "@Rotate"
  1434. X} |4.4cx {
  1435. X      "@Scale"
  1436. X  @JL "@Space"
  1437. X  @JL "@SysDatabase"
  1438. X  @JL "@SysInclude"
  1439. X  @JL "@SysIncludeGraphic"
  1440. X  @JL "@SysPrependGraphic"
  1441. X  @JL "@Tag"
  1442. X  @JL "@Tagged"
  1443. X  @JL "@Use"
  1444. X  @JL "@VAdjust"
  1445. X  @JL "@VContract"
  1446. X  @JL "@VExpand"
  1447. X  @JL "@VScale"
  1448. X  @JL "@Wide"
  1449. X  @JL "@Yield"
  1450. X}
  1451. X}
  1452. Xplus the names of the parameters of @@Moment.  The symbols @@LClos, @@LEnv,
  1453. Xlclos@Index { @@LClos symbol }
  1454. Xlenv @Index { @@LEnv symbol }
  1455. Xlinput @Index { @@LInput symbol }
  1456. Xlvis @Index { @@LVis symbol }
  1457. X@@LInput, and @@LVis appear in cross reference databases generated by Lout
  1458. Xand are not for use elsewhere.
  1459. X@PP
  1460. XA @I delimiter is a sequence of one or more `other' characters which
  1461. Xdelimiter @Index { Delimiter }
  1462. Xis the name of a symbol.  For example, @Code "{" and @Code "//" are
  1463. Xdelimiters.  When defining a delimiter, the name must be enclosed
  1464. Xin quotes:
  1465. X@ID @Code {
  1466. X"def  \"^\"  { {}  ^&  {} }"
  1467. X}
  1468. Xbut quotes are not used when the delimiter is invoked.  A delimiter may
  1469. Xhave delimiters and any other characters adjacent, whereas identifiers
  1470. Xmay not be adjacent to letters or other identifiers.  The complete list
  1471. Xof predefined delimiters is
  1472. X@ID @Code {
  1473. X{
  1474. X      "/"
  1475. X  @JL "//"
  1476. X  @JL "^/"
  1477. X  @JL "^//"
  1478. X} |2.2cx {
  1479. X      "|"
  1480. X  @JL "||"
  1481. X  @JL "^|"
  1482. X  @JL "^||"
  1483. X} |2.2cx {
  1484. X      "&"
  1485. X  @JL "^&"
  1486. X} |2.2cx {
  1487. X      "&&"
  1488. X  @JL "{"
  1489. X  @JL "}"
  1490. X}
  1491. X}
  1492. XA longer delimiter like @Code "<=" will be recognised in
  1493. Xpreference to a shorter one like {@Code "<"}.
  1494. X@PP
  1495. XA sequence of characters which is neither a white space, an identifier, nor a
  1496. Xdelimiter, is by default a @I {literal word}, which means that it will
  1497. Xword @Index { Word }
  1498. Xliteral.word @Index { Literal word }
  1499. Xquoted.word @Index { Quoted word }
  1500. Xpass through Lout unchanged.  An arbitrary sequence of characters
  1501. Xenclosed in double quotes, for example @Code "\"{  }\"", is also a
  1502. Xliteral word.  Space characters may be included, but not tabs or
  1503. Xnewlines.  There are special character sequences, used only between
  1504. Xquotes, for obtaining otherwise inaccessible characters:
  1505. X@ID @Tab
  1506. X   vmargin { 0.5vx }
  1507. X   @Fmta { @Col A ! @Col B }
  1508. X{
  1509. X@Rowa A { @Code "\\\""   } B { produces @Code "\"" }
  1510. X@Rowa A { @Code "\\\\"   } B { "\\" }
  1511. X@Rowa A { @Code "\\ddd"  } B { the character whose ASCII code is }
  1512. X@Rowa A {                } B { the up to three digit octal number {@Code ddd} }
  1513. X}
  1514. XSo, for example, @Code "\"\\\"@PP\\\"\"" produces {@Code "\"@PP\""}.
  1515. X@PP
  1516. XWhen the comment character
  1517. Xcomment @Index { Comment }
  1518. X@Code "#" is encountered, everything from
  1519. Xthat point to the end of the line is ignored.  This is useful for
  1520. Xincluding reminders to oneself, like this:
  1521. X@ID @Code {
  1522. X"# Lout user manual"
  1523. X"# J. Kingston, June 1989"
  1524. X}
  1525. Xfor temporarily deleting parts of the document, and so on.
  1526. X@PP
  1527. X@I Macros
  1528. Xmacro @Index { Macro }
  1529. Xprovide a means of defining symbols which stand for a
  1530. Xsequence of textual units rather than an object.  For example, the macro
  1531. Xdefinition
  1532. X@ID @Code {
  1533. X"macro  @PP  {  //1.3vx  2.0f @Wide  &0i }"
  1534. X}
  1535. Xmakes Lout replace the symbol @Code "@PP" by the given textual units
  1536. Xbefore assembling its input into objects.  A similar macro to this
  1537. Xone is used to separate the paragraphs of the present document.  The
  1538. Xenclosing braces and any spaces adjacent to them are dropped, which can
  1539. Xbe a problem:  @Code "@PP2i" has result {@Code "//1.3vx 2.0f @Wide &0i2i"}
  1540. Xwhich is erroneous.
  1541. X@PP
  1542. XThe meaning of symbols used within the body of a macro is determined by
  1543. Xwhere the macro is defined, not by where it is used.  Due to implementation
  1544. Xproblems, @@Open symbols will not work within macros.  Named and body
  1545. Xparameters will work if the symbol that they are parameters of is also
  1546. Xpresent.  There is no way to get a left or right brace into the body of
  1547. Xa macro without the matching brace.
  1548. X@PP
  1549. XMacros may be nested within other definitions and exported, but they may
  1550. Xnot be parameters.  They may not have parameters or nested definitions
  1551. Xof their own, and consequently a preceding @Code export clause (Section
  1552. X{@NumberOf visibility}) would be pointless; however, an @Code import
  1553. Xclause is permitted.
  1554. X@End @Section
  1555. END_OF_FILE
  1556.   if test 6408 -ne `wc -c <'doc/tr.lout/ch2.01'`; then
  1557.     echo shar: \"'doc/tr.lout/ch2.01'\" unpacked with wrong size!
  1558.   fi
  1559.   # end of 'doc/tr.lout/ch2.01'
  1560. fi
  1561. if test -f 'doc/tr.lout/ch2.05' -a "${1}" != "-c" ; then 
  1562.   echo shar: Will not clobber existing file \"'doc/tr.lout/ch2.05'\"
  1563. else
  1564.   echo shar: Extracting \"'doc/tr.lout/ch2.05'\" \(5248 characters\)
  1565.   sed "s/^X//" >'doc/tr.lout/ch2.05' <<'END_OF_FILE'
  1566. X@Section
  1567. X   @Title { The style and size of objects }
  1568. X   @Tag { size }
  1569. X@Begin
  1570. X@PP
  1571. XThis section explains how Lout determines the style and size of each
  1572. Xobject.  Together, these attributes determine the object's final
  1573. Xappearance in the output.
  1574. Xstyle @Index { Style of an object }
  1575. X@PP
  1576. XThe style of an object comprises the following:
  1577. X@BulletList
  1578. X@ListItem { Which font family, face and size to use (also defining the
  1579. X@Code f unit); }
  1580. X@ListItem { What gap to replace a single space between two objects by (also
  1581. Xdefining the @Code s unit); }
  1582. X@ListItem { The kind of paragraph breaking to employ ({@Code adjust},
  1583. X{@Code ragged}, etc.) }
  1584. X@ListItem { What gap to insert between the lines of paragraphs
  1585. X(also defining the @Code v unit); }
  1586. X@ListItem { Whether to permit hyphenation or not. }
  1587. X@EndList
  1588. XThe style of an object depends on where it appears in the final
  1589. Xdocument.  For example, the style of a parameter depends on where it is
  1590. Xused; the style of a galley is the style of the first target that it
  1591. Xattempts to attach itself to.  Of course, the style of any object can be
  1592. Xchanged by using the @@Font, @@Space, and @@Break symbols.
  1593. X@PP
  1594. XThere are no standard default values for style.  Instead one must ensure
  1595. Xthat the root galley or each of its components is enclosed in @@Font
  1596. Xand @@Break symbols.  From there the style is passed to incoming galleys
  1597. Xand the objects within them.
  1598. X@PP
  1599. Xwidth. @Index { Width of an object }
  1600. Xheight. @Index { Height of an object }
  1601. Xsize. @Index { Size of an object }
  1602. XThe remainder of this section explains how the size of each object (its
  1603. Xwidth and height on the printed page) is determined.  We will treat width
  1604. Xonly, since height is determined in exactly the same way, except that the
  1605. Xcomplications introduced by paragraph breaking are absent.
  1606. X@PP
  1607. XWith three exceptions (see below), the width of an object is as large as
  1608. Xit possibly could be without violating a @@Wide symbol or intruding into
  1609. Xthe space occupied by neighbouring gaps or objects.  As an aid to
  1610. Xinvestigating this rule, we will use the definition
  1611. X@ID @Code {
  1612. X"def @Box right x"
  1613. X"{"
  1614. X"  \"0 0 moveto xsize 0 lineto xsize ysize lineto 0 ysize lineto closepath stroke\""
  1615. X"  @Graphic x"
  1616. X"}"
  1617. X}
  1618. Xwhich draws a box around the boundary of its right parameter (Section
  1619. X{@NumberOf graphic}).  The result of
  1620. X@ID @Code {
  1621. X"5c @Wide @Box metempsychosis"
  1622. X}
  1623. Xis
  1624. X@ID {
  1625. X5c @Wide @Box metempsychosis
  1626. X}
  1627. XThe widest that @Code "@Box metempsychosis" could possibly be is five
  1628. Xcentimetres, and accordingly that is its width.  The same applies to
  1629. X{@Code metempsychosis}, which is five centimetres wide as well.  Note
  1630. Xcarefully that there is no object in this example whose width is equal
  1631. Xto the sum of the widths of the letters of {@Code metempsychosis}.
  1632. X@PP
  1633. XThe first of the three exceptions to the `as wide as possible' rule is the
  1634. X@@HContract symbol, which causes the width of its right parameter to be
  1635. Xreduced to a reasonable minimum (a formal definition will not be attempted):
  1636. X@ID @Code {
  1637. X"5c @Wide @HContract @Box metempsychosis"
  1638. X}
  1639. Xproduces
  1640. X@ID {
  1641. X5c @Wide @HContract @Box metempsychosis
  1642. X}
  1643. XThe object @Code "@HContract @Box metempsychosis" is still five centimetres
  1644. Xwide, but the object @Code "@Box metempsychosis" has been reduced.
  1645. X@PP
  1646. XThe second of the three exceptions is the horizontal concatenation symbol
  1647. X@Code "|" (and also {@Code "&"}).  Consider this example:
  1648. X@ID @Code {
  1649. X"5c @Wide @Box { A  |1c  B  |1c  C }"
  1650. X}
  1651. XAs usual, the right parameter of @@Wide is five centimetres wide, and
  1652. Xthe result looks like this:
  1653. X@ID {
  1654. X5c @Wide @Box { A  |1c  B  |1c  C }
  1655. X}
  1656. XLout has to apportion the size minus inter-column gaps among the three
  1657. Xcolumns.
  1658. X@PP
  1659. XIf the columns are wide enough to require paragraph breaking, Lout will
  1660. Xassign sizes to the columns in such a way as to leave narrow columns
  1661. Xunbroken and break wider columns to equal width, occupying the full
  1662. Xsize.  Otherwise, paragraph breaking is not required, and each column
  1663. Xwill be assigned a reasonable minimum size in the manner of @@HContract,
  1664. Xexcept that the last column receives all the leftover width.  For example,
  1665. X@ID @Code {
  1666. X"5c @Wide { @Box A  |1c  @Box B  |1c  @Box C }"
  1667. X}
  1668. Xhas result
  1669. X@ID {
  1670. X5c @Wide { @Box A  |1c  @Box B  |1c  @Box C }
  1671. X}
  1672. XIf it is desired that the leftover width remain unused, rather than
  1673. Xgoing into the last column, an empty column can be appended, or the last
  1674. Xcolumn can be enclosed in @@HContract.  Two other ways to apportion the
  1675. Xleftover width are provided by the @@HExpand and @@HAdjust symbols
  1676. X(Sections {@NumberOf hexpand} and {@NumberOf hadjust}).
  1677. X@PP
  1678. XThe third and final exception to the `as wide as possible' rule concerns
  1679. Xthe components of the root galley.  Each is considered to be enclosed
  1680. Xroot.galley.size @SubIndex { size of components of }
  1681. Xin @@HContract and @@VContract symbols.
  1682. X@PP
  1683. XUp to this point we have treated width as a single quantity, but of
  1684. Xcourse it has two parts:  width to left and right of the mark.  The
  1685. X`as wide as possible' rule applies to both directions:
  1686. X@ID @Code {
  1687. X"@HContract { @Box 953^.05 /0.5c @Box 2^.8286 }"
  1688. X}
  1689. Xhas result
  1690. X@ID {
  1691. X@HContract { @Box 953^.05 /0.5c @Box 2^.8286 }
  1692. X}
  1693. XLeftover width usually goes to the right, as we have seen, but here some
  1694. Xwidth was available only to the left of {@Code "2.8286"} owing to the
  1695. Xcolumn mark alignment.
  1696. X@End @Section
  1697. END_OF_FILE
  1698.   if test 5248 -ne `wc -c <'doc/tr.lout/ch2.05'`; then
  1699.     echo shar: \"'doc/tr.lout/ch2.05'\" unpacked with wrong size!
  1700.   fi
  1701.   # end of 'doc/tr.lout/ch2.05'
  1702. fi
  1703. if test -f 'include/tab_prepend' -a "${1}" != "-c" ; then 
  1704.   echo shar: Will not clobber existing file \"'include/tab_prepend'\"
  1705. else
  1706.   echo shar: Extracting \"'include/tab_prepend'\" \(2912 characters\)
  1707.   sed "s/^X//" >'include/tab_prepend' <<'END_OF_FILE'
  1708. X%%BeginResource: procset LoutTabPrependGraphic
  1709. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1710. X%                                                  %
  1711. X%  PostScript @SysPrependGraphic file for @Tab     %
  1712. X%                                                  %
  1713. X%  To assist in avoiding name clashes, the names   %
  1714. X%  of all these symbols begin with "ltab".         %
  1715. X%                                                  %
  1716. X%  Jeffrey H. Kingston                             %
  1717. X%  24 September 1991                               %
  1718. X%  22 December 1992                                %
  1719. X%                                                  %
  1720. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1721. X
  1722. X% linewidth ltabhs -
  1723. X% horizontal single line
  1724. X/ltabhs
  1725. X{  0 0 moveto xsize 0 lineto
  1726. X   setlinewidth 0 setlinecap stroke
  1727. X} def
  1728. X
  1729. X% linewidth ltabhsp -
  1730. X% horizontal single line with projecting ends
  1731. X/ltabhsp
  1732. X{  0 0 moveto xsize 0 lineto
  1733. X   setlinewidth 2 setlinecap stroke
  1734. X} def
  1735. X
  1736. X% linewidth ltabhd -
  1737. X% horizontal double line
  1738. X/ltabhd
  1739. X{  dup dup
  1740. X   0 0 moveto xsize 0 lineto
  1741. X   0 exch 3 mul moveto xsize exch 3 mul lineto
  1742. X   setlinewidth 0 setlinecap stroke
  1743. X} def
  1744. X
  1745. X% linewidth ltabhdb -
  1746. X% horizontal double line below mark
  1747. X/ltabhdb
  1748. X{  dup dup
  1749. X   0 0 moveto xsize 0 lineto
  1750. X   0 exch -3 mul moveto xsize exch -3 mul lineto
  1751. X   setlinewidth 0 setlinecap stroke
  1752. X} def
  1753. X
  1754. X% linewidth ltabhdnw -
  1755. X% horizontal double line with northwest corner
  1756. X/ltabhdnw
  1757. X{  dup dup dup dup
  1758. X   0 0 moveto xsize 0 lineto
  1759. X   xsize exch 3 mul moveto
  1760. X   -3 mul exch 3 mul lineto
  1761. X   -3 mul 0 lineto
  1762. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  1763. X} def
  1764. X
  1765. X% linewidth ltabhdne -
  1766. X% horizontal double line with northeast corner
  1767. X/ltabhdne
  1768. X{  dup dup dup dup
  1769. X   0 0 moveto xsize 0 lineto
  1770. X   0 exch 3 mul moveto
  1771. X   3 mul xsize add exch 3 mul lineto
  1772. X   3 mul xsize add 0 lineto
  1773. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  1774. X} def
  1775. X
  1776. X% linewidth ltabhdsw -
  1777. X% horizontal double line with southwest corner
  1778. X/ltabhdsw
  1779. X{  dup dup dup dup
  1780. X   0 0 moveto xsize 0 lineto
  1781. X   xsize exch -3 mul moveto
  1782. X   -3 mul exch -3 mul lineto
  1783. X   -3 mul 0 lineto
  1784. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  1785. X} def
  1786. X
  1787. X% linewidth ltabhdse -
  1788. X% horizontal double line with southeast corner
  1789. X/ltabhdse
  1790. X{  dup dup dup dup
  1791. X   0 0 moveto xsize 0 lineto
  1792. X   0 exch -3 mul moveto
  1793. X   3 mul xsize add exch -3 mul lineto
  1794. X   3 mul xsize add 0 lineto
  1795. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  1796. X} def
  1797. X
  1798. X% linewidth ltabvs -
  1799. X% vertical single line
  1800. X/ltabvs
  1801. X{  0 0 moveto 0 ysize lineto
  1802. X   setlinewidth 0 setlinecap stroke
  1803. X} def
  1804. X
  1805. X% linewidth ltabvd -
  1806. X% vertical double line
  1807. X/ltabvd
  1808. X{  dup dup
  1809. X   0 0 moveto 0 ysize lineto
  1810. X   -3 mul 0 moveto -3 mul ysize lineto
  1811. X   setlinewidth 0 setlinecap stroke
  1812. X} def
  1813. X
  1814. X% linewidth ltabvdr -
  1815. X% vertical double line to right of mark
  1816. X/ltabvdr
  1817. X{  dup dup
  1818. X   0 0 moveto 0 ysize lineto
  1819. X   3 mul 0 moveto 3 mul ysize lineto
  1820. X   setlinewidth 0 setlinecap stroke
  1821. X} def
  1822. X%%EndResource
  1823. END_OF_FILE
  1824.   if test 2912 -ne `wc -c <'include/tab_prepend'`; then
  1825.     echo shar: \"'include/tab_prepend'\" unpacked with wrong size!
  1826.   fi
  1827.   # end of 'include/tab_prepend'
  1828. fi
  1829. if test -f 'z28.c' -a "${1}" != "-c" ; then 
  1830.   echo shar: Will not clobber existing file \"'z28.c'\"
  1831. else
  1832.   echo shar: Extracting \"'z28.c'\" \(8109 characters\)
  1833.   sed "s/^X//" >'z28.c' <<'END_OF_FILE'
  1834. X/*@z28.c:Error Service:ErrorInit(), ErrorSeen()@******************************/
  1835. X/*                                                                           */
  1836. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.05)       */
  1837. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1838. X/*                                                                           */
  1839. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1840. X/*  Basser Department of Computer Science                                    */
  1841. X/*  The University of Sydney 2006                                            */
  1842. X/*  AUSTRALIA                                                                */
  1843. X/*                                                                           */
  1844. X/*  This program is free software; you can redistribute it and/or modify     */
  1845. X/*  it under the terms of the GNU General Public License as published by     */
  1846. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1847. X/*  any later version.                                                       */
  1848. X/*                                                                           */
  1849. X/*  This program is distributed in the hope that it will be useful,          */
  1850. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1851. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1852. X/*  GNU General Public License for more details.                             */
  1853. X/*                                                                           */
  1854. X/*  You should have received a copy of the GNU General Public License        */
  1855. X/*  along with this program; if not, write to the Free Software              */
  1856. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1857. X/*                                                                           */
  1858. X/*  FILE:         z28.c                                                      */
  1859. X/*  MODULE:       Error Service                                              */
  1860. X/*  EXTERNS:      ErrorInit(), Error(), ErrorSeen()                          */
  1861. X/*                                                                           */
  1862. X/*****************************************************************************/
  1863. X#include "externs"
  1864. X
  1865. X#define    MAX_BLOCKS     20        /* max number of error blocks        */
  1866. X#define    MAX_ERRORS     20        /* max number of held error messages */
  1867. X
  1868. Xstatic BOOLEAN    print_block[MAX_BLOCKS];    /* TRUE if print this block  */
  1869. Xstatic int    start_block[MAX_BLOCKS];    /* first message of block    */
  1870. Xstatic char    message[MAX_ERRORS][MAX_LINE];    /* the error messages    */
  1871. Xstatic FILE    *fp = NULL;            /* file pointer of log file  */
  1872. Xstatic BOOLEAN    error_seen = FALSE;        /* TRUE after first error    */
  1873. Xstatic int    block_top = 0;            /* first free error block    */
  1874. Xstatic int    mess_top = 0;            /* first free error message  */
  1875. X
  1876. X
  1877. X/*****************************************************************************/
  1878. X/*                                                                           */
  1879. X/*  ErrorInit(str)                                                           */
  1880. X/*                                                                           */
  1881. X/*  Open log file str and initialise this module.                            */
  1882. X/*                                                                           */
  1883. X/*****************************************************************************/
  1884. X
  1885. XErrorInit(str)
  1886. XFULL_CHAR *str;
  1887. X{ if( fp != NULL )
  1888. X    Error(FATAL, no_fpos, "-e argument appears twice in command line");
  1889. X  fp = StringFOpen(str, "w");
  1890. X  if( fp == NULL )
  1891. X    Error(FATAL, no_fpos, "cannot open error file \"%s\"", str);
  1892. X} /* end ErrorInit */
  1893. X
  1894. X
  1895. X/*****************************************************************************/
  1896. X/*                                                                           */
  1897. X/*  BOOLEAN ErrorSeen()                                                      */
  1898. X/*                                                                           */
  1899. X/*  TRUE once an error has been found.                                       */
  1900. X/*                                                                           */
  1901. X/*****************************************************************************/
  1902. X
  1903. XBOOLEAN ErrorSeen()
  1904. X{ return error_seen;
  1905. X} /* end ErrorSeen */
  1906. X
  1907. X
  1908. X/*@::EnterErrorBlock(), LeaveErrorBlock()@************************************/
  1909. X/*                                                                           */
  1910. X/*  EnterErrorBlock(ok_to_print)                                             */
  1911. X/*                                                                           */
  1912. X/*  Start off a new block of error messages.  If ok_to_print, they do not    */
  1913. X/*  need to be held for a later commit.                                      */
  1914. X/*                                                                           */
  1915. X/*****************************************************************************/
  1916. X
  1917. XEnterErrorBlock(ok_to_print)
  1918. XBOOLEAN ok_to_print;
  1919. X{ if( block_top < MAX_BLOCKS )
  1920. X  { print_block[block_top] = ok_to_print;
  1921. X    start_block[block_top] = mess_top;
  1922. X    block_top++;
  1923. X  }
  1924. X  else Error(FATAL, no_fpos, "too many levels of error messages");
  1925. X} /* end EnterErrorBlock */
  1926. X
  1927. X
  1928. X/*****************************************************************************/
  1929. X/*                                                                           */
  1930. X/*  LeaveErrorBlock(commit)                                                  */
  1931. X/*                                                                           */
  1932. X/*  Finish off a block or error messages.  If commit is true, print them,    */
  1933. X/*  otherwise discard them.                                                  */
  1934. X/*                                                                           */
  1935. X/*****************************************************************************/
  1936. X
  1937. XLeaveErrorBlock(commit)
  1938. XBOOLEAN commit;
  1939. X{ int i;
  1940. X  assert( block_top > 0, "LeaveErrorBlock: no matching EnterErrorBlock!" );
  1941. X  assert( commit || !print_block[block_top - 1], "LeaveErrorBlock: commit!" );
  1942. X  if( fp == NULL )  fp = stderr;
  1943. X  if( commit )
  1944. X  { for( i = start_block[block_top - 1];  i < mess_top;  i++ )
  1945. X      fputs(message[i], fp);
  1946. X  }
  1947. X  block_top--;
  1948. X  mess_top = start_block[block_top];
  1949. X} /* end LeaveErrorBlock */
  1950. X
  1951. X
  1952. X/*@::Error()@*****************************************************************/
  1953. X/*                                                                           */
  1954. X/*  Error(etype, pos, str, p1, p2, p3, p4, p5, p6)                           */
  1955. X/*                                                                           */
  1956. X/*  Report error of type etype at position *pos in input.                    */
  1957. X/*  The error message is str with parameters p1 - p6.                        */
  1958. X/*                                                                           */
  1959. X/*****************************************************************************/
  1960. X
  1961. X/*VARARGS3*/
  1962. XError(etype, pos, str, p1, p2, p3, p4, p5, p6)
  1963. Xint etype;  FILE_POS *pos;  char *str, *p1, *p2, *p3, *p4, *p5, *p6;
  1964. X{ char val[MAX_LINE];
  1965. X  sprintf(val, str, p1, p2, p3, p4, p5, p6);
  1966. X  if( fp == NULL )  fp = stderr;
  1967. X  switch( etype )
  1968. X  {
  1969. X
  1970. X    case INTERN:
  1971. X    
  1972. X      while( block_top > 0 )  LeaveErrorBlock(TRUE);
  1973. X      fprintf(fp, "lout%s internal error: %s\n", EchoFilePos(pos), val);
  1974. X#if DEBUG_ON
  1975. X      abort();
  1976. X#else
  1977. X      exit(1);
  1978. X#endif
  1979. X      break;
  1980. X
  1981. X
  1982. X    case FATAL:
  1983. X    
  1984. X      while( block_top > 0 )  LeaveErrorBlock(TRUE);
  1985. X      fprintf(fp, "lout%s fatal error: %s\n", EchoFilePos(pos), val);
  1986. X      exit(1);
  1987. X      break;
  1988. X
  1989. X
  1990. X    case WARN:
  1991. X    
  1992. X      if( block_top == 0 || print_block[block_top - 1] )
  1993. X    fprintf(fp, "lout%s: %s\n", EchoFilePos(pos), val);
  1994. X      else if( mess_top < MAX_ERRORS )
  1995. X    sprintf(message[mess_top++], "lout%s: %s\n", EchoFilePos(pos), val);
  1996. X      else Error(FATAL, pos, "too many error messages");
  1997. X      error_seen = TRUE;
  1998. X      break;
  1999. X
  2000. X
  2001. X    default:
  2002. X    
  2003. X      Error(INTERN, no_fpos, "invalid error type");
  2004. X      exit(1);
  2005. X      break;
  2006. X
  2007. X  }
  2008. X} /* end Error */
  2009. END_OF_FILE
  2010.   if test 8109 -ne `wc -c <'z28.c'`; then
  2011.     echo shar: \"'z28.c'\" unpacked with wrong size!
  2012.   fi
  2013.   # end of 'z28.c'
  2014. fi
  2015. if test -f 'z32.c' -a "${1}" != "-c" ; then 
  2016.   echo shar: Will not clobber existing file \"'z32.c'\"
  2017. else
  2018.   echo shar: Extracting \"'z32.c'\" \(5104 characters\)
  2019.   sed "s/^X//" >'z32.c' <<'END_OF_FILE'
  2020. X/*@z32.c:Counter Service:Next()@**********************************************/
  2021. X/*                                                                           */
  2022. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.05)       */
  2023. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  2024. X/*                                                                           */
  2025. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  2026. X/*  Basser Department of Computer Science                                    */
  2027. X/*  The University of Sydney 2006                                            */
  2028. X/*  AUSTRALIA                                                                */
  2029. X/*                                                                           */
  2030. X/*  This program is free software; you can redistribute it and/or modify     */
  2031. X/*  it under the terms of the GNU General Public License as published by     */
  2032. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  2033. X/*  any later version.                                                       */
  2034. X/*                                                                           */
  2035. X/*  This program is distributed in the hope that it will be useful,          */
  2036. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  2037. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  2038. X/*  GNU General Public License for more details.                             */
  2039. X/*                                                                           */
  2040. X/*  You should have received a copy of the GNU General Public License        */
  2041. X/*  along with this program; if not, write to the Free Software              */
  2042. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  2043. X/*                                                                           */
  2044. X/*  FILE:         z32.c                                                      */
  2045. X/*  MODULE:       Counter Service                                            */
  2046. X/*  EXTERNS:      Next()                                                     */
  2047. X/*                                                                           */
  2048. X/*****************************************************************************/
  2049. X#include "externs"
  2050. X
  2051. X/*****************************************************************************/
  2052. X/*                                                                           */
  2053. X/*  OBJECT Next(x, inc, done)                                                */
  2054. X/*                                                                           */
  2055. X/*  Return x with its value incremented by inc (if possible).                */
  2056. X/*  Set *done to TRUE if successful, leave *done unchanged otherwise.        */
  2057. X/*                                                                           */
  2058. X/*****************************************************************************/
  2059. X
  2060. XOBJECT Next(x, inc, done)
  2061. XOBJECT x; int inc; BOOLEAN *done;
  2062. X{ OBJECT y, link;  int l, r, n, len;
  2063. X  FULL_CHAR buff[MAX_LINE + 1];
  2064. X  debug3(DCS, DD, "Next( %s, %d, %s )", EchoObject(x), inc, bool(*done));
  2065. X  switch( type(x) )
  2066. X  {
  2067. X    case WORD:
  2068. X    case QWORD:
  2069. X    
  2070. X      len = StringLength(string(x));
  2071. X      for( r = len - 1;  r >= 0 && !decimaldigit(string(x)[r]);  r--);
  2072. X      if( r < 0 ) break;
  2073. X      for( l = r-1;  l >= 0 && decimaldigit(string(x)[l]);  l-- );
  2074. X      sscanf( (char *) &string(x)[l+1], "%d", &n);
  2075. X      string(x)[l+1] = '\0';
  2076. X      StringCopy(buff, string(x));
  2077. X      StringCat(buff, StringInt(n+inc));
  2078. X      StringCat(buff, &string(x)[r+1]);
  2079. X      if( StringLength(buff) >= MAX_LINE )
  2080. X    Error(FATAL, &fpos(x), "word %s is too long", buff);
  2081. X      y = MakeWord(type(x), buff, &fpos(x));
  2082. X      word_font(y) = word_font(x);
  2083. X      MergeNode(y, x);  x = y;
  2084. X      *done = TRUE;
  2085. X      break;
  2086. X
  2087. X
  2088. X    case INCGRAPHIC:
  2089. X    case SINCGRAPHIC:
  2090. X    case GAP_OBJ:
  2091. X    case CLOSURE:
  2092. X    case NULL_CLOS:
  2093. X    case CROSS:
  2094. X    
  2095. X      break;
  2096. X
  2097. X
  2098. X    case ONE_COL:
  2099. X    case ONE_ROW:
  2100. X    case WIDE:
  2101. X    case HIGH:
  2102. X    case HCONTRACT:
  2103. X    case VCONTRACT:
  2104. X    case HEXPAND:
  2105. X    case VEXPAND:
  2106. X    case PADJUST:
  2107. X    case HADJUST:
  2108. X    case VADJUST:
  2109. X    case HSCALE:
  2110. X    case VSCALE:
  2111. X    case ROTATE:
  2112. X    case SCALE:
  2113. X    case SPLIT:
  2114. X    case GRAPHIC:
  2115. X    
  2116. X      Child(y, LastDown(x));
  2117. X      y = Next(y, inc, done);
  2118. X      break;
  2119. X
  2120. X
  2121. X    case ACAT:
  2122. X    
  2123. X      link = LastDown(x);
  2124. X      while( link != x && !*done )
  2125. X      {    Child(y, link);
  2126. X    if( is_index(type(y)) )  continue;
  2127. X    y = Next(y, inc, done);
  2128. X    if( !*done )  link = PrevDown(link);
  2129. X      }
  2130. X      break;
  2131. X
  2132. X
  2133. X    case COL_THR:
  2134. X    case ROW_THR:
  2135. X    case HCAT:
  2136. X    case VCAT:
  2137. X    
  2138. X      link = LastDown(x);
  2139. X      while( link != x && !*done )
  2140. X      {    Child(y, link);
  2141. X    if( is_index(type(y)) )  continue;
  2142. X    y = Next(y, inc, done);
  2143. X    if( !*done )  link = PrevDown(link);
  2144. X      }
  2145. X      break;
  2146. X
  2147. X
  2148. X    default:
  2149. X    
  2150. X      Error(INTERN,&fpos(x), "Next: type(x) = %s", Image(type(x)));
  2151. X      break;
  2152. X
  2153. X  } /* end switch */
  2154. X  debug1(DCS, DD, "Next returning %s", EchoObject(x));
  2155. X  return x;
  2156. X} /* end Next */
  2157. END_OF_FILE
  2158.   if test 5104 -ne `wc -c <'z32.c'`; then
  2159.     echo shar: \"'z32.c'\" unpacked with wrong size!
  2160.   fi
  2161.   # end of 'z32.c'
  2162. fi
  2163. echo shar: End of archive 30 \(of 35\).
  2164. cp /dev/null ark30isdone
  2165. MISSING=""
  2166. 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 31 32 33 34 35 ; do
  2167.     if test ! -f ark${I}isdone ; then
  2168.     MISSING="${MISSING} ${I}"
  2169.     fi
  2170. done
  2171. if test "${MISSING}" = "" ; then
  2172.     echo You have unpacked all 35 archives.
  2173.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2174. else
  2175.     echo You still must unpack the following archives:
  2176.     echo "        " ${MISSING}
  2177. fi
  2178. exit 0
  2179. exit 0 # Just in case...
  2180.