[comp.text] Eqn ms macros bug fix

aeb@cwi.nl (Andries Brouwer) (09/04/87)

I had problems with big eqn equations: eqn (-ms, BSD4.3) fails
to check whether there is room on the page, and large matrices
often fall off the page. 
A simpleminded solution seems to be enclosing the formula in .KS/.KE
macros, but that reveals another bug in the .EQ/.EN macros: the half
line white space before the equation is lost as a result.
[This is caused by the fact that the undefined number register PE
and the number register .d compare equal (both are 0) at the start
of a diversion.]
The right solution is to add a  .ne  line to the .EN macro.
In my version of tmac.s this macro now starts off as follows:

 .de EN  \" end of a displayed equation
 .br
 .di
 .rm EZ
 .nr ZN \\n(dn
 .if \\n(ZN>0 .if \\n(YE=0 .LP
 .ne \\n(ZNu
 .if \\n(ZN=0 .if !"\\*(EL"" .nr ZN 1
 .if t .if \\n(ZN>0 .if \\n(PE>0 .if !\\n(.d=\\n(PE .sp .5
 .if n .if \\n(ZN>0 .if \\n(PE>0 .if !\\n(.d=\\n(PE .sp 1
 'pc

The described bugs do not occur with -me.
-- 
      Andries Brouwer -- CWI, Amsterdam -- seismo!mcvax!aeb -- aeb@cwi.nl