groff
[Top][All Lists]
Advanced

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

Re: [Groff] Formatting algorithm


From: Peter Schaffter
Subject: Re: [Groff] Formatting algorithm
Date: Tue, 22 Apr 2014 15:40:18 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Apr 22, 2014, Ulrich Lauther wrote:
> Well of course not.  A paragraph ends, e.g. when an empty line is
> seen.  Probably there are a whole lot of other conditions.  My
> understanding is that formatting takes place after macros have
> been expanded; at the macro level it would be easier.  So could
> the macros issue some hint (in form of a pseudo comment) when they
> realize that a paragraph has ended?

Signalling the end of collected paragraphs can't be done exclusively
within macros because, unlike SGMLs, paragraph macros in groff
generally aren't closed.  That means that every macro introducing a
new semantic element would have to test, at the start of the macro
definition, whether paragraph collecting is currently taking place,
and bring it to an end so the paragraph can be formatted.  While
that would work in a lot of cases, I think the better strategy would
be to implement two requests, say .pb and .pe, usable within macro
definitions, but also available on-the-fly in cases where the user
needs to specify the block of text that constitutes a paragraph.

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



reply via email to

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