bugGNU roff - Bugs: bug #63960, [man,mdoc] continuous rendering...


bug #63960: [man,mdoc] continuous rendering can cause tbl to misdraw vertical rules

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sat 25 Mar 2023 08:18:58 PM UTC
Category:  Macro package - others/general Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 29 Mar 2023 07:34:19 AM UTC, comment #4: 

Do this for both man(7) and mdoc(7).

G. Branden Robinson <gbranden>
Group administrator
Mon 27 Mar 2023 08:56:06 AM UTC, comment #3: 

comment #1:

> the "3usekeeps" hack

implemented as a repsonse to bug #57665

Dave <barx>
Group Member
Sun 26 Mar 2023 04:19:27 PM UTC, comment #2: 

Also, this is new misbehavior in groff 1.23.0; 1.22.4 draws the vertical rule "correctly", but all tables are interrupted by 1v of blank space where the page breaks mentioned in comment #1 would be (the rule also does not span the blank space, because the formatter thinks there's a page boundary there).  I find this near-cosmetic problem a lesser evil, but readers' mileage may vary, and in any case, I mean to fix it one way or the other.

G. Branden Robinson <gbranden>
Group administrator
Sun 26 Mar 2023 04:15:55 PM UTC, comment #1: 

Confirmed; thanks for the report.

The version of the ascii(7) man page in Linux man-pages 5.10 on my Debian system did not reproduce this behavior, but the one from my Git checkout of its project did.

I'm attaching a bespoke reproducer.

The problem appears to be that even with continuous rendering on, a notional page length of 11 inches remains in place, extended in places by certain macros a line at a time.  However, when we start a table with `TS`, that macro can't have any idea how long the table will ultimately be.

Thus, if the table should happen to be long enough to cross a "page" boundary, the vertical line (which is always drawn from the bottom up in GNU tbl) is of the wrong length (and starts from the wrong place, too).

Here's a patch that appears to solve the problem.  It's a bit of a hack (but so is what we do for line length in HTML output.)

Before committing, which might wait until after 1.23.0 final anyway, I'd like to see if this hack obviates the need for the "3usekeeps" hack which I also put in place for managing tbl tables in man pages when continuous rendering.

And ultimately, both of those hacks as well as a lot of tedium in man(7) and mdoc(7) might be obviated if we proceed with my plans in bug #63587.

$ git di
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 0d540fbcb..df92dfa27 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1203,6 +1203,10 @@ contains unsupported escape sequence
 .  \" If continuous rendering, tell tbl not to use keeps.
 .  ie \\n[cR] .nr 3usekeeps 0
 .  el         .nr 3usekeeps 1
+.  if \\n[cR] \{\
+.    nr an*saved-trap-distance \\n[.t]
+.    pl +1000i
+.  \}
 .  if \\n[an*is-output-html] \{\
 .    nr an-TS-ll \\n[.l]
 .    ll 1000n
@@ -1218,6 +1222,10 @@ contains unsupported escape sequence
 .de1 TE
 .  if \\n[an*is-output-html] .ll \\n[an-TS-ll]u
+.  if \\n[cR] \{\
+.    pl (u;\\n[nl] + \\n[an*saved-trap-distance])
+.    rr an*saved-trap-distance
+.  \}
 .  if !r TW .if !\\n[an-was-tbl-failure-reported] \{\
 .    ds an-msg tbl preprocessor failed, or it or soelim was not run;\"
 .    as an-msg " table(s) likely not rendered\"

Feel free to apply this to your local derivative of groff; please report any collateral problems arising from it.

(file #54526)

G. Branden Robinson <gbranden>
Group administrator
Sat 25 Mar 2023 08:18:58 PM UTC, original submission:  

Subject: nroff...rc3: missing vertical line in long tables with cR=1
(default value)

GNU nroff (groff) version 1.23.0.rc3
GNU groff version 1.23.0.rc3

  Seen with "man 7 ascii":


       074   60    3C    <                           174   124   7C    |
       075   61    3D    =                           175   125   7D    }
       076   62    3E    >                           176   126   7E    ~
       077   63    3F    ?                         | 177   127   7F   DEL
   Tables                                          |

#End of example

  "nroff -t -man -rcR=0 ascii.7" shows the vertical line.

Bjarni Ingi Gislason <bjarniig>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #54526:  brascii.7 added by gbranden (2KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-29 gbranden CategoryMacro package man Macro package - others/general
        Summary[man] continuous rendering can cause tbl to misdraw vertical rules [man,mdoc] continuous rendering can cause tbl to misdraw vertical rules
    2023-03-26 gbranden CategoryPreprocessor tbl Macro package man
    2023-03-26 gbranden Summary[tbl] roff...rc3: missing vertical line in long tables with cR=1 (default value) [man] continuous rendering can cause tbl to misdraw vertical rules
    2023-03-26 gbranden Attached File- Added brascii.7, #54526
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code