1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Update to KaTeX 0.4.3

This commit is contained in:
Jermolene 2015-06-29 21:07:26 +01:00
parent bc885027c3
commit 5f3587c38c
6 changed files with 23 additions and 9 deletions

View File

@ -118,6 +118,12 @@ and "open new window" <span title="$:/core/images/open-window">{{$:/core/images/
!! Hackability Improvements
* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/]] to ~KaTeX version 0.4.3, with the following editions since the previous 0.2.0 release that was distributed with TiddlyWiki 5.1.8:
** Added support for some `\begin`/`\end` environments, including support for `array`, `matrix`, `pmatrix`, `bmatrix`, `vmatrix`, and `Vmatrix`
** Added support for optional `\sqrt` arguments, e.g. `\sqrt[3]{x}`
** Add support for `\phantom`
** Add `\#`, `\&`
** See the [[KaTeX GitHub page|https://github.com/Khan/KaTeX/releases]] for full release details
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/9b4b9d4d8878b8646112de7b5a7b282f50a4d1cb]] ActionSendMessageWidget for more flexible passing of named parameters via new `$name` and `$value` attributes
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/6942efa6289c9f1d99ea9f63972aa314ac06a8b1]] styling for `<kbd>` elements such as <kbd>escape</kbd> and <kbd>enter</kbd>
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/637aaca2fc3563cc695ab5603fc0cde222a770da]] subtle new "pin stripe" pattern for page background - <$button>

View File

@ -14,8 +14,8 @@ KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and
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.1.1/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.1.1/katex.min.js"></script>
<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
@ -26,6 +26,8 @@ Call `katex.render` with a TeX expression and a DOM element to render into:
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`:
@ -35,7 +37,7 @@ 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.
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
@ -49,6 +51,10 @@ For example:
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)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,4 +4,6 @@ This is a TiddlyWiki plugin for mathematical typesetting based on [[KaTeX from K
It is completely self-contained, and doesn't need an Internet connection in order to work. It works both in the browser and under Node.js.
It is currently based on KaTeX version 0.4.3. See https://github.com/Khan/KaTeX/releases for details of releases.
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/katex]]