Merge pull request #578 from kohler/middle

Handle \middle.
This commit is contained in:
Kevin Barabash
2016-12-08 23:35:36 -05:00
committed by GitHub
8 changed files with 106 additions and 20 deletions

View File

@@ -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() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -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.