LaTeX to CAS translator

Jump to navigation Jump to search

This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.

The demo-application converts LaTeX functions which directly translate to CAS counterparts.

Functions without explicit CAS support are available for translation via a DRMF package (under development).

The following LaTeX input ...

{\displaystyle \{\pm2, \pm\tfrac{3}{2}, \pm\tfrac{1}{2}\}}

... is translated to the CAS output ...

Semantic latex: \{\pm2, \pm\tfrac{3}{2}, \pm\tfrac{1}{2}\}

Confidence: 0

Mathematica

Translation: {\[PlusMinus]2 , \[PlusMinus]Divide[3,2], \[PlusMinus]Divide[1,2]}

Information

Sub Equations

  • {+ 2 , +Divide[3,2], +Divide[1,2]}
  • {- 2 , -Divide[3,2], -Divide[1,2]}

Symbol info

  • was translated to: \[PlusMinus]

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \pm

Tests

Symbolic
Numeric

Maple

Translation: {&+- 2 , &+- (3)/(2), &+- (1)/(2)}

Information

Sub Equations

  • {+ 2 , +(3)/(2), +(1)/(2)}
  • {- 2 , -(3)/(2), -(1)/(2)}

Symbol info

  • was translated to: &+-

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • value on the real axis
  • value
  • value in the figure
  • right

Complete translation information:

{
  "id" : "FORMULA_89f40bc0585a1761e686355511fe81da",
  "formula" : "\\{\\pm2, \\pm\\tfrac{3}{2}, \\pm\\tfrac{1}{2}\\}",
  "semanticFormula" : "\\{\\pm2, \\pm\\tfrac{3}{2}, \\pm\\tfrac{1}{2}\\}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "{\\[PlusMinus]2 , \\[PlusMinus]Divide[3,2], \\[PlusMinus]Divide[1,2]}",
      "translationInformation" : {
        "subEquations" : [ "{+ 2 , +Divide[3,2], +Divide[1,2]}", "{- 2 , -Divide[3,2], -Divide[1,2]}" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: \\[PlusMinus]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \\pm"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "{&+- 2 , &+- (3)/(2), &+- (1)/(2)}",
      "translationInformation" : {
        "subEquations" : [ "{+ 2 , +(3)/(2), +(1)/(2)}", "{- 2 , -(3)/(2), -(1)/(2)}" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: &+-"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 7,
    "sentence" : 47,
    "word" : 35
  } ],
  "includes" : [ "\\pm", "1", "2" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "value on the real axis",
    "score" : 0.722
  }, {
    "definition" : "value",
    "score" : 0.5988174995334326
  }, {
    "definition" : "value in the figure",
    "score" : 0.5988174995334326
  }, {
    "definition" : "right",
    "score" : 0.5049074255814494
  } ]
}

Specify your own input