且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在iOS 5.0设备中显示复杂的数学方程式

更新时间:1970-01-01 07:57:12

对于复杂的数学表达式,我建议使用标记语言,该语言是 W3C标准之一,称为MathML. ,请参阅:
http://en.wikipedia.org/wiki/Mathml [ http://www.w3.org/Math/ [ http://en.wikipedia.org/wiki/HTML5 [ http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5%29 [ ^ ].

您可以将这种方法用于不一定基于Web的iPhone应用程序.您可以在iOS上使用Apple WebKit,请参阅:
http://en.wikipedia.org/wiki/WebKit [ http://www.webkit.org/ [ ^ ],
http://en.wikipedia.org/wiki/IOS [ http://www.apple.com/ios/ [
For complex mathematical expressions, I would advise to use the markup language which is one the the W3C standards, called MathML, please see:
http://en.wikipedia.org/wiki/Mathml[^],
http://www.w3.org/Math/[^].

Apparently, as this approach is based on the standard, your this approach in multi-platform, which I think is very important for smartphone systems like iOS.

Moreover, if you browser supports relevant set of HTML5 features, you can directly embed MathML markup in the HTML markup, please see:
http://en.wikipedia.org/wiki/HTML5[^],
http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML5%29[^].

You can use this approach with iPhone applications which does not have to be the Web-based. You can use Apple WebKit with iOS, please see:
http://en.wikipedia.org/wiki/WebKit[^],
http://www.webkit.org/[^],
http://en.wikipedia.org/wiki/IOS[^],
http://www.apple.com/ios/[^].

Finally, this is a complete sample of HTML file with MathML markup embedded:
<html>
    <head>
        <title>MathML sample</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
<body>

<h2>MathML sample:</h2>
<p><big><big>
<math mode="display" xmlns="http://www.w3.org/1998/Math/MathML">
  <mrow>
    <mi>x</mi>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <mo form="prefix">&#x2212;<!-- &minus; --></mo>
        <mi>b</mi>
        <mo>&#x00B1;<!-- &PlusMinus; --></mo>
        <msqrt>
          <msup>
            <mi>b</mi>
            <mn>2</mn>
          </msup>
          <mo>&#x2212;<!-- &minus; --></mo>
          <mn>4</mn>
          <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
          <mi>a</mi>
          <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
          <mi>c</mi>
        </msqrt>
      </mrow>
      <mrow>
        <mn>2</mn>
        <mo>&#x2062;<!-- &InvisibleTimes; --></mo>
        <mi>a</mi>
      </mrow>
    </mfrac>
  </mrow>
</math>
</big></big></p>

</body>
</html>




—SA




—SA