如何从MathJAX.js获取MathExpression

问题描述:

我是MathMl的新手。如何从MathJAX.js获取MathExpression

我具有低于MATHML

<math xmlns='http://www.w3.org/1998/Math/MathML'> 
<mrow> 
    <mrow> 
    <msup> 
     <mi>x</mi> 
     <mn>10</mn> 
    </msup> 
    <mo>+</mo> 
    <mrow> 
     <mn>4</mn> 
     <mo>&InvisibleTimes;</mo> 
     <mi>x</mi> 
    </mrow> 
    <mo>+</mo> 
    <mn>4</mn> 
    </mrow> 
    <mo>=</mo> 
    <mn>0</mn> 
</mrow> 
</math> 

我怎样才能相应MathExpression其通过使用MathJax为x^10 + 4×+ 4 = 0。

我需要javascript变量或内部生成的html内容本身的表达式。

感谢

你刚才添加的MathJax库这样的:

<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <title>MathJax TeX Test Page</title> 
 
    <script type="text/x-mathjax-config"> 
 
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); 
 
    </script> 
 
    <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"> 
 
    </script> 
 
</head> 
 

 
<body> 
 
    <math xmlns='http://www.w3.org/1998/Math/MathML'> 
 
<mrow> 
 
    <mrow> 
 
    <msup> 
 
     <mi>x</mi> 
 
     <mn>10</mn> 
 
    </msup> 
 
    <mo>+</mo> 
 
    <mrow> 
 
     <mn>4</mn> 
 
     <mo>&InvisibleTimes;</mo> 
 
     <mi>x</mi> 
 
    </mrow> 
 
    <mo>+</mo> 
 
    <mn>4</mn> 
 
    </mrow> 
 
    <mo>=</mo> 
 
    <mn>0</mn> 
 
</mrow> 
 
</math> 
 
</body> 
 

 
</html>

+0

我想要一个JavaScript变量内表达式的值。那么有什么功能可以用来获得它或类似的东西? –

+0

我认为这篇文章可以帮助你[https://stackoverflow.com/a/26386993/8324070](https://stackoverflow.com/a/26386993/8324070) – Cylexx