mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
Implement cases environment
See issue #278. Although the official definition makes use of @{…} notation, we use custom spacing instead, since that seems easier for now.
This commit is contained in:
@@ -1310,7 +1310,17 @@ describe("An array environment", function() {
|
||||
it("should accept a single alignment character", function() {
|
||||
var parse = getParsed("\\begin{array}r1\\\\20\\end{array}");
|
||||
expect(parse[0].type).toBe("array");
|
||||
expect(parse[0].value.colalign).toEqual(["r"]);
|
||||
expect(parse[0].value.cols).toEqual([{align:"r"}]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("A cases environment", function() {
|
||||
|
||||
it("should parse its input", function() {
|
||||
expect("f(a,b)=\\begin{cases}a+1&\\text{if }b\\text{ is odd}\\\\" +
|
||||
"a&\\text{if }b=0\\\\a-1&\\text{otherwise}\\end{cases}")
|
||||
.toParse();
|
||||
});
|
||||
|
||||
});
|
||||
|
BIN
test/screenshotter/images/Cases-firefox.png
Normal file
BIN
test/screenshotter/images/Cases-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
@@ -4,6 +4,7 @@
|
||||
"Baseline": "http://localhost:7936/test/screenshotter/test.html?m=a+b-c\\cdot d/e",
|
||||
"BasicTest": "http://localhost:7936/test/screenshotter/test.html?m=a",
|
||||
"BinomTest": "http://localhost:7936/test/screenshotter/test.html?m=\\dbinom{a}{b}\\tbinom{a}{b}^{\\binom{a}{b}+17}",
|
||||
"Cases": "http://localhost:7936/test/screenshotter/test.html?m=f(a,b)=\\begin{cases}a+1%26\\text{if }b\\text{ is odd}\\\\a%26\\text{if }b=0\\\\a-1%26\\text{otherwise}\\end{cases}",
|
||||
"Colors": "http://localhost:7936/test/screenshotter/test.html?m=\\blue{a}\\color{%230f0}{b}\\color{red}{c}",
|
||||
"DeepFontSizing": "http://localhost:7936/test/screenshotter/test.html?m=a^{\\big| x^{\\big(}}_{\\Big\\uparrow} + i^{i^{\\Huge x}_y}_{\\Huge z} + \\dfrac{\\Huge x}{y}",
|
||||
"DelimiterSizing": "http://localhost:7936/test/screenshotter/test.html?m=\\bigl\\uparrow\\Bigl\\downarrow\\biggl\\updownarrow\\Biggl\\Uparrow\\Biggr\\Downarrow\\biggr\\langle\\Bigr\\}\\bigr\\rfloor",
|
||||
|
Reference in New Issue
Block a user