Commit Graph

210 Commits

Author SHA1 Message Date
Ben Alpert
cba70b51fe Make built files use only ASCII characters
Test Plan: Searched for `[^\x00-\x7f]` in vim and had no results, where there were before.

Reviewers: emily

Reviewed By: emily

Differential Revision: http://phabricator.khanacademy.org/D13459
2014-10-01 14:07:11 -07:00
Emily Eisenberg
5722b45633 Merge pull request #101 from kevinb7/over
added support for \over
2014-09-27 01:32:30 -07:00
Kevin Barabash
c566ae6888 added support for \over
changed stopType (string) parameter to breakOnInfix (boolean)
renamed rewriteInfixNodes to handleInfixNodes

added a test for {1 \over 2} \over 3, fixed some grammar, and added code in the parser to squash superfluous ordgroups

removed squashOrdGroups and instead don't create an "ordgroup" if one already exists

removed unnecessary variable

moved variable declarations out of "if" statements
removed comment

Fixed style issue with where variables are declared and remove unnecessary comment from functions.js
2014-09-26 15:31:45 -06:00
Ben Alpert
0236cdc619 Merge pull request #107 from dbieber/patch-2
Update CONTRIBUTING.md
2014-09-24 11:28:21 -07:00
Ben Alpert
5e535af75f Merge pull request #106 from dbieber/patch-1
Update CONTRIBUTING.md
2014-09-24 11:25:45 -07:00
Ben Alpert
240981e3a2 Merge pull request #70 from mathiasbynens/patch-1
README: Remove redundant `type` attribute
2014-09-23 22:16:25 -07:00
Emily Eisenberg
a18adfdfad Merge pull request #104 from kevinb7/error.position
added position property to ParseError
2014-09-23 14:04:17 -07:00
Kevin Barabash
afaec30d0a added position property to ParseError 2014-09-23 14:38:41 -06:00
David Bieber
5916e1287d Update CONTRIBUTING.md 2014-09-22 21:07:11 -07:00
David Bieber
bd795020f0 Update CONTRIBUTING.md
fix spelling of install
2014-09-22 21:05:19 -07:00
Emily Eisenberg
e0dece759f Merge pull request #91 from MandaBrown/teeny_tiny_typo_fix
Fixes a teeny tiny typo in a comment.
2014-09-22 14:25:28 -07:00
Emily Eisenberg
bd6f762f94 Improve the fonts.less experience
Summary:
Create a fonts.less file which generates identical css to fonts.css, but using
less rules to be more understandable and customizable. For example, add the
ability to change where the fonts directory is located (instead of mandating it
be located next to the less file), and add the ability to disable specific font
formats (like disable EOTs when IE8 support isn't needed).

Test Plan:
 - Ensure that the test page and huxley page still work
 - Ensure that the output of `./node_modules/.bin/lessc static/fonts.less` is
   the same as the original css by running both through
   `./node_modules/.bin/cleancss` and diffing them.
 - Ensure that the huxley screenshots haven't changed
 - Ensure that the build step still works

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13326
2014-09-22 14:23:23 -07:00
Emily Eisenberg
824fb7fd2f Update huxley screenshots
Update huxley, and then use the Dockerfile to create new huxley screenshots.

Test plan:
 - Make sure generating new huxley screenshots works
 - Ensure that re-generating huxley screenshots produces no changes

Auditors: alpert
2014-09-22 13:58:19 -07:00
Ben Alpert
317564a173 Catch exceptions on test page
Summary: This makes typing into the box bearable with break-on-exception enabled.

Test Plan: Typed into box; I didn't blow up.

Reviewers: emily

Reviewed By: emily

Subscribers: jessie

Differential Revision: http://phabricator.khanacademy.org/D13314
2014-09-22 11:46:26 -07:00
Mandy Brown
fdc578563b Fixes a teeny tiny typo in a comment. 2014-09-19 21:29:50 -04:00
Emily Eisenberg
d2f41a19a5 Merge pull request #89 from patrickkang/master
Add \partial symbol
2014-09-19 12:34:00 -07:00
Emily Eisenberg
b675587259 Merge pull request #71 from jmendeth/simple-cli
Simple CLI
2014-09-19 11:51:06 -07:00
Emily Eisenberg
bd6ebf23dd Merge pull request #54 from adammark/patch-1
Update README.md
2014-09-19 11:49:02 -07:00
Patrick Kang
b9333a36d1 Add partial symbol 2014-09-19 14:14:46 -04:00
Emily Eisenberg
73c33b015a Merge pull request #72 from evestera/setrelops
Added set theory and logic symbols
2014-09-18 22:06:33 -07:00
Erik Vesteraas
840ab70191 Added various set theory and logic symbols
\subset, \supset, \subseteq, \supseteq, \cap, \cup, \setminus,
\neg, \lnot, \top, \bot, \emptyset, \varnothing, \land, \lor,
\wedge, \vee, \notin, \nsubseteq, \nsupseteq, \models
2014-09-19 06:59:59 +02:00
Emily Eisenberg
5476c849c9 Merge pull request #44 from grizzilus/master
Fix license typo in README
2014-09-18 21:03:11 -07:00
Emily Eisenberg
1f9393476b Add CLA information in CONTRIBUTING.md
Auditors: alpert
2014-09-18 20:05:51 -07:00
Emily Eisenberg
ea5ee95dbe Warn when the website is in quirks mode
Summary:
KaTeX doesn't work correctly in quirks mode. Warn in the console and disable
rendering if that happens.

Test Plan:
 - Make sure the test still loads and renders math
 - Make sure a warning is thrown when the doctype is removed, and no more math
   is rendered
 - Make sure the tests pass both on the web and with `make test`

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13192
2014-09-17 15:13:56 -07:00
Xavier Mendez
8bd9bfbcfe Ignore NPM debug logs
Not related to this PR, but good to have.
2014-09-17 15:47:04 +02:00
Xavier Mendez
f6dd9e93fb Add simple CLI 2014-09-17 15:46:20 +02:00
Mathias Bynens
2ab395a55f README: Remove redundant type attribute 2014-09-17 15:39:11 +02:00
Emily Eisenberg
b7e55607cc Add skew and italic metrics for ttfs
Summary:
Add the ability to base the metrics for a TTF character on the metrics
from one of the TFM characters.

Test Plan:
 - Make sure the tests still work
 - Make sure huxley tests didn't change

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13217
2014-09-16 17:40:20 -07:00
Emily Eisenberg
e6b3cbe7c1 Add font metrics for \iint, \iiint
Also, fix the python dict keys so we actually get the metrics back into the
javascript correctly.

Fixes #56

Auditors: alpert
2014-09-16 16:00:30 -07:00
Adam Mark
5cfa59e5b6 Update README.md
Must specify UTF-8 in document for math characters to render properly.
2014-09-16 11:17:18 -04:00
Jeremy Engel
199bc00385 Fix license typo in README 2014-09-15 18:05:10 -07:00
Emily Eisenberg
aa7052d03a Merge pull request #39 from mgp/master
Fix links to JS source files
2014-09-15 13:24:28 -07:00
Mike Parker
faf69f238a Fix links to JS source files
These links were missing the `src` path component.
2014-09-15 12:51:29 -07:00
Emily Eisenberg
f76688b639 Bump version to v0.1.0
Also ready KaTeX for releasing

Auditors: alpert
2014-09-15 03:04:11 -07:00
Emily Eisenberg
35d9d972fd Move js files into src/
Test plan:
- Make sure huxley tests, jasmine tests, make build, make metrics, make test all
  still work.

Auditors: alpert
2014-09-15 02:50:34 -07:00
Emily Eisenberg
032b8a63e6 Improve readme
Add good README and CONTRIBUTING files.

Auditors: alpert
2014-09-15 02:41:19 -07:00
Emily Eisenberg
38a6ce7990 Add a Dockerfile for huxley tests
Summary:
Add the dockerfile that I've been using to make huxley screenshots so
others can test their changes by making huxley screenshots. Include a readme
about how to use it correctly.

Test Plan: - Use the dockerfile by running the given commands, see it works

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D12773
2014-09-14 21:30:06 -07:00
Emily Eisenberg
6b674873ea Rename katex.process to katex.render
Test plan:
 - Make sure tests work and huxley tests didn't change

Auditors: alpert
2014-09-14 21:20:27 -07:00
Emily Eisenberg
9dc767041d Improve build process
Summary:
Improve the build process by combining the CSS files, automatically
selecting font files to include, and building .tar.gz and .zip files.

Test Plan:
 - Make sure tests work
 - Make sure huxley screenshots didn't change
 - Make sure zip and tar.gz files contain only files we want to distribute

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13159
2014-09-14 19:31:38 -07:00
Emily Eisenberg
f63af87f17 Add looots of comments
Summary:
Add comments everywhere! Also fix some small bugs like using Style.id
instead of Style.size, and rename some variables to be more descriptive.

Fixes #22

Test Plan:
 - Make sure the huxley screenshots didn't change
 - Make sure the tests still pass

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13158
2014-09-14 19:23:39 -07:00
Ben Alpert
79a5687057 Add Travis badge to README
Auditors: emily
2014-09-14 16:02:52 -07:00
Emily Eisenberg
0dca731da6 Add accents
Summary:
Add support for math-mode accents. This involves a couple changes.
First, in order to correctly position the accents, we must know the kern between
every character and the "skewchar" in that font. To do this, we improve our tfm
parser to run the mini-kern-language and calculate kerns. We then export these
into fontMetrics.js.

Then, we add normal support for accents. In particular, we do some special
handling for supsubs around accents. This involves building the supsub
separately without the accent, and then replacing its base with the built
accent.

Finally, the character in the fonts for the \vec command is a combining unicode
character, so it is shifted to the left, but none of the other characters do
this. We add some special handling for \vec to account for this.

Fixes #7

Test Plan:
 - Make sure tests pass
 - Make sure no huxley screenshots changed, and the new one looks good

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13157
2014-09-13 21:30:35 -07:00
Emily Eisenberg
0d42a902ac Fix dots spacing
\cdots, \ddots, and \vdots are all ords, not puncts.

Test plan:
 - Make sure no huxley tests changed

Auditors: alpert
2014-09-13 19:25:15 -07:00
Emily Eisenberg
90573fcaf2 Fix rendering of lists in \left/\right
Test plan:
 - Make sure tests work
 - Make sure screenshots didn't change, and new screenshot looks good

Auditors: alpert
2014-09-13 16:56:15 -07:00
Ben Alpert
7df5b4bba8 Add code for generating HTML
Test Plan: Ran unit tests. Looked at `\blue{\displaystyle \left(\dfrac{a^\sigma}{\sin \theta}\right\Updownarrow \intop_{1/2}^{z^z} \sum_{i=0}^\infty x \,dx}` in Chrome and saw the future in my eyes.

Reviewers: emily

Reviewed By: emily

Subscribers: jessie

Differential Revision: http://phabricator.khanacademy.org/D13154
2014-09-12 17:59:26 -07:00
Ben Alpert
3e78a76a47 Enable travis-ci.org
This tests against Node 0.10 (latest stable) and 0.11 (latest dev).

Test Plan: Crossed fingers. In theory we'll see this at https://travis-ci.org/Khan/KaTeX as soon as I push it.

Auditors: emily
2014-09-12 17:50:39 -07:00
Emily Eisenberg
79ab06d88d Get rid of the lookahead-y dots
Summary:
The `\dots` and `\dots{c,o,b,i,m}` commands do more than just show characters,
they add extra space and `\dots` also looks ahead to determine what kind of
environment it is in (see [this math.sx post]
(http://tex.stackexchange.com/questions/122491/difference-of-the-dots)). We
can't support that yet, so remove them.

Also, add comments to the extract_ttf script to show what caracters we are
extracting metrics for.

Test Plan: - Make sure tests work

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D13151
2014-09-12 17:29:49 -07:00
Emily Eisenberg
2920348bdd Fix large integrals in IE 8
IE 8 clips the \int sign when it is `display: inline-block`. This fixes that.

Test plan:
 - Make sure no huxley tests changed

Auditors: alpert
2014-09-12 16:27:48 -07:00
Emily Eisenberg
ad056abbaf Fix undefined maxFontSize
Fix getting a NaN maxFontSize in makeVList because symbolNodes don't have a
maxFontSize property.

Test plan:
 - Make sure no huxley screenshots changed

Auditors: alpert
2014-09-12 15:38:48 -07:00
Emily Eisenberg
6ee2ecf47e Add \dots commands
Add all of the \dots commands, and import their metrics from the ttf files.

Fixes #23

Auditors: alpert
2014-09-12 15:02:18 -07:00