2

I have three small systems of equations, with two equations each. I want to display them like in the following picture:

enter image description here

The first equations should be in one line and the second equations should be in one line as well and should be aligned to the first equations.

I tried the following:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
    \begin{aligned}
        3x+4y &=14 \qquad 3x+4y &=14 \qquad 3x+4y &=14 \\
       -5x+2y &=20 \qquad -6x-8y &=14 \qquad -6x-8y &=-28
    \end{aligned}
\end{equation*}
\end{document}

But this code produces the following:

enter image description here

I get no compiling errors, but the second equation is still not aligned, how can I fix this?

1

4 Answers 4

5

Perhaps an align* environment?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
        3x+4y &=14 &  3x+4y &=14 &  3x+4y &=14 \\
       -5x+2y &=20 & -6x-8y &=14 & -6x-8y &=-28
\end{align*}
\end{document}

enter image description here

2
  • @BlackMild, thanks for the edit!! Feb 2, 2023 at 13:27
  • @JuanCastaño I just add the output of your code (and save for later use). Thank you!
    – Black Mild
    Feb 2, 2023 at 13:50
3

You can use array to format a set of equations

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
  \setlength\arraycolsep{\dimexpr3em/18}
  \begin{array}{
    rcr @{{}={}} l
    @{\hspace{3em}}
    rcr @{{}={}} l
    @{\hspace{3em}}
    rcr @{{}={}} l
    }
     3x &+& 4y & 14   &    3x &+& 4y & 14   &    3x &+& 4y &  14 \\
    -5x &+& 2y & 20   &   -6x &-& 8y & 14   &   -6x &-& 8y & -28
  \end{array}
\]
\end{document}

enter image description here

2
  • Thank you for your answer! Feb 2, 2023 at 14:32
  • Np. I just posted an alternative approach in case you would consider further alignment with coefficients; array is particularly useful if you happen to need centred alignments.
    – Celdor
    Feb 2, 2023 at 14:34
3

The simplest way to input linear systems is with the systeme package.

\documentclass{article}
\usepackage{amsmath}
\usepackage{systeme}

\begin{document}

\begin{equation*}
\systeme{3x+4y=14,-5x+2y=20}
\qquad
\systeme{3x+4y=14,-6x-8y=14}
\qquad
\systeme{3x+4y=14,-6x-8y=-28}
\end{equation*}

\begin{equation*}
\sysdelim..
\systeme{3x+4y=14,-5x+2y=20}
\qquad
\systeme{3x+4y=14,-6x-8y=14}
\qquad
\systeme{3x+4y=14,-6x-8y=-28}
\end{equation*}

\end{document}

By default a brace is used on the left, corresponding to

\sysdelim\lbrace.

(the period denotes the null delimiter). In the second example, also the left delimiter is null.

enter image description here

1
  • Thank you very much! Didn't know about this package. Feb 2, 2023 at 17:05
0

I agree of course with @Juancastaño answer.

However there is no need to switch from equation/aligned to align! The key point is that, in both environments, successive equations on the same line must be separated by a & which delimits the RHS of equation n, to be aligned left, from the LHS of equation n+1, to be aligned right. This also ensure that there is no need to add spacing commands like \qquad(removed by Juan), as amsmath alignmemt environments spread the available white space to maximize the distance between the above referenced RHS and LHS.

0

You must log in to answer this question.

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