Skip to content

Commit 391f34c

Browse files
committed
document to use MathJax
1 parent 72bfe90 commit 391f34c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,30 @@ Official plotly.js documentation is hosted at [https://plotly.com/javascript](ht
139139
These pages are generated by the Plotly [graphing-library-docs repo](https://github.com/plotly/graphing-library-docs) built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages.
140140
For more info about contributing to Plotly documentation, please read through [contributing guidelines](https://github.com/plotly/graphing-library-docs/blob/master/README.md).
141141

142+
### To support MathJax
143+
144+
*Before* the plotly.js script tag, add:
145+
146+
```html
147+
<script src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
148+
```
149+
150+
You can get the relevant MathJax files from the internet e.g.
151+
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"
152+
153+
By default, plotly.js will modify the global MathJax configuration on load.
154+
This can lead to undesirable behavior if plotly.js is loaded alongside
155+
other libraries that also rely on MathJax. To disable this global configuration
156+
process, set the `MathJaxConfig` property to `'local'` in the `window.PlotlyConfig`
157+
object. This property must be set before the plotly.js script tag, for example:
158+
159+
```html
160+
<script>
161+
window.PlotlyConfig = {MathJaxConfig: 'local'}
162+
</script>
163+
<script src="plotly.min.js"></script>
164+
```
165+
142166
---
143167
## Contributing
144168

0 commit comments

Comments
 (0)