@@ -37,11 +37,14 @@ localhost/MathJax-dev/v3-lab.html
37
37
```
38
38
39
39
40
- ## Running samples
40
+ ## Running Samples
41
41
42
42
Samples are small scripts to test various MathJax features or to use MathJax
43
43
directly for a specific purpose. They are particularly useful to work with local
44
- MathJax variants or test changes to the code base directly.
44
+ MathJax variants or test changes to the code base directly. Samples can be run
45
+ using ` node ` or in a browser.
46
+
47
+ ### Running Samples in Node
45
48
46
49
Samples are run using ` node ` and loaded using the ` load.js ` script. The general command is:
47
50
@@ -64,52 +67,89 @@ node load.js samples/tex2mml.js x^2
64
67
</math >
65
68
```
66
69
67
- Not all sample scripts are currently working. Here is a list of working and currently unusable samples:
70
+ ### Running Samples in Node
71
+
72
+ Samples can be run in the browser using the ` load.html ` page. This either loads
73
+ the ` main.js ` file or the particular sample file given in the parameters. For example, running
74
+
75
+ [ http://localhost/v3-dev/load.html?samples/asciimath-document.js ] ( http://localhost/v3-dev/load.html?samples/asciimath-document.js )
76
+
77
+ will give you a rendered page of AsciiMath expressions in the browser. Note,
78
+ that the output will also be displayed on the console. In fact, many scripts
79
+ will only produce console output. For example, the URL:
80
+
81
+ [ http://localhost/v3-dev/load.html?samples/tex2mml.js&x^2 ] ( http://localhost/v3-dev/load.html?samples/tex2mml.js&x^2 )
82
+
83
+ will print the corresponding MathML expression in the console:
84
+
85
+ ``` html
86
+ <math display =" block" >
87
+ <msup >
88
+ <mi >x</mi >
89
+ <mn >2</mn >
90
+ </msup >
91
+ </math >
92
+ ```
93
+
94
+
95
+ ### Scripts
96
+
97
+ Not all sample scripts are currently working. Here are two lists of the samples
98
+ that are currently working or broken. Sample names should be self-explanatory.
99
+
68
100
69
101
#### Working scripts
70
102
103
+
71
104
``` shell
72
105
samples/asciimath2mml.js
106
+ samples/asciimath-document.js
73
107
samples/asciimath-json.js
74
- samples/notagids.js
108
+ samples/asyncLoad.js
109
+ samples/bits.js
110
+ samples/css.js
111
+ samples/find-asciimath.js
112
+ samples/find-mml.js
113
+ samples/find-strings.js
114
+ samples/find-tex-dollars.js
115
+ samples/find-tex.js
75
116
samples/mml2html.js
76
117
samples/mml2svg.js
77
118
samples/mml-bbox.js
78
119
samples/mml-nodes.js
120
+ samples/notagids.js
79
121
samples/tag-format.js
122
+ samples/test-adaptor.js
123
+ samples/test-styles.js
80
124
samples/tex2html.js
81
125
samples/tex2mml.js
82
126
samples/tex2svg.js
127
+ samples/tex-document.js
83
128
samples/tex-json.js
129
+ samples/tex-multi-document.js
84
130
samples/tex-nodes.js
85
131
samples/tex-string.js
86
132
```
133
+ #### Obsolete Packages
134
+
135
+ ``` shell
136
+ samples/convert-tex2mml.js same as tex2mml.js
137
+ samples/tex-typeset.js same as tex2html.js
138
+
139
+ ```
140
+
87
141
88
142
#### Broken scripts
89
143
90
144
``` shell
91
145
samples/asciimath2mml-component.js
92
- samples/asciimath-document.js
93
- samples/asyncLoad.js
94
- samples/bits.js
95
- samples/convert-tex2mml.js
96
- samples/css.js
97
- samples/find-asciimath.js
98
- samples/find-mml.js
99
- samples/find-strings.js
100
- samples/find-tex-dollars.js
101
- samples/find-tex.js
102
146
samples/html-full.js
103
147
samples/mfenced.js
104
- samples/test-adaptor.js
105
- samples/test-styles.js
106
148
samples/tex2mml-component.js
107
149
samples/tex2mml-require.js
108
150
samples/tex2mml-speech.js
109
151
samples/tex2svg-speech.js
110
- samples/tex-document.js
111
- samples/tex-multi-document.js
112
- samples/tex-typeset.js
152
+
113
153
```
114
154
115
155
0 commit comments