Left align in math environment with every element over each other
Here is a possible solution if no equation number is required:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{4}
\gamma(0) &= \alpha_1\gamma(1) &&+ \alpha_2\gamma(2) &&+ \dots + \alpha_p\gamma(p) &&+ \sigma^2 \\
\gamma(1) &= \alpha_1\gamma(0) &&+ \alpha_2\gamma(1) &&+ \dots + \alpha_p\gamma(p-1)&& \\
&\vdotswithin{=} \\
\gamma(p) &= \alpha_1\gamma(p-1) &&+ \alpha_2\gamma(p-2) &&+ \dots + \alpha_p\gamma(0) &&
\end{alignat*}
\end{document}
If the centered equation number is indeed required, use an equation
--alignedat
combination, as in Thorsten's answer.
If you want to keep one single equation number, you can use the alignedat
environment inside equation
.
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools} % loads »amsmath«
\pagestyle{empty}
\begin{document}
\begin{equation}
\begin{alignedat}{5}
\gamma(0) &= \alpha_1\gamma(1) &&+ \alpha_2\gamma(2) &&+ \cdots &&+ \alpha_p\gamma(p)&&+ \sigma^2 \\
\gamma(1) &= \alpha_1\gamma(0) &&+ \alpha_2\gamma(1) &&+ \cdots &&+ \alpha_p\gamma(p-1) \\
&\vdotswithin{=} \\
\gamma(p) &= \alpha_1\gamma(p-1)&&+ \alpha_2\gamma(p-2) &&+ \cdots &&+\alpha_p\gamma(0)
\end{alignedat}
\end{equation}
\end{document}
The accepted answer is definitely the way to go, but if ever you're stuck on a desert island and you don't have the amsmath
package, an array
environment can do some of the work- there are deficiencies (such as the alignment of the \vdots
and the need for extra {}
), but it does get some of the job done.
% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass{article}
\begin{document}
\[
\begin{array}{r@{}l@{}l@{}l@{}l@{}l@{}l@{}}
\gamma(0) & {}=\alpha_1\gamma(1) & {}+\alpha_2\gamma(2) & {}+{}\cdots {} & & {}+\alpha_p\gamma(p) & {}+\sigma^2 \\
\gamma(1) & {} =\alpha_1\gamma(0) & {}+\alpha_2\gamma(1) & {}+{}\cdots {} & & {}+\alpha_p\gamma(p-1) & \\
& \vdots & & & & & \\
\gamma(p) & {} =\alpha_1\gamma(p-1) & {}+\alpha_2\gamma(p-2) & {}+{}\cdots {} & & {}+\alpha_p\gamma(0) &
\end{array}
\]
\end{document}