Re: Annotations Not Stored after a Save

2014-07-30 Thread Ariel Constenla-Haile
On Mon, Jul 28, 2014 at 01:51:13PM +0530, Prannoy Pilligundla wrote:
> > Looking at the code in
> >
> > starmath/source/mathmlimport.cxx
> > class SmXMLAnnotationContext_Impl
> >
> > http://svn.apache.org/viewvc/openoffice/trunk/main/starmath/source/mathmlimport.cxx?revision=1591062&view=markup#l1306
> >
> > only the annotation with encoding="StarMath 5.0" is imported.
> >
> 
> I tried changing the encoding to Starmath 5.0 as you said but its still not
> retained after saving the ODT file

That will never work; if you look at the code, OpenOffice expects valid
"StarMath" (OpenOffice Math) syntax inside that annotation; that's why
I said that you could add the latex formula as a OO Math comment; but,
again, this is useless, because the user will see that comment, and can
remove it.
 
> >
> > You could add the latex formula as a comment inside that annotation (in
> > OpenOffice Math comments start with %%), but if the user deletes the
> > comment, you won't be able to import back the latex formula. Besides,
> > there isn't much sense in storing the original latex formula when the
> > document - and the formula - can be modified by the user. It seems you
> > will have to implement a MathML to latex converter.
> >
> 
>  I don't want to show the latex formula to the user, I am bringing it as
> metadata that can be used for ODT to LyX conversion. But the point you made
> that the formula can be modified is true,its a limitation in what I am
> trying to do, this can only be solved by implementing a MathML to Latex
> converter as you said


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature


Re: Annotations Not Stored after a Save

2014-07-28 Thread Prannoy Pilligundla
Thanks for the reply Ariel

On Mon, Jul 28, 2014 at 3:09 AM, Ariel Constenla-Haile 
wrote:

> Hello Prannoy,
>
> You may get more answers if you write to the development mailing list:
> d...@openoffice.apache.org


I was subscribed to that as well, put it to this list by mistake. Just
posted it there also. Thanks!


> Looking at the code in
>
> starmath/source/mathmlimport.cxx
> class SmXMLAnnotationContext_Impl
>
> http://svn.apache.org/viewvc/openoffice/trunk/main/starmath/source/mathmlimport.cxx?revision=1591062&view=markup#l1306
>
> only the annotation with encoding="StarMath 5.0" is imported.
>

I tried changing the encoding to Starmath 5.0 as you said but its still not
retained after saving the ODT file


>
> You could add the latex formula as a comment inside that annotation (in
> OpenOffice Math comments start with %%), but if the user deletes the
> comment, you won't be able to import back the latex formula. Besides,
> there isn't much sense in storing the original latex formula when the
> document - and the formula - can be modified by the user. It seems you
> will have to implement a MathML to latex converter.
>

 I don't want to show the latex formula to the user, I am bringing it as
metadata that can be used for ODT to LyX conversion. But the point you made
that the formula can be modified is true,its a limitation in what I am
trying to do, this can only be solved by implementing a MathML to Latex
converter as you said


Re: Annotations Not Stored after a Save

2014-07-27 Thread Ariel Constenla-Haile
Hello Prannoy,

You may get more answers if you write to the development mailing list:
d...@openoffice.apache.org

On Sun, Jul 27, 2014 at 10:17:29PM +0530, Prannoy Pilligundla wrote:
> Hi Everyone,
> 
> I am Prannoy and I am working on Roundtrip Conversion from LyX to ODT as a
> part of my Google Summer of Code 2014 project.
> 
> While doing LyX to ODT conversion I am saving the latex math expression as
> it is using the annotation tag so that I can extract it back while
> performing ODT to LyX conversion. All annotations are inside the main
> content.xml. I am able to extract the math expression back if the file is
> not modified and saved in OpenOffice. After modifying and saving the
> document, OpenOffice rewrites everything and the annotation tags I had in
> content.xml now disappear. Is there any way to stop OpenOffice from
> removing the annotation tags in the content.xml?
> 
> I can now extract the math from the annotation which OpenOffice writes
> inside the content.xml of that particular formula but this is not of much
> use as it is a custom notation.
> 
> Looking forward to hear everyone's views on this

Looking at the code in 

starmath/source/mathmlimport.cxx
class SmXMLAnnotationContext_Impl
http://svn.apache.org/viewvc/openoffice/trunk/main/starmath/source/mathmlimport.cxx?revision=1591062&view=markup#l1306

only the annotation with encoding="StarMath 5.0" is imported.

You could add the latex formula as a comment inside that annotation (in
OpenOffice Math comments start with %%), but if the user deletes the
comment, you won't be able to import back the latex formula. Besides,
there isn't much sense in storing the original latex formula when the
document - and the formula - can be modified by the user. It seems you
will have to implement a MathML to latex converter.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina


signature.asc
Description: Digital signature


Annotations Not Stored after a Save

2014-07-27 Thread Prannoy Pilligundla
Hi Everyone,

I am Prannoy and I am working on Roundtrip Conversion from LyX to ODT as a
part of my Google Summer of Code 2014 project.

While doing LyX to ODT conversion I am saving the latex math expression as
it is using the annotation tag so that I can extract it back while
performing ODT to LyX conversion. All annotations are inside the main
content.xml. I am able to extract the math expression back if the file is
not modified and saved in OpenOffice. After modifying and saving the
document, OpenOffice rewrites everything and the annotation tags I had in
content.xml now disappear. Is there any way to stop OpenOffice from
removing the annotation tags in the content.xml?

I can now extract the math from the annotation which OpenOffice writes
inside the content.xml of that particular formula but this is not of much
use as it is a custom notation.

Looking forward to hear everyone's views on this

Thanks and Regards
Prannoy Pilligundla