cortex-js / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
https://cortexjs.io
MIT License
357 stars 42 forks source link

[FEATURE] Extend MathJSON parser to output environments #125

Closed tumidi closed 10 months ago

tumidi commented 10 months ago

Is your feature request related to a problem? Please describe.

Environments, as supported by MathLive, encompass various mathematical structures such as matrices, arrays, and more. Currently, the MathJSON parser lacks the ability to output environments, which are crucial for mathematical notation rendering and further processing. The ability to output those environments is a requirement for other software such as CAS to consume and process notation data.

The inclusion of this feature will enhance the versatility and utility of the MathJSON parser and MathLive as a whole, making it more capable of handling a wide range of mathematical expressions.

Describe the solution you'd like

We propose extending the capabilities of the MathJSON parser to include the ability to output environments. Specifically, we suggest that the parser be enhanced to generate a semantic representation of these environments in the output.

When the MathJSON parser encounters an environment as described in the reference it should generate an appropriate semantic representation in the output JSON. This representation should accurately capture the structure and content of the environment, ensuring that mathematical expressions can be effectively processed and displayed in various applications.

Describe alternatives you've considered

While parsing the data from LaTeX is an option, it is cumbersome and error-prone. Also, LaTeX code targets representational rather than semantic requirements, making it less suitable for further processing.

Additional context