Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Convert MathML to AsciiMath This gem is in active development.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.14
~> 12.0
~> 3.6
~> 0.15
~> 0.9
~> 1.5.2
>= 0

Runtime

 Project Readme

RETIRED — superseded by Plurimath

This repository was archived on 2026-11-02 and is no longer maintained. Its functionality — converting MathML to AsciiMath — is fully subsumed by Plurimath, which reads MathML natively and writes every math format, including AsciiMath.

Gem usage:

require "plurimath"

formula = Plurimath::Math.parse("<math><mfrac><mi>a</mi><mi>b</mi></mfrac></math>", :mathml)
formula.to_asciimath  # => "frac(a)(b)"

CLI usage:

plurimath convert --input-format mathml --output-format asciimath \
  --input "<math><mfrac><mi>a</mi><mi>b</mi></mfrac></math>"

Documentation: the formal specifications for every supported format live at https://plurimath.github.io/docs/ . ## DEPRECATION NOTICE: This repository is no longer maintained. Please visit Plurimath for the latest updates and features.

mathml2asciimath

Gem Version Ubuntu Build Status OSX Build Status Windows Build Status Code Climate Pull Requests Commits since latest

Ruby gem to convert MathML into AsciiMath

Ignores style and MathML attributes (other than mfenced/@open, mfenced/@close, mo/@fence).

Processes the following MathML tags: mrow, mfenced, msqrt, mfrac, msup, msub, munderover, msubsup, munder, mover, mi, mn, ntext, mo, mtable, mtr, mtd.

Converts all the Unicode characters MathJax knows about into AsciiMath operators (e.g. \\beta, xx, oint)

As with the other two MathML to AsciiMath converters available online (Python: https://github.com/rochecompaan/upfront.mathml2asciimath, Node.js: https://github.com/learningobjectsinc/mathml-to-asciimath), this converter is not foolproof, production-ready, or complete, and you will need to post-edit output. It’s still a lot better than nothing. (And because it converts Unicode to Ascii, it’s a lot better than the other two.)