There has been an effort in the past to extract mathematics from
latex. It seems that the usual latex markup does not carry enough
semantic information to disambiguate expressions.
Axiom has a similar problem occasionally where the interpreter
tries to guess and the compiler insists on type specifications.
Axiom provides an abbreviation for each type, such as FRAC for
Fraction and INT for Integer.
Might it be possible to create latex macros that take advantage
of this to provide unambiguous markup. For instance, instead of
\frac{3x+b}{2x}
we might have a latex markup of
\FRAC[\INT]{3x+b}{2x}
where there was a latex macro for each Axiom type. This would
turn into an latex \usepackage{AxiomType}
There would be a map from the \FRAC[\INT] form to the \frac
form which seems reasonably easy to do in latex. There would
be a parser that maps \FRAC[\INT] to the Axiom input syntax.
The problem would be to take the NIST Math Handbook sources
(is the latex available?) and decorate them with additional markup
so they could parse to valid Axiom input and valid latex input
(which they already are, but would validate the mapping back to
latex).
Comments?
Tim