Results 1 to 9 of 9

Math Help - Left hand alignment in the matrix command and array command

  1. #1
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,821
    Thanks
    317
    Awards
    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
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    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:

    Follow Math Help Forum on Facebook and Google+

  3. #3
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    Hello,

    lcl and ccc would help you.
    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.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,821
    Thanks
    317
    Awards
    1
    \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
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,821
    Thanks
    317
    Awards
    1
    Quote Originally Posted by Moo View Post
    Hello,

    lcl and ccc would help you.
    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
    Follow Math Help Forum on Facebook and Google+

  6. #6
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Quote Originally Posted by topsquark View Post
    \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.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    Quote Originally Posted by topsquark View Post
    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.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,821
    Thanks
    317
    Awards
    1
    Quote Originally Posted by Ackbeet View Post
    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
    Follow Math Help Forum on Facebook and Google+

  9. #9
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    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.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Mathematica command question - matrix operator
    Posted in the Math Software Forum
    Replies: 5
    Last Post: January 13th 2011, 08:31 AM
  2. Latex command!
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: December 17th 2010, 11:04 AM
  3. MATLAB: The cat command
    Posted in the Math Software Forum
    Replies: 4
    Last Post: July 13th 2010, 01:32 PM
  4. Maple 11 command
    Posted in the Math Software Forum
    Replies: 1
    Last Post: June 1st 2008, 06:36 AM
  5. command for..?
    Posted in the LaTeX Help Forum
    Replies: 9
    Last Post: November 2nd 2007, 05:40 AM

/mathhelpforum @mathhelpforum