groff
[Top][All Lists]
Advanced

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

Re: [Groff] pointsize changes in .NH ms-macro


From: Keith MARSHALL
Subject: Re: [Groff] pointsize changes in .NH ms-macro
Date: Wed, 8 Sep 2004 10:42:39 +0100

Joerg van den Hoff wrote:
> keith,
>
> thanks again for the help which solved (and explained) the problem in 
> the first place. but:
>
> in the attached expample the problem persists if, instead of a text 
> body, a sufficiently large postscript file (I included one which is 
> expected in the current directory where tt2.trf resides) is included 
> with PSPIC. again the incorrect point size in the footer (and subsequent 

> header) is only present if the next section starts at the top of the 
> next page. this occurs now despite the fact that the .br is included in 
> the .SHEAD definition.
>
> any ideas (from anybody)?

Hi Joerg,

I've had another look at this.

The problem still boils down to getting the bottom of page trap to
spring at the proper time, i.e. *before* the point size is changed
by the SHEAD macro.

In this case, there is room for one additional line of 13pt text,
at the bottom of the first page, so the .br request alone is not
sufficient to spring the trap.  However, the NH allegedly requires
enough space for one heading line, plus two lines of the following
paragraph ...

    .\" from s.tmac
    .\" SH-NO-TAG called by .NH
    .de SH-NO-TAG
    address@hidden
    .\" Keep together the heading
    .\" and the first two lines of the next paragraph.
    .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
    .sp 1
    .ft B
    ..

For SHEAD, we need to pre-empt that .ne request which will be invoked
by .NH, *before* the point size is changed -- seems like my original
idea of putting a .ne in SHEAD was less redundant that I concluded;
shame that I put it in the wrong place, and didn't request enough
space! :-(

Here's a modified definition of SHEAD, which should do the trick ...

    .de SHEAD
    .\"inputs: $1: NH-level, $2: title
    .\"------
    .br
    .nr incps (4-\\$1)*3
    .if \\n[incps]<0 .nr incps 0  \"just in case ...
    .ne 3v+\\n[incps]p+\\n[\\n[.ev]:PD]u+\\n(.Vu
    .nr incps \\n[incps]/3
    .nr PS +\\n[incps]
    .nr VS +\\n[incps]
    .NH \\$1
    \\$2
    .nr PS -\\n[incps]
    .nr VS -\\n[incps]
    ..

... (note how I've augmented the .ne request copied from SH-NO-TAG,
to account for the change in VS which will be in effect when .NH is
invoked, but allowing the .ne to spring the bottom of page trap,
*before* it changes).

Actually, I believe we may have discovered a bug in s.tmac! The
declared intent in SH-NO-TAG is to keep *two* lines of the following
paragraph with the header, but only *three* lines are requested, and
.NH wants one blank line before the header, one line for the header
itself, and the third 'v' accounts for only *one* line from the
following paragraph -- unless there is an additional line included
in the \\n[\\n[.ev]:PD], but I don't believe that to be the case,
(my understanding is that PD gives additional spacing above a
paragraph, but doesn't include the height of a line of text).

I will follow up on this, and submit a patch, if necessary.

HTH.

Best regards,
Keith.




reply via email to

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