DITA 1.3 includes a built-in integration with the MathML standard for representing equations in XML. This presentation shows how to author Math equations in Microsoft Word using the MathType equation editor, then convert those word documents to DITA with embedded MathML markup, then use the open-source FOP tool produce PDF with the equations rendered. This process demonstrates a workflow that is being used today to produce PDFs of open-access journals from DITA source.
2. About the Author
• Independent consultant focusing on DITA
analysis, design, and implementation
• Doing SGML and XML for cough 30 years cough
• Founding member of the DITA Technical
Committee
• Founding member of the XML Working Group
• Co-editor of HyTime standard (ISO/IEC 10744)
• Primary developer and founder of the DITA for
Publishers project
• Author of DITA for Practitioners, Vol 1 (XML Press)
10/27/2014 Contrext, LLC 2
3. Agenda
• The challenge: authoring math and publishing
using DITA
• Demonstration
• The tools
• The process
10/27/2014 Contrext, LLC 3
4. Executive Summary
• DITA 1.3 integrates MathML out of the box
• FOP and Antenna House XSL Formatter both
support MathML rendering
• MathType for Word is a low-cost equation editor
that supports MathML
• The DITA for Publishers Word-to-DITA framework
supports getting MathML from Word
• All together it means low-cost, high-quality math
publishing with DITA
10/27/2014 Contrext, LLC 4
6. Use Case: Authoring in Word,
Generating DITA
• Authors use Microsoft Word to author the
content:
– Academic papers
– Technical standards
– Technical documentation with math
• Convert the Word to DITA using the DITA for
Publishers Word-to-DITA framework
• Need to get MathML equations from authors
10/27/2014 Contrext, LLC 6
7. Math is Hard
• Many ways to author math
• MathML is the only XML standard for math
• MathML not practical to author directly:
requires an authoring tool of some sort
• For XML use need a way to get MathML from
authors along with the XML
10/27/2014 Contrext, LLC 7
8. Rendering MathML
• Requires MathML-aware tools
• May be production quality issues depending
on the renderer chosen
• May need to generate images for some
delivery targets (e.g., EPUB and Kindle)
10/27/2014 Contrext, LLC 8
9. Word and MathType
• Word has a built-in equation editor
– It does not produce MathML directly
• The Design Science MathType Word plugin can
produce MathML directly
– Can cut and paste from MathType as MathML
– Can convert MathType binary equations to “inline
MathML”
• No other automated way to get MathML from
the MathType equations
10/27/2014 Contrext, LLC 9
10. DITA and MathML
• Before DITA 1.3, no out-of-the-box MathML
integration in DITA
• Integration doable, e.g. DITA for Publishers,
Design Science solutions
• Need to implement MathML handling in the
DITA Open Toolkit or other DITA tools
10/27/2014 Contrext, LLC 10
14. PDF Rendering: FOP and jEuclid
• Apache FOP is open-source XSL-FO engine
• When integrated with Apache jEuclid engine
renders MathML directly
• Rendition quality is good but may not be good
enough for some publications or equations
• To configure, just add jEuclid jar files to the
FOP installation
10/27/2014 Contrext, LLC 14
15. MathML in DITA
• DITA 1.3 integrates MathML out of the box
• This integration can be used with existing DITA 1.2 or
1.1 systems (not dependent on any other 1.3 features)
• Provides the <mathml> container for containing inline
MathML markup.
• Provides the <mathmlref> element for using MathML
markup by reference
• Provides elements for representing semantic equations
separate from the data format of the equations
• oXygenXML supports MathML in the editor and can
integrate with MathType
10/27/2014 Contrext, LLC 15
16. MS Word and MathType
• MathType is a low-cost Word plugin
– Visual editing of equations
– Can generate MathML
– Can convert binary MathType equations to “inline
MathML” in the word
– This conversion is not reversible
• Could also use Word’s proprietary equation
markup
– Not currently supported by the D4P Word-to-DITA
process
– But technically possible to convert to MathML
10/27/2014 Contrext, LLC 16
17. Word-to-DITA Framework
• Part of DITA for Publishers project
• Uses a style-to-tag-map to map Word styles to
DITA markup
• Supports translation of “inline” MathML to
MathML in the DITA
• Requires using MathType to convert binary
equations to inline MathML
10/27/2014 Contrext, LLC 17
19. 0. Set Up
• Set up the style-to-tag mapping for converting
Word to DITA
– D4P provides an out-of-the-box mapping for built-
in Word styles
– See DITA for Publishers User Guide for details
• Add the jEuclid libraries to your FOP
installation
• Add the DITA 1.3 MathML and equation
domains to your local topic type shells
10/27/2014 Contrext, LLC 19
20. 1. Author in Word
• Use Word with styles
• Use MathType to create equations
10/27/2014 Contrext, LLC 20
21. 2. Generate Inline MathML
• Use MathType to convert
MathType equations to inline
MathML
• May want to save DOCX file to
a new location
– Conversion is not reversable
– Makes the Word largely
unusable
10/27/2014 Contrext, LLC 21
22. 3. Generate DITA from The Word
Doc
• Run the D4P Word-to-DITA process
• Results in DITA XML
with MathML inline
10/27/2014 Contrext, LLC 22
23. 4. Produce PDF with FOP
• Use normal DITA Open Toolkit process to
generate PDF using FOP
• Equations should
be rendered
10/27/2014 Contrext, LLC 23
24. Bonus: MathML In HTML
• The open-source MathJax package renders inline
MathML in any Javascript-capable browser
• The DITA 1.3 MathML support includes
generation of HTML with MathJax references
• Some browsers render MathML directly:
– Firefox
– IE 10+ (I think)
• Google has dropped MathML support from
Chrome
10/27/2014 Contrext, LLC 24