home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / lout / part04 < prev    next >
Encoding:
Text File  |  1993-05-31  |  83.4 KB  |  2,560 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v37i102:  lout - Lout document formatting system, v2, Part04/30
  4. Message-ID: <1993May31.035157.20729@sparky.imd.sterling.com>
  5. X-Md4-Signature: 04f5db9ba51da692bf13e07e82d61fe0
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Mon, 31 May 1993 03:51:57 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 37, Issue 102
  13. Archive-name: lout/part04
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lout/doc/tr.eq/outfile.ps.A lout/doc/tr.impl/s5.0
  21. #   lout/z10.c
  22. # Wrapped by kent@sparky on Sun May 30 19:43:54 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 4 (of 30)."'
  26. if test -f 'lout/doc/tr.eq/outfile.ps.A' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'lout/doc/tr.eq/outfile.ps.A'\"
  28. else
  29.   echo shar: Extracting \"'lout/doc/tr.eq/outfile.ps.A'\" \(54341 characters\)
  30.   sed "s/^X//" >'lout/doc/tr.eq/outfile.ps.A' <<'END_OF_FILE'
  31. X%!PS-Adobe-3.0
  32. X%%Creator: Basser Lout Version 2.03 (April 1993)
  33. X%%CreationDate: Fri Apr 23 09:09:42 1993
  34. X%%DocumentNeededResources: (atend)
  35. X%%Pages: (atend)
  36. X%%BoundingBox: 0 0 595 841
  37. X%%EndComments
  38. X%%BeginProlog
  39. X%%BeginResource: procset LoutStartUp
  40. X/fnt { exch findfont exch scalefont setfont } def
  41. X/x { currentpoint exch pop moveto } def
  42. X/s { show } def
  43. X/in { 1440 mul } def
  44. X/cm { 567 mul } def
  45. X/pt { 20 mul } def
  46. X/em { 120 mul } def
  47. X/sp { louts mul } def
  48. X/vs { loutv mul } def
  49. X/ft { loutf mul } def
  50. X/dg {           } def
  51. X/loutgr {
  52. X  /louts exch def
  53. X  /loutv exch def
  54. X  /loutf exch def
  55. X  /ymark exch def
  56. X  /xmark exch def
  57. X  /ysize exch def
  58. X  /xsize exch def
  59. X} def
  60. X/BeginEPSF {
  61. X  /LoutEPSFState save def
  62. X  /dict_count countdictstack def
  63. X  /op_count count 1 sub def
  64. X  userdict begin
  65. X  /showpage { } def
  66. X  0 setgray 0 setlinecap
  67. X  1 setlinewidth 0 setlinejoin
  68. X  10 setmiterlimit [] 0 setdash newpath
  69. X  /languagelevel where
  70. X  { pop languagelevel
  71. X    1 ne
  72. X    { false setstrokeadjust false setoverprint
  73. X    } if
  74. X  } if
  75. X} bind def
  76. X/EndEPSF {
  77. X  count op_count sub { pop } repeat
  78. X  countdictstack dict_count sub { end } repeat
  79. X  LoutEPSFState restore
  80. X} bind def
  81. X%%EndResource
  82. X%%BeginResource: procset LoutTabPrependGraphic
  83. X
  84. X% @PrependGraphic file /usr/staff/jeff/lout.lib/include/tab_prepend
  85. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  86. X%                                                  %
  87. X%  PostScript @SysPrependGraphic file for @Tab     %
  88. X%                                                  %
  89. X%  To assist in avoiding name clashes, the names   %
  90. X%  of all these symbols begin with "ltab".         %
  91. X%                                                  %
  92. X%  Jeffrey H. Kingston                             %
  93. X%  24 September 1991                               %
  94. X%  22 December 1992                                %
  95. X%                                                  %
  96. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  97. X
  98. X% linewidth ltabhs -
  99. X% horizontal single line
  100. X/ltabhs
  101. X{  0 0 moveto xsize 0 lineto
  102. X   setlinewidth 0 setlinecap stroke
  103. X} def
  104. X
  105. X% linewidth ltabhsp -
  106. X% horizontal single line with projecting ends
  107. X/ltabhsp
  108. X{  0 0 moveto xsize 0 lineto
  109. X   setlinewidth 2 setlinecap stroke
  110. X} def
  111. X
  112. X% linewidth ltabhd -
  113. X% horizontal double line
  114. X/ltabhd
  115. X{  dup dup
  116. X   0 0 moveto xsize 0 lineto
  117. X   0 exch 3 mul moveto xsize exch 3 mul lineto
  118. X   setlinewidth 0 setlinecap stroke
  119. X} def
  120. X
  121. X% linewidth ltabhdb -
  122. X% horizontal double line below mark
  123. X/ltabhdb
  124. X{  dup dup
  125. X   0 0 moveto xsize 0 lineto
  126. X   0 exch -3 mul moveto xsize exch -3 mul lineto
  127. X   setlinewidth 0 setlinecap stroke
  128. X} def
  129. X
  130. X% linewidth ltabhdnw -
  131. X% horizontal double line with northwest corner
  132. X/ltabhdnw
  133. X{  dup dup dup dup
  134. X   0 0 moveto xsize 0 lineto
  135. X   xsize exch 3 mul moveto
  136. X   -3 mul exch 3 mul lineto
  137. X   -3 mul 0 lineto
  138. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  139. X} def
  140. X
  141. X% linewidth ltabhdne -
  142. X% horizontal double line with northeast corner
  143. X/ltabhdne
  144. X{  dup dup dup dup
  145. X   0 0 moveto xsize 0 lineto
  146. X   0 exch 3 mul moveto
  147. X   3 mul xsize add exch 3 mul lineto
  148. X   3 mul xsize add 0 lineto
  149. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  150. X} def
  151. X
  152. X% linewidth ltabhdsw -
  153. X% horizontal double line with southwest corner
  154. X/ltabhdsw
  155. X{  dup dup dup dup
  156. X   0 0 moveto xsize 0 lineto
  157. X   xsize exch -3 mul moveto
  158. X   -3 mul exch -3 mul lineto
  159. X   -3 mul 0 lineto
  160. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  161. X} def
  162. X
  163. X% linewidth ltabhdse -
  164. X% horizontal double line with southeast corner
  165. X/ltabhdse
  166. X{  dup dup dup dup
  167. X   0 0 moveto xsize 0 lineto
  168. X   0 exch -3 mul moveto
  169. X   3 mul xsize add exch -3 mul lineto
  170. X   3 mul xsize add 0 lineto
  171. X   setlinewidth 0 setlinejoin 2 setlinecap stroke
  172. X} def
  173. X
  174. X% linewidth ltabvs -
  175. X% vertical single line
  176. X/ltabvs
  177. X{  0 0 moveto 0 ysize lineto
  178. X   setlinewidth 0 setlinecap stroke
  179. X} def
  180. X
  181. X% linewidth ltabvd -
  182. X% vertical double line
  183. X/ltabvd
  184. X{  dup dup
  185. X   0 0 moveto 0 ysize lineto
  186. X   -3 mul 0 moveto -3 mul ysize lineto
  187. X   setlinewidth 0 setlinecap stroke
  188. X} def
  189. X
  190. X% linewidth ltabvdr -
  191. X% vertical double line to right of mark
  192. X/ltabvdr
  193. X{  dup dup
  194. X   0 0 moveto 0 ysize lineto
  195. X   3 mul 0 moveto 3 mul ysize lineto
  196. X   setlinewidth 0 setlinecap stroke
  197. X} def
  198. X%%EndResource
  199. X%%BeginResource: procset LoutFigPrependGraphic
  200. X
  201. X% @PrependGraphic file /usr/staff/jeff/lout.lib/include/fig_prepend
  202. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  203. X%                                                                    %
  204. X%  PostScript @SysPrependGraphic file for @Fig  Jeffrey H. Kingston  %
  205. X%  Version 2.0 (includes CIRCUM label)                 January 1992  %
  206. X%                                                                    %
  207. X%  To assist in avoiding name clashes, the names of all symbols      %
  208. X%  defined here begin with "lfig".  However, this is not feasible    %
  209. X%  with user-defined labels and some labels used by users.           %
  210. X%                                                                    %
  211. X%  <point>      is two numbers, a point.                             %
  212. X%  <length>     is one number, a length                              %
  213. X%  <angle>      is one number, an angle in degrees                   %
  214. X%  <dashlength> is one number, the preferred length of a dash        %
  215. X%                                                                    %
  216. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  217. X
  218. Xerrordict begin
  219. X   /handleerror
  220. X   {
  221. X      {  /Times-Roman findfont 8 pt scalefont setfont
  222. X     0 setgray 4 pt 4 pt moveto
  223. X     $error /errorname get
  224. X     dup lfigdict exch known
  225. X     { lfigdict exch get }
  226. X     { 30 string cvs } ifelse
  227. X     show
  228. X     (  Command: ) show
  229. X     $error /command get 30 string cvs show
  230. X      } stopped {} if
  231. X      showpage stop
  232. X   } def
  233. Xend
  234. X
  235. X% concat strings: <string> <string> lfigconcat <string>
  236. X% must be defined outside lfigdict since used in lfigpromotelabels
  237. X/lfigconcat
  238. X{ 2 copy length exch length add string
  239. X  dup 0 4 index putinterval
  240. X  dup 3 index length 3 index putinterval
  241. X  3 1 roll pop pop
  242. X} def
  243. X
  244. X% <string> lfigdebugprint -
  245. X% must be defined outside lfigdict since used in arbitrary places
  246. X% /lfigdebugprint
  247. X% { print
  248. X%   (;  operand stack:\n) print
  249. X%   count copy
  250. X%   count 2 idiv
  251. X%   { ==
  252. X%     (\n) print
  253. X%   } repeat
  254. X%   (\n) print
  255. X% } def
  256. X
  257. X/lfigdict 120 dict def
  258. Xlfigdict begin
  259. X
  260. X% error messages
  261. X/dictfull (dictfull error:  too many labels?) def
  262. X/dictstackoverflow (dictstackoverflow error:  labels nested too deeply?) def
  263. X/execstackoverflow (execstackoverflow error:  figure nested too deeply?) def
  264. X/limitcheck (limitcheck error:  figure nested too deeply or too large?) def
  265. X/syntaxerror (syntaxerror error:  syntax error in text of figure?) def
  266. X/typecheck (typecheck error:  syntax error in text of figure?) def
  267. X/undefined (undefined error:  unknown or misspelt label?) def
  268. X/VMError (VMError error:  run out of memory?) def
  269. X
  270. X% push pi onto stack:  - lfigpi <num>
  271. X/lfigpi 3.14159 def
  272. X
  273. X% arc directions
  274. X/clockwise     false def
  275. X/anticlockwise true  def
  276. X
  277. X% maximum of two numbers:  <num> <num> lfigmax <num>
  278. X/lfigmax { 2 copy gt { pop } { exch pop } ifelse } def
  279. X
  280. X% minimum of two numbers:  <num> <num> lfigmin <num>
  281. X/lfigmin { 2 copy lt { pop } { exch pop } ifelse } def
  282. X
  283. X% add two points:  <point> <point> lfigpadd <point>
  284. X/lfigpadd { exch 3 1 roll add 3 1 roll add exch } def
  285. X
  286. X% subtract first point from second:  <point> <point> lfigpsub <point>
  287. X/lfigpsub { 3 2 roll sub 3 1 roll exch sub exch } def
  288. X
  289. X% max two points:  <point> <point> lfigpmax <point>
  290. X/lfigpmax { exch 3 1 roll lfigmax 3 1 roll lfigmax exch } def
  291. X
  292. X% min two points:  <point> <point> lfigpmin <point>
  293. X/lfigpmin { exch 3 1 roll lfigmin 3 1 roll lfigmin exch } def
  294. X
  295. X% scalar multiplication: <point> <num> lfigpmul <point>
  296. X/lfigpmul { dup 3 1 roll mul 3 1 roll mul exch } def
  297. X
  298. X% point at angle and distance:  <point> <length> <angle> lfigatangle <point>
  299. X/lfigatangle { 2 copy cos mul 3 1 roll sin mul lfigpadd } def
  300. X
  301. X% angle from one point to another:  <point> <point> lfigangle <angle>
  302. X/lfigangle { lfigpsub 2 copy 0 eq exch 0 eq and {pop} {exch atan} ifelse } def
  303. X
  304. X% distance between two points:  <point> <point> lfigdistance <length>
  305. X/lfigdistance { lfigpsub dup mul exch dup mul add sqrt } def
  306. X
  307. X% difference in x coords: <point> <point> lfigxdistance <length>
  308. X/lfigxdistance { pop 3 1 roll pop sub } def
  309. X
  310. X%difference in y coords: <point> <point> lfigydistance <length>
  311. X/lfigydistance { 3 1 roll pop sub exch pop } def
  312. X
  313. X% stroke a solid line:  <length> <dashlength> lfigsolid -
  314. X/lfigsolid
  315. X{  pop pop [] 0 setdash stroke
  316. X} def
  317. X
  318. X% stroke a lfigdashed line:   <length> <dashlength> lfigdashed -
  319. X/lfigdashed
  320. X{  2 copy div 2 le 1 index 0 le or
  321. X   {  exch pop 1 pt lfigmax [ exch dup ] 0 setdash }
  322. X   {  dup [ exch 4 2 roll 2 copy div
  323. X      1 sub 2 div ceiling dup 4 1 roll
  324. X      1 add mul sub exch div ] 0 setdash
  325. X   } ifelse stroke
  326. X} def
  327. X
  328. X% stroke a lfigcdashed line:  <length> <dashlength> lfigcdashed -
  329. X/lfigcdashed
  330. X{  2 copy le 1 index 0 le or
  331. X   {  exch pop 1 pt lfigmax [ exch dup ] copy 0 get 2 div setdash }
  332. X   { dup [ 4 2 roll exch 2 copy exch div
  333. X     2 div ceiling div 1 index sub
  334. X     ] exch 2 div setdash
  335. X   } ifelse stroke
  336. X} def
  337. X
  338. X% stroke a dotted line:  <length> <dashlength> lfigdotted -
  339. X/lfigdotted
  340. X{  dup 0 le
  341. X   {  exch pop 1 pt lfigmax [ exch 0 exch ] 0 setdash }
  342. X   { 1 index exch div ceiling div
  343. X     [ 0 3 2 roll ] 0 setdash
  344. X   } ifelse stroke
  345. X} def
  346. X
  347. X% stroke a noline line:  <length> <dashlength> lfignoline -
  348. X/lfignoline
  349. X{ pop pop
  350. X} def
  351. X
  352. X% painting (i.e. filling): - lfigwhite - (etc.)
  353. X/lfigwhite   { 1.0  setgray fill } def
  354. X/lfiglight   { 0.95 setgray fill } def
  355. X/lfiggrey    { 0.9  setgray fill } def
  356. X/lfiggray    { 0.9  setgray fill } def
  357. X/lfigdark    { 0.7  setgray fill } def
  358. X/lfigblack   { 0.0  setgray fill } def
  359. X/lfignopaint {                   } def
  360. X
  361. X% line caps (and joins, not currently used)
  362. X/lfigbutt       0 def
  363. X/lfiground      1 def
  364. X/lfigprojecting 2 def
  365. X/lfigmiter      0 def
  366. X/lfigbevel      2 def
  367. X
  368. X% shape and labels of the @Box symbol
  369. X/lfigbox
  370. X{
  371. X   0     0     /SW  lfigpointdef
  372. X   xsize 0     /SE  lfigpointdef
  373. X   xsize ysize /NE  lfigpointdef
  374. X   0     ysize /NW  lfigpointdef
  375. X   SE 0.5 lfigpmul /S   lfigpointdef
  376. X   NW 0.5 lfigpmul /W   lfigpointdef
  377. X   W SE lfigpadd   /E   lfigpointdef
  378. X   S NW lfigpadd   /N   lfigpointdef
  379. X   NE 0.5 lfigpmul /CTR lfigpointdef
  380. X   [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef
  381. X   SW SE NE NW SW
  382. X} def
  383. X
  384. X% shape and labels of the @Square symbol
  385. X/lfigsquare
  386. X{
  387. X   xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  388. X   CTR xsize xsize ysize ysize lfigpmax 0.5 lfigpmul lfigpadd /NE lfigpointdef
  389. X   CTR 0 0 CTR NE lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef
  390. X   CTR 0 0 CTR NE lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef
  391. X   CTR 0 0 CTR NE lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef
  392. X   SW 0.5 lfigpmul SE 0.5 lfigpmul lfigpadd /S lfigpointdef
  393. X   NW 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /N lfigpointdef
  394. X   SW 0.5 lfigpmul NW 0.5 lfigpmul lfigpadd /W lfigpointdef
  395. X   SE 0.5 lfigpmul NE 0.5 lfigpmul lfigpadd /E lfigpointdef
  396. X   [ CTR NE lfigpsub /lfigboxcircum cvx ] lfigcircumdef
  397. X   SW SE NE NW SW
  398. X} def
  399. X
  400. X% shape and labels of the @Diamond symbol
  401. X/lfigdiamond
  402. X{
  403. X   xsize 0 0.5 lfigpmul /S   lfigpointdef
  404. X   0 ysize 0.5 lfigpmul /W   lfigpointdef
  405. X   S W         lfigpadd /CTR lfigpointdef
  406. X   CTR W       lfigpadd /N   lfigpointdef
  407. X   CTR S       lfigpadd /E   lfigpointdef
  408. X   [ xsize ysize 0.5 lfigpmul /lfigdiamondcircum cvx ] lfigcircumdef
  409. X   S E N W S
  410. X} def
  411. X
  412. X% shape and labels of the @Ellipse symbol
  413. X/lfigellipse
  414. X{
  415. X   xsize 0 0.5 lfigpmul /S   lfigpointdef
  416. X   0 ysize 0.5 lfigpmul /W   lfigpointdef
  417. X   S W         lfigpadd /CTR lfigpointdef
  418. X   CTR W       lfigpadd /N   lfigpointdef
  419. X   CTR S       lfigpadd /E   lfigpointdef
  420. X   CTR xsize 0 0.3536 lfigpmul lfigpadd 0 ysize 0.3536 lfigpmul lfigpadd /NE lfigpointdef
  421. X   0 ysize 0.3536 lfigpmul CTR xsize 0 0.3536 lfigpmul lfigpadd lfigpsub /SE lfigpointdef
  422. X   xsize 0 0.3536 lfigpmul CTR lfigpsub 0 ysize 0.3536 lfigpmul lfigpadd /NW lfigpointdef
  423. X   0 ysize 0.3536 lfigpmul xsize 0 0.3536 lfigpmul CTR lfigpsub lfigpsub /SW lfigpointdef
  424. X   [ xsize ysize 0.5 lfigpmul /lfigellipsecircum cvx ] lfigcircumdef
  425. X   S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
  426. X} def
  427. X
  428. X% shape and labels of the @Circle symbol
  429. X/lfigcircle
  430. X{
  431. X   xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  432. X   CTR xsize 0 ysize 0 lfigpmax 0.5 lfigpmul lfigpadd /E lfigpointdef
  433. X   CTR 0 0 CTR E lfigdistance 45 lfigatangle lfigpadd /NE lfigpointdef
  434. X   CTR 0 0 CTR E lfigdistance 90 lfigatangle lfigpadd /N lfigpointdef
  435. X   CTR 0 0 CTR E lfigdistance 135 lfigatangle lfigpadd /NW lfigpointdef
  436. X   CTR 0 0 CTR E lfigdistance 180 lfigatangle lfigpadd /W lfigpointdef
  437. X   CTR 0 0 CTR E lfigdistance 225 lfigatangle lfigpadd /SW lfigpointdef
  438. X   CTR 0 0 CTR E lfigdistance 270 lfigatangle lfigpadd /S lfigpointdef
  439. X   CTR 0 0 CTR E lfigdistance 315 lfigatangle lfigpadd /SE lfigpointdef
  440. X   [ S E lfigpsub /lfigellipsecircum cvx ] lfigcircumdef
  441. X   S [ CTR ] E [ CTR ] N [ CTR ] W [ CTR ] S
  442. X} def
  443. X
  444. X% shape and labels of the @HLine and @HArrow symbols
  445. X/lfighline
  446. X{
  447. X   0 ymark lfigprevious /FROM lfigpointdef
  448. X   xsize ymark lfigprevious /TO lfigpointdef
  449. X} def
  450. X
  451. X% shape and labels of the @VLine and @VArrow symbols
  452. X/lfigvline
  453. X{
  454. X   xmark ysize lfigprevious /FROM lfigpointdef
  455. X   xmark 0 lfigprevious /TO lfigpointdef
  456. X} def
  457. X
  458. X% points of a polygon around base with given no of sides, vert init angle:
  459. X% <sides> <angle> figpolygon <point> ... <point>
  460. X/lfigpolygon
  461. X{  xsize ysize 0.5 lfigpmul /CTR lfigpointdef
  462. X   90 sub CTR 2 copy lfigmax 5 3 roll
  463. X   [ 4 copy pop /lfigpolycircum cvx ] lfigcircumdef
  464. X   exch dup 360 exch div exch
  465. X   1 1  3 2 roll
  466. X   {  4 string cvs (P) exch lfigconcat cvn
  467. X      6 copy pop pop lfigatangle 2 copy 10 2 roll
  468. X      3 2 roll lfigpointdef
  469. X      dup 3 1 roll add exch
  470. X   }  for
  471. X   pop lfigatangle
  472. X} def
  473. X
  474. X% next array element:  <array> <index> lfiggetnext <array> <index> <any> true
  475. X%                                               or <array> <index> false
  476. X/lfiggetnext
  477. X{  2 copy exch length ge
  478. X   { false }
  479. X   { 2 copy get exch 1 add exch true } ifelse
  480. X} def
  481. X
  482. X% check whether thing is number:  <any> lfigisnumbertype <any> <bool>
  483. X/lfigisnumbertype
  484. X{  dup type dup
  485. X   /integertype eq exch /realtype eq or
  486. X} def
  487. X
  488. X% check whether thing is an array:  <any> lfigisarraytype <any> <bool>
  489. X/lfigisarraytype { dup type /arraytype eq } def
  490. X
  491. X% get next item:  <array> <index> lfiggetnextitem <array> <index> 0
  492. X%                                              or <array> <index> <array> 1
  493. X%                                              or <array> <index> <point> 2
  494. X/lfiggetnextitem
  495. X{   lfiggetnext
  496. X    {    lfigisarraytype
  497. X    {   1
  498. X    }
  499. X    {   lfigisnumbertype
  500. X        {    3 1 roll
  501. X        lfiggetnext
  502. X        {   lfigisnumbertype
  503. X            {    4 3 roll exch  2
  504. X            }
  505. X            {    pop 3 2 roll pop  0
  506. X            } ifelse
  507. X        }
  508. X        {   3 2 roll pop  0
  509. X        } ifelse
  510. X        }
  511. X        {    pop 0
  512. X        } ifelse
  513. X    } ifelse
  514. X    }
  515. X    {    0
  516. X    } ifelse
  517. X} def
  518. X
  519. X% set arc path:  bool x1 y1  x2 y2  x0 y0  lfigsetarc  <angle> <angle> <dist>
  520. X% the path goes from x1 y1 to x2 y2 about centre x0 y0,
  521. X% anticlockwise if bool is true else clockwise.
  522. X% The orientations of backwards pointing and forwards pointing
  523. X% arrowheads are returned in the two angles, and
  524. X% the length of the arc is returned in <dist>.
  525. X/lfigsetarc
  526. X{
  527. X  20 dict begin
  528. X     matrix currentmatrix 8 1 roll
  529. X     2 copy translate 2 copy 8 2 roll
  530. X     4 2 roll lfigpsub 6 2 roll lfigpsub
  531. X     dup /y1 exch def dup mul /y1s exch def
  532. X     dup /x1 exch def dup mul /x1s exch def
  533. X     dup /y2 exch def dup mul /y2s exch def
  534. X     dup /x2 exch def dup mul /x2s exch def
  535. X
  536. X     y1s y2s eq
  537. X     {    -1
  538. X     }
  539. X     {    y1s x2s mul y2s x1s mul sub y1s y2s sub div
  540. X     } ifelse
  541. X     /da exch def
  542. X
  543. X     x1s x2s eq
  544. X     {    -1
  545. X     }
  546. X     {    x1s y2s mul x2s y1s mul sub x1s x2s sub div
  547. X     } ifelse
  548. X     /db exch def
  549. X
  550. X     da 0 gt db 0 gt and
  551. X     {    /LMax da sqrt db sqrt lfigmax def
  552. X    /scalex da sqrt LMax div def
  553. X    /scaley db sqrt LMax div def
  554. X    scalex scaley scale
  555. X    0 0 LMax
  556. X    0 0 x1 scalex mul y1 scaley mul lfigangle
  557. X    0 0 x2 scalex mul y2 scaley mul lfigangle
  558. X    2 copy eq { 360 add } if
  559. X    2 copy 8 2 roll
  560. X    5 index { arc } { arcn } ifelse
  561. X    2 index 1 index
  562. X    { 90 sub } { 90 add } ifelse
  563. X    dup sin scaley mul exch cos scalex mul atan
  564. X    2 index 2 index
  565. X    { 90 add } { 90 sub } ifelse
  566. X    dup sin scaley mul exch cos scalex mul atan
  567. X    5 2 roll  % res1 res2 ang1 ang2 anticlockwise
  568. X    { exch sub } { sub } ifelse
  569. X    dup 0 le { 360 add } if  lfigpi mul LMax mul 180 div
  570. X     }
  571. X     {    0 0 x1 y1 lfigdistance 0 0 x2 y2 lfigdistance eq
  572. X    0 0 x1 y1 lfigdistance 0 gt and
  573. X    {    0 0
  574. X        0 0 x1 y1 lfigdistance
  575. X        0 0 x1 y1 lfigangle
  576. X        0 0 x2 y2 lfigangle
  577. X        2 copy eq { 360 add } if
  578. X        2 copy 8 2 roll
  579. X        5 index { arc } { arcn } ifelse
  580. X        2 index 1 index
  581. X        { 90 sub } { 90 add } ifelse
  582. X        2 index 2 index
  583. X        { 90 add } { 90 sub } ifelse
  584. X        5 2 roll % res1 res2 ang1 ang2 clockwise
  585. X        { exch sub } { sub } ifelse
  586. X        dup 0 le { 360 add } if lfigpi mul 0 0 x1 y1 lfigdistance mul 180 div
  587. X    }
  588. X    {    x2 y2 lineto pop
  589. X        x2 y2 x1 y1 lfigangle
  590. X        x1 y1 x2 y2 lfigangle
  591. X        x1 y1 x2 y2 lfigdistance
  592. X    } ifelse
  593. X     } ifelse
  594. X     4 -1 roll setmatrix
  595. X   end
  596. X} def
  597. X
  598. X% lfigsetcurve: set up a Bezier curve from x0 y0 to x3 y3
  599. X% and return arrowhead angles and length of curve (actually 0)
  600. X% x0 y0 x1 y1 x2 y2 x3 y3 lfigsetcurve <angle> <angle> <length>
  601. X/lfigsetcurve
  602. X{ 8 copy curveto pop pop
  603. X  lfigangle
  604. X  5 1 roll
  605. X  4 2 roll lfigangle
  606. X  exch
  607. X  0
  608. X} def
  609. X
  610. X% lfigpaintpath: paint a path of the given shape
  611. X% /paint [ shape ] lfigpaintpath -
  612. X/lfigpaintpath
  613. X{
  614. X  10 dict begin
  615. X    0 newpath
  616. X    /prevseen false def
  617. X    /curveseen false def
  618. X    { lfiggetnextitem
  619. X      dup 0 eq { pop exit }
  620. X      { 1 eq
  621. X        { /curveseen true def
  622. X      /curve exch def
  623. X      curve length 0 eq { /curveseen false def } if
  624. X        }
  625. X        { /ycurr exch def
  626. X      /xcurr exch def
  627. X      prevseen
  628. X      { curveseen
  629. X        { curve length 4 eq
  630. X          { xprev yprev
  631. X        curve 0 get curve 1 get
  632. X        curve 2 get curve 3 get
  633. X        xcurr ycurr
  634. X        lfigsetcurve pop pop pop
  635. X          }
  636. X          { xprev yprev xcurr ycurr
  637. X            curve length 1 ge { curve 0 get } { 0 } ifelse
  638. X            curve length 2 ge { curve 1 get } { 0 } ifelse
  639. X            curve length 3 ge { curve 2 get } { true } ifelse
  640. X            7 1 roll
  641. X            lfigsetarc pop pop pop
  642. X          } ifelse
  643. X        }
  644. X        { xcurr ycurr lineto
  645. X        } ifelse
  646. X      }
  647. X      { xcurr ycurr moveto
  648. X      } ifelse
  649. X      /xprev xcurr def
  650. X      /yprev ycurr def
  651. X      /prevseen true def
  652. X      /curveseen false def
  653. X        } ifelse
  654. X      } ifelse
  655. X    } loop pop pop cvx exec
  656. X  end
  657. X} def
  658. X
  659. X% stroke a path of the given shape in the given linestyle and dash length.
  660. X% Return the origin and angle of the backward and forward arrow heads.
  661. X% dashlength /linestyle [shape] lfigdopath  [<point> <angle>] [<point> <angle>] 
  662. X/lfigdopath
  663. X{
  664. X  10 dict begin
  665. X    0
  666. X    /prevseen  false def
  667. X    /curveseen false def
  668. X    /backarrow []    def
  669. X    /fwdarrow  []    def
  670. X    {
  671. X    lfiggetnextitem
  672. X    dup 0 eq { pop exit }
  673. X    {
  674. X        1 eq
  675. X        {    /curveseen true def
  676. X        /curve exch def
  677. X        curve length 0 eq { /prevseen false def } if
  678. X        }
  679. X        {    /ycurr exch def
  680. X        /xcurr exch def
  681. X        prevseen
  682. X        {   newpath xprev yprev moveto
  683. X            curveseen
  684. X            {    curve length 4 eq
  685. X            {   xprev yprev
  686. X                curve 0 get curve 1 get
  687. X                curve 2 get curve 3 get
  688. X                xcurr ycurr lfigsetcurve
  689. X            }
  690. X            {   xprev yprev xcurr ycurr
  691. X                curve length 1 ge { curve 0 get } { 0 } ifelse
  692. X                curve length 2 ge { curve 1 get } { 0 } ifelse
  693. X                curve length 3 ge { curve 2 get } { true } ifelse
  694. X                7 1 roll
  695. X                lfigsetarc
  696. X            } ifelse
  697. X            }
  698. X            {    xcurr ycurr lineto
  699. X            xcurr ycurr xprev yprev lfigangle dup 180 sub
  700. X            xprev yprev xcurr ycurr lfigdistance
  701. X            } ifelse
  702. X            6 index 6 index cvx exec
  703. X            [ xprev yprev 5 -1 roll ]
  704. X            backarrow length 0 eq
  705. X            { /backarrow exch def }
  706. X            { pop } ifelse
  707. X            [ xcurr ycurr 4 -1 roll ] /fwdarrow exch def
  708. X        } if
  709. X        /xprev xcurr def
  710. X        /yprev ycurr def
  711. X        /prevseen true def
  712. X        /curveseen false def
  713. X        } ifelse
  714. X    } ifelse
  715. X    } loop
  716. X    pop pop pop pop
  717. X    backarrow length 0 eq { [ 0 0 0 ] } { backarrow } ifelse
  718. X    fwdarrow  length 0 eq { [ 0 0 0 ] } { fwdarrow  } ifelse
  719. X  end
  720. X} def
  721. X
  722. X% lfigdoarrow: draw an arrow head of given form
  723. X% dashlength /lstyle /pstyle hfrac height width [ <point> <angle> ] lfigdoarrow -
  724. X/lfigdoarrow
  725. X{  matrix currentmatrix 8 1 roll
  726. X   dup 0 get 1 index 1 get translate
  727. X   2 get rotate
  728. X   [ 2 index neg 2 index 0 0
  729. X     3 index 3 index neg
  730. X     1 index 10 index mul 0
  731. X     7 index 7 index ]
  732. X   4 1 roll pop pop pop
  733. X   dup 3 1 roll
  734. X   gsave lfigpaintpath grestore lfigdopath pop pop
  735. X   setmatrix
  736. X} def
  737. X
  738. X% arrow head styles
  739. X/lfigopen     0.0 def
  740. X/lfighalfopen 0.5 def
  741. X/lfigclosed   1.0 def
  742. X
  743. X% stroke no arrows, forward, back, and both
  744. X/lfignoarrow { pop pop pop pop pop pop pop pop                        } def
  745. X/lfigforward { 7 -1 roll lfigdoarrow pop                              } def
  746. X/lfigback    { 8 -2 roll pop lfigdoarrow                              } def
  747. X/lfigboth    { 8 -1 roll 7 copy lfigdoarrow pop 7 -1 roll lfigdoarrow } def
  748. X
  749. X% lfigprevious: return previous point on path
  750. X/lfigprevious
  751. X{ lfigisnumbertype
  752. X  { 2 copy }
  753. X  { lfigisarraytype
  754. X    { 2 index 2 index }
  755. X    { 0 0 }
  756. X    ifelse
  757. X  } ifelse
  758. X} def
  759. X
  760. X% label a point in 2nd top dictionary:  <point> /name lfigpointdef -
  761. X/lfigpointdef
  762. X{
  763. X  % (Entering lfigpointdef) lfigdebugprint
  764. X  [ 4 2 roll transform
  765. X    /itransform cvx ] cvx
  766. X    currentdict end
  767. X    3 1 roll
  768. X    % currentdict length currentdict maxlength lt
  769. X    % { def }
  770. X    % { exec moveto (too many labels) show stop }
  771. X    % ifelse
  772. X    def
  773. X    begin
  774. X  % (Leaving lfigpointdef) lfigdebugprint
  775. X} def
  776. X
  777. X% promote labels from second top to third top dictionary
  778. X% <string> lfigpromotelabels -
  779. X/lfigpromotelabels
  780. X{
  781. X  % (Entering lfigpromotelabels) lfigdebugprint
  782. X  currentdict end exch currentdict end
  783. X  { exch 20 string cvs 2 index
  784. X    (@) lfigconcat exch lfigconcat cvn exch def
  785. X  } forall pop begin
  786. X  % (Leaving lfigpromotelabels) lfigdebugprint
  787. X} def
  788. X
  789. X% show labels (except CIRCUM): - lfigshowlabels -
  790. X/lfigshowlabels
  791. X{
  792. X  % (Entering lfigshowlabels) lfigdebugprint
  793. X  currentdict end
  794. X    currentdict
  795. X    { 1 index 20 string cvs (CIRCUM) search % if CIRCUM in key
  796. X      { pop pop pop pop pop }
  797. X      { pop cvx exec 2 copy
  798. X        newpath 1.5 pt 0 360 arc
  799. X        0 setgray fill
  800. X        /Times-Roman findfont 8 pt scalefont setfont
  801. X        moveto 0.2 cm 0.1 cm rmoveto 20 string cvs show
  802. X      }
  803. X      ifelse
  804. X    } forall
  805. X  begin
  806. X  % (Leaving lfigshowlabels) lfigdebugprint
  807. X} def
  808. X
  809. X% fix an angle to between 0 and 360 degrees:  <angle> lfigfixangle <angle>
  810. X/lfigfixangle
  811. X{
  812. X  % (Entering lfigfixangle) lfigdebugprint
  813. X  { dup 0 ge { exit } if
  814. X    360 add
  815. X  } loop
  816. X  { dup 360 lt { exit } if
  817. X    360 sub
  818. X  } loop
  819. X  % (Leaving lfigfixangle) lfigdebugprint
  820. X} def
  821. X
  822. X% find point on circumference of box:  alpha a b lfigboxcircum x y
  823. X/lfigboxcircum
  824. X{
  825. X  % (Entering lfigboxcircum) lfigdebugprint
  826. X  4 dict begin
  827. X    /b exch def
  828. X    /a exch def
  829. X    lfigfixangle /alpha exch def
  830. X    0 0 a b lfigangle /theta exch def
  831. X
  832. X    % if alpha <= theta, return (a, a*tan(alpha))
  833. X    alpha theta le
  834. X    { a  a alpha sin mul alpha cos div }
  835. X    {
  836. X      % else if alpha <= 180 - theta, return (b*cot(alpha), b)
  837. X      alpha 180 theta sub le
  838. X      { b alpha cos mul alpha sin div  b }
  839. X      {
  840. X        % else if alpha <= 180 + theta, return (-a, -a*tan(alpha))
  841. X        alpha 180 theta add le
  842. X        { a neg  a neg alpha sin mul alpha cos div }
  843. X        {
  844. X      % else if alpha <= 360 - theta, return (-b*cot(alpha), -b)
  845. X      alpha 360 theta sub le
  846. X          { b neg alpha cos mul alpha sin div  b neg }
  847. X      {
  848. X        % else 360 - theta <= alpha, return (a, a*tan(alpha))
  849. X        a  a alpha sin mul alpha cos div
  850. X      } ifelse
  851. X        } ifelse
  852. X      } ifelse
  853. X    } ifelse
  854. X  end
  855. X  % (Leaving lfigboxcircum) lfigdebugprint
  856. X} def
  857. X
  858. X% find point on circumference of diamond:  alpha a b lfigdiamondcircum x y
  859. X/lfigdiamondcircum
  860. X{
  861. X  % (Entering lfigdiamondcircum) lfigdebugprint
  862. X  4 dict begin
  863. X    /b exch def
  864. X    /a exch def
  865. X    lfigfixangle /alpha exch def
  866. X    b alpha cos abs mul  a alpha sin abs mul  add  /denom exch def
  867. X    a b mul alpha cos mul denom div
  868. X    a b mul alpha sin mul denom div
  869. X  end
  870. X  % (Leaving lfigdiamondcircum) lfigdebugprint
  871. X} def
  872. X
  873. X% find point on circumference of ellipse:  alpha a b lfigellipsecircum x y
  874. X/lfigellipsecircum
  875. X{
  876. X  % (Entering lfigellipsecircum) lfigdebugprint
  877. X  4 dict begin
  878. X    /b exch def
  879. X    /a exch def
  880. X    lfigfixangle /alpha exch def
  881. X    b alpha cos mul dup mul  a alpha sin mul dup mul  add sqrt /denom exch def
  882. X    a b mul alpha cos mul denom div
  883. X    a b mul alpha sin mul denom div
  884. X  end
  885. X  % (Leaving lfigellipsecircum) lfigdebugprint
  886. X} def
  887. X
  888. X% find point of intersection of two lines each defined by two points
  889. X% x1 y1 x2 y2  x3 y3 x4 y4  lfiglineintersect x y
  890. X/lfiglineintersect
  891. X{
  892. X  % (Entering lfiglineintersect) lfigdebugprint
  893. X  13 dict begin
  894. X    /y4 exch def
  895. X    /x4 exch def
  896. X    /y3 exch def
  897. X    /x3 exch def
  898. X    /y2 exch def
  899. X    /x2 exch def
  900. X    /y1 exch def
  901. X    /x1 exch def
  902. X    x2 x1 sub /x21 exch def
  903. X    x4 x3 sub /x43 exch def
  904. X    y2 y1 sub /y21 exch def
  905. X    y4 y3 sub /y43 exch def
  906. X    y21 x43 mul y43 x21 mul sub /det exch def
  907. X  
  908. X    % calculate x 
  909. X    y21 x43 mul x1 mul
  910. X    y43 x21 mul x3 mul sub
  911. X    y3 y1 sub x21 mul x43 mul add
  912. X    det div
  913. X
  914. X    % calculate y
  915. X    x21 y43 mul y1 mul
  916. X    x43 y21 mul y3 mul sub
  917. X    x3 x1 sub y21 mul y43 mul add
  918. X    det neg div
  919. X
  920. X  end
  921. X  % (Leaving lfiglineintersect) lfigdebugprint
  922. X} def
  923. X
  924. X% find point on circumference of polygon
  925. X% alpha radius num theta lfigpolycircum x y
  926. X/lfigpolycircum
  927. X{
  928. X  % (Entering lfigpolycircum) lfigdebugprint
  929. X  13 dict begin
  930. X    /theta exch def
  931. X    /num exch def
  932. X    /radius exch def
  933. X    /alpha exch def
  934. X
  935. X    % calculate delta, the angle from theta to alpha
  936. X    alpha theta sub lfigfixangle
  937. X
  938. X    % calculate the angle which is the multiple of 360/num closest to delta
  939. X    360 num div div truncate 360 num div mul theta add /anglea exch def
  940. X
  941. X    % calculate the next multiple of 360/num after anglea
  942. X    anglea 360 num div add /angleb exch def
  943. X
  944. X    % intersect the line through these two points with the alpha line
  945. X    anglea cos anglea sin  angleb cos angleb sin
  946. X    0 0  alpha cos 2 mul alpha sin 2 mul
  947. X    lfiglineintersect radius lfigpmul
  948. X
  949. X  end
  950. X  % (Leaving lfigpolycircum) lfigdebugprint
  951. X} def
  952. X
  953. X% add CIRCUM operator with this body:  <array> lfigcircumdef -
  954. X/lfigcircumdef
  955. X{   % (Entering lfigcircumdef) lfigdebugprint
  956. X    /CIRCUM exch cvx
  957. X    currentdict end
  958. X    3 1 roll
  959. X    % currentdict length currentdict maxlength lt
  960. X    % { def }
  961. X    % { exec moveto (too many labels) show stop }
  962. X    % ifelse
  963. X    def
  964. X    begin
  965. X    % (Leaving lfigcircumdef) lfigdebugprint
  966. X} def
  967. X
  968. Xend
  969. X%%EndResource
  970. X
  971. X%%EndProlog
  972. X
  973. X%%Page: ? 1
  974. X%%BeginPageSetup
  975. X0.0500 dup scale 10 setlinewidth
  976. X/pgsave save def
  977. X%%EndPageSetup
  978. X
  979. X/Times-Bold 240 fnt
  980. X3365 13817 moveto(Eq)s 3718 x(\261)s 3898 x(A)s 4131 x(Lout)s 4683 x(Package)s
  981. X5594 x(for)s 5959 x(Typesetting)s 7214 x(Mathematics)s 
  982. X/Times-Italic 240 fnt
  983. X5020 13243 moveto(Jeffrey)s 5729 x(H.)s
  984. X6022 x(Kingston)s 
  985. X/Times-Roman 240 fnt
  986. X4001 12671 moveto(Basser)s 4698 x(Department)s 5886 x(of)s 6145 x(Computer)s
  987. X7162 x(Science)s 4659 12383 moveto(University)s 5728 x(of)s 5987 x(Sydney)s 6766 x(2006)s
  988. X5515 12095 moveto(Australia)s 
  989. X/Times-Italic 240 fnt
  990. X5388 11211 moveto(ABSTRACT)s 
  991. X/Times-Roman 240 fnt
  992. X2137 10755 moveto(This)s 2660 x(report)s 3328 x(describes)s
  993. X4315 x(the)s 4705 x(use)s 5122 x(of)s 5419 x(Eq,)s 5843 x(a)s
  994. X6047 x(package)s 6929 x(of)s 7226 x(de\256nitions)s 8334 x(for)s 8710 x(typesetting)s
  995. X2137 10467 moveto(mathematics)s 3404 x(with)s 3889 x(the)s 4241 x(Lout)s 4753 x(document)s
  996. X5757 x(formatter.)s 6824 x(For)s 7216 x(example,)s 
  997. X/Helvetica 220 fnt
  998. X2617 9966 moveto(@Eq { big int supp 1 on 0 ` dx over sqrt {1 - x sup 2} = pi over 2 })s 
  999. X/Times-Roman 240 fnt
  1000. X2137 9467 moveto(produces)s
  1001. X3061 x(the)s 3413 x(output)s gsave
  1002. X2617 8850 translate
  1003. X-180.0000 rotate
  1004. Xgsave
  1005. X0 -206 translate
  1006. X180.0000 rotate
  1007. X
  1008. X/Symbol 405 fnt
  1009. X0 -370 moveto(\362)s 
  1010. Xgrestore
  1011. X
  1012. Xgrestore
  1013. X
  1014. X/Symbol 405 fnt
  1015. X2617 8687 moveto(\362)s 
  1016. X/Symbol 168 fnt
  1017. X2727 9014 moveto(\061)s
  1018. X2727 8602 moveto(\060)s 
  1019. X/Times-Italic 240 fnt
  1020. X3105 8901 moveto(dx)s gsave
  1021. X2854 8850 translate
  1022. X729 0 0 0 240 288 0 loutgr
  1023. Xgsave
  1024. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1025. Xgrestore
  1026. X
  1027. Xgrestore
  1028. Xgsave
  1029. X0 8582 translate
  1030. X1.0000 1.3755 scale
  1031. X
  1032. X/Symbol 240 fnt
  1033. X2854 -60 moveto(\326)s 
  1034. Xgrestore
  1035. Xgsave
  1036. X2985 8802 translate
  1037. X598 0 0 0 240 288 0 loutgr
  1038. Xgsave
  1039. X0 0 moveto xsize 0 lineto 0.03 ft setlinewidth 2 setlinecap stroke
  1040. Xgrestore
  1041. X
  1042. Xgrestore
  1043. X
  1044. X/Symbol 240 fnt
  1045. X3028 8530 moveto(\061)s 3205 x(-)s
  1046. X
  1047. X/Symbol 168 fnt
  1048. X3499 8644 moveto(\062)s 
  1049. X/Times-Italic 240 fnt
  1050. X3393 8537 moveto(x)s 
  1051. X/Symbol 240 fnt
  1052. X3655 8790 moveto(\075)s 3858 8902 moveto(\160)s gsave
  1053. X3858 8850 translate
  1054. X131 0 0 0 240 288 0 loutgr
  1055. Xgsave
  1056. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1057. Xgrestore
  1058. X
  1059. Xgrestore
  1060. X
  1061. X/Symbol 240 fnt
  1062. X3863 8638 moveto(\062)s
  1063. X
  1064. X/Times-Roman 240 fnt
  1065. X2137 8037 moveto(The)s 2568 x(advantages)s 3690 x(of)s 3948 x(Eq)s 4273 x(include)s
  1066. X5036 x(careful)s 5757 x(attention)s 6652 x(to)s 6897 x(details)s 7579 x(of)s
  1067. X7837 x(spacing,)s 8687 x(a)s 8852 x(repertoire)s 2137 7749 moveto(of)s 2382 x(several)s
  1068. X3104 x(hundred)s 3935 x(mathematical)s 5267 x(symbols,)s 6171 x(a)s 6323 x(simple)s
  1069. X7006 x(syntax)s 7677 x(extensible)s 8692 x(by)s 8978 x(the)s 9316 x(user,)s
  1070. X2137 7461 moveto(and)s 2543 x(complete)s 3479 x(integration)s 4574 x(with)s 5059 x(the)s
  1071. X5411 x(rest)s 5815 x(of)s 6074 x(Lout.)s 2617 7087 moveto(In)s 2898 x(addition,)s
  1072. X3824 x(this)s 4251 x(report)s 4903 x(contains)s 5782 x(an)s 6090 x(appendix)s
  1073. X7050 x(describing)s 8128 x(the)s 8502 x(use)s 8903 x(of)s 9184 x(Pas,)s
  1074. X9658 x(a)s 2137 6799 moveto(package)s 2981 x(of)s 3240 x(de\256nitions)s 4310 x(for)s
  1075. X4648 x(printing)s 5465 x(Pascal)s 6135 x(programs.)s 1417 5145 moveto(22)s 1717 x(December,)s
  1076. X2819 x(1992)s 
  1077. Xpgsave restore
  1078. Xshowpage
  1079. X
  1080. X%%Page: ? 2
  1081. X%%BeginPageSetup
  1082. X0.0500 dup scale 10 setlinewidth
  1083. X/pgsave save def
  1084. X%%EndPageSetup
  1085. X
  1086. X/Times-Bold 240 fnt
  1087. X3365 14537 moveto(Eq)s 3718 x(\261)s 3898 x(A)s 4131 x(Lout)s 4683 x(Package)s
  1088. X5594 x(for)s 5959 x(Typesetting)s 7214 x(Mathematics)s 
  1089. X/Times-Italic 240 fnt
  1090. X5020 13963 moveto(Jeffrey)s 5729 x(H.)s
  1091. X6022 x(Kingston)s 
  1092. X/Times-Roman 240 fnt
  1093. X4001 13391 moveto(Basser)s 4698 x(Department)s 5886 x(of)s 6145 x(Computer)s
  1094. X7162 x(Science)s 4659 13103 moveto(University)s 5728 x(of)s 5987 x(Sydney)s 6766 x(2006)s
  1095. X5515 12815 moveto(Australia)s 
  1096. X/Times-Bold 240 fnt
  1097. X1417 12222 moveto(1.)s 1717 x(Introduction)s 
  1098. X/Times-Roman 240 fnt
  1099. X1897 11850 moveto(Eq)s 2205 x(is)s
  1100. X2406 x(a)s 2554 x(package)s 3380 x(of)s 3621 x(de\256nitions)s 4673 x(for)s
  1101. X4993 x(typesetting)s 6084 x(mathematics)s 7333 x(with)s 7800 x(the)s 8134 x(Lout)s
  1102. X8628 x(document)s 9614 x(formatter)s 1417 11562 moveto([)s 1496 x(4)s 1616 x(].)s
  1103. X1874 x(It)s 2078 x(includes)s 2934 x(several)s 3669 x(hundred)s 4513 x(mathematical)s
  1104. X5858 x(and)s 6263 x(other)s 6813 x(special)s 7535 x(characters)s 8561 x(\(including)s
  1105. X9603 x(the)s 9954 x(entire)s 1417 11274 moveto(PostScript)s 
  1106. X/Times-Roman 153 fnt
  1107. X2399 11379 moveto(1)s 
  1108. X/Times-Roman 240 fnt
  1109. X2545 11274 moveto(Symbol)s
  1110. X3360 x(font)s 3815 x([)s 3894 x(1)s 4014 x(]\),)s 4302 x(and)s
  1111. X4718 x(a)s 4894 x(smaller)s 5666 x(number)s 6467 x(of)s 6736 x(symbols)s
  1112. X7604 x(for)s 7952 x(joining)s 8700 x(objects)s 9447 x(together)s 10300 x(in)s
  1113. X1417 10986 moveto(mathematical)s 2753 x(ways.)s 3415 x(Eq)s 3731 x(is)s 3940 x(based)s
  1114. X4535 x(on)s 4825 x(the)s 5167 x(eqn)s 5563 x(language)s 6477 x(of)s
  1115. X6726 x(Kernighan)s 7786 x(and)s 8182 x(Cherry)s 8896 x([)s 8975 x(3)s
  1116. X9095 x(],)s 9284 x(with)s 9759 x(spacing)s 1417 10698 moveto(rules)s 1941 x(similar)s
  1117. X2663 x(to)s 2909 x(Knuth's)s 3740 x(T)s 3886 10650 moveto(E)s 4032 10698 moveto(X)s
  1118. X4265 x(formatter)s 5212 x([)s 5291 x(6)s 5411 x(].)s 1897 10324 moveto(To)s
  1119. X2226 x(use)s 2608 x(Eq)s 2937 x(in)s 3186 x(a)s 3355 x(Lout)s
  1120. X3870 x(document,)s 4937 x(\256rst)s 5371 x(ensure)s 6058 x(that)s 6479 x(its)s
  1121. X6767 x(de\256nition)s 7747 x(is)s 7969 x(included,)s 8916 x(either)s 9522 x(by)s
  1122. X9825 x(having)s 
  1123. X/Helvetica 220 fnt
  1124. X1417 10032 moveto(@SysInclude { eq })s 
  1125. X/Times-Roman 240 fnt
  1126. X3367 10036 moveto(in)s 3634 x(the)s 4007 x(setup)s
  1127. X4593 x(\256le,)s 5039 x(or)s 
  1128. X/Helvetica 220 fnt
  1129. X5319 10032 moveto(-ieq)s 
  1130. X/Times-Roman 240 fnt
  1131. X5765 10036 moveto(on)s 6086 x(the)s
  1132. X6459 x(command)s 7484 x(line.)s 8043 x(Then,)s 8676 x(at)s 8929 x(any)s
  1133. X9356 x(point)s 9929 x(in)s 10196 x(the)s 1417 9748 moveto(document,)s 2479 x(write)s
  1134. X
  1135. X/Helvetica 220 fnt
  1136. X3027 9744 moveto(@Eq  {  ...  })s 
  1137. X/Times-Roman 240 fnt
  1138. X4271 9748 moveto(and)s 4675 x(the)s 5025 x(symbols)s 5881 x(of)s
  1139. X6138 x(Eq)s 6462 x(will)s 6891 x(be)s 7175 x(available)s 8095 x(between)s
  1140. X8950 x(the)s 9300 x(braces.)s 10088 x(Any)s 1417 9460 moveto(symbols)s 2290 x(available)s
  1141. X3227 x(outside)s 3993 x(continue)s 4892 x(to)s 5153 x(be)s 5454 x(available)s
  1142. X6391 x(inside,)s 7097 x(which)s 7757 x(means)s 8443 x(that)s 8876 x(Eq)s
  1143. X9217 x(can)s 9624 x(be)s 9925 x(freely)s 1417 9172 moveto(mixed)s 2075 x(with)s
  1144. X2560 x(standard)s 3430 x(Lout)s 3942 x(and)s 4348 x(with)s 4833 x(symbols)s
  1145. X5691 x(from)s 6215 x(other)s 6766 x(packages,)s 7763 x(without)s 8554 x(restriction.)s
  1146. X1897 8798 moveto(In)s 2156 x(this)s 2561 x(report)s 3191 x(we)s 3530 x(show)s
  1147. X4096 x(the)s 4448 x(Lout)s 4960 x(input)s 5512 x(at)s 5744 x(the)s
  1148. X6096 x(left,)s 6533 x(and)s 6939 x(its)s 7224 x(result)s 7814 x(at)s
  1149. X8046 x(the)s 8398 x(right:)s 
  1150. X/Helvetica 220 fnt
  1151. X1897 8081 moveto(@Eq { {x sup 2 + y sup 2} over 2 })s 
  1152. X/Symbol 168 fnt
  1153. X5972 8343 moveto(\062)s 
  1154. X/Times-Italic 240 fnt
  1155. X5866 8236 moveto(x)s
  1156. X
  1157. X/Symbol 240 fnt
  1158. X6113 8229 moveto(+)s 
  1159. X/Symbol 168 fnt
  1160. X6407 8343 moveto(\062)s 
  1161. X/Times-Italic 240 fnt
  1162. X6301 8236 moveto(y)s gsave
  1163. X5866 8138 translate
  1164. X625 0 0 0 240 288 0 loutgr
  1165. Xgsave
  1166. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1167. Xgrestore
  1168. X
  1169. Xgrestore
  1170. X
  1171. X/Symbol 240 fnt
  1172. X6118 7926 moveto(\062)s 
  1173. X/Times-Roman 240 fnt
  1174. X1417 7476 moveto(Subsequent)s
  1175. X2581 x(examples)s 3544 x(will)s 3975 x(omit)s 4473 x(the)s 4825 x(enclosing)s
  1176. X
  1177. X/Helvetica 220 fnt
  1178. X5802 7472 moveto(@Eq { ... })s 
  1179. X/Times-Roman 240 fnt
  1180. X6805 7476 moveto(.)s 
  1181. X/Times-Bold 240 fnt
  1182. X1417 6683 moveto(2.)s 1717 x(Symbols)s 
  1183. X/Times-Roman 240 fnt
  1184. X1897 6311 moveto(Eq)s
  1185. X2223 x(prints)s 2827 x(characters)s 3854 x(in)s 4100 x(the)s 4452 x(fonts)s
  1186. X4990 x(appropriate)s 6138 x(for)s 6476 x(mathematics:)s 
  1187. X/Helvetica 220 fnt
  1188. X1897 5810 moveto(x - 2)s 
  1189. X/Times-Italic 240 fnt
  1190. X5866 5814 moveto(x)s
  1191. X
  1192. X/Symbol 240 fnt
  1193. X6029 5807 moveto(-)s 6217 x(\062)s 
  1194. X/Times-Roman 240 fnt
  1195. X1417 5356 moveto(Here)s 
  1196. X/Times-Italic 240 fnt
  1197. X1923 x(x)s 
  1198. X/Times-Roman 240 fnt
  1199. X2071 x(is)s
  1200. X2272 x(in)s 2500 x(Italic,)s 
  1201. X/Symbol 240 fnt
  1202. X3091 5349 moveto(\062)s 
  1203. X/Times-Roman 240 fnt
  1204. X3253 5356 moveto(is)s 3454 x(in)s
  1205. X3682 x(Roman,)s 4476 x(and)s 
  1206. X/Symbol 240 fnt
  1207. X4864 5349 moveto(-)s 
  1208. X/Times-Roman 240 fnt
  1209. X5037 5356 moveto(is)s 5238 x(from)s
  1210. X5744 x(the)s 6078 x(Symbol)s 6865 x(font.)s 7412 x(The)s 7826 x(character)s
  1211. X
  1212. X/Helvetica 220 fnt
  1213. X8742 5352 moveto(-)s 
  1214. X/Times-Roman 240 fnt
  1215. X8857 5356 moveto(is)s 9058 x(a)s 
  1216. X/Times-Italic 240 fnt
  1217. X9206 x(symbol)s 
  1218. X/Times-Roman 240 fnt
  1219. X9926 x(which)s
  1220. X1417 5068 moveto(stands)s 2075 x(for)s 
  1221. X/Symbol 240 fnt
  1222. X2413 5061 moveto(-)s 
  1223. X/Times-Roman 240 fnt
  1224. X2544 5068 moveto(,)s 2664 x(and)s
  1225. X
  1226. X/Helvetica 220 fnt
  1227. X3070 5064 moveto(2)s 
  1228. X/Times-Roman 240 fnt
  1229. X3252 5068 moveto(is)s 3471 x(also)s 3916 x(a)s 4082 x(symbol,)s
  1230. X4907 x(standing)s 5778 x(for)s 
  1231. X/Symbol 240 fnt
  1232. X6116 5061 moveto(\062)s 
  1233. X/Times-Roman 240 fnt
  1234. X6236 5068 moveto(.)s 6416 x(Eq)s
  1235. X6742 x(includes)s 7599 x(a)s 7765 x(vast)s 8210 x(number)s 9001 x(of)s
  1236. X9260 x(symbols:)s 
  1237. X/Helvetica 220 fnt
  1238. X1897 4512 moveto(Omega delta int partial club)s 
  1239. X/Symbol 240 fnt
  1240. X5866 4509 moveto(\127)s 6050 x(\144)s gsave
  1241. X6168 4569 translate
  1242. X-180.0000 rotate
  1243. Xgsave
  1244. X0 -159 translate
  1245. X180.0000 rotate
  1246. X
  1247. X/Symbol 312 fnt
  1248. X0 -285 moveto(\362)s
  1249. X
  1250. Xgrestore
  1251. X
  1252. Xgrestore
  1253. X
  1254. X/Symbol 312 fnt
  1255. X6168 4443 moveto(\362)s 
  1256. X/Symbol 240 fnt
  1257. X6253 4509 moveto(\266)s 6371 x(\247)s 
  1258. X/Times-Roman 240 fnt
  1259. X1417 3960 moveto(The)s 1849 x(summary)s
  1260. X2799 x(at)s 3031 x(the)s 3383 x(end)s 3789 x(of)s 4048 x(this)s
  1261. X4453 x(report)s 5083 x(has)s 5462 x(the)s 5814 x(complete)s 6750 x(list.)s
  1262. X1897 3586 moveto(Symbols)s 2813 x(whose)s 3503 x(names)s 4192 x(are)s 4561 x(made)s
  1263. X5157 x(from)s 5699 x(letters)s 6359 x(should)s 7076 x(be)s 7380 x(separated)s
  1264. X8360 x(from)s 8902 x(each)s 9418 x(other)s 9987 x(by)s 10305 x(at)s
  1265. X1417 3298 moveto(least)s 1914 x(one)s 2320 x(space)s 2911 x(or)s 3170 x(end)s
  1266. X3576 x(of)s 3835 x(line,)s 4313 x(as)s 4572 x(was)s 5004 x(done)s
  1267. X5530 x(above,)s 6222 x(or)s 6481 x(else)s 6912 x(Eq)s 7238 x(will)s
  1268. X7669 x(become)s 8473 x(confused:)s 
  1269. X/Helvetica 220 fnt
  1270. X1897 2791 moveto(Omegadelta)s 
  1271. X/Times-Italic 240 fnt
  1272. X5866 2795 moveto(Omegadelta)s 
  1273. X/Times-Roman 240 fnt
  1274. X1417 2292 moveto(Symbols)s
  1275. X2327 x(whose)s 3011 x(names)s 3694 x(are)s 4057 x(made)s 4647 x(from)s
  1276. X5183 x(digits)s 5786 x(and)s 6204 x(punctuation)s 7406 x(characters)s 8445 x(can,)s
  1277. X8909 x(however,)s 9865 x(be)s 10163 x(run)s gsave
  1278. X1417 1752 translate
  1279. X680 0 0 0 240 288 60 loutgr
  1280. Xgsave
  1281. X0 0 moveto xsize 0 lineto stroke
  1282. Xgrestore
  1283. X
  1284. Xgrestore
  1285. X
  1286. X/Times-Roman 153 fnt
  1287. X1417 1536 moveto(1)s 
  1288. X/Times-Roman 192 fnt
  1289. X1493 1458 moveto(PostScript)s
  1290. X2326 x(is)s 2501 x(a)s 2634 x(trademark)s 3457 x(of)s 3664 x(Adobe)s
  1291. X4223 x(Systems,)s 4956 x(Incorporated.)s 
  1292. Xpgsave restore
  1293. Xshowpage
  1294. X
  1295. X%%Page: ? 3
  1296. X%%BeginPageSetup
  1297. X0.0500 dup scale 10 setlinewidth
  1298. X/pgsave save def
  1299. X%%EndPageSetup
  1300. X
  1301. X/Times-Roman 240 fnt
  1302. X5754 15261 moveto(-)s 5893 x(2)s 6073 x(-)s 1417 14674 moveto(together)s 2260 x(with)s
  1303. X2745 x(each)s 3243 x(other)s 3794 x(and)s 4200 x(with)s 4685 x(symbols)s
  1304. X5543 x(made)s 6121 x(from)s 6645 x(letters:)s 
  1305. X/Helvetica 220 fnt
  1306. X1897 14160 moveto(Omega-delta<=2)s 
  1307. X/Symbol 240 fnt
  1308. X5866 14157 moveto(\127)s
  1309. X6107 x(-)s 6295 x(\144)s 6485 x(\243)s 6688 x(\062)s 
  1310. X/Times-Roman 240 fnt
  1311. X1417 13661 moveto(This)s
  1312. X1902 x(rule)s 2333 x(applies)s 3070 x(throughout)s 4181 x(the)s 4533 x(Lout)s
  1313. X5045 x(world.)s 1897 13287 moveto(Some)s 2502 x(symbols)s 3360 x(join)s 3792 x(objects)s
  1314. X4529 x(together)s 5372 x(in)s 5618 x(mathematical)s 6964 x(ways:)s 
  1315. X/Helvetica 220 fnt
  1316. X1897 12788 moveto(x sub 2)s
  1317. X
  1318. X/Times-Italic 240 fnt
  1319. X5866 12792 moveto(x)s 
  1320. X/Symbol 168 fnt
  1321. X5972 12707 moveto(\062)s 
  1322. X/Times-Roman 240 fnt
  1323. X1417 12257 moveto(Here)s 1930 x(the)s 
  1324. X/Helvetica 220 fnt
  1325. X2271 12253 moveto(sub)s
  1326. X
  1327. X/Times-Roman 240 fnt
  1328. X2674 12257 moveto(symbol)s 3428 x(has)s 3796 x(taken)s 4363 x(the)s 4704 x(object)s
  1329. X5337 x(just)s 5731 x(to)s 5966 x(its)s 6240 x(left,)s 6666 x(and)s
  1330. X7061 x(the)s 7402 x(object)s 8035 x(just)s 8429 x(to)s 8664 x(its)s
  1331. X8938 x(right,)s 9498 x(and)s 9893 x(joined)s 1417 11969 moveto(them)s 1972 x(into)s
  1332. X2421 x(one)s 2844 x(object)s 3505 x(in)s 3768 x(the)s 4137 x(form)s
  1333. X4678 x(of)s 4954 x(a)s 5137 x(subscript.)s 6197 x(The)s 6646 x(two)s
  1334. X7082 x(objects)s 7836 x(are)s 8204 x(called)s 8851 x(the)s 9220 x(left)s
  1335. X9614 x(and)s 10037 x(right)s 1417 11681 moveto(parameters)s 2524 x(of)s 
  1336. X/Helvetica 220 fnt
  1337. X2783 11677 moveto(sub)s
  1338. X
  1339. X/Times-Roman 240 fnt
  1340. X3137 11681 moveto(,)s 3257 x(and)s 3663 x(they)s 4135 x(may)s 4607 x(be)s
  1341. X4893 x(arbitrary)s 5774 x(Lout)s 6286 x(objects.)s 1897 11307 moveto(Other)s 2499 x(symbols)s
  1342. X3355 x(of)s 3612 x(a)s 3776 x(similar)s 4496 x(kind)s 4980 x(include)s
  1343. X
  1344. X/Helvetica 220 fnt
  1345. X5742 11303 moveto(sup)s 
  1346. X/Times-Roman 240 fnt
  1347. X6154 11307 moveto(for)s 6490 x(superscripting,)s 
  1348. X/Helvetica 220 fnt
  1349. X7962 11303 moveto(over)s 
  1350. X/Times-Roman 240 fnt
  1351. X8447 11307 moveto(for)s
  1352. X8783 x(built-up)s 9598 x(fractions,)s 1417 11019 moveto(and)s 
  1353. X/Helvetica 220 fnt
  1354. X1831 11015 moveto(from)s 
  1355. X/Times-Roman 240 fnt
  1356. X2338 11019 moveto(and)s
  1357. X
  1358. X/Helvetica 220 fnt
  1359. X2752 11015 moveto(to)s 
  1360. X/Times-Roman 240 fnt
  1361. X3003 11019 moveto(for)s 3349 x(the)s 3709 x(lower)s 4321 x(and)s
  1362. X4735 x(upper)s 5348 x(limits)s 5959 x(of)s 6226 x(sums,)s 6846 x(products,)s
  1363. X7798 x(etc.)s 8264 x(These)s 8903 x(symbols)s 9769 x(may)s 10249 x(be)s
  1364. X1417 10731 moveto(used)s 1916 x(together)s 2759 x(to)s 3005 x(produce)s 3836 x(complicated)s
  1365. X5064 x(equations)s 6041 x(with)s 6526 x(astonishing)s 7676 x(ease:)s 
  1366. X/Helvetica 220 fnt
  1367. X1897 10231 moveto(big sum from i=0 to n r sup i)s
  1368. X1897 9943 moveto(= {r sup n+1 - 1} over r-1)s 
  1369. X/Times-Italic 168 fnt
  1370. X5943 10317 moveto(n)s 
  1371. X/Symbol 312 fnt
  1372. X5874 10038 moveto(\345)s 
  1373. X/Times-Italic 168 fnt
  1374. X5866 9852 moveto(i)s 
  1375. X/Symbol 168 fnt
  1376. X5920 9847 moveto(\075)s
  1377. X6020 x(\060)s 
  1378. X/Times-Italic 168 fnt
  1379. X6197 10175 moveto(i)s 
  1380. X/Times-Italic 240 fnt
  1381. X6104 10063 moveto(r)s 
  1382. X/Symbol 240 fnt
  1383. X6315 10056 moveto(\075)s 
  1384. X/Times-Italic 168 fnt
  1385. X6611 10283 moveto(n)s
  1386. X
  1387. X/Symbol 168 fnt
  1388. X6701 10278 moveto(+)s 6799 x(\061)s 
  1389. X/Times-Italic 240 fnt
  1390. X6518 10171 moveto(r)s 
  1391. X/Symbol 240 fnt
  1392. X6940 10164 moveto(-)s 7128 x(\061)s
  1393. Xgsave
  1394. X6518 10116 translate
  1395. X730 0 0 0 240 288 0 loutgr
  1396. Xgsave
  1397. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1398. Xgrestore
  1399. X
  1400. Xgrestore
  1401. X
  1402. X/Times-Italic 240 fnt
  1403. X6654 9914 moveto(r)s 
  1404. X/Symbol 240 fnt
  1405. X6804 9907 moveto(-)s 6992 x(\061)s 
  1406. X/Times-Roman 240 fnt
  1407. X1417 9384 moveto(Here)s 
  1408. X/Helvetica 220 fnt
  1409. X1937 9380 moveto(sum)s
  1410. X
  1411. X/Times-Roman 240 fnt
  1412. X2408 9384 moveto(is)s 2623 x(just)s 3024 x(the)s 
  1413. X/Symbol 240 fnt
  1414. X3372 9377 moveto(\345)s 
  1415. X/Times-Roman 240 fnt
  1416. X3599 9384 moveto(symbol;)s
  1417. X
  1418. X/Helvetica 220 fnt
  1419. X4426 9380 moveto(from)s 
  1420. X/Times-Roman 240 fnt
  1421. X4921 9384 moveto(and)s 
  1422. X/Helvetica 220 fnt
  1423. X5323 9380 moveto(to)s 
  1424. X/Times-Roman 240 fnt
  1425. X5562 9384 moveto(do)s 5858 x(all)s
  1426. X6152 x(the)s 6500 x(work)s 7048 x(of)s 7303 x(placing)s 8063 x(the)s
  1427. X8411 x(limits.)s 9130 x(They)s 9678 x(are)s 10025 x(quite)s 1417 9096 moveto(independent,)s
  1428. X2718 x(so)s 3002 x(either)s 3616 x(or)s 3886 x(both)s 4383 x(may)s
  1429. X4866 x(be)s 5163 x(omitted.)s 6084 x(To)s 6421 x(get)s 6784 x(a)s
  1430. X6961 x(superscript)s 8080 x(directly)s 8880 x(over)s 9376 x(a)s 9553 x(subscript,)s
  1431. X1417 8808 moveto(use)s 1796 x(the)s 
  1432. X/Helvetica 220 fnt
  1433. X2148 8804 moveto(supp)s 
  1434. X/Times-Roman 240 fnt
  1435. X2684 8808 moveto(and)s 
  1436. X/Helvetica 220 fnt
  1437. X3090 8804 moveto(on)s
  1438. X
  1439. X/Times-Roman 240 fnt
  1440. X3394 8808 moveto(symbols:)s 
  1441. X/Helvetica 220 fnt
  1442. X1897 8231 moveto(A supp 2 on 1)s 
  1443. X/Times-Italic 240 fnt
  1444. X5866 8235 moveto(A)s 
  1445. X/Symbol 168 fnt
  1446. X6012 8353 moveto(\062)s 6012 8150 moveto(\061)s
  1447. X
  1448. X/Times-Roman 240 fnt
  1449. X1417 7700 moveto(These)s 2048 x(two)s 2467 x(symbols)s 3325 x(should)s 4024 x(always)s
  1450. X4748 x(be)s 5034 x(used)s 5533 x(together)s 6376 x(as)s 6635 x(shown.)s
  1451. X1897 7326 moveto(As)s 2230 x(usual)s 2802 x(in)s 3055 x(Lout,)s 3634 x(braces)s
  1452. X4311 x(are)s 4669 x(used)s 5175 x(to)s 5428 x(group)s 6054 x(something)s
  1453. X7118 x(into)s 7557 x(an)s 7850 x(indivisible)s 8926 x(object.)s 9697 x(Leaving)s
  1454. X1417 7038 moveto(them)s 1955 x(out)s 2321 x(creates)s 3043 x(ambiguities:)s 
  1455. X/Helvetica 220 fnt
  1456. X1897 6539 moveto(a  sup  b  over  c)s
  1457. X
  1458. X/Times-Roman 240 fnt
  1459. X1417 6041 moveto(There)s 2034 x(are)s 2385 x(two)s 2804 x(possible)s 3648 x(interpretations)s
  1460. X5087 x(for)s 5425 x(this:)s 
  1461. X/Helvetica 220 fnt
  1462. X1897 5367 moveto({a  sup  b}  over  c)s 
  1463. X/Times-Italic 168 fnt
  1464. X5986 5587 moveto(b)s 
  1465. X/Times-Italic 240 fnt
  1466. X5866 5475 moveto(a)s
  1467. Xgsave
  1468. X5866 5424 translate
  1469. X204 0 0 0 240 288 0 loutgr
  1470. Xgsave
  1471. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1472. Xgrestore
  1473. X
  1474. Xgrestore
  1475. X
  1476. X/Times-Italic 240 fnt
  1477. X5915 5270 moveto(c)s 
  1478. X/Helvetica 220 fnt
  1479. X1897 4664 moveto(a  sup  {b  over  c})s 
  1480. X/Times-Italic 168 fnt
  1481. X5986 4865 moveto(b)s gsave
  1482. X5986 4830 translate
  1483. X84 0 0 0 168 33 0 loutgr
  1484. Xgsave
  1485. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1486. Xgrestore
  1487. X
  1488. Xgrestore
  1489. X
  1490. X/Times-Italic 168 fnt
  1491. X5991 4723 moveto(c)s 
  1492. X/Times-Italic 240 fnt
  1493. X5866 4668 moveto(a)s
  1494. X
  1495. X/Times-Roman 240 fnt
  1496. X1417 4166 moveto(Eq)s 1746 x(chooses)s 2567 x(between)s 3427 x(them)s 3968 x(in)s
  1497. X4217 x(the)s 4572 x(following)s 5565 x(way.)s 6147 x(Every)s 6781 x(symbol)s
  1498. X7549 x(that)s 7970 x(takes)s 8524 x(a)s 8693 x(parameter)s 9710 x(also)s
  1499. X10158 x(has)s 1417 3878 moveto(a)s 
  1500. X/Times-Italic 240 fnt
  1501. X1574 x(precedence)s 
  1502. X/Times-Roman 240 fnt
  1503. X2663 x(,)s 2774 x(which)s
  1504. X3410 x(is)s 3620 x(a)s 3777 x(number.)s 4679 x(For)s 5062 x(example,)s
  1505. X
  1506. X/Helvetica 220 fnt
  1507. X5983 3874 moveto(sup)s 
  1508. X/Times-Roman 240 fnt
  1509. X6388 3878 moveto(has)s 6758 x(precedence)s 7884 x(60)s 8175 x(and)s
  1510. X
  1511. X/Helvetica 220 fnt
  1512. X8572 3874 moveto(over)s 
  1513. X/Times-Roman 240 fnt
  1514. X9050 3878 moveto(has)s 9420 x(precedence)s 1417 3590 moveto(54.)s 1823 x(The)s
  1515. X2241 x(symbol)s 2992 x(with)s 3463 x(the)s 3801 x(highest)s 4538 x(precedence)s
  1516. X5659 x(wins)s 6157 x(the)s 6495 x(object)s 7125 x(lying)s 7663 x(between)s
  1517. X8506 x(them,)s 9090 x(so)s 9349 x(in)s 9581 x(the)s 9919 x(above)s
  1518. X1417 3302 moveto(case)s 1875 x(the)s 2214 x(\256rst)s 2632 x(interpretation)s 3965 x(is)s
  1519. X4171 x(chosen.)s 5003 x(If)s 5208 x(two)s 5614 x(symbols)s 6459 x(of)s
  1520. X6705 x(equal)s 7270 x(precedence)s 8392 x(compete)s 9249 x(for)s 9574 x(an)s
  1521. X9847 x(object,)s 1417 3014 moveto(the)s 1769 x(association)s 2891 x(is)s 3110 x(towards)s
  1522. X3927 x(the)s 4279 x(left:)s 
  1523. X/Helvetica 220 fnt
  1524. X1897 2492 moveto(a sup b sub 2)s 
  1525. X/Times-Italic 168 fnt
  1526. X5986 2608 moveto(b)s 
  1527. X/Times-Italic 240 fnt
  1528. X5866 2496 moveto(a)s
  1529. X
  1530. X/Symbol 168 fnt
  1531. X6070 2411 moveto(\062)s 
  1532. X/Times-Roman 240 fnt
  1533. X1417 1961 moveto(In)s 1676 x(this)s 2081 x(case)s 2552 x(it)s
  1534. X2744 x(is)s 2963 x(more)s 3514 x(probable)s 4411 x(that)s 4829 x(the)s
  1535. X5181 x(following)s 6171 x(right)s 6682 x(association)s 7804 x(was)s 8236 x(actually)s
  1536. X9052 x(wanted:)s 
  1537. Xpgsave restore
  1538. Xshowpage
  1539. X
  1540. X%%Page: ? 4
  1541. X%%BeginPageSetup
  1542. X0.0500 dup scale 10 setlinewidth
  1543. X/pgsave save def
  1544. X%%EndPageSetup
  1545. X
  1546. X/Times-Roman 240 fnt
  1547. X5754 15261 moveto(-)s 5893 x(3)s 6073 x(-)s 
  1548. X/Helvetica 220 fnt
  1549. X1897 14602 moveto(a sup { b sub 2 })s 
  1550. X/Times-Italic 168 fnt
  1551. X5986 14718 moveto(b)s
  1552. X
  1553. X/Symbol 117 fnt
  1554. X6070 14659 moveto(\062)s 
  1555. X/Times-Italic 240 fnt
  1556. X5866 14606 moveto(a)s 
  1557. X/Times-Roman 240 fnt
  1558. X1897 13839 moveto(White)s 2549 x(space)s 3148 x(between)s
  1559. X4013 x(two)s 4440 x(objects)s 5185 x(is)s 5412 x(considered)s 6516 x(to)s
  1560. X6770 x(be)s 7064 x(a)s 7238 x(symbol)s 8011 x(with)s 8504 x(precedence)s
  1561. X9647 x(7,)s 9895 x(which)s 1417 13551 moveto(is)s 1636 x(lower)s 2240 x(than)s
  1562. X2712 x(the)s 3064 x(precedence)s 4199 x(of)s 4458 x(any)s 4864 x(Eq)s
  1563. X5190 x(symbol;)s 6021 x(but)s 6387 x(if)s 6592 x(the)s 6944 x(two)s
  1564. X7363 x(objects)s 8100 x(are)s 8451 x(immediately)s 9705 x(adjacent)s 1417 13263 moveto(the)s
  1565. X1774 x(precedence)s 2914 x(is)s 3138 x(102,)s 3623 x(which)s 4273 x(is)s
  1566. X4497 x(higher)s 5173 x(than)s 5650 x(the)s 6007 x(precedence)s 7147 x(of)s
  1567. X7411 x(any)s 7822 x(Eq)s 8153 x(symbol.)s 9043 x(Compare)s 9985 x(these)s
  1568. X1417 12975 moveto(three)s 1954 x(examples:)s 
  1569. X/Helvetica 220 fnt
  1570. X1897 12303 moveto(big sum from i=0 to n)s 
  1571. X/Times-Italic 168 fnt
  1572. X5943 12561 moveto(n)s 
  1573. X/Symbol 312 fnt
  1574. X5874 12282 moveto(\345)s
  1575. X
  1576. X/Times-Italic 168 fnt
  1577. X5866 12096 moveto(i)s 
  1578. X/Symbol 168 fnt
  1579. X5920 12091 moveto(\075)s 6020 x(\060)s 
  1580. X/Helvetica 220 fnt
  1581. X1897 11469 moveto(big sum from {i = 0} to n)s 
  1582. X/Times-Italic 168 fnt
  1583. X5943 11727 moveto(n)s
  1584. X
  1585. X/Symbol 312 fnt
  1586. X5874 11448 moveto(\345)s 
  1587. X/Times-Italic 168 fnt
  1588. X5866 11262 moveto(i)s 
  1589. X/Symbol 168 fnt
  1590. X5920 11257 moveto(\075)s 6020 x(\060)s 
  1591. X/Helvetica 220 fnt
  1592. X1897 10687 moveto(big sum from i = 0 to n)s
  1593. X
  1594. X/Symbol 312 fnt
  1595. X5866 10666 moveto(\345)s 
  1596. X/Times-Italic 168 fnt
  1597. X5954 10480 moveto(i)s 
  1598. X/Symbol 240 fnt
  1599. X6160 10684 moveto(\075)s 
  1600. X/Times-Italic 168 fnt
  1601. X6381 10893 moveto(n)s 
  1602. X/Symbol 240 fnt
  1603. X6363 10684 moveto(\060)s
  1604. X
  1605. X/Times-Roman 240 fnt
  1606. X1417 10028 moveto(and)s 1824 x(you)s 2245 x(will)s 2677 x(see)s 3043 x(that)s
  1607. X3462 x(some)s 4028 x(care)s 4486 x(is)s 4706 x(needed)s 5445 x(on)s
  1608. X5746 x(this)s 6152 x(point.)s 6825 x(Braces)s 7536 x(can)s 7929 x(always)s
  1609. X8654 x(be)s 8941 x(used)s 9441 x(to)s 9688 x(override)s 1417 9740 moveto(precedence)s
  1610. X2554 x(and)s 2962 x(associativity,)s 4278 x(and)s 4686 x(when)s 5267 x(in)s
  1611. X5515 x(doubt)s 6123 x(the)s 6477 x(easiest)s 7175 x(course)s 7861 x(is)s
  1612. X8082 x(to)s 8330 x(insert)s 8922 x(them.)s 9582 x(Although)s 1417 9452 moveto(Lout)s
  1613. X1980 x(allows)s 2715 x(symbols)s 3624 x(to)s 3921 x(as)s 4120 x(so)s
  1614. X4333 x(ciate)s 4894 x(towards)s 5762 x(the)s 6165 x(left)s 6593 x(or)s
  1615. X6903 x(right,)s 7525 x(Eq)s 7902 x(chooses)s 8771 x(to)s 9068 x(have)s
  1616. X9631 x(only)s 10168 x(left)s 1417 9164 moveto(associative)s 2559 x(symbols.)s 3571 x(The)s
  1617. X4037 x(summary)s 5021 x(at)s 5287 x(the)s 5673 x(end)s 6113 x(of)s
  1618. X6406 x(this)s 6845 x(report)s 7509 x(gives)s 8108 x(the)s 8494 x(precedence)s
  1619. X9663 x(of)s 9956 x(every)s 1417 8876 moveto(symbol.)s 1897 8502 moveto(The)s 
  1620. X/Times-Italic 240 fnt
  1621. X2329 x(matrix)s
  1622. X
  1623. X/Times-Roman 240 fnt
  1624. X3013 x(symbol)s 3778 x(builds)s 4423 x(an)s 4709 x(array)s 5259 x(of)s
  1625. X5518 x(objects:)s 
  1626. X/Helvetica 220 fnt
  1627. X1897 8003 moveto(matrix)s 1897 7715 moveto(   atleft { blpar })s 1897 7427 moveto(   atright { brpar })s 1897 7139 moveto({ x sup 2 above x above 1)s
  1628. X1897 6851 moveto(  nextcol)s 1897 6563 moveto(  y sup 2 above y above 1)s 1897 6275 moveto(  nextcol)s 1897 5987 moveto(  z sup 2 above z above 1)s 1897 5699 moveto(})s
  1629. Xgsave
  1630. X5866 7691 translate
  1631. X-180.0000 rotate
  1632. Xgsave
  1633. X0 -471 translate
  1634. X180.0000 rotate
  1635. Xgsave
  1636. X0 -518 translate
  1637. X1.0000 1.1416 scale
  1638. X
  1639. X/Symbol 240 fnt
  1640. X0 232 moveto(\346)s 0 -60 moveto(\347)s 0 -302 moveto(\350)s 
  1641. Xgrestore
  1642. X
  1643. X/Symbol 168 fnt
  1644. X241 -172 moveto(\062)s 
  1645. X/Times-Italic 240 fnt
  1646. X135 -279 moveto(x)s
  1647. X194 -555 moveto(x)s 
  1648. X/Symbol 240 fnt
  1649. X187 -886 moveto(\061)s 
  1650. X/Symbol 168 fnt
  1651. X623 -172 moveto(\062)s 
  1652. X/Times-Italic 240 fnt
  1653. X517 -279 moveto(y)s 576 -555 moveto(y)s
  1654. X
  1655. X/Symbol 240 fnt
  1656. X569 -886 moveto(\061)s 
  1657. X/Symbol 168 fnt
  1658. X992 -172 moveto(\062)s 
  1659. X/Times-Italic 240 fnt
  1660. X899 -279 moveto(z)s 955 -555 moveto(z)s 
  1661. X/Symbol 240 fnt
  1662. X941 -886 moveto(\061)s
  1663. Xgsave
  1664. X0 -518 translate
  1665. X1.0000 1.1416 scale
  1666. X
  1667. X/Symbol 240 fnt
  1668. X1119 232 moveto(\366)s 1119 -60 moveto(\367)s 1119 -302 moveto(\370)s 
  1669. Xgrestore
  1670. X
  1671. Xgrestore
  1672. X
  1673. Xgrestore
  1674. Xgsave
  1675. X0 7645 translate
  1676. X1.0000 1.1416 scale
  1677. X
  1678. X/Symbol 240 fnt
  1679. X5866 232 moveto(\346)s 5866 -60 moveto(\347)s
  1680. X5866 -302 moveto(\350)s 
  1681. Xgrestore
  1682. X
  1683. X/Symbol 168 fnt
  1684. X6107 7991 moveto(\062)s 
  1685. X/Times-Italic 240 fnt
  1686. X6001 7884 moveto(x)s 6060 7608 moveto(x)s 
  1687. X/Symbol 240 fnt
  1688. X6053 7277 moveto(\061)s
  1689. X
  1690. X/Symbol 168 fnt
  1691. X6489 7991 moveto(\062)s 
  1692. X/Times-Italic 240 fnt
  1693. X6383 7884 moveto(y)s 6442 7608 moveto(y)s 
  1694. X/Symbol 240 fnt
  1695. X6435 7277 moveto(\061)s 
  1696. X/Symbol 168 fnt
  1697. X6858 7991 moveto(\062)s
  1698. X
  1699. X/Times-Italic 240 fnt
  1700. X6765 7884 moveto(z)s 6821 7608 moveto(z)s 
  1701. X/Symbol 240 fnt
  1702. X6807 7277 moveto(\061)s gsave
  1703. X0 7645 translate
  1704. X1.0000 1.1416 scale
  1705. X
  1706. X/Symbol 240 fnt
  1707. X6985 232 moveto(\366)s 6985 -60 moveto(\367)s
  1708. X6985 -302 moveto(\370)s 
  1709. Xgrestore
  1710. X
  1711. X/Times-Roman 240 fnt
  1712. X1417 5202 moveto(The)s 
  1713. X/Helvetica 220 fnt
  1714. X1876 5198 moveto(atleft)s 
  1715. X/Times-Roman 240 fnt
  1716. X2438 5202 moveto(and)s 
  1717. X/Helvetica 220 fnt
  1718. X2871 5198 moveto(atright)s
  1719. X
  1720. X/Times-Roman 240 fnt
  1721. X3567 5202 moveto(options)s 4359 x(place)s 4950 x(vertically)s 5938 x(scaled)s 6622 x(versions)s
  1722. X7506 x(of)s 7792 x(their)s 8316 x(values)s 9014 x(at)s 9273 x(each)s
  1723. X9798 x(side;)s 10336 x(if)s 1417 4914 moveto(either)s 2034 x(is)s 2267 x(omitted)s
  1724. X3071 x(the)s 3437 x(value)s 4029 x(is)s 4262 x(taken)s 4854 x(to)s
  1725. X5114 x(be)s 5414 x(an)s 5714 x(empty)s 6386 x(object)s 7044 x(of)s
  1726. X7317 x(zero)s 7802 x(width)s 8421 x(by)s 8735 x(default.)s 9592 x(The)s
  1727. X10038 x(right)s 1417 4626 moveto(parameter)s 2421 x(of)s 
  1728. X/Helvetica 220 fnt
  1729. X2670 4622 moveto(matrix)s 
  1730. X/Times-Roman 240 fnt
  1731. X3317 4626 moveto(is)s
  1732. X3526 x(the)s 3868 x(array)s 4408 x(itself.)s 5054 x(It)s 5249 x(is)s
  1733. X5458 x(a)s 5614 x(sequence)s 6541 x(of)s 6790 x(columns)s 7651 x(separated)s
  1734. X8603 x(by)s 
  1735. X/Helvetica 220 fnt
  1736. X8893 4622 moveto(nextcol)s 
  1737. X/Times-Roman 240 fnt
  1738. X9638 4626 moveto(symbols;)s 1417 4338 moveto(each)s 1915 x(column)s
  1739. X2693 x(is)s 2912 x(a)s 3078 x(sequence)s 4015 x(of)s 4274 x(objects)s
  1740. X5011 x(separated)s 5973 x(by)s 
  1741. X/Helvetica 220 fnt
  1742. X6273 4334 moveto(above)s 
  1743. X/Times-Roman 240 fnt
  1744. X6931 4338 moveto(symbols.)s 1897 3964 moveto(The)s
  1745. X
  1746. X/Helvetica 220 fnt
  1747. X2310 3960 moveto(nextcol)s 
  1748. X/Times-Roman 240 fnt
  1749. X3046 3964 moveto(and)s 
  1750. X/Helvetica 220 fnt
  1751. X3433 3960 moveto(above)s 
  1752. X/Times-Roman 240 fnt
  1753. X4072 3964 moveto(symbols)s 4911 x(have)s
  1754. X5404 x(low)s 5804 x(precedence,)s 6980 x(but)s 7327 x(not)s 7674 x(as)s
  1755. X7914 x(low)s 8314 x(as)s 8554 x(white)s 9126 x(space)s 9698 x(between)s
  1756. X1417 3676 moveto(two)s 1826 x(objects.)s 2673 x(Therefore,)s 3724 x(unless)s 4372 x(the)s
  1757. X4714 x(entries)s 5400 x(in)s 5636 x(the)s 5978 x(array)s 6518 x(are)s
  1758. X6859 x(very)s 7334 x(simple,)s 8081 x(it)s 8263 x(is)s 8472 x(safest)s
  1759. X9065 x(to)s 9301 x(enclose)s 10068 x(each)s 1417 3388 moveto(of)s 1676 x(them)s
  1760. X2214 x(in)s 2460 x(braces.)s 1897 3014 moveto(Columns)s 2856 x(built)s 3388 x(with)s
  1761. X3907 x(the)s 
  1762. X/Helvetica 220 fnt
  1763. X4293 3010 moveto(above)s 
  1764. X/Times-Roman 240 fnt
  1765. X4985 3014 moveto(symbol)s 5784 x(have)s 6330 x(their)s
  1766. X6861 x(objects)s 7632 x(centred)s 8429 x(in)s 8709 x(the)s 9095 x(column.)s
  1767. X10027 x(Also)s 1417 2726 moveto(available)s 2343 x(are)s 
  1768. X/Helvetica 220 fnt
  1769. X2698 2722 moveto(labove)s 
  1770. X/Times-Roman 240 fnt
  1771. X3408 2726 moveto(for)s
  1772. X3750 x(left-justi\256ed)s 4980 x(columns,)s 
  1773. X/Helvetica 220 fnt
  1774. X5915 2722 moveto(cabove)s 
  1775. X/Times-Roman 240 fnt
  1776. X6687 2726 moveto(meaning)s 7575 x(the)s
  1777. X7931 x(same)s 8486 x(as)s 
  1778. X/Helvetica 220 fnt
  1779. X8749 2722 moveto(above)s 
  1780. X/Times-Roman 240 fnt
  1781. X9347 2726 moveto(,)s 
  1782. X/Helvetica 220 fnt
  1783. X9471 2722 moveto(rabove)s
  1784. X
  1785. X/Times-Roman 240 fnt
  1786. X10206 2726 moveto(for)s 1417 2438 moveto(right-justi\256ed)s 2785 x(columns,)s 3724 x(and)s 
  1787. X/Helvetica 220 fnt
  1788. X4138 2434 moveto(mabove)s
  1789. X
  1790. X/Times-Roman 240 fnt
  1791. X4987 2438 moveto(for)s 5333 x(alignment)s 6357 x(along)s 6957 x(column)s 7743 x(marks.)s
  1792. X8515 x(Each)s 9061 x(column)s 9847 x(should)s 1417 2150 moveto(contain)s 2182 x(only)s
  1793. X2669 x(one)s 3076 x(kind)s 3563 x(of)s 
  1794. X/Helvetica 220 fnt
  1795. X3823 2146 moveto(above)s 
  1796. X/Times-Roman 240 fnt
  1797. X4482 2150 moveto(symbol)s
  1798. X5248 x(\(although)s 6226 x(adventurous)s 7457 x(users)s 8009 x(might)s 8628 x(be)s
  1799. X8915 x(able)s 9374 x(to)s 9621 x(get)s 9974 x(some)s 1417 1862 moveto(mixtures)s
  1800. X2313 x(to)s 2559 x(work\),)s 3250 x(but)s 3616 x(different)s 4497 x(columns)s
  1801. X5368 x(may)s 5840 x(differ.)s 6549 x(For)s 6941 x(example,)s 
  1802. Xpgsave restore
  1803. Xshowpage
  1804. X
  1805. X%%Page: ? 5
  1806. X%%BeginPageSetup
  1807. X0.0500 dup scale 10 setlinewidth
  1808. X/pgsave save def
  1809. X%%EndPageSetup
  1810. X
  1811. X/Times-Roman 240 fnt
  1812. X5754 15261 moveto(-)s 5893 x(4)s 6073 x(-)s 
  1813. X/Helvetica 220 fnt
  1814. X1897 14674 moveto(@R "Chain rule:"  labove  @R "Product rule:")s 1897 14386 moveto(nextcol)s
  1815. X1897 14098 moveto({df over dx ^= df over dy cdot dy over dx})s 1897 13810 moveto(mabove)s 1897 13522 moveto({dfg over dy ^= f ` dg over dx + g df over dx})s 
  1816. X/Times-Roman 240 fnt
  1817. X1417 13023 moveto(has)s 1796 x(result)s
  1818. X1897 12418 moveto(Chain rule:)s 1897 11776 moveto(Product rule:)s 
  1819. X/Times-Italic 240 fnt
  1820. X3430 12569 moveto(df)s gsave
  1821. X3410 12471 translate
  1822. X226 0 0 0 240 288 0 loutgr
  1823. Xgsave
  1824. X0 0 moveto xsize 0 lineto 0.05 ft setlinewidth stroke
  1825. Xgrestore
  1826. X
  1827. Xgrestore
  1828. X
  1829. X/Times-Italic 240 fnt
  1830. X3410 12260 moveto(dx)s 
  1831. END_OF_FILE
  1832.   if test 54341 -ne `wc -c <'lout/doc/tr.eq/outfile.ps.A'`; then
  1833.     echo shar: \"'lout/doc/tr.eq/outfile.ps.A'\" unpacked with wrong size!
  1834.   elif test -f 'lout/doc/tr.eq/outfile.ps.B' && test -f 'lout/doc/tr.eq/outfile.ps.C'; then
  1835.     echo shar: Combining  \"'lout/doc/tr.eq/outfile.ps'\" \(157394 characters\)
  1836.     cat 'lout/doc/tr.eq/outfile.ps.A' 'lout/doc/tr.eq/outfile.ps.B' 'lout/doc/tr.eq/outfile.ps.C' > 'lout/doc/tr.eq/outfile.ps'
  1837.     if test 157394 -ne `wc -c <'lout/doc/tr.eq/outfile.ps'`; then
  1838.       echo shar: \"'lout/doc/tr.eq/outfile.ps'\" combined with wrong size!
  1839.     else
  1840.       rm lout/doc/tr.eq/outfile.ps.A lout/doc/tr.eq/outfile.ps.B 
  1841.       rm lout/doc/tr.eq/outfile.ps.C
  1842.     fi
  1843.   fi
  1844.   # end of 'lout/doc/tr.eq/outfile.ps.A'
  1845. fi
  1846. if test -f 'lout/doc/tr.impl/s5.0' -a "${1}" != "-c" ; then 
  1847.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s5.0'\"
  1848. else
  1849.   echo shar: Extracting \"'lout/doc/tr.impl/s5.0'\" \(476 characters\)
  1850.   sed "s/^X//" >'lout/doc/tr.impl/s5.0' <<'END_OF_FILE'
  1851. X@Section
  1852. X    @Title { Galleys }
  1853. X@Begin
  1854. X@PP
  1855. XWith objects and definitions under control, the author faced the problem
  1856. Xof getting body text, footnotes, floating figures and tables,
  1857. Xreferences, index entries, and entries in the table of contents into
  1858. Xtheir places.  The resulting investigation occupied three months of
  1859. Xfull-time design work, and proceeded approximately as described in
  1860. XSection {@NumberOf galleys}; the implementation occupied the years 1987-89.
  1861. X@BeginSubSections
  1862. END_OF_FILE
  1863.   if test 476 -ne `wc -c <'lout/doc/tr.impl/s5.0'`; then
  1864.     echo shar: \"'lout/doc/tr.impl/s5.0'\" unpacked with wrong size!
  1865.   fi
  1866.   # end of 'lout/doc/tr.impl/s5.0'
  1867. fi
  1868. if test -f 'lout/z10.c' -a "${1}" != "-c" ; then 
  1869.   echo shar: Will not clobber existing file \"'lout/z10.c'\"
  1870. else
  1871.   echo shar: Extracting \"'lout/z10.c'\" \(24737 characters\)
  1872.   sed "s/^X//" >'lout/z10.c' <<'END_OF_FILE'
  1873. X/*@z10.c:Cross References:CrossExpand(), CrossSequence()@*********************/
  1874. X/*                                                                           */
  1875. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1876. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1877. X/*                                                                           */
  1878. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1879. X/*  Basser Department of Computer Science                                    */
  1880. X/*  The University of Sydney 2006                                            */
  1881. X/*  AUSTRALIA                                                                */
  1882. X/*                                                                           */
  1883. X/*  This program is free software; you can redistribute it and/or modify     */
  1884. X/*  it under the terms of the GNU General Public License as published by     */
  1885. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1886. X/*  any later version.                                                       */
  1887. X/*                                                                           */
  1888. X/*  This program is distributed in the hope that it will be useful,          */
  1889. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1890. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1891. X/*  GNU General Public License for more details.                             */
  1892. X/*                                                                           */
  1893. X/*  You should have received a copy of the GNU General Public License        */
  1894. X/*  along with this program; if not, write to the Free Software              */
  1895. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1896. X/*                                                                           */
  1897. X/*  FILE:         z10.c                                                      */
  1898. X/*  MODULE:       Cross References                                           */
  1899. X/*  EXTERNS:      CrossInit(), CrossMake(), GallTargEval(), CrossExpand(),   */
  1900. X/*                CrossSequence(), CrossClose()                              */
  1901. X/*                                                                           */
  1902. X/*****************************************************************************/
  1903. X#include "externs"
  1904. X#define    CROSS_LIT    CROSS_TARG
  1905. X#define    NO_TARGET    0
  1906. X#define    SEEN_TARGET    1
  1907. X#define    WRITTEN_TARGET    2
  1908. X
  1909. Xstatic OBJECT RootCross = nil;            /* header for all crs        */
  1910. X
  1911. X
  1912. X/*****************************************************************************/
  1913. X/*                                                                           */
  1914. X/*  CrossInit(sym)                                                           */
  1915. X/*                                                                           */
  1916. X/*  Initialize cross_sym(sym).                                               */
  1917. X/*                                                                           */
  1918. X/*****************************************************************************/
  1919. X
  1920. XCrossInit(sym)
  1921. XOBJECT sym;
  1922. X{ OBJECT cs;  int i;
  1923. X  cs = New(CROSS_SYM);
  1924. X  target_state(cs)  = NO_TARGET;
  1925. X  target_seq(cs)    = 0;
  1926. X  cr_file(cs)       = NO_FILE;
  1927. X  gall_seq(cs)      = 0;
  1928. X  gall_tag(cs)      = nil;
  1929. X  gall_tfile(cs)    = NO_FILE;
  1930. X  gentag_file(cs)   = NO_FILE;
  1931. X  symb(cs)          = sym;
  1932. X  cross_sym(sym)    = cs;
  1933. X  gentag_fseq(cs)   = NewWord(MAX_FILES, no_fpos);
  1934. X  for( i = 0;  i < MAX_FILES;  i++ ) string(gentag_fseq(cs))[i] = 0;
  1935. X  if( RootCross == nil )  RootCross = New(CR_ROOT);
  1936. X  Link(RootCross, cs);
  1937. X}
  1938. X
  1939. X
  1940. X/*****************************************************************************/
  1941. X/*                                                                           */
  1942. X/*  OBJECT CrossGenTag(x)                                                    */
  1943. X/*                                                                           */
  1944. X/*  Generate a tag suitable for labelling closure x, in such a way that      */
  1945. X/*  the same tag is likely to be generated on subsequent runs.               */
  1946. X/*                                                                           */
  1947. X/*****************************************************************************/
  1948. X
  1949. XOBJECT CrossGenTag(x)
  1950. XOBJECT x;
  1951. X{ unsigned char buff[MAX_LINE], *str1, *str2;
  1952. X  OBJECT sym, cs, gt, res;  FILE_NUM fnum;
  1953. X  unsigned char *sgt;
  1954. X  int seq;
  1955. X  debug1(DCR, D, "CrossGenTag( %s )", SymName(actual(x)));
  1956. X  sym = actual(x);
  1957. X  if( cross_sym(sym) == nil )  CrossInit(sym);
  1958. X  cs = cross_sym(sym);
  1959. X  fnum = file_num(fpos(x));
  1960. X  /* ***
  1961. X  if( fnum != gentag_file(cs) )
  1962. X  { gentag_file(cs) = fnum;
  1963. X    gentag_seq(cs)  = 0;
  1964. X  }
  1965. X  *** */
  1966. X  str1 = FullSymName(sym, ".");
  1967. X  str2 = FileName(fnum);
  1968. X  gt = gentag_fseq(cs);
  1969. X  sgt = string(gt);
  1970. X  seq = ++(sgt[fnum]);
  1971. X  if( strlen(str1) + strlen(str2) + 10 >= MAX_LINE )
  1972. X    Error(FATAL,no_fpos, "automatically generated tag \"%s.%s.%d\" is too long",
  1973. X    str1, str2, seq);
  1974. X  sprintf(buff, "\"%s.%s.%d\"", str1, str2, seq);
  1975. X  res = MakeWord(buff, &fpos(x));
  1976. X  debug1(DCR, DD, "CrossGenTag returning %s", string(res));
  1977. X  return res;
  1978. X} /* end CrossGenTag */
  1979. X
  1980. X
  1981. X/*@@**************************************************************************/
  1982. X/*                                                                           */
  1983. X/*  OBJECT CrossMake(sym, val, ctype)                                        */
  1984. X/*                                                                           */
  1985. X/*  Make a cross-reference with the given sym and tag value.                 */
  1986. X/*  NB The fpos fields are not set, so we cannot EchofilePos from this.      */
  1987. X/*                                                                           */
  1988. X/*****************************************************************************/
  1989. X
  1990. XOBJECT CrossMake(sym, val, ctype)
  1991. XOBJECT sym, val;  int ctype;
  1992. X{ OBJECT v1, res;
  1993. X  debug3(DCR, DD, "CrossMake(%s, %s, %s)", SymName(sym),
  1994. X        EchoObject(null, val), Image(ctype));
  1995. X  res = New(CROSS);
  1996. X  cross_type(res) = ctype;  threaded(res) = FALSE;
  1997. X  v1 = New(CLOSURE);  actual(v1) = sym;
  1998. X  Link(res, v1);  Link(res, val);
  1999. X  debug1(DCR, DD, "CrossMake returning %s", EchoObject(null, res));
  2000. X  return res;
  2001. X}
  2002. X
  2003. X
  2004. X/*****************************************************************************/
  2005. X/*                                                                           */
  2006. X/*  OBJECT GallTargEval(sym, dfpos)                                          */
  2007. X/*                                                                           */
  2008. X/*  Produce a suitable cross-reference for a galley target.                  */
  2009. X/*                                                                           */
  2010. X/*****************************************************************************/
  2011. X
  2012. XOBJECT GallTargEval(sym, dfpos)
  2013. XOBJECT sym; FILE_POS *dfpos;
  2014. X{ OBJECT cs, res;
  2015. X  unsigned char buff[MAX_LINE], *str;
  2016. X  debug2(DCR, DD, "GallTargEval( %s,%s )", SymName(sym), EchoFilePos(dfpos));
  2017. X  if( cross_sym(sym) == nil )  CrossInit(sym);
  2018. X  cs = cross_sym(sym);
  2019. X  if( file_num(*dfpos) != gall_tfile(cs) )
  2020. X  { gall_tfile(cs) = file_num(*dfpos);
  2021. X    gall_seq(cs)   = 0;
  2022. X  }
  2023. X  str = FileName(gall_tfile(cs));
  2024. X  if( strlen(str) + 6 >= MAX_LINE )
  2025. X    Error(FATAL, dfpos, "automatically generated tag %s&%d is too long",
  2026. X    str, ++gall_seq(cs));
  2027. X  sprintf(buff, "%s&%d", str, ++gall_seq(cs));
  2028. X  res = CrossMake(sym, MakeWord(buff, dfpos), GALL_TARG);
  2029. X  debug1(DCR, DD, "GallTargEval returning %s", EchoObject(null, res));
  2030. X  return res;
  2031. X} /* end GallTargEval */
  2032. X
  2033. X
  2034. X/*@@**************************************************************************/
  2035. X/*                                                                           */
  2036. X/*  OBJECT CrossExpand(x, env, style, crs_wanted, crs, res_env)              */
  2037. X/*                                                                           */
  2038. X/*  Return the value of cross-reference x, with environment *res_env.  If x  */
  2039. X/*  has a non-literal tag, it must be tracked, so an object is added to *crs */
  2040. X/*  for this purpose if crs_wanted.  Result replaces x, which is disposed.   */
  2041. X/*                                                                           */
  2042. X/*****************************************************************************/
  2043. Xstatic OBJECT nbt[2] = { nil, nil };
  2044. Xstatic OBJECT nft[2] = { nil, nil };
  2045. Xstatic OBJECT ntarget = nil;
  2046. X
  2047. XOBJECT CrossExpand(x, env, style, crs_wanted, crs, res_env)
  2048. XOBJECT x, env;  STYLE *style;  BOOLEAN crs_wanted; OBJECT *crs, *res_env;
  2049. X{ OBJECT sym, res, tag, y, cs, link, db, tmp, index;
  2050. X  int ctype;  unsigned char buff[MAX_LINE], seq[MAX_LINE], *str;
  2051. X  FILE_NUM fnum, dfnum;
  2052. X  long cont, dfpos;
  2053. X  assert( type(x) == CROSS, "CrossExpand: x!" );
  2054. X  debug2(DCR, DD, "CrossExpand( %s, %s )",
  2055. X    EchoObject(null, x), EchoObject(null, *crs));
  2056. X  assert( NextDown(Down(x)) == LastDown(x), "CrossExpand: #args!" );
  2057. X
  2058. X  /* manifest and tidy the right parameter */
  2059. X  Child(tag, LastDown(x));
  2060. X  tag = Manifest(tag, env, style, nbt, nft, &ntarget, crs, FALSE, FALSE);
  2061. X  tag = ReplaceWithTidy(tag);
  2062. X
  2063. X  /* extract sym (the symbol name) and tag (the tag value) from x */
  2064. X  Child(y, Down(x));
  2065. X  if( type(y) == CLOSURE )  sym = actual(y);
  2066. X  ctype = type(y) != CLOSURE ? 1 :
  2067. X      type(tag) != WORD ? 2 :
  2068. X      string(tag)[0] == '\0' ? 3 :
  2069. X      strcmp(string(tag), KW_PRECEDING) == 0 ? CROSS_PREC :
  2070. X      strcmp(string(tag), KW_FOLLOWING) == 0 ? CROSS_FOLL : CROSS_LIT;
  2071. X
  2072. X  res = nil;
  2073. X  switch( ctype )
  2074. X  {
  2075. X
  2076. X    case 1:
  2077. X
  2078. X      Error(WARN, &fpos(y), "left parameter of %s is not a symbol", KW_CROSS);
  2079. X      break;
  2080. X
  2081. X
  2082. X    case 2:
  2083. X
  2084. X      Error(WARN, &fpos(tag),
  2085. X    "value of right parameter of %s is not a simple word", KW_CROSS);
  2086. X      break;
  2087. X
  2088. X
  2089. X    case 3:
  2090. X    
  2091. X      Error(WARN, &fpos(tag),
  2092. X    "value of right parameter of %s is an empty word", KW_CROSS);
  2093. X      break;
  2094. X
  2095. X
  2096. X    case CROSS_LIT:
  2097. X    
  2098. X      if( cross_sym(sym) == nil )  CrossInit(sym);
  2099. X      cs = cross_sym(sym);
  2100. X      if( sym == MomentSym && strcmp(string(tag), KW_NOW) == 0 )
  2101. X      {    /* this is a request for the current time */
  2102. X    res = StartMoment();
  2103. X      }
  2104. X      else for( link = NextUp(Up(cs));  link != cs;  link = NextUp(link) )
  2105. X      {    Parent(db, link);
  2106. X    assert( type(db) == WORD, "CrossExpand: db!" );
  2107. X    if( DbRetrieve(db, FALSE, sym, string(tag), seq, &dfnum,&dfpos,&cont) )
  2108. X    { res = ReadFromFile(dfnum, dfpos, sym);
  2109. X      if( db != OldCrossDb )  AttachEnv(env, res);
  2110. X      break;
  2111. X    }
  2112. X      }
  2113. X      break;
  2114. X
  2115. X
  2116. X    case CROSS_PREC:
  2117. X    case CROSS_FOLL:
  2118. X    
  2119. X      if( cross_sym(sym) == nil )  CrossInit(sym);
  2120. X      cs = cross_sym(sym);
  2121. X      assert( cs != nil, "CrossExpand/CROSS_FOLL: cs == nil!" );
  2122. X      assert( type(cs) == CROSS_SYM, "CrossExpand/CROSS_FOLL: type(cs)!" );
  2123. X      fnum = file_num(fpos(tag));
  2124. X      if( fnum != cr_file(cs) )
  2125. X      {    cr_file(cs) = fnum;
  2126. X    cr_seq(cs) = 0;
  2127. X      }
  2128. X      str = FileName(fnum);
  2129. X      if( strlen(str) + 5 >= MAX_LINE )
  2130. X    Error(FATAL, &fpos(x), "automatically generated tag %s_%d is too long",
  2131. X      str, ++cr_seq(cs));
  2132. X      sprintf(buff, "%s_%d", str, ++cr_seq(cs));
  2133. X      tmp = CrossMake(sym, MakeWord(buff, &fpos(tag)), ctype);
  2134. X      index = New(ctype);
  2135. X      actual(index) = tmp;
  2136. X      Link(index, tmp);
  2137. X      if( crs_wanted )
  2138. X      {    if( *crs == nil )  *crs = New(CR_LIST);
  2139. X    link = Link(*crs, index);
  2140. X      }
  2141. X      else Error(FATAL, &fpos(x), "%s or %s tag not allowed here",
  2142. X    KW_PRECEDING, KW_FOLLOWING);
  2143. X      if( AllowCrossDb &&
  2144. X      DbRetrieve(OldCrossDb, FALSE, sym, buff, seq, &dfnum, &dfpos,&cont) )
  2145. X    res = ReadFromFile(dfnum, dfpos, nil);
  2146. X      break;
  2147. X
  2148. X
  2149. X    default:
  2150. X    
  2151. X      Error(INTERN, no_fpos, "CrossExpand switch!");
  2152. X      break;
  2153. X
  2154. X
  2155. X  } /* end switch */
  2156. X  if( res == nil )
  2157. X  { OBJECT envt;
  2158. X    if( ctype > 1 )  Error(WARN, &fpos(x), "%s%s%s unknown",
  2159. X        SymName(sym), KW_CROSS, string(tag));
  2160. X
  2161. X    /* build dummy result with environment attached */
  2162. X    /* nb at present we are not adding dummy import closures to this! */
  2163. X    res = New(CLOSURE);  actual(res) = sym;
  2164. X    y = res;
  2165. X    debug1(DCR, DD, "First y = %s", SymName(actual(y)));
  2166. X    while( enclosing(actual(y)) != StartSym )
  2167. X    { tmp = New(CLOSURE);
  2168. X      actual(tmp) = enclosing(actual(y));
  2169. X      envt = SetEnv(tmp, nil);
  2170. X      AttachEnv(envt, y);
  2171. X      y = tmp;
  2172. X      debug1(DCR, DD, "Later y = %s", SymName(actual(y)));
  2173. X    }
  2174. X    envt = New(ENV);  Link(y, envt);
  2175. X  }
  2176. X
  2177. X  /* set environment, replace x by res, debug and exit */
  2178. X  *res_env = DetachEnv(res);
  2179. X  ReplaceNode(res, x);
  2180. X  DisposeObject(x);
  2181. X  debug1(DCR, DD, "CrossExpand returning %s", EchoObject(null, res));
  2182. X  debug1(DCR, DD, "  *crs = %s", EchoObject(null, *crs));
  2183. X  debug1(DCR, DD, "  *res_env = %s", EchoObject(null, *res_env));
  2184. X  return res;
  2185. X} /* end CrossExpand */
  2186. X
  2187. X
  2188. X/*@@**************************************************************************/
  2189. X/*                                                                           */
  2190. X/*  CrossSequence(x)                                                         */
  2191. X/*                                                                           */
  2192. X/*  Object x is an insinuated cross-reference that has just been popped off  */
  2193. X/*  the top of the root galley.  Resolve it with the sequence of others.     */
  2194. X/*                                                                           */
  2195. X/*****************************************************************************/
  2196. X
  2197. XCrossSequence(x)
  2198. XOBJECT x;
  2199. X{ OBJECT sym, tag, val, tmp, cs, par, key, link, y;
  2200. X  unsigned ctype;  unsigned char buff[MAX_LINE], *str, *seq;
  2201. X  FILE_NUM dfnum;  int dfpos;
  2202. X
  2203. X  /* if suppressing cross-referencing, dispose x and quit */
  2204. X  if( !AllowCrossDb )
  2205. X  { if( Up(x) == x )  DisposeObject(x);
  2206. X    debug0(DCR, D, "CrossSequence returning (!AllowCrossDb).");
  2207. X    return;
  2208. X  }
  2209. X
  2210. X  /* get interesting fragments from x */
  2211. X  assert( type(x) == CROSS, "CrossSequence: type(x)!" );
  2212. X  ctype = cross_type(x);
  2213. X  Child(tmp, Down(x));
  2214. X  assert( type(tmp) == CLOSURE, "CrossSequence: type(tmp)!" );
  2215. X  sym = actual(tmp);
  2216. X  if( cross_sym(sym) == nil )  CrossInit(sym);
  2217. X  cs = cross_sym(sym);
  2218. X  assert( type(cs) == CROSS_SYM, "CrossSequence: cs!" );
  2219. X
  2220. X  /* debug output */
  2221. X  debug2(DCR, D, "CrossSequence %s %s", Image(ctype), SymName(sym));
  2222. X  debug1(DCR, DD, "  x = %s", EchoObject(null, x));
  2223. X  ifdebug(DCR, DD, EchoObject(stderr, cs));
  2224. X
  2225. X  /* delete as much of x as possible */
  2226. X  Child(tag, NextDown(Down(x)));
  2227. X  DeleteLink(NextDown(Down(x)));
  2228. X  if( Up(x) == x )  DisposeObject(x);
  2229. X
  2230. X  switch( ctype )
  2231. X  {
  2232. X    case GALL_FOLL:
  2233. X    case GALL_PREC:
  2234. X
  2235. X      /* find key of the galley, if any */
  2236. X      val = tag;  key = nil;
  2237. X      for( link = Down(val);  link != val;  link = NextDown(link) )
  2238. X      {    Child(par, link);
  2239. X    if( type(par) == PAR && (is_key(actual(par)) || is_tag(actual(par))) )
  2240. X    { assert( Down(par) != par, "CrossSequence: PAR child!" );
  2241. X      Child(key, Down(par));
  2242. X      key = ReplaceWithTidy(key);
  2243. X    }
  2244. X      }
  2245. X
  2246. X      /* write out the galley */
  2247. X      str = FileName(file_num(fpos(val)));
  2248. X      if( strlen(str) + strlen(DATA_SUFFIX) >= MAX_LINE )
  2249. X    Error(FATAL, &fpos(val), "database file name %s%s is too long",
  2250. X        str, DATA_SUFFIX);
  2251. X      sprintf(buff, "%s%s", str, DATA_SUFFIX);
  2252. X      dfnum = FileNum(buff);
  2253. X      if( dfnum == NO_FILE )
  2254. X    dfnum = DefineFile(MakeWord(buff, &fpos(val)),
  2255. X                DATABASE_FILE, SOURCE_PATH);
  2256. X      AppendToFile(val, dfnum, &dfpos);
  2257. X
  2258. X      /* determine the sequence number or string of this galley */
  2259. X      if( key == nil )
  2260. X      {    sprintf(buff, "%.5d", ++gall_seq(cs));
  2261. X    seq = buff;
  2262. X      }
  2263. X      else if( type(key) != WORD )
  2264. X      {    Error(WARN, &fpos(key), "%s parameter is not a word", KW_KEY);
  2265. X    seq = (unsigned char *) "badkey";
  2266. X      }
  2267. X      else if(  string(key)[0] == '\0' )
  2268. X      {    Error(WARN, &fpos(key), "%s parameter is empty word", KW_KEY);
  2269. X    seq = (unsigned char *) "badkey";
  2270. X      }
  2271. X      else seq = string(key);
  2272. X
  2273. X      /* either write out the index immediately or store it for later */
  2274. X      if( ctype == GALL_PREC )
  2275. X      {    if( gall_tag(cs) == nil )
  2276. X    { Error(WARN, &fpos(val), "no %s precedes this %s%s%s",
  2277. X        SymName(sym), SymName(sym), KW_CROSS, KW_PRECEDING);
  2278. X      debug0(DCR, DD, "  ... so substituting \"none\"");
  2279. X      gall_tag(cs) = MakeWord("none", &fpos(val));
  2280. X    }
  2281. X    assert( type(gall_tag(cs)) == WORD && string(gall_tag(cs))[0] != '\0',
  2282. X            "CrossSequence: gall_tag!" );
  2283. X    debug3(DCR, D, "  inserting galley (prec) %s&%s %s", SymName(sym),
  2284. X      string(gall_tag(cs)), seq);
  2285. X    DbInsert(NewCrossDb, TRUE, sym, string(gall_tag(cs)), seq,
  2286. X            dfnum, (long) dfpos);
  2287. X      }
  2288. X      else
  2289. X      {    tmp = MakeWord(seq, &fpos(val));
  2290. X    gall_rec(tmp) = TRUE;
  2291. X    file_num(fpos(tmp)) = dfnum;
  2292. X    gall_pos(tmp) = dfpos;
  2293. X    Link(cs, tmp);
  2294. X    debug2(DCR, D, "  saving galley (foll) %s&? %s", SymName(sym), seq);
  2295. X      }
  2296. X      DisposeObject(val);
  2297. X      break;
  2298. X
  2299. X
  2300. X    case GALL_TARG:
  2301. X
  2302. X      if( gall_tag(cs) != nil )  DisposeObject(gall_tag(cs));
  2303. X      if( type(tag) != WORD || string(tag)[0] == '\0' )
  2304. X      {
  2305. X    debug2(DCR, DD, "  GALL_TARG %s put none for %s",
  2306. X      SymName(sym), EchoObject(null, tag));
  2307. X    DisposeObject(tag);
  2308. X    gall_tag(cs) = MakeWord("none", no_fpos);
  2309. X      }
  2310. X      else gall_tag(cs) = tag;
  2311. X      debug2(DCR, D, "  have new %s gall_targ %s", SymName(sym),
  2312. X      EchoObject(null, gall_tag(cs)));
  2313. X      for( link = Down(cs);  link != cs;  link = NextDown(link) )
  2314. X      {    Child(y, link);
  2315. X    assert( type(y) == WORD && string(y)[0] != '\0',
  2316. X                "CrossSequence: GALL_TARG y!" );
  2317. X    if( gall_rec(y) )
  2318. X    {
  2319. X      debug3(DCR, D, "  inserting galley (foll) %s&%s %s", SymName(sym),
  2320. X        string(gall_tag(cs)), string(y));
  2321. X      DbInsert(NewCrossDb, TRUE, sym, string(gall_tag(cs)), string(y),
  2322. X            file_num(fpos(y)), (long) gall_pos(y));
  2323. X      link = PrevDown(link);
  2324. X      DisposeChild(NextDown(link));
  2325. X    }
  2326. X      }
  2327. X      break;
  2328. X
  2329. X
  2330. X    case CROSS_PREC:
  2331. X
  2332. X      if( target_state(cs) == NO_TARGET )
  2333. X      {    Error(WARN, &fpos(tag), "no invokation of %s precedes this %s%s%s",
  2334. X        SymName(sym), SymName(sym), KW_CROSS, KW_PRECEDING);
  2335. X    break;
  2336. X      }
  2337. X      if( target_state(cs) == SEEN_TARGET )
  2338. X      {
  2339. X    debug2(DCR, D, "  inserting %s cross_targ %s",
  2340. X      SymName(sym), target_val(cs));
  2341. X    AppendToFile(target_val(cs), target_file(cs), &target_pos(cs));
  2342. X    DisposeObject(target_val(cs));
  2343. X    target_val(cs) = nil;
  2344. X    target_state(cs) = WRITTEN_TARGET;
  2345. X      }
  2346. X      if( type(tag) != WORD || string(tag)[0] == '\0' )
  2347. X      {
  2348. X    debug2(DCR, DD, "  GALL_TARG %s put none for %s", SymName(sym),
  2349. X        EchoObject(null, tag));
  2350. X    DisposeObject(tag);
  2351. X    tag = MakeWord("none", no_fpos);
  2352. X      }
  2353. X      debug3(DCR, D, "  inserting cross (prec) %s&%s %s", SymName(sym),
  2354. X        string(tag), "0");
  2355. X      DbInsert(NewCrossDb, FALSE, sym, string(tag), "0", target_file(cs),
  2356. X            (long) target_pos(cs));
  2357. X      DisposeObject(tag);
  2358. X      break;
  2359. X
  2360. X
  2361. X    case CROSS_FOLL:
  2362. X
  2363. X      if( type(tag) != WORD )
  2364. X      {    Error(WARN, &fpos(tag), "tag of %s is not a simple word",
  2365. X        SymName(symb(cs)));
  2366. X    debug1(DCR, DD, "  tag = %s", EchoObject(null, tag));
  2367. X      }
  2368. X      else if( string(tag)[0] == '\0' )
  2369. X      {
  2370. X        debug1(DCR, D, "  ignoring cross (foll) %s (empty tag)", SymName(sym));
  2371. X      }
  2372. X      else
  2373. X      { Link(cs, tag);
  2374. X    gall_rec(tag) = FALSE;
  2375. X        debug3(DCR, D, "  storing cross (foll) %s&%s %s", SymName(sym),
  2376. X        string(tag), "?");
  2377. X      }
  2378. X      break;
  2379. X
  2380. X
  2381. X    case CROSS_TARG:
  2382. X
  2383. X      /* get rid of old target, if any, and add new one */
  2384. X      if( target_state(cs) == SEEN_TARGET )
  2385. X      {
  2386. X    debug2(DCR, D, "  disposing unused %s cross_targ %s", SymName(sym),
  2387. X      target_val(cs));
  2388. X    DisposeObject(target_val(cs));
  2389. X      }
  2390. X      debug2(DCR, D, "  remembering new %s cross_targ %s", SymName(sym),
  2391. X    EchoObject(null, tag));
  2392. X      target_val(cs) = tag;
  2393. X      assert( Up(tag) == tag, "CrossSeq: Up(tag)!" );
  2394. X      str = FileName(file_num(fpos(tag)));
  2395. X      if( strlen(str) + strlen(DATA_SUFFIX) >= MAX_LINE )
  2396. X    Error(FATAL, &fpos(tag), "database file name %s%s is too long",
  2397. X        str, DATA_SUFFIX);
  2398. X      sprintf(buff, "%s%s", str, DATA_SUFFIX);
  2399. X      target_file(cs) = FileNum(buff);
  2400. X      if( target_file(cs) == NO_FILE )
  2401. X    target_file(cs) = DefineFile(MakeWord(buff, &fpos(tag)),
  2402. X                    DATABASE_FILE, SOURCE_PATH);
  2403. X      target_state(cs) = SEEN_TARGET;
  2404. X
  2405. X      /* store tag of the galley, if any */
  2406. X      tag = nil;
  2407. X      assert( type(target_val(cs)) == CLOSURE, "CrossSequence: target_val!" );
  2408. X      link = Down(target_val(cs));
  2409. X      for( ;  link != target_val(cs);  link = NextDown(link) )
  2410. X      {    Child(par, link);
  2411. X    if( type(par) == PAR && is_tag(actual(par)) )
  2412. X    { assert( Down(par) != par, "CrossSequence: Down(PAR)!" );
  2413. X      Child(tag, Down(par));
  2414. X      tag = ReplaceWithTidy(tag);
  2415. X      if( type(tag) != WORD )
  2416. X      { Error(WARN, &fpos(tag), "%s tag is not a simple word",
  2417. X            SymName(actual(target_val(cs))));
  2418. X        debug1(DCR, DD, "  tag = %s", EchoObject(null, tag));
  2419. X      }
  2420. X      else if( string(tag)[0] == '\0' )
  2421. X      {
  2422. X            debug1(DCR, D, "  ignoring cross (own tag) %s (empty tag)",
  2423. X        SymName(sym));
  2424. X      }
  2425. X      else
  2426. X      { Link(cs, tag);
  2427. X        gall_rec(tag) = FALSE;
  2428. X            debug3(DCR, D, "  storing cross (own tag) %s&%s %s", SymName(sym),
  2429. X        string(tag), "?");
  2430. X      }
  2431. X      break;
  2432. X    }
  2433. X      }
  2434. X
  2435. X      /* if new target is already writable, write it */
  2436. X      if( Down(cs) != cs )
  2437. X      {
  2438. X    debug2(DCR, D, "  writing %s cross_targ %s", SymName(sym),
  2439. X        EchoObject(null, target_val(cs)));
  2440. X    AppendToFile(target_val(cs), target_file(cs), &target_pos(cs));
  2441. X    DisposeObject(target_val(cs));
  2442. X    for( link = Down(cs);  link != cs;  link = NextDown(link) )
  2443. X    { Child(tag, link);
  2444. X      assert( type(tag) == WORD && string(tag)[0] != '\0',
  2445. X            "CrossSeq: non-WORD or empty tag!" );
  2446. X      if( !gall_rec(tag) )
  2447. X      {
  2448. X        debug3(DCR, D, "  inserting cross (foll) %s&%s %s", SymName(sym),
  2449. X          string(tag), "0");
  2450. X        DbInsert(NewCrossDb, FALSE, sym, string(tag),
  2451. X            "0", target_file(cs), (long) target_pos(cs));
  2452. X        link = PrevDown(link);
  2453. X        DisposeChild(NextDown(link));
  2454. X      }
  2455. X    }
  2456. X    target_state(cs) = WRITTEN_TARGET;
  2457. X      }
  2458. X      break;
  2459. X
  2460. X
  2461. X    default:
  2462. X
  2463. X      Error(INTERN, &fpos(tag), "CrossSequence: ctype = %s", Image(ctype));
  2464. X      break;
  2465. X
  2466. X  } /* end switch */
  2467. X  debug0(DCR, D, "CrossSequence returning.");
  2468. X  debug0(DCR, DD, "   cs =");
  2469. X  ifdebug(DCR, DD, EchoObject(stderr, cs));
  2470. X} /* end CrossSequence */
  2471. X
  2472. X
  2473. X/*@@**************************************************************************/
  2474. X/*                                                                           */
  2475. X/*  CrossClose()                                                             */
  2476. X/*                                                                           */
  2477. X/*  Check for dangling forward references, and convert old cross reference   */
  2478. X/*  database to new one.                                                     */
  2479. X/*                                                                           */
  2480. X/*****************************************************************************/
  2481. X
  2482. XCrossClose()
  2483. X{ OBJECT link, cs, ylink, y, sym;  BOOLEAN g;  int len, count;
  2484. X  FILE_NUM dfnum;  long dfpos, cont;
  2485. X  unsigned char buff[MAX_LINE], seq[MAX_LINE], tag[MAX_LINE];
  2486. X  debug0(DCR, D, "CrossClose()");
  2487. X  ifdebug(DCR, DD, if( RootCross != nil ) EchoObject(stderr, RootCross));
  2488. X
  2489. X  /* if suppressing cross referencing, return */
  2490. X  if( !AllowCrossDb )
  2491. X  { debug0(DCR, D, "CrossClose returning (!AllowCrossDb).");
  2492. X    return;
  2493. X  }
  2494. X
  2495. X  /* check for dangling forward references and dispose cross ref structures */
  2496. X  if( RootCross != nil )
  2497. X  { for( link = Down(RootCross);  link != RootCross;  link = NextDown(link) )
  2498. X    { Child(cs, link);
  2499. X      assert( type(cs) == CROSS_SYM, "CrossClose: type(cs)!" );
  2500. X      count = 0;  ylink = Down(cs);
  2501. X      while( ylink != cs && count <= 5 )
  2502. X      {    Child(y, ylink);
  2503. X    Error(WARN, &fpos(y), "no invokation of %s follows this %s%s%s",
  2504. X        SymName(symb(cs)), SymName(symb(cs)), KW_CROSS, KW_FOLLOWING);
  2505. X    debug2(DCR, D, "gall_rec(y) = %s, y = %s",
  2506. X            bool(gall_rec(y)), EchoObject(null, y));
  2507. X    if( gall_rec(y) ) DbInsert(NewCrossDb, TRUE, symb(cs), "none",
  2508. X            string(y), file_num(fpos(y)), (long) gall_pos(y));
  2509. X    count++;  ylink = NextDown(ylink);
  2510. X      }
  2511. X      if( ylink != cs )  Error(WARN, no_fpos, "and more undefined %s%s%s",
  2512. X                SymName(symb(cs)), KW_CROSS, KW_FOLLOWING);
  2513. X      ifdebug(ANY, D,
  2514. X    if( target_state(cs) == SEEN_TARGET )  DisposeObject(target_val(cs));
  2515. X    if( gall_tag(cs) != nil )  DisposeObject(gall_tag(cs));
  2516. X      );
  2517. X    }
  2518. X    ifdebug(ANY, D, DisposeObject(RootCross); );
  2519. X  }
  2520. X
  2521. X  /* add to NewCrossDb those entries of OldCrossDb from other source files */
  2522. X  if( AllowCrossDb )
  2523. X  cont = 0L;  len = strlen(DATA_SUFFIX);
  2524. X  while( DbRetrieveNext(OldCrossDb, &g, &sym, tag, seq, &dfnum, &dfpos, &cont) )
  2525. X  { if( g ) continue;
  2526. X    strcpy(buff, FileName(dfnum));
  2527. X    buff[strlen(buff) - len] = '\0';
  2528. X    if( FileNum(buff) == NO_FILE )
  2529. X      DbInsert(NewCrossDb, FALSE, sym, tag, seq, dfnum, dfpos);
  2530. X  }
  2531. X
  2532. X  /* make NewCrossDb readable, for next run */
  2533. X  DbConvert(NewCrossDb, TRUE);
  2534. X
  2535. X  debug0(DCR, D, "CrossClose returning.");
  2536. X} /* end CrossClose */
  2537. END_OF_FILE
  2538.   if test 24737 -ne `wc -c <'lout/z10.c'`; then
  2539.     echo shar: \"'lout/z10.c'\" unpacked with wrong size!
  2540.   fi
  2541.   # end of 'lout/z10.c'
  2542. fi
  2543. echo shar: End of archive 4 \(of 30\).
  2544. cp /dev/null ark4isdone
  2545. MISSING=""
  2546. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  2547.     if test ! -f ark${I}isdone ; then
  2548.     MISSING="${MISSING} ${I}"
  2549.     fi
  2550. done
  2551. if test "${MISSING}" = "" ; then
  2552.     echo You have unpacked all 30 archives.
  2553.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2554. else
  2555.     echo You still must unpack the following archives:
  2556.     echo "        " ${MISSING}
  2557. fi
  2558. exit 0
  2559. exit 0 # Just in case...
  2560.