mathjax-svelte
v0.0.2
Published
A Svelte component for MathJax
Downloads
18
Maintainers
Readme
mathjax-svelte
Svelte component for MathJax
Installation
npm i mathjax-svelte
Usage
<script>
import { Math } from 'mathjax-svelte';
</script>
<Math t={`E = {mc^2}`} />
API
Math
Props
| Property | Type | Default | | -------- | ------- | ------- | | t | String | "" | | display | Boolean | true | | settings | Object | {} | | class | String | "" |
useMathJax
import type { Writable } from 'svelte/store';
function useMathJax(config: MathJaxConfig): {
output: Writable<string>;
error: Writable<any>;
};
MathJaxConfig
export interface MathJaxConfig {
t: string;
node?: HTMLElement;
display?: boolean;
settings?: OptionList;
}
Developing
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
Building
To create a production version of your app:
npm run build
To deploy your app, you may need to install an adapter for your target environment.