【问题标题】:math formula format doesn't appear in android mathView数学公式格式不会出现在 android mathView 中
【发布时间】:2018-03-01 21:28:05
【问题描述】:

我试图在我的 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>");

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

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

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

【问题讨论】:

    标签: java android android-studio tinymce-4 wiris


    【解决方案1】:

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

    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>$$");
    

    希望这会奏效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-06
      • 2014-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多