groff
[Top][All Lists]
Advanced

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

Re: [Groff] tbl problems in man


From: Werner LEMBERG
Subject: Re: [Groff] tbl problems in man
Date: Tue, 06 Feb 2007 12:35:06 +0100 (CET)

> > What's the problem with .TQ?  Most of the data in groff_mm.man can
> > be represented with this macro in a satisfying way, I believe.
>
> Since you say so, I assume it's possible.  But I have not figured
> out how yet.

Have a looked at the attached file.

> OK.  But first, even if we don't find a way to implement what I'm
> about to suggest, I've experimented and verified that the lumpy
> tables can be fixed by adding a w format to the bad column's format
> spec.  [...]

Later on you say:

> The only problem with using w is that the number that needs to go to
> go next to it is brittle -- it may break if the table indent
> changes, or if the the point size changes, or if the margins change.

I fully agree.  It can make such man pages ugly to read.

> If my understanding is correct, TBL picks a random value for the
> maximum width of the T{ T} block because T{ }T blocks are processed
> before the rest of the table, so TBL can't know how much horizontal
> space is going to be left when the other columns have claimed their
> share.

It's not arbitrary.  The formula can be found in the tbl man page.

> But now imagine that the w specifier takes a percent syntax that
> looks like this: [...]
>
> Now we can force good behavior without having to care about the
> current indent, or point sizes, or margins, or how they might
> change.  This trick is shamelessly stolen from the percent-spec form
> of table width in HTML.

I disagree.  The nice thing of tables created with tbl is that each
column gets exactly the width it deserves.  Using your percent model,
this advantage is lost.  Additionally, it surprises me that you are
suggesting an extension to `tbl' which won't be available with non-GNU
implementations!

It would be possible to implement a new global keyword which makes the
table use the remaining horizontal space for text blocks after the
other column widths have been computed.  However, this is still a
non-portable extension...

I still think that tables with T{...T} don't work well within man
pages.  Instead, .TP and TQ should be used, as demonstrated in the
attached file.


    Werner

'\" t
.TH
.
.
.P
Some completely useless text to demonstrate the left and right margin
within a manual page.
.
.RS
.TS
tab(@);
lb lb
l l.
address@hidden
address@hidden
Abstract is printed on page\~1 and on the cover sheet if used in the
released-paper style (\fBMT\~4\fP),
otherwise it is printed on page\~1 without a cover sheet.
T}
address@hidden
Abstract is only printed on the cover sheet (\fBMT\~4\fP only).
T}
address@hidden
Abstract is printed only on the cover sheet (other than \fBMT\~4\fP only).
The cover sheet is printed without a need for \fBCS\fP.
T}
.TE
.RE
.
.P
Some completely useless text to demonstrate the left and right margin
within a manual page.
.
.RS
.TP
.B Arg
.B Placement
.TQ
0
Abstract is printed on page\~1 and on the cover sheet if used in the
released-paper style (\fBMT\~4\fP),
otherwise it is printed on page\~1 without a cover sheet.
.TQ
1
Abstract is only printed on the cover sheet (\fBMT\~4\fP only).
.TQ
2
Abstract is printed only on the cover sheet (other than \fBMT\~4\fP only).
The cover sheet is printed without a need for \fBCS\fP.
.TE
.RE

reply via email to

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