Phantom not working as expected in cases environment
They do, but since you have aligned the two lines with & the space on left does not matter.
If you want the "Case" example to be aligned you have to add {} because + is a binary operator and Latex adds space between an operator and its arguments. Hence if there is no argument, as in your case, then no space is added.
\documentclass{amsart}
\[
\begin{cases}
M+A+T & =12\\
\phantom{M+{}}A+T & =10
\end{cases}
\]
\end{document}
Hope I could help :)
Technically it does; it's the alignment difference between align
and cases
that's tripping you up. align
has a RIGHT-LEFT alignment for elements around &
, while cases
has a LEFT-LEFT alignment. As such, the spacing shows (more) clearly in cases
than align
.
To achieve the proper spacing, using \phantom{M + {}}
- add an empty group after +
to ensure TeX sees it as a binary operator.
\documentclass{amsart}
\begin{document}
\begin{align*}
M + A + T & = 12 \\
\phantom{M + {}} A + T & = 10
\end{align*}
\[
\begin{cases}
M + A + T & = 12 \\
\phantom{M + {}} A + T & = 10
\end{cases}
\]
\end{document}
You are probably better off using the following cases
:
\[
\begin{cases}
M + A + T = 12 \\
\phantom{M + {}} A + T = 10
\end{cases}
\]
The difference is that align
makes a pair of columns, one right aligned and one left aligned, so the \phantom
does nothing in the case of align
or align*
.
In order to get the correct spacing you need an empty group: \phantom{M+{}}
, because only in this way TeX will consider +
as a binary operation symbol.
However there's a simpler solution:
\begin{cases}
\begin{aligned}[t]
M+A+T &= 12
A+T &= 10
\end{aligned}
\end{cases}
Full comparison:
\documentclass{amsart}
\begin{document}
\[
\begin{cases}
M+A+T = 12\\
\phantom{M+{}}A+T = 10
\end{cases}
\]
\[
\begin{cases}
\begin{aligned}[t]
M+A+T &= 12\\
A+T &= 10
\end{aligned}
\end{cases}
\]
\end{document}