groff
[Top][All Lists]
Advanced

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

[Groff] Beginner Groff issue: number registers inside macros


From: Zoë Blade
Subject: [Groff] Beginner Groff issue: number registers inside macros
Date: Wed, 27 Jun 2012 16:49:06 +0100

Hi!

I'm learning a bit of Groff syntax, and I seem to be having trouble getting 
Groff to remember number registers from inside macros.  Here's some example 
code I'm trying out:

----

.nr foo 0
First line.
.if (\n[foo] == 1) .sp
.nr foo 1
First line still.
.if (\n[foo] == 1) .sp
A new paragraph.

'bp

.de C
.nr bar 0
..

.de D
.if (\n[bar] == 1) .sp
.nr bar 1
..

.C
First line.
.D
First line still.
.D
A new paragraph.

----

I'd expect both pages to consist of two separate paragraphs, but for the second 
one, they're all bunched up together as if the "\n[bar] == 1" condition is 
never met.  Are number registers retained when a macro is called again?  Is 
there something simple I'm doing wrong?

Thank you very much for your help!

Zoe.


reply via email to

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