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 16:00:54 +0100 (BST)

OOPS!!! Ignore my response below!

1. In groff. \n[.x] is the major version number of groff

2. \[.rl] of course does not exist so would get value 0
   if invoked.

Ted.

On 31-Aug-06 Ted Harding wrote:
> 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 ------------------------------
> 
> 
> _______________________________________________
> Groff mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/groff

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




reply via email to

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