[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] PIC: access global labels from within a [] block
From: |
Tadziu Hoffmann |
Subject: |
Re: [Groff] PIC: access global labels from within a [] block |
Date: |
Fri, 8 Jul 2016 19:32:30 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
(Posted to the list because of possible general interest.)
> > A bracketed block can be treated as a single unit and
> > aligned like any primitive object, but I don't think it
> > is possible to align the entire block by specifying an
> > "absolute" position for an internal sub-component of
> > the block.
> One can position a sub-component inside a block using
> "with .sub-component.s at GLOBAL.s" with alignment
> consequences for the entire block.
Indeed, this is possible. My bad.
What does not work is positioning subcomponents individually
relative to outside objects:
A: box "A"
B: [
C: box "C"
arrow
D: box "D" with .n at A.s + (0,-.1)
]
(but you can position D relative to C).
What does work is positioning the entire block:
A: box "A"
B: [
C: box "C"
arrow
D: box "D"
] with .D.n at A.s + (0,-.1)
i.e., the block itself has a single alignment specification,
but this can refer to a sub-component.
> The problem arises, however, when one tries to position two
> sub-components of the block independently with respect to
> outer objects.
Yes, like in the first example above.
> Suppose I have two global boxes (GLOBAL1 and GLOBAL2) and
> then a block with two boxes (A and B):
>
> .PS
> GLOBAL1: box
> GLOBAL2: box
> .... some crooked movement here ...
> BLOCK: [
> A: box
> B: box
> ]
> .PE
>
> I want to position A under GLOBAL1 and B under GLOBAL2 respectively,
> i.e. to make BLOCK.A.c.y = GLOBAL1.c.y and BLOCK.B.c.y = GLOBAL2.c.y.
Are the global boxes constrained?
If not, then a possible solution to your layout problem might be
to align GLOBAL1 and GLOBAL2 relative to BLOCK.A resp. BLOCK.B:
BLOCK: [
A: box "A"
move
B: box "B"
]
LOCAL: box width BLOCK.wid+.5 height BLOCK.ht+.5 with .c at BLOCK.c
"Local" at LOCAL.nw + (.05,-.02) below ljust
GLOBAL1: box "G1" with .s at BLOCK.A.n + (0,.75)
GLOBAL2: box "G2" with .s at BLOCK.B.n + (0,.75)