groff
[Top][All Lists]
Advanced

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

Re: [Groff] Re: pic and macros [looks like a bug]


From: Werner LEMBERG
Subject: Re: [Groff] Re: pic and macros [looks like a bug]
Date: Sun, 10 Mar 2002 10:03:07 +0100 (CET)

> > If a (valid) pic picture is drawn from _within_ a macro, the .ll
> > request stops working!  See the following example code.

Quick answer: pic macros don't work within other macros.  It is
beyond pic's knowledge how to check whether a macro definition is
active or not.

> Ah, as it turns out, pic is emitting an .nf request.  I suspect when
> used within a macro this is not reset properly.

Correct.  pic emits

  .nr 00 \n(.u
  ...
  .if \n(00 .fi

To make this work within a macro, the following would be necessary:

  .nr 00 \\n(.u
  ...
  .if \\n(00 .fi

> A quick hack is below, but this is surely incorrect as .fi may not
> have been on before the macro is called (I checked, it causes lines
> to be wrapped after a pic even if .nf was set prior).  The correct
> fix would seem to be looking into fixing something other than the
> symptom, but this (or just putting .fi in the macro after .PE) would
> seem indicated ;^)

It is hard to fix; in general, all preprocessor macros don't work
within other macros.

For your specific example the following will do the trick:

  .eo
  .de He
  box;
  ..
  .ec
  ...

I doubt that this will work in general, but maybe you are lucky, and
you can restrict yourself to simple pic images.


    Werner

reply via email to

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