| Author |
aligning equations with amsmath
|
|
| icksa1@gmail.com 2006-09-26, 8:45 am |
| Hi:
I am using amsmath to make blocks of equations for example:
\begin{align}
VA &= 2*x + 3 + \\
& 4x^2 + 8x^3 + \\
& sin(y)
\end{align}
or something similar. These equations are always centered. I know I can
put fleqn in my document class, but I would like the flexibility to
change the alignment for each equation block (make some centered or
some left justified). Is there any way to do this?
Thanks
| |
| Enrico Gregorio 2006-09-26, 8:45 am |
| <icksa1@gmail.com> wrote:
> Hi:
> I am using amsmath to make blocks of equations for example:
>
> \begin{align}
> VA &= 2*x + 3 + \\
> & 4x^2 + 8x^3 + \\
> & sin(y)
> \end{align}
>
> or something similar. These equations are always centered. I know I can
> put fleqn in my document class, but I would like the flexibility to
> change the alignment for each equation block (make some centered or
> some left justified). Is there any way to do this?
Use mathtools and its "multlined" environment.
Ciao
Enrico
| |
|
|
| Lars Madsen 2006-09-26, 7:06 pm |
| icksa1@gmail.com wrote:
> Hi:
> I am using amsmath to make blocks of equations for example:
>
> \begin{align}
> VA &= 2*x + 3 + \\
> & 4x^2 + 8x^3 + \\
> & sin(y)
> \end{align}
>
> or something similar. These equations are always centered. I know I can
> put fleqn in my document class, but I would like the flexibility to
> change the alignment for each equation block (make some centered or
> some left justified). Is there any way to do this?
>
> Thanks
>
using recommended AMS rules (from mathematics into type, converted into
using align, note that the +'s at the breaks goes first on the line not
last)
\begin{align}
VA = {} & 2x+3 \\
& + 4x^2+8x^3\\
& \sin(y)
\end{align}
/daleif
| |
| icksa1@gmail.com 2006-09-26, 7:06 pm |
|
Enrico Gregorio wrote:
> <icksa1@gmail.com> wrote:
>
>
> Use mathtools and its "multlined" environment.
>
> Ciao
> Enrico
According to what I read, multlined puts the first line to the left,
the middle lines center and the last line to the right. But is there
anyway to have complete control of the alignment? So I can say, for
example...center this equation but right justify that one. And I should
say that I'm very new to tex.
THanks
| |
|
| You could use
\begin{flalign}
VA &= 2*x + 3 + & \\
& 4x^2 + 8x^3 + \\
& sin(y)
\end{flalign}
Notice the extra '&' before the first '\'.
icksa1@gmail.com wrote:
> Hi:
> I am using amsmath to make blocks of equations for example:
>
> \begin{align}
> VA &= 2*x + 3 + \\
> & 4x^2 + 8x^3 + \\
> & sin(y)
> \end{align}
>
> or something similar. These equations are always centered. I know I can
> put fleqn in my document class, but I would like the flexibility to
> change the alignment for each equation block (make some centered or
> some left justified). Is there any way to do this?
>
> Thanks
| |
|
|
Paul wrote:
> \begin{flalign}
> VA &= 2*x + 3 + & \\
Better: VA &= 2x + 3 + {} \\
Without the empty formula "{}" the plus sign has the wrong
spacing. The extra & only adds one additional intercolumn space
at the end, which has no visible effect.
> & 4x^2 + 8x^3 + \\
Here, too, we need a "{}" after the plus sign.
Probably one doesn't want to align "4x^2" with the equal sign
above it. One needs to either add some space before that or
follow Lars' suggestion (moving the alignment tab on the first
line).
> & sin(y)
Of course you meant \sin.
But flalign is the way to go to get the alignment flush left.
Unfortunately, if there are side-by-side equations,
(i.e., additional "& a &= B" in one row) they get pushed flush
right.
Dan
| |
|
|
|
|