Math markup example

Discussion in 'XML' started by Peter Flynn, May 21, 2010.

  1. Peter Flynn

    Peter Flynn Guest

    I am, god wot, no mathematician, but I need to be able to quote a simple
    example of MathML markup for an obvious candidate expression, E=mc²

    The following was constructed by a colleague who is no longer
    contactable, and I would be grateful if someone could let me know if it
    is a reasonable way to do it, bearing in mind this is for the purposes
    of an example:

    <m:apply>
    <m:eq/>
    <m:ci>E</m:ci>
    <m:apply>
    <m:times/>
    <m:ci>m</m:ci>
    <m:apply>
    <m:power/>
    <m:ci>c</m:ci>
    <m:cn>2</m:cn>
    </m:apply>
    </m:apply>
    </m:apply>

    ///Peter
    Peter Flynn, May 21, 2010
    #1
    1. Advertising

  2. From an example found fairly quickly on the web:

    A MathML formula can be typeset inline, as here
    <math xmlns="&mathmlns;">
    <mi>E</mi><mo>=</mo><mi>m</mi>
    <msup>
    <mi>c</mi>
    <mn>2</mn>
    </msup>
    </math>

    Here they used a default namespace declaration rather than an explicit
    prefix, but it comes out to the same thing. Note that I don't vouch for
    correctness.

    Here <mo> is an operator, <mi> is an identifier, <msup> takes an
    expression and a superscript and applies the latter to the former.

    See also the examples in the Recommendation, at
    http://www.w3.org/TR/MathML/chapter2.html#fund.examples
    though those appear to be more rigorous, explicitly using the "invisible
    times" operator.

    I'm sure there are tutorials on the web too, though I haven't gone
    looking for them. My usual starting point when looking for beginner
    documents is http://www.ibm.com/xml, but I admit to being biased.

    --
    Joe Kesselman,
    http://www.love-song-productions.com/people/keshlam/index.html

    {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
    /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
    Joe Kesselman, May 21, 2010
    #2
    1. Advertising

  3. Peter Flynn

    Peter Flynn Guest

    William F Hammond wrote:
    > However, I would suggest not using namespace prefixes, which are not,
    > as I understand it, compatible with html5. The safest way, I think,
    > is to introduce the namespace -- fully elaborated for each instance --
    > with the xmlns attribute on the "math" element.


    > Note that you are using "content" MathML markup. For content MathML
    > to render in Mozilla family browsers, you'll need a link to local
    > copies of David Carlisle's "universal mathml stylesheets" found at
    > http:/www.w3.org/Math/XSL


    Fortunately there will only be this one example :) and it will be
    transformed by Cocoon into whatever flavour of HTML is current from time
    to time.

    Joe Kesselman wrote:
    > From an example found fairly quickly on the web:
    >
    > A MathML formula can be typeset inline, as here
    > <math xmlns="&mathmlns;">
    > <mi>E</mi><mo>=</mo><mi>m</mi>
    > <msup>
    > <mi>c</mi>
    > <mn>2</mn>
    > </msup>
    > </math>


    Thank you both for the explanations. I think I need to use both the
    presentation format and the content format, so I'm grateful to have them
    in a mathematically correct form.

    > I'm sure there are tutorials on the web too, though I haven't gone
    > looking for them. My usual starting point when looking for beginner
    > documents is http://www.ibm.com/xml, but I admit to being biased.


    I have been trying to avoid having to learn the fine detail of MathML
    and thereby reveal my own mathematical incompetence (this from someone
    who gained a grade U in the Add.Maths O-Level, which is "Unclassified";
    OLEB's polite phrase for "under 5%" :)

    ///Peter
    Peter Flynn, May 21, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chirs
    Replies:
    18
    Views:
    750
    Chris Uppal
    Mar 2, 2004
  2. AciD_X
    Replies:
    4
    Views:
    8,075
    Jonathan Turkanis
    Apr 1, 2004
  3. Replies:
    3
    Views:
    513
  4. Mark Healey
    Replies:
    7
    Views:
    1,463
    Tim Prince
    May 22, 2006
  5. VK
    Replies:
    15
    Views:
    1,130
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page