Support \brace and \brack (#1453)

* Support \brace and \brack

* Update screenshots
This commit is contained in:
Ron Kok
2018-06-27 11:43:02 -07:00
committed by ylemkimon
parent 518379aed5
commit 8621f5b76a
5 changed files with 54 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ defineFunction({
"\\cfrac", "\\dfrac", "\\frac", "\\tfrac",
"\\dbinom", "\\binom", "\\tbinom",
"\\\\atopfrac", // cant be entered directly
"\\\\bracefrac", "\\\\brackfrac", // ditto
],
props: {
numArgs: 2,
@@ -45,6 +46,16 @@ defineFunction({
leftDelim = "(";
rightDelim = ")";
break;
case "\\\\bracefrac":
hasBarLine = false;
leftDelim = "\\{";
rightDelim = "\\}";
break;
case "\\\\brackfrac":
hasBarLine = false;
leftDelim = "[";
rightDelim = "]";
break;
default:
throw new Error("Unrecognized genfrac command");
}
@@ -272,7 +283,7 @@ defineFunction({
// immediately by one of the variants above.
defineFunction({
type: "infix",
names: ["\\over", "\\choose", "\\atop"],
names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
props: {
numArgs: 0,
infix: true,
@@ -289,6 +300,12 @@ defineFunction({
case "\\atop":
replaceWith = "\\\\atopfrac";
break;
case "\\brace":
replaceWith = "\\\\bracefrac";
break;
case "\\brack":
replaceWith = "\\\\brackfrac";
break;
default:
throw new Error("Unrecognized infix genfrac command");
}