Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display complex fractions in Objective C: NSString? NSAttributedString?

Is it possible to display fractions using any of the NSString-like classes in Cocoa?

For example I would like to display the fraction (x+2)/(x-4) as an NSString where (x+2) is sitting above a line above the expression (x-4). Here's an image of a more complicated example:

enter image description here

I can already think about how to do so using a bunch of NSViews, but was wondering if there's a better way of doing it.

like image 565
schmudu Avatar asked Feb 22 '26 01:02

schmudu


1 Answers

You can use a UIWebView instance and the opensource MathJax library to render your math code written in proper TeX.