0

If I write

\begin{align} 
A = <long string of variables> \\
=& <another long string of variables>
\end{align}

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
1

Write this:

 \begin{align*}
 & \phantom{{}={}}\text{long string of variables}\\
& = \text{another long string of variables}
  \end{align*}

or this (as suggested by @daleif):

\begin{align*}
&\text{long string of variables}\\
 ={} & \text{another long string of variables}
  \end{align*}

enter image description here

  • 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.