0

Using Latex, I am looking for a way to align equations on several characters. I want to obtain something like that :

ax + bx = c1
a²x + bx = c2
a²x + b²x = c2

As you can see the idea is that the horizontal alignment occurs at several characters (here the two x appearing at each row, the plus symbol, and the equal symbol), and to generetate such an alignment I want to insert some spaces. I already tried to use the align block but when using several '&', the result shows huge spaces between each '&' positions.

2 Answers2

0

Like this?

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

\begin{alignat}{2}
 ax & + bx & & = c1 \\
a²x & + bx & & = c2 \\
a²x & + b²x & & = c2
\end{alignat}

\end{document} 

enter image description here

Bernard
  • 271,350
0

There are multiple ways to achieve your desired output. The code below shows 2 possible solutions. After i struggled a lot with it myself someone recommended me the array environment. Also an interesting article for this topic might be this one.

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{array}
\begin{document}
    \begin{align*}
        \begin{aligned}
            ax &+ bx &= c_1 \\
            a^2x &+ bx &= c_2 \\
            a^2x &+ b^2x &= c_3
        \end{aligned}
    \end{align*}
\begin{equation*}
    \begin{array}{ccccc}
        ax &+& bx &=& c_1 \\
        a^2x &+& bx &=& c_2 \\
        a^2x &+& b^2x &=& c_3
    \end{array}
\end{equation*}

\end{document}

The code above generates this aligned_example

Hoerbii3
  • 148