Directive for displayed math (math that takes the whole line for itself).
The directive supports multiple equations, which should be separated by a blank line:
.. math::
(a + b)^2 = a^2 + 2ab + b^2 (a - b)^2 = a^2 - 2ab + b^2
In addition, each single equation is set within a split
environment, which means that you can have multiple aligned lines in an equation, aligned at &
and separated by \\
:
.. math::
- (a + b)^2 &= (a + b)(a + b) \
&= a^2 + 2ab + b^2
For more details, look into the documentation of the AmSMath LaTeX package.
When the math is only one line of text, it can also be given as a directive argument:
(a + b)2 = a2 + 2ab + b2
$$Normally, equations are not numbered. If you want your equation to get a
number, use the ``label`` option. When given, it selects a label for the
equation, by which it can be cross-referenced, and causes an equation number
to be issued. See :role:`eqref` for an example. The numbering style depends
on the output format.$$