equation

Display maths: a block of LaTeX on a line of its own, centred and typeset with KaTeX.

equationNodeAliases:eq
On this page
The quadratic formula, x equals minus b plus or minus the square root of b squared minus 4ac, all over 2a, centred on a line of its own.The quadratic formula, x equals minus b plus or minus the square root of b squared minus 4ac, all over 2a, centred on a line of its own.

#Attributes

colourImplicit
The colour the equation is set in: one of the nine hues, or neutral for the body-text colour. A light- or dark- tone, or a hex(…) or rgb(…) literal, compiles but is drawn in the default colour.
paint
Also written: colorCan be written as shorthand: equation:value
Defaultneutral

#Allowed content

Body { }TeX math source (block equation content)

#Allowed in

#Examples

equation{
    E = mc^2
}
equation:blue{
    \int_0^1 x^2 \, dx = \frac{1}{3}
}
equation{
    (a + b)^2 &= a^2 + 2ab + b^2 \\
    (a - b)^2 &= a^2 - 2ab + b^2
}

#Notes

  • $…$ is the same notation inside a sentence.
  • The body is literal: it reaches KaTeX exactly as written, braces and backslashes included.
  • An & outside any \begin…\end environment the body opens sets the whole body as align*, so lines separated by \\ align at their &. An & inside cases, a matrix or an array belongs to that environment.
  • A {{…}} in the body is spliced while the document compiles. A @let value or arithmetic on constants works; a value read from the canvas, such as {{#k.value}}, is refused.
  • TeX that KaTeX cannot parse is shown as its source.
  • In the narrative, a long equation breaks at its relations and operators, and one that cannot break scrolls sideways inside its own box.

#Writing guidance

  • Prose & headings — What the narrative carries that the picture cannot, headings a reader can navigate by, and maths as LaTeX.

Last updated