Skip to content

AlloteSoftware/mathml2omml_as

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

math2omml

Pure Python library to convert MathML to OMML (Office Math Markup Language). Fixed several bugs from the original version.

Installation

Use pip:

pip install git+https://github.com/AlloteSoftware/mathml2omml_as.git

or, use setup.py:

python3 setup.py install

Usage

Mathml2omml takes a MathML as string, and outputs an OMML as string:

import mathml2omml

mathml = '<math><mi>x</mi><mo>+</mo><mi>y</mi></math>'
omml = math2omml.convert(mathml)

By default, mathml2omml recognises only entities defined in MathML specification. If the input includes other entities, pass the entity information as a dictionary to the second argument:

import html.entities

mathml = '<math><msubsup><mo>&int;</mo><mn>1</mn><mi>x</mi></msubsup></math>'
omml = math2omml.convert(mathml, html.entities.name2codepoint)

About

Python library to convert MathML to OMML (Office Math Markup Language)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.9%
  • Makefile 0.1%