A JavaScript tool to convert mathml string to LaTeX equation string.
Go to file
Alexandre Nunes 68db2f132f feat: new application version 2021-01-07 11:32:54 -03:00
.vscode config files setup 2020-09-12 17:11:18 -03:00
__tests__ test: bar divider translated to single bar 2021-01-07 11:22:25 -03:00
src fix: bar divider translated to single bar 2021-01-07 11:22:06 -03:00
.eslintignore chore: add no src folders to .eslintignore file 2020-10-03 13:32:11 -03:00
.eslintrc.js chore: add and fix prettier 2020-09-27 02:23:15 -03:00
.gitignore chore: add dist folder to .gitignore file 2020-10-03 13:32:37 -03:00
.huskyrc.json chore: add husky as dev dependency 2020-09-26 16:48:40 -03:00
.lintstagedrc.json chore: add tests to lint-staged 2020-09-26 16:53:48 -03:00
.npmignore fix: add .prettierrc.js and .eslintignore to npmignore file 2020-10-03 14:57:32 -03:00
.prettierrc.js chore: add and fix prettier 2020-09-27 02:23:15 -03:00
.tool-versions fix: add src export default 2021-01-07 11:14:46 -03:00
LICENSE.md Create LICENSE.md 2020-09-26 16:37:11 -03:00
README.md feat: update readme file with basic description and usage 2020-10-03 15:05:07 -03:00
jest.config.js chore: remove alias path and fix export default 2020-10-03 14:42:56 -03:00
package-lock.json feat: update dependencies 2021-01-07 11:29:16 -03:00
package.json feat: new application version 2021-01-07 11:32:54 -03:00
tsconfig.json chore: remove alias path and fix export default 2020-10-03 14:42:56 -03:00

README.md

mathml-to-latex

It converts MathML to LaTeX.

Instalation

If you use NPM

npm install mathml-to-latex --save

If you use Yarn

yarn add mathml-to-latex

Usage

const Mathml2latex = require('mathml-to-latex');

const mathml = `
      <math>
        <mrow>
          <mn>a</mn>
          <mo>+</mo>
          <mn>b</mn>
        </mrow>
      </math>
      `;

Mathml2latex.convert(mathml);
// => a + b
const Mathml2latex = require('mathml-to-latex');

const mathml = `
    <math>
        <mrow>
            <mi>A</mi>
            <mo>=</mo>
            <mfenced open = "[" close="]">
            <mtable>
                <mtr>
                <mtd><mi>x</mi></mtd>
                <mtd><mi>y</mi></mtd>
                </mtr>
                <mtr>
                <mtd><mi>z</mi></mtd>
                <mtd><mi>w</mi></mtd>
                </mtr>
            </mtable>
            </mfenced>
        </mrow>
    </math>
    `;

Mathml2latex.convert(mathml);
// => A = \begin{bmatrix} x & y \\ z & w \end{bmatrix}