groff
[Top][All Lists]
Advanced

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

Re: [Groff] Horizontal rule w/ length a fraction of the page width?


From: Werner LEMBERG
Subject: Re: [Groff] Horizontal rule w/ length a fraction of the page width?
Date: Thu, 14 Jul 2005 07:45:54 +0200 (CEST)

> To specify a line whose length is 80 percent of the line length, I
> am currently using this:
> 
>   \l'\n(.l/1.25'

This doesn't work correctly.

> I tried this:
> 
>   \l'\n(.l*.80'

This doesn't work correctly too.

There is a very important concept if you work with groff requests and
escapes: The default scaling indicator.  For \l, it is the em unit.
This:

  \l'\n(.l*.80'

is thus handled as

  \l'\n(.lm*.80m'

But accessing a register like \n(.l always returns its value in
internal units `u'!  Consequently, the line length will be far too
long in most cases.  Additionally, for devices where the value of `u'
is near to `m', computing `.80m' is round to 1, making the
multiplication very inexact.

To overcome all those limitations I suggest that you say this:

  \l'\n(.lu*80u/100u)

avoiding fractional numbers.


     Werner




reply via email to

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