mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
Support \atop.
Add Jasmine test and update screenshotter test.
This commit is contained in:
@@ -418,6 +418,7 @@ defineFunction("\\mathop", {
|
||||
defineFunction([
|
||||
"\\dfrac", "\\frac", "\\tfrac",
|
||||
"\\dbinom", "\\binom", "\\tbinom",
|
||||
"\\\\atopfrac", // can’t be entered directly
|
||||
], {
|
||||
numArgs: 2,
|
||||
greediness: 2,
|
||||
@@ -435,6 +436,9 @@ defineFunction([
|
||||
case "\\tfrac":
|
||||
hasBarLine = true;
|
||||
break;
|
||||
case "\\\\atopfrac":
|
||||
hasBarLine = false;
|
||||
break;
|
||||
case "\\dbinom":
|
||||
case "\\binom":
|
||||
case "\\tbinom":
|
||||
@@ -571,7 +575,7 @@ defineFunction([
|
||||
});
|
||||
|
||||
// Infix generalized fractions
|
||||
defineFunction(["\\over", "\\choose"], {
|
||||
defineFunction(["\\over", "\\choose", "\\atop"], {
|
||||
numArgs: 0,
|
||||
infix: true,
|
||||
}, function(context) {
|
||||
@@ -583,6 +587,9 @@ defineFunction(["\\over", "\\choose"], {
|
||||
case "\\choose":
|
||||
replaceWith = "\\binom";
|
||||
break;
|
||||
case "\\atop":
|
||||
replaceWith = "\\\\atopfrac";
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unrecognized infix genfrac command");
|
||||
}
|
||||
|
Reference in New Issue
Block a user