On 01/03/2012 10:58 AM, Philippe Nobili wrote:

We are facing an issue with MathML image plugin (all XXE versions); we
insert MathML equations in our DocBook-4 documents using the MathML
image plugin.

This works fine in general, but gives sometimes incorrect or difficult
to read results (from a mathematical point of view). As an example, I
attached a small file containing a MathML equation (*eq_morlt_1.mml*).

*eq_image_mathml.jpg*: The equation looks very good when edited in
XMLMind using XXE MathML editor (very efficient & easy to use BTW).

*eq_image_db4.jpg*: But looks ugly when inserted as an image in a
DocBook-4 document.

Not surprisingly (but unfortunately), the result in our final PDF
document looks like the second image.

It's JEuclid (http://jeuclid.sourceforge.net/) which is used to convert MathML to PNG and to PDF (JEuclid serves as a FOP plug-in).

It's possible to uninstall the JEuclid add-on in order to fallback to XMLmind MathML add-on as a MathML renderer. However I would not recommend doing this.




Is there any way to improve this situation ?

Your equation looks ugly because sometimes you need to adjust slightly by hand what has been generated by XXE's MathML Editor to get it right.

For example, using XXE:

[1] I've selected the first <msup> element and used the Attributes tool to specify superscriptshift="2ex". See http://www.w3.org/TR/MathML2/chapter3.html#presm.msup

[2] Did the same with the second <msup> element.

[3] Finally, I've selected the first <msup> and using the Edit tool, I've inserted after it an <mspace> element.

This gave me attached eq_morlt_1.mml

When converted to PDF, the result seems to be acceptable. See attached eq_morlt_1-pdf.png
<?xml version="1.0" encoding="ISO-8859-1"?>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xmlns:xs="http://www.w3.org/2001/XMLSchema";
      xmlns:xlink="http://www.w3.org/1999/xlink";
      xmlns:ns="http://www.w3.org/1998/Math/MathML";>
  <mrow>
    <mrow>
      <msub>
        <mi>g</mi>
        <mi>t</mi>
      </msub>
      <mrow>
        <mo>(</mo>
        <msub>
          <mi>f</mi>
          <mi>c</mi>
        </msub>
        <mo>)</mo>
      </mrow>
    </mrow>
    <mo>=</mo>
    <mrow>
      <msup superscriptshift="2ex">
        <mi>e</mi>
        <mrow>
          <mrow>
            <mo>-</mo>
            <msup>
              <mrow>
                <mo>(</mo>
                <mfrac>
                  <mrow>
                    <msub>
                      <mi>2f</mi>
                      <mi>c</mi>
                    </msub>
                    <mo>t</mo>
                  </mrow>
                  <mi>k</mi>
                </mfrac>
                <mo>)</mo>
              </mrow>
              <mi>2</mi>
            </msup>
          </mrow>
          <mo>log2</mo>
        </mrow>
      </msup>
      <mspace width="0.5em"/>
      <msup superscriptshift="2ex">
        <mi>e</mi>
        <mrow>
          <msub>
            <mi>2&#960;if</mi>
            <mi>c</mi>
          </msub>
          <mi>t</mi>
        </mrow>
      </msup>
    </mrow>
  </mrow>
</math>

<<attachment: eq_morlt_1-pdf.png>>

 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to