groff
[Top][All Lists]
Advanced

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

Re: [mom] Extraneous empty line that starts a new page


From: Peter Schaffter
Subject: Re: [mom] Extraneous empty line that starts a new page
Date: Mon, 24 Apr 2023 14:55:00 -0400

Sorry for top-quoting Branden's reply _in toto_ but it will make
replying easier.

On Sun, Apr 23, 2023, G. Branden Robinson wrote:
> Hi Frederic,
> 
> At 2023-04-24T01:37:00+0200, Frederic Chartier wrote:
> > I've stumbled on another problem with -mom. There is a table at
> > the bottom of a page. After the table, something inserts what
> > behaves like a line feed and Groff warns that
> > 
> >     [mom]: '2023-04-24.mom', macro TE, line 61:
> >             Insufficient room for label, caption, and/or source after
> >             table on page 1.  Omitting, but continuing to process.
> >     2023-04-24.mom:61: environment stack underflow
> > 
> > Two things strike me as odd about these messages. First, the
> > table in question has no label, caption or source so why warn
> > about it ? Second, "environment stack underflow" sounds like
> > something went wrong in mom's internals.
> 
> I don't have a solution for you because I'm not qualified to do mom(7)
> support, but I can clarify a couple of things.
> 
> The first diagnostic messge comes from the macro package, from mom(7)
> itself.  The second one, the cryptic "environment stack underflow",
> comes from the formatter (GNU troff).
> 
> I tried to dig deeper into this, but when I format this document using
> groff Git HEAD, with the "-b" and "-ww" flags to sniff out as many
> problems as possible, I get a _lot_ of diagnostics.
> 
> troff: backtrace: file 
> '/home/branden/src/GIT/groff/build/../contrib/mom/om.tmac':20283
> troff:/home/branden/src/GIT/groff/build/../contrib/mom/om.tmac:20283: 
> warning: macro 'PDFBOOKMARK.NAME' not defined
> troff: backtrace: file 
> '/home/branden/src/GIT/groff/build/../contrib/mom/om.tmac':23328
> troff:/home/branden/src/GIT/groff/build/../contrib/mom/om.tmac:23328: 
> warning: macro 'pdfview' not defined
> troff: backtrace: 
> '/home/branden/src/GIT/groff/build/../contrib/mom/om.tmac':4286: macro 
> 'PRINTSTYLE'
> troff: backtrace: file 'ATTIC/frederic.mom':3
> troff:ATTIC/frederic.mom:3: warning: register '#COLLATE' not defined
> 
> Something's gone badly wrong, and I'm not sure what.

Indeed.

> Possibly the document's state is invalid (mom(7) is not
> implemented sloppily).

The document is well-formed except for the erroneous use of 'cm' as
a scaling unit instead of just 'c'.

> I'm sure Peter's cluebox is much fuller than mine.

Actually, no.  First things first.  Just guessing, but the backtrace
warnings you give, Branden, suggest you didn't process with pdfmom,
which takes care of pdf forward references.  Not sure about this.

Regardless, when I process the document with groff 1.23.0.rc1.3711-25fb
and mom-2.5_c, passing pdfmom the -b flag (but not the -w flag), I
receive a string of errors of the form

  troff: backtrace: '2023-04-24.mom':83: macro '3init'
  troff: backtrace: file '2023-04-24.mom':92
  troff:2023-04-24.mom:92: error: numeric overflow

The first thing to notice is that the document is 71 lines long so
the reported line numbers aren't useful.  Secondly, the macro
'3init' is not used in om.tmac.  I've scoured the tmac directory but
am unable to locate where it's defined nor where it's being called.
  
I've never seen this behaviour before.  It's been a while since I
needed tbl(1) in a mom document so I'm thinking it crept in during
one of the past year's bazillion commits.  Most likely something to
do with tbl(1) or with gropdf(1).  At any rate, I need help tracking
this down.

Once we get the mysterious 3init problem solved, I can take a look
at the OP's original problem.  tbl(1) handling at or near a page
transition presents a number of edge cases and I may not have caught
them all.

I'm re-attaching the OP's original document with the erroneous 'cm'
corrected to 'c' for convenience.

--
Peter Schafter
https://www.schaffter.ca

Attachment: 2023-04-24.mom
Description: Text document


reply via email to

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