Skip to content

Commit

Permalink
(readme): enabled syntax highlighting for js
Browse files Browse the repository at this point in the history
  • Loading branch information
0xflotus authored May 3, 2020
1 parent c029529 commit acadda2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,21 @@ To use MathJax components in a node application, install the `mathjax` package:

Then require `mathjax` within your application:

require('mathjax').init({ ... }).then((MathJax) => { ... });
```js
require('mathjax').init({ ... }).then((MathJax) => { ... });
```

where the first `{ ... }` is a MathJax configuration, and the second
`{ ... }` is the code to run after MathJax has been loaded. E.g.

require('mathjax').init({
loader: {load: ['input/tex', 'output/svg']}
}).then((MathJax) => {
const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err.message));
```js
require('mathjax').init({
loader: {load: ['input/tex', 'output/svg']}
}).then((MathJax) => {
const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err.message));
```


See the
Expand Down

0 comments on commit acadda2

Please sign in to comment.