@@ -40,6 +40,7 @@ var displayMessages = false; // don't log Message.Set() calls
4040var displayErrors = true ; // show error messages on the console
4141var undefinedChar = false ; // unknown characters are not saved in the error array
4242var extensions = '' ; // no additional extensions used
43+ var paths = { } ; // additional paths (for third party extensions)
4344var fontURL = '' ; // location of web fonts for CHTML
4445
4546var defaults = {
@@ -156,6 +157,11 @@ function ConfigureMathJax() {
156157 AuthorInit : function ( ) {
157158 MathJax = window . MathJax ;
158159
160+ // Add custom paths to configuration
161+ for ( let key in paths ) {
162+ MathJax . Ajax . config . path [ key ] = paths [ key ] ;
163+ }
164+
159165 delete MathJax . Hub . config . styles ; // don't need any styles
160166 MathJax . Hub . Startup . MenuZoom = function ( ) { } ; // don't load menu or zoom code
161167 MathJax . Extension . MathEvents = {
@@ -324,7 +330,7 @@ function ConfigureMathJax() {
324330 this . d = this . D = ( bbox . height + bbox . y ) * scale ;
325331 }
326332 } ) ;
327-
333+
328334 //
329335 // Don't have mglyph load images
330336 //
@@ -515,7 +521,7 @@ function ConfigureMathJax() {
515521 } ) ;
516522 }
517523 } ;
518-
524+
519525 if ( extensions ) {
520526 //
521527 // Parse added extensions list and add to standard ones
@@ -958,6 +964,7 @@ exports.config = function (config) {
958964 if ( config . displayErrors != null ) { displayErrors = config . displayErrors }
959965 if ( config . undefinedCharError != null ) { undefinedChar = config . undefinedCharError }
960966 if ( config . extensions != null ) { extensions = config . extensions }
967+ if ( config . paths != null ) { paths = config . paths }
961968 if ( config . fontURL != null ) { fontURL = config . fontURL }
962969 if ( config . MathJax ) {
963970 // strip MathJax config blocks to avoid errors
0 commit comments