Skip to content

Commit a3b23a1

Browse files
committed
Add KaTeX to the distribution.
1 parent 0bbb5ac commit a3b23a1

36 files changed

+46
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# [<img src="https://khan.github.io/KaTeX/katex-logo.svg" width="130" alt="KaTeX">](http://khan.github.io/KaTeX/) [![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX)
2+
3+
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
4+
5+
* **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/).
6+
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
7+
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
8+
* **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.
9+
10+
KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and IE 8 - IE 11.
11+
12+
## Usage
13+
14+
Download the built files from [the releases page](https://github.com/khan/katex/releases). Include the `katex.min.js` and `katex.min.css` files on your page:
15+
16+
```html
17+
<link rel="stylesheet" type="text/css" href="/path/to/katex.min.css">
18+
<script src="/path/to/katex.min.js" type="text/javascript"></script>
19+
```
20+
21+
Call `katex.render` with a TeX expression and a DOM element to render into:
22+
23+
```js
24+
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element);
25+
```
26+
27+
To generate HTML on the server, you can use `katex.renderToString`:
28+
29+
```js
30+
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}");
31+
// '<span class="katex">...</span>'
32+
```
33+
34+
Make sure to include the CSS and font files, but there is no need to include the JavaScript.
35+
36+
## Contributing
37+
38+
See [CONTRIBUTING.md](CONTRIBUTING.md)
39+
40+
## License
41+
42+
KaTeX is licenced under the [MIT License](http://opensource.org/licenses/MIT).
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/librustdoc/html/static/katex/katex.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustdoc/html/static/katex/katex.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)