9

In the image below you can see the phantom not taking up as much width as it's expected in the cases environment:

Here's the MWE:

\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}

My questions are: why doesn't the phantom in the cases environment take up as much space as it does in the align* environment? How can I fix it?

I only have a temporary solution now, which is manually adding some \hspace.

1
  • Welcome to TeX.SE! Thanks for providing a minimal working example. Try adding a pair of braces {} after the + as a quick fix, as in \phantom{M+{}}A+T.
    – Troy
    Sep 27, 2017 at 15:22

4 Answers 4

7

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.

enter image description here

\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:

enter image description here

\[
  \begin{cases}
             M +     A + T = 12 \\
    \phantom{M + {}} A + T = 10
  \end{cases}
\]
1
  • Your last tip indeed looks nicer. I will probably mark your answer as accepted for providing more information.
    – tatsletni
    Sep 27, 2017 at 15:34
6

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 :)

0
4

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}

enter image description here

1
\documentclass{amsart}

\begin{document}

\[
  \left\{
    \begin{aligned}
      M+A+T &= 12\\
      A+T &= 10
    \end{aligned}
  \right.
\]

\end{document}

enter image description here

3
  • Your vertical alignment seems to be off here. You need \begin{aligned}[t], as suggested in egreg's answer.
    – Werner
    Sep 27, 2017 at 17:18
  • @Werner: Your suggestion does not work.
    – user94293
    Sep 28, 2017 at 0:16
  • So why does it work in the other smart?
    – Werner
    Sep 28, 2017 at 0:33

You must log in to answer this question.

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