@@ -51,9 +51,9 @@ If you are loading MathJax from a CDN into a web page, there is no
5151need to install anything. Simply use a ` script ` tag that loads
5252MathJax from the CDN. E.g.,
5353
54- <script id="MathJax-script" async
55- src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
56- </script>
54+ ``` html
55+ < script id = " MathJax-script " async src =" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ></ script >
56+ ```
5757
5858See the [ MathJax
5959documentation] ( https://docs.mathjax.org/en/latest/index.html#browser-components ) ,
@@ -74,21 +74,25 @@ To use MathJax components in a node application, install the `mathjax` package:
7474
7575Then require ` mathjax ` within your application:
7676
77- require('mathjax').init({ ... }).then((MathJax) => { ... });
77+ ``` js
78+ require (' mathjax' ).init ({ ... }).then ((MathJax ) => { ... });
79+ ```
7880
7981where the first ` { ... } ` is a MathJax configuration, and the second
8082` { ... } ` is the code to run after MathJax has been loaded. E.g.
8183
82- require('mathjax').init({
83- loader: {
84- require: require,
85- paths: {mathjax: 'mathjax/es5'},
86- load: ['input/tex', 'output/svg']
87- }
88- }).then((MathJax) => {
89- const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
90- console.log(MathJax.startup.adaptor.outerHTML(svg));
91- }).catch((err) => console.log(err.message));
84+ ``` js
85+ require (' mathjax' ).init ({
86+ loader: {
87+ require: require,
88+ paths: {mathjax: ' mathjax/es5' },
89+ load: [' input/tex' , ' output/svg' ]
90+ }
91+ }).then ((MathJax ) => {
92+ const svg = MathJax .tex2svg (' \\ frac{1}{x^2-1}' , {display: true });
93+ console .log (MathJax .startup .adaptor .outerHTML (svg));
94+ }).catch ((err ) => console .log (err .message ));
95+ ```
9296
9397
9498See the
@@ -120,10 +124,12 @@ demos](https://github.com/mathjax/MathJax-demos-node) for examples).
120124
121125If you want to work from the GitHub repository directly, then do the following:
122126
123- git clone https://github.com/mathjax/MathJax-src.git mathjax-src
124- cd mathjax-src
125- npm run --silent compile
126- npm run --silent make-components
127+ ``` bash
128+ git clone https://github.com/mathjax/MathJax-src.git mathjax-src
129+ cd mathjax-src
130+ npm run --silent compile
131+ npm run --silent make-components
132+ ```
127133
128134in order to compile the JavaScript files from the TypeScript source,
129135and build the component files from the JavaScript files.
0 commit comments