[Top][All Lists]

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

[groff] [UTROFF] Pagraph at once adjustment

From: Pierre-Jean
Subject: [groff] [UTROFF] Pagraph at once adjustment
Date: Thu, 30 Nov 2017 10:24:56 +0100
User-agent: mail v14.8.16

Hello alls,

As stated on my previous mail, I’ll talk today about the
paragraph at once adjustment of Heirloom Troff in Utmac.

# Paragraph at once adjustment details

The paragraph at once adjustment appears to be difficult to use,
because of the way it has been implemented by Gunnar Ritter:
macros within the paragraph are executed before the whole
paragraph is adjusted. As a result, notes are diverted in the
page where the paragraph begins, while the corresponding line
could appear on the next page. To solve that problem, Heirloom
Troff provides an output line trap \P[macro] which only executes
the macro when the line is printed. Utmac uses these output line
traps each time it is needed, particularly to divert notes and
refer to a page number.

    .nr num 1 1
    .de NS
    .\" Start a note
    .       \" Put an output line trap.
    .       \" Define an output line trap macro
    .       de note:trap
    .               \" collect all notes in note:div
    .               da note:div
    .                       br
    .                       nf
    .                       \" actually print the note
    .                       note:print-\n[num]
    .                       br
    .               di
    .               ev
    .       ev note
    .       br
    .       \" divert the note to the macro note:print-W,
    .       \" which is only called when the line is printed.
    .       di note:print-\\n[num]
    .de NE
    .\" End a note
    .       br
    .       di
    .       ev

As you might notice, it is not easy to understand, even in this
simplified example. That complexity is not the only flail of the
paragraph at once adjustment of Heirloom Troff: it is also
bugged, as noticed on the repository of Karsten Kunze:

These two reasons motivated me to try to port Utmac to Neatroff.
That’s a lot of work, since both Neatroff and Heirloom Troff have
their special set of troff commands. Hopefully, once ported to
neatroff, it should be easy to achieve compatibility with groff.

On my next mail, I’ll probably talk about fonts.
Kind Regards,

reply via email to

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