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!

Best regards, Oliver.

--
Dr. Oliver Corff
Mail: oliver.co...@email.de
.ta 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR
.nr p 0
.nr x 0 1
.nr y 1 1
.while (\n[y] <= 12) \{\
.if (\n[y]<10) \{\
\~
.\}
\n[y]\0|
.nr x 0 1
.while (\n[x] < 12) \{\
.nr x +1
.nr p \n[x]*\n[y]
\t
.if (\n[y]<=\n[x]) \n[p]
.\}
.br
.nr y +1
.\}

Reply via email to