Alignment of mathematical equations in latex

I am trying to align the following equalities around an equal sign. What can I do? Thank you I am using the AMSMath package

$$m\ddot{x}_{1}-K(x_{2}+x_{12})+C(\dot{x}_{12}+\dot{x}_{2})+2C\dot{x}_{1} = fx_{1}$$ $$m\ddot{x}_{2}-K(x_{3}+x_{1})+C(\dot{x}_{1}+\dot{x}_{3})+2C\dot{x}_{2} = fx_{2}$$ $$m\ddot{x}_{3}-K(x_{4}+x_{2})+C(\dot{x}_{2}+\dot{x}_{4})+2C\dot{x}_{3} = fx_{3}$$ 
+7
latex amsmath
source share
3 answers
 \begin{align} m\ddot{x}_{1}-K(x_{2}+x_{12})+C(\dot{x}_{12}+\dot{x}_{2})+2C\dot{x}_{1} &= fx_{1} \\ m\ddot{x}_{2}-K(x_{3}+x_{1})+C(\dot{x}_{1}+\dot{x}_{3})+2C\dot{x}_{2} &= fx_{2} \\ m\ddot{x}_{3}-K(x_{4}+x_{2})+C(\dot{x}_{2}+\dot{x}_{4})+2C\dot{x}_{3} &= fx_{3} \end{align} 

See user manual .

+21
source share

In short, the following idea of ​​using eqnarray is obvious, but it turns out to be a really bad idea . eqnarray contains many problems that are resolved in amsmath and related packages. Read Lars Madsen: Avoid Ekkarnara for details.

 \begin{eqnarray*} %% Do avoid eqnarray if possible. x_1 & = & 1 \\ x_2 & = & 2 \\ x_3 & = & 3 \end{eqnarray*} 

(Answer revised with information from Arthur Reutenauer , Thomas, and Madsen-related paper Thomas).

+5
source share

There are several packages that need to be done, one of the most widely used is the AMS align environment from the amsmath package.

Simplified excerpt from amsldoc.pdf:

 \begin{align} x&=y \\ x'&=y' \\ x+x'&=y+y' \end{align} 

Equations are aligned around characters following & (in this case, equal signs).

+4
source share

All Articles