groff
[Top][All Lists]
Advanced

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

Re: [Groff] "Cosmetic" filling


From: Ted Harding
Subject: Re: [Groff] "Cosmetic" filling
Date: Thu, 31 Aug 2006 15:28:15 +0100 (BST)

On 31-Aug-06 Gunnar Ritter wrote:
> (Ted Harding) <address@hidden> wrote:
> 
>> 1. I'm not aware of a simple mechanism in groff to
>>    do this -- e.g. fill all lines whose minimum
>>    formatted length is within X of line-length.
> 
> AT&T troff has a \n(.x register which holds the remaining
> horizontal space on the current output line. Thus it is
> possible to do
> 
> .sp 5c
> .ps 28
> .vs 36
> .de SP
> .     if \\n(.x<1n \p\%
> .     sp
> ..
> .ll \w'a full line'u
> a full line
> stretch it
> .SP
> a full line
> a line
> .SP
> more text
> 
> \n(.x is documented as a "reserved version-dependent register"
> but has the described semantics in every version I have seen
> from 7th edition troff on.

Thanks for pointing this out! Your version above does not seem
to work as intended in groff, but

> The \% is necessary to trick the internal control flow; the
> .brp request would make it superfluous but is, of course, not
> available in AT&T troff.
> 
> By introducing a documented register for the same purpose, it
> would become possible to use e.g.
> 
> .de SP
> .     if \\n[.rl]<1n .brp
> .     sp
> ..

... this version does!

> to get the desired effect.
> 
>       Gunnar

Interesting. Many thanks!
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 31-Aug-06                                       Time: 15:28:10
------------------------------ XFMail ------------------------------




reply via email to

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