Getting MathML to work in 3.3.4 toolkit

112 views
Skip to first unread message

Martin Pipho

unread,
Jan 11, 2023, 5:42:12 PM1/11/23
to DITA-OT Users
Hi everyone,

I've been following the directions in MathML in PDF output in DITA 3.1 with partial success. Here is what I've done so far:
  1. Add dita-community plugins (modified per Radu's instructions)
  2. Add JEuclid libraries to "plugins\org.dita.pdf2.fop\lib"
  3. Add Batik 1.9 libraries to  "plugins\org.dita.pdf2.fop\lib"
  4. Modified plugins\org.dita.pdf2.fop\plugin.xml to remove reference to batik 1.10, then add references to JEuclid and batik 1.9 libraries.
  5. Added saxon-9.1.0.8.jar and saxon-9.1.0.8-dom.jar to "dita-ot\lib". I found these libraries in the 2.5.4 toolkit.
  6. Run dita --install. The dita-community plugins show as added.
When I publish I get an error. From the log file, the relevant part (I think) follows: 
parsing buildfile C:\Users\mpipusb\dita-ot-3.3.4\plugins\org.dita.base\build.xml with URI = file:/C:/Users/mpipusb/dita-ot-3.3.4/plugins/org.dita.base/build.xml
Error: The prefix "if" for attribute "if:set" associated with an element type "param" is not bound.


Running dita --install with the saxon 9.1.0.8 jars seems to cause problems in the 3.x toolkit. I can get publishing to work if I do the following workaround:
  1. Remove saxon-9.1.0.8.jar and saxon-9.1.0.8-dom.jar from "dita-ot\lib".
  2. Run dita --install again.
  3. Manually put the saxon-9.1.0.8.jar and saxon-9.1.0.8-dom.jar back into "dita-ot\lib".
  4. Publish. Success! I get a PDF with MathML.

This workaround is not really ideal, however. Am I missing something? Do I need further modifications for these saxon jars? Shanta mentions something about adding dependencies for the saxon jars to a plugin.xml.

Thanks!

Martin

Radu Coravu

unread,
Jan 12, 2023, 2:27:34 AM1/12/23
to Martin Pipho, DITA-OT Users
Hi Martin,

What DITA OT version are you using? Is it 3.7, 4.0 or some older version?
That discussion thread you are following is 4 years old. It was not updated to take into account newer DITA OT versions.
Why did you attempt to add the Saxon 9 libraries to the DITA OT?
The "dita-comunity" plugins are not maintained and need to be slightly changed I think.
Our commercial Oxygen Publishing Engine is based on DITA OT 3.7, it contains the DITA community plugins plus the JEuclid JAR library:
Maybe you can download it, remove from the "DITA-OT\plugins" folder all "com.oxygenxml.*" folders which are commercial, run the integrator and then try to use it for publishing.
You can also compare the "dita-comunity" plugins bundled with our publishing engine with the ones downloaded from the project web site, we made various changes to the ones we are bundling along the way.


Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/4b9d8c85-eb23-4605-ad83-2e65f3c32fb0n%40googlegroups.com.

Martin Pipho

unread,
Jan 13, 2023, 3:28:46 PM1/13/23
to Radu Coravu, DITA-OT Users
Thanks Radu! The dita-community plugins from the Oxygen Publishing Engine solved the problem.

In case it's helpful to anybody, this was what I did to get MathML for PDF working in dita-ot-3.3.4.
  1. Add the following dita-community plugins from oxygen-publishing-engine-3.x. No modifications were necessary.
  • org.dita-community.common.xslt
  • org.dita-community.dita13.html
  • org.dita-community.dita13.pdf
  1. Add the following JEuclid libraries to "plugins\org.dita.pdf2.fop\lib" from the jeuclid-3.1.9-distribution.
  • jeuclid-core-3.1.9.jar
  • jeuclid-fop-3.1.9.jar
  1. Add Batik 1.9 libraries to  "plugins\org.dita.pdf2.fop\lib" from a dita-ot-3.0.
  2. Modified "plugins\org.dita.pdf2.fop\plugin.xml" to add references to the JEuclid and Batik 1.9 jars. Removed reference to Batik 1.10.
  3. dita --install

Martin

Kate Lopresti

unread,
Oct 30, 2023, 8:58:01 PM10/30/23
to DITA-OT Users
Thanks Martin and Radu for this exchange. I just got MathML to work for our team (DITA-OT version 3.7.3). 

Kate Lopresti

unread,
Mar 19, 2024, 10:56:17 PMMar 19
to DITA-OT Users
All, 
These instructions worked great for the equations in our standard PDF plugin. However, equations don't appear for the plugin that “points to” or is based on the standard. Both of these custom plugins require the "org.dita.pdf2.fop" plugin. Any idea why the disconnect? 
Thanks,
Kate

Radu Coravu

unread,
Mar 20, 2024, 1:39:29 AMMar 20
to Kate Lopresti, DITA-OT Users
Hi Kate,
You are on your own here I'm afraid. You need to debug the problem.
For example: Set the parameter "clean.temp" to "no" and publish a simple map containing a single topic with an equation to PDF using your custom plugin, after publishing look in the transformation temporary files folder at the "topic.fo" file, does it contain the proper MathML equation inside it? If it does not, then the XSLT stylesheets need to be debugged further, there are XSLT templates which match the MathML element in the "dita-comunity" plugins, you need to add maybe xsl:messages inside them, see if they get called. If the topic.fo contains the equation, then the problem is later on when the PDF processor creates the PDF. What PDF processor are you using? Is it the stock Apache FOP or is it Antenna House or RenderX XEP? You should also probably get some errors in the command line output from the PDF processor when it encounters the equation and cannot properly handle it.

Regards,
Radu

Kate Lopresti

unread,
Mar 20, 2024, 11:32:53 AMMar 20
to DITA-OT Users
Hi Radu, 

Thanks for the quick response and guidance. It's helpful to know I'm not missing something obvious. Will dig into it and post if I find anything helpful. 

-Kate

Kate Lopresti

unread,
Mar 20, 2024, 12:34:59 PMMar 20
to DITA-OT Users
PS We're using Apache FOP

Kate Lopresti

unread,
May 30, 2024, 1:05:53 PMMay 30
to DITA-OT Users
Hi Radu, 

In case you or others are interested, I found the issue with equestion not appearing.  
  • Equations appeared for the plugin that has stylesheet overrides in custom.xsl files.  
  • Equations did not appear for the plugin that has stylesheet overrides in a custom topic2fo.xsl file. 
What was missing from my topic2fo.xsl was this import to the community plugins. Once added, problem fixed! 

<xsl: import mandritta=http://dita-ot.sourceforge.net href="plugin:org.dita-community.common.xslt:xsl/commonXsltExtensionSupport.xsl"/>

<xsl: import href="plugin:org.dita-community.dita13.pdf:xsl/dita13Vocab2Pdf.xsl"/>

Thanks for the guidance. 
Also hat tip to my colleague Josh for helping to debug. 

Radu Coravu

unread,
May 30, 2024, 11:03:07 PMMay 30
to Kate Lopresti, DITA-OT Users
Hi Kate,
I'm glad you managed to make that work!
Regards,
Radu

Reply all
Reply to author
Forward
0 new messages