Integration of MathJax, KaTeX and Asymptote with scribble, to typeset math in Racket documentation
Go to file
Emily Eisenberg 0a3a2271f4 Add ability to calculate heights/depths
Summary:
This diff does a couple different things:

 - There is now a metrics/ folder, which contains the property files describing
   the metrics if the fonts, as well as a script for reading and printing the
   metrics in javascript.
 - Fractions and superscripts/subscripts are now rendered in slightly different
   ways now (notably, no use of inline-table). This allows for much more precise
   positioning of the superscripts, subscripts, numerators, and denominators,
   while still having an appropriate baseline. Also, there is no longer a
   sup/sub/supsub distinction, there are only supsubs with null sup/sub.
 - Using the new font metrics and by implementing the formulas found in The TeX
   Book, Appendix G, the heights and depths of all of the sub-expressions in a
   formula are now calculated. These are currently used to:
    - Correctly position superscripts, subscripts, numerators, and denominators
    - Adjust the height and depth of the overall expression so it takes up the
      appropriate space
 - Because we have to add attributes (height and depth) to every attribute, I
   have changed the way DOM nodes are assembled. Now, instead of assembling the
   DOM elements inline (which is a problem because we need to track
   height/depth, and we shouldn't (and can't in IE 8) attach raw attributes to DOM
   nodes), we assemble a pseudo-DOM structure with the extra information, and
   then actually assemble it at the very end.

The main page also now has an updated expression to show off and test the new
and improved parsing.

Test Plan:
View the main page, make sure that the expression renders. Make sure
that the tests pass. Make sure that expressions have the correct calculated
height (this is most easily tested by viewing them on the main page and making
sure that the top of the expression lines up with the bottom of the input box).

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D3442
2013-08-13 18:16:43 -07:00
build Add a setup rule to Makefile 2013-07-30 13:54:43 -07:00
metrics Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
static Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
test Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
.arcconfig Rename everything to KaTeX 2013-07-10 14:08:50 -07:00
.gitignore Rewrite the parser 2013-07-12 23:16:30 -07:00
buildTree.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
domTree.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
fontMetrics.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
katex.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
Lexer.js Always throw real ParseErrors 2013-07-28 17:54:41 -07:00
Makefile Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
Options.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
package.json Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
ParseError.js Make ParseErrors differentiable from other Errors 2013-07-22 14:46:13 -07:00
Parser.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
parseTree.js Remove Parser options usage 2013-07-13 18:15:17 -07:00
server.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
Style.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00
utils.js Add ability to calculate heights/depths 2013-08-13 18:16:43 -07:00