Aligning Equations in LaTeX: Troubleshooting

  • Context: LaTeX 
  • Thread starter Thread starter computer2012
  • Start date Start date
  • Tags Tags
    Latex Troubleshooting
Click For Summary
SUMMARY

The discussion focuses on aligning multiple equations in LaTeX, specifically using the gather and eqnarray environments. The user encountered a compilation error when attempting to use multline within gather, as it is not permitted. The solution involves using eqnarray to achieve the desired alignment, ensuring that the first two equations are centered and the last equation is split into two parts, with Eq3a on the left and Eq3b on the right.

PREREQUISITES
  • Familiarity with LaTeX syntax and environments
  • Understanding of equation alignment in LaTeX
  • Knowledge of the gather and eqnarray environments
  • Experience with the multline environment
NEXT STEPS
  • Research the align environment in LaTeX for more flexible equation alignment
  • Explore the split environment for breaking equations across lines
  • Learn about the array environment for custom alignment options
  • Investigate the amsmath package for advanced mathematical formatting
USEFUL FOR

This discussion is beneficial for LaTeX users, particularly mathematicians, scientists, and engineers who need to format and align complex equations effectively.

computer2012
Messages
2
Reaction score
0
Hi,

I want to align several equations in latex.

I want the first and second equations to be in the middle.

The last equation is too long and I want to split it into 2 parts.

I tried

\begin{gather}
Eq1\\
Eq2\\
\begin{multline}
Eq3a\\
Eq3b
\end{multline}
\end{gather}

However, the code cannot be compiled due to multline cannot be used inside other environment. How can I solve the problem?

Thanks for your help very much.
 
Physics news on Phys.org
Have you tried eqnarray?

Code:
\begin{eqnarray}
a & = & b + c \\
c & = & d + e \\
f & = & a + b + \nonumber \\
  &    &  d + e + f
\end{eqnarray}

<br /> \begin{eqnarray}<br /> a &amp; = &amp; b + c \\<br /> c &amp; = &amp; d + e \\<br /> f &amp; = &amp; a + b + \nonumber \\<br /> &amp; &amp; d + e + f<br /> \end{eqnarray}<br />
 
I want the effect of multline, that is, Eq 3a is on the extreme left hand side and Eq 3b is on the extreme right hand side? How can I do that? Thanks.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
9K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K