lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 wishes for @Tbl and @Diag


From: Mark Summerfield
Subject: Re: 2 wishes for @Tbl and @Diag
Date: Wed, 26 Mar 2003 14:25:04 +0000

On Tuesday 25 March 2003 21:35, Jeff Kingston wrote:
> > @Tbl has no rulestyle option to set the line style, e.g. to dotted
>
> This sounds pretty reasonable; I'll add it to my list of things
> to do.  The actual styles are generated within PostScript so it
> takes a bit of magic.

Thanks! BTW I forgot to also mention that in @Tbl you can set
rulecolour, but in @Node you can't set outlinecolour and in @Link you
can't set pathcolour: both of these would also be really useful. (Roll
on 3.29:)

> > @Diag has no 'expand' option
>
> The basic thing you are asking for is for an inner thing to
> expand to fill the space available to it at the next level
> out, without expanding that thing (if I understand your
> correctly). 

That's exactly what I'm after.

> This is quite a delicate thing to get right.
> If you hunt through the definitions in @Diag you will find
> that @Box (for example) is a macro that uses @Node (whose
> def is at line 2243) whose value, apart from cases where it
> is labelled and/or translated, is given by symbol @Value
> defined at line 2528.  Interestingly, @Value begins with
>
>     @HContract @VContract
>
> ensuring that the value does not attempt to grab all
> available space.  Deleting this @HContract/@VContract
> would be the place to start.  If it does the right
> things, then named parameters could be added to the
> various symbols (@Node mainly) to allow the user to
> choose between having it/them or not.
>
> A dirtier method would be to decide how wide you
> want the outer box to be, enclose it in a @Wide
> symbol, then put @HExpand inside the inner box
> as before.  The @HExpand will widen everything it
> can but not the @Wide symbol, so the widening
> stops where you want it to, at the cost of having
> to say how wide you want things to be there.
> I call this dirty but it does have the advantage
> of giving a specific place where you want the
> widening to start (at the @HExpand) and a specific
> place where you want it to end (at the @Wide),
> which is much clearer than the "next level up",
> a concept which is affected by the fact that the
> node value can be enclosed in tagging and
> translation symbols behind the scenes.

Thanks, I'll try both these and see which works best for me.

PS I tried using @SyntaxDiag, but had to give up and use @Diag and @Tbl
instead. Why? Because I needed the following diagram. I think I could do
it using @SyntaxDiag if there was a @SelectOpposite that had its arrows
going right to left.


@Figure
    @Caption { Syntax diagram for spreadsheet expressions }
    @Tag { syntax.diagram.for.spreadsheet.expressions }
@Diag
    font { Slope -1p }
    outline { box }
    margin { 0.3f }

    boutline { circle }
    bmargin { 0.3f }
    bhsize { 0.75f }

    coutlinestyle { noline }
    cmargin { 0.4f }
{
    @Tbl
        #rule { yes } rulecolour { red }
        indent { ctr }
        iv { ctr }
        bindent { left }
        aformat { @Cell marginleft { 0c } A |
                  @Cell marginhorizontal { 0c } B |
                  @Cell indent { right }
                        marginleft { 1f } marginright { 0c } C |
                  @Cell D |
                  @Cell marginleft { 0c } E |
                  @Cell marginhorizontal { 0c } F |
                  @Cell indent { right }
                        marginleft { 1f } marginright { 0c } G |
                  @Cell H |
                  @Cell marginhorizontal { 0c } I | @Cell J |
                  @Cell margin { 0c } K |
                  @StartHSpan @Cell indent { left } L | 
                  @HSpan | @HSpan | @Cell marginhorizontal { 0c } O | }
        bformat { @StartHSpan @Cell marginleft { 0c } A | @HSpan | @HSpan |
                  @Cell marginhorizontal { 3s } D |
                  @StartHSpan @Cell marginleft { 0c } E | @HSpan | @HSpan |
                  @Cell marginhorizontal { 3s } H |
                  @StartHSpan @Cell marginleft { 0c } I | @HSpan | @HSpan |
                  @HSpan | @HSpan | @HSpan | @HSpan | }
        cformat { @Cell marginleft { 0c } A |
                  @Cell marginhorizontal { 0c } B |
                  @Cell indent { right }
                        marginleft { 1f } marginright { 0c } C |
                  @Cell D |
                  @Cell marginleft { 0c } E |
                  @Cell marginhorizontal { 0c } F |
                  @Cell indent { right }
                        marginleft { 1f } marginright { 0c } G |
                  @Cell H |
                  @Cell marginleft { 0c } I | @Cell J |
                  @Cell margin { 0c } K | @Cell indent { left } L | 
                  @Cell M | @Cell N | @Cell marginhorizontal { 0c } O | }
    {
        @Rowb A { @I Expression } E { @I Term } I { @I Factor }
        @Rowa A { EA:: @CNode } B { EB:: @Node Term } C { EC:: @CNode } 
              E { TA:: @CNode } F { TB:: @Node Factor } G { TC:: @CNode } 
              I { FA:: @Node outlinestyle { noline } margin { 0.2f } }
              J { @CNode } K { FB:: @CNode } 
              L { FC:: @Node Number } O { FD:: @CNode }
        @Rowa A { ED:: @CNode } B { EE:: @BNode + } C { EF:: @CNode } 
              E { TD:: @CNode } F { TE:: @BNode @Sym asteriskmath }
              G { TF:: @CNode } 
              J { FE:: @BNode {+0.2f @VShift @minus} }
              L { FF:: @Node { Cell location } }
              O { FFF:: @CNode }
        @Rowc A { EG:: @CNode } B { EH:: @BNode {+0.2f @VShift @minus} }
              C { EI:: @CNode } 
              E { TG:: @CNode } F { TH:: @BNode "/" } G { I:: @CNode } 
              L { FG:: @BNode ( }
              M { FH:: @Node Expression }
              N { FI:: @BNode ) }
    }
    //
    @Arrow from { address@hidden } to { address@hidden }
    @Arrow from { address@hidden } to { address@hidden }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @HVCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @HVCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @Arrow from { address@hidden } to { address@hidden }
    @Arrow from { address@hidden } to { address@hidden }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @HVCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @HVCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @Arrow from { address@hidden } to { address@hidden }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @HVCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @VHCurveArrow from { address@hidden } to { address@hidden } radius { 0.25f }
    @Arrow from { FC } to { address@hidden }
    @Arrow from { FG } to { FH }
    @Arrow from { FH } to { FI }
    @HVCurveArrow from { FI } to { address@hidden } radius { 0.25f }
    @Arrow from { FF } to { address@hidden }
}



-- 
Mark.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]