3

Here's my code:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
Q= & \phantom{\cup} \{\{n-1,n-1,3\}\} \\
   & \cup \{\{n-1,n-j+1,j+1\}: 3 \leq j \leq \lfloor n/2 \rfloor\} \\
   & \cup \{\{n-2,n-j+1,j+2\}: 4 \leq j \leq \lfloor n/2 \rfloor-1\}.
\end{align*}

\end{document}

This is what it looks like:

enter image description here

I want the brackets to line up on the left, but it's not behaving. How can I nudge the first bracket to the left to align with the other brackets?

It lines up properly if we don't use a \phantom{\cup}, but I don't actually want the cup there.

  • \mathbin{\phantom{\cup}} – LaRiFaRi Aug 7 '15 at 7:16
5

Perhaps this will suit. In the first example, I set the alignment point after the \cup, whereas in the second, I set it after the = sign.

When things like \cup and = are surrounded by math atoms, additional space is provided as separation. Such space is, for example, not present when those glyphs stand alone as in $=$. The problem with \phantom is that it loses track of what surrounds it. Thus, the method of using {}\cup{} is a way to designate using \cup as if something (in this case two empty groups) surrounds it on both sides. In that case, the extra space is inserted.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
Q = \phantom{{}\cup{}}& \{\{n-1,n-1,3\}\} \\
   \phantom{=} \cup{}& \{\{n-1,n-j+1,j+1\}: 3 \leq j \leq \lfloor n/2 \rfloor\} \\
   \phantom{=} \cup{}& \{\{n-2,n-j+1,j+2\}: 4 \leq j \leq \lfloor n/2 \rfloor-1\}.
\end{align*}
\end{document}

enter image description here

Alternately, this would suffice:

\begin{align*}
Q={} & \phantom{{}\cup{}} \{\{n-1,n-1,3\}\} \\
   & \cup \{\{n-1,n-j+1,j+1\}: 3 \leq j \leq \lfloor n/2 \rfloor\} \\
   & \cup \{\{n-2,n-j+1,j+2\}: 4 \leq j \leq \lfloor n/2 \rfloor-1\}.
\end{align*}
  • 4
    For the uninitiated, you may want to explain in words what \phantom{{}\cup{}} achieves that \phantom{\cup} does not. Put differenty, what do the empty groups, {}, that you've placed around \cup "do"? – Mico Aug 7 '15 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.