Svelte Component to convert TeX to rendered SVG using MathJax or rendered MathML using Temml
npm install svelte-tex
Svelte Component to convert TeX to rendered SVG using MathJax or rendered MathML using Temml.
Supports both Svelte 4 and Svelte 5
- Svelte 4: Use components from svelte-tex/package/v4
- Svelte 5: Use components from svelte-tex/package (default)
- Convert TeX to SVG using MathJax
- Convert TeX to MathML using Temml
- Support MathJax options
- Support Temml options
npm install svelte-tex
> MathML is more recommended since MathSVG bundle size is not small.
#### MathML
``ts
`
#### MathSVG
`ts
`
#### MathML
`ts
`
#### MathSVG
`ts
`
> :warning: MathSVG is not small for bundle size.
MathJax is not supports TypeScript for options yet
check texOptions from https://docs.mathjax.org/en/latest/options/input/tex.html#tex-input-processor-options
check svgOptions from https://docs.mathjax.org/en/latest/options/output/svg.html#svg-options
The package includes comprehensive tests for both Svelte 4 and Svelte 5 components:
`bashRun all tests
npm test
$3
- Svelte 4 components: Located in
/src/lib/v4/ - use traditional export let syntax
- Svelte 5 components: Located in /src/lib/ - use modern $props()` syntaxBoth versions provide identical functionality with different syntax approaches for maximum compatibility.