Math & ScienceProblem with align

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
marcdein
Posts: 40
Joined: Sat Dec 19, 2009 2:11 pm

Problem with align

Post by marcdein »

I am using "align" to display two equations, the second of which is much shorter than the first one. Unfortunately, LaTeX shifts the RHS of the second equation all the way to the right, so that both equations end at the same point.

This does not happen when I use eqnarray, but I'd rather use align. Is there a way around it?

Thanks.
Last edited by marcdein on Mon Jun 27, 2011 1:33 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Problem with align

Post by Stefan Kottwitz »

Hi,

I guess you used an incorrect syntax in the align environment. Perhaps post your code of that environment here.

Stefan
LaTeX.org admin
marcdein
Posts: 40
Joined: Sat Dec 19, 2009 2:11 pm

Problem with align

Post by marcdein »

Ok, here is the code:

Code: Select all

\begin{align}
a_n(\sg,ct)&=&-\frac{c\tau + n/2-1}{n/2} \sg^2 a_{n-2}(\sg,ct) = -\frac{2\sg^2}{n} \left(c+\frac{n}{2}-1\right) a_{n-2}(\sg,ct),\\
c_n(\sg,\om,ct)&=&a_n(\sg,c\tau)-i\om c_{n-1}(\sg,ct).
\end{align}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Problem with align

Post by Stefan Kottwitz »

I see, just write &= instead of &=&:

Code: Select all

\begin{align}
a_n(\sg,ct)&=-\frac{c\tau + n/2-1}{n/2} \sg^2 a_{n-2}(\sg,ct) = -\frac{2\sg^2}{n} \left(c+\frac{n}{2}-1\right) a_{n-2}(\sg,ct),\\
c_n(\sg,\om,ct)&=a_n(\sg,c\tau)-i\om c_{n-1}(\sg,ct).
\end{align}
In contrast to eqnarray, & ist here used to mark the symbol where the alignment shall be.

Stefan
LaTeX.org admin
marcdein
Posts: 40
Joined: Sat Dec 19, 2009 2:11 pm

Re: Problem with align

Post by marcdein »

Thanks!
Post Reply