mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
@@ -1042,6 +1042,26 @@ describe("A left/right parser", function() {
|
||||
var normalEmpty = "\\Bigl .";
|
||||
expect(normalEmpty).toParse();
|
||||
});
|
||||
|
||||
it("should handle \\middle", function() {
|
||||
var normalMiddle = "\\left( \\dfrac{x}{y} \\middle| \\dfrac{y}{z} \\right)";
|
||||
expect(normalMiddle).toParse();
|
||||
});
|
||||
|
||||
it("should handle multiple \\middles", function() {
|
||||
var multiMiddle = "\\left( \\dfrac{x}{y} \\middle| \\dfrac{y}{z} \\middle/ \\dfrac{z}{q} \\right)";
|
||||
expect(multiMiddle).toParse();
|
||||
});
|
||||
|
||||
it("should handle nested \\middles", function() {
|
||||
var nestedMiddle = "\\left( a^2 \\middle| \\left( b \\middle/ c \\right) \\right)";
|
||||
expect(nestedMiddle).toParse();
|
||||
});
|
||||
|
||||
it("should error when \\middle is not in \\left...\\right", function() {
|
||||
var unmatchedMiddle = "(\\middle|\\dfrac{x}{y})";
|
||||
expect(unmatchedMiddle).toNotParse();
|
||||
});
|
||||
});
|
||||
|
||||
describe("A begin/end parser", function() {
|
||||
|
BIN
test/screenshotter/images/LeftRightMiddle-chrome.png
Normal file
BIN
test/screenshotter/images/LeftRightMiddle-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
test/screenshotter/images/LeftRightMiddle-firefox.png
Normal file
BIN
test/screenshotter/images/LeftRightMiddle-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@@ -72,6 +72,7 @@ Kern:
|
||||
Lap: ab\llap{f}cd\rlap{g}h
|
||||
LeftRight: \left( x^2 \right) \left\{ x^{x^{x^{x^x}}} \right.
|
||||
LeftRightListStyling: a+\left(x+y\right)-x
|
||||
LeftRightMiddle: \left( x^2 \middle/ \right) \left\{ x^{x^{x^{x^x}}} \middle/ y \right.
|
||||
LeftRightStyleSizing: |
|
||||
+\left\{\rule{0.1em}{1em}\right.
|
||||
x^{+\left\{\rule{0.1em}{1em}\right.
|
||||
|
Reference in New Issue
Block a user