# Thread: Left hand alignment in the matrix command and array command

1. ## Left hand alignment in the matrix command and array command

Here is the code I am looking for assistance on.
$\begin{matrix}|\vec{r} - \vec{v}t_r|^2 = r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 = c^2(t - t_r)^2 \\ . \\ \vec{r} \cdot \vec{v} = \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) \end{matrix}$

What I am trying to do is left-align both statements. I am aware of the "array" command and I might be able to fix this using array, but am confused about the {lcl} ( {ccc} etc.) parts of the statement.

Just to explain why I am doing this with the "matrix" command instead of two separate lines of code is that on PHF we are only allowed to post 5 images, which is currently the only way to write LaTeX commands. So I'm trying to find a way to put more than one statement inside a single image.

-Dan

2. If you're using quicklatex, try this sort of thing:

\begin{align*}
&x^2 + y^2 = 1 \\
&y = \sqrt{1 - x^2}
\end{align*}

The ampersands control what gets aligned with what. (Can do it on the equals sign, e.g.).

Result:

3. Hello,

In this case, it would be l (left) for the alignment. lcl would give left center left
Choose the array command

$\begin{array}{l}|\vec{r} - \vec{v}t_r|^2 = r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 = c^2(t - t_r)^2 \\ \vec{r} \cdot \vec{v} = \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) \end{array}$

or

$\begin{array}{lll} |\vec{r} - \vec{v}t_r|^2 &= r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 &= c^2(t - t_r)^2 \\ \vec{r} \cdot \vec{v} &= \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) & \end{array}$

Or the align*/aligned solution that Ackbeet proposes is nice too.

4. \begin{align*}& |\vec{r} - \vec{v}t_r|^2 = r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 = c^2(t - t_r)^2 \\ . \\ & \vec{r} \cdot \vec{v} = \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) \end{align*}

Oh, that's sooooo nice. You'll be richly rewarded for this Ack! bent!

-Dan

5. Originally Posted by Moo
Hello,

In this case, it would be l (left) for the alignment. lcl would give left center left
Choose the array command

$\begin{array}{l}|\vec{r} - \vec{v}t_r|^2 = r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 = c^2(t - t_r)^2 \\ \vec{r} \cdot \vec{v} = \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) \end{array}$

or

$\begin{array}{lll} |\vec{r} - \vec{v}t_r|^2 &= r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 &= c^2(t - t_r)^2 \\ \vec{r} \cdot \vec{v} &= \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) & \end{array}$

Or the align*/aligned solution that Ackbeet proposes is nice too.
Okay, that's a good solution as well. Now at least I know how that {lcl} thing is supposed to work. Not that I can think of a reason why I would, but is there an "r" for right alignment?

-Dan

6. Originally Posted by topsquark
\begin{align*}& |\vec{r} - \vec{v}t_r|^2 = r^2 - 2 \vec{r} \cdot \vec{v}t_r + v^2t_r^2 = c^2(t - t_r)^2 \\ . \\ & \vec{r} \cdot \vec{v} = \frac{1}{2t_r} ( r^2 + v^2 - c^2(t - t_r)^2 ) \end{align*}

Oh, that's sooooo nice. You'll be richly rewarded for this Ack! bent!

-Dan
Ha. The laugh from yet another distortion of my username may already have been my reward. But suit yourself.

Incidentally, in a real LaTeX environment, the asterisk in the \begin{align*} suppresses the automatic equation numbering that would normally appear on the right. If you want that numbering to appear because you'll refer to those equations later (although N. David Mermin strongly encourages numbering every single displayed equation in case someone else wants to refer to it), then simply omit the asterisks.

7. Originally Posted by topsquark
Okay, that's a good solution as well. Now at least I know how that {lcl} thing is supposed to work. Not that I can think of a reason why I would, but is there an "r" for right alignment?

-Dan
Yes !
The aligned is really nice (I use it all the time), but the array is better if you want to do more precise things.

8. Originally Posted by Ackbeet
Ha. The laugh from yet another distortion of my username may already have been my reward. But suit yourself.

Incidentally, in a real LaTeX environment, the asterisk in the \begin{align*} suppresses the automatic equation numbering that would normally appear on the right. If you want that numbering to appear because you'll refer to those equations later (although N. David Mermin strongly encourages numbering every single displayed equation in case someone else wants to refer to it), then simply omit the asterisks.
Actually I tried without the asterisk and the numbers didn't seem to line up with the equations, but I didn't play with it.

Your solution works well here, but I've been using "www.codecogs.com" for PHF and they don't appear to have the align* command. Thank you anyway!

(sighs) I guess that means that I'll have to admit that Moo made an acceptable suggestion. It's hard but you gotta do what you gotta do.

-Dan

9. quicklatex.com does play well with the align and align* environments. You could use that instead. It's just an image import, so PHF should have no problem with that.