Enable an empty \substack (#2278)

This commit is contained in:
Ron Kok
2020-07-08 12:50:50 -07:00
committed by GitHub
parent c2e5a289c0
commit 467052ce21
2 changed files with 4 additions and 1 deletions

View File

@@ -737,7 +737,7 @@ defineEnvironment({
arraystretch: 0.5,
};
res = parseArray(context.parser, res, "script");
if (res.body[0].length > 1) {
if (res.body.length > 0 && res.body[0].length > 1) {
throw new ParseError("{subarray} can contain only one column");
}
return res;

View File

@@ -2660,6 +2660,9 @@ describe("A substack function", function() {
it("should accommodate macros in the argument", function() {
expect`\sum_{\substack{ 0<i<\varPi \\ 0<j<\pi }} P(i,j)`.toBuild();
});
it("should accommodate an empty argument", function() {
expect`\sum_{\substack{}} P(i,j)`.toBuild();
});
});