mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 22:18:41 +00:00
feat: support {align}, {align*}, {alignat}, and {alignat*} (#2341)
* Support {align}, {align*}, {alignat}, and {alignat*} * Specify display mode for screenshots * Add bogus screenshots * Some screenshotter progress * Update screenshots
This commit is contained in:
@@ -2726,25 +2726,26 @@ describe("An aligned environment", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("A gather environment", function() {
|
||||
describe("AMS environments", function() {
|
||||
const nonStrictDisplay = new Settings({displayMode: true, strict: false});
|
||||
|
||||
it("should fail outside display mode", () => {
|
||||
expect`\begin{gather}a+b\\c+d\end{gather}`.not.toParse(nonstrictSettings);
|
||||
});
|
||||
|
||||
it("should fail outside display mode", () => {
|
||||
expect`\begin{gather*}a+b\\c+d\end{gather*}`.not.toParse(nonstrictSettings);
|
||||
expect`\begin{align}a&=b+c\\d+e&=f\end{align}`.not.toParse(nonstrictSettings);
|
||||
expect`\begin{align*}a&=b+c\\d+e&=f\end{align*}`.not.toParse(nonstrictSettings);
|
||||
expect`\begin{alignat}{2}10&x+ &3&y = 2\\3&x+&13&y = 4\end{alignat}`.not.toParse(nonstrictSettings);
|
||||
expect`\begin{alignat*}{2}10&x+ &3&y = 2\\3&x+&13&y = 4\end{alignat*}`.not.toParse(nonstrictSettings);
|
||||
});
|
||||
|
||||
it("should build if in display mode", () => {
|
||||
it("should build if in non-strict display mode", () => {
|
||||
expect`\begin{gather}a+b\\c+d\end{gather}`.toBuild(nonStrictDisplay);
|
||||
});
|
||||
|
||||
it("should build if in display mode", () => {
|
||||
expect`\begin{gather*}a+b\\c+d\end{gather*}`.toBuild(nonStrictDisplay);
|
||||
expect`\begin{align}a&=b+c\\d+e&=f\end{align}`.toBuild(nonStrictDisplay);
|
||||
expect`\begin{align*}a&=b+c\\d+e&=f\end{align*}`.toBuild(nonStrictDisplay);
|
||||
expect`\begin{alignat}{2}10&x+ &3&y = 2\\3&x+&13&y = 4\end{alignat}`.toBuild(nonStrictDisplay);
|
||||
expect`\begin{alignat*}{2}10&x+ &3&y = 2\\3&x+&13&y = 4\end{alignat*}`.toBuild(nonStrictDisplay);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("operatorname support", function() {
|
||||
|
BIN
test/screenshotter/images/Align-chrome.png
Normal file
BIN
test/screenshotter/images/Align-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
test/screenshotter/images/Align-firefox.png
Normal file
BIN
test/screenshotter/images/Align-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@@ -22,6 +22,9 @@ AccentsText: |
|
||||
\text{\'A} & \text{\.A} & \text{\`A} & \text{\"A} & \text{\H{A}} & \text{\r{A}} \\
|
||||
\text{\.I İ} & \text{\H e e̋} & \text{\i ı}
|
||||
\end{array}
|
||||
Align:
|
||||
tex: \begin{align}a &= 1 & b &= 2 \\ 3a &= 3 & 17b &= 34\end{align}
|
||||
display: 1
|
||||
Aligned: |
|
||||
\begin{aligned}
|
||||
a &= 1 & b &= 2 \\
|
||||
|
Reference in New Issue
Block a user