Re: Permission to commit Latex equation editor?

From: <msevior_at_physics.unimelb.edu.au>
Date: Mon Mar 07 2005 - 14:42:30 CET

> On Mon, 2005-03-07 at 09:48 +1100, msevior@physics.unimelb.edu.au wrote:
>> http://www.ph.unimelb.edu.au/~msevior/abiword/LatexMathSS1.png
>>
>> The biggest problem is that GtkMathView is very fragile and lacks
>> support
>> for many valid MathML entities right.
>
> at the moment GtkMathView is fragile in several ways. When you say
> "entities", what do you mean?
>
> If you mean XML entities like &#945; &RightArrow; and so on, these are
> supported, provided that you declare them in the XML fragments that use
> them. If you use an XML entity without declaring it, that is not even a
> well-formed XML document and the XML parser fails before GtkMathView can
> do anything about it. If you were using the GmetaDOM frontend, there is
> a trick to fool the XML parser and have it recognize MathML entities
> even if they are not declared, but it doesn't work with the libxml2
> frontend currently used by the abimathview plugin (and it is a trick
> anyway...)
>
> In place of these entities, you can always use the corresponding
> character references instead. So you would write &#945; instead of
> &#945; and so on (U+03B1 is the Unicode for Greek alpha). Character
> refrences are all supported, there is no need to declare them. However,
> you must have the proper font to display the characters you want. The
> abimathview plugin only provides characters found in the symbol font,
> plus the normal ASCII characters. This means that a lot of math symbols
> cannot be displayed. To fix this, I should restore the backend for, say,
> TeX fonts. But then, it's not clear how to interface it with the AbiWord
> graphic class and my biggest fear is that printing would not work just
> "out of the box" as it does now. This is quite some work that has to be
> done carefully, since most of the code is independent of AbiWord and I'd
> like to reuse it even when gtkmathview is not used as a plugin.

Ah, this is exactly what is happening. Here is an example:

Input expression:

\[ \vec{\nabla}\times \vec{E} =
\hat{x}(\frac{\partial E_{x}}{\partial y}-\frac{\partial E_{y}}{\partial
z}) +
\hat{y}(\frac{\partial E_{x}}{\partial z}-\frac{\partial E_{z}}{\partial x})+
\hat{z}(\frac{\partial E_{y}}{\partial x}-\frac{\partial E_{x}}{\partial
y} \]

Output MathML:

<math xmlns='http://www.w3.org/1998/Math/MathML' mode='display'>
<mover><mrow><mo lspace="0em" rspace="thinmathspace">nabla</mo>
</mrow><mo>&RightVector;</mo></mover>
<mo>&times;</mo><mover><mrow><mi>E</mi>
</mrow><mo>&RightVector;</mo></mover><mo>=</mo><mover><mrow><mi>x</mi>
</mrow><mo>&Hat;</mo></mover><mo>(</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>x</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>y</mi></mrow></mfrac><mo>-</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>y</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>z</mi></mrow></mfrac><mo>)</mo><mo>+</mo><mover><mrow><mi>y</mi>
</mrow><mo>&Hat;</mo></mover><mo>(</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>x</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>z</mi></mrow></mfrac><mo>-</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>z</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>x</mi></mrow></mfrac><mo>)</mo><mo>+</mo><mover><mrow><mi>z</mi>
</mrow><mo>&Hat;</mo></mover><mo>(</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>y</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>x</mi></mrow></mfrac><mo>-</mo><mfrac><mrow><mo>&partial;</mo>
<msub><mi>E</mi> <mrow><mi>x</mi>
</mrow></msub></mrow><mrow><mo>&partial;</mo>
<mi>y</mi></mrow></mfrac>
</math>

I can think of a couple of solutions.

1. write a post-MML parse to convert all the entities to unicode. I'd just
need access to the latex book and I could write up a mapping pretty
quickly.

2. Send bug reports to the itex2MML authors.

I'll start with solution 2 :-)

Regarding the font issues, I believe that there are some quality math TTF
available. We could ship these along with AbiWord provided it doesn't
violate license.

I'll look into this too.

Cheers

Martin

>
> I have never used itex2MML, but perhaps there is an option to force it
> output character references instead of entities?
>
> Cheers,
> --luca
>
>
Received on Mon Mar 7 14:42:27 2005

This archive was generated by hypermail 2.1.8 : Mon Mar 07 2005 - 14:42:28 CET