[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] Piic behaviour
From: |
Ted Harding |
Subject: |
RE: [Groff] Piic behaviour |
Date: |
Fri, 03 Aug 2007 17:19:57 +0100 (BST) |
On 03-Aug-07 15:10:06, Udo Krebelder wrote:
> Hi,
>
> I have a strange problem with pic. Here is the code:
>
> ********************************
> .de PS
> ..
> .de PE
> ..
> .PS
> scale = 25.4
># draw right dimension arrow
> define LinR {[
> X: line from $1 right 10
> Y: line from $2 right 10
> line <--> from X.center to Y.center sprintf("%g", $3) ljust
> ]}
># draw upper dimension arrow
> define LinU {[
> X: line from $1 up 10
> Y: line from $2 up 10
> line <--> from X.center to Y.center sprintf("%g", $3) above
> ]}
> A: box wid 80 ht 100
> LinR(A.ne, A.se, A.ht)
> LinU(A.nw, A.ne, A.wid)
> .PE
> **********************************
>
> I am not shure if i do something wrong, but the result are not two
> dimension arrows on the right and upper side of the rectangle
> (groff version 1.19.2).
Your mistake was to bracket the bodies of LinL and LinR within [...],
thus making each into a "block". In particular, names etc. occurring
within a block are local to the block, so inside the [...] the
block would not see "A" when passed "A.nw", for instance.
The cure is to remove the "[" and "]":
.PS
scale = 25.4
# draw right dimension arrow
define LinR {
X: line from $1 right 10
Y: line from $2 right 10
line <--> from X.center to Y.center sprintf("%g", $3) ljust
}
# draw upper dimension arrow
define LinU {
X: line from $1 up 10
Y: line from $2 up 10
line <--> from X.center to Y.center sprintf("%g", $3) above
}
A: box wid 80 ht 100
LinR(A.ne, A.se, A.ht)
LinU(A.nw, A.ne, A.wid)
.PE
Best wsihes,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 03-Aug-07 Time: 17:19:54
------------------------------ XFMail ------------------------------