Bug 89401 - multiple consecutive letters and MathML export
Summary: multiple consecutive letters and MathML export
Status: RESOLVED FIXED
Alias: None
Product: calligraformula
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Alfredo Beaumont
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-13 12:41 UTC by Wolfgang Jeltsch
Modified: 2011-03-11 11:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jeltsch 2004-09-13 12:41:17 UTC
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>
    &InvisibleTimes;    </mo>
      </mi>
      <mi>b<mo>
    &InvisibleTimes;    </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>&InvisibleTimes;</mo>
    <mi>b<mi>
    <mo>&InvisibleTimes;</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.
Comment 1 Nicolas Goutte 2004-09-28 21:44:33 UTC
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!
Comment 2 Nicolas Goutte 2004-09-29 10:42:55 UTC
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 );
     }
 }


Comment 3 Alfredo Beaumont 2006-03-14 21:27:01 UTC
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.
Comment 4 Alfredo Beaumont 2006-09-29 17:07:34 UTC
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'.