Fixing itex2MML

From: <msevior_at_physics.unimelb.edu.au>
Date: Tue Mar 08 2005 - 00:35:00 CET

>
> On Tue, 2005-03-08 at 01:32 +1100, msevior@physics.unimelb.edu.au wrote:
>> That is the entire output of itex2MML. I created a file with the Latex
>> expression and piped it into itex2MML with..
>>
>> cat fred.tex | itex2MML
>
> I see. Then these fragments are not well-formed by themselves.
>
>> > there is no need to lookup a latex book, fortunately (there are nearly
>> > 2000 MathML entities!) The MathML spec lists them all, and gtkmathview
>> > provides an XML file with the correspondence between entity names and
>> > Unicode characters (see the file entities-table.xml in gtkmathview)
>>
>> Excellent! What do we need to do to make all this work?
>>
>> Is there a simple solution to get GtkMathView to recognize the Entities?
>
> The only sensible way is to declare them. However, I don't like the idea
> of declaring 2000 entities for each fragment of Math.

Well as I see it we only need to declare the entities that are actually
emitted by itex2MML, not the full 2000? Is that right? If itex2MML emitted
the code for each entity in the pre-amble like...

 <entity name="alpha" value="&#x003B1;"/>
 <entity name="PartialD" value="&#x02202;"/>
 <entity name="Rightarrow" value="&#x021D2;"/>
 etc..

then GtkMathView would be happy?

I also assume that all of these are loaded into GtkMathView into some
memory structure. Is it possible to access that memory structure somehow?
I can see two solutions.

1. Massage the MathML produced by itex2MML by locating the enties and
adding the approppriate declarations to the MathML. ie add...

 <entity name="alpha" value="&#x003B1;"/>
 <entity name="PartialD" value="&#x02202;"/>
 <entity name="Rightarrow" value="&#x021D2;"/>

etc..

to the pre-amble of the MathML ourselves.

 The advantage of this is that know I exactly how to do it although it
will be tedious. If GtkMathView has these in some readily accessible form
it will make things much easier.

2. Fix itex2MML. Unfortunately this code is totally opaque to me. I can't
even find the part that reads/writes stdio. I'm CCing the author of the
program to see if he is interested writing the code to emit the unicode
values of the entities.

I would really like to get this fixed. The modeless Latex editor works
really well. If the editor is active clicking on a formula inserts the
latex representation into the editor. It's very easy to fix things in
formulae and although itex2MML could be more descriptive in it's error
messages, it easy to find determine of the latex is valid.

It's really easy to make copies of formulas. Visual Drag and drop of
formula's works really well.

All in all for a user with Latex knowledge this is the perfect way to put
Maths into documents. I can't wait to use it in ernest. I want to use it
write the lecture notes for my next course.

Cheers

Martin

>
> My opinion is that itex2MML should be fixed. In general, I try to avoid
> XML entities altogether, they're more often a source of trouble than
> really useful. I understand that the author made his life much easier
> (and the tool simpler) by converting any \alpha into &#945; without
> fooling around with thousands of Unicode numbers, but tweaking
> gtkmathview to work around itex2MML's deficiencies doesn't sound good to
> me. And, by the way, itex2MML's source code shows severe memory leaks
> and produces dozens of invalid memory accesses when run through
> valgrind.
>
> The very nice thing about itex2MML is that it's really small, in
> practice there is only one source file that one needs (the .y) so,
> provided all the above issues get fixed and the author gives permission,
> it seems like a trivial piece of code to copy&paste into the plugin.
>
>> > sure. The TeX fonts themselves are available as TTF. It is writing the
>> > backend for using them, and making it work for printing too, that is
>> not
>> > trivial. Unless we manage to open them and request specific glyphs
>> from
>> > them via the sole AbiWord interface to system fonts.
>> >
>>
>> We should be able to do that. I recall we used Symbol to get us started
>> because it was already widely available.
>
> Hope to look into that soon.
>
> --luca
>
>
Received on Tue Mar 8 00:35:56 2005

This archive was generated by hypermail 2.1.8 : Tue Mar 08 2005 - 00:35:57 CET