|
|
|
import {defineFunctionBuilders} from "../defineFunction"; |
|
import buildCommon from "../buildCommon"; |
|
import mathMLTree from "../mathMLTree"; |
|
|
|
import * as mml from "../buildMathML"; |
|
|
|
|
|
|
|
defineFunctionBuilders({ |
|
type: "atom", |
|
htmlBuilder(group, options) { |
|
return buildCommon.mathsym( |
|
group.text, group.mode, options, ["m" + group.family]); |
|
}, |
|
mathmlBuilder(group, options) { |
|
const node = new mathMLTree.MathNode( |
|
"mo", [mml.makeText(group.text, group.mode)]); |
|
if (group.family === "bin") { |
|
const variant = mml.getVariant(group, options); |
|
if (variant === "bold-italic") { |
|
node.setAttribute("mathvariant", variant); |
|
} |
|
} else if (group.family === "punct") { |
|
node.setAttribute("separator", "true"); |
|
} else if (group.family === "open" || group.family === "close") { |
|
|
|
|
|
node.setAttribute("stretchy", "false"); |
|
} |
|
return node; |
|
}, |
|
}); |
|
|
|
|