mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 04:28:41 +00:00
feat: Support matrix*, pmatrix*, bmatrix*, Bmatrix*, vmatrix*, and Vmatrix*. (#2488)
* Support matrix*, pmatrix*, bmatrix*, Bmatrix*, vmatrix*, and Vmatrix* * Add tests and docs * Delete screeshotter tests * Fix column alignment and add bogus screenshot files * Update real Chrome and Firefox screenshots. * Update Safari screenshot * Dedupe code in array.js * Edit payload in array.js * Edit again, correctly this time.
This commit is contained in:
@@ -115,6 +115,16 @@ exports[`A begin/end parser should grab \\arraystretch 1`] = `
|
||||
}
|
||||
]
|
||||
],
|
||||
"cols": [
|
||||
{
|
||||
"type": "align",
|
||||
"align": "c"
|
||||
},
|
||||
{
|
||||
"type": "align",
|
||||
"align": "c"
|
||||
}
|
||||
],
|
||||
"hLinesBeforeRow": [
|
||||
[
|
||||
],
|
||||
|
@@ -1300,6 +1300,17 @@ describe("A begin/end parser", function() {
|
||||
const parse = getParsed`\def\arraystretch{1.5}\begin{matrix}a&b\\c&d\end{matrix}`;
|
||||
expect(parse).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should allow an optional argument in {matrix*} and company.", function() {
|
||||
expect("\\begin{matrix*}[r] a & -1 \\\\ -1 & d \\end{matrix*}").toBuild();
|
||||
expect("\\begin{pmatrix*}[r] a & -1 \\\\ -1 & d \\end{pmatrix*}").toBuild();
|
||||
expect("\\begin{bmatrix*}[r] a & -1 \\\\ -1 & d \\end{bmatrix*}").toBuild();
|
||||
expect("\\begin{Bmatrix*}[r] a & -1 \\\\ -1 & d \\end{Bmatrix*}").toBuild();
|
||||
expect("\\begin{vmatrix*}[r] a & -1 \\\\ -1 & d \\end{vmatrix*}").toBuild();
|
||||
expect("\\begin{Vmatrix*}[r] a & -1 \\\\ -1 & d \\end{Vmatrix*}").toBuild();
|
||||
expect("\\begin{matrix*} a & -1 \\\\ -1 & d \\end{matrix*}").toBuild();
|
||||
expect("\\begin{matrix*}[] a & -1 \\\\ -1 & d \\end{matrix*}").not.toParse();
|
||||
});
|
||||
});
|
||||
|
||||
describe("A sqrt parser", function() {
|
||||
|
BIN
test/screenshotter/images/MathtoolsMatrix-chrome.png
Normal file
BIN
test/screenshotter/images/MathtoolsMatrix-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
BIN
test/screenshotter/images/MathtoolsMatrix-firefox.png
Normal file
BIN
test/screenshotter/images/MathtoolsMatrix-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
BIN
test/screenshotter/images/MathtoolsMatrix-safari.png
Normal file
BIN
test/screenshotter/images/MathtoolsMatrix-safari.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
@@ -244,6 +244,7 @@ MathOp: a\mathop+b\mathop:c\mathop{\delta}e\mathop{\textrm{and}}f\mathrel{\matho
|
||||
MathRm: \mathrm{Ax2k\breve{a}\omega\Omega\imath+\KaTeX}
|
||||
MathSf: \mathsf{Ax2k\breve{a}\omega\Omega\imath+\KaTeX}
|
||||
MathScr: \mathscr{Ax2k\breve{a}\omega\Omega\imath+\KaTeX}
|
||||
MathtoolsMatrix: \begin{matrix*}[l] a & -1 \\ -1 & d \end{matrix*} \; \begin{pmatrix*}[r] a & -1 \\ -1 & d \end{pmatrix*}
|
||||
MathTt: \mathtt{Ax2k\breve{a}\omega\Omega\imath+\KaTeX}
|
||||
Mod: |
|
||||
\begin{array}{cc}
|
||||
|
Reference in New Issue
Block a user