Commit Graph

11 Commits

Author SHA1 Message Date
Emily Eisenberg
d729ba5281 Add a \color command for custom colors
Summary:
Keep track of the color inside the style now, and use that when we are
rendering things. Added a custom lexing mode to handle lexing colors correctly.
Prefixed the old katex colors (internally) with "katex-" to distinguish them
from CSS colors.

Test Plan:
 - Run the normal tests, see they work
 - Run the huxley tests, see that they didn't change except for the color one
   which looks right

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7763
2014-03-27 12:34:45 -04:00
Emily Eisenberg
7723d3dcaf First attempt at \text function
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
2014-03-26 22:17:41 -04:00
Ben Alpert
cab5af40b6 Always throw real ParseErrors
Also sneak in a colon.

Auditors: emily
2013-07-28 17:54:41 -07:00
Emily Eisenberg
79a50b3abe Make the linter happy
Auditors: alpert
2013-07-24 20:37:56 -07:00
Emily Eisenberg
383ca01434 Sync with Khan-exercises
Summary:
Add some things in to make this more useful to khan-exercises.
Notably, make KaTeX.process create and clean up its own .katex node, and rename
.mathmathmath -> .katex.

Test Plan: Make test, make sure the main page still renders stuff

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D3061
2013-07-17 15:43:55 -07:00
Emily Eisenberg
975234e813 Fix some minor things
Summary: Fix llap/rlap again, fix lexing errors

Auditors: alpert
2013-07-15 12:12:15 -07:00
Ben Alpert
a5840aae4b Add more symbols
Summary:
', \angle, \circ, \gets, \infty, \leftarrow, \prime, \rightarrow, \times, \to

Fixes T1191.

Reviewers: emily

Reviewed By: emily

Maniphest Tasks: T1191

Differential Revision: http://phabricator.khanacademy.org/D3053
2013-07-14 22:53:43 -07:00
Emily Eisenberg
ed82784cba Non-capturing regex, don't catch some exceptions
Auditors: alpert
2013-07-13 20:55:35 -07:00
Emily Eisenberg
20658a95b6 Add \ in front of functions in the parser
Auditors: alpert
2013-07-13 16:13:05 -07:00
Emily Eisenberg
38e2d600fd Allow some functions to have letters after them
Summary: Allow there to be letters immediately after \ , \;, \,, \:.

Test Plan: Run the tests

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D3031
2013-07-13 00:05:41 -07:00
Emily Eisenberg
4122fa2b99 Rewrite the parser
Summary:
Make our own parser that doesn't use jison, so that we can handle
funny TeX syntax, and to make it smaller.

Test Plan: Make sure the tests pass with the new parser.

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D3029
2013-07-12 23:16:30 -07:00