Skip to content

Commit 65683da

Browse files
committed
update mathjax section in readme
1 parent c262957 commit 65683da

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,23 @@ While non-minified source files may contain characters outside UTF-8, it is reco
9595
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
9696
9797
### MathJax
98-
You can load either version two or version three of MathJax files. For example:
98+
plotly.js supports using MathJax v3 or v4 to render mathematical expressions within plots.
99+
100+
MathJax is not included in the plotly.js bundle, so it must be loaded separately as a script on the webpage.
101+
102+
For MathJax v4:
99103
```html
100-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG.js"></script>
104+
<script src="https://cdn.jsdelivr.net/npm/mathjax@4.1.2/tex-svg.js"></script>
101105
```
102106

107+
For MathJax v3:
103108
```html
104109
<script src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-svg.js"></script>
105110
```
106111

107-
> When using MathJax version 3, it is also possible to use `chtml` output on the other parts of the page in addition to `svg` output for the plotly graph.
108-
Please refer to `devtools/test_dashboard/index-mathjax3chtml.html` to see an example.
112+
When MathJax is available, any string contained within `$..$` signs will be rendered using the MathJax engine. This applies to plot titles, axis labels, tick label text, and annotations.
113+
114+
plotly.js's use of the MathJax `svg` renderer should not prevent using other MathJax renderers elsewhere on the page, nor will it affect the global MathJax config. See `devtools/test_dashboard/index-mathjax3chtml.html` for an example of a webpage which uses the MathJax `chtml` renderer in the main page, and also displays Plotly charts containing MathJax equations rendered as `svg`.
109115

110116
### Need to have several WebGL graphs on a page?
111117
You may simply load the [virtual-webgl](https://github.com/greggman/virtual-webgl) script for WebGL 1 (not WebGL 2) before loading other scripts.

0 commit comments

Comments
 (0)