[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Behviour of .write request
From: |
Ralph Corderoy |
Subject: |
Re: [Groff] Behviour of .write request |
Date: |
Thu, 16 Apr 2015 13:42:05 +0100 |
Hi Radek,
> ... typeset the article header where article is like chapter.
> ... play a games with numerci register counting articles, sections, ...
> .sp 5v
> \fCactual_page=\\n[actual_page], %=\\n[%]\fP
> .tm Article: \\$1, \\n[%]
> .\" Generate TOC entry
> .write toc .ta .25i 5i +.25iR
> .write toc \t\\n[article_number] \\$1 \a\t\\n[%],\\n[actual_page]
> .write toc .br
> ..
>
> The problem is, I see good numbers from \fCactual_page=
> But the numbers from .tm command are wrong and the numbers writtn into
> toc stream are also wrong. They do not match.
Is that because \n% sometimes changes during the macro because it is
producing output?
$ cat radek.tr
.pl 5
.nf
.
.de m
1 \\n%
2 \\n%
3 \\n%
..
.
.m
.m
.m
$ nroff radek.tr
1 1
2 1
3 1
1 1
2 1
3 2
1 2
2 2
3 2
$
Cheers, Ralph.