algebra-latex
An npm module, with no dependencies, for parsing LaTeX math to a regular math string (ascii math),
that can be parsed to other algebra or math libraries like algebrite and algebra.js
Example
const AlgebraLatex = require('algebra-latex')
const latexInput = '\\frac{1}{\\sqrt{2}}\\cdot x=10'
const algebraObj = new AlgebraLatex().parseLatex(latexInput)
const mathInput = '1/sqrt(2)*x=10'
const algebraObj = new AlgebraLatex().parseMath(mathInput)
console.log(algebraObj.toMath())
console.log(algebraObj.toLatex())
Parse to other libraries
Supported libraries
NOTE: The above libraries are optional, and have to be installed before use
continuing from example above
...
var algebraJS = require('algebra.js')
var algebrite = require('algebrite')
var coffeequate = require('coffeequate')
algebraObj.toAlgebra(algebraJS)
algebraObject.toAlgebrite(algebrite)
algebraObject.toCoffeequate(coffeequate)