jgm/pandoc — pull request #1494 by jkr (2014-08-07 16:34:55+00:00)
Title: Math module

This moves the math parsing logic (OMML -> Docx, Docx- > Exp) into its own module, Text.Pandoc.Reader.Docx.OMath. This is independent of the Docx parser. The idea is for the OMath module (after some cleanup and streamlining) to move to TeXMath, for the purpose of OMML->TeXMath conversion. The change is entirely internal -- there should be no alteration in behavior or output.

The OMML math types are now internal to the OMath module (and can probably eventually be done away with). In the parser's Docx type, OMathPara and OMath now just contain TeXMath exps. All the actual reader has to do is apply `writeTeX`.

The previous concern about the necessity of parsing the full OOXML tree here is, I think, unfounded. Elements can have runs, but runs are limited in what they contain. At the moment, it should work similarly to the way we handle tex math including tex expressions. There isn't much code duplication, though a few of my xml convenience functions are in both the parser and the OMath module.

Note that this pr is on top of #1493, so that should be applied first.