2014-09-21 22:03:07 +00:00
title: HelloThere
This is a TiddlyWiki plugin for mathematical typesetting based on KaTeX from Khan Academy.
2014-10-06 20:20:19 +00:00
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.
2014-09-22 09:41:12 +00:00
2014-09-21 22:03:07 +00:00
! Installation
To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
[[$:/plugins/tiddlywiki/katex]]
! Using KaTeX
2014-09-22 11:06:49 +00:00
The usual way to include ~LaTeX is to use `$$`, as shown in the examples below.
The underlying KaTeX widget is provided under the name `<$latex>` and is also available under the alias `<$katex>`. It's better to use the generic `<$latex>` name unless you are running multiple ~LaTeX plugins and wish to specifically target KaTeX.
2014-09-21 22:03:07 +00:00
! Examples
These examples are taken from http://khan.github.io/KaTeX/
!! Example 1
2015-12-24 16:45:45 +00:00
If the text between `$$` contains newlines it will rendered in display mode:
2015-12-23 17:55:05 +00:00
2014-09-21 22:03:07 +00:00
```
2015-12-24 16:45:45 +00:00
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
2014-09-21 22:03:07 +00:00
```
2015-12-24 16:45:45 +00:00
$$
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
$$
2014-09-21 22:03:07 +00:00
!! Example 2
```
2015-12-24 16:45:45 +00:00
$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$
2014-09-21 22:03:07 +00:00
```
2015-12-24 16:45:45 +00:00
$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$
2015-03-14 08:34:16 +00:00
2014-09-21 22:03:07 +00:00
2015-12-23 17:55:05 +00:00
!! Example 3
2014-09-21 22:03:07 +00:00
```
2015-12-24 16:45:45 +00:00
$$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$
2014-09-21 22:03:07 +00:00
```
2015-12-24 16:45:45 +00:00
$$
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$
2014-09-21 22:03:07 +00:00
!! Widget Example
For more flexibility the KaTeX widget can also be used via the full widget syntax:
```
2015-12-23 17:55:05 +00:00
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
2014-09-21 22:03:07 +00:00
```
2015-12-23 17:55:05 +00:00
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
2014-09-24 09:50:49 +00:00
! Error Handling
2015-09-08 09:37:33 +00:00
Any LaTeX syntax errors are flagged with the problematic syntax highlighted. For example:
2014-09-24 09:50:49 +00:00
```
2015-12-23 17:55:05 +00:00
$$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
2014-09-24 09:50:49 +00:00
```
2015-12-23 17:55:05 +00:00
$$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
2014-09-24 09:50:49 +00:00