scribble-math/metrics
Emily Eisenberg c3f758c319 Add support for \left and \right
Summary:
Added stacked delimiter support for more delimiters. Split out delimiter
functions into its own file, and split out some tree building functions into a
common file. Supports the empty `.` delimiter with \left and \right, and doesn't
try to produce huge /, \backslash, <, or > delimiters. Depends on D7844

Test input:

\left( \left) \left[ \left\lbrack \left] \left\rbrack \left\{ \left\lbrace
\left\} \left\rbrace \left\lfloor \left\rfloor \left\lceil \left\rceil
\left\langle \left\rangle \left/ \left\backslash \left| \left\vert \left\|
\left\Vert \left\uparrow \left\Uparrow \left\downarrow \left\Downarrow
\left\updownarrow \left\Updownarrow {x^{x^{x^{x^{x^{x^{x^{x^{x^{x^x}}}}}}}}}}
\right.\right.\right.\right.\right.\right.\right.\right.\right.\right.
\right.\right.\right.\right.\right.\right.\right.\right.\right.\right.
\right.\right.\right.\right.\right.\right.\right.\right.

Test Plan:
 - Run the test input, see that it works
 - Run the tests, see that they work
 - Look at huxley screenshots (not here yet :( ) and make sure they look good

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D11602
2014-09-04 21:58:43 -07:00
..
extract_tfms.py Add support for \left and \right 2014-09-04 21:58:43 -07:00
mapping.pl Update metrics using TeX metrics instead of TTF metrics 2014-09-03 20:12:00 -07:00
parse_tfm.py Update metrics using TeX metrics instead of TTF metrics 2014-09-03 20:12:00 -07:00
README.md Update metrics using TeX metrics instead of TTF metrics 2014-09-03 20:12:00 -07:00
replace_line.py Update metrics using TeX metrics instead of TTF metrics 2014-09-03 20:12:00 -07:00

How to generate new metrics


There are several requirements for generating the metrics used by KaTeX.

  • You need to have an installation of TeX which supports kpathsea (you can check this by running tex --version, and seeing if it has a line that looks like > kpathsea version 6.2.0

  • You need the JSON module for perl. You can install this either from CPAN or with your package manager.

Once you have these things, run

make metrics

which should generate new metrics and place them into fontMetrics.js. You're done!