groff
[Top][All Lists]
Advanced

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

Re: [Groff] Exact column widths in 'tbl'


From: Tadziu Hoffmann
Subject: Re: [Groff] Exact column widths in 'tbl'
Date: Wed, 10 Aug 2011 20:12:58 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

> Of course the keyword w(...) in the table format line,
[snip]
> specifies a *minimum* column width. So it will not do
> for setting a maximum column width, especially where there
> are long text blocks in some cells.
>
> The following example shows how to do it in general. The
> basis is that a ".ll" request in a text block sets a line
> length and this will be reflected in the resulting column
> width (unless something else, e.g. a long entry which is
> not a text block, forces a wider column).
[snip]

In this particular example, the table will be formatted
*exactly* the same if you leave out the ".ll" requests in the
text blocks and instead use the following table specification:

  | l | lw(3i) | lw(1.25i) |.

This is because tbl does exactly what you're doing manually,
namely setting the line width to whatever was specified as
column width before processing the text block.  (Take a look
at the output of tbl before it is fed to troff.)  As you
correctly note, it's called "minimum" column width because
tbl cannot guarantee that you have non-text-block items in
the column which are wider than what is given in the spec
(or text blocks which cannot be broken to this width).

The trouble with using the ms paragraph macros in the
text blocks is that they themselves reset the line width,
overwriting whatever tbl has set up for that text block.





reply via email to

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