SwiftMath icon indicating copy to clipboard operation
SwiftMath copied to clipboard

Cannot render command "iint" and "iiint"

Open NKU915 opened this issue 10 months ago • 2 comments

I cloned SwiftMathDemo and try to render LaTex, code as below (this first of demoLabels is mine).

struct ContentView: View {
    
    /// Set to *true* to preview the fonts
    let previewFonts = false
    
    let demoLabels = [
        "\\iint_{S} \\mathbf{F} \\cdot d\\mathbf{S} = \\iiint_{V} \\nabla \\cdot \\mathbf{F} \\, dV",
        
		"x_i\\in[-1{,}5;1,5]",
		"\\text{Accented characters: áéíóúýàèìòùâêîôûäëïöüÿãñõ}",
		"\\text{Special: çøåæœß'ÇØÅÆŒ}",
		"\\text{Uppercase: ÁÉÍÓÚÝÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÃÑÕ}",
		"\\text{Accents: \\hat{o}, \\check{o}, \\tilde{o}, \\acute{i}, \\grave{o}, \\ddot{o}, \\dot{o}, \\breve{o}, `, \", \\upquote}, \\aa",
        "\\text{Quadratic roots: }x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}",

Mine didn't get rendered: Image

I trie to render it in my project and the following error raised:

...  Error Domain=ParseError Code=2 "Invalid command \iint" UserInfo={NSLocalizedDescription=Invalid command \iint}

I can render this on http://www.texrendr.com , I don't know it is a bug or I need do extra to make it work.

Image

NKU915 avatar Apr 09 '25 15:04 NKU915

"iiint" : MTMathAtomFactory.operatorWithName( "\u{222D}", limits: false),

Zheng-Hongyi avatar Apr 18 '25 09:04 Zheng-Hongyi

"iiint" : MTMathAtomFactory.operatorWithName( "\u{222D}", limits: false),

You mean adding the line to the var supportedLatexSymbols of MTMathAtomFactory.swift, right?

NKU915 avatar Apr 18 '25 10:04 NKU915