Re: [Groff] Diversion/trap help

2010-09-20 Thread Tadziu Hoffmann

  Under what circumstances would a diversion that ends on the
  bottom line of a page spring a footer trap even when the
  diversion has been chopped?
 
 As usual, please provide a small snippet which demonstrates
 the problematic behaviour.

It might be related to outputting the diversion in no-fill mode,
which behaves somewhat as if there were a .br at the end.
Try the following, and uncomment either the .nf or the .br:


.\ This is for A4 paper.
.\ 
.wh 0 HD
.wh -2c FT
.pl 29.7c
.po 2.5c
.ll 16c
.\ 
.de HD
.ev 1
.lt 16c
.sp |1c-1v
.tl ''page % header''
.sp |2c
.ev
..
.de FT
.ev 1
.sp |29.7c-1c-1v
.tl ''page % footer''
.bp
.ev
..
.\ 
.de XX
ps: def
/cm { 72 mul 2.54 div } def
/BPhook
{ gsave
  1 .9 .9 setrgbcolor 0 27.7 cm 21 cm  2   cm rectfill
  .9 1 .9 setrgbcolor 0  2   cm 21 cm 25.7 cm rectfill
  .9 .9 1 setrgbcolor 0  0   cm 21 cm  2   cm rectfill
  grestore }
def
..
.\ 
\Y[XX]\c
.di xx
Hello,
.br
\!.sp 24.9c
world.
.br
.di
.\ .nf
.xx
.\ .br
.\ 
.\ This is the end. Don't let blank lines creep in here.





Re: [Groff] Diversion/trap help

2010-09-19 Thread Werner LEMBERG

 Under what circumstances would a diversion that ends on the bottom
 line of a page spring a footer trap even when the diversion has been
 chopped?

The end of document handling in groff is handled specially in the
C++ source; maybe there's a bug.

 If anyone can come up with a reason (or several reasons), I may be
 able to track down the source of the problem and then be more
 precise in asking for help if I can't fix it myself.  As it is, I'm
 stymied.

As usual, please provide a small snippet which demonstrates the
problematic behaviour.

And sorry for not having time yet to examine your `refer' problem.


Werner



[Groff] Diversion/trap help

2010-09-17 Thread Peter Schaffter
I've been struggling with a problem for three days, so I guess
it's time to ask help.

Under what circumstances would a diversion that ends on the bottom
line of a page spring a footer trap even when the diversion has been
chopped?

I've been working on the refer section of mom, and I came upon
the problem, as so often, by accident.  Some endnotes happened to
conclude at the very bottom of a page, and I discovered that a blank
page, complete with header and footer, was being output afterwards.

The endnotes are collected in a diversion which outputs flawlessly
over several pages.  However, when the final page ends as I've
described, there's that damn blank page afterwards, even though
the diversion's chopped before output.

If anyone can come up with a reason (or several reasons), I may
be able to track down the source of the problem and then be more
precise in asking for help if I can't fix it myself.  As it is,
I'm stymied.

-- 
Peter Schaffter

Author of The Binbrook Caucus
http://www.schaffter.ca