Added \cong + fixed comment copypasta.

Test Plan: Parses and renders locally.

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6393
Added \! (negative thin space)

Test Plan: Parses and renders locally. \!\, and \,\! are now no-ops.

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6395
Basic perceptual diffing support for KaTeX

Summary:
This commit adds an HTML file for creating perceptual diffs (pdiff.html),
a reference screenshot of that HTML file (pdiff.png), and a quick script
for comparing that screenshot to a newly generated one (pdiff.js).

Also added a basic README.

Test Plan: make pdiff

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6415
Add \enspace (0.5em space)

Summary:
TeX spacing is complicated - there's \enskip and \enspace and the two are
subtly different in some weird way. But \enspace seems to be the preferred
half em space in LaTeX, and the only one which MathJax supports.

Test Plan: Parsed and rendered correctly.

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6437
Add MIT License

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D6497
Add "http://" to links in README

The links didn't parse quite right as it was:
  * https://gist.github.com/justinj/c13560efabceb4f0a2ce
  * Try to click on the links

Test Plan:
* Check out that readme!

Auditors: alex
Add huxley screenshot tests

Summary:
Add in a testing page, which just renders the location hash in the body. Use
this to make some screenshot tests in huxley. Note, these screenshots were made
in Firefox on a Linux computer, so running the tests somewhere else might
produce something else.

Test Plan:
- Serve KaTeX (`make serve`)
- Run a Selenium Server (I used selenium 2.40.0)
- Run `huxley` from the test/huxley/ directory
- Ensure that all of the tests pass

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7258
Make the Makefile non-mac friendly

Summary:
Add checks in the makefile to not run mac-only things when not on a
mac. (I've only tested on linux, I haven't ensured that this runs mac-only
things on a mac)

Test Plan:
- Run `make`
- Have it not break

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7260
Don't silence webkit2png output

Otherwise you miss useful error messages like this:

```
Fetching http://localhost:7936/test/pdiff.html ...
... something went wrong: Could not connect to the server.
```

Auditors: alex
Make marginRight work in firefox

Summary:
`.style["margin-right"]` doesn't work in firefox, but
`.style.marginRight` does.

Test Plan:
- Look at `b\llap{f}` in chrome and firefox
- Make sure it looks the same (or at least very similar) in both

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7476
Don't die if things are already installed

Test Plan:
make
Somehow manage to fix the sizing bugs

Summary:
Remove a single `vertical-align: top`, and somewhow it now works. May
the gods of CSS have mercy on us. Also added some tests.

Test Plan:
 - See that the huxley tests don't have any changes
 - See that the new huxley screenshots look reasonable
 - Run the normal tests and see that they work

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7494
Compile .less on demand for test page

Test Plan: Opened test page in Chrome and IE8, saw math.

Reviewers: emily

Reviewed By: emily

Differential Revision: http://phabricator.khanacademy.org/D7581
Replace our annoying lookup tables with a unified symbol table

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
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
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
Add tie symbol (~)

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
Fix our getTypeOfGroup function

Add in the missing `'sizing'` entry, put the `'text'` entry in the correct
place, and replace `groupToType.ord` (a null value) with `groupToType.mathord`
(something real).

Test Plan:
 - See that `^3+` now puts the correct space before the `+`
 - See the new huxley test works, and nothing else has changed

Auditors: alpert
Fix a weird bug with rlap

For some reason, when you have a nested elements that look like
  `display: inline-block; > position: relative; > position: absolute;`
then the `position: absolute;` element is shifted down a bunch. If there is
anything* else inside either of the other two elements, then this behavior
disappears. (This can be seen at [this fiddle](http://jsfiddle.net/qZXRr/). We
have this structure when we create `\llap` and `\rlap`s, and this weird behavior
So, to fix this I added an empty `display: inline-block;` span inside the llap
to fix this.

Test plan:
 - See that the new huxley image looks good
 - Test this in a bunch of browsers and see they also look good

Auditors: alpert
Make errors more informative

Make error messages from the lexing and parsing stages be a bit more helpful. If
provided with the input and a position, the error will display the error
position, and the nearby input with the error position underlined (yay combining
marks). Also, standardize the errors a bit (remove doubled "Error:" strings)

Test plan:
 - Make sure the errors look totally sweet (before: {F15602}, after: {F15603})
 - Trigger every error (that can be triggered) in Parser, Lexer, and buildTree
   using the inputs:
  `a^`
  `a_`
  `a^x^x`
  `a_x_x`
  `\color f`
  `\blue `
  `\Huge`
  `\llap`
  `\text`
  `\dfrac`
  `\dfrac{x}`
  `\d`
  `\blue{`
  `\color{#f`
  `{\Huge{x}}`
 - See that the tests still work

Auditors: alpert