Let's find out how does it look when we try to inline the preposterous equation into this paragraph... Blah-blah-blah-blah...
Mhhh... OK, not so preposterous...
Tuesday, June 23, 2009
Testing math stuff #2: tex2image
MathML is a little too maniacal, maybe it will all come down to use that outrageous tex2image thingy...
Problem is, this image will kaput as soon as the server where it is stored kaputs.
Problem is, this image will kaput as soon as the server where it is stored kaputs.
Monday, June 22, 2009
Testing math stuff #1: MathML
So, before we embark into this maniacal venture, I need to find a way to include math typesetting into our posts... Everything points to using MathML, which is "a recommended standard for internet publishing of mathematics."
Problem is, this "recommended standard" doesn't seem to be able to lift itself to anything higher than a recommendation, and thus, a couple of things need to be done on the client side (a.k.a. browser in the host machine) such as:
I am using Mozilla Firefox 3.0.11 as of now.
Now, there is a catch. MathML is ridiculously verbose to author directly and so needs authoring tools that can translate from a standard mathematics authoring markup such as TeX. There is this tool called TtM (TeX to MathML) which provides this capability. The idea is that one feeds LaTeX into TtM and this produces the desired MathML output... Which then a MathML capable browser can read and render nicely...
LaTeX Input:
This is the generated MathML:
All this sounds fantastic, but somehow when I include this bloody MathML markup into my post content, it ain't look no good at all!@#$%^&* Ahhhgrrrrrrr...
This is the browser rendered MathML:
Totally unacceptable...
Problem is, this "recommended standard" doesn't seem to be able to lift itself to anything higher than a recommendation, and thus, a couple of things need to be done on the client side (a.k.a. browser in the host machine) such as:
- Downloading more fonts: This seems pretty much necessary, but fortunately is also very simple and straightforward.
- Making sure you have a browser capable of reading MathML. From what I've learnt today, Mozilla Firefox essentially provides native support for MathML. Internet Explorer needs a plug-in. In any case, this is not worrying me too much either.
I am using Mozilla Firefox 3.0.11 as of now.
Now, there is a catch. MathML is ridiculously verbose to author directly and so needs authoring tools that can translate from a standard mathematics authoring markup such as TeX. There is this tool called TtM (TeX to MathML) which provides this capability. The idea is that one feeds LaTeX into TtM and this produces the desired MathML output... Which then a MathML capable browser can read and render nicely...
LaTeX Input:
\section{A ridiculous equation}
A sample ridiculous equation pirated from the TtM website,
$$\Omega=\sum_{i=0}^{\infty}\left(x_i^2+1 \over x_i-1\right)^{p_i}$$
which supposedly is to be nicely translated into HTML by TtH.
\section{A ridiculous macro}
\def\ridiculous_macro#1{{\it #1}}
And the ridiculous_macro does this: \ridiculous_macro{ridiculous text to be macroed}.
This is the generated MathML:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mstyle displaystyle="true">
<mrow>
<mi>Ω</mi>
<mo>=</mo>
<munderover>
<mo>∑</mo>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow>
<mi>∞</mi>
</mrow>
</munderover>
<msup>
<mrow>
<mo>(</mo>
<mfrac>
<mrow>
<msubsup>
<mrow>
<mi>x</mi>
</mrow>
<mrow>
<mi>i</mi>
</mrow>
<mrow>
<mn>2</mn>
</mrow>
</msubsup>
<mo>+</mo>
<mn>1</mn>
</mrow>
<mrow>
<msub>
<mrow>
<mi>x</mi>
</mrow>
<mrow>
<mi>i</mi>
</mrow>
</msub>
<mo>-</mo>
<mn>1</mn>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mrow>
<msub>
<mrow>
<mi>p</mi>
</mrow>
<mrow>
<mi>i</mi>
</mrow>
</msub>
</mrow>
</msup>
</mrow>
</mstyle>
</math>
All this sounds fantastic, but somehow when I include this bloody MathML markup into my post content, it ain't look no good at all!@#$%^&* Ahhhgrrrrrrr...
This is the browser rendered MathML:
Totally unacceptable...
Labels:
Math
Subscribe to:
Posts (Atom)