Here is a macro to be used with mom, that moves to a distance down from top or
up from bottom, depending on the sign of the argument:

.\" Goto position relative to top or bottom of page depending
.\" on sign of argument, respecting margins with parameter "m"
.\" Examples: .Goto -3c / .Goto 3c m
.MAC Goto END
.  ie \\$1<0 \{\
.    nr tmp \\n[#PAGE_LENGTH]+\\$1-\\n[#LEAD]
.    if '\\$2'm' .nr tmp \\n[tmp]-\\n[#B_MARGIN]
.  \}
.  el \{\
.    nr tmp \\$1
.    if '\\$2'm' .nr tmp \\n[tmp]+\\n[#T_MARGIN]
   \}
.  vpt 0
.  SP |\\n[tmp]u
.  vpt
.END

Have fun,

     ulrich

Reply via email to