A javascript tool to convert mathml syntax to asciimath
npm install mathml2asciimath
It converts MathML to ASCIIMath.
Please notice that ASCIIMath represents only a subset of MathML context, therefore some information may be lost in the process. In general, if it can be represented in ASCIIMath, it will be well converted.
If you use NPM
`````
npm install mathml2asciimath --save
If you use Yarn
````
yarn add mathml2asciimath
``javascript
const Mathml2asciimath = require('mathml2asciimath');
const mathml =
;
new Mathml2asciimath(mathml).convert();
// => a + b
```
``javascript
const Mathml2asciimath = require('mathml2asciimath');
const mathml =
;
new Mathml2asciimath(mathml).convert();
// => A = [(x, y), (z, w)]
```
Please read `index.test.js`` file for more use cases.