mirror of
https://github.com/SillyTavern/Extension-LaTeX.git
synced 2026-10-15 13:32:11 +00:00
Adds an ability to render LaTeX and AsciiMath formulas in SillyTavern chats.
- JavaScript 100%
| assets | ||
| dist | ||
| src | ||
| .gitignore | ||
| LICENSE | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| webpack.config.js | ||
Extension-LaTeX
Render math formulas in LaTeX/AsciiMath format in SillyTavern chats.
How to use
- Install the "LaTeX" extension from the "Download Extensions & Assets" menu in the Extensions panel.
- Use the
latexorasciimathcode block to render math formulas in LaTeX or AsciiMath format respectively.
Alternative syntax
In the assets folder you'll find a collection of regex scripts for alternative LaTeX syntax options. Import them with the Regex extension to use them in your chats.
- Double Dollar Signs
($$...$$) - Single Dollar Signs
($...$) - LaTeX Brackets
(\[...\]) - LaTeX Parentheses
(\(...\))
Legacy syntax
To use the legacy syntax with $$ (LaTeX) and $ (AsciiMath) delimiters in Markdown, import the following scripts with the Regex extension.
Example
Code blocks
```latex
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
```
```asciimath
int_{-oo}^{oo} e^{-x^2} dx = sqrt{pi}
```
With regex scripts
$$\boxed{\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}}$$
$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$
\[ \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} \]
\( \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} \)
License
AGPL-3.0