JesseFarebro / katex.macro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

katex.macro

A babel-macro to generate static KaTeX markup as JSX. The KaTeX runtime is large, this allows you to generate markup for static content without bundling the runtime.

Installation

npm i --save katex.macro

Usage

import katex from "katex.macro"

const Component = () => (
  <div>
    { katex`\int_0^1 dx = 1` }
  </div>
)

will replace the katex macro with the appropriate markup:

const Component = () => (
  <div>
    <span className="katex">
      <span className="katex-mathml">
        ...
      </span>
      <span className="katex-html">
        ...
      </span>
    </span>
  </div>
)

About


Languages

Language:JavaScript 100.0%