基于Web的方程编辑器到mathml导出?

时间:2015-05-28 15:01:54

标签: javascript html html5 mathml formula-editor

我正在尝试将数学formula editor整合到网站中。我希望用户在这个编辑器中写出一个等式,并让编辑器导出为包含MathML格式的源代码。

当我玩演示并更改方程式时,源代码不会更新为新的等式。

这是否需要后端工作?

请不要重定向到其他公式编辑器!

1 个答案:

答案 0 :(得分:1)

对我来说确实如此。

q²-1/q-1 

然后我使用他们的javascript链接

javascript:alert(org.mathdox.formulaeditor.FormulaEditor.getEditorByTextArea("formula1").getMathML())

,结果是

mlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><msup><mi>q</mi><mn>2</mn></msup><mo>-</mo><mn>1</mn></mrow><mrow><mi>q</mi><mo>-</mo><mn>1</mn></mrow></mfrac></math>

当我将公式更改为

q²-1/q-2

我得到了

<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><msup><mi>q</mi><mn>2</mn></msup><mo>-</mo><mn>1</mn></mrow><mrow><mi>q</mi><mo>-</mo><mn>2</mn></mrow></mfrac></math>

它肯定会改变价值。您应提供一个示例或与SO'指南'相似的类似内容。您可以在这里查看:https://stackoverflow.com/tour