Re: Fixing itex2MML

From: Luca Padovani <lpadovan_at_cs.unibo.it>
Date: Tue Mar 08 2005 - 07:25:03 CET

On Tue, 2005-03-08 at 10:35 +1100, msevior@physics.unimelb.edu.au wrote:
> 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?

yes, you are 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?

the file entities-table.xml gives you the correspondence, the actual
syntax to be used is somethink like

  <!ENTITY alpha "&#x003B1;">
  ...

but anyway yes, after doing this, gtkmathview (well, libxml2) will 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?

only when using the GmetaDOM frontend, 'cause that's the only frontend
that can be cheated about undeclared entities. The other frontends
(including the one used by the abimath plugin) don't include the table
to save memory

> 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.

As far as I understand itex2MML's source code, this should be a trivial
matter. Each time a macro of the form \xyz is found which is not treated
specially (like \frac or \underline, etc.) it should lookup into an
entities table and find out what the expansion is. A command line option
might just switch itex2MML behavior so that it can output either
entities _or_ Unicode on request.

> 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.

Very nice job Martin!

Yours
--luca

Received on Tue Mar 8 07:25:49 2005

This archive was generated by hypermail 2.1.8 : Tue Mar 08 2005 - 07:25:50 CET