avatar

目录
Katex渲染测试

[TOC]

Setting

{
    tex  : true
}

Custom KaTeX source URL

javascript
// Default using CloudFlare KaTeX's CDN
// You can custom url
editormd.katexURL = {
js : "your url", // default: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min
css : "your url" // default: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min
};

Examples

行内的公式 Inline

E=mc2E=mc^2

Inline 行内的公式 $$E=mc^2$$ 行内的公式,行内的$$E=mc^2$$公式。

c=pmsqrta2+b2c = \\pm\\sqrt{a^2 + b^2}

x>yx > y

f(x)=x2f(x) = x^2

α=1e2\alpha = \sqrt{1-e^2}

\(\sqrt{3x-1}+(1+x)^2\)

sin(α)θ=i=0n(xi+cos(f))\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))

dfracbpmsqrtb24ac2a\\dfrac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}

f(x)=f^(ξ)e2πiξxdξf(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi

1(ϕ5ϕ)e25π=1+e2π1+e4π1+e6π1+e8π1+\displaystyle \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }

(_k=1na_kb_k)2(_k=1na_k2)(_k=1nb_k2)\displaystyle \left( \sum\_{k=1}^n a\_k b\_k \right)^2 \leq \left( \sum\_{k=1}^n a\_k^2 \right) \left( \sum\_{k=1}^n b\_k^2 \right)

a2a^2

a2+2a^{2+2}

a2a_2

x23{x_2}^3

x23x_2^3

1010810^{10^{8}}

ai,ja_{i,j}

nPk_nP_k

c=±a2+b2c = \pm\sqrt{a^2 + b^2}

12=0.5\frac{1}{2}=0.5

kk1=0.5\dfrac{k}{k-1} = 0.5

(nk)(nk)\dbinom{n}{k} \binom{n}{k}

Cx3dx+4y2dy\oint_C x^3\, dx + 4y^2\, dy

1np1kp\bigcap_1^n p \bigcup_1^k p

eiπ+1=0e^{i \pi} + 1 = 0

(12)\left ( \frac{1}{2} \right )

x1,2=b±b24ac2ax_{1,2}=\frac{-b\pm\sqrt{\color{Red}b^2-4ac}}{2a}

x2+2x1{\color{Blue}x^2}+{\color{YellowOrange}2x}-{\color{OliveGreen}1}

k=1Nk2\textstyle \sum_{k=1}^N k^2

12[1(12)n]112=sn\dfrac{ \tfrac{1}{2}[1-(\tfrac{1}{2})^n] }{ 1-\tfrac{1}{2} } = s_n

(nk)\binom{n}{k}

0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+\cdots

k=1Nk2\sum_{k=1}^N k^2

k=1Nk2\textstyle \sum_{k=1}^N k^2

i=1Nxi\prod_{i=1}^N x_i

i=1Nxi\textstyle \prod_{i=1}^N x_i

i=1Nxi\coprod_{i=1}^N x_i

i=1Nxi\textstyle \coprod_{i=1}^N x_i

13e3/xx2dx\int_{1}^{3}\frac{e^3/x}{x^2}\, dx

Cx3dx+4y2dy\int_C x^3\, dx + 4y^2\, dy

12 ⁣Ω34{}_1^2\!\Omega_3^4

多行公式 Multi line

```math or ```latex or ```katex

Code
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
Code
\displaystyle
\left( \sum\_{k=1}^n a\_k b\_k \right)^2
\leq
\left( \sum\_{k=1}^n a\_k^2 \right)
\left( \sum\_{k=1}^n b\_k^2 \right)
Code
\dfrac{ 
\tfrac{1}{2}[1-(\tfrac{1}{2})^n] }
{ 1-\tfrac{1}{2} } = s_n
Code
\displaystyle 
\frac{1}{
\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{
\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {
1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}}
{1+\cdots} }
}
}
Code
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi

KaTeX vs MathJax

https://jsperf.com/katex-vs-mathjax

文章作者: 自由灵
文章链接: https://lemona.tk/57853544.html
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 自由灵的梦境
打赏
  • 微信
    微信
  • 支付寶
    支付寶

评论