groff
[Top][All Lists]
Advanced

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

[Groff] Readable tbl-source


From: Slotte Sverre (NRC/Helsinki)
Subject: [Groff] Readable tbl-source
Date: Wed, 04 Sep 2002 13:37:54 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020510

Hi

When cleaning out some old e-mail files I came upon an old question of mine: is it somehow possible to make the tbl-source "look OK" for easier editing? When elimiting fields with TAB or : or whatever fields of varying lengths make it difficult to see what is going on.

I originally sent this question to gnu.groff.bug in 1996, but I got no reply. Here we go again in a new forum:

-----------------------------------------------------------------
I am using gtbl to format a table. The fields of the table are of
varying length, and this makes it rather hard to read and edit:

    tab(:);     \" not mentioned in subsequent examples
    ...
    foo:bar:2:xxx
    this is a longer field:right!:89:xyzzy
    a:b:3:d

I came up with the (imho) novel idea on using ".char" (outside
the .TS/.TE pair) to create a filler character in order to put
some external structure into my table:

    .char _ \&

    foo_____________________:bar______:_2:xxx
    this is a longer field__:right____:89:xyzzy
    a_______________________:b________:_3:d

    .rchar _

This works beautifully; gtbl has no trouble formatting my table
correctly, and the source code is very readable.

In fact, I do not (normally) use standard characters, such as _,
but choose something out of the upper half of the latin1
character set. I am rather fond of the bullet character, since it
does not normally appear in text.

I have also used ".char _ \0" when I have needed a digit-wide
filler that does not occupy two spaces in the file.

My question is: is this a safe and acceptable way of using gtbl?
If not, why?

Would it even be possible to somehow map the space character
to \&, thus being able to write:

    .char _ \N'32'   \" This would output a real space

    foo                     :bar      : 2:xxx
    this_is_a_longer_field  :right    :89:xyzzy
    a                       :b        : 3:d

Eagerly awaiting responses from groff-gurus out there
-----------------------------------------------------------------

Regarding the question "is this a safe and acceptable way of using gtbl?" James Clark informed me that he "can't see any problem with it".

As for using spaces instead of e.g. _ I seem not to have received an answer, or then I just cannot find it anywhere.

Since groff is now under development again I should very much like to open this question again. Is there a batter way of achieving readable tbl-source than mapping rare characters to \&? Whitespace would be better, I think, but then we run into the problem with spaces and tabs apperaring quite legally in the text-fields.

Can something be done to gtbl to allow for source-code formatting? gpic does not have this problem, as it does not use whitespace in the same way (== formatting is possible).

Any thoughts out there?

Sverre

--
Sverre Slotte |  address@hidden  |  Mobile +358 50 4839532
--------------+---------------------------+------------------------
              |  Nokia Research Center    |  Phone  +358 7180 39532
              |  P.O. Box 407             |
              |  FIN-00045 Nokia Group    |  Phax   +358 7180 36850
              +---------------------------+------------------------



reply via email to

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