As a developer, an iPhone app that does just that , trust me when I say that typing equations are not a trivial thing. In my case, I used Core Animation layers to build sub-elements of the analyzed equation. The equations are hierarchically constructed, and the operations that make them up are laid out as such. Each operation is contained in its parent working layer and is set in accordance with the rules of this particular operation.
To visualize the elements within the equation, I used Quartz to draw lines, characters, etc., but most of the drawing was just text drawn inside CALayer, using the NSString text drawing extensions.
I redefined the standard CALayer rendering architecture for generating PDF files from these equations, because CALayers do not display vector elements by default. For an example of how this rendering works in my application, see the Core Plot project, which does the same thing at its basic level.
I deduced in LaTeX from the equations that it is quite simple after you have analyzed them in a hierarchical data structure, but parsing them from LaTeX into this structure will be a little more complicated.
To enter and evaluate simple text equations, you can find Graham Cox GCMathParser .
Brad larson
source share