Get a tall \middle\vert from MathML (#1911)

This commit is contained in:
Ron Kok
2019-03-28 01:49:05 -07:00
committed by ylemkimon
parent 26e1518b7b
commit 9fcf14dccf

View File

@@ -318,8 +318,14 @@ defineFunction({
return middleDelim;
},
mathmlBuilder: (group, options) => {
const middleNode = new mathMLTree.MathNode(
"mo", [mml.makeText(group.delim, group.mode)]);
// A Firefox \middle will strech a character vertically only if it
// is in the fence part of the operator dictionary at:
// https://www.w3.org/TR/MathML3/appendixc.html.
// So we need to avoid U+2223 and use plain "|" instead.
const textNode = (group.delim === "\\vert" || group.delim === "|")
? mml.makeText("|", "text")
: mml.makeText(group.delim, group.mode);
const middleNode = new mathMLTree.MathNode("mo", [textNode]);
middleNode.setAttribute("fence", "true");
// MathML gives 5/18em spacing to each <mo> element.
// \middle should get delimiter spacing instead.