[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] gtbl, T{ ... T} doesn't work?
From: |
Sverre Slotte |
Subject: |
Re: [Groff] gtbl, T{ ... T} doesn't work? |
Date: |
Wed, 19 Aug 2009 10:49:52 +0300 |
User-agent: |
Thunderbird 1.5.0.12 (Windows/20070509) |
A trick I have been using is to utilise groff's own mapping mechanism
for achieving vertically aligned source code.
Given an original code-fragment like this:
.TS
tab(:);
l l l l.
foo:bar:2:xxx
this is a longer field:right!:89:xyzzy
a:b:3:d
.TE
one can use .char to achieve something like this:
.char _ \&
.TS
tab(:);
l l l l.
foo_____________________:bar______:_2:xxx
this is a longer field__:right!___:89:xyzzy
a_______________________:b________:_3:d
.TE
.rchar _
When executed with "groff -t -Tlatin1 | head" both examples produce:
foo bar 2 xxx
this is a longer field right! 89 xyzzy
a b 3 d
I normally use some character from the upper half of the Latin1
character set as filler character, e.g. the bullet character.
As this method relies only on groff it has the added benefit of
working on platforms of limited capacity with no shell-escape mechanism.
This is something I came up with years ago, and I discussed it with
James Clark in private e-mail. I might have posted it here before,
cannot remember.
One thing I would have liked to acheive was to use the space character
as filler. However, I do not know how to map space to \&. Maybe
somebody on the list can help me out -- how do I achieve the
equivalent of
.char <space> \&
in groff?
Best regards, Sverre
--
Sverre Slotte | Oppibergsgränden 2 D | Phone +358 9 8558007
address@hidden | 02210 Esbo, Finland | Mobile +358 50 4839532