NROFF Question
kolstad at convex.UUCP
kolstad at convex.UUCP
Fri Aug 2 07:48:00 AEST 1985
you asked:
why does
.sp 4/2+1
not do the same as
.sp 3
(in essence, anyway)
The answer is:
nroff (and troff) are always trying to be helpful and give you default
units for things. When you say ".sp 1" then nroff (and troff, too)
say: ``well, he doesn't want to space 1 UNIT (maybe 1/432" or 1/300")
he really wants to space 1 LINE (a VERTICAL UNIT -- 1v)''. Now, this
is all well and good for things like ".sp 1+1" which translates to
".sp 1v+1v". The trick comes when you do something like ".sp 4/2+1"
which good old nroff (and troff, too) changes to:
.sp 4v/2v+1v
which is of course:
.sp 2u+1v
which is a single space (or close enough)...
The solution to your problem is to remember two things:
(a) nroff & troff's only goal in life is to screw you
(b) when in doubt, ALWAYS SPECIFY UNITS.
The following seems to work just fine:
.sp 4v/2u+1v
which is probably what you wanted anyway.
Your friend in text processing,
Rob Kolstad
CONVEX Computers
214-952-0351
More information about the Comp.unix.wizards
mailing list