groff
[Top][All Lists]
Advanced

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

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


From: Steve Izma
Subject: [Groff] Re: how to write this section-break macro?
Date: Thu, 27 May 2004 21:56:47 -0500
User-agent: Mutt/1.3.28i

> To: address@hidden
> Date: Wed, 26 May 2004 19:25:14 -0400 (EDT)
> From: Dorai Sitaram <address@hidden>
> Subject: [Groff] how to write this section-break macro?
> 
> 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.  

I'd like to comment on this from the point of view of
readability. I think this is a good example as to why blank lines
as either section breaks or (worse) paragraph breaks are not a
good idea, at least not on a printed page.

If text scrolls without a page break (e.g., e-mail), then the
blank line is unambiguous. But otherwise, as you point out, the
reader can easily miss the break, especially if the last text line
before the break runs nearly the full line length.

However, adding an ornament only on these occasions makes this
particular break take on a new significance relative to all the
other breaks that are merely blank lines: the reader has to
interrupt their thinking about the content in order to ask
something like "Is this a sub-break or a super-break?" I
recommend always using an ornament. Alternatively, you could
signal the beginning of a new section with a blank line followed
by a change in formatting for the first line of the next
paragraph, e.g., with the first few words in small caps.

Just the same, if you ever need to write a macro that needs to
now it's not close to the bottom of the page, you could check
that the distance to the next trap is greater than a couple of
lines, e.g.:

.if \\n[.t]>2v

(assuming you only have a trap at the bottom of the page)
or else compare the current position (\n[.d]) with the depth
of the page, either \n[.pl] or some other register you may have
created to represent the last printable line on the page.

Hope this helps,

        -- Steve

-- 
Steve Izma
    Computing Systems Administrator       (519) 884-0710 ext. 6125
    Wilfrid Laurier University Press      FAX: (519) 725-1399
    Waterloo, Ont., Canada N2L 3C5        address@hidden


reply via email to

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