@@ -51,9 +51,9 @@ If you are loading MathJax from a CDN into a web page, there is no
51
51
need to install anything. Simply use a ` script ` tag that loads
52
52
MathJax from the CDN. E.g.,
53
53
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
+ ```
57
57
58
58
See the [ MathJax
59
59
documentation] ( 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:
74
74
75
75
Then require ` mathjax ` within your application:
76
76
77
- require('mathjax').init({ ... }).then((MathJax) => { ... });
77
+ ``` js
78
+ require (' mathjax' ).init ({ ... }).then ((MathJax ) => { ... });
79
+ ```
78
80
79
81
where the first ` { ... } ` is a MathJax configuration, and the second
80
82
` { ... } ` is the code to run after MathJax has been loaded. E.g.
81
83
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
+ ```
92
96
93
97
94
98
See the
@@ -120,10 +124,12 @@ demos](https://github.com/mathjax/MathJax-demos-node) for examples).
120
124
121
125
If you want to work from the GitHub repository directly, then do the following:
122
126
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
+ ```
127
133
128
134
in order to compile the JavaScript files from the TypeScript source,
129
135
and build the component files from the JavaScript files.
0 commit comments