groff
[Top][All Lists]
Advanced

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

Re: [Groff] Inline evaluation of calculations?


From: Tadziu Hoffmann
Subject: Re: [Groff] Inline evaluation of calculations?
Date: Tue, 16 May 2006 15:07:48 +0200
User-agent: Mutt/1.5.11

> You could of course define a macro/parametrised string on the
> lines of
>
> .de eval
> .nr Neval \\$*
> \\n[Neval]
> ..
>
> The value of \en%+1 is
> .eval \n%+1
> (correct since this is page 1).
>
> which produces the output
>
>   The value of \n%+1 is 2 (correct since this is page 1).

Unfortunately this doesn't seem practical for debugging info
output with the terminal message request if you have text
interspersed with numbers to be calculated, e.g.,

  .tm distance from high-water mark to page bottom is \n(.p-\n(.h

I guess for this purpose the junk variable method will probably
still be the most straightforward.





reply via email to

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