[Tex/LaTex] Alignment/whitespace to compensate for negative sign

horizontal alignmentmath-modespacing

I have two equations:

\begin{equation}
    \begin{cases}
        \begin{aligned}
            a_x &= - \sin \alpha \cos \beta    \\
            a_y &= \cos \alpha \cos \beta
        \end{aligned}
    \end{cases}
\end{equation}

This works very nicely. However I would find the result prettier if there were a white space under the negative sign. That is, not like this:

a_x = - sin ...
a_y = cos ...

but rather like this :

a_x = - sin ...
a_y =   cos ...

So, white space problem or alignment problem? I could just place a whitespace there, like \. or \,, but I do not know how wide the negative sign is. I cannot put more & in my lines because that makes aligned think I have many equations on the same line.

What are the best practices here?

Best Answer

These adjustments have to be done manually, of course, because they depend on the actual interrelation between formulas.

With \hphantom{...} you can leave the space that would be occupied by the argument:

\begin{equation}
\left\lbrace
\begin{aligned}
  a_x &= - \sin \alpha \cos \beta    \\
  a_y &= \hphantom{-}\cos \alpha \cos \beta
\end{aligned}
\right.
\end{equation}

A subtle point is that \hphantom always creates an object that behaves like normal letters with respect to surrounding spaces, so sometimes one has to help TeX by telling the type of the object, putting it as the argument of \mathbin or \mathrel (if it must match an operation symbol or a relation, respectively). In this case the "minus sign" is treated as an ordinary symbol, so no adjustment is necessary.

I wouldn't use cases in this particular formula, but it doesn't harm either (it just adds an unnecessary level).

Related Question