5

I am trying to write a system of equations, I usually do it with the align environments but while I was researching the community, I saw that there was the systeme package and it seemed interesting to use it to create systems of equations, and I want the terms to be nicely spaced as the image below. I have reviewed several posts about the systeme package but the results I get are not the desired ones.

enter image description here

Here is the code that I was testing but I have complications when adding the i-th and n-th rows.

\begin{equation}\label{eq:sys_lin}
\syssubstitute{{w_3}{\sysdots}{w_4}{w_n}}
\systeme*{
  b_1=a_{11}x_1 + a_{21}x_2 + \dots + a_{1n}x_n,
  b_2=a_{21}x_1 + a_{22}x_2 + \dots + a_{2n}x_n,
  \vdots + \vdots + + \vdots , b_i=a_{i1} + a_{i2} + \dots + a_{in},\vdots + \vdots + + \vdots,b_n=a_{n1}x_1 + a_{n2}x_2 + \dots + a_{nn}x_n
}
\end{equation}

2 Answers 2

5

I don't think that systeme would easily accommodate that display. It's very good for explicit systems, but placing dots like in the example isn't easy (if at all possible). On the other hand you're not going to use such a display many times, so a more difficult code once is not too bad.

You can use nicematrix instead.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\[
\setlength{\arraycolsep}{0pt}
\begin{NiceArray}{ l @{\quad} *{4}{r >{{}}c<{{}}} c }
\mathbf{L}_1 & a_{11}x_1 &+& a_{12}x_2 &+& \cdots &+& a_{1n}x_n &=& c_1 \\[1ex]
\mathbf{L}_2 & a_{21}x_1 &+& a_{22}x_2 &+& \cdots &+& a_{2n}x_n &=& c_2 \\
\multicolumn{1}{c@{\quad}}{\vdots} &
  \multicolumn{1}{c}{\vdots} &&
  \multicolumn{1}{c}{\vdots} &&
  &&
  \multicolumn{1}{c}{\vdots} &&
  \multicolumn{1}{c}{\vdots} \\[0.5ex]
\mathbf{L}_i & a_{i1}x_1 &+& a_{i2}x_2 &+& \cdots &+& a_{in}x_n &=& c_i \\
\multicolumn{1}{c@{\quad}}{\vdots} &
  \multicolumn{1}{c}{\vdots} &&
  \multicolumn{1}{c}{\vdots} &&
  &&
  \multicolumn{1}{c}{\vdots} &&
  \multicolumn{1}{c}{\vdots} \\[0.5ex]
\mathbf{L}_n & a_{n1}x_1 &+& a_{n2}x_2 &+& \cdots &+& a_{nn}x_n &=& c_n
\CodeAfter\SubMatrix\{{1-2}{6-2}.
\end{NiceArray}
\]

\end{document}

You need to compile a few times for the warning to disappear when you add or modify a NiceArray.

enter image description here

Please, note that \mathbf{L_i} is wrong, because a boldface “i” has no connection with an italic one.

0
4

I don't think that the machinery of the systeme package is well suited for the task at hand. Instead, I'd use two side-by-side array environments.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{array}      % for '\newcolumntype' macro
\newcolumntype{C}{>{{}}c<{{}}} % for binary and relational operators
\usepackage{newtxtext,newtxmath} % optional (Times Roman clones)

\begin{document}

\[
\setlength\arraycolsep{0pt}      % default value: 5pt
\renewcommand\arraystretch{1.3}  % default value: 1.0
\begin{array}{ c } % single-column array
\mathbf{L}_1 \\ \mathbf{L}_2 \\ \vdots \\ \mathbf{L}_i \\ \vdots \\ \mathbf{L}_n
\end{array}
\quad
\left\{ 
\begin{array}{ *{4}{cC}c } % array with 9 (logical) columns
a_{11}x_1 &+& a_{12}x_2 &+& \cdots &+& a_{1n}x_n &=& c_1    \\
a_{21}x_1 &+& a_{22}x_2 &+& \cdots &+& a_{2n}x_n &=& c_2    \\
\vdots    & & \vdots    & &        & & \vdots    & & \vdots \\
a_{i1}x_1 &+& a_{i2}x_2 &+& \cdots &+& a_{in}x_n &=& c_i    \\
\vdots    & & \vdots    & &        & & \vdots    & & \vdots \\
a_{n1}x_1 &+& a_{n2}x_2 &+& \cdots &+& a_{nn}x_n &=& c_n
\end{array} 
\right.
\]

\end{document} 

Addendum, posted after @egreg posted a separate answer: I've removed the bold-facing of the subscripts to \mathbf{L}, as I agree that it's preferable to write \mathbf{L}_i rather than \mathbf{L_i}, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .