MathML in PDF output in DITA 3.1

255 views
Skip to first unread message

Armin Secibovic

unread,
Oct 9, 2018, 12:30:29 PM10/9/18
to DITA-OT Users

I am trying to use DITA-OT 3.1 for rendering equations. I have been successful in doing so for HTML5 output thanks to explanations here: https://groups.google.com/forum/m/#!topic/dita-ot-users/eN8CdQNTdMM.
But now i need the same thing for PDF output.

Is there a solution for DITA 3.1?
Is there a plan for DITA-OT to support MathML equations out of the box?

Thanks for the help

Radu Coravu

unread,
Oct 10, 2018, 2:28:02 AM10/10/18
to arminse...@gmail.com, DITA-OT Users
Hi,

There is a DITA OT opened issue to support MathML but it has not yet been done:

For PDF output you would need to add and install this extra DITA OT plugin:


The plugin would need to be slightly changed as it was not built for DITA OT 3.x, you would need to edit the XSLT stylesheet "org.dita-community.dita13.pdf\xsl\dita13Vocab2Pdf_template.xsl" and remove references to the "dita13base2fo.xsl", "hi-d2fo.xsl", "svg-d2fo.xsl", "xml-d2fo.xsl" because those XSLT fixes are already incorporated in the DITA OT.

Then you would need to get the Apache JEuclid libraries:

add two two JAR libraries to the folder "plugins\org.dita.pdf2.fop\lib" and modify the " plugins\org.dita.pdf2.fop\plugin.xml" to add references to the two new JAR libraries.
Then run the DITA OT integrator "dita -install".
But there is a problem, DITA OT 3.1.2 updated the Batik library bundled in the "org.dita.pdf2.fop\lib" folder to version 1.10 is no longer compatible with JEuclid.
So you would need to replace the Batik 1.10 with the equivalent Batik 1.9 libraries and update again the plugin.xml. (DITA OT 3.1.1 still came with the Batik 1.9 libraries so you can use the Batik 1.9 JAR libraries from it).

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.
For more options, visit https://groups.google.com/d/optout.

Armin Secibovic

unread,
Oct 18, 2018, 7:07:21 AM10/18/18
to DITA-OT Users
Hi Radu

Thank you for your help.

But in your post you frogot to mention which libraries need to be copied.
add two two JAR libraries to the folder "plugins\org.dita.pdf2.fop\lib" and modify the " plugins\org.dita.pdf2.fop\plugin.xml" to add references to the two new JAR libraries.

I am running DITA-OT version 3.1 so maybe the last step about " DITA OT 3.1.2" could be skipped.

Tnx

Radu Coravu

unread,
Oct 18, 2018, 8:42:27 AM10/18/18
to Armin Secibovic, DITA-OT Users
Hi,

The JAR libraries should be "jeuclid-core-3.1.9.jar" and "jeuclid-fop-3.1.9.jar".

Regards,
Radu
Message has been deleted
Message has been deleted

Armin Secibovic

unread,
Oct 19, 2018, 5:55:20 AM10/19/18
to DITA-OT Users
Hi

This worked for me thank you very much.

Here is what other things I needed to do to make this work on (DITA-OT version 3.1.3):
  • in addition to Radu's suggested plugin "dita -install" required me to also install "org.dita-community.common.xslt", "org.dita-community.dita13.html".
  • copy "saxon-9.1.0.8.jar" and "saxon-9.1.0.8-dom.jar" to "C:\test\dita-ot-3.1.3\lib"
    • if these files were missing i constantly got this error "C:\test\dita-ot-3.1.3\plugins\org.dita.pdf2\build.xml:288: java.lang.RuntimeException: Failed to compile stylesheet 'C:\test\dita-ot-3.1.3\plugins\org.dita.pdf2.fop\xsl\fo\topic2fo_shell_fop.xsl': net.sf.saxon.s9api.SaxonApiException: Errors were reported during stylesheet compilation"

Shantanu Gupta

unread,
Apr 8, 2021, 5:47:48 PM4/8/21
to DITA-OT Users
Following Armin's response, I am able to execute dita in Windows.

But the same thing does not work in Unix.

Any suggestions?

Shantanu Gupta

unread,
Apr 12, 2021, 12:51:19 PM4/12/21
to DITA-OT Users
For anybody referring to this thread in future, I needed to add the dependency to the lpaugin.xml for the saxon JARs.
Reply all
Reply to author
Forward
0 new messages