groff
[Top][All Lists]
Advanced

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

Re: [Groff] tbl: text blocks vs. centering


From: Werner LEMBERG
Subject: Re: [Groff] tbl: text blocks vs. centering
Date: Thu, 07 Sep 2006 08:02:22 +0200 (CEST)

> .LP
> \&...
> .TS H
> allbox expand;
> cbp9 cbp9 cbp9w(3i)
> cp9v10 lp9v10 lp9v10 .
> Pattern       Indication      Solutions
> .TH
> T{
> Power LED on
> for 2 seconds
> or longer
> T}    T{
> Power-on Self Test Failed
> T}    Replace the gadget.
> .TE
>
> The text in the first column should be centered, but is left-
> justified.

The crucial part of explaining the behaviour is this sentence from
tbl.man:

  The default length of a text block is given by LC/(N+1), where `L'
  is the current line length, `C' the number of columns spanned by the
  text block, and `N' the total number of columns in the table.

As a consequence, the real field length is completely ignored;
similarly, vertical border lines and the like are ignored too.  The
algorithm for handling text blocks is roughly as follows:

  1. Put each text block into a diversion with the given width, either
     following the above formula or using a user-specified width.
  2. Set the adjust flags, sizes, etc., as specified.
  3. Format the diversions.
  4. Construct the table and use the diversions.

Step 4 shifts the diversions horizontally as needed by other fields,
but within the diversions the horizontal spaces can't be changed
anymore.  This causes the strange positions you observe.

With other words: Always specify a width for a column which contain
text blocks.

> Displaying a PS version, you can also see that the two cells using
> text blocks are higher than the one-liner cell. If the one-liner was
> vertically centered, I could understand that, but it obviously
> isn't.
>
> The tbl(1) manpage says that text in cells is vertically centered
> unless you use the T or D specifiers. That doesn't seem to be the
> case here either.

Here is what tbl.man says about `v':

  No effect if the corresponding table entry isn't a text block.

This means that for the third column the default vertical spacing
(12pt) is used.


    Werner




reply via email to

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