Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

25
Word, MathType, DITA, MathML, and FOP Doing Math With DITA and Word 10/27/2014 Contrext, LLC 1

Transcript of Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

Page 1: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

Word, MathType, DITA, MathML, and FOP

Doing Math With DITA and Word

10/27/2014 Contrext, LLC 1

Presenter
Presentation Notes
The materials are available here:��http://github.com/drmacro/conference_papers/tree/master/soap-2014-mathml-and-word
Page 2: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 3: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

Agenda

• The challenge: authoring math and publishing using DITA

• Demonstration

• The tools

• The process

10/27/2014 Contrext, LLC 3

Page 4: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 5: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

THE CHALLENGE: AUTHORING MATH AND PUBLISHING USING DITA

10/27/2014 Contrext, LLC 5

Page 6: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 7: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 8: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 9: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 10: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 11: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

DEMONSTRATION

10/27/2014 Contrext, LLC 11

Page 12: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

Demonstration

• Real process for scientific journal articles

10/27/2014 Contrext, LLC 12

Page 13: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

THE TOOLS

10/27/2014 Contrext, LLC 13

Page 14: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 15: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 16: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 17: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 18: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

THE PROCESS

10/27/2014 Contrext, LLC 18

Page 19: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 20: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

1. Author in Word

• Use Word with styles

• Use MathType to create equations

10/27/2014 Contrext, LLC 20

Page 21: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 22: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 23: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 24: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

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

Page 25: Eliot Kimber - Math ML with MathType, Word, DITA and FOP; soapconf 2014

Resources

• DITA 1.3 spec: ???

• DITA for Publishers: http://www.dita4publishers.org

• MathType: http://www.dessci.com

• FOP: http://xmlgraphics.apache.org/fop/

• Me: [email protected], http://contrext.com

10/27/2014 Contrext, LLC 25