[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] blm blues
From: |
Tadziu Hoffmann |
Subject: |
Re: [Groff] blm blues |
Date: |
Sat, 15 Nov 2008 22:50:15 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
> 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
- [Groff] blm blues, Miklos Somogyi, 2008/11/10
- Re: [Groff] blm blues, Tadziu Hoffmann, 2008/11/10
- Re: [Groff] blm blues, Werner LEMBERG, 2008/11/11
- Re: [Groff] blm blues, Larry Kollar, 2008/11/15
- Re: [Groff] blm blues,
Tadziu Hoffmann <=
- Re: [Groff] blm blues, Ted Harding, 2008/11/15
- Re: [Groff] blm blues, Tadziu Hoffmann, 2008/11/15
- [Groff] -ms paragraph macros don't reset glyph- and fill-color, Dorai Sitaram, 2008/11/20
- RE: [Groff] -ms paragraph macros don't reset glyph- and fill-col, Ted Harding, 2008/11/20
- Re: [Groff] -ms paragraph macros don't reset glyph- and fill-col, Dorai Sitaram, 2008/11/21
- Re: [Groff] -ms paragraph macros don't reset glyph- and fill-col, Werner LEMBERG, 2008/11/21
- Re: [Groff] blm blues, Miklos Somogyi, 2008/11/17