- From: Christian Lerch <christian.lerch@km-works.eu>
- Date: Wed, 25 Jan 2012 06:13:55 +0100
- To: wendellp@operamail.com
- CC: www-math@w3.org
Wendell, one more way to do the translation from AMS-LaTex to MathML is using MathJax, a JavaScript-based display engine (http://www.mathjax.org), which is serving my purposes of embedding math into web pages very well. The resulting MathML output from MathJax for your formula would be: <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <msup> <mover> <mi>G</mi> <mo stretchy="false">ˆ<!-- ˆ --></mo> </mover> <mrow> <mo stretchy="false">(</mo> <mi>T</mi> <mo stretchy="false">)</mo> </mrow> </msup> <mo>=</mo> <mfrac> <mn>1</mn> <mi>T</mi> </mfrac> <mrow> <munderover> <mo>∑<!-- ∑ --></mo> <mrow> <mi>t</mi> <mo>=</mo> <mi>m</mi> <mo>+</mo> <mn>1</mn> </mrow> <mrow> <mi>T</mi> </mrow> </munderover> </mrow> <msup> <mi>π<!-- π --></mi> <mi>t</mi> </msup> </math> which is again a slightly different variant for almost the same rendering. MathJax's major advantage here is that translation between LaTeX and MathML is automatic - no need to manually click through an editor tool. In case you find it usefull you can use my online translator for doing experiments with MathJax at http://km-works.eu//mathel-interactive/ Regards, Chris Am 25.01.2012 01:06, schrieb Paul Topping: > One of the choices equation editors have to make is whether to generate > MathML that reflects the fonts and styles assigned within their editing > window. This seems to be the choice made by MathMagic whereas Formulator > and MathType (my product) leaves this out. Since the MathML is not > likely to be rendered in a context where those choices make sense or can > be controlled easily, I believe leaving this out makes more sense. > Perhaps MathMagic figures it is best to generate it so you can remove it > if you don't want it. > > After a quick glance, MathType and Formulator output look similar. > MathType uses numerical character references (eg,^) whereas > Formulator uses character names (eg,ˆ). The names are more > readable but numerical refs are more reliable. To be fair though,ˆ > might be ok everywhere and perhaps Formulator uses numbers for those > references that are not usually supported in web browsers. > > Hope this helps. > > Paul > >> -----Original Message----- >> From: Wendell P [mailto:wendellp@operamail.com] >> Sent: Tuesday, January 24, 2012 3:55 PM >> To: www-math@w3.org >> Subject: Styles of using p-MathML >> >> I used the MathType, Math+Magic, and Formulator equation editors to >> render this as MathML: >> >> $$ \hat G^{(T)} = \frac{1}{T} \sum_{t=m+1}^{T} \pi^t $$ >> http://img36.imageshack.us/img36/8418/codecogseqn.png >> >> Below is the slightly cleaned-up code from each. They seem to > represent >> quite different ideas of how things should be done. The different >> versions render the same in most environments I have tried, so I would >> lean toward using the simplest markup, like Formulator. In what >> situations would I want to use heavier markup like Math+Magic? >> >> -------------------------------- >> FORMULATOR >> <math display='block' xmlns='http://www.w3.org/1998/Math/MathML'> >> <mrow> >> <msup> >> <mover> >> <mi>G</mi> >> <mo stretchy='true'>ˆ</mo> >> </mover> >> <mrow> >> <mo stretchy='false'>(</mo> >> <mi>T</mi> >> <mo stretchy='false'>)</mo> >> </mrow> >> </msup> >> <mo>=</mo> >> <mfrac> >> <mn>1</mn> >> <mi>T</mi> >> </mfrac> >> <mrow> >> <munderover> >> <mo>∑</mo> >> <mrow> >> <mi>t</mi> >> <mo>=</mo> >> <mi>m</mi> >> <mo>+</mo> >> <mn>1</mn> >> </mrow> >> <mi>T</mi> >> </munderover> >> <msup> >> <mi>π</mi> >> <mi>t</mi> >> </msup> >> </mrow> >> </mrow> >> </math> >> -------------------------------- >> MATHTYPE >> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> >> <mrow> >> <msup> >> <mover accent='true'> >> <mi>G</mi> >> <mo>^</mo> >> </mover> >> <mrow> >> <mo stretchy='false'>(</mo> >> <mi>T</mi> >> <mo stretchy='false'>)</mo> >> </mrow> >> </msup> >> <mo>=</mo> >> <mfrac> >> <mn>1</mn> >> <mi>T</mi> >> </mfrac> >> <mstyle displaystyle='true'> >> <munderover> >> <mo>∑</mo> >> <mrow> >> <mi>t</mi> >> <mo>=</mo> >> <mi>m</mi> >> <mo>+</mo> >> <mn>1</mn> >> </mrow> >> <mi>T</mi> >> </munderover> >> <mrow> >> <msup> >> <mi>π</mi> >> <mi>t</mi> >> </msup> >> </mrow> >> </mstyle> >> </mrow> >> </math> >> >> -------------------------------- >> MATH+MAGIC >> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"> >> <semantics> >> <mstyle mathcolor="#000000" mathsize="12.0pt"> >> <msup> >> <mover> >> <mi mathvariant="italic">G</mi> >> <mo accent="true">^</mo> >> </mover> >> <mrow> >> <mi mathsize="50.0%">(</mi> >> <mi mathsize="50.0%" mathvariant="italic">T</mi> >> <mi mathsize="50.0%">)</mi> >> </mrow> >> </msup> >> <mo>=</mo> >> <mfrac> >> <mn>1</mn> >> <mi mathvariant="italic">T</mi> >> </mfrac> >> <mrow> >> <munderover> >> <mo>∑</mo> >> <mrow> >> <mi mathsize="50.0%" mathvariant="italic">t</mi> >> <mo mathsize="50.0%">=</mo> >> <mi mathsize="50.0%" mathvariant="italic">m</mi> >> <mo mathsize="50.0%">+</mo> >> <mn mathsize="50.0%">1</mn> >> </mrow> >> <mi mathsize="50.0%" mathvariant="italic">T</mi> >> </munderover> >> <msup> >> <mo mathvariant="italic">π</mo> >> <mi mathsize="50.0%" mathvariant="italic">t</mi> >> </msup> >> </mrow> >> </mstyle> >> </semantics> >> </math> >> >> -- >> http://www.fastmail.fm - Email service worth paying for. Try it for >> free >> > >
Received on Wednesday, 25 January 2012 05:11:40 UTC