✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Plotly library interferes with MathJax

I noticed, when included the plotly library in my HTML header, MathJax stopped working. All my LaTeX formulas appeared in raw source form instead of formatted math formulas.

I managed to fix it by including Plotly first.

That is, it works in this order:

<!-- Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-latest.min.js'/>
<!-- load MathJax -->
<script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js' type='text/javascript'/>

…but if Plotly is loaded after MathJax, MathJax stops working.

I have no idea why, but I’m glad I found a workaround. I hope this helps others.