https://github.com/WoolDoughnut310/mathjax-svelte
  
  
    A Svelte component for MathJax 
    https://github.com/WoolDoughnut310/mathjax-svelte
  
svelte typescript
        Last synced: 6 months ago 
        JSON representation
    
A Svelte component for MathJax
- Host: GitHub
 - URL: https://github.com/WoolDoughnut310/mathjax-svelte
 - Owner: WoolDoughnut310
 - Created: 2023-01-03T20:49:02.000Z (almost 3 years ago)
 - Default Branch: main
 - Last Pushed: 2023-01-08T12:43:50.000Z (almost 3 years ago)
 - Last Synced: 2024-04-24T20:28:07.374Z (over 1 year ago)
 - Topics: svelte, typescript
 - Language: TypeScript
 - Homepage:
 - Size: 47.9 KB
 - Stars: 0
 - Watchers: 1
 - Forks: 0
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-svelte - mathjax-svelte - A Svelte component for MathJax. (UI Components / Miscellaneous)
 
README
          # mathjax-svelte
Svelte component for MathJax
Based on [mathjax-react](https://github.com/CharlieMcVicker/mathjax-react/)
## Installation
```bash
npm i mathjax-svelte
npm i mathjax-full@3
```
## Usage
```svelte
	import { Math } from 'mathjax-svelte';
```
## API
### Math
**Props**
| Property | Type    | Default |
| -------- | ------- | ------- |
| t        | String  | ""      |
| display  | Boolean | true    |
| settings | Object  | {}      |
| class    | String  | ""      |
### useMathJax
```typescript
import type { Writable } from 'svelte/store';
function useMathJax(config: MathJaxConfig): {
	output: Writable;
	error: Writable;
};
```
### MathJaxConfig
```typescript
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:
```bash
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:
```bash
npm run build
```
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.