<equation> tag when inserting MathML in Author

Oxygen general issues.
lascar
Posts: 3
Joined: Tue Jul 12, 2011 8:05 pm

<equation> tag when inserting MathML in Author

Post by lascar »

Greetings.

We have just configured MathFlow as default MathML editor for Oxygen 12.1

Our content is based on several levels of specialization of DITA.

When inserting MathML equations, the resulting XML is surrounded by <equation> tags. This does not work for us, since we have our own element (driven from DITA Learning Specialization) <lcEquation> - resulting in invalid XML.

Is there a way to configure oXygen not to wrap MathML with <equation> tags or replace then with <lcEquation>?

Thank you.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: <equation> tag when inserting MathML in Author

Post by Radu »

Hi,

Unfortunately the Author operation which inserts the equation is quite hard-coded and only inserts the <equation><math>.... wrapper tags.
We will discuss making it more flexible in order to be able to use it in a DITA specialization.

But you have several alternatives:

1) The easiest one would be to modify the default Author action for inserting a MathML equation in the Author page. In the Oxygen Preferences->Document Type Association page you can edit the DITA document type, in the Author tab go to the Actions category, edit the action called insert.equation and make it use an

Code: Select all

ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation
which takes as a parameter the XML fragment to insert which can be like:

Code: Select all


<lcEquation>
<math>

</math>
</lcEquation>
Then the operation will insert the XML fragment when pressed and you will be able to double click it to edit the MathML fragment in the MathFlow editor.

You can share your document type modifications with others:
http://www.oxygenxml.com/doc/ug-oxygen/ ... aring.html

2) You can also create a new code template in Oxygen which inserts the equation start formula (code template which will appear in the Author content completion window), use the code template to insert the equation and then again double click it to edit.

3) The editing support Oxygen offers for DITA is not hard coded but can be customized by using our Java Author SDK:
http://www.oxygenxml.com/developer.html ... horing_SDK
The SDK comes with the Java sources for all DITA operations which can be modified and re-packed in the dita.jar library.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
lascar
Posts: 3
Joined: Tue Jul 12, 2011 8:05 pm

Re: <equation> tag when inserting MathML in Author

Post by lascar »

Thank you.

For the 1st option, using "Developer" role I can't edit the arguments section. I can add them - but the little wrench icon stays disabled/grayed-out. How do I modify an argument for the operation to add my custom code?
lascar
Posts: 3
Joined: Tue Jul 12, 2011 8:05 pm

Re: <equation> tag when inserting MathML in Author

Post by lascar »

Actually - there are no arguments listed under "1" tab at all for this operation. So what I meant was - that I can add those number tabs(1,2,3) - but not arguments in them.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: <equation> tag when inserting MathML in Author

Post by Radu »

Hi,

So for option number (1) you should have chosen a new type of operation called:

Code: Select all

ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation
instead of:

Code: Select all

ro.sync.ecss.extensions.dita.topic.InsertEquationOperation
which indeed allows no parameters.

The customization should be like:

Image

If the customization is successful then you should be able to insert the MathML equation in the Author and then by double clicking it you should be able to edit it using the MathFlow equation editor.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply