groff
[Top][All Lists]
Advanced

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

RE: [Groff] PIC misunderstanding?


From: Ted Harding
Subject: RE: [Groff] PIC misunderstanding?
Date: Sat, 11 Nov 2000 16:09:10 -0000 (GMT)

On 10-Nov-00 address@hidden wrote:
> 
> Greetings,
> 
> I am probably being incredibly stupid but could someone please explain
> to me why the two pictures produced by the following fragment of PIC
> code are different?
> The second picture is the one I would expect.

So it would seem, on the surface. I can't be definitive about this,
but I believe it is consistent with intended behaviour, on the
following grounds.

In Kernighan's original PIC manual (section 9, Blocks) it says:

  "Any sequence of pic statements may be enclosed in brackets [ and ]
   to form a block, which can then be treated as a single object, and
   manipulated rather like an ordinary box" ... "By default, blocks
   join with other things as boxes do, at the center of the appropriate
   side."

An interpretation of this which is consistent with the behaviour you
observed is that when you wrote [ ... ] ; [ ... ] the first [] was drawn
from left to right leaving the "current point" at the centre of its
righthand side. Then the second [] was drawn from this point, giving
rise to the result you obtained,

If this is correct, then there is an implicit over-ride of absolute
coordinates given inside the block, by the coordinates of the current
point, in the sense that the contents of the block are drawn
"silently" using the absolute coordinates within, and then the whole
drawn block gets shifted so that its left-hand centre point is at the
current point prior to being physically drawn.

However, my interpretation above is not based on having seen any such
thing documented, merely on trying to see whether your results might
be kosher.

So, either this behaviour is a bug, or it is yet another instance
of the documentation being laconic to the point of being misleading.

One way to see whether groff is being kosher is to check whether
the same happens with a classic UNIX troff. If so, then it's OK!

I hope this helps.
Ted.

> Before anyone asks: yes, I have read the manual.
> 
> This is with GROFF 1.16.1 on Redhat Linux 6.2 for Intel.
> 
>    .PS 5in
>    [
>       move to (0,0)
>       line to (1,1) -> "A"
>    ]
>    [
>       move to (0,0)
>       line to (-1, 1) -> "B"
>    ]
>    .PE
> 
>    .PS 5in
> 
>       move to (0,0)
>       line to (1,1) -> "A"
> 
> 
>       move to (0,0)
>       line to (-1, 1) -> "B"
> 
>    .PE
> 
> Thanks,
>     S.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 284 7749
Date: 11-Nov-00                                       Time: 16:09:10
------------------------------ XFMail ------------------------------

reply via email to

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