groff
[Top][All Lists]
Advanced

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

Re: [Groff] how to write this section-break macro?


From: Larry Kollar
Subject: Re: [Groff] how to write this section-break macro?
Date: Thu, 27 May 2004 19:26:17 -0400

On Wednesday, May 26, 2004, at 07:25 PM, Dorai Sitaram wrote:

I'd like to write a section-break macro, say .SB, with the following
properties:

(1) If the break occurs in the middle of a page -- i.e., with pre-break
and post-break text on the same page -- then the break is representated
as some tell-tale vertical space.

(2) If however the break occurs at a page break, then the new page
starts with an ornament, such as a centered ***.

The rationale for (2) is that we need some indication that the section
break occurred -- since there is no vertical space marking it.

Any ideas would be much appreciated.  I think groff must have enough
registers that can be checked to pull this off, except I don't know
which.

Use \n[.t] to get the space (in units) to the next trap....

.de SB
.ne 1i
.sp 3
.if \\n[.t]>=648000u \{\
.ce
\&***
.\}
..

You may have to adjust the comparison number if you're not using
the PostScript driver. In this case, 648000 is 9 inches, the distance
between the top & bottom margins in a USletter page in -ms. The
".sp 3" request won't do anything if you're already at the top of a
page.

Hope that helps,
--
Larry Kollar     k  o  l  l  a  r  @  a  l  l  t  e  l  .  n  e  t
Unix Text Processing: "UTP Revival"
http://home.alltel.net/kollar/utp/



reply via email to

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