2022-12-22 15:47:04 +00:00
---
type: plug
2023-05-23 18:53:53 +00:00
uri: github:silverbulletmd/silverbullet-katex/katex.plug.js
2022-12-22 15:47:04 +00:00
repo: https://github.com/silverbulletmd/silverbullet-katex
author: Zef Hemel
---
<!-- #include [[https://raw.githubusercontent.com/silverbulletmd/silverbullet-katex/main/README.md]] -->
2023-05-23 18:53:53 +00:00
# Silver Bullet KaTeX plug
2022-12-22 15:47:04 +00:00
## Installation
2023-05-26 12:50:43 +00:00
Run the {[Plugs: Add]} command and paste in: `github:silverbulletmd/silverbullet-katex/katex.plug.js`
2022-12-22 15:47:04 +00:00
That's all!
## Use
Put a latex block in your markdown:
```latex
c = \pm\sqrt{a^2 + b^2}
```
And move your cursor outside of the block to live preview it!
2023-05-26 12:50:43 +00:00
**Note:** [KaTeX ](https://katex.org ) itself is not bundled with this plug, it pulls the JavaScript, CSS and fonts from the JSDelivr CDN. This means _this plug will not work without an Internet connection_ . The reason for this limitation is that it is not yet possible to distribute font files via plugs, and KaTeX depends on specific web fonts.
2022-12-22 15:47:04 +00:00
## Build
2023-05-23 18:53:53 +00:00
Assuming you have Deno and Silver Bullet installed, simply build using:
2022-12-22 15:47:04 +00:00
```shell
deno task build
```
Or to watch for changes and rebuild automatically
```shell
deno task watch
```
2023-05-26 12:50:43 +00:00
Then, load the locally built plug, add it to your `PLUGS` note with an absolute path, for instance:
2022-12-22 15:47:04 +00:00
```
- file:/Users/you/path/to/katex.plug.json
```
And run the `Plugs: Update` command in SilverBullet.
<!-- /include -->