Since MathJax v3, Mathjax.Hub does not exist anymore. This makes impossible to load PlotlyJS if Mathjax v3 has already been loaded. I get the following error:
TypeError: MathJax.Hub is undefined
I believe the error comes from these lines plotly.js:
module.exports = function() {
if(typeof MathJax !== 'undefined') {
var globalConfig = (window.PlotlyConfig || {}).MathJaxConfig !== 'local';
if(globalConfig) {
MathJax.Hub.Config({
messageStyle: 'none',
skipStartupTypeset: true,
displayAlign: 'left',
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
}
});
MathJax.Hub.Configured();
}
}
};
A check on MathJax version should probably be made here to use MathJax.Hub or not?
Here is a short example where plotly failed to be loaded: https://codepen.io/bthierry/pen/PoqwXzm
Many thanks!
MathJax v3 and plotly.js can be loaded together as long as the following is set before loading Plotly:
window.PlotlyConfig = {MathJaxConfig: 'local'}
For reference:
https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-support-mathjax
Is there any advance on this bug? I would like to load Mathjax v3 in my project, but unfortunately it does work with plotly at the moment. Plotly is using the old Mathjax.Hub object.
Thanks!
Most helpful comment
MathJax v3 and plotly.js can be loaded together as long as the following is set before loading Plotly:
For reference:
https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-support-mathjax