[Top][All Lists]

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

Re: [Groff] blm blues

From: Ted Harding
Subject: Re: [Groff] blm blues
Date: Sat, 15 Nov 2008 22:28:18 -0000 (GMT)

On 15-Nov-08 21:50:15, Tadziu Hoffmann wrote:
>> I know I'm coming in late, but there are two things I'd do
>> differently: set a default and use relative spacing (v)
>> instead of machine units (u).
>> .de blank_aux
>> . if !rblankreg .nr blankreg 0.4v
>> . sp \\n[blankreg]u
>> ..
>> .blm blank_aux
>> Replace the 0.4v above with whatever you want the default
>> value to be and it will work with the entire range of devices
>> and text sizes.
> Unfortunately this implementation has the disadvantage that the
> blank line spacing is fixed with the baseline spacing in effect
> when the macro is first called.  For example, if you first call it
> in the title which, say, has a font size of 24pt and a baseline
> spacing of 26pt, and then switch to body text with font size
> 10pt and baseline spacing 12pt, the blank line spacing will not
> be 0.4v of that of the body text.
> The solution Miklos gave does not have this problem, but it
> works correctly only when "blank" is called without units,
> always with the interpretation that the number represents "V"s.
> The default centimeter scale is somewhat misleading. It's there
> only to introduce a scaling factor to store a non-integer in an
> integer register. The scaling factor is divided out again in
> "blank_aux". (Although he should have simply said "1c" instead
> of "28340", to be independent of the unit scale of the output
> device.) (By the way, the correct number for devps appears to
> be "28346".)
> Perhaps the best solution would be to simply defer computation
> of the spacing until it is actually needed. This is possible by
> storing the desired spacing in a string instead of a register,
> which allows the units to be preserved:
>   .de blank
>   .ds blankreg \\$1
>   ..
>   .de blank_aux
>   .sp \\*[blankreg]
>   ..
>   .blm blank_aux

The following seems to work OK, and does not provoke the difficulties
noted above:

.de blank_aux
.sp \\n[.v]u/10u*4u
.blm blank_aux
This is a line.
And another line.

This is a line following a blank line.

Note that simply changing the point-size does not change \n[.v] at
the same time. So that needs to be done separately as well (it may
be looked after by your macro package). But, once \n[.v] has been
changed, the above macro blank_aux will pick up the ambient value.

Hoping this helps!

E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 15-Nov-08                                       Time: 22:28:15
------------------------------ XFMail ------------------------------

reply via email to

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