iOS app development.Is there a way to display formulas in text on the screen?

Asked 2 years ago, Updated 2 years ago, 73 views

I'm developing an iPhone app.I'd like to display a formula on a screen, but I'd like to display it as text instead of img. Is there any good way?

ios xcode

2022-09-30 20:50

2 Answers

By default, you cannot paste formulas directly into text.
Word and others have the ability to handle mathematical expressions, but they are included with the word processor, not the text itself.
Compilation software, such as LaTeX, displays formulas by storing text containing formula information (for example, \frac{A}{B}) in text format and rendering it.
Therefore, if the intention of the question is to save the formula as text and display it as a formula on iOS, it will be difficult to implement it on your own.
If you've decided which formula to display in advance, it's probably the easiest way to make it into an image format.
If you want to handle more complex formulas (e.g., creating a function calculator), MathJax
can render formulas in LaTeX format with a web browser + Javascript https://www.mathjax.org/
Since there is , I think it is better to use it.You can probably use it on WebView.


2022-09-30 20:50

There's nothing you want.UILabel and UITextView do not include the ability to display formulas.Do you want to view images using NSAString?I think it's better to use either WebView or one of them.


2022-09-30 20:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.