# Text-based math standards

**Note:** this effort is currently on due to lack of community interest. If you are interested in helping, let us know on GitHub, the mailing list or directly to the CG Chairs.

## Context

There is a split in the world of maths. On the one side you have math applications which do calculations. These applications typically use a text based standard which is easy for humans to type and easy for machines to parse and evaluate. On the other side you have applications which are about rendering maths for representation on the web or in printed form. This requires a much more rich and flexible standard to allow for all sorts of specific layouts of formulas, think of LaTeX or MathML.

It would be awesome if we had a single standard that could bridge these two sides: mathematical representation and calculation. This could give interoperability a boost since it would make it easy to have all sorts of cross-referencing between applications doing either calculation or representation of maths. It could make printed maths interactive, and add visual representations to math applications.

Requirements for such a standard would include:

- Easily readable and editable by humans (a text based standard)
- Easy to parse by machines (e.g. a concise and text based standard)
- Supports elements to do layout for rendering of maths

Let’s shortly see how some standards do against these criteria:

- LaTeX works great: it’s easy to write for humans and easy to parse by machines, and it is very flexible. However, the language is so large and comprehensive that it’s hard to implement support for it in other applications. Defining a subset of it as a new standard could be interesting.
- MathML is an XML based format which is great for presenting maths. It’s very flexible but also very verbose. The standard is too large to easily implement support for it in applications, and the standard isn’t very human friendly too.
- Math applications like Mathematica, Matlab, etc use a text based standard to enter and evaluate maths. This standard is easy to read and edit by humans, is easy to parse, but is not flexible enough to allow for visual representation of formulas.
- An interesting case is the formula editor of LibreOffice, which is aiming at representation of maths, but has a simple, text based format underneath it which would be easy to parse for calculation purposes.
- Also Maple is interesting in this regard: it is a math application where you enter text, but it has built-in support to visually render entered formulas.

## Overview

This section shows the text based syntax of a number of well known math applications. They all show how the quadratic formula looks like in a text format:

Image source: Wikipedia

### LaTeX

LaTeX, a document preparation system, is used a lot in the academic world to write scientific documents. LaTeX is very strong in describing math for displaying/publication purposes.

The quadratic formula is represented as:

x = \frac{ { - b \pm \sqrt {b^2 - 4ac} } } { {2a} }

### LibreOffice formula editor

Book on the formula editor (2013)

A formula editor which allows to enter formulas both in text and visually.

The quadratic formula would be represented like:

x = {-b +- sqrt(b^2 – 4ac)} over {2a}

### AsciiMath

A math standard

The quadratic formula is represented as:

x=(-b +- sqrt(b^2 – 4ac))/(2a)

### MathSON

A draft for a JSON based math standard

The quadratic formula is represented as:

["x=", { "numer": ["-b±", { "sqrt": ["b", { "sup": ["2"] }, "-4ac"] }], "denom": ["2a"] }]

### Mathematica, Matlab, Octave, mathjs

Mathematica website

Matlab website

Octave website

mathjs website

Matlab, Mathematica, and Octave are well known math applications. Mathjs is a math library for browsers and node.js.

The quadratic formula would be represented like:

x1 = (-b + sqrt(b^2 - 4*a*c) / (2 * a) x2 = (-b - sqrt(b^2 - 4*a*c) / (2 * a)

### Maple

Maple is a math application too, but is capable of visually rendering the entered input or results.

Image source: StackExchange

### Microsoft Excel

Spreadsheet application

Quadratic formula:

= (-b + SQRT(b^2 - 4*a*c) / (2 * a) = (-b - SQRT(b^2 - 4*a*c) / (2 * a)