groff
[Top][All Lists]
Advanced

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

[Groff] Re: another tbl peculiarity


From: Gunnar Ritter
Subject: [Groff] Re: another tbl peculiarity
Date: Sat, 08 Nov 2008 15:43:43 +0100
User-agent: Heirloom mailx 12.5pre 10/4/08

Werner LEMBERG <address@hidden> wrote:

> > | If no line length is specified in the block of text itself, or in
> > | the table format, the default is to use LxC/(N+1) where L is the
> > | current line length, C is the number of table columns spanned by
> > | the text, and N is the total number of columns in the table.
> >
> > Because this rule is too simplistic for most cases, Bell Labs tbl
> > requires a .ll for most text blocks anyway.  The problem here is
> > that tbl puts a text block into a formatted diversion before the
> > actual column widths have been computed, so it can only guess what
> > they are.
>
> It's not clear to me what you mean.  Please elaborate.

When tbl encounters a T{ in its input, it immediately
generates code to start a diversion, and then copies the
text to the output until the T} appears. This diversion
is formatted, i.e. when troff reads it later, it computes
line breaks immediately. At this time however, tbl did not
yet generate the troff code to compute the actual widths
of the table columns. Thus, the .ll which tbl emits at the
start of the diversion is only either the guess computed
with the above formula, or the minimum column width if that
had been specified.

> I have the impression that heirloom tbl currently doesn't follow the
> LxC/(N+1) rule for text block spans larger than one column if there is
> at least one `w' specifier.  Am I missing something?  It fails even if
> all column widths are specified with `w' -- no guessing necessary at
> all in this case.

No, you are right. If there is a minimum column width given
for the column in which the text block starts, that width
is used for the generated .ll, regardless of following spans.

> BTW, I get buggy output for this table also:
>
>   .TS
>   tab(;);
>   l l l
>   l s l.
>   a a;T{
>   b b b b b b b b
>   b b b b b b b b
>   T};c c
>   T{
>   d d d d d d d d
>   d d d d d d d d
>   d d d d d d d d
>   d d d d d d d d
>   T};e e
>   .TE
>
> The `d' and `e' fields overlap...

This is a consequence of the LxC/(N+1) rule. The line
length within the second text block is one half of
the total line length. However, the first column is
actually more narrow than one quarter of the total line
length. Thus, the second text block is too wide. As I
said, an explicit .ll is very often necessary with
Bell Labs tbl.

Gunnar




reply via email to

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