Socket
Socket
Sign inDemoInstall

@cartamd/plugin-math

Package Overview
Dependencies
130
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cartamd/plugin-math

This plugin adds support for **Katex** expressions. Install it using:


Version published
Weekly downloads
70
decreased by-10.26%
Maintainers
1
Install size
7.12 MB
Created
Weekly downloads
 

Readme

Source

Carta Math Plugin

This plugin adds support for Katex expressions. Install it using:

npm i @cartamd/plugin-math

Setup

Styles

You need to get access to the katex stylesheet, to do so, you can either install katex using:

npm i katex

and then adding this import to your app:

import 'katex/dist/katex.css';

or by using a content delivery network:

<link
	rel="stylesheet"
	href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css"
	integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI"
	crossorigin="anonymous"
/>

Extension

<script lang="ts">
	import { Carta, MarkdownEditor } from 'carta-md';
	import { math } from '@cartamd/plugin-math';

	const carta = new Carta({
		extensions: [math()]
	});
</script>

<MarkdownEditor {carta} />

Usage

Inline:

Pythagorean theorem: $a^2+b^2=c^2$

Block:

$$
{\displaystyle {d^{2}x^{\mu } \over ds^{2}}+\Gamma ^{\mu }{}_{\alpha \beta }{dx^{\alpha } \over ds}{dx^{\beta } \over ds}=0}
$$

Documentation

Checkout the docs for examples, options and more.

Keywords

FAQs

Last updated on 12 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc