A JavaScript converter of mathematical formulas
Demo is available here
<script type="module">
import Plurimath from "https://www.plurimath.org/plurimath-js/dist/index.js";
const formula = new Plurimath('ubrace(1+2+3+4)_("4 terms")', "asciimath");
console.log(formula.toLatex());
</script>
$ npm install -S @plurimath/plurimath
ES Modules (recommended):
import Plurimath from "@plurimath/plurimath"
const formula = new Plurimath('ubrace(1+2+3+4)_("4 terms")', "asciimath");
console.log(formula.toLatex());
CommonJS:
const Plurimath = require("@plurimath/plurimath/index.cjs").default;
const formula = new Plurimath('ubrace(1+2+3+4)_("4 terms")', "asciimath");
console.log(formula.toLatex());
Please make sure you have podman installed and do npm run submodule:init
and then npm run build
.
It is recommended to use Docker/Podman to get a compatible environment. As of now, it is needed to use Ragel 6 to build necessary parsers.
$ podman build -t plurimath-js .
$ podman run --rm -it -v.:/srv:z plurimath-js
Inside Podman shell:
# ./setup.sh
# ./build.sh
npm run test:js # To run the JS smoke test
npm run test:rb # To run the entire Ruby testsuite
The individual submodules can be tested using scripts in env
directory.
Those scripts ensure that all the dependencies are satisfied using the
individual submodules and not the released versions. By default, if you
don't provide parameters denoting the command line utility you want to run,
they will issue opal-rspec
.
npm run build
npm publish