@leptosia/docute-katex
Using [Katex](https://katex.org/) (The fastest math typesetting library for the web) in Docute.
Last updated 2 years ago by egoist .
MIT · Original npm · Tarball · package.json
$ cnpm install @leptosia/docute-katex 
SYNC missed versions from official npm registry.

@leptosia/docute-katex

Using Katex (The fastest math typesetting library for the web) in Docute.

Usage

First load this plugin via <script> tag:

<!-- Load the CSS in <head> -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.css">

<!-- Load the scripts after docute.js -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@leptosia/docute-katex@1/dist/index.min.js"></script>

This plugin is exposed as window.docuteKatex:

new Docute({
  // ...
  plugins: [
    docuteKatex()
  ]
})

Then you can use Vue components to write Tex expressions:

<InlineMath>c = \\pm\\sqrt{a^2 + b^2}</InlineMath>
<!-- or -->
<InlineMath math="c = \\pm\\sqrt{a^2 + b^2}"></InlineMath>

<BlockMath>c = \\pm\\sqrt{a^2 + b^2}</BlockMath>
<!-- or -->
<BlockMath math="c = \\pm\\sqrt{a^2 + b^2}"></BlockMath>

<InlineMath> wraps the generated HTML with <span> tag while <BlockMath> uses <div> tag.

Optionally you can transform code fences too:

```katex {evaluate: true}
c = \\pm\\sqrt{a^2 + b^2}
```

Then it will be transformed to <BlockMath> component.

License

MIT © LEPTOSIA

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |