mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
Support {gather} and {gather*} (#2183)
* Support `gather` and `gather*` * Add bogus screenshots * Add correct screenshots * Fix typo * Update screenshots * Improve error handling * Scope styles inside .katex{} * Revert console.log to console.error
This commit is contained in:
@@ -2726,6 +2726,27 @@ describe("An aligned environment", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("A gather environment", 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);
|
||||
});
|
||||
|
||||
it("should build if in 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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("operatorname support", function() {
|
||||
it("should not fail", function() {
|
||||
expect("\\operatorname{x*Π∑\\Pi\\sum\\frac a b}").toBuild();
|
||||
|
BIN
test/screenshotter/images/Gather-chrome.png
Normal file
BIN
test/screenshotter/images/Gather-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.6 KiB |
BIN
test/screenshotter/images/Gather-firefox.png
Normal file
BIN
test/screenshotter/images/Gather-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.6 KiB |
@@ -141,6 +141,9 @@ FractionTest: |
|
||||
\xrightarrow[\dfrac g h]{\displaystyle\frac g h} \; \xrightarrow [2.\, \dfrac c d] {1.\, \displaystyle\frac c d}
|
||||
\end{array}
|
||||
Functions: \sin\cos\tan\ln\log
|
||||
Gather:
|
||||
tex: \begin{gather} a=\frac 1 2 \\ e=b+c \end{gather}
|
||||
display: 1
|
||||
Gathered: |
|
||||
\begin{gathered}
|
||||
x = \frac{1}{2} \\
|
||||
|
Reference in New Issue
Block a user