groff
[Top][All Lists]
Advanced

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

Re: [Groff] .NH ms Macro Question


From: Andrew J. Piziali
Subject: Re: [Groff] .NH ms Macro Question
Date: Mon, 8 Mar 2004 17:05:05 -0600 (CST)

Larry,

   In reply to my question about detecting an imminent page break:

     I use the following macro in an ms document to make the font size
     of a chapter title proportional to the chapter level.  As noted in
     the comments below, as currently implemented it has the side effect
     of changing the size of text in the page footer if the embedded
     call to .NH triggers a page break.

     How can I detect that a page break is imminent, force the page
     break and then change PS, VS and call .NH?

you suggested:

     The easiest way is to add ".ne 4" or something similar to the
     beginning of the macro.  This creates a conditional page break --
     if there are less than four lines left before the footer
     (literally, before the next vertical trap), it forces a page break
     then begins executing the rest of the macro.

     I use 4 lines because that's enough space for the heading, a blank
     line, then two lines of the first paragraph past the heading.

   I implemented this solution and it prevented almost all occurrences
of oversized footer text.  I am currently using a ".ne 5" at the top of
the macro but ran into a case where a paragraph ends an inch and a half
or so from the bottom of the page.  The next request is a .NHT macro
call.  Apparently, the ".ne 5" does not force a page break because the
PS and VS registers are incremented and then the footer is printed.

   I hesitate to continue increasing the .ne value because it will cause
unnecessary whitespace at the end of every page.

   Is there another approach which takes advantage of the algorithm .NH
uses to decide whether or not to break the page?

   Thank you.



-- 
                                                        |
address@hidden                       ________------+------________
                                                       / \
                                                      *---*


reply via email to

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