Support {smallmatrix}, {subarray}, and \substack (#1969)
* Support {smallmatrix}, {subarray}, and \substack * Fix lint errors * Update docs. Screenshots step 1. * Screenshots step 2 * Screenshots step 3 * Pick up review comments * Fixed arraycolsep for {smallmatrix} * Fixed lint error * Updated screenshots
@@ -2582,6 +2582,43 @@ describe("An array environment", function() {
|
||||
|
||||
});
|
||||
|
||||
describe("A subarray environment", function() {
|
||||
|
||||
it("should accept only a single alignment character", function() {
|
||||
const parse = getParsed`\begin{subarray}{c}a \\ b\end{subarray}`;
|
||||
expect(parse[0].type).toBe("array");
|
||||
expect(parse[0].cols).toEqual([
|
||||
{type: "align", align: "c"},
|
||||
]);
|
||||
expect`\begin{subarray}{cc}a \\ b\end{subarray}`.not.toParse();
|
||||
expect`\begin{subarray}{c}a & b \\ c & d\end{subarray}`.not.toParse();
|
||||
expect`\begin{subarray}{c}a \\ b\end{subarray}`.toBuild();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("A substack function", function() {
|
||||
|
||||
it("should build", function() {
|
||||
expect`\sum_{\substack{ 0<i<m \\ 0<j<n }} P(i,j)`.toBuild();
|
||||
});
|
||||
it("should accommodate spaces in the argument", function() {
|
||||
expect`\sum_{\substack{ 0<i<m \\ 0<j<n }} P(i,j)`.toBuild();
|
||||
});
|
||||
it("should accommodate macros in the argument", function() {
|
||||
expect`\sum_{\substack{ 0<i<\varPi \\ 0<j<\pi }} P(i,j)`.toBuild();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("A smallmatrix environment", function() {
|
||||
|
||||
it("should build", function() {
|
||||
expect`\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}`.toBuild();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("A cases environment", function() {
|
||||
|
||||
it("should parse its input", function() {
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 24 KiB |
@@ -37,7 +37,9 @@ Arrays: |
|
||||
1&2&3\\ \hline
|
||||
1+1&2+1&3+1\cr1\over2&\scriptstyle 1/2&\frac12\\[1ex] \hline \hdashline
|
||||
\begin{pmatrix}x\\y\end{pmatrix}&0&\begin{vmatrix}a&b\\c&d\end{vmatrix}
|
||||
\end{array}\right]
|
||||
\end{array}\right] \\
|
||||
\begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \;\;
|
||||
\begin{subarray}{c}a \\ b\end{subarray}
|
||||
ArrayMode:
|
||||
tex: |
|
||||
\begin{matrix}
|
||||
@@ -270,7 +272,8 @@ OpLimits: |
|
||||
\begin{matrix}
|
||||
{\sin_2^2 \lim_2^2 \int_2^2 \sum_2^2}
|
||||
{\displaystyle \lim_2^2 \int_2^2 \intop_2^2 \sum_2^2} \\
|
||||
\limsup_{x \rightarrow \infty} x \stackrel{?}= \liminf_{x \rightarrow \infty} x
|
||||
\limsup_{x \rightarrow \infty} x \stackrel{?}= \liminf_{x \rightarrow \infty} x \\
|
||||
\displaystyle \sum_{\substack{0<i<m\\0<j<n}}
|
||||
\end{matrix}
|
||||
OverUnderline: x\underline{x}\underline{\underline{x}}\underline{x_{x_{x_x}}}\underline{x^{x^{x^x}}}\overline{x}\overline{x}\overline{x^{x^{x^x}}} \blue{\overline{\underline{x}}\underline{\overline{x}}}
|
||||
OverUnderset: |
|
||||
|