Summary:
Add support for all of the other operators, including the ones with symbols and
limits. This also fixes the bug where subscripts were shifted the same amount as
subscripts.
To accomplish this, the domTree.textNode has been repurposed into symbolNode
which is no longer an actual text node, but instead represents an element with a
single symbol in it. This lets us access properties like the italic correction
of a symbol in a reasonable manner without having to recursively look through
children of spans.
Depends on D13082
Fixes#8
Test Plan:
- Make sure tests work
- Make sure huxley screenshots didn't change much, and new screenshot looks good
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13122
Summary:
Follow the TeXbook instructions on how to construct square roots. Using
makeCustomSizedDelim, this becomes nearly trivial.
Test Plan:
- Make sure normal tests work
- Make sure the new huxley test looks good, and other huxley tests haven't changed.
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D12918
Summary:
Make delimiter sizing work. This involved
- Adding the symbols for the remaining delimiters (like `\lfloor` and `\{`)
- Adding metrics for the size1, size2, size3, and size4 fonts
- Parsing delimiter sizing functions
- Using the big fonts when possible, otherwise building large copies of the
delimiters from scratch
Test Plan:
- See that
`\bigl\uparrow\Bigl\downarrow\biggl\updownarrow\Biggl\Uparrow
\Biggr\Downarrow\biggr\Updownarrow\bigm/\Bigm\backslash\biggm|
\Biggm|\big\lceil\Big\rceil\bigg\langle\Bigg\rangle\bigl(\Bigl)
\biggl[\Biggl]\Biggr\{\biggr\}\Bigr\lfloor\bigr\rfloor`
parses correctly (this contains all of the delimiters, and all of the sizing
modes)
- See that the huxley tests didn't change, and the new one looks good
- See the normal tests work
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7844
Summary:
Add real support for the tie symbol. Also, get rid of any of the
leftover bad support
Test Plan:
- See the new normal tests succeed
- See huxley tests didn't change except the new ones, which looks good
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7772
Summary:
Make all of the parsing functions keep track of whether they are
parsing in math mode or text mode. Then, add a separate lexing function to lex
text mode, which is different than the normal mode because it does weird things
with spacing and allows a different set of characters.
Test Plan:
- See that the normal tests work
- See that the huxley screenshot looks reasonable
- See that none of the other huxley screenshots changed
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7578
Summary:
Before, there were a couple problems:
1. There were similar tables of functions in the buildTree and Parser modules,
making it hard to add new functions, and code duplication is bad
2. We distinguished the font to use (mostly just ams vs normal) using a
different parser class, which led to annoyance and some weird bugs
3. (Not actually in this code, but in D7578) We can't distinguish between
functions that should be expanded in text mode and those that shouldn't.
To solve these problems, I've created an all-encompassing table in symbols.js
that fixes 1. and 2., and should fix 3. once it's merged in. The table keeps
track of each of the functions and their class, font, and possible replacement,
and then Parser and buildTree do lookups in this table.
Also added the functions for the new_definitions functions, to show how easy it
is to add new functions.
Test Plan:
1. Run the normal tests, see they all pass
2. Run huxley, see none of the screenshots changed
3. See that things like the main page loads
4. See that the new functions look correctly with
'\barwedge\veebar\odot\oplus\otimes\oslash\circledcirc
\boxdot\bigtriangleup\bigtriangledown\dagger\diamond
\star\triangleleft\triangleright'
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7704