Hi Peter, At 2023-04-25T14:59:22-0400, Peter Schaffter wrote: > This thread picks up from > Re: [mom] Extraneous empty line that starts a new page > > I've built and installed 1.23.0.rc4.26-3aa8c and continue to get > numeric overflow errors in documents that use tbl, starting with > the second and continuing for all subsequent tables. The output > is clean despite the errors, which all originate from tbl's 3init > macro.
Yup. > When I switch out the newly installed /usr/local/bin/tbl for an > older version of tbl (from 1.22.4), the error messages disappear. Yup. > I'm loathe to file a bug report at this time because you appear to > be getting different results when processing with tbl, i.e. you are > not seeing the error messages. But I am now--maybe I was before and didn't notice, overlooking them in the flood of output generated by the barracks inspector. > Given that an older version of tbl does not report any errors, it > would seem the problem is with tbl in 1.23.0.rc4, however I wouldn't > bet the farm on it. You are right. The problem is simple and originates in a commit I made a couple of years ago. commit cee547e8839a82f8b21b2859a9370fd74f9793f3 Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Sat Jan 30 08:13:43 2021 +1100 [tbl]: Save and restore hyphenation parameters. * src/preproc/tbl/table.cpp (table::init_output): When starting a table, save the hyphenation parameters (\n[.hy], \n[.hla], \n[.hlm], \n[.hym], \n[.hys]). Restore them in the table reset macro (confusingly called "3init"), which is called before performing each diversion and before exiting a table. This enables people to, e.g., turn off hyphenation in a table text block with .nh, just as they can turn off adjustment with .na, without having to manually reset it. The next text block, and the material after the table, will not be affected. Fixes <https://savannah.gnu.org/bugs/?59971>. Looking at the diff: + ".hym \\\\n[" SAVED_HYPHENATION_MARGIN_REG "]\n" + ".hys \\\\n[" SAVED_HYPHENATION_SPACE_REG "]\n" There's my problem, right there. I'm not supplying a scaling unit of 'u'; the default for these requests is 'm'. I suspect no one ever noticed this before because (1) no other macro package actually exercises this feature and (2) you have to use more than one tbl(1) table in a mom(7) document before it rears its head. Here's sample output from my debugging exhibit (attached). $ ./build/test-groff -t -mom -z ATTIC/frederic3.mom GBR1: hym=0, hys=0 GBR2: hym=36000, hys=1000 gropdf-info:href tbl:1 GBR3: hym=504000000, hys=14000000 gropdf-info:href tbl:2 troff:ATTIC/frederic3.mom:57: error: numeric overflow troff:ATTIC/frederic3.mom:57: error: numeric overflow Pretty easy to see where those values were headed. Will fix. Also find attached a small reproducer. I'll be turning this into a regression test. Regards, Branden
.tm GBR1: hym=\n[.hym], hys=\n[.hys] .PAPER A4 .DOCHEADER OFF .PRINTSTYLE TYPESET .L_MARGIN 2.0cm .R_MARGIN 2.0cm .B_MARGIN 2.0cm .PT_SIZE 14 .LS 20 .FAMILY H .HEADERS .HEADER_MARGIN 2.0c .HEADER_GAP 1.5c .HEADER_LEFT "x" .HEADER_RIGHT # .PAGINATE OFF .START .HEADER .HEADING 1 "First heading" .HEADING 2 "x" .tm GBR2: hym=\n[.hym], hys=\n[.hys] .TS H l r. .TH x x x x .TE .tm GBR3: hym=\n[.hym], hys=\n[.hys] .HEADING 2 "x" .TS H l r. .TH x x x x x x .TE
.hym 10m .hys 5m .TS L. foo .TE .TS L. bar .TE
signature.asc
Description: PGP signature