groff
[Top][All Lists]
Advanced

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

[Groff] digits in eqn


From: Ted Harding
Subject: [Groff] digits in eqn
Date: Wed, 01 Aug 2007 23:00:10 +0100 (BST)

Hi Folks,

I'm trying to overcome an eqn "phenomenon" -- in some ways a
"feature", in others a "bug".

What I'm referring to can be seen if you set the following
in Times, using a fairly large point size (say 15) (I'm using
ms macros here):

.nr DD 0
.EQ I
21 ~~=~~ 3 times 7
.EN
.EQ I
22 ~~=~~ 2 times 11
.EN

You wil see that the "=" signs do not line up.

It seems that eqn uses the glyph-width of the digits in computing
the layout, as opposed to the normal metrics. In TR, digits have
fixed width, so, while one would expect the "=" signs in the above
to line up, they don't -- since the "1" glyph is narrower than the
"2" glyph, and eqn therefore packs it closer to the "2".

I reckon this is an instance of "bug" behaviour, since it can spoil
the layout of a stack of equations.

It is possible to overcome this by using constructs like

.EQ I
2{roman "1"} ~~=~~ 3 times 7
.EN
.EQ I
22 ~~=~~ 2 times 11
.EN

but that is very clumsy (you have to use the "roman" attribute,
since otherise the "1" comes out italic).

I've been looking for a simpler way to turn this off. None of the
"customisation" variables listed for eqn seems to have anything
to do with this.

One can of course also handle it by writing the equations as a
matrix, like:

.EQ I
set column_sep 40
matrix {
 lcol { 21 above 22 }
 lcol { = above = }
 lcol {{3 times 7} above {2 times 11}}
}
.EN

but (a) this too is very complicated, (b) the spacing between
"2" and "1" in "21" is still too narrow (just doesn't look right).

I should add that the above is just a simple example, for illustration.
In real life, I hit this problem with long equations which have
several subscripts or superscripts, e.g.:

.nr DD 0
.EQ I
define Exp %{ type "operator" roman "E" ^ }%

{partial b sub 1} over {partial theta sub 1}
  Exp ( tau sub 1 ( y ) ) ~+~
{partial b sub 2} over {partial theta sub 1}
  Exp ( tau sub 2 ( y ) ) ~+~
{partial c} over {partial theta sub 1} ~~=~~0
.EN
.EQ I
{partial b sub 1} over {partial theta sub 2}
  Exp ( tau sub 1 ( y ) ) ~+~
{partial b sub 2} over {partial theta sub 2}
  Exp ( tau sub 2 ( y ) ) ~+~
{partial c} over {partial theta sub 2} ~~=~~0
.EN

which gets noticeably out of line as a result of this effect,
and would be impossibly cumbersome to correct using "local"
modifications like the above. So I'd just like to turn it off!

Anyone know something I don't know? Or is one stuck with it?

With thanks,
Ted.



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




reply via email to

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