Skip to content

Equation

The Equation component renders LaTeX math expressions using KaTeX. It supports both single display-mode equations with optional labels and multi-step derivations with annotations.

Basic expression

A single centered equation with a label underneath.

Step-by-step derivation

Use steps to show a multi-line derivation. Each step can have an optional annotation displayed to the right.

Complex formula

LaTeX commands like \frac, \int, and \sqrt are fully supported. In YAML, backslashes in expressions should be quoted if they contain special characters.

Properties

PropertyTypeDefaultDescription
expressionstringLaTeX expression to render (single expression mode)
labelstringOptional label displayed below the equation
stepsEquationStep[]Array of derivation steps (steps mode)

Either expression or steps must be provided.

EquationStep

PropertyTypeDefaultDescription
expressionstring(required)LaTeX expression for this step
annotationstringOptional annotation displayed to the right

Accessibility

  • The component container has role="math" and an aria-label containing the raw LaTeX source expression(s).
  • For single expressions, the aria-label reads “Equation: {expression}”.
  • For step derivations, the aria-label reads “Equation steps: {expr1}; {expr2}; …”.
  • If KaTeX fails to parse an expression, the raw LaTeX is shown in a monospace code fallback so content is never silently lost.