package teximportfunc ( *parser) ( string) ([]*mml.Node, error) {// MatrixQuantity uses GetStar and GetNext's JavaScript whitespace rules. := .readMathtoolsStar()for .pos < len(.source) && internalTextSpace(.peekRune()) { .consumeRune() } := "array"if == "smqty" || == "smallmatrixquantity" { = "smallmatrix" } , , := "", "", ""varerror := byte(0)if .pos < len(.source) { = .source[.pos] }switch {case'{': , _, = .readArgumentAtCursor(, false)case'(', '[', '|': .pos++ , = string(), string()if == '(' { = ")"if { , = "\\lgroup", "\\rgroup" } } elseif == '[' { = "]" } := string()if == '(' { = ")" } elseif == '[' { = "]" } , = .readUpTo(, )default:// The fallback renders an empty fenced array without consuming the // next token. Only the GetNext whitespace has been consumed. , = "(", ")" }if != nil {returnnil, }// In array the {} supplies the column definition; in smallmatrix it // remains a real empty group in the first cell. A fresh child parser // preserves both outcomes and the registered environment/fence commands. := "\\begin{" + + "}{} " + + "\\end{" + + "}"if != "" { = "\\left" + + + "\\right" + } , := .parseChild()if != nil {returnnil, }returnunwrapInferred(), nil}
The pages are generated with Goldsv0.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.