jgm/pandoc — pull request #1397 by jkr (2014-07-02 21:09:54+00:00)
Title: Docx Reader: Parse Docx OMML math/equations

This is a fairly large push that adds the ability to parse omml equations (both inline and paragraph) from word. It outputs LaTeX, so it is, in theory, compatible with TeXMath. Early experiments have been pretty good. The following input file is a collection of Word's commonly used suggestion equations

http://commonmeasure.org/~jkr/equation_input.docx

without any alteration, going to html with the `--mathml` tag, we get the following

http://commonmeasure.org/~jkr/equation_output.html

...so, essentially perfect. Not everything is so perfect. I haven't tested everything with TeXMath, but everything does at least compile in LaTeX, given two caveats:

1. unicode chars that don't have any correlation in LaTeX (e.g. ≝) are silently skipped. In the future, it would be nice to get a list of the symbols word uses or allows in its equation editor, and find/make substitutions for them.

2. Some more esoteric LaTeX commands are sent through (`\oiiint`, i.e., ∰). These can't be compiled with the default preamble, but can be with `mathdesign` or the like. If someone wants these commands, I figured they should be able to have them. It does mean, though, that some docs won't be able to go straight to PDF.

Tests are forthcoming.