I have a problem when using math mode’s alignment operator. It always right align text. See this example:
#set page(height: auto, width: auto, margin: 20pt)
$
¬ exists x exists y (Q(x, y) <--> Q(y, x)) #h(160pt) &"Original" \
equiv &forall x not exists y (Q(x,y) <--> Q(y, x)) &"De Morgan's Law" \
equiv &forall x forall y space not (Q(x,y) <--> Q(y, x)) &"De Morgan's Law" \
equiv &forall x forall y space ((Q(x,y) and not Q(y,x)) or (not Q(x,y) and Q(y, x))) &"By (1)"
$
I am aware that this is achievable using a grid, but I think this use case is very common that I might be missing out on something. If there’s a better method to do this quick and easy please let me know.
Alignment markers alternate alignment between left and right, which is why the the part before the first & is right aligned, and the part between the first and second & is left aligned. You can achieve the behavior you want by doubling up to && so that it toggles twice, cancelling each other out, turning right & left & right into right & left && left.
For your case this would be:
#set page(height: auto, width: auto, margin: 20pt)
$
¬ exists x exists y (Q(x, y) <--> Q(y, x)) #h(160pt) &&"Original" \
equiv &forall x not exists y (Q(x,y) <--> Q(y, x)) &&"De Morgan's Law" \
equiv &forall x forall y space not (Q(x,y) <--> Q(y, x)) &&"De Morgan's Law" \
equiv &forall x forall y space ((Q(x,y) and not Q(y,x)) or (not Q(x,y) and Q(y, x))) &&"By (1)"
$