I'm trying to get something really simple to work but LaTeX is being annoying.

y &= f(x)  \\
z &= y \times && p \\
& \times && q 

I want the && to be aligned but right now it produces the following:

[annoying latex]1

  • 2
    It would be nice to post a full compilable code. Could help to understand what happens…
    – Bernard
    Dec 18, 2017 at 19:54

1 Answer 1


There are a number of ways you can obtain the alignment you seek:




  y &= \mathrlap{f(x)} \\
  z &= y & {}\times{} & p \\
    &    & {}\times{} & q

  y &= f(x) \\
  z &= y \times p \\
    &\phantom{{}= y} \times q


The first uses an alignat structure, but requires you to ensure that the first equation doesn't interfere with the alignment of the second/third. The second option inserts the appropriate \phantom to have the \times aligned.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .