MathML Blogs: MathType 6.0

Thursday, November 20, 2008

MathType 6.0

I use MathType to create math equation. I used to use Microsoft Word together with MathType, but after upgrading to Word 2007 I found that the document can no longer be saved as Mathpage specially in XP. Its not a problem in Vista. However I use XP. Also I got fed up with the cleaning of code in MathPage.

One can purchase MathType, Microsoft Word and many other educational products from JourneyEd at discounts upto 85% off original price. For some products, you have to qualify as a student or faculty at any school or university.It is best to create an account with them and establish the status as student or faculty first before placing any order otherwise it can delay the order shipment.

Anyway, coming back to MathType, I create all my math content using a simple HTML editor and embed MathML code from MathType.

I found a couple of things in the MathType translation routines to be creating a problem in the MathML code. For example, in complex math content involving complex exponents, the complex expression in the exponent was not included in a pair of <mrow> and </mrow> pair of tags and as a result of that Mathplayer was throwing errors while displaying it.

So I decided to take a look at the MathType translation routines. After saving the original, I started experimenting on it to see what I am changing. There is no documentation anywhere about how to change or create new translation routines. Design Science lets you modify and create new translations using theirs as a template. I not only succeeded in implementing the fix for the complex exponent case, but also was able to delete the <semantics>, </semantics> pair of tags and also the <annotation>, </annotation> pair of tags which I find them to be unnecessary for my need.

For the sementic and annontations tags, I basically removed them as follows:
// default top-level display equation translation
eqn = "(StdStartCmt)<(ns)math display='block' xmlns='http://www.w3.org/1998/Math/MathML'>"
"$+$n#$-$n"
"</(ns)math>$n(StdEndCmt)";
// default top-level inline equation translation
eqn/inline = "(StdStartCmt)<(ns)math xmlns='http://www.w3.org/1998/Math/MathML'>"
"$+$n#$-$n"
"</(ns)math>$n(StdEndCmt)";

and to include the exponent in a pair of mrow tags, I did the following
// superscript (normal, trailing)
sup/scan = "<(ns)msup>$+$n<(ns)mrow>#1</(ns)mrow>$n<(ns)mrow>#3</(ns)mrow>$-$n</(ns)msup>$n";

No comments:

Post a Comment