Math

Math elements render mathematical equations using LaTeX syntax with KaTeX rendering. They're perfect for displaying complex mathematical formulas, equations, and expressions in a clean, professional format. Each math element can include an optional caption for better context and accessibility.

Properties

equation

string required

The LaTeX equation to render. This should contain valid LaTeX mathematical notation that KaTeX can parse and display.

caption

string optional

A descriptive caption for the equation. This appears below the rendered math and provides context or explanation for the mathematical expression.

Examples

Basic Math Equation

x 2 + y 2 = z 2 x^2 + y^2 = z^2
<scalar-math equation="x^2 + y^2 = z^2">
</scalar-math>
x 2 + y 2 = z 2 x^2 + y^2 = z^2
::scalar-math{ equation="x^2 + y^2 = z^2"}

Math with Caption

E = m c 2 E = mc^2
Einstein's mass-energy equivalence
<scalar-math
  equation="E = mc^2"
  caption="Einstein's mass-energy equivalence">
</scalar-math>
E = m c 2 E = mc^2
Einstein's mass-energy equivalence
::scalar-math{ equation="E = mc^2" caption="Einstein's mass-energy equivalence" }

Complex Mathematical Expression

e x 2 d x = π \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
Gaussian integral
<scalar-math
  equation="\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}"
  caption="Gaussian integral">
</scalar-math>
e x 2 d x = π \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
Gaussian integral
::scalar-math{ equation="\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}" caption="Gaussian integral" }

Matrix Equation

( a b c d ) ( x y ) = ( e f ) \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} e \\ f \end{pmatrix}
System of linear equations in matrix form
<scalar-math
  equation="\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} e \\ f \end{pmatrix}"
  caption="System of linear equations in matrix form">
</scalar-math>
( a b c d ) ( x y ) = ( e f ) \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} e \\ f \end{pmatrix}
System of linear equations in matrix form
::scalar-math{ equation="\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} e \\ f \end{pmatrix}" caption="System of linear equations in matrix form" }