home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-11 | 74.1 KB | 2,041 lines |
- Newsgroups: comp.sources.misc
- From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
- Subject: v38i094: lout - Lout document formatting system, v2.05, Part26/35
- Message-ID: <1993Aug10.132121.18626@sparky.sterling.com>
- X-Md4-Signature: 648b4be7cd28fd903e1504e79dece980
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Tue, 10 Aug 1993 13:21:21 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
- Posting-number: Volume 38, Issue 94
- Archive-name: lout/part26
- Environment: UNIX
- Supersedes: lout: Volume 37, Issue 99-128
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: doc/tr.begin/s02 doc/tr.impl/s2.3 doc/tr.impl/s5.2
- # doc/tr.impl/setup doc/tr.lout/ch3.02 gnu.gpl
- # Wrapped by kent@sparky on Sun Aug 8 12:29:31 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 26 (of 35)."'
- if test -f 'doc/tr.begin/s02' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/tr.begin/s02'\"
- else
- echo shar: Extracting \"'doc/tr.begin/s02'\" \(5199 characters\)
- sed "s/^X//" >'doc/tr.begin/s02' <<'END_OF_FILE'
- X@Section
- X @Tag { displays }
- X @Title { Displays }
- X@Begin
- X@PP
- XThe @Code "@Display" symbol displays the following thing in the centre
- Xof the page or column:
- X@ID @Code "@Display @I Centred"
- Xhas result
- X@Display @I Centred
- XNotice that @Code "@I Centred" does not have to be grouped within braces;
- Xit is already a single thing. Spaces (@Code "@DP" symbols) are inserted
- Xautomatically above and below the display, so no paragraph symbols are
- Xneeded anywhere near the display.
- X@PP
- XThe display can be made to appear at the left margin by using the
- X{@Code "@LeftDisplay"} symbol instead of {@Code "@Display"}, or indented
- Xby using {@Code "@IndentedDisplay"}. There are also @Code "@CentredDisplay"
- Xand @Code "@CenteredDisplay" symbols which are the same as
- X{@Code "@Display"}. In general, the word @Code Centred may be spelt
- X@Code Centered wherever it appears.
- X@PP
- XEach display symbol has a `raw' version, which means that no space is
- Xinserted above or below; the user must therefore add paragraph symbols:
- X@ID @Code {
- X"... preceding text."
- X"@DP"
- X"@RawIndentedDisplay @I Emma"
- X"@DP"
- X"@RawIndentedDisplay @I"
- X"{ Mansfield Park }"
- X"@DP"
- X"following text ..."
- X}
- Xhas result
- X@ID {
- X... preceding text.
- X@DP
- X@RawIndentedDisplay @I Emma
- X@DP
- X@RawIndentedDisplay @I { Mansfield Park }
- X@DP
- Xfollowing text ...
- X}
- XThe point of this particular example is that two consecutive non-raw
- Xdisplays would be separated by two @Code "@DP" symbols, which is too
- Xmuch. A better way to do this, using a list, will be presented in the
- Xnext section.
- X@PP
- XDisplays may be {@I aligned}, which means that nominated points within a
- Xsequence of displays are made to appear directly beneath each
- Xother. Displays may also be {@I numbered}, which means that an
- Xautomatically generated number is placed at the right-hand margin. For
- Xexample, here is a first display:
- X@BeginNumberedDisplays
- X@BeginAlignedDisplays
- X@CentredAlignedNumberedDisplay
- X @Tag { fibeq }
- X@Eq { F sub n ^= F sub n-1 + F sub n-2 }
- Xand here is a second display, which is aligned on its @Eq {equal} sign
- Xwith the first, and also numbered in sequence with it:
- X@CentredAlignedNumberedDisplay
- X@Eq { F sub n - F sub n-1 ^= F sub n-2 }
- X@EndNumberedDisplays
- X@EndAlignedDisplays
- XMathematical examples have been chosen because they are the most common
- Xaligned and numbered displays; but any kind of display may be aligned or
- Xnumbered.
- X@PP
- XNotice that the two displays are centred as a block as well as
- Xaligned. Altogether then we have four ways in which displays vary:
- X@BL
- X@LI { A display can be raw or not raw; }
- X@LI { It can be a {@Code "@Display"}, {@Code "@LeftDisplay"},
- X{@Code "@IndentedDisplay"}, {@Code "@CentredDisplay"} or
- X{@Code "@CenteredDisplay"}; }
- X@LI { It can be aligned or not aligned; }
- X@LI { It can be numbered or not numbered. }
- X@EL
- XAll possible combinations are allowed. The display that has everything
- Xis called
- X@ID @Code { "@RawCentredAlignedNumberedDisplay" &0io }
- XBy leaving out some or all of {@Code Raw}, {@Code Aligned}, and
- X{@Code Numbered}, and by changing or leaving out {@Code Centred},
- Xwe get all these combinations.
- X@PP
- XWhen aligned displays are used, it is necessary to indicate where the
- Xaligned group begins and ends, by inserting @Code "@BeginAlignedDisplays"
- Xjust before the first, and @Code "@EndAlignedDisplays" just after the
- Xlast. The alignment points are indicated by preceding them by the
- Xsymbol {@Code "^"}. Numbered displays are similarly bracketed by
- X@Code "@BeginNumberedDisplays" and {@Code "@EndNumberedDisplays"}. So
- Xthen, with the help of the @Code "@Eq" equation formatting package
- X[{@Ref kingston92eq}], here is the input for the two displays given
- Xearlier:
- X@ID @Code {
- X"... a first display:"
- X"@BeginNumberedDisplays"
- X"@BeginAlignedDisplays"
- X"@CentredAlignedNumberedDisplay"
- X" @Tag { fibeq }"
- X@OneCol { "@Eq { F sub n ^= F sub n-1 + F sub n-2 }" &0io }
- X"and ... in sequence with it:"
- X"@CentredAlignedNumberedDisplay"
- X@OneCol { "@Eq { F sub n - F sub n-1 ^= F sub n-2 }" &0io }
- X"@EndNumberedDisplays"
- X"@EndAlignedDisplays"
- X"Mathematical examples ..."
- X}
- XNo braces need enclose @Code "@Eq { ... }" because it is already a
- Xsingle entity. The @Code "@Tag { fibeq }" part is optional and is
- Xexplained in Section {@NumberOf cross}. Alignment and numbering work
- Xquite independently; they don't have to start or end together, and there
- Xcan be non-aligned and non-numbered displays among the others.
- X@PP
- X@Code "@BeginNumberedDisplays" has two {@I options}: subsidiary
- Xsymbols which modify the result. For example,
- X@ID @Code {
- X"@BeginNumberedDisplays"
- X" style { [tag] }"
- X" start { 12.5 }"
- X}
- Xwill cause the associated numbered displays to be labelled [12.5],
- X[12.6], and so on. The first label is the @Code style option with
- X@Code tag replaced by the @Code start option. Font changes and other
- Xsymbols are acceptable within the @Code style option. When omitted, the
- Xoptions have default values @Code "(tag)" and @Code "1" respectively.
- X@PP
- XEvery symbol introduced in this section has an abbreviated form
- Xconsisting of @Code "@" followed by its capital letters only. For
- Xexample, @Code "@BeginNumberedDisplays" can be abbreviated to {@Code "@BND"},
- Xand the display that has everything to {@Code "@RCAND"}.
- X@End @Section
- END_OF_FILE
- if test 5199 -ne `wc -c <'doc/tr.begin/s02'`; then
- echo shar: \"'doc/tr.begin/s02'\" unpacked with wrong size!
- fi
- # end of 'doc/tr.begin/s02'
- fi
- if test -f 'doc/tr.impl/s2.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/tr.impl/s2.3'\"
- else
- echo shar: Extracting \"'doc/tr.impl/s2.3'\" \(12558 characters\)
- sed "s/^X//" >'doc/tr.impl/s2.3' <<'END_OF_FILE'
- X@SubSection
- X @Tag { objects }
- X @Title { Basic structural operators }
- X@Begin
- X@PP
- XA programming language may be considered complete when it attains the
- Xpower of a Turing machine, but no such criterion seems relevant to
- Xdocument formatting. Instead, as the language develops and new
- Xapplications are attempted, deficiencies are exposed and the operator set is
- Xrevised to overcome them.
- X@PP
- XLout has a repertoire of 23 primitive operators
- X(Figure {@NumberOf primitives}),
- X
- X@Figure
- X @Caption { The 23 primitive operators of Lout, in order of
- Xincreasing precedence. }
- X @Tag { primitives }
- X@Tab
- X vmargin { 0.5vx }
- X @Fmta { @Col @I A ! @Col B }
- X{
- X@Rowa
- X A { object {@Code "/"}gap object }
- X B { Vertical concatenation with mark alignment }
- X@Rowa
- X A { object {@Code "//"}gap object }
- X B { Vertical concatenation with left justification }
- X@Rowa
- X A { object {@Code "|"}gap object }
- X B { Horizontal concatenation with mark alignment }
- X@Rowa
- X A { object {@Code "||"}gap object }
- X B { Horizontal concatenation with top-justification }
- X@Rowa
- X A { object {@Code "&"}gap object }
- X B { Horizontal concatenation within paragraphs }
- X@Rowa
- X A { {@Code "@OneCol"} object }
- X B { Hide all but one column mark of @I object }
- X@Rowa
- X A { {@Code "@OneRow"} object }
- X B { Hide all but one row mark of @I object }
- X@Rowa
- X A { font @Code "@Font" object }
- X B { Render @I object in nominated font }
- X@Rowa
- X A { breakstyle @Code "@Break" object}
- X B { Break paragraphs of @I object in nominated style }
- X@Rowa
- X A { spacestyle @Code "@Space" object }
- X B { Render spaces between words in nominated style }
- X@Rowa
- X A { length {@Code "@Wide"} object }
- X B { Render @I object to width @I length }
- X@Rowa
- X A { length {@Code "@High"} object }
- X B { Render @I object to height @I length }
- X@Rowa
- X A { {@Code "@HExpand"} object}
- X B { Expand horizontal gaps to fill available space }
- X@Rowa
- X A { {@Code "@VExpand"} object}
- X B { Expand vertical gaps to fill available space }
- X@Rowa
- X A { {@Code "@HScale"} object }
- X B { Horizontal geometrical scaling to fill available space }
- X@Rowa
- X A { {@Code "@VScale"} object }
- X B { Vertical geometrical scaling to fill available space }
- X@Rowa
- X A { angle {@Code "@Rotate"} object }
- X B { Rotate @I object by @I angle }
- X@Rowa
- X A { PostScript {@Code "@Graphic"} object }
- X B { Escape to graphics language }
- X@Rowa
- X A { @Code "@Next" object }
- X B { Add 1 to an object denoting a number }
- X@Rowa
- X A { object @Code "@Case" alternatives }
- X B { Select from a set of alternative objects }
- X@Rowa
- X A { identifier @Code "&&" object }
- X B { Cross reference }
- X@Rowa
- X A { cross-reference @Code "@Open" object }
- X B { Retrieve value from cross reference }
- X@Rowa
- X A { cross-reference @Code "@Tagged" object}
- X B { Attach cross referencing tag to object }
- X}
- X
- Xwhich has proven adequate for a wide variety of features, including equations,
- Xtables, and page layout, and so seems to be reasonably complete in this
- Xpragmatic sense. In this section we introduce the eight concatenation and
- Xmark-hiding operators. To them falls the basic task of assembling complex
- Xobjects from simple ones, and they were the first
- Xto be designed and implemented.
- X@PP
- XMany of the operators of Eqn can be viewed as building small tables. A
- Xbuilt-up fraction, for example, has one column and three rows
- X(numerator, line, and denominator). Numerous investigations of this
- Xkind convinced the author that operators capable of assembling the rows
- Xand columns of tables would suffice for building all kinds of objects.
- X@PP
- XThe simplest objects are empty objects and literal words like
- X{@Code metempsychosis}, which have one column mark and one row mark:
- X@ID {
- X@ShowMarks metempsychosis
- X}
- XTo place two arbitrary objects side by side, we use the infix
- Xoperator {@Code "|"}, denoting horizontal concatenation. For
- Xexample,
- X@ID {
- X@Code "USA |0.2i Australia"
- X}
- Xproduces the object
- X@ID {
- X@ShowMarks USA |0.2i @ShowMarks Australia
- X}
- XThe row marks are merged into one, fixing the vertical position of
- Xthe objects relative to each other; their horizontal separation is
- Xdetermined by the @I gap attached to the operator, in this case 0.2
- Xinches. We think of the gap as part of the operator, although
- Xstrictly it is a third parameter. It may be omitted, defaulting to
- X{@Code "0i"}.
- X@PP
- X@I {Vertical concatenation} & , denoted by the infix operator {@Code "/"},
- Xis the same apart from the change of direction:
- X@ID {
- X@Code "Australia /0.1i USA"
- X}
- Xproduces the object
- X@ID {
- X@ShowMarks Australia /0.1i
- X@ShowMarks USA
- X}
- Xwith column marks merged and a 0.1 inch gap.
- X@PP
- XConsider now what happens when horizontal and vertical are combined:
- X@ID @Code {
- X |1m "{" USA |1m "|0.2i" |1m Australia "}"
- X/1vx "/0.1i" | "{" Washington | "|" | Canberra "}"
- X}
- XThe two parameters of @Code "/" now have two column marks each, and
- Xthey will be merged with the corresponding marks in the other
- Xparameter, yielding the object
- X@ID {
- X @ShowMarks USA &
- X { 0 ymark moveto xsize 10 pt add ymark lineto [ 3 pt ] 0 setdash stroke }
- X @Graphic {1c @Wide }
- X |0.2i @ShowMarks Australia
- X/0.1i @ShowMarks Washington | @ShowMarks Canberra
- X}
- XThe @Code "0.2i" gap separates columns, not individual items in
- Xcolumns, so a gap attached to the second @Code "|" would serve no
- Xpurpose; any such gap is ignored. If the number of marks to be merged
- Xdiffers, empty columns are added at the right to equalize the number. The
- Xfour marks protruding from the result are all available for merging
- Xwith neighbouring marks by other concatenation operators. The precedence
- Xof @Code "|" is higher than the precedence of {@Code "/"}, so the braces
- Xcould be omitted.
- X@PP
- XWhen lines of text are concatenated, it is conventional to measure
- Xtheir separation from baseline to baseline (mark to mark in Lout),
- Xrather than from edge to edge as above. This idea of different
- Xreference points for measurement evolved over the years into a
- Xsystem of six @I {gap modes} (Figure {@NumberOf gapmodes}), expressed
- Xby appending a letter to the length. For example, @Code "|0.2i" is
- Xan abbreviation for {@Code "|0.2ie"}, meaning 0.2 inches measured
- Xfrom edge to edge; @Code "|0.3ix"
- Xproduces a 0.3 inch gap measured from mark to mark and widened if
- Xnecessary to prevent overstriking; and @Code "|2.5it" places its right
- Xparameter 2.5 inches from the current left margin, irrespective of
- Xthe position of the left parameter. There is also a choice of
- Xeleven units of measurement (inches, centimetres, multiples of the
- Xcurrent font size, etc.), the most interesting being
- Xthe @Code r unit: one @Code r is the column width minus the width of
- Xthe following object, so that @Code "|1rt" produces sufficient space
- Xto right justify the following object, and @Code "|0.5rt" to center
- Xit. These features implement spacings needed in practice rather
- Xthan suggested by theory. They work with all five concatenation
- Xoperators, horizontal and vertical.
- X
- X@Figure
- X @Tag { gapmodes }
- X @Caption { The six gap modes (@I length is any length). Hyphenation
- Xmode has an extra property not shown here. }
- X@Fig {
- X{ /2.5vx Edge-to-edge |0.3i {@Code "|"} &1p {@I length} &1p {@Code e}
- X /4.2vx Hyphenation |0.3i {@Code "|"} &1p {@I length} &1p {@Code h}
- X /4.2vx Overstrike |0.3i {@Code "|"} &1p {@I length} &1p {@Code o}
- X /4.2vx Mark-to-mark |0.3i {@Code "|"} &1p {@I length} &1p {@Code x}
- X /4.2vx Kerning |0.3i {@Code "|"} &1p {@I length} &1p {@Code k}
- X /4.2vx Tabulation |0.3i {@Code "|"} &1p {@I length} &1p {@Code t}
- X}
- X||0.5i
- X@Box margin { 0c } 6c @Wide 13.5c @High 9p @Font
- X{
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
- X @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I length } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
- X @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I length } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High } @Put { 3.3c @Wide { &0.5rt @I length } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High }
- X @Put 3.3c @Wide { |0.5rt @Eq { max(length, a+b) } }
- X @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
- X @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
- X @At { 4c @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
- X @At { 4c @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
- X }
- X //4.5vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High }
- X @Put { 3.3c @Wide { |0.5rt @Eq { max(length, a, b) } } }
- X @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
- X @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
- X @At { 4c @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
- X @At { 4c @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 0.0c @Wide 1.6c @High } @Put { @DoubleArrow 4.0c }
- X @At { 2.8c @Wide 1.8c @High } @Put { @I length }
- X }
- X //5vx
- X @DoubleArrow 6c
- X //0.1c |0.5rt @I { current bound }
- X}
- X}
- X
- X@PP
- XWhen we construct a built-up fraction, the result has three row marks, but
- Xonly the second should be visible outside the object:
- X@ID @Eq { @ShowMarks { X over Y } }
- XThis is a common problem, and accordingly a @Code "@OneRow" operator was
- Xintroduced for hiding all but one of the row marks of its
- Xparameter. Normally, the first mark is the survivor, but a later mark can
- Xbe chosen by prefixing @Code "^" to the preceding concatenation operator:
- X@ID @Code "@OneRow { X ^/2p @HLine /2p Y }"
- Xhas the desired result, where {@Code "2p"} is two points and @Code "@HLine"
- Xis an easy combination of Lout's graphics operators. A similar operator,
- X{@Code "@OneCol"}, hides column marks.
- X@PP
- XA variant of @Code "/" called @Code "//" is provided which performs
- Xvertical concatenation but ignores all column marks and simply
- Xleft-justifies its two parameters:
- X@ID @Code {
- X"Heading //0.1i"
- X"A |0.2i B /0.1i"
- X"C | D"
- X}
- Xhas result
- X@ID { Heading //0.1i A |0.2i B /0.1i C | D }
- Xshowing that spanning columns in tables motivate the inclusion of this
- Xoperator. There is an analogous @Code "||" operator. The author
- Xwould have preferred to leave out these operators, since they
- Xcomplicate the implementation, and it is interesting to examine the
- Xprospects of doing so.
- X@PP
- XThe @Code "//" operator is formally redundant, because in general
- Xthe expression @Code "x // y" can be replaced by
- X@ID @Code {
- X"@OneCol { | x } /"
- X"@OneCol { | y }"
- X}
- Xfor any objects {@Code x} and {@Code y}. By concatenating an empty
- Xobject at the left of @Code x and hiding all but that empty object's
- Xcolumn mark, we effectively shift {@Code x}'s column mark to its left
- Xedge. The same goes for {@Code y}, so the @Code "/" operator has just
- Xone column mark to merge, at the extreme left, and its effect is
- Xindistinguishable from {@Code "//"}.
- X@PP
- XUnfortunately, if @Code y consists of two rows separated by {@Code "/"},
- Xas in the example above, both rows must be placed inside the
- X{@Code "@OneCol"}, and the table cannot be entered in the simple
- Xrow-by-row manner that non-expert users naturally expect. Another
- Xadvantage of @Code "//" is that its left parameter can be printed
- Xbefore its right parameter is known; this is important when the left
- Xparameter is an entire page.
- X@PP
- XThe fifth and final concatenation operator, {@Code "&"}, is an explicit
- Xversion of the horizontal concatenation operator interpolated when
- Xobjects are separated by white space. It is formally identical to
- X@Code "|" except for taking higher precedence and being subject to
- Xreplacement by @Code "//1vx" during paragraph breaking
- X(Section {@NumberOf style}).
- X@End @SubSection
- END_OF_FILE
- if test 12558 -ne `wc -c <'doc/tr.impl/s2.3'`; then
- echo shar: \"'doc/tr.impl/s2.3'\" unpacked with wrong size!
- fi
- # end of 'doc/tr.impl/s2.3'
- fi
- if test -f 'doc/tr.impl/s5.2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/tr.impl/s5.2'\"
- else
- echo shar: Extracting \"'doc/tr.impl/s5.2'\" \(14105 characters\)
- sed "s/^X//" >'doc/tr.impl/s5.2' <<'END_OF_FILE'
- X@SubSection
- X @Tag { flushing }
- X @Title { The galley flushing algorithm }
- X@Begin
- X@PP
- XGalley components are promoted one by one into the point of appearance in
- Xthe dynamic parent galley, then carried along with it, ultimately to the
- Xroot galley and the output file. This process is called @I galley
- X{@I flushing}: the galleys are rivers running together to the sea, and
- Xeach component is a drop of water.
- X@PP
- XHere is a snapshot of a small dynamic tree, based on the @Code "@PageList"
- Xdefinitions of Section {@NumberOf recursion}:
- X@ID @Fig {
- X
- X@I 10p @Font { output file } A:: @Box linestyle { noline } margin { 0c }
- X
- X||2c
- X
- X{
- X@I 10p @Font { root galley }
- X//0.2c
- XB:: @Box margin { 0c } linestyle { noline }
- X//
- X@LittlePage {
- X|0.5rt - 1 -
- X//1.2vx &2m A small
- X//1.2vx @Code "@Galley" * C:: @Box margin { 0.01c } linestyle { noline }
- X//1rt @Code "@FootSect"
- X}
- X//
- X@Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@PageList 2"
- X}
- X
- X||2c
- X
- X{
- X//0.9c @I 10p @Font { body text }
- X//0.2c D:: @Box margin { 0.3c } 2.8c @Wide 8p @Font paragraph
- X// @Box margin { 0.3c } 2.8c @Wide 8p @Font { of text. }
- X// @Box margin { 0.3c } 2.8c @Wide @Code 8p @Font "@Input"
- X}
- X
- X// @Arrow from { B@W } to { A@E }
- X// @Arrow from { D@W } to { C@E }
- X
- X}
- XThe components of the body text galley are lines, except for the special
- Xreceptive symbol @Code "@Input" which is a placeholder for as yet unread
- Xinput (Section {@NumberOf lookahead}). The components of the root galley are
- Xpages, except for the concluding unexpanded invocation of {@Code "@PageList"},
- Xwhich is an inexhaustible source of more pages, expanded on demand.
- X@PP
- XThe concrete data structure used by Basser Lout permits the galley
- Xflushing algorithm to navigate the dynamic tree and find significant
- Xfeatures quickly:
- X@ID 10p @Font @Fig maxlabels { 100 } {
- X
- XA:: @Ellipse @I { HEAD }
- X
- X||1.5c
- X
- X@OneCol @OneRow {
- XB:: @Ellipse @I { RECEIVING * }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
- X//0.6c
- XC:: @Ellipse @I { RECEPTIVE }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W A@CIRCUM} } to { C@W }
- X//0.6c
- XD:: @Box margin { 0c } linestyle { noline }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle D@NW A@CIRCUM} } to { D@NW }
- X//
- X@LittlePage {
- X|0.5rt - 1 -
- X//1.2vx &2m A small
- X//1.2vx E:: @Box margin { 0c } linestyle { noline } @Code "@Galley "
- X//1rt F:: @Box margin { 0c } linestyle { noline } @Code "@FootSect "
- X}
- X// @FunnyArrow arrow { forward } from { B@E } to { E@E }
- X// @FunnyArrow arrow { forward } from { C@E } to { F@E }
- X//0.6c
- XC:: @Ellipse @I { GAP }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W A@CIRCUM} } to { C@W }
- X//0.6c
- XC:: @Ellipse @I { RECEPTIVE }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W A@CIRCUM} } to { C@W }
- X//0.6c
- XD:: @Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@PageList 2"
- X// @Arrow from { A@CTR ++ {A@CTR @Angle D@NW A@CIRCUM} } to { D@NW }
- X// @FunnyArrow from { C@E } to { D@W ++ { 1.8 cm 0 } }
- X}
- X
- X||1.0c
- X
- XA:: @Ellipse @I { HEAD }
- X& @Arrow from { B@E } to { A@W }
- X
- X||1.5c
- X
- X@OneCol @OneRow {
- XB:: @Box margin { 0.3c } 2.8c @Wide 8p @Font paragraph
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
- X//0.6c
- XB:: @Ellipse @I { GAP }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
- X//0.6c
- XB:: @Box margin { 0.3c } 2.8c @Wide 8p @Font { of text. }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@NW A@CIRCUM} } to { B@NW }
- X//0.6c
- XB:: @Ellipse @I { GAP }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
- X//0.6c
- XB:: @Ellipse @I { RECEPTIVE }
- X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
- X//0.6c
- XC:: @Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@Input"
- X// @Arrow from { A@CTR ++ {A@CTR @Angle C@NW A@CIRCUM} } to { C@NW }
- X// @FunnyArrow from { B@E } to { C@W ++ { 1.2 cm 0 } }
- X}
- X
- X}
- XEach galley has a @Eq { HEAD } node whose children are its component
- Xobjects, separated by @Eq { GAP } nodes recording the inter-component
- Xgaps.
- X@PP
- XEach component is preceded by zero or more @I {galley index nodes} of
- Xvarious types. Every receptive symbol has a @Eq { RECEPTIVE } index pointing
- Xto it, so that it can be found without searching through its
- Xcomponent. If the symbol is currently the target of a galley, it has a
- X@Eq { RECEIVING } index instead which is also linked to the incoming
- Xgalley. Galleys that are currently without a target are linked to the
- Xdynamic tree by @Eq { UNATTACHED } galley indexes, either just after their
- Xmost recent target if there has been one, or else at their point of
- Xinvocation.
- X@PP
- XEach galley should be thought of as a concurrent process, although the
- Ximplementation in C uses coroutines implemented by procedures. A galley
- Xmay promote its first component only if it has a target, sufficient space
- Xis available at the target to receive the component, and the component
- Xcontains no receptive symbols. This last condition seems to be the key
- Xto galley synchronization: it forces a bottom-up promotion regime,
- Xpreventing pages from flushing to output before text flushes into them,
- Xfor example.
- X@PP
- XEach galley contains a number of binary semaphores, shown as asterisks
- Xin our snapshots when set. At any given moment, a galley process is
- Xeither running or else is suspended on one of its own semaphores. The
- X@Eq { HEAD } node contains a semaphore which is set when the galley has tried
- Xto find a target and failed. Each receptive symbol has a semaphore
- Xwhich is set when that symbol is preventing the first component from
- Xbeing promoted.
- X@PP
- XFor example, in the snapshot at the beginning of this section, the root
- Xgalley is suspended on the @Code "@Galley" symbol, but the text galley
- Xis running. It will suspend on the @Code "@Input" symbol after the
- Xfirst two components are promoted.
- X@PP
- XEvery galley {@I G}, be it a list of pages, body text, a footnote, or
- Xwhatever, executes the following algorithm in parallel with every other
- Xgalley:
- X@DP
- X1. Initially @I G is unattached. Search forwards or backwards from its
- X@Eq { UNATTACHED } index as required, to find a receptive symbol @I S which
- Xcan expand to reveal a target for {@I G}.
- X@DP
- X2. If no @I S can be found, suspend on the attachment semaphore. Resume
- Xlater from step 1.
- X@DP
- X3. Expand @I S to reveal the target of {@I G}. Preserve {@I S}'s
- Xsemaphore by moving it to the first receptive symbol within the
- Xexpansion of {@I S}.
- X@DP
- X4. Calculate the available width and height at the target, and if
- X@I G is still a pure parse tree, use the environment attached to @I G
- Xand the style information from the target to evaluate @I G as in
- XSection {@NumberOf functional}.
- X@DP
- X5. Examine the components of @I G one by one. For each component there
- Xare three possibilities:
- X@PP
- X@I ACCEPT. If the component fits into the available space, and has
- Xno other problems, then promote it into the target. If this is the
- Xfirst component promoted into this target, and @I G is a forcing
- Xgalley (Section {@NumberOf lookahead}), delete every receptive symbol
- Xpreceding the target in the parent galley. If @I G is the root galley,
- Xrender the component on the output file and dispose it;
- X@PP
- X@I REJECT. If the component is too large for the available space, or a
- X@Eq { FOLLOWS } index (described below) forbids its promotion into this
- Xtarget, then detach @I G from the target. If this was the first component
- Xat this target, @I S has been a complete failure, so undo step 3 (Basser
- XLout is not able to undo step 4); otherwise delete the target. Return to
- Xstep 1 and continue immediately;
- X@PP
- X@I SUSPEND. If the component contains a receptive symbol, it cannot be
- Xpromoted yet. If this symbol is the target of a galley that was written
- Xto an auxiliary file on a previous run, read in that galley and flush
- Xit. Otherwise suspend on the receptive symbol's semaphore; resume later
- Xfrom step 4.
- X@DP
- X6. Terminate when the galley is empty.
- X@DP
- XAt various points in this algorithm, receptive symbols (and their
- Xsemaphores) are deleted in the dynamic parent galley, possibly
- Xpermitting it to resume flushing. When this happens, Basser Lout resumes
- Xthe parent immediately after @I G suspends or terminates. Also,
- Xwhenever a component is promoted, any child galleys connected to
- Xit by @Eq { UNATTACHED } indexes must be resumed, since these
- Xgalleys may be able to find a target now. A good example of this
- Xsituation occurs when a line of body text with one or more footnotes
- Xis promoted onto a page. Basser Lout gives priority to such children,
- Xsuspending @I G while each is given a chance to flush.
- X@PP
- XBasser Lout searches for the first target of @I G only in regions of the
- Xdynamic tree that will clearly precede or follow {@I G}'s invocation
- Xpoint in the final printed document, whichever is specified in the
- X@Code into clause; subsequent targets are sought later in the same
- Xgalley as the first. An exception to this rule, whose necessity will
- Xbe made clear later, is that a first @Code following target will be
- Xsought within a dynamic sibling galley preceding {@I G}'s invocation
- Xpoint:
- X@ID 10p @Font @Fig {
- X
- X{
- X@I { dynamic parent }
- X//0.2c
- X@Box 2.8c @Wide 4.5c @High
- X{
- X //0.5c A:: @Box margin { 0c } linestyle { noline } @Code "@XTarget"
- X //1.0c C:: @Box margin { 0c } linestyle { noline } @Eq { UNATTACHED }
- X //1.3c @Code "@XTarget"
- X}
- X}
- X
- X||1.5c
- X
- X{
- X//0.6c
- XB:: @Box margin {0c} linestyle {noline} @Code "X into { @XTarget&&following }"
- X//0.2c
- X@Box 2.8c @Wide 1.5c @High { //0.8c @Code "@GTarget" }
- X//1.0c
- XD:: @Box margin {0c} linestyle {noline} @Code "G into { @GTarget&&following }"
- X//0.2c
- X@Box 2.8c @Wide 2.5c @High {}
- X}
- X
- X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
- X// @Arrow from { C@E ++ {0.2 cm 0} } to { D@W -- {0.2 cm 0} }
- X
- X}
- XHere @I G will find the @Code "@GTarget" target within {@I X}. This is
- Xdangerous, since if the first component of @I G is then promoted via
- X@I X into the first {@Code "@XTarget"} rather than into the second,
- X{@I G}'s target will not appear later in the final printed document than
- Xits invocation point, as required by the @Code into clause.
- X@PP
- XAccordingly, when such a target is chosen, two special galley indexes
- Xare inserted and linked together: a @Eq { PRECEDES } index at {@I G}'s
- Xinvocation point, and a @Eq { FOLLOWS } index at the first component of
- X{@I G}. The algorithm checks before promoting any @Eq { FOLLOWS } index
- Xthat its promotion would not place it earlier than the corresponding
- X@Eq { PRECEDES } index in the same galley, and rejects the component if
- Xit would. Since @Eq { PRECEDES } and @Eq { FOLLOWS } indexes are rarely used,
- Xthis check can be implemented by linear search.
- X@PP
- XWhen two components are separated by {@Code "/"}, as opposed to the more
- Xusual {@Code "//"}, each influences the horizontal position of the
- Xother. Because of this, the @I SUSPEND action is in fact taken if a
- Xreceptive symbol occurs in any component separated from the first by
- X{@Code "/"} operators only. Again, linear search forwards to the first
- X{@Code "//"} suffices for this check.
- X@PP
- XA good illustration of these unusual cases is afforded by the
- X@Code "@Align" symbols from the standard DocumentLayout package. These
- Xare used to produce displayed equations, aligned on their equals signs
- Xdespite being separated by arbitrary body text.
- X@PP
- XThe @Code "@Align" symbols are packaged neatly for the convenience of
- Xthe non-expert user, but we will show just the essence of the
- Ximplementation here. First, an @Code "@AlignList" galley is created
- Xwhich contains an infinite supply of @Code "@AlignPlace" receptive
- Xsymbols separated by @Code "/" operators:
- X@ID @Fig {
- X
- X{
- X@I { body text galley }
- X//0.2c
- X@Box 2.8c @Wide 4.0c @High
- X{ //1.5c
- X A:: @Box margin { 0c } linestyle { noline } @Code "@Galley"
- X}
- X}
- X
- X||1.5c
- X
- X{
- X//2.4c
- XB:: @Box margin { 0c } linestyle { noline } @Code "@AlignList"
- X//0.2c
- X@Box {
- X @Code "@AlignPlace"
- X//1vx @Code "@AlignPlace"
- X//1vx @Code "..."
- X//1vx @Code "@EndAlignList"
- X}
- X
- X}
- X
- X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
- X}
- XThen equations like
- X@ID @ShowMarks @Eq { f(x) ^= g(x) + 2 }
- Xare created and sent to @Code "@AlignPlace&&following" targets. They
- Xcollect in the @Code "@AlignList" galley and are aligned there:
- X@ID @Fig {
- X
- X{
- X@I { body text galley }
- X//0.2c
- X@Box 2.8c @Wide 4.0c @High
- X{ //1.5c
- X A:: @Box margin { 0c } linestyle { noline } @Code "@Galley"
- X}
- X}
- X
- X||1.5c
- X
- X{
- X//2.4c
- XB:: @Box margin { 0c } linestyle { noline } @Code "@AlignList"
- X//0.2c
- X@Box {
- X @Line linestyle { dashed } from { xmark ysize } to { xmark 0 }
- X {
- X @Eq { f(x) ^= g(x) + 2 }
- X /1vx @Eq { f(x) - g(x) ^= 2 }
- X /1vx @Code "..."
- X /1vx @Code "@EndAlignList"
- X }
- X}
- X
- X}
- X
- X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
- X}
- XThe @Code "@AlignList" galley does not flush, because its first
- Xcomponent is connected to a receptive symbol by @Code "/" operators.
- X@PP
- XAfter the last equation, an empty forcing galley is sent to
- X{@Code "@EndAlignList"}, deleting the two remaining receptive symbols from
- Xthe @Code "@AlignList" galley and permitting it to flush. @Eq { FOLLOWS }
- Xindexes ensure that each equation finds a target placed in the body text
- Xjust after its point of invocation, so the equations return, aligned, to
- Xapproximately the points where they were invoked. Notice that the flushing
- Xof body text is suspended until the list of equations is completed, as it
- Xmust be, since the horizontal position of the first equation cannot
- Xbe known until the last equation is added to the list.
- X@PP
- XLayout quality can occasionally be improved by rejecting a component
- Xthat could be promoted -- for example, a component of body text that
- Xcarries a footnote too large to fit on the current page. Since Lout
- Xdoes not specify how breaking decisions are made, beyond the basic
- Xconstraints imposed by available space and @Code into clauses, in
- Xprinciple such high quality breaking could be added to the
- Ximplementation with no change to the language. However, the
- Xgenerality of the galley flushing algorithm, and its already
- Xconsiderable complexity, make this a daunting problem in practice,
- Xalthough a fascinating one. @TeX [9], with its unnested
- Xset of `floating insertions' clearly identifiable as each page is begun,
- Xhas the advantage in this respect.
- X@End @SubSection
- END_OF_FILE
- if test 14105 -ne `wc -c <'doc/tr.impl/s5.2'`; then
- echo shar: \"'doc/tr.impl/s5.2'\" unpacked with wrong size!
- fi
- # end of 'doc/tr.impl/s5.2'
- fi
- if test -f 'doc/tr.impl/setup' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/tr.impl/setup'\"
- else
- echo shar: Extracting \"'doc/tr.impl/setup'\" \(13290 characters\)
- sed "s/^X//" >'doc/tr.impl/setup' <<'END_OF_FILE'
- X
- X######################################################
- X# #
- X# Lout setup file for design and imp. paper #
- X# #
- X# Jeffrey H. Kingston #
- X# 13 January 1992 #
- X# #
- X######################################################
- X
- X@SysInclude { ft }
- X@SysInclude { dl }
- X@SysInclude { tab }
- X@SysInclude { eq }
- X@SysInclude { pas }
- X@SysInclude { fig }
- X
- Xdef @TeX { T{ /0.2fo E}X }
- X
- Xdef @Code
- X right x
- X{ { Helvetica Base -1p } @Font lines @Break x
- X}
- X
- X######################################################
- X# #
- X# Nodes and trees. #
- X# #
- X######################################################
- X
- Ximport @Fig
- Xdef @FBox
- X named width { 0.6c }
- X named height { 0.4c }
- X named margin { 0.1c }
- X right x
- X{
- X @Box margin { margin }
- X { width @Wide height @High
- X { /0.5rt |0.5rt @OneCol @OneRow 0.8f @Font x
- X }
- X }
- X}
- X
- Ximport @Fig
- Xdef @FEllipse
- X named width { 0.6c }
- X named height { 0.4c }
- X named margin { 0.1c }
- X right x
- X{
- X @Ellipse margin { margin }
- X { height @High
- X { /0.5rt |0.5rt @OneCol @OneRow 0.8f @Font x
- X }
- X }
- X}
- X
- Ximport @Fig
- Xdef @FCircle
- X named width { 0.4c }
- X named height { 0.4c }
- X named margin { 0.1c }
- X right x
- X{
- X @Circle margin { margin }
- X { width @Wide height @High
- X { /0.5rt |0.5rt @OneCol @OneRow 0.8f @Font x
- X }
- X }
- X}
- X
- Ximport @Fig
- Xdef @JoinFigures
- X left A
- X named linestyle { solid }
- X named linewidth { 0.5 pt }
- X named linecap { round }
- X named dashlength { 0.15 cm }
- X named arrow { noarrow }
- X named headstyle { open }
- X named headwidth { 0.05 cm }
- X named headlength { 0.15 cm }
- X right B
- X{
- X @Line
- X from { {A"@CTR"} ++ {{A"@CTR"} @Angle {B"@CTR"} A"@CIRCUM"} }
- X to { {B"@CTR"} ++ {{B"@CTR"} @Angle {A"@CTR"} B"@CIRCUM"} }
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X arrow { arrow }
- X headstyle { headstyle }
- X headwidth { headwidth }
- X headlength { headlength }
- X {}
- X}
- X
- Ximport @Fig
- Xexport @LeftSub @RightSub @FirstSub @NextSub @StubSub @Node
- Xdef @Tree
- X named hmargin { 0.2c }
- X named vmargin { 0.3c }
- X named linestyle { solid }
- X named linewidth { 0.5 pt }
- X named linecap { round }
- X named dashlength { 0.15 cm }
- X named arrow { noarrow }
- X named headstyle { open }
- X named headwidth { 0.05 cm }
- X named headlength { 0.15 cm }
- X body x
- X@Begin
- X
- X def @LeftSub
- X precedence 90
- X associativity left
- X left root
- X named hmargin { hmargin }
- X named linestyle { linestyle }
- X named linewidth { linewidth }
- X named linecap { linecap }
- X named dashlength { dashlength }
- X named arrow { arrow }
- X named headstyle { headstyle }
- X named headwidth { headwidth }
- X named headlength { headlength }
- X right x
- X {
- X { /vmargin {L::x} } |hmargin root |
- X L@T @JoinFigures
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X arrow { arrow }
- X headstyle { headstyle }
- X headwidth { headwidth }
- X headlength { headlength }
- X T
- X }
- X
- X def fixroot
- X precedence 90
- X left root
- X {
- X |0.5rt root
- X }
- X
- X def firstsub
- X precedence 90
- X associativity left
- X named hmargin { hmargin }
- X named linestyle { linestyle }
- X named linewidth { linewidth }
- X named linecap { linecap }
- X named dashlength { dashlength }
- X named arrow { arrow }
- X named headstyle { headstyle }
- X named headwidth { headwidth }
- X named headlength { headlength }
- X right x
- X {
- X S::x &
- X S@T @JoinFigures
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X arrow { arrow }
- X headstyle { headstyle }
- X headwidth { headwidth }
- X headlength { headlength }
- X T
- X }
- X
- X macro @FirstSub { fixroot //vmargin |0.5rt firstsub }
- X
- X def @NextSub
- X precedence 90
- X associativity left
- X left others
- X named hmargin { hmargin }
- X named linestyle { linestyle }
- X named linewidth { linewidth }
- X named linecap { linecap }
- X named dashlength { dashlength }
- X named arrow { arrow }
- X named headstyle { headstyle }
- X named headwidth { headwidth }
- X named headlength { headlength }
- X right x
- X {
- X others &hmargin S::x &
- X S@T @JoinFigures
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X arrow { arrow }
- X headstyle { headstyle }
- X headwidth { headwidth }
- X headlength { headlength }
- X T
- X }
- X
- X def @RightSub
- X precedence 90
- X associativity left
- X left root
- X named hmargin { hmargin }
- X named linestyle { linestyle }
- X named linewidth { linewidth }
- X named linecap { linecap }
- X named dashlength { dashlength }
- X named arrow { arrow }
- X named headstyle { headstyle }
- X named headwidth { headwidth }
- X named headlength { headlength }
- X right x
- X {
- X root |hmargin { /vmargin {R::x} } |
- X R@T @JoinFigures
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X arrow { arrow }
- X headstyle { headstyle }
- X headwidth { headwidth }
- X headlength { headlength }
- X T
- X }
- X
- X def @StubSub
- X precedence 90
- X associativity left
- X left root
- X named linestyle { linestyle }
- X named linewidth { linewidth }
- X named linecap { linecap }
- X named dashlength { dashlength }
- X {
- X root |
- X @Figure
- X shape { T@SW
- X T@W -- { 0.1 cm 0.7 cm }
- X T@E -- {-0.1 cm 0.7 cm }
- X T@SE
- X }
- X linestyle { linestyle }
- X linewidth { linewidth }
- X linecap { linecap }
- X dashlength { dashlength }
- X { @Null }
- X }
- X
- X def @Node
- X # named mark {}
- X right root
- X {
- X T:: root
- X # & T@W ++ { -0.2 cm 0.1 cm } @BaseOf mark
- X }
- X
- X @OneCol @OneRow x
- X
- X@End @Tree
- X
- X
- Xdef @ShowMarks
- X named linewidth { 0.015 cm }
- X named linestyle { dashed }
- X named dashlength { 0.15 cm }
- X named paint { light }
- X named marks { both } # none, horizontal, vertical, or both
- X right x
- X{
- X @Fig
- X { @Box margin { 0c } linewidth { linewidth } paint { paint }
- X { @Figure
- X shape {
- X marks @Case {
- X { horizontal both } @Yield
- X { -0.3 cm ymark {xsize ymark} ++ {0.3 cm 0} }
- X else @Yield {}
- X }
- X marks @Case {
- X both @Yield []
- X else @Yield {}
- X }
- X marks @Case {
- X { vertical both } @Yield
- X { xmark -0.3 cm {xmark ysize} ++ {0 0.3 cm} }
- X else @Yield {}
- X }
- X }
- X linewidth { linewidth }
- X linestyle { linestyle }
- X dashlength { dashlength }
- X x
- X }
- X }
- X}
- X
- X import @Fig
- X def @DagBox
- X named top {}
- X named mid {}
- X named base {}
- X {
- X @OneRow {
- X TOP:: @FBox top
- X // MID:: @FBox mid
- X // BASE:: @FBox base
- X }
- X }
- X
- X import @Fig
- X def @BlackDot
- X named diameter { 0.07c }
- X {
- X @Circle
- X margin { 0c }
- X paint { black }
- X { diameter @Wide diameter @High {}
- X }
- X }
- X
- X import @Fig
- X def @TVShape # television shape enclosing points ne, nw, se, sw
- X named nw {}
- X named ne {}
- X named sw {}
- X named se {}
- X named delta { 0.5 cm }
- X {
- X @Figure
- X shape {
- X { {nw @Min sw @Min ne @Min se} -- { delta 0 } } @Label BL
- X { {nw @Max sw @Max ne @Max se} ++ { delta 0 } } @Label TR
- X BL ++ { 0 BL @YDistance TR } @Label TL
- X BL ++ { BL @XDistance TR 0 } @Label BR
- X BL
- X BR [ BR ++ {0 delta} ]
- X BR ++ {delta delta}
- X TR ++ {delta -delta} [ TR -- {0 delta} ]
- X TR
- X TL [ TL -- {0 delta} ]
- X TL -- {delta delta}
- X BL ++ {-delta delta} [ BL ++ {0 delta} ]
- X BL
- X }
- X {}
- X }
- X
- X import @Fig
- X def @FunnyArrow
- X named from {}
- X named to {}
- X named arrow { forward }
- X {
- X @Figure
- X shape {from from ++ {0 from @YDistance to} to}
- X arrow { arrow }
- X {}
- X }
- X
- X def "->" { {Symbol Base} @Font "\256" } #174 decimal
- X def "=>" { {Symbol Base} @Font "\336" } #222 decimal
- X macro @JP { /0.5v }
- X
- X ###################################################
- X # #
- X # Lout keywords. #
- X # #
- X ###################################################
- X
- X def @@Begin { @Code "@Begin" }
- X def @@Break { @Code "@Break" }
- X def @@Case { @Code "@Case" }
- X def @@Database { @Code "@Database" }
- X def @@End { @Code "@End" }
- X def @@Font { @Code "@Font" }
- X def @@Galley { @Code "@Galley" }
- X def @@Graphic { @Code "@Graphic" }
- X def @@HExpand { @Code "@HExpand" }
- X def @@HScale { @Code "@HScale" }
- X def @@High { @Code "@High" }
- X def @@Include { @Code "@Include" }
- X def @@Key { @Code "@Key" }
- X def @@LClos { @Code "@LClos" }
- X def @@LEnv { @Code "@LEnv" }
- X def @@LInput { @Code "@LInput" }
- X def @@Moment { @Code "@Moment" }
- X def @@Next { @Code "@Next" }
- X def @@Null { @Code "@Null" }
- X def @@OneCol { @Code "@OneCol" }
- X def @@OneRow { @Code "@OneRow" }
- X def @@Open { @Code "@Open" }
- X def @@Prepend { @Code "@Prepend" }
- X def @@Rotate { @Code "@Rotate" }
- X def @@Space { @Code "@Space" }
- X def @@SysDatabase { @Code "@SysDatabase" }
- X def @@SysInclude { @Code "@SysInclude" }
- X def @@SysPrepend { @Code "@SysPrepend" }
- X def @@Tag { @Code "@Tag" }
- X def @@Tagged { @Code "@Tagged" }
- X def @@Use { @Code "@Use" }
- X def @@VExpand { @Code "@VExpand" }
- X def @@VScale { @Code "@VScale" }
- X def @@Yield { @Code "@Yield" }
- X def @@Wide { @Code "@Wide" }
- X
- X
- X ###################################################
- X # #
- X # Miscellaneous, mostly graphical definitions. #
- X # #
- X ###################################################
- X
- X def @Leaders
- X { .. @Leaders
- X }
- X
- X def @HLine {
- X { 0 0 moveto xsize 0 lineto stroke }
- X @Graphic {}
- X }
- X
- X def @VDashLine
- X right length
- X {
- X length @High
- X { 0 0 moveto 0 ysize lineto [ 3 pt ] 0 setdash stroke }
- X @Graphic {}
- X }
- X
- X def @LBox
- X right offset
- X { @OneCol @OneRow
- X {
- X { //0.2c
- X 0.6c @High 1.2c @Wide
- X { 0 0 moveto xsize 0 lineto
- X xsize ysize lineto 0 ysize lineto closepath
- X gsave 0.9 setgray fill grestore stroke }
- X @Graphic {}
- X }
- X ||offset @VDashLine 1c
- X }
- X }
- X
- X def @Arrow
- X right length
- X { @OneCol @OneRow
- X {
- X 30d @Rotate {0.12c @Wide @HLine}
- X //
- X length @Wide @HLine
- X //
- X "-30d" @Rotate {0.12c @Wide @HLine}
- X }
- X }
- X
- X def @DoubleArrow
- X right length
- X { @OneCol @OneRow
- X {
- X & 180d @Rotate @Arrow length
- X |0io @Arrow length
- X }
- X }
- X
- X def @Put
- X left coord
- X right x
- X { @OneCol @OneRow
- X { coord / | @OneCol @OneRow x
- X }
- X }
- X
- X macro @At { //0io }
- X
- X
- X ###################################################
- X # #
- X # Interpolated example documents. #
- X # #
- X ###################################################
- X
- X def @LittleEndRunPlace { @Galley }
- X def @LittleEndRun
- X force into { @LittleEndRunPlace&&preceding }
- X {}
- X
- X def @LittleTextPlace { @Galley }
- X def @LittleText into { @LittleTextPlace&&preceding }
- X right x
- X { x
- X }
- X
- X def @LittleFootPlace { @Galley }
- X def @LittleFootNote into { @LittleFootPlace&&following }
- X right x
- X { x
- X }
- X
- X def @LittlePageColumn
- X right x
- X {
- X 9px @Break 8p @Font
- X 2.8c @Wide x
- X }
- X
- X def @LittlePage
- X right x
- X {
- X @HContract @VContract
- X { 0 0 moveto xsize 0 lineto xsize ysize lineto
- X 0 ysize lineto closepath stroke } @Graphic
- X { //0.3c ||0.3c
- X 9px @Break 8p @Font
- X 2.8c @Wide 3.8c @High x
- X ||0.3c //0.3c
- X }
- X }
- X
- X def @LittleFootSect
- X { 1c @Wide @HLine
- X //0.3v @LittleFootPlace ||0.5c
- X }
- X
- X def @LittlePageList
- X right @PageNum
- X {
- X @LittlePage { # |0.5rt @PageNum //0.8v
- X //0.3v @LittleTextPlace
- X //1rt @LittleFootSect
- X }
- X //
- X @LittlePageList @Next @PageNum
- X }
- X
- X def @LittleDocument
- X { @LittlePage
- X { @LittleTextPlace
- X //1rt @LittleFootSect
- X }
- X // @LittlePageList 2
- X // @LittleEndRunPlace
- X }
- X
- X def @Strange
- X named @Format right @Val { [@Val] }
- X right x
- X { @Format x
- X }
- X
- X
- X@Use { @DocumentLayout
- X @MinorHeadingFont { Slope }
- X}
- X
- X@Database @Reference { oldrefs }
- END_OF_FILE
- if test 13290 -ne `wc -c <'doc/tr.impl/setup'`; then
- echo shar: \"'doc/tr.impl/setup'\" unpacked with wrong size!
- fi
- # end of 'doc/tr.impl/setup'
- fi
- if test -f 'doc/tr.lout/ch3.02' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/tr.lout/ch3.02'\"
- else
- echo shar: Extracting \"'doc/tr.lout/ch3.02'\" \(12218 characters\)
- sed "s/^X//" >'doc/tr.lout/ch3.02' <<'END_OF_FILE'
- X@Section
- X @Title { Concatenation symbols and paragraphs }
- X @Tag { concatenation }
- X@Begin
- X@PP
- XThere are ten concatenation symbols, in three families:
- Xconcatenation. @Index { Concatenation symbols }
- X@ID @Tab
- X vmargin { 0.5vx }
- X @Fmta { @Col @Code A ! @Col @Code B ! @Col @Code C ! @Col @Code D ! @Col E }
- X{
- X@Rowa A { "/" } B { "^/" } C { "//" } D { "^//" } E { Vertical concatenation }
- X@Rowa A { "|" } B { "^|" } C { "||" } D { "^||" } E { Horizontal concatenation }
- X@Rowa A { "&" } B { "^&" } C { } D { } E {In-paragraph concatenation}
- X}
- XEach symbol produces an object which combines together the two
- Xparameters. The right parameter must be separated from the symbol by at
- Xleast one white space character.
- X@PP
- XThe vertical concatenation symbol @Code "/" places its left parameter
- Xvertical.concatenation @Index { Vertical concatenation }
- Xabove its right parameter with their column marks aligned. If one
- Xparameter has more column marks than the other, empty columns are
- Xinserted at the right to equalize the numbers. The variant @Code "//"
- Xignores column marks and left-justifies the objects.
- X@PP
- XThe horizontal concatenation symbols @Code "|" and @Code "||" are horizontal
- Xhorizontal.concatenation @Index { Horizontal concatenation }
- Xanalogues of @Code "/" and {@Code "//"}: they place their two parameters side
- Xby side, with row mark alignment or top-justification respectively. The
- Xin.paragraph.concatenation @Index { In-paragraph concatenation }
- Xin-paragraph concatenation symbol @Code "&" produces horizontal concatenation
- Xwithin a paragraph; its special properties are treated in detail at the
- Xend of this section.
- X@PP
- XThe concatenation symbols in any one family are {@I{mutually associative}},
- Xwhich means that
- X@ID {
- X@Code "{" @I x {@Code "|"}{@I p} @I y @Code "}" {@Code "|"}{@I q} @I z
- X}
- Xis always the same as
- X@ID {
- X@I x {@Code "|"}{@I p} @Code "{" @I y {@Code "|"}{@I q} @I z @Code "}"
- X}
- Xfor any objects {@I x}, {@I y}, and {@I z}, any gaps @I p and @I q (defined
- Xbelow), and any choice of {@Code "|"}, {@Code "^|"}, {@Code "||"}, and
- X{@Code "^||"}. In practice we always omit such braces, since they are
- Xredundant and can be misleading. The result of the complete sequence of
- Xconcatenations will be called the {@I{whole concatenation object}}, and
- Xthe objects which make it up will be called the {@I components}.
- X@PP
- XOne mark is designated as the {@I {principal mark}}, usually the mark of
- Xprincipal.mark @Index { Principal mark }
- Xthe first component. A later mark can be chosen for this honour by
- Xattaching {@Code "^"} to the preceding concatenation symbol. See Section
- X{@NumberOf onerow} for examples.
- X@PP
- XA {@I gap},
- Xgap @Index Gap
- Xspecifying the distance between the two
- Xparameters, may follow any concatenation symbol. There may be no spaces
- Xbetween a concatenation symbol and its gap. A missing gap is taken
- Xto be {@Code 0ie}. The gap is effectively a third parameter of the
- Xconcatenation symbol, and it may be an arbitrary object provided that it
- Xevaluates to a juxtaposition of simple words. In general, the gap must
- Xbe enclosed in braces, like this:
- X@ID @Code {
- X"//{ @Style&&mystyle @Open { @TopMargin } }"
- X}
- Xbut the braces may be omitted when the object is a juxtaposition of
- Xsimple words or an invocation of a symbol without parameters, as in
- X@Code "//0.3vx" and {@Code "||@Indent"}.
- X@PP
- XA gap consists of a length plus a gap mode. A @I length
- Xlength @Index { Length }
- Xis represented by an decimal number (which may not be negative) followed
- Xby a unit of measurement. For example, @Code "2.5c" represents the
- Xlength 2.5 centimetres. Figure {@NumberOf units} gives the full selection
- Xof units of measurement.
- Xc.unit @Index { @Code c unit }
- Xp.unit @Index { @Code p unit }
- Xm.unit @Index { @Code m unit }
- Xf.unit @Index { @Code f unit }
- Xs.unit @Index { @Code s unit }
- Xv.unit @Index { @Code v unit }
- Xw.unit @Index { @Code w unit }
- Xb.unit @Index { @Code b unit }
- Xr.unit @Index { @Code r unit }
- Xd.unit @Index { @Code d unit }
- X
- X@BeginFigures
- X@Figure
- X @Caption { The eleven units of measurement provided by Lout. }
- X @Tag { units }
- X@Begin
- X @Tab
- X vmargin { 0.3v }
- X side { yes }
- X @Fmta { @Col @Code A ! @Col B }
- X {
- X @Rowa above { yes } A { c } B { Centimetres. }
- X @Rowa A { i } B { Inches.
- X}
- X @Rowa A { p } B { Points ({@Code 72p} = {@Code 1i}).
- X}
- X @Rowa A { m } B { Ems ({@Code 12m} = {@Code 1i}).
- X}
- X @Rowa A { f } B {
- XOne @Code f equals the size of the current font, as specified by
- Xthe @@Font symbol (Section {@NumberOf font}). This unit is
- Xappropriate for lengths that should change with the font size.
- X}
- X @Rowa A { s } B {
- XOne @Code s equals the preferred gap between two words in the
- Xcurrent font, as specified in the definition of the font, or by the
- X@@Space symbol (Section {@NumberOf break}).
- X}
- X @Rowa A { v } B {
- XOne @Code v equals the current gap between lines introduced during
- Xparagraph breaking, as specified by the @@Break symbol (Section
- X{@NumberOf break}). This unit is appropriate for lengths, such as the
- Xspaces between paragraphs, which should change with the inter-line gap.
- X}
- X @Rowa A { w } B {
- XOne @Code w equals the width of the following component, or its height if the
- Xsymbol is vertical concatenation.
- X}
- X @Rowa A { b } B {
- XOne @Code b equals the width of the whole concatenation object,
- Xor its height if the symbol is vertical concatenation.
- X}
- X @Rowa A { r } B {
- XOne @Code r equals one @Code b minus one {@Code w}. This unit is used
- Xfor centring and right justification.
- X}
- X @Rowa below { yes } A { d } B {
- XDegrees. This unit may only be used with the @Code "@Rotate" symbol.
- X}
- X }
- X@End @Figure
- X
- X@PP
- XA gap concludes with a {@I {gap mode}},
- Xgap.mode @Index { Gap mode }
- Xwhich is a single letter following the length, indicating how the length
- Xis to be measured. As shown in Figure {@NumberOf gapmodes},
- X
- X@Figure
- X @Tag { gapmodes }
- X @Caption { The six gap modes provided by Lout. }
- X@Begin
- X@Fig {
- X{ /2.5vx Edge-to-edge |0.3i {@Code "|"} &1p {@I l} &1p {@Code e}
- X /4vx Hyphenation |0.3i {@Code "|"} &1p {@I l} &1p {@Code h}
- X /4vx Overstrike |0.3i {@Code "|"} &1p {@I l} &1p {@Code o}
- X /4vx Mark-to-mark |0.3i {@Code "|"} &1p {@I l} &1p {@Code x}
- X /4vx Kerning |0.3i {@Code "|"} &1p {@I l} &1p {@Code k}
- X /4vx Tabulation |0.3i {@Code "|"} &1p {@I l} &1p {@Code t}
- X}
- X||0.5i
- X@Box margin { 0c } 6c @Wide 13.2c @High 9p @Font
- X{
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
- X @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 2.2c @Wide 1.4c @High } @Put { @DoubleArrow 1.8c }
- X @At { 2.2c @Wide 1.6c @High } @Put { 1.8c @Wide { &0.5rt @I l } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High } @Put { 3.3c @Wide { &0.5rt @I l } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High }
- X @Put 3.3c @Wide { |0.5rt { max( {@I {l, a+b}}) } }
- X @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
- X @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
- X @At { 4c @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
- X @At { 4c @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 1.2c @Wide 1.5c @High } @Put { @DoubleArrow 3.3c }
- X @At { 1.2c @Wide 1.7c @High }
- X @Put { 3.3c @Wide { |0.5rt max( {@I {l, a, b}})}}
- X @At { 1.2c @Wide 0.4c @High } @Put { @DoubleArrow 1.0c }
- X @At { 1.2c @Wide 0.2c @High } @Put { 1.0c @Wide { &0.5rt @I a } }
- X @At { 4c @Wide 0.4c @High } @Put { @DoubleArrow 0.5c }
- X @At { 4c @Wide 0.2c @High } @Put { 0.5c @Wide { &0.5rt @I b } }
- X }
- X //4vx
- X @OneRow {
- X @At { 1c @Wide 0.5c @High } @Put { @LBox 0.2co }
- X @At { 4c @Wide 0.5c @High } @Put { @LBox 0.5co }
- X @At { 0.0c @Wide 1.6c @High } @Put { @DoubleArrow 4.0c }
- X @At { 2.8c @Wide 1.8c @High } @Put { @I l }
- X }
- X //5vx
- X @DoubleArrow 6c
- X //0.1c |0.5rt @I { current bound }
- X}
- X
- X}
- X@End @Figure
- X@EndFigures
- Xwith edge-to-edge gap mode
- Xedge.to.edge @Index { Edge-to-edge gap mode }
- Xe.gap.mode @Index { @Code e gap mode }
- Xthe length @I l is measured from the trailing edge
- Xof the first object to the leading edge of the second. Edge-to-edge is the
- Xdefault mode: the @Code e may be omitted. Hyphenation gap mode is
- Xhyphenation.gap @Index { Hyphenation gap mode }
- Xh.gap.mode @Index { @Code h gap mode }
- Xsimilar, except as explained at the end of this section.
- X@PP
- XMark-to-mark,
- Xmark.to.mark @Index { Mark-to-mark gap mode }
- Xx.gap.mode @Index { @Code x gap mode }
- Xoverstrike,
- Xoverstrike @Index { Overstrike gap mode }
- Xo.gap.mode @Index { @Code o gap mode }
- Xand kerning
- Xkerning @Index { Kerning gap mode }
- Xk.gap.mode @Index { @Code k gap mode }
- Xmeasure the length from the last mark
- Xof the first object to the first mark of the second. In the case of
- Xmark-to-mark, if the length is too small to prevent the objects
- Xoverlapping, it is widened until they no longer do. Kerning also
- Xwidens, with the aim of preventing the mark of either object from
- Xoverlapping the other object; this mode is used for subscripts and
- Xsuperscripts.
- X@PP
- Xtabulation @Index { Tabulation gap mode }
- Xt.gap.mode @Index { @Code t gap mode }
- Xcentring @Index { Centring }
- Xright.justif @Index { Right justification }
- XTabulation ignores the first object and places the leading edge of the
- Xsecond object at a distance @I l from the left edge of the whole
- Xconcatenation object. It is the main user of the @Code b and @Code r
- Xunits of measurement; for example, @Code "|1rt" will right-justify the
- Xfollowing component, and @Code "|0.5rt" will centre it.
- X@PP
- XWhen two objects are separated only by zero or more white space
- Xwhite.space.when @SubIndex { when significant }
- Xspace.f.when @SubIndex { when significant }
- Xcharacters (spaces, tabs, and newlines), Lout inserts
- X{@Code "&"}{@I k}{@Code "s"} between the two objects, where @I k is the
- Xnumber of spaces. Precisely, @I k is determined by discarding all space
- Xcharacters and tabs that precede newlines (these are invisible so are
- Xbetter ignored), then counting 1 for each newline or space, and 8 for
- Xeach tab character.
- X@PP
- XA sequence of two or more objects separated by @Code "&" symbols is a
- Xparagraph.breaking.in.detail @SubIndex { in detail }
- X{@I paragraph}. Lout breaks paragraphs into lines automatically as
- Xrequired, by converting some of the @Code "&" symbols into
- X{@Code "//1vx"}. Gaps of length 0 (other than hyphenation gaps) are not
- Xeligible for this conversion. `Optimal' line breaks are chosen, using a
- Xmethod adapted from @TeX [{@Ref knuth84}].
- Xtex @RawIndex { @TeX }
- Xtex.optimal @SubIndex { optimal paragraph breaking }
- X@PP
- XIf an @Code "&" symbol whose gap has hyphenation mode
- Xhyphenation @Index { Hyphenation gap mode }
- Xtex.hyphenation @SubIndex { hyphenation }
- Xis chosen for replacement by {@Code "//1vx"}, a hyphen will be appended to
- Xthe preceding object, unless that object is a word which already ends with
- Xa hyphen. For example,
- X@ID @Code {
- XLong words may be "hyph &0ih enat &0ih ed."
- X}
- Xcould have the following result, depending where the line breaks fall:
- X@ID 2i @Wide {
- XLong words may be hyph &0ih enat &0ih ed.
- X}
- XBasser Lout inserts hyphenation gaps automatically as required, again
- Xfollowing the method of @TeX, which approximates the hyphenations in
- XWebster's dictionary. To prevent the hyphenation of a single word,
- Xenclose it in quotes. Further control over paragraph breaking and
- Xhyphenation is provided by the @@Break and @@Space symbols (Sections
- X{@NumberOf break} and {@NumberOf space}).
- X@End @Section
- END_OF_FILE
- if test 12218 -ne `wc -c <'doc/tr.lout/ch3.02'`; then
- echo shar: \"'doc/tr.lout/ch3.02'\" unpacked with wrong size!
- fi
- # end of 'doc/tr.lout/ch3.02'
- fi
- if test -f 'gnu.gpl' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gnu.gpl'\"
- else
- echo shar: Extracting \"'gnu.gpl'\" \(12487 characters\)
- sed "s/^X//" >'gnu.gpl' <<'END_OF_FILE'
- X GNU GENERAL PUBLIC LICENSE
- X Version 1, February 1989
- X
- X Copyright (C) 1989 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X Preamble
- X
- X The license agreements of most software companies try to keep users
- Xat the mercy of those companies. By contrast, our General Public
- XLicense is intended to guarantee your freedom to share and change free
- Xsoftware--to make sure the software is free for all its users. The
- XGeneral Public License applies to the Free Software Foundation's
- Xsoftware and to any other program whose authors commit to using it.
- XYou can use it for your programs, too.
- X
- X When we speak of free software, we are referring to freedom, not
- Xprice. Specifically, the General Public License is designed to make
- Xsure that you have the freedom to give away or sell copies of free
- Xsoftware, that you receive source code or can get it if you want it,
- Xthat you can change the software or use pieces of it in new free
- Xprograms; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- Xanyone to deny you these rights or to ask you to surrender the rights.
- XThese restrictions translate to certain responsibilities for you if you
- Xdistribute copies of the software, or if you modify it.
- X
- X For example, if you distribute copies of a such a program, whether
- Xgratis or for a fee, you must give the recipients all the rights that
- Xyou have. You must make sure that they, too, receive or can get the
- Xsource code. And you must tell them their rights.
- X
- X We protect your rights with two steps: (1) copyright the software, and
- X(2) offer you this license which gives you legal permission to copy,
- Xdistribute and/or modify the software.
- X
- X Also, for each author's protection and ours, we want to make certain
- Xthat everyone understands that there is no warranty for this free
- Xsoftware. If the software is modified by someone else and passed on, we
- Xwant its recipients to know that what they have is not the original, so
- Xthat any problems introduced by others will not reflect on the original
- Xauthors' reputations.
- X
- X The precise terms and conditions for copying, distribution and
- Xmodification follow.
- X
- X GNU GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License Agreement applies to any program or other work which
- Xcontains a notice placed by the copyright holder saying it may be
- Xdistributed under the terms of this General Public License. The
- X"Program", below, refers to any such program or work, and a "work based
- Xon the Program" means either the Program or any work containing the
- XProgram or a portion of it, either verbatim or with modifications. Each
- Xlicensee is addressed as "you".
- X
- X 1. You may copy and distribute verbatim copies of the Program's source
- Xcode as you receive it, in any medium, provided that you conspicuously and
- Xappropriately publish on each copy an appropriate copyright notice and
- Xdisclaimer of warranty; keep intact all the notices that refer to this
- XGeneral Public License and to the absence of any warranty; and give any
- Xother recipients of the Program a copy of this General Public License
- Xalong with the Program. You may charge a fee for the physical act of
- Xtransferring a copy.
- X
- X 2. You may modify your copy or copies of the Program or any portion of
- Xit, and copy and distribute such modifications under the terms of Paragraph
- X1 above, provided that you also do the following:
- X
- X a) cause the modified files to carry prominent notices stating that
- X you changed the files and the date of any change; and
- X
- X b) cause the whole of any work that you distribute or publish, that
- X in whole or in part contains the Program or any part thereof, either
- X with or without modifications, to be licensed at no charge to all
- X third parties under the terms of this General Public License (except
- X that you may choose to grant warranty protection to some or all
- X third parties, at your option).
- X
- X c) If the modified program normally reads commands interactively when
- X run, you must cause it, when started running for such interactive use
- X in the simplest and most usual way, to print or display an
- X announcement including an appropriate copyright notice and a notice
- X that there is no warranty (or else, saying that you provide a
- X warranty) and that users may redistribute the program under these
- X conditions, and telling the user how to view a copy of this General
- X Public License.
- X
- X d) You may charge a fee for the physical act of transferring a
- X copy, and you may at your option offer warranty protection in
- X exchange for a fee.
- X
- XMere aggregation of another independent work with the Program (or its
- Xderivative) on a volume of a storage or distribution medium does not bring
- Xthe other work under the scope of these terms.
- X
- X 3. You may copy and distribute the Program (or a portion or derivative of
- Xit, under Paragraph 2) in object code or executable form under the terms of
- XParagraphs 1 and 2 above provided that you also do one of the following:
- X
- X a) accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X b) accompany it with a written offer, valid for at least three
- X years, to give any third party free (except for a nominal charge
- X for the cost of distribution) a complete machine-readable copy of the
- X corresponding source code, to be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X c) accompany it with the information you received as to where the
- X corresponding source code may be obtained. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form alone.)
- X
- XSource code for a work means the preferred form of the work for making
- Xmodifications to it. For an executable file, complete source code means
- Xall the source code for all modules it contains; but, as a special
- Xexception, it need not include source code for modules which are standard
- Xlibraries that accompany the operating system on which the executable
- Xfile runs, or for standard header files or definitions files that
- Xaccompany that operating system.
- X
- X 4. You may not copy, modify, sublicense, distribute or transfer the
- XProgram except as expressly provided under this General Public License.
- XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
- Xthe Program is void, and will automatically terminate your rights to use
- Xthe Program under this License. However, parties who have received
- Xcopies, or rights to use copies, from you under this General Public
- XLicense will not have their licenses terminated so long as such parties
- Xremain in full compliance.
- X
- X 5. By copying, distributing or modifying the Program (or any work based
- Xon the Program) you indicate your acceptance of this license to do so,
- Xand all its terms and conditions.
- X
- X 6. Each time you redistribute the Program (or any work based on the
- XProgram), the recipient automatically receives a license from the original
- Xlicensor to copy, distribute or modify the Program subject to these
- Xterms and conditions. You may not impose any further restrictions on the
- Xrecipients' exercise of the rights granted herein.
- X
- X 7. The Free Software Foundation may publish revised and/or new versions
- Xof the General Public License from time to time. Such new versions will
- Xbe similar in spirit to the present version, but may differ in detail to
- Xaddress new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Program
- Xspecifies a version number of the license which applies to it and "any
- Xlater version", you have the option of following the terms and conditions
- Xeither of that version or of any later version published by the Free
- XSoftware Foundation. If the Program does not specify a version number of
- Xthe license, you may choose any version ever published by the Free Software
- XFoundation.
- X
- X 8. If you wish to incorporate parts of the Program into other free
- Xprograms whose distribution conditions are different, write to the author
- Xto ask for permission. For software which is copyrighted by the Free
- XSoftware Foundation, write to the Free Software Foundation; we sometimes
- Xmake exceptions for this. Our decision will be guided by the two goals
- Xof preserving the free status of all derivatives of our free software and
- Xof promoting the sharing and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- XREPAIR OR CORRECTION.
- X
- X 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- XPOSSIBILITY OF SUCH DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Programs
- X
- X If you develop a new program, and you want it to be of the greatest
- Xpossible use to humanity, the best way to achieve this is to make it
- Xfree software which everyone can redistribute and change under these
- Xterms.
- X
- X To do so, attach the following notices to the program. It is safest to
- Xattach them to the start of each source file to most effectively convey
- Xthe exclusion of warranty; and each file should have at least the
- X"copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the program's name and a brief idea of what it does.>
- X Copyright (C) 19yy <name of author>
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- XAlso add information on how to contact you by electronic and paper mail.
- X
- XIf the program is interactive, make it output a short notice like this
- Xwhen it starts in an interactive mode:
- X
- X Gnomovision version 69, Copyright (C) 19xx name of author
- X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- X This is free software, and you are welcome to redistribute it
- X under certain conditions; type `show c' for details.
- X
- XThe hypothetical commands `show w' and `show c' should show the
- Xappropriate parts of the General Public License. Of course, the
- Xcommands you use may be called something other than `show w' and `show
- Xc'; they could even be mouse-clicks or menu items--whatever suits your
- Xprogram.
- X
- XYou should also get your employer (if you work as a programmer) or your
- Xschool, if any, to sign a "copyright disclaimer" for the program, if
- Xnecessary. Here a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the
- X program `Gnomovision' (a program to direct compilers to make passes
- X at assemblers) written by James Hacker.
- X
- X <signature of Ty Coon>, 1 April 1989
- X Ty Coon, President of Vice
- X
- XThat's all there is to it!
- END_OF_FILE
- if test 12487 -ne `wc -c <'gnu.gpl'`; then
- echo shar: \"'gnu.gpl'\" unpacked with wrong size!
- fi
- # end of 'gnu.gpl'
- fi
- echo shar: End of archive 26 \(of 35\).
- cp /dev/null ark26isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 35 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-