groff
[Top][All Lists]
Advanced

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

Re: [Groff] Suggested tbl enhancement


From: Robert Thorsby
Subject: Re: [Groff] Suggested tbl enhancement
Date: Mon, 22 May 2006 18:44:25 +1000

On 2006.05.22 14:46 Werner LEMBERG wrote:
> McGlinton & McNabb in "Typesetting Tables on the Unix System" give
> examples of nested tables using diversions :-)

With tbl?  Interesting.  Please give an example.

From p.218 of their book:

.br
.di d1
.in 0
.TS
cp-2 s
lp-3 cp-3
lp-3 cp-3 .
=
TEA GROWING COUNTRIES
COUNTRY<tab>ACRES UNDER
\^<tab>CULTIVATION
.sp 2p
_
.sp 2p
.T&
a n .
India<tab>875,000
Sri Lanka<tab>580,000
Africa<tab>225,000
U.S.S.R.<tab>200,000
Indonesia<tab>175,000
_
.sp 2p
.TE
.br
.di
.br
.di d2
.in 0
.TS
cp-2  s      s
cp-2  s      s
lp-2  np-2  np-2 .
=
SCOTCH DRINKING COUNTRIES
THOUSANDS OF GALLONS
COUNTRY<tab>1959<tab>1969
.sp 2p
_
.sp 2p
.T&
a n n .
United States<tab>12,098<tab>26,605
Great Britain<tab>6,862<tab>9,233
France<tab>281<tab>2,476
Canada<tab>1,109<tab>1,240
Australia<tab>1,077<tab>1,362
_
.sp 2p
.TE
.br
.di
.TS
center, doublebox ;
c || c .
T{
.nf
.d1
T}<tab>T{
.nf
.d2
T}
.TE
.rm d1 d2

In the book the source code for d1 and the output of the substantive table were shown but d2 was left "as an exercise for the reader". Therefore, the possibility of a typo by me has increased exponentially.

I use diversions in tables all the time. For example, I make a "wall-hanging" calendar where above "this month" is a picture, to the left of which is a very small six or seven line tabular calendar for "last month", and to the right of the image is a similar tabular calendar for "next month": this is done with nested tables. To achieve base line alignment in the case where "last month" is six lines and "next month" is seven lines, I cheat by throwing in an ".sp ...p" at the beginning of the six-line mini-table.

HTH,
Robert Thorsby



reply via email to

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