File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -122,17 +122,21 @@ To use MathJax components in a node application, install the `mathjax` package:
122122
123123Then require ` mathjax ` within your application:
124124
125- require('mathjax').init({ ... }).then((MathJax) => { ... });
125+ ``` js
126+ require (' mathjax' ).init ({ ... }).then ((MathJax ) => { ... });
127+ ```
126128
127129where the first ` { ... } ` is a MathJax configuration, and the second
128130` { ... } ` is the code to run after MathJax has been loaded. E.g.
129131
130- require('mathjax').init({
131- loader: {load: ['input/tex', 'output/svg']}
132- }).then((MathJax) => {
133- const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
134- console.log(MathJax.startup.adaptor.outerHTML(svg));
135- }).catch((err) => console.log(err.message));
132+ ``` js
133+ require (' mathjax' ).init ({
134+ loader: {load: [' input/tex' , ' output/svg' ]}
135+ }).then ((MathJax ) => {
136+ const svg = MathJax .tex2svg (' \\ frac{1}{x^2-1}' , {display: true });
137+ console .log (MathJax .startup .adaptor .outerHTML (svg));
138+ }).catch ((err ) => console .log (err .message ));
139+ ```
136140
137141
138142See the
You can’t perform that action at this time.
0 commit comments