marked-extended-latex

1.1.0 • Public • Published

marked-extended-latex

LaTex support to Marked

Usage

import Katex from "katex";
import Marked from "marked";
import extendedLatex from "marked-extended-latex";

const options = {
  render: (formula: string, displayMode: boolean) => Katex.renderToString(formula, { displayMode })
};

marked.use(extendedLatex(options));
marked("$a+b=c$");
// <p><span class="katex"><span ...

options

  • lazy, a boolean, whether to use lazy rendering, default false
  • render, a callback, LaTex renderer. When lazy is true, it can be an async function (returns Promise)

Dependencies (0)

    Dev Dependencies (22)

    Package Sidebar

    Install

    npm i marked-extended-latex

    Weekly Downloads

    402

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    14.3 kB

    Total Files

    17

    Last publish

    Collaborators

    • yazi