9.2 Displayed Mathematics
One-line unnumbered displayed mathematics can be created using:
where <maths> is the mathematics to be displayed.
Example:
Output:
$$
...$$
[15].
Use \[ and \] with
the amsmath package.
The equation environment provides something similar to \[ \], except that the equation is numbered. Modifying the above example:
results in the following output:
![As before but the equation now has a number in
brackets on the right.](img451.png)
which is provided by the amsmath package.
Example:
results in the following output:
![x equals 2 and y equals minus 1 (the word 'and' is in normal text font)](img452.png)
[Re-using an equation]Recall from §5.5. Cross-Referencing that we can
cross-reference most things that LaTeX automatically numbers using \ref
and \label
.
Equations can be cross-referenced in the same way:
Equation numbers are usually given in parentheses, which can be done using:
The amsmath package provides a convenient short cut:
So the above can be written as:
![Equation (9.2)](img454.png)
Note:
Both the equation environment and \[...\] are only designed for one line of maths. Therefore you must not have any line breaks or paragraph breaks within them. The following will cause an error:
Either remove the blank lines or comment them out:
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).