[Tex/LaTex] Aligning vdots with terms in a system of equations

align

I am attempting to write a system of linear equations that looks like this:

A_{11}x_1 + A_{12}x_2 + \cdots + A_{1n}x_n = y_1
A_{21}x_1 + A_{22}x_2 + \cdots + A_{2n}x_n = y_2
\vdots      \vdots               \vdots      \vdots
A_{m1}x_1 + A_{m2}x_2 + \cdots + A_{mn}x_n = y_m

where the vdots are centered on the terms rather than the equal sign. Here is my attempt:

\documentclass{report}
\usepackage{amsmath}
\begin{document}

\begin{align*}
&A_{11}x_1& + &A_{12}x_2& + \cdots + &A_{1n}x_n& = &y_1& \\
&A_{21}x_1& + &A_{22}x_2& + \cdots + &A_{2n}x_n& = &y_2& \\
&\vdots&  &\vdots& &\vdots& &\vdots& \\
&A_{m1}x_1& + &A_{m2}x_2& + \cdots + &A_{mn}x_n& = &y_m& \\
\end{align*}

\end{document}

Anyone have an elegant solution?

EDIT. Here is a second attempt, using the better-suited array environment. It looks better, but still unnatural.

\documentclass{report}
\begin{document}

\[\begin{array}{ccccccccc}
A_{11}x_1 & + & A_{12}x_1 & + & \cdots & + & A_{1n}x_n & = & y_1 \\
A_{21}x_1 & + & A_{22}x_2 & + & \cdots & + & A_{2n}x_n & = & y_2 \\
\vdots    &   & \vdots    &   &        &   & \vdots    &   & \vdots \\
A_{m1}x_1 & + & A_{m2}x_2 & + & \cdots & + & A_{mn}x_n & = & y_m \\
\end{array}\]

\end{document}

Is there any way to have the vdots aligned like this but make the equations look normal?

Best Answer

I suggest the following modification:

\documentclass{report}
\usepackage{array}
\begin{document}

\[\begin{array}{*{9}{@{}c@{}}}
A_{11}x_1 & {}+{} & A_{12}x_1 &{}+{} & \cdots & {}+{} & A_{1n}x_n & {}\mathrel{=}{} & y_1 \\
A_{21}x_1 & + & A_{22}x_2 & + & \cdots & + & A_{2n}x_n & = & y_2 \\
\vdots    &   & \vdots    &   &        &   & \vdots    &   & \vdots \\
A_{m1}x_1 & + & A_{m2}x_2 & + & \cdots & + & A_{mn}x_n & = & y_m \\
\end{array}\]

\end{document}

enter image description here

Related Question