I'm looking for something synonymous to tabbing
, but for math mode.
I read that alignat*
should do the trick, but this behaves differently it seems. For example:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{2}
S_4^{t} &= \{&\langle rdi, r12, rax' \rangle \mid \langle rdi, r12, rax \rangle \in S_4~\wedge \\
&& rax' = \{ rax \mid rax > 0 \} \}\\
\end{alignat*}
\end{document}
The second line appears to be right aligned, whereas I would like the &
markers to be aligned with each other and then all text left aligned (like in tabbing
).
Is anyone able to fix this code, or suggest an alternative.
Best Answer
As per Math indentation environment, the
alignat
provides multiplerl
align pairs. Since your second alignment is intended to bel
aligned, you need to use a double &&. The first & skips over ther
aligned column of therl
align pair:Notes:
align
environment also provides multiplerl
alignment pairs. However, thealignat
does not insert additional space that thealign
environment does between therl
alignment pairs. So, for cases where a separation is required between the alignment points with thealignat
environment those would need to be inserted manually.array
environment. But one does need to be careful to remove inter column spacing using@{}
, and to ensure that the relational or binary operators have the correct spacing by using{}
to make TeX think that there is an element on the other side of the operator. This produces results identical to the above.Code: