Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-math

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-math

Svelte component to render math MathML, via Temml

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

Svelte Math

A Svelte component to render math with MathML via Temml.

Getting started

Installation

# using pnpm
pnpm i -D svelte-math

# using npm
npm i -D svelte-math

Import in Svelte

<script>
	import { Math } from 'svelte-djot-math';
</script>

Temml css

For the best math rendering, include a temml css and font file when using the component. See the temml docs for more details.

Usage

With slots

<Math>x</Math>

With props

<script>
	const latex = '\\frac{x}{3}';
</script>

<Math latex="y" />
<Math {latex} />
<Math {latex} displayMode />

Props > slots

<Math latex={'z'}>This will *not* be rendered.</Math>

Options

In addition to displayMode seen above, you can pass Temml options via the options prop.

Consult the temml documentations for more details.

<script>
	const latex = 'x \\in \\R';
	const macros = { '\\R': '\\mathbb{R}' };
	const options = { macros, leqno: true };
</script>

<Math {latex} {options} displayMode />

Keywords

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc