groff
[Top][All Lists]
Advanced

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

Re: [Groff] nesting tbl?


From: Werner LEMBERG
Subject: Re: [Groff] nesting tbl?
Date: Fri, 16 Aug 2002 15:57:08 +0200 (CEST)

> > Nevertheless, it is very simple to imitate two-column output in
> > groff by moving the current location up and right to the middle of
> > the page.
> 
> Could you provide an example of this for the less coding savvy among
> us.

Here is a very primitive example with a lot of room for
improvements.  For example, the tables could be saved into diversions
so that they can be centered vertically also.


    Werner

======================================================================

.\" we assume a paper width of 210mm (A4) = 2*page offset + line length
.po 2c
.ll 17c
.
This is a test how two tables can be positioned side by side.
We use a simple two-column imitation to do that.
Note that all values are hard-coded for simplicity.
.sp
.
.\" now take the half with a gap of 1cm
.ll 8c
.
.mk image-top
.
.TS
tab(@), center, box;
c | c.
address@hidden
_
address@hidden
.TE
.
.mk image-bot-left
.
.\" move to the beginning of the right table
.sp |\n[image-top]u
.po (2c + 8c + 1c)
.
.TS
tab(@), center, box;
l | l.
address@hidden@
_
address@hidden
_
table.@
.TE
.
.\" move to the bottom left of the two tables, restoring the line length
.if (\n[image-bot-left] > \n[nl]) \
.  sp |\n[image-bot-left]u
.po 2c
.ll 17c
.sp
.
We are done.
Both tables have been positioned side by side, and the text continues below
the tables.
The same can be done with more than two tables; perhaps someone tries to
write a small auxiliary macro package to handle that.

reply via email to

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