Closed maxgiraldo closed 2 years ago
Here is an example SwiftUI view to reproduce the bug:
import SwiftUI
import iosMath
struct MathText: UIViewRepresentable {
let latex: String
func makeUIView(context: UIViewRepresentableContext<MathText>) -> MTMathUILabel {
let label = MTMathUILabel()
label.textAlignment = .center
return label
}
func updateUIView(_ uiView: MTMathUILabel, context: UIViewRepresentableContext<MathText>) {
uiView.latex = latex
}
}
#if DEBUG
struct MathText_Previews: PreviewProvider {
static let sample = "3z+20 > −99z+3"
static var previews: some View {
return (
VStack {
MathText(latex: sample)
.fixedSize()
}
)
}
}
#endif
Here is what the preview looks like:
If I use the following LaTeX:
3z+20 > −3z+1
Then it renders as:
Notice that the
-3z
renders as3z
Does anyone know why that is? If I delete the negative sign and then re-add it, then sometimes it will render.
Hi, please remove − sign which is in front of 3z and replace with your minus sign in keyboard Note: (-) and (−) signs seem different. The first sign works.
Thanks @akardas16. Resolved by using UTF-8 hyphen-minus (U+002D) and not minus (U+2212)
If I use the following LaTeX:
3z+20 > −3z+1
Then it renders as:
Notice that the
-3z
renders as3z
Does anyone know why that is? If I delete the negative sign and then re-add it, then sometimes it will render.