mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 05:58:40 +00:00
Add | column separators to arrays.
This adds the ability to add `|` to a column description and have vertical separators be added. I added types to the column descriptions and added some logic to handle the separators when building the vertical lists of the array. Test plan: - See the Arrays screenshot looks good. - `make test`
This commit is contained in:
@@ -1354,7 +1354,22 @@ 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.cols).toEqual([{align:"r"}]);
|
||||
expect(parse[0].value.cols).toEqual([
|
||||
{ type: "align", align: "r" }
|
||||
]);
|
||||
});
|
||||
|
||||
it("should accept vertical separators", function() {
|
||||
var parse = getParsed("\\begin{array}{|l||c|}\\end{array}");
|
||||
expect(parse[0].type).toBe("array");
|
||||
expect(parse[0].value.cols).toEqual([
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "align", align: "l" },
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "separator", separator: "|" },
|
||||
{ type: "align", align: "c" },
|
||||
{ type: "separator", separator: "|" }
|
||||
]);
|
||||
});
|
||||
|
||||
});
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 42 KiB |
@@ -13,7 +13,7 @@
|
||||
|
||||
Accents: \vec{A}\vec{x}\vec x^2\vec{x}_2^2\vec{A}^2\vec{xA}^2
|
||||
Arrays: |
|
||||
\left(\begin{array}{rlc}
|
||||
\left(\begin{array}{|rl|c||}
|
||||
1&2&3\\
|
||||
1+1&2+1&3+1\cr1\over2&\scriptstyle 1/2&\frac12\\[1ex]
|
||||
\begin{pmatrix}x\\y\end{pmatrix}&0&\begin{vmatrix}a&b\\c&d\end{vmatrix}
|
||||
|
Reference in New Issue
Block a user