XSweet 2.0 – now with math!

Alex Theg Dec 20, 2018

We’re pleased to announce the release of XSweet 2.0, Coko’s docx-to-HTML conversion tool. XSweet is a highly customizable, modular tool for converting MS Word files (.docx) into HTML for publishing to the web, or importing into other platforms. Coko uses XSweet to import author Word files into its book production and journals platforms, and XSweet 1.0 was released in May of this year.

So, what’s new with 2.0?

The most exciting new feature is extraction of math from Word into HTML. Math in Word comes in many formats: LaTeX, plain text, Office MathML, images (gasp), and more. With this release, XSweet captures equations created with Word’s built-in equation tool (Office MathML format, to be specific) and passes them through to the HTML as MathML, the most useful format for math on the web. Not all browsers treat MathML exactly the same, but Javascript libraries such as MathJax can standardize how equations look in browsers.

If you’re interested to test out the math extraction and see how it works, try it out! We’ve tested it, but always rely on the community letting us know what they see, too. Especially if you find bugs, let us know by creating an issue on the repository here. Including the file you used, as well as as much detail as you can about what you see, is the best way to help us make this better.

Other notable improvements to XSweet 2.0 include but are not limited to:

  • Optional plain-text numbered list detection and tagging
  • Basic image handling (with local image reference by path)
  • Fixes for automated copyediting macros
  • Updated outline-level handling to separate semantic data from element styling
  • Bug fixes

We’ll continue to make improvements to XSweet in the coming year. Soon, we’ll be looking into how we can handle certain citation formats.

If you’d like to know more or have a conversation with us, please reach out! We’d encourage you to say hi on the Coko chat (Mattermost), and you can find me at alex@coko.foundation.

Many thanks to Wendell Piez, the XSLT expert who’s built XSweet from the ground up. Not only has he brought years of experience to this project, he has been generous with his time in explaining how things work as I’ve dipped a toe into the code myself.

Comprehensive documentation can be found at xsweet.coko.foundation, and the code repositories can be viewed at gitlab.coko.foundation/XSweet.

About the Author

Alex Theg

Posts by this author