Builtin macros, macro arguments, overset and underset

* Ship predefined macros with the library, in macros.js.
* Allow macro arguments #1 and so on, with argument count deduced from string.
* Use these features to implement \overset and \underset, fixes #484.
This commit is contained in:
Martin von Gagern
2017-01-06 18:52:50 +01:00
parent 40ec1b92b8
commit 7ec455083f
5 changed files with 98 additions and 3 deletions

View File

@@ -2011,6 +2011,13 @@ describe("A macro expander", function() {
"\\bar": "a",
});
});
it("should expand the \overset macro as expected", function() {
expect("\\overset?=").toParseLike("\\mathop{=}\\limits^{?}");
expect("\\overset{x=y}{\sqrt{ab}}")
.toParseLike("\\mathop{\sqrt{ab}}\\limits^{x=y}");
expect("\\overset {?} =").toParseLike("\\mathop{=}\\limits^{?}");
});
});
describe("A parser taking String objects", function() {