Render Math Equations on iOS

I was wondering if there is an easy way to implement the rendering of mathematical equations in an iOS application. It does not have to be interactive. All he has to do is display the equation in the traditional ways, so when the user has to deal with complex equations, he simplifies.

ex. 2 ^ (2 / (6 ^ (1/2))) gives: Example output

Wolfram Alpha does this along with other applications that I have seen. It also does not have to deal with variables.

+6
source share
2 answers

UIWebView can display mathML with iOS5. Your example:

<math title="2^(2/(sqrt(6))" xmlns="http://www.w3.org/1998/Math/MathML"> <mstyle mathcolor="blue" fontfamily="sanserif" displaystyle="true"> <msup> <mn>2</mn> <mrow> <mfrac> <mn>2</mn> <mrow> <msqrt> <mrow> <mn>6</mn> </mrow> </msqrt> </mrow> </mfrac> </mrow> </msup> </mstyle> </math> 

This will display in the UIWebView on iOS.

There are javascript libraries that can convert for you - for example, mathjax can take ASCIIMath , for example, this example 2 ^ (2 / (sqrt (6))

Is there a good discussion here on these issues Compromise between LaTex, MathML, and XHTMLMathML in an iOS app?

+3
source

For simple expressions, the easiest way is to use HTML and display the expression in a UIWebView. This will work especially well if part of the expression of other content can also be displayed using HTML.

+1
source

All Articles