001: ************* I added this:
loader: {
paths: {
mathjax: '/mathjax',
}
},
002: *************** I added this:
loader: {
paths: {
mathjax: '/mathjax',
'mathjax-newcm': '/mathjax-newcm-font'
}
},
003: *************** I removed this:
`init`
004: ***********************
/mathjax/components/cjs/loader/loader.js";
//Uncaught TypeError: Cannot read properties of undefined (reading 'preLoaded')
Reason: this "loader.js" doesn't contain preload function
This is working:
mathjax/cjs/components/loader.js
*******************************************************************
Now if I use mathjax4+img+ xyJax
I get the following error messages:
(These worked in mathJax 3+img+xyJax properly. )
001: *************
//BEGIN code
function _tex2svg(tex, callback, _errCallback) {
MathJax.tex2svgPromise(tex, {
display: false
, em: 16 // em-size in pixels
, ex: 8 // ex-size in pixels
, containerWidth: 80 * 16
}).then(function (node) {
callback(node); // ORIGINAL callback(node.firstElementChild);
//callback(node.firstElementChild);
}).catch(function (err) {
_errCallback(err.message);
});
}
//END code
This generates the following error message:
wb-ver-1768133149000.js:15468 Uncaught (in promise) TypeError: _errCallback is not a function
002: *************
/mathjax/input/tex/extensions/bbox.js net::ERR_ABORTED 404 (Not Found)
003: *************
/mathjax/input/tex/extensions/bbox.js net::ERR_ABORTED 404 (Not Found)
004: *************
/mathjax/input/tex/extensions/boldsymbol.js net::ERR_ABORTED 404 (Not Found)
005: **************
wb-ver-1768133149000.js:91444 Can't load '[mathjax-newcm]/svg/dynamic/sans-serif.js':
No mathjax.asyncLoad method specified
****************************
****************************
****************************
>If I understand properly, this will be run int he browser, right? (Not in node on a server.)
Yes, in the browser.
The Javascript code of the framework including Mathjax4, img extension and xyJax
will be bundled with browserify. The codes above are from your CJS version.
I use the SVG output of Mathjax 4 but not directly because it will be converted by fabric.js
to SVG again which will be displayed by the browser.
Further testing is in progress.
My plan is to focus on Mathjax 4 (and not on Mathjax 3).
Joe