數學公式前端 Katex


Latex

% \f is defined as f(#1) using the macro
\f{x} = \int_{-\infty}^\infty
    \hat \f\xi\,e^{2 \pi i \xi x}
    \,d\xi

Katex

  • 用latex表達數學公式
  • 資源server side rendering或generate HTML
  • To generate HTML on the server or to generate an HTML string of the rendered math, you can use
katex.renderToString:

var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
    throwOnError: false
});
// '<span class="katex">...</span>'

MathJax

MathML