How can I number a few equations together
The amsmath package has many facilities, among which the aligned
environment that does similarly to align
, but produces a block usable in a bigger formula:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
a &= x_{ij} \\
b_j &= y_j
\end{aligned}
\end{equation}
\end{document}
What's the difference with split
? That aligned
, like align
, allows many alignment points.
The amsmath
package provides the split
environment. You can use a split
environment inside an align
environment or inside an equation
environment; a little example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\begin{split}
a &= x_{ij} \\
b_j &= y_j
\end{split}
\end{align}
\end{document}
Although amsmath
functionality is preferred, there are a multitude of ways this can be achieved. Here's one using only an array
:
\documentclass{article}
\begin{document}
\begin{equation}
\renewcommand{\arraystretch}{1.2}% To spread out the equations
\begin{array}{r@{\;}l}
a =& x_{ij} \\
b_j =& y_j
\end{array} \label{eq}
\end{equation}
\end{document}
It has the same layout - in terms of input - to the align
environment. Moreover, it now also straight-forward to combine the equations using a brace (say) - achieved using a \left.
and \right\}
pair:
\documentclass{article}
\begin{document}
\begin{equation}
\renewcommand{\arraystretch}{1.2}% To spread out the equations
\left.\begin{array}{r@{\;}l}
a =& x_{ij} \\
b_j =& y_j
\end{array}\right\} \label{eq}
\end{equation}
\end{document}
rcases
(from mathtools
) also provides the above functionality, but is usually intended for a different purpose. As such, the spacing/alignment is not as expected. One can use the undocumented \newcases
to define a comparable alternative. Below I've adapted rcases
to have a right-aligned first column, and introduce a \thickmuskip
between the two "columns", similar to what one would expect around ordinary and relation atoms:
\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\makeatletter
\newcases{Rcases}{$\mskip\thickmuskip$}{%
\hfil$\m@th{##}$}{$\m@th{##}$\hfil}{.}{\rbrace}
\makeatother
\begin{document}
\begin{equation}
\begin{Rcases}
a &= x_{ij} \\
b_j &= y_j
\end{Rcases} \label{eq}
\end{equation}
\end{document}