groff
[Top][All Lists]
Advanced

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

[Groff] Question about .trunc


From: Peter Schaffter
Subject: [Groff] Question about .trunc
Date: Wed, 2 Nov 2016 16:50:09 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

I'm baffled.

According to the info docs, .trunc is "a read-only register containing
the amount of vertical space truncated by the most recently sprung
vertical position trap."  However, if I insert

  .tm page \\n[%] \\n[.trunc]

at the very top of a trap-invoked footer macro that coincides with
my bottom margin, .trunc is reporting '0' even when the last line on
the page falls short of the bottom margin.  Assuming flowing text
with no '.ne', shouldn't .trunc be reporting the space truncated by
the trap?  E.g., if my trap is at position 'Y' and the last line
before the trap falls at 'Y-\n[.v]/2', shouldn't that cause .trunc
to report \n[.v]/2, which is "the amount of vertical space truncated
by the most recently sprung vertical position trap"?

I'm working on implementing flexible vertical space in the mom
macros.  The ideal method would be to grab .t from the last printed
line and divide it by the number of flex-spaces on the page, however
.t from the last printed line is not available once the footer trap
is sprung.  The next obvious choice, one would think, is to get
the value of .trunc and use it to derive a value equal to the last
.t, but .trunc isn't doing what I expect.  The only other choice
for calculating a value equal to the last .t is to use nl or .h,
subtract it from the page length, then get the difference between
the nl/.h and the location of the trap.  However, my diagnostics
show that nl and .h are not always identical, and I can't figure out
how to tell groff "sometimes use nl, sometimes use .h".

--
http://www.schaffter.ca



reply via email to

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