Support \stackrel (#468).

This commit is contained in:
Eddie Kohler
2016-11-26 23:00:01 -05:00
parent 6bb62b11b4
commit f8e0c91de4
4 changed files with 31 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
var utils = require("./utils");
var ParseError = require("./ParseError");
var parseData = require("./parseData");
var ParseNode = parseData.ParseNode;
/* This file contains a list of functions that we parse, identified by
* the calls to defineFunction.
@@ -236,6 +238,34 @@ defineFunction([
};
});
// Build a relation by placing one symbol on top of another
defineFunction("\\stackrel", {
numArgs: 2,
}, function(context, args) {
var top = args[0];
var bottom = args[1];
var bottomop = new ParseNode("op", {
type: "op",
limits: true,
alwaysHandleSupSub: true,
symbol: false,
value: ordargument(bottom),
}, bottom.mode);
var supsub = new ParseNode("supsub", {
base: bottomop,
sup: top,
sub: null,
}, top.mode);
return {
type: "mclass",
mclass: "mrel",
value: [supsub],
};
});
// Extra data needed for the delimiter handler down below
var delimiterSizes = {
"\\bigl" : {mclass: "mopen", size: 1},

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -116,6 +116,7 @@ Sqrt: |
^{\sqrt{\sqrt{\sqrt{x}}}}}
SqrtRoot: |
1+\sqrt[3]{2}+\sqrt[1923^234]{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^{2^2}}}}}}}}}}}
StackRel: a \stackrel{?}{=} b \stackrel{\text{def}}{=} c
StyleSwitching: a\cdot b\scriptstyle a\cdot ba\textstyle\cdot ba\scriptstyle\cdot b
SupSubCharacterBox: a_2f_2{f}_2{aa}_2{af}_2\mathbf{y}_Ay_A
SupSubHorizSpacing: |