Conserving Implicit Mathematical Semantics in Conversion between TEX and MathML
Stephen M. Watt · 2003
MathML[1] is an XML representation for mathematical objects, allowing expressions to be stored in databases, transmitted between applications and operated upon by programs. MathML can be used to express mathematical content in web pages and digital libraries, and has become an accepted form for input and output of computer algebra systems. There have been several efforts to design software for conversion of mathematical expressions from TEX to MathML and vice versa. We consider the problem of how conversion between formats can conserve any mathematical semantics implied by the markup of the original document. Both TEX and MathML admit macro mechanisms, natively so in TEX and via XSLT[2] with MathML. Authors may use pre-defined style-sheets or define their own abbreviations, effectively extending the vocabulary of the environment. Macros are typically used as shorthands for lengthy expressions or to maintain notational independence. A simple example of notational independence would be, e.g., to define \Vector to expand either to \mathbf{v} or \vec{v} or something else, depending on the style sheet used. Any serious converter between TEX and MathML must support macros. The standard approach has been to expand macros, and then perform the translation from low-level TEX to MathML (or vice versa). We see this approach as undesirable, as the use of macros in practice captures mathematical semantics within expressions. For example, if the form \BesselJ{\alpha}{z} expands to Jα(z), and translates to