mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
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:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user