MathML equations in oXygen Author Web Component

Having trouble installing Oxygen? Got a bug to report? Post it all here.
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

MathML equations in oXygen Author Web Component

Post by yury.eroshenkov »

Hello,

I see some differences between Oxygen Standalone Editor and Oxygen Author Web Component (Applet) in mathml formulas visualization. For example, this content:

Code: Select all


<math type="presentation">
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"
display="block">
<mml:semantics>
<mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">a</mml:mi>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi mathvariant="bold">F</mml:mi>
</mml:mrow>
<mml:mi>m</mml:mi>
</mml:mfrac>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mo>[</mml:mo>
<mml:mi mathvariant="bold">E</mml:mi>
<mml:mo>+</mml:mo>
<mml:mfenced>
<mml:mrow>
<mml:mi mathvariant="bold">v</mml:mi>
<mml:mi>X</mml:mi>
<mml:mi mathvariant="bold">B</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mi>m</mml:mi>
</mml:mfrac>
</mml:mrow>
</mml:mrow>
</mml:semantics>
</mml:math>
</math>
is visualized in Standalone Editor(16.1) in author mode well as an image. But the author mode in the applet does not resolve this formula to an image and just shows a root math:ml tag.
Is it possible to integrate maybe some additional css-styles or libraries to the Web component to be able to present math formulas like in Standalone Editor?

Thanks,
Yury.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: MathML equations in oXygen Author Web Component

Post by Radu »

Hi Yuri,

You would need the JEuclid libraries added to the applet's JNLP.
If you are using the Maven-based 16.1 SDK you would need to add a dependency in the pom.xml:

http://www.oxygenxml.com/doc/ug-oxygen/ ... uclid.html

If you are using an older Author Component Project, your JNLP should contain additional references to the following libraries:

Code: Select all

        <jar href="lib/jeuclid-core.jar"/>
<jar href="lib/batik-all-1.7.jar"/>
<jar href="lib/commons-io-1.3.1.jar"/>
<jar href="lib/commons-logging-1.1.1.jar"/>
<jar href="lib/xmlgraphics-commons-1.5.jar"/>
You can take them from a standalone installation of Oxygen from the lib folder.
The extra JARs need to be signed along with the others.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

Re: MathML equations in oXygen Author Web Component

Post by yury.eroshenkov »

Thank you, Radu.
Another question: as i see, by default, neither Standalone Editor, neither Web Component does not resolve formulas from href links:

Code: Select all


<math type="presentation" href="../../mathml/numeric.mml" format="mathml"/>
Is it also possible?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: MathML equations in oXygen Author Web Component

Post by Radu »

Hi Yuri,

You could add to the CSS used to edit DITA content the selector:

Code: Select all

*[class~="math-d/math"][href]{
content:attr(href, url);
}
But of course this would only present the image for editing.
For publishing you would need to make separate changes.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yury.eroshenkov
Posts: 34
Joined: Mon Jun 03, 2013 2:17 pm

Re: MathML equations in oXygen Author Web Component

Post by yury.eroshenkov »

Thank you, Radu, for your quick and helpful response!
It works!

Best Regards,
Yury
Post Reply