From fe00c5a96e4db3c70615e805b17a527728e94fc6 Mon Sep 17 00:00:00 2001 From: Nicolas Guillot Date: Wed, 1 Oct 2025 10:30:03 +0200 Subject: [PATCH] add iiiint LaTeX command support --- .../MathRender/MTMathAtomFactory.swift | 1 + .../SwiftMathTests/MTMathListBuilderTests.swift | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftMath/MathRender/MTMathAtomFactory.swift b/Sources/SwiftMath/MathRender/MTMathAtomFactory.swift index fc4d9ff..81f0d4c 100644 --- a/Sources/SwiftMath/MathRender/MTMathAtomFactory.swift +++ b/Sources/SwiftMath/MathRender/MTMathAtomFactory.swift @@ -331,6 +331,7 @@ public class MTMathAtomFactory { "int" : MTMathAtomFactory.operatorWithName( "\u{222B}", limits: false), "iint" : MTMathAtomFactory.operatorWithName( "\u{222C}", limits: false), "iiint" : MTMathAtomFactory.operatorWithName( "\u{222D}", limits: false), + "iiiint" : MTMathAtomFactory.operatorWithName( "\u{2A0C}", limits: false), "oint" : MTMathAtomFactory.operatorWithName( "\u{222E}", limits: false), "bigwedge" : MTMathAtomFactory.operatorWithName( "\u{22C0}", limits: true), "bigvee" : MTMathAtomFactory.operatorWithName( "\u{22C1}", limits: true), diff --git a/Tests/SwiftMathTests/MTMathListBuilderTests.swift b/Tests/SwiftMathTests/MTMathListBuilderTests.swift index accc7c9..b051a38 100644 --- a/Tests/SwiftMathTests/MTMathListBuilderTests.swift +++ b/Tests/SwiftMathTests/MTMathListBuilderTests.swift @@ -2286,12 +2286,25 @@ final class MTMathListBuilderTests: XCTestCase { var error: NSError? = nil let list = MTMathListBuilder.build(fromString: latex, error: &error) - if list == nil || error != nil { - throw XCTSkip("Multiple integral symbols (\\iint, \\iiint) not implemented: \(desc). Error: \(error?.localizedDescription ?? "nil result")") + if let err = error { + XCTFail("ERROR: \(err.localizedDescription)") + } else if list == nil { + XCTFail("List is nil but no error") } let unwrappedList = try XCTUnwrap(list, "Should parse: \(desc)") + XCTAssertNil(error, "Should not error on \(desc): \(error?.localizedDescription ?? "")") XCTAssertTrue(unwrappedList.atoms.count >= 1, "\(desc) should have atoms") + + // Verify we have a large operator (integral) in the list + var foundOperator = false + for atom in unwrappedList.atoms { + if atom.type == .largeOperator { + foundOperator = true + break + } + } + XCTAssertTrue(foundOperator, "\(desc) should contain a large operator (integral)") } }