File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ Create a file named :file:`test-mathjax.mjs` containing the following:
29
29
30
30
.. code-block :: javascript
31
31
32
- import { init } from " @mathjax/src" ;
33
- await init ({loader: {load: [' input/tex' ]}});
32
+ import MathJax from " @mathjax/src" ;
33
+ await MathJax . init ({loader: {load: [' input/tex' ]}});
34
34
const mml = (await MathJax .tex2mmlPromise (' x+y' ));
35
35
console .log (mml);
36
36
@@ -59,7 +59,8 @@ This is you first MathJax node program!
59
59
60
60
.. code-block :: javascript
61
61
62
- require (" @mathjax/src" ).init ({
62
+ const MathJax = require (" @mathjax/src" );
63
+ MathJax .init ({
63
64
loader: {load: [' input/tex' ]}
64
65
}).then (() => MathJax .tex2mmlPromise (' x+y' ))
65
66
.then ((mml ) => console .log (mml));
@@ -112,15 +113,13 @@ To do so, use either
112
113
113
114
.. code-block :: javascript
114
115
115
- import { init } from ' @mathjax/src/source' ;
116
+ import MathJax from ' @mathjax/src/source' ;
116
117
117
118
or
118
119
119
120
.. code-block :: javascript
120
121
121
- require (' @mathjax/src/source' ).init ({... }).then ((MathJax ) => {
122
- ... // code that uses MathJax here
123
- });
122
+ const MathJax = require (' @mathjax/src/source' );
124
123
125
124
when loading MathJax.
126
125
Original file line number Diff line number Diff line change @@ -165,15 +165,15 @@ In order to get the source versions in ``@mathjax/src``, use
165
165
166
166
.. code-block :: js
167
167
168
- require (' @mathjax/src/source' ). init ( ... )
168
+ const MathJax = require (' @mathjax/src/source' );
169
169
170
170
or
171
171
172
172
.. code-block :: js
173
173
174
- import { init } from ' @mathjax/src/source'
174
+ import MathJax from ' @mathjax/src/source' ;
175
175
176
- and then call ``init(...) ``. These load
176
+ and then call ``MathJax. init(...) ``. These load
177
177
``components/mjs/node-main/node-main.mjs `` or
178
178
``components/cjs/node-main/node-main.cjs ``, respectively.
179
179
You can’t perform that action at this time.
0 commit comments