|
17 | 17 |
|
18 | 18 | <section id="mocks-list"></section> |
19 | 19 |
|
20 | | - <p>MathJax $V^3$ with $chtml$ output on the page and <b>svg</b> output on the plotly graphs</p> |
| 20 | + <p>MathJax \(V^3\) with \(chtml\) output on the page and <b>svg</b> output on the plotly graphs</p> |
21 | 21 | <div id="plots"> |
22 | 22 | <div id="graph"></div> |
23 | 23 | </div> |
24 | 24 | <div id="snapshot"></div> |
25 | 25 |
|
26 | 26 | <script> |
27 | | - window.MathJax = window.MathJax || { |
28 | | - // see https://github.com/mathjax/MathJax/issues/2705#issuecomment-859742446 |
| 27 | + window.MathJax = { |
| 28 | + // It's possible for MathJax CHTML output to coexist on the same page with |
| 29 | + // a plotly chart with renders MathJax as SVG; *however*, the loader must be |
| 30 | + // configured to load the SVG output module so that it's available for plotly |
| 31 | + // (in addition to the CHTML output module, which is implicitly loaded by |
| 32 | + // tex-chtml.js below). |
29 | 33 | loader: {load: ['output/svg']}, |
30 | | - startup: { |
31 | | - ready() { |
32 | | - // Get the MathJax modules that we need. |
33 | | - const {mathjax} = MathJax._.mathjax; |
34 | | - const {SVG} = MathJax._.output.svg_ts; |
35 | | - |
36 | | - // Do the normal setup |
37 | | - MathJax.startup.defaultReady(); |
38 | | - |
39 | | - // Create an SVG output jax and a new MathDocument that uses it. |
40 | | - const svgOutput = new SVG(MathJax.config.svg); |
41 | | - const svgDocument = mathjax.document(document, { |
42 | | - ...MathJax.config.options, |
43 | | - InputJax: MathJax.startup.input, |
44 | | - OutputJax: svgOutput |
45 | | - }); |
46 | | - |
47 | | - // Define the SVG-based conversion methods |
48 | | - MathJax.tex2svg = (math, options = {}) => { |
49 | | - options.format = svgDocument.inputJax[0].name; |
50 | | - return svgDocument.convert(math, options); |
51 | | - }; |
52 | | - |
53 | | - MathJax.svgStylesheet = () => svgOutput.styleSheet(svgDocument); |
54 | | - } |
55 | | - } |
56 | 34 | }; |
57 | 35 | </script> |
58 | 36 | <script src="../../node_modules/@plotly/mathjax-v3/es5/tex-chtml.js"></script> |
59 | | - |
60 | 37 | <script charset="utf-8" id="source" src="../../build/plotly.js"></script> |
61 | 38 | <script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script> |
62 | 39 | </body> |
|
0 commit comments