Version: 1.3.2 (using KDE 3.2.3, (testing/unstable)) Compiler: gcc version 3.3.3 (Debian 20040422) OS: Linux (i586) release 2.4.18-bf2.4 If I type the string "abc" into a fresh KFormula document and export the document as MathML, I get a file with the following content: <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>a<mo> ⁢ </mo> </mi> <mi>b<mo> ⁢ </mo> </mi> <mi>c</mi> </math> I'm really no MathML expert but I suppose that this isn't valid MathML since mo elements are nested into mi elements. In my opinion, a product of three entities a, b and c should be represented as follows: <mi>a<mi> <mo>⁢</mo> <mi>b<mi> <mo>⁢</mo> <mi>c<mi> But there is another problem. The string "abc" could as well mean one entity which is named "abc". To my knowledge, this would be represented in MathML as follows: <mi>abc</mi> How can I distinguish between a product of three entities and one entity with a three letter identifier in KFormula? Is this possible at all? It really should. I'm very interested in using KFormula as a MathML editor. Thanks for your work on MathML support in KFormula so far.
I have tried with OpenOffice. By default "abc" would be a single entity. (I have even no idea how to make a multiplication without any visible sign.) And indeed the exported file created by KFormula is wrong. Have a nice day!
CVS commit by goutte: Fix saving of MathML (The <mo> element cannot be a child of <mi>.) CCMAIL:89401@bugs.kde.org (The bug cannot be closed, as it also asks to allow "abc" as single parameter and not as 3 parametres with hidden multiplications.) M +2 -2 elementtype.cc 1.28 --- koffice/lib/kformula/elementtype.cc #1.27:1.28 @@ -309,10 +309,10 @@ void TextType::saveMathML( SequenceEleme } + de.appendChild( text ); if ( i != end() - 1 ) { QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" ); op.appendChild( doc.createEntityReference( "InvisibleTimes" ) ); - text.appendChild( op ); + de.appendChild( op ); } - de.appendChild( text ); } }
It shouldn't be one entity but three with invisible times, as it is. To be only one entity tag <mtext> should be used. I'll leave this bug opened anyway since there's it's possible to load <mtext>, but not to create it.
Ok, forget about my previous comment above, it was wrong. You were right and it's possible to differentiate between a single entity of 3 chars or three entities in KFormula 1.6. To make a single entity, just enter 'a', 'b', 'c'. To make 3 entities, enter 'a', right arrow, 'b', right arrow, 'c'.