groff
[Top][All Lists]
Advanced

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

RE: [Groff] Inline evaluation of calculations?


From: Ted Harding
Subject: RE: [Groff] Inline evaluation of calculations?
Date: Thu, 11 May 2006 19:18:50 +0100 (BST)

On 11-May-06 Larry Kollar wrote:
> I was wondering if there was a way to, for example, print the result  
> of \n%+1 without using a junk variable. I didn't see a request  
> equivalent to "eval" in the manpages or the texinfo thing.

Hi Larry,
I'm not aware of one either (though of course the "junk variable"
method works fine).

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).

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 11-May-06                                       Time: 19:18:46
------------------------------ XFMail ------------------------------




reply via email to

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