groff
[Top][All Lists]
Advanced

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

Re: mom problem


From: Peter Schaffter
Subject: Re: mom problem
Date: Sun, 14 Aug 2022 14:24:27 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

Ulrich --

On Sun, Aug 14, 2022, Ulrich Lauther wrote:
> I found the culprit.  It is in my macro NumberPages that you see
> at the top of my example file.  Only if I call this macro, the
> problem occurs.

> .MAC NumberPages END
> .PRINTSTYLE TYPESET
> .HEADERS OFF
> .FOOTERS OFF
> .PAGINATE
> .PAGENUM_POS BOTTOM RIGHT
> .PAGENUMBER_STRING "\\$1 \\*[PAGE#] \\$2"
> .START
> .END

The problem stems from mom inhibiting vertical spacing (.ns)
  • at the start of documents/chapters, whether or not a docheader
    is printed
  • after page transitions
Restoration of spacing is controlled by a trap just underneath the
first line of body text on the page.

In the case of the first line being the one under the docheader,
.RESTORE_SPACE must be used (see the docs).

First lines on subsequent pages are trickier since the HEADER macro
sets .ns.  Short of studying the output to see where .RESTORE_SPACE
would need to be inserted, a more radical solution is required:
re-define the SPACE macro.

  .rm SPACE
  .de SPACE
  . ie \\n[.ns] \{\
  .   rs
  .   vpt 0
  .   nop \&
  .   vpt
  .   sp -1
  .   sp
  . \}
  . el .sp
  ..

This ensures that .ns is removed when SPACE is called.  It fixes the
problem for your sample file, though I'm not sure how robust it is
for real-world files.

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



reply via email to

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