1.0.5 • Published 7 months ago

svelte-tex v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

svelte-tex

npm version

Svelte Component to convert TeX to rendered SVG using MathJax or rendered MathML using Temml.

Try It Online

Features

  • Convert TeX to SVG using MathJax
  • Convert TeX to MathML using Temml
  • Support MathJax options
  • Support Temml options

Installation

npm install svelte-tex

Usage

MathML is more recommended since MathSVG bundle size is not small.

MathML

<script lang="ts">
  import MathML from 'svelte-tex/package/MathML.svelte';

  // use String.raw to escape `\`
  const tex = String.raw`\frac{(n^2+n)(2n+1)}{6}`;
</script>

<MathML {tex} />
// or include Temml options
<MathML {tex} temmlOptions={{}} />

MathSVG

<script lang="ts">
  import MathSVG from 'svelte-tex/package/MathSVG.svelte';

  // use String.raw to escape `\`
  const tex = String.raw`\frac{(n^2+n)(2n+1)}{6}`;
</script>

<MathSVG {tex} />
// or include MathJax options
<MathSVG {tex} texOptions={{}} svgOptions={{ fontCache: 'local' }} />

: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

1.0.2

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1-1

9 months ago

0.0.1

9 months ago