How can I render all inline formulas in $..$ with KaTeX?

前端 未结 3 760
无人及你
无人及你 2021-02-05 13:37

So I want to have KaTeX inline formulas like with MathJax.
But so far I\'ve found only render() function which \"draws\" a string to an element.
And I need

3条回答
  •  被撕碎了的回忆
    2021-02-05 14:33

    render can take an extra third argument (default is false) to select inline displaymode:

    katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { displayMode: true });
    

    Is this what you are looking for?

提交回复
热议问题