groff
[Top][All Lists]
Advanced

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

Re: [Groff] Right-aligning tables?


From: Werner LEMBERG
Subject: Re: [Groff] Right-aligning tables?
Date: Fri, 14 Aug 2009 19:27:46 +0200 (CEST)

> By default, tbl leaves tables on the left.  You can also specify
> centered.  It follows, therefore, that you should be able to define
> a right-aligned (relative to column) table.  Anyone have a quick and
> dirty macro for this?

See below.  The trick is to redefine .TS and .TE to start and end a
diversion, respectively.  Afterwards, simply specify the correct
indentation using the diversion width.

Note that I haven't tested it extensively: Expect problems for tables
which are broken across pages.


    Werner


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


.rn TS TS-old
.rn TE TE-old
.
.de TS
.  di mytbl
..
.
.de TE
.  di
..
.
.TS
tab(@), linesize(2);
lb | lb
l | l.
.sp 2p
address@hidden Size
.sp 2p
_
.sp 2p
address@hidden" wide by 0.5" high
address@hidden" diameter
address@hidden" wide by 0.5" high
address@hidden" radius
address@hidden" long
address@hidden" long
.sp 5p
_
.TE
.
.rm TS
.rm TE
.rn TS-old TS
.rn TE-old TE
.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.

.in (\n[.l]u - \n[dl]u)
.nf
.mytbl
.fi
.in

This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.
This is a test.




reply via email to

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