groff
[Top][All Lists]
Advanced

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

Re: Avoid page break in tables without box option


From: G. Branden Robinson
Subject: Re: Avoid page break in tables without box option
Date: Tue, 23 Apr 2024 01:59:19 -0500

Hi Jan,

At 2024-04-23T08:24:19+0200, Jan Eden wrote:
> Sorry for failing to mention that I use the tbl preprocessor,

I figured that.  It takes exceptional courage and patience with tedium
to lay out tables _without_ tbl.  :P

> which only has a `nokeep` option described as follows:
> 
> "Don't use roff diversions to manage page breaks. Normally, tbl
> employs them to avoid breaking a page within a table row. This usage
> can sometimes interact badly with macro packages' own use of
> diversions—when footnotes, for example, are employed. This is a GNU
> extension."

The foregoing advice could probably use some fine-tuning.  Is it okay to
use *roff diversions if you let a macro package that ships with groff do
it for you?

You seem to be bumping into an anticipated issue, though.

groff 1.23.0's tbl(1) man page includes the following cautionary note:

Limitations
     Multi‐page tables, if boxed and/or if you want their column
     headings repeated after page breaks, require support at the time
     the document is formatted.  A convention for such support has
     arisen in macro packages such as ms, mm, and me.  To use it, follow
     the .TS token with a space and then “H”; this will be interpreted
     by the formatter as a TS macro call with an H argument.  Then,
     within the table data, call the TH macro; this informs the macro
     package where the headings end.  If your table has no such heading
     rows, or you do not desire their repetition, call TH immediately
     after the table format specification.  If a multi‐page table is
     boxed or has repeating column headings, do not enclose it with
     keep/release macros, or divert it in any other way.  Further, the
     bp request will not cause a page break in a “TS H” table.  Define a
     macro to wrap bp: invoke it normally if there is no current
     diversion.  Otherwise, pass the macro call to the enclosing
     diversion using the transparent line escape sequence \!; this will
     “bubble up” the page break to the output device.  See section
     “Examples” below for a demonstration.

I got good results with the attached document.  Here are the commands I
used.

$ nroff -t -mm EXPERIMENTS/table.mm

$ groff -t -mm EXPERIMENTS/table.mm > table.ps

Does this help?

Regards,
Branden

Attachment: table.mm
Description: Text Data

Attachment: table.ps
Description: PostScript document

Attachment: signature.asc
Description: PGP signature


reply via email to

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