groff
[Top][All Lists]
Advanced

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

Re: [Groff] Vertical position not affected by .sp request


From: Werner LEMBERG
Subject: Re: [Groff] Vertical position not affected by .sp request
Date: Fri, 15 Jul 2011 10:17:21 +0200 (CEST)

> I think that the vertical position is initialized to -1 before any
> text has been output is also by design, to be able to set page
> margins on the first page with a ".wh 0 xx" trap.  To quote the
> Troff User's Manual:
> 
>   A pseudo-page transition onto the first page occurs either when
>   the first break occurs or when the first nondiverted text
>   processing occurs. Arrangements for a trap to occur at the top of
>   the first page must be completed before this transition.

Or to quote the info manual of groff:

 -- Register: \n[nl]
     This register contains the current vertical position.  If the
     vertical position is zero and the top of page transition hasn't
     happened yet, `nl' is set to negative value.  `gtroff' itself does
     this at the very beginning of a document before anything has been
     printed, but the main usage is to plant a header trap on a page if
     this page has already started.

     Consider the following:


          .de xxx
          .  sp
          .  tl ''Header''
          .  sp
          ..
          .
          First page.
          .bp
          .wh 0 xxx
          .nr nl (-1)
          Second page.

     Result:


          First page.

          ...

                                       Header

          Second page.

          ...

     Without resetting `nl' to a negative value, the just planted trap
     would be active beginning with the _next_ page, not the current
     one.



  Werner



reply via email to

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