MathEditor
MathEditor copied to clipboard
How do you get the raw Latex from the MTEditableMathLabel?
How do you get the raw Latex from the MTEditableMathLabel if it is possible. I didnt find any label.text member
You can access the text like this:
label.mathList.stringValue
@erikchen93 That is not correct. stringValue
is not LaTeX.
The correct LaTeX version is
[MTMathListBuilder mathListToString:label.mathList]
Also unofficially (private API): [label label].latex
Marking as enhancement to add public API to get latex.
Thanks for help! [MTMathListBuilder mathListToString:label.mathList] works perfectly :)
I am testing this project using swift 3. Here is the code for getting LaTex form from the keyboard input: let a = MTMathListBuilder.mathList(toString: math_label.mathList) print(a) //output latex
I am also wondering how can I predefine the input string and use MTEditableMathLabel to display it?
something like this in IOSmath: let text = "some latex and normal texts" Math_label.latex = text