mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 20:28:38 +00:00
Add support for \overline
Summary: Follow the instructions in the TeX book for drawing \overlines. This uses the same code as fractions to produce the bars. Also added the ability to cramp styles (i.e. T -> T' and T' -> T'). Test Plan: - Look at `\overline{x}`, `\overline{\dfrac{x}{y}+z}`, and `\blue{\overline{x}}` to make sure they look good. - Make sure the tests work - Make sure the huxley tests look good (Not here yet :( ) Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D11604
This commit is contained in:
@@ -99,5 +99,11 @@
|
||||
"name": "DelimiterSizing",
|
||||
"screenSize": [1024, 768],
|
||||
"url": "http://localhost:7936/test/huxley/test.html?m=\\bigl\\uparrow\\Bigl\\downarrow\\biggl\\updownarrow\\Biggl\\Uparrow\\Biggr\\Downarrow\\biggr\\langle\\Bigr\\}\\bigr\\rfloor"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "Overline",
|
||||
"screenSize": [1024, 768],
|
||||
"url": "http://localhost:7936/test/huxley/test.html?m=\\overline{x}\\overline{x}\\overline{x^{x^{x^x}}} \\blue\\overline{y}"
|
||||
}
|
||||
]
|
||||
|
BIN
test/huxley/Overline.hux/firefox-1.png
Normal file
BIN
test/huxley/Overline.hux/firefox-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
5
test/huxley/Overline.hux/record.json
Normal file
5
test/huxley/Overline.hux/record.json
Normal file
@@ -0,0 +1,5 @@
|
||||
[
|
||||
{
|
||||
"action": "screenshot"
|
||||
}
|
||||
]
|
@@ -667,3 +667,19 @@ describe("A delimiter sizing parser", function() {
|
||||
expect(bigParse.value.size).toEqual(4);
|
||||
});
|
||||
});
|
||||
|
||||
describe("An overline parser", function() {
|
||||
var overline = "\\overline{x}";
|
||||
|
||||
it("should not fail", function() {
|
||||
expect(function() {
|
||||
parseTree(overline);
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("should produce an overline", function() {
|
||||
var parse = parseTree(overline)[0];
|
||||
|
||||
expect(parse.type).toMatch("overline");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user