Hard coded a precedence for formula input formats.

Now, mathml is prefered to tex, and an image if available is used as preview.