@@ -338,6 +338,7 @@ MathJax.ElementJax.mml.Augment({
338
338
adjustChild_scriptlevel : function ( i , nodef ) { return this . Get ( "scriptlevel" , nodef ) } , // always inherit from parent
339
339
adjustChild_displaystyle : function ( i , nodef ) { return this . Get ( "displaystyle" , nodef ) } , // always inherit from parent
340
340
adjustChild_texprimestyle : function ( i , nodef ) { return this . Get ( "texprimestyle" , nodef ) } , // always inherit from parent
341
+ hasMMLspacing : function ( ) { return false } ,
341
342
childPosition : function ( ) {
342
343
var child = this , parent = child . parent ;
343
344
while ( parent . notParent ) { child = parent ; parent = child . parent }
@@ -559,12 +560,16 @@ MathJax.ElementJax.mml.Augment({
559
560
indentshiftlast : MML . INDENTSHIFT . INDENTSHIFT ,
560
561
texClass : MML . TEXCLASS . REL // for MML, but TeX sets ORD explicitly
561
562
} ,
562
- SPACE_ATTR : { lspace : 0x01 , rspace : 0x02 , form : 0x04 } ,
563
+ SPACE_ATTR : { lspace : 0x01 , rspace : 0x02 } ,
563
564
useMMLspacing : 0x03 ,
565
+ hasMMLspacing : function ( ) {
566
+ if ( this . useMMLspacing ) return true ;
567
+ return this . form && ( this . OPTABLE [ this . form ] || { } ) [ this . data . join ( '' ) ] ;
568
+ } ,
564
569
autoDefault : function ( name , nodefault ) {
565
570
var def = this . def ;
566
571
if ( ! def ) {
567
- if ( name === "form" ) { this . useMMLspacing &= ~ this . SPACE_ATTR . form ; return this . getForm ( ) }
572
+ if ( name === "form" ) { return this . getForm ( ) }
568
573
var mo = this . data . join ( "" ) ;
569
574
var forms = [ this . Get ( "form" ) , MML . FORM . INFIX , MML . FORM . POSTFIX , MML . FORM . PREFIX ] ;
570
575
for ( var i = 0 , m = forms . length ; i < m ; i ++ ) {
@@ -657,7 +662,7 @@ MathJax.ElementJax.mml.Augment({
657
662
} ,
658
663
setTeXclass : function ( prev ) {
659
664
var values = this . getValues ( "form" , "lspace" , "rspace" , "fence" ) ; // sets useMMLspacing
660
- if ( this . useMMLspacing ) { this . texClass = MML . TEXCLASS . NONE ; return this }
665
+ if ( this . hasMMLspacing ( ) ) { this . texClass = MML . TEXCLASS . NONE ; return this }
661
666
if ( values . fence && ! this . texClass ) {
662
667
if ( values . form === MML . FORM . PREFIX ) { this . texClass = MML . TEXCLASS . OPEN }
663
668
if ( values . form === MML . FORM . POSTFIX ) { this . texClass = MML . TEXCLASS . CLOSE }
@@ -996,10 +1001,6 @@ MathJax.ElementJax.mml.Augment({
996
1001
this . SetData ( "open" , MML . mo ( values . open ) . With ( {
997
1002
fence :true , form :MML . FORM . PREFIX , texClass :MML . TEXCLASS . OPEN
998
1003
} ) ) ;
999
- //
1000
- // Clear flag for using MML spacing even though form is specified
1001
- //
1002
- this . data . open . useMMLspacing = 0 ;
1003
1004
}
1004
1005
//
1005
1006
// Create fake nodes for the separators
@@ -1008,10 +1009,8 @@ MathJax.ElementJax.mml.Augment({
1008
1009
while ( values . separators . length < this . data . length )
1009
1010
{ values . separators += values . separators . charAt ( values . separators . length - 1 ) }
1010
1011
for ( var i = 1 , m = this . data . length ; i < m ; i ++ ) {
1011
- if ( this . data [ i ] ) {
1012
- this . SetData ( "sep" + i , MML . mo ( values . separators . charAt ( i - 1 ) ) . With ( { separator :true } ) )
1013
- this . data [ "sep" + i ] . useMMLspacing = 0 ;
1014
- }
1012
+ if ( this . data [ i ] )
1013
+ { this . SetData ( "sep" + i , MML . mo ( values . separators . charAt ( i - 1 ) ) . With ( { separator :true } ) ) }
1015
1014
}
1016
1015
}
1017
1016
//
@@ -1021,10 +1020,6 @@ MathJax.ElementJax.mml.Augment({
1021
1020
this . SetData ( "close" , MML . mo ( values . close ) . With ( {
1022
1021
fence :true , form :MML . FORM . POSTFIX , texClass :MML . TEXCLASS . CLOSE
1023
1022
} ) ) ;
1024
- //
1025
- // Clear flag for using MML spacing even though form is specified
1026
- //
1027
- this . data . close . useMMLspacing = 0 ;
1028
1023
}
1029
1024
} ,
1030
1025
texClass : MML . TEXCLASS . OPEN ,
@@ -1492,7 +1487,7 @@ MathJax.ElementJax.mml.Augment({
1492
1487
INTEGRAL2 : [ 1 , 2 , TEXCLASS . OP , { largeop : true , symmetric : true } ] ,
1493
1488
BIN3 : [ 3 , 3 , TEXCLASS . BIN ] ,
1494
1489
BIN4 : [ 4 , 4 , TEXCLASS . BIN ] ,
1495
- BIN01 : [ 0 , 1 , TEXCLASS . ORD ] ,
1490
+ BIN01 : [ 0 , 1 , TEXCLASS . BIN ] ,
1496
1491
BIN5 : [ 5 , 5 , TEXCLASS . BIN ] ,
1497
1492
TALLBIN : [ 4 , 4 , TEXCLASS . BIN , { stretchy : true } ] ,
1498
1493
BINOP : [ 4 , 4 , TEXCLASS . BIN , { largeop : true , movablelimits : true } ] ,
0 commit comments