How to have linebreaks in block equation without messing with the alignment?

Hi! Consider the following code:

$ mus((A inter B) inter C) + mus((A inter B)^c inter C) &= mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
&= mus(A inter C) + mus(A^c inter C) = mus(C). $

The first line is too long and overflows:

I would like it to go on a line below so I do this:

$ mus((A inter B) inter C) + mus((A inter B)^c inter C) &= \
mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
&= mus(A inter C) + mus(A^c inter C) = mus(C). $

But then it is left-aligned and “pushes” my equation towards the right, so that now the third line overflows:

I would like the second line to rather be right aligned and such that it does not mess with placement of the two other lines.

Thanks in advance!

I added a & on the beginning of the second line. Is this how you want it?

$ mus((A inter B) inter C) + mus((A inter B)^c inter C) &= \
& mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
&= mus(A inter C) + mus(A^c inter C) = mus(C). $

20251009-021613

Thanks for your answer! No that is not really what I want, it causes an overflow:


What I would like is the second line to be right-aligned independently of the alignment characters in the other lines. Typically what I would like to be working is this:

$ mus((A inter B) inter C) + mus((A inter B)^c inter C) &= \
#h(1fr) mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
&= mus(A inter C) + mus(A^c inter C) = mus(C). $

However the #h command does nothing.
Let me mention that I have no idea on how to do that in Latex, as the \hfill command does not work in an align environment.

If I have large formulas overflowing, I typically do something like this:

$ & mus((A inter B) inter C) + mus((A inter B)^c inter C) \
= & mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
= & mus(A inter C) + mus(A^c inter C) = mus(C). $


…but I’m not sure if that’s what you want and applicable to your case.

Alternatively, you could use negative spacing with #h and manually position the line where you want it to be. I’m not exactly sure why, but relative types like the fr type doesn’t work here, but absolute types like pt and cm do:

$ mus((A inter B) inter C) + mus((A inter B)^c inter C) &= \
& #h(-100pt) mus((A inter B) inter C) + mus(A inter B^c inter C) + mus(A^c inter C) + 0 + 0 \
&= mus(A inter C) + mus(A^c inter C) = mus(C). $

I personally prefer the first option because it’s much easier to read.

Oh you’re right I’ve never thought of doing that but it’s much better, thank you!