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:
Emily Eisenberg
2014-08-05 17:48:10 -07:00
parent 5756be048c
commit fe6b67817c
8 changed files with 107 additions and 1 deletions

View File

@@ -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}"
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,5 @@
[
{
"action": "screenshot"
}
]

View File

@@ -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");
});
});