Katex syntax to write mathematical expressions in html
Here are 10 examples of KaTeX expressions along with their corresponding KaTeX syntax:
-
Square Root:
- Expression: √x
- KaTeX Syntax:
<InlineMath math="\sqrt{x}" />
-
Fraction:
- Expression: ½
- KaTeX Syntax:
<InlineMath math="\frac{1}{2}" />
-
Exponents:
- Expression: x²
- KaTeX Syntax:
<InlineMath math="x^2" />
-
Summation:
- Expression: Σ (from 1 to n)
- KaTeX Syntax:
<InlineMath math="\sum_{i=1}^{n}" />
-
Integral:
- Expression: ∫ (from a to b)
- KaTeX Syntax:
<InlineMath math="\int_{a}^{b}" />
-
Matrix:
- Expression: [1, 2; 3, 4]
- KaTeX Syntax:
<BlockMath math="\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}" />
-
Square Root with Radical:
- Expression: ∛(x + 1)
- KaTeX Syntax:
<InlineMath math="\sqrt[3]{x + 1}" />
-
Derivative:
- Expression: f'(x)
- KaTeX Syntax:
<InlineMath math="f'(x)" />
-
Infinity:
- Expression: ∞
- KaTeX Syntax:
<InlineMath math="\infty" />
-
Greek Letters:
- Expression: α, β, γ
- KaTeX Syntax:
<InlineMath math="\alpha, \beta, \gamma" />
You can use these examples as templates for rendering various mathematical expressions and notations in your React application using KaTeX. Simply replace the content within the math
attribute with the specific expression you want to display.
Published on: Sep 11, 2023, 10:11 PM
Updated on: Sep 11, 2023, 10:12 PM