# Re: \phantom is not calculated correctly for =

On 25/05/2011 8:05 PM, Patrick Li wrote:

Hello everyone,


I have found myself resorting to \phantom for some things, and am having
trouble getting it to calculate correctly for the = sign. Would anyone

The following is a piece of Tex code that I copy and pasted from my Lyx
file.

\begin{align*}

\vec{w}&  =a+b\\

&  \phantom{=}a+b\end{align*}

It should display

w = a+b

a+b

where the second "a+b" should line up perfectly with the first "a+b". This
is not the case.

Thank you

-Patrick




TeX adds some space around = because it is one of the relational operators, but inside the \phantom{} it is not a relational operator since it does not have any operands on the left or rigth within the {}.

Why don't you put the = to the left of the alignment?
> \begin{align*}
>
> \vec{w} = & a+b\\
>
> &  a+b\end{align*}

--
Julien