[MTMathListBuilder][MTTypesetter] add \cfrac support

This commit is contained in:
Nicolas Guillot
2025-09-30 10:17:08 +02:00
parent 225948c725
commit 7c9766f825
3 changed files with 73 additions and 4 deletions

6
Sources/SwiftMath/MathRender/MTMathList.swift Executable file → Normal file
View File

@@ -328,6 +328,10 @@ public class MTFraction: MTMathAtom {
public var rightDelimiter = ""
public var numerator: MTMathList?
public var denominator: MTMathList?
// Continued fraction properties
public var isContinuedFraction: Bool = false
public var alignment: String = "c" // "l", "r", "c" for left, right, center
init(_ frac: MTFraction?) {
super.init(frac)
@@ -338,6 +342,8 @@ public class MTFraction: MTMathAtom {
self.hasRule = frac.hasRule
self.leftDelimiter = frac.leftDelimiter
self.rightDelimiter = frac.rightDelimiter
self.isContinuedFraction = frac.isContinuedFraction
self.alignment = frac.alignment
}
}