0

How can I get a system of linear equations identical to the one on this picture? enter image description here

Here is my code, there is a problem with \SHORTvdotswithin{=}, because there shuold be the distance between the equals sign and vdots:

\begin{align}
a_{11}x_1 + a_{12}x2 + \cdots + a_{1n}x_n &= b_1 \\ \nonumber
a_{21}x_1 + a_{22}x2 + \cdots + a_{2n}x_n &= b_2 \\ \nonumber
\shortvdotswithin{=} \nonumber
a_{m1}x_1 + a_{m2}x2 + \cdots + a_{mn}x_n &= b_m \\ \nonumber
\end{align}
1
  • Thanks...I understand but in my task it is necessary in the first line...
    – user215058
    Commented May 9, 2020 at 9:50

2 Answers 2

3

To have the columns aligned and also the coefficients I have used the alignat environment. This is a possibile solution.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{showframe} %% <--:::It shows the margins of your paper.
\begin{document}
\begin{alignat*}{4}
a_{11}x_1  &{} + {}& a_{12} x_2  & {} + \cdots + {} & a_{1n}x_n& ={} & b_1 \\
a_{21}x_1  &{} + {}& a_{22} x_2  & {} + \cdots + {} & a_{2n}x_n& ={} & b_2 \\
& &  &  &  & \phantom{=}\!\vdots &  \\
a_{n1}x_1  &{} + {}& a_{n2} x_2  & {} + \cdots + {} & a_{nn}x_n& ={} & b_n
\end{alignat*}
\end{document}

Just only the first line:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{alignat*}{4}
a_{11}x_1  &{} + {}& a_{12} x_2  & {} + \dotsb + {} & a_{1n}x_n& ={} & b_1
\end{alignat*}
\end{document}

enter image description here

1

The following code will do the job. Also, I would suggest using the align* environment to avoid having numbers on equations, instead of putting a \nonumber on each line separately.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
a_{11}x_1 + a_{12}x2 + \cdots + a_{1n}x_n &= b_1 \\ 
a_{21}x_1 + a_{22}x2 + \cdots + a_{2n}x_n &= b_2 \\ 
&\ \ \vdots \\
a_{m1}x_1 + a_{m2}x2 + \cdots + a_{mn}x_n &= b_m \\ 
\end{align*}
\end{document}

You must log in to answer this question.