@@ -40,6 +40,7 @@ var displayMessages = false; // don't log Message.Set() calls
40
40
var displayErrors = true ; // show error messages on the console
41
41
var undefinedChar = false ; // unknown characters are not saved in the error array
42
42
var extensions = '' ; // no additional extensions used
43
+ var paths = { } ; // additional paths (for third party extensions)
43
44
var fontURL = '' ; // location of web fonts for CHTML
44
45
45
46
var defaults = {
@@ -156,6 +157,11 @@ function ConfigureMathJax() {
156
157
AuthorInit : function ( ) {
157
158
MathJax = window . MathJax ;
158
159
160
+ // Add custom paths to configuration
161
+ for ( let key in paths ) {
162
+ MathJax . Ajax . config . path [ key ] = paths [ key ] ;
163
+ }
164
+
159
165
delete MathJax . Hub . config . styles ; // don't need any styles
160
166
MathJax . Hub . Startup . MenuZoom = function ( ) { } ; // don't load menu or zoom code
161
167
MathJax . Extension . MathEvents = {
@@ -324,7 +330,7 @@ function ConfigureMathJax() {
324
330
this . d = this . D = ( bbox . height + bbox . y ) * scale ;
325
331
}
326
332
} ) ;
327
-
333
+
328
334
//
329
335
// Don't have mglyph load images
330
336
//
@@ -480,14 +486,16 @@ function ConfigureMathJax() {
480
486
//
481
487
// Set up None output jax (for when only MathML output is needed)
482
488
//
483
- MathJax . OutputJax . None = MathJax . OutputJax ( {
484
- id : "None" ,
485
- preTranslate : function ( ) { } ,
486
- Translate : function ( ) { } ,
487
- postTranslate : function ( ) { }
489
+ MathJax . Hub . Register . StartupHook ( "End Jax" , function ( ) {
490
+ MathJax . OutputJax . None = MathJax . OutputJax ( {
491
+ id : "None" ,
492
+ preTranslate : function ( ) { } ,
493
+ Translate : function ( ) { } ,
494
+ postTranslate : function ( ) { }
495
+ } ) ;
496
+ MathJax . OutputJax . None . loadComplete ( "jax.js" ) ;
497
+ MathJax . OutputJax . None . Register ( "jax/mml" ) ;
488
498
} ) ;
489
- MathJax . OutputJax . None . loadComplete ( "jax.js" ) ;
490
- MathJax . OutputJax . None . Register ( "jax/mml" ) ;
491
499
492
500
//
493
501
// Reset the color extension after `autoload-all`
@@ -515,7 +523,7 @@ function ConfigureMathJax() {
515
523
} ) ;
516
524
}
517
525
} ;
518
-
526
+
519
527
if ( extensions ) {
520
528
//
521
529
// Parse added extensions list and add to standard ones
@@ -958,6 +966,7 @@ exports.config = function (config) {
958
966
if ( config . displayErrors != null ) { displayErrors = config . displayErrors }
959
967
if ( config . undefinedCharError != null ) { undefinedChar = config . undefinedCharError }
960
968
if ( config . extensions != null ) { extensions = config . extensions }
969
+ if ( config . paths != null ) { paths = config . paths }
961
970
if ( config . fontURL != null ) { fontURL = config . fontURL }
962
971
if ( config . MathJax ) {
963
972
// strip MathJax config blocks to avoid errors
0 commit comments