JSPM

convert-mathml-to-latex

1.1.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q60261F
  • License MIT

Convert mathml to latex.

Package Exports

  • convert-mathml-to-latex
  • convert-mathml-to-latex/lib/mathml2latex.browser.cjs.js
  • convert-mathml-to-latex/lib/mathml2latex.browser.es.js
  • convert-mathml-to-latex/lib/mathml2latex.cjs.js
  • convert-mathml-to-latex/lib/mathml2latex.es.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (convert-mathml-to-latex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mathml-to-latex

基于JavaScript将MathML转为Latex语言,由mathml2latex基础上修改,修复了部分问题。

Build

Clone this repo and run npm run build, It'll generate belowing files:

lib
├── mathml2latex.browser.cjs.js
├── mathml2latex.browser.es.js
├── mathml2latex.browser.umd.js
├── mathml2latex.cjs.js
├── mathml2latex.es.js
└── mathml2latex.umd.js
dist
└── mathml2latex.js

usage

load library

In browser environment, you need to build the library first, then load it:

<script src="dist/mathml2latex.js"></script>

Using with npm

npm install mathml2latex
const MathMl2LaTeX = require('mathml2latex')

convert mathml html

const mathmlHtml = '<math display="block"><mfrac><mi>a</mi><mi>b</mi></mfrac></math>';
const latex = MathML2LaTeX.convert(mathmlHtml); // => \frac{a}{b}