MathML In Action 编辑

MathML in Action

Are you seeing nifty equations throughout this page? No? Too bad. Here is a screenshot of what you are missing. Download a MathML-enabled Mozilla build to remedy this sad situation.

You already have a MathML-enabled build but what you see on the screenshot is not what you get? In that case you are probably missing some crucial MathML fonts.

Now that you are well-equipped, you should be able to see this inline equation with varying accents: x^+xy^+xyz^. Next to it is this tiny formula, det|acbd|=ad-bc, which can also be typeset in displaystyle as det|abcd|=ad-bc.

Mathematical typesetting is picky. MathML in Mozilla aims at complying with the MathML specification so that What You See Is What You Markup, or to put it another way What You See Is What You Made, or in short "WYSIWYM". The difference between these two is in the markup! (...((a0+a1)n1+a2)n2+...+ap)np (...((a0+a1)n1+a2)n2+...+ap)np

The roots of this bold equation y3+py+q=0 are also bold y=-q2+q24+p32723+-q2-q24+p32723.

As for the roots of the equation ax2+bx+c=0, click anywhere in the yellow area to zoom-in/zoom-out:

Zoomable Math

HTML Content

    <p>
      <math display="block">
        <mstyle id="zoomableMath" mathbackground="yellow">
          <mrow>
            <mi>x</mi>
            <mo>=</mo>
            <mfrac>
              <mrow>
                <mrow>
                  <mo>-</mo>
                  <mi>b</mi>
                </mrow>
                <mo>&#xB1;</mo>
                <msqrt>
                  <mrow>
                    <msup>
                      <mi>b</mi>
                      <mn>2</mn>
                    </msup>
                    <mo>-</mo>
                    <mrow>
                      <mn>4</mn>
                      <mi>a</mi>
                      <mi>c</mi>
                    </mrow>
                  </mrow>
                </msqrt>
              </mrow>
              <mrow>
                <mn>2</mn>
                <mi>a</mi>
              </mrow>
            </mfrac>
          </mrow>
        </mstyle>
      </math>
    </p>

JavaScript Content

      function zoomToggle()
      {
      if (this.hasAttribute("mathsize")) {
      this.removeAttribute("mathsize");
      } else {
      this.setAttribute("mathsize", "200%");
      }
      }

      function load()
      {
      document.getElementById("zoomableMath").
      addEventListener("click", zoomToggle, false);
      }

      window.addEventListener("load", load, false);

Consider an interesting markup like this {ut+f(u)x=0u(0,x)={u-if x<0u+if x>0 or other complex markups like these Ell^Y(Z;z,τ):=Y(l(yl2πi)θ(yl2πi-z)θ(0)θ(-z)θ(yl2πi))×(kθ(ek2πi-(αk+1)z)θ(-z)θ(ek2πi-z)θ(-(αk+1)z)) π(n)=m=2n(k=1m-1(m/k)/m/k)-1 ϕWsk(Ωg)(|α|kαϕξαLs(Ωg)s)1/s

For more examples, refer to links on the MathML Project page, and if you are building your own Mozilla binary, see the directory mozilla/layout/mathml/tests.

Now, what next? As you try out MathML in Mozilla, what to do with those few things that appear to you not to work as per the MathML spec? Or what about those things that just seem itchy, and that you wish could be done just a little better? Or what about those things that were working before and are not working anymore (a.k.a. regressions)? In either case, head over to Bugzilla to report the discrepancies. Bugzilla has a big memory for these things, and besides, how would your problems be fixed if they are not reported?!

Getting involved is part of your contribution towards enriching Gecko with an elegant standards-compliant MathML renderer. Your feedback can be manifested by putting MathML content on the web, reporting bugs in Bugzilla, and, if you can help with code, inspecting/improving the current code, and/or picking up an item in the ToDo list.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:52 次

字数:13093

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文