Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Eisenberg committed Sep 2, 2015
1 parent 8accf0f commit 2e773e2
Show file tree
Hide file tree
Showing 86 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "KaTeX",
"version": "0.6.0-pre",
"version": "0.5.1",
"main": [
"dist/katex.min.js",
"dist/katex.min.css"
Expand Down
66 changes: 66 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# [<img src="https://khan.github.io/KaTeX/katex-logo.svg" width="130" alt="KaTeX">](https://khan.github.io/KaTeX/) [![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX)

KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://jsperf.com/katex-vs-mathjax/).
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
* **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.

KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and IE 8 - IE 11. A list of supported commands can be on the [wiki](https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX).

## Usage

You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN:

```html
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
```

#### In-browser rendering

Call `katex.render` with a TeX expression and a DOM element to render into:

```js
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element);
```

If KaTeX can't parse the expression, it throws a `katex.ParseError` error.

#### Server side rendering or rendering to a string

To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`:

```js
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}");
// '<span class="katex">...</span>'
```

Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression.

#### Rendering options

You can provide an object of options as the last argument to `katex.render` and `katex.renderToString`. Available options are:

- `displayMode`: `boolean`. If `true` the math will be rendered in display mode, which will put the math in display style (so `\int` and `\sum` are large, for example), and will center the math on the page on its own line. If `false` the math will be rendered in inline mode. (default: `false`)
- `throwOnError`: `boolean`. If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command. If `false`, KaTeX will render the unsupported command as text in the color given by `errorColor`. (default: `true`)
- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color which unsupported commands are rendered in. (default: `#cc0000`)

For example:

```js
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { displayMode: true });
```

#### Automatic rendering of math on a page

Math on the page can be automatically rendered using the auto-render extension. See [the Auto-render README](contrib/auto-render/README.md) for more information.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)

## License

KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT).
1 change: 1 addition & 0 deletions dist/contrib/auto-render.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/fonts/KaTeX_AMS-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_AMS-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_AMS-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_AMS-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Bold.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Bold.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Bold.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Bold.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Caligraphic-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Bold.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Bold.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Bold.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Bold.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Fraktur-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Bold.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Bold.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Bold.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Bold.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Italic.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Italic.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Italic.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Italic.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Main-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-BoldItalic.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-BoldItalic.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-BoldItalic.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-BoldItalic.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Italic.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Italic.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Italic.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Italic.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Math-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Bold.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Bold.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Bold.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Bold.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Italic.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Italic.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Italic.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Italic.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_SansSerif-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Script-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Script-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Script-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Script-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size1-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size1-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size1-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size1-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size2-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size2-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size2-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size2-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size3-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size3-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size3-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size3-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size4-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size4-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size4-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Size4-Regular.woff2
Binary file not shown.
Binary file added dist/fonts/KaTeX_Typewriter-Regular.eot
Binary file not shown.
Binary file added dist/fonts/KaTeX_Typewriter-Regular.ttf
Binary file not shown.
Binary file added dist/fonts/KaTeX_Typewriter-Regular.woff
Binary file not shown.
Binary file added dist/fonts/KaTeX_Typewriter-Regular.woff2
Binary file not shown.
1 change: 1 addition & 0 deletions dist/katex.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/katex.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "katex",
"version": "0.6.0-pre",
"version": "0.5.1",
"description": "Fast math typesetting for the web.",
"main": "katex.js",
"repository": {
Expand Down

0 comments on commit 2e773e2

Please sign in to comment.