@cartamd/plugin-tikz
TypeScript icon, indicating that this package has built-in type declarations

4.1.8 • Public • Published

Carta TikZ Plugin

This plugin adds support for PGF/TikZ illustrations thanks to TikzJax. It uses the code generated for the Obsidian-TikZ plugin. Install it using:

npm i @cartamd/plugin-tikz

Important Notes

  1. This plugin requires the import of a heavy library (~7Mb), which is dynamically imported at runtime;
  2. Generated images are not ssr compatible, as they are rendered in the browser;
  3. You need to update your sanitizer to allow the specific tag: <div type="text/tikz">.

Setup

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

	import '@cartamd/plugin-tikz/fonts.css';

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

<MarkdownEditor {carta} />

Documentation

Checkout the docs for examples, options and more.

Dependents (0)

Package Sidebar

Install

npm i @cartamd/plugin-tikz

Weekly Downloads

7

Version

4.1.8

License

MIT

Unpacked Size

18.7 MB

Total Files

13

Last publish

Collaborators

  • astrobear