File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 395
395
// Filter the styles for \bbox
396
396
//
397
397
TEX . Parse . Augment ( {
398
- BBoxStyle : function ( styles ) { return SAFE . filterStyles ( styles ) }
398
+ BBoxStyle : function ( styles ) { return SAFE . filterStyles ( styles ) } ,
399
+ BBoxPadding : function ( pad ) {
400
+ var styles = SAFE . filterStyles ( "padding: " + pad ) ;
401
+ return ( styles ? pad : 0 ) ;
402
+ }
399
403
} ) ;
400
404
401
405
} ) ;
Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
67
67
if ( match ) {
68
68
if ( def )
69
69
{ TEX . Error ( [ "MultipleBBoxProperty" , "%1 specified twice in %2" , "Padding" , name ] ) }
70
- var pad = match [ 1 ] + match [ 3 ] ;
71
- def = { height :"+" + pad , depth :"+" + pad , lspace :pad , width :"+" + ( 2 * match [ 1 ] ) + match [ 3 ] } ;
70
+ var pad = this . BBoxPadding ( match [ 1 ] + match [ 3 ] ) ;
71
+ if ( pad ) def = { height :"+" + pad , depth :"+" + pad , lspace :pad , width :"+" + ( 2 * match [ 1 ] ) + match [ 3 ] } ;
72
72
} else if ( part . match ( / ^ ( [ a - z 0 - 9 ] + | \# [ 0 - 9 a - f ] { 6 } | \# [ 0 - 9 a - f ] { 3 } ) $ / i) ) {
73
73
if ( background )
74
74
{ TEX . Error ( [ "MultipleBBoxProperty" , "%1 specified twice in %2" , "Background" , name ] ) }
@@ -91,7 +91,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
91
91
}
92
92
this . Push ( math ) ;
93
93
} ,
94
- BBoxStyle : function ( styles ) { return styles }
94
+ BBoxStyle : function ( styles ) { return styles } ,
95
+ BBoxPadding : function ( pad ) { return pad }
95
96
} ) ;
96
97
97
98
MathJax . Hub . Startup . signal . Post ( "TeX bbox Ready" ) ;
You can’t perform that action at this time.
0 commit comments