Skip to main content

LaTex Math

abbrfor
x'x^\prime
latexsymbol
\varphiφ\varphi
\phiϕ\phi
\mathbb{R}R\mathbb{R}
\in\in
\mathcal{D}D\mathcal{D}
7437\dfrac{4}{3}
MathML
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mn>20</mn>
<mfrac>
<mn>47</mn>
<mn>100</mn>
</mfrac>
</math>
<html>
<head>
<script
type="text/javascript"
async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"
></script>

<title>mathsjax</title>
</head>
<body>
$$7\frac{4}{3}$$
</body>
</html>

括号 {brackets-and-parentheses}

typerender
Parentheses; round brackets()()
Brackets; square brackets[][]
Braces; curly brackets{}\{\}
Angle brackets\langle \rangle
Pipes; vertical bars|x+y|, x+y\vert x+y \vert
Double pipesx+y\|x+y\|
ceiling\lceil\rceil
floor\lfloor\rfloor
  • \left,\right + \||({[<>]}) 让括号更大 - 动态大小
  • \big,\Big,\bigg,\Bigg, + [lr] + 括号 - 手动设置大小
((((\bigl(\Bigl(\biggl(\Biggl(

FAQ

katex unicodeTextInMathMode

KaTeX vs MathJax

  • KaTeX
    • 只关心 TeX/LaTeX -> HTML
    • HTML+CSS 来渲染,对 JS 依赖少 - 要求相对新一些的浏览器
    • 会更快一些
    • 支持的功能特性会少一些
  • MathJax
    • 还支持 LaTeX、MathML, AsciiMath
    • 可输出 HTML, SVG, MathML.
    • 包含输出 accessible 信息