If I write

A = <long string of variables> \\
=& <another long string of variables>

This works and aligns the equal signs and makes the total block of two-lines centered.

Now I want to remove the "A =" part, and simply assert that <long string of variables> is equal to <another long string of variables>. However, every version of this I write makes the left alignment of the second line to the left of the first, since <another long string of variables> is even longer.

How can I force the second line to shift over to the right so that the equal sign lies underneath the first line, somewhat? I've tried \hspace and a million alignment tricks but none of them have worked. I'd also be fine if I could just left-align the first line and right-align the second line!

  • 1
    Your code doesn't align the = sign on whatever. – Bernard May 11 '16 at 17:07

Write this:

 & \phantom{{}={}}\text{long string of variables}\\
& = \text{another long string of variables}

or this (as suggested by @daleif):

&\text{long string of variables}\\
 ={} & \text{another long string of variables}

enter image description here

| improve this answer | |
  • Less to write if you use & in the first row and ={} & on the second. – daleif May 11 '16 at 17:55
  • 1
    @daleif: You're right, if there are no other lines with alignment. I've updated my answer. Thanks! – Bernard May 11 '16 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.