Skip to content

Mathjax.Hub.config used for plotly 5.7.0 #3696

Closed
@AakashGfude

Description

@AakashGfude

Could not find a duplicate of this issue anywhere so, not sure if anyone else had an issue like this, but when using plotly in a sphinx project and creating HTML pages, I get the following js code included in my HTML page:

<div class="output text_html">        <script type="text/javascript">
        window.PlotlyConfig = {MathJaxConfig: 'local'};
        if (window.MathJax) {MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}
        if (typeof require !== 'undefined') {
        require.undef("plotly");
        define('plotly', function(require, exports, module) {
            /**
* plotly.js v2.11.1
.....

When I have a math block in the same page as a plotly graph, then window.MathJax is defined and MathJax.Hub.Config gets called. Which throws an error as I am using mathjax v3, which is supported by v5.7.0.

The line MathJax.Hub.Config({SVG: {font: "STIX-Web"}}) I see written in a bunch of files like:
https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/io/_base_renderers.py#L240

Is it a legit issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions