groff
[Top][All Lists]
Advanced

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

DWB and Heirloom Doctools tbl(1) table formatting bugs


From: G. Branden Robinson
Subject: DWB and Heirloom Doctools tbl(1) table formatting bugs
Date: Sat, 2 Mar 2024 21:34:47 -0600

[self-follow-up; looping in groff list]

At 2024-03-02T18:09:11-0600, G. Branden Robinson wrote:
> I used scripts that generate and diffed output from several
> formatters.  I'm attaching them in case they are of some help.

Naturally enough, after attaching them, I spotted something that
revealing my howling ignorance of old-school (pre-groff) nroff
formatting.

I was using ul(1) to process the output of DWB and Heirloom Doctools
nroffs; I should have been using col(1).  Doing so markedly improves the
rendering of tables using horizontal rules on terminals.

There are still warts.  Given a table format of

Lb        Cb       S   Lb
Lb        Lb       Lb  Lb
Lbw(25n)2 Lbw(8n)2 Lb2 Lx.

...where, if one has a decoder for tbl(1) format specifications, one can
see that the second column should be 8 ens wide, DWB 3.3 tbl/nroff
unaccountably makes it much wider.

                                             Code
          Boolean Capability Name    TI                 TC  Description
          _______________________________________________________________
          auto_left_margin           bw                 bw
                                                            cub1 wraps
                                                            from column 0
                                                            to last col-
                                                            umn

Heirloom Doctools is better at honoring the explicit column width,
but...

                                      Code
       Boolean Capability Name    TI        TC  Description
       _______________________________________________________________________
       auto_left_margin           bw        bw
                                                cub1 wraps from
                                                column 0 to last
                                                column

...it forgot to return the "change" to the fourth column, which is
permitted to e"x"pand to the remainder of the line length.  As you can
see, this causes unnecessary crowding.

These problems also occur with DWB and Heirloom troff--that is, when
formatting for a typesetter, like dpost(1) to produce PostScript.

Further, we see that both DWB and Heirloom put spurious vertical space
at the top of the text block.  I suspected that I could suppress this by
changing man/MKterminfo.sh to inject `'ad l` instead of `.ad l` (i.e.,
by using the *roff no-break control character), but this had no effect.
So I reckon it's just a bug in these old tools.  It _almost_ doesn't
manifest in typesetter output, except when a table row with a text block
occurs at the bottom of the page; when that happens, the first three
columns set at the bottom of page n, and the final column sets by itself
at the top of page n+1.

Finally, I will note that DWB 3.3 tbl produces many spurious complaints
like this:

tbl: File .../toe.1, line 202: Warning: Too many columns with 'x' modifier.

So let's have a look at that table.

.TS
Lx.
\-\-> /etc/terminfo
\-\-\-\-> /lib/terminfo
\-\-\-\-\-\-> /usr/share/terminfo
.TE

Yup, one out of one column has an 'x' modifier.  Clearly way too many.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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