groff
[Top][All Lists]
Advanced

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

Re: An example of a multiplication table: some unresolved questions


From: Thomas Dupond
Subject: Re: An example of a multiplication table: some unresolved questions
Date: Mon, 29 May 2023 23:29:46 +0200

Dear Oliver,

Oliver Corff <oliver.corff@email.de> wrote:

> Dear All,
> 
> the attached attempt to create a multiplication table was inspired by
> https://rosettacode.org/wiki/Multiplication_tables
> 
> but I fail to do the right thing with regard to typesetting the computed
> output.
> 
> I followed the groff manual, section Tabs and Fields, and set up my tab
> positions as follows:
> 
> .ta 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR
> 
> So, 12 tab stops at a distance of 4 m (I never have more than three
> digits in my table example), all right-justified.
> 
> However, the \t escape seems to be completely ignored.
> 
> The alternative, conditionally prepending \~ if \n[p] < 100 and \~\~ if
> \n[p] < 10 also seems to fail.
> 
> Thank you all for your enlightenment!

Does this example fill some of what you are trying to achieve?

.nf
.ta 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR
.nr x 1 1
.nr y 1 1
.nr p 0
.while (\n[x] <= 12) \{\
.while (\n[y] <= 12) \{\
.nr p \n[x]*\n[y]
\n[p]   \c
.nr y +1
.\}
.br
.nr x +1
.nr y 1 1
.\}

-- 
Regards,
Thomas



reply via email to

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