# Force aligned equation (all the way) to the left?

How do I force the following aligned output all the way to the upper left (right next to the enumerated list item)? I still want the 2nd and 3rd lines to be aligned with it's above equal sign.

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{enumerate}

\begin{document}
\begin{enumerate}[(a)]
\item
\begin{align*}
P(A \XOR B) &= P(A)+P(B)-2P(A\cap B)
\\ &= 0.15 + 0.10 - 0.05
\\ &= 0.20
\end{align*}
\end{enumerate}
\end{document}

-
Related question: mix align and enumerate –  Peter Grill Sep 8 '11 at 18:09

## 2 Answers

align is a display math environment; use the subsidiary aligned environment, instead:

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumerate}

\begin{document}
\begin{enumerate}[(a)]
\item
\begin{aligned}[t] P(A + B) &= P(A)+P(B)-2P(A\cap B) \\ &= 0.15 + 0.10 - 0.05 \\ &= 0.20 \end{aligned}
\end{enumerate}
\end{document}


Werner is correctly remarking the [t] that guarantees top alignment.

-
...note the optional [t] to align aligned at the top. –  Werner Sep 8 '11 at 17:49
thanks a lot, man! –  Alex Lockwood Sep 8 '11 at 17:56

To use the align math environment (as well as the other equation environments of the amsmath package) but with the equations "shoved" all the way to the left, you should (i) load the amsmath package with the fleqn option and (ii) redefine the \mathindent length parameter to 0pt, as shown in the following MWE. (I've added a bit of "dummy text" to make the alignment operations a bit more easy to see.)

\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{enumerate,lipsum}
\setlength{\mathindent}{0pt}
\begin{document}
\noindent\lipsum[2]
\begin{enumerate}[(a)]
\item \lipsum[2]
\begin{align*}
P(A \cup B) &= P(A)+P(B)-2P(A\cap B)\\
&= 0.15 + 0.10 - 0.05 \\
&= 0.20
\end{align*}
\end{enumerate}
\end{document}


Hope this is what you're looking for. Happy TeXing!

-
I think the problem is when the {align*} is follows an \item without any preceding text. This results in additional vertical space. –  Peter Grill Sep 8 '11 at 18:31
Yeah, I wasn't quite sure if I'd understood the OP's question correctly. I thought he wanted to stick with the align* environment. –  Mico Sep 8 '11 at 18:35