0

我正在尝试在我的 android 应用程序中显示数学公式我使用 tiny_mce 和 WIRIS 插件来编写公式如下图所示 在此处输入图像描述

编辑器将公式存储在数据库中,格式如下

<p><math xmlns="http://www.w3.org/1998/Math/MathML"><mroot><mrow><mn>3</mn>
   <mi>x</mi></mrow><mn>2</mn></mroot><mo>&#215;</mo><mn>2</mn>
   <mimathvariant="normal">&#960;</mi></math></p>

我还在我的 android 应用程序中使用 MathView 来显示这个公式,如下所示

 MathView testMathView=(MathView) findViewById(R.id.test);
    testMathView.setText("<p><math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
          "<mroot><mrow><mn>3</mn><mi>x</mi></mrow><mn>2</mn></mroot>" +
          "<mo>&#215;</mo><mn>2</mn><mi mathvariant=\"normal\">&#960;</mi></math></p>");

但它不起作用它向我展示了唯一没有数学公式符号的数字

这是一个 GitHub 库和 MathView 教程,它不适用于 github上 wiris 编辑器 MathView 的输出

您能否提供任何帮助或建议以在 android 应用程序中显示 wiris 输出格式?

4

1 回答 1

2

正如我在您链接的 GitHub 上的文档中所读到的,您应该auto:engine="MathJax"设置MathView如下setText

testMathView.setText("$$<p><math xmlns=\"http://www.w3.org/1998/Math/MathML\">" +
      "<mroot><mrow><mn>3</mn><mi>x</mi></mrow><mn>2</mn></mroot>" +
      "<mo>&#215;</mo><mn>2</mn><mi mathvariant=\"normal\">&#960;</mi></math></p>$$");

希望这会奏效。

于 2018-03-01T21:57:19.380 回答