Time for action – typesetting multi-line formulas
We shall use the amsmath
package to experiment with a very long formula and with a system of equations:
Start a new document on an A6 paper and load the
amsmath
package.\documentclass{article} \usepackage[a6paper]{geometry} \usepackage{amsmath} \begin{document}
Use the
multline
environment to span a long equation over three lines. End the lines with\\
:\begin{multline} \sum = a + b + c + d + e \\ + f + g + h + i + j + \\ + k + l + m + n \end{multline} \end{document}
Typeset and look at the formula:
Now we handle a system of equations. Use the
gather
environment to add these equations. Again, end lines with\\
:\begin{gather} x + y + z = 0 \\ y - z = 1 \end{gather}
Typeset and look at the equations:
Commonly, equation systems are aligned at the equal sign. Let's do this. Use the
&
symbol to mark the point that we wish to align:\begin{align} x + y + z &= 0 \\ y - z&= 1 \end{align}
Typeset; now the equations are aligned as...