package tex
import "github.com/d2lang/mathjax-go/internal/mml"
func (p *parser ) noteMO (n *mml .Node ) *mml .Node {
if n != nil && n .Kind == "mo" && p .state != nil {
p .state .operators = append (p .state .operators , n )
}
return n
}
func (p *parser ) token (kind , text string ) *mml .Node {
return p .noteMO (token (kind , text ))
}
func (p *parser ) operator (text string , class mml .TeXClass , attributes map [string ]any ) *mml .Node {
return p .noteMO (operator (text , class , attributes ))
}
func (p *parser ) copyNode (original *mml .Node ) *mml .Node {
copy := original .Clone ()
if copy != nil {
copy .Walk (func (n *mml .Node ) bool {
p .noteMO (n )
p .notePoppedScript (n )
return true
})
}
return copy
}
func (p *parser ) namedOperator (text string ) *mml .Node {
return p .noteMO (namedOperator (text ))
}
func (p *parser ) lookupExtensionSymbol (name string ) (*mml .Node , bool ) {
n , ok := lookupExtensionSymbol (name )
return p .noteMO (n ), ok
}
func (p *parser ) cdHorizontalArrow (text string ) *mml .Node {
return p .noteMO (cdHorizontalArrow (text ))
}
func (p *parser ) cdVerticalArrow (text string ) *mml .Node {
return p .noteMO (cdVerticalArrow (text ))
}
func (p *parser ) amsFixedFencePalette (text string , class mml .TeXClass ) *mml .Node {
return amsFixedFencePaletteWithToken (text , class , p .token )
}
func (p *parser ) fenced (open string , content *mml .Node , close string , stretchy bool ) *mml .Node {
return fencedWithOperator (open , content , close , stretchy , p .operator )
}
func (p *parser ) leftRightFenced (open string , content *mml .Node , close string , stretchy bool ) *mml .Node {
n := p .fenced (open , content , close , stretchy )
n .SetProperty ("open" , open )
n .SetProperty ("close" , close )
n .SetProperty ("texClass" , mml .TeXClassInner )
n .TeXClass = mml .TeXClassInner
return n
}
func (p *parser ) physicsNabla () *mml .Node {
return physicsNablaWithOperator (p .operator )
}
func (p *parser ) empheqTopRowTable (original *mml .Node ) *mml .Node {
return empheqCopiedTopRowTable (p .copyNode (original ))
}
func (p *parser ) lookupMJSourceSymbol (name string ) (*mml .Node , bool ) {
n , ok := lookupMJSourceSymbol (name )
if ok && p .fontExplicitEmpty && p .activeFont == "" {
if ambient , _ := n .Property (ambientFontSource ); ambient == true {
n .SetProperty (resolvedFontScope , true )
}
}
return p .noteMO (n ), ok
}
func (p *parser ) physicsFenced (open string , content *mml .Node , close string , stretchy bool ) *mml .Node {
n := p .fenced (open , content , close , stretchy )
n .TeXClass = mml .TeXClassInner
return n
}
func (p *parser ) autoOpenFence (text string , class mml .TeXClass ) *mml .Node {
return p .noteMO (autoOpenFence (text , class ))
}
func (p *parser ) normalizeDecorationBase (base *mml .Node ) *mml .Node {
return normalizeDecorationBaseWithMO (base , func () *mml .Node { return p .noteMO (node ("mo" )) })
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .