groff
[Top][All Lists]
Advanced

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

Re: Re: Avoid page break in tables without box option


From: Jan Eden
Subject: Re: Re: Avoid page break in tables without box option
Date: Tue, 23 Apr 2024 09:26:22 +0200

Hi Branden,

On 2024-04-23 01:59, G. Branden Robinson wrote:

> 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?

Unfortunately, I failed to describe my requirements properly – sorry
again. My document contains multiple relatively small tables, and each
table should appear on exactly one page (i.e. should not cross page
boundaries).

I attached sample documents and the respective outputs of

groff -mm -t -Kutf8 -Tpdf test_boxed.groff > test_boxed.pdf

to this message, and I would like to achieve the page break behaviour of
the boxed variant, but without having actual boxes drawn around the
tables.

- Jan

Attachment: test_boxed.groff
Description: Text Data

Attachment: test_boxed.pdf
Description: Adobe PDF document

Attachment: test_unboxed.groff
Description: Text Data

Attachment: test_unboxed.pdf
Description: Adobe PDF document

Attachment: signature.asc
Description: PGP signature


reply via email to

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