// Copyright (c) 2009-2022 The MathJax Consortium// SPDX-License-Identifier: Apache-2.0//// This file is a Go translation and modification of MathJax 3.2.2.// Sources: ts/input/tex/ams/AmsMethods.ts (AlignAt, AmsEqnArray),// base/BaseMethods.ts (EqnArray), and ParseUtil.ts (setArrayAlign).package teximport ()func ( *parser) () (string, error) { , , := .readBrackets(nil)var *Erroriferrors.As(, &) && .ID == "MissingCloseBracket" {return"", texError("MissingCloseBracket", "Could not find closing ']' for argument to \\begin") }return , }func finishAlignedatTable( *mml.Node, , string, int) {// AlignAt's positive counts supply repeated rl/zero-gap patterns, not a // maximum number of authored columns. EqnArray extends those patterns to // the actual row width. Empty and all-zero counts instead retain the // empty alignment and BaseMethods.EqnArray's fallback spacing. , := "right left", "0em 0em"ifstrings.TrimLeft(, "0") == "" { , = "", "1em" } .Attributes.Set("columnalign", repeatAMSEqnArrayDefinition(, )) .Attributes.Set("columnspacing", repeatAMSEqnArrayDefinition(, -1))setArrayAlign(, )}func setArrayAlign( *mml.Node, string) {// ParseUtil.trimSpaces uses JavaScript whitespace and preserves the last // control-space before setArrayAlign interprets t/b/c. := strings.TrimFunc(, internalTextSpace)ifstrings.HasSuffix(, `\`) && strings.HasSuffix(, " ") { += " " }switch {case"t": = "baseline 1"case"b": = "baseline -1"case"c": = "axis" }if != "" { .Attributes.Set("align", ) }}
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.