Handle \middle.

This commit is contained in:
Eddie Kohler
2016-12-08 11:28:48 -05:00
parent 7433638fda
commit e449b2d61a
8 changed files with 106 additions and 20 deletions

View File

@@ -52,6 +52,8 @@ function Parser(input, settings) {
this.gullet = new MacroExpander(input, settings.macros);
// Store the settings for use in parsing
this.settings = settings;
// Count leftright depth (for \middle errors)
this.leftrightDepth = 0;
}
var ParseNode = parseData.ParseNode;
@@ -411,7 +413,9 @@ Parser.prototype.parseImplicitGroup = function() {
// Parse the entire left function (including the delimiter)
var left = this.parseFunction(start);
// Parse out the implicit body
++this.leftrightDepth;
body = this.parseExpression(false);
--this.leftrightDepth;
// Check the next token
this.expect("\\right", false);
var right = this.parseFunction();