[Tex/LaTex] Align equation left

alignequations

Here is my split equation:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
a_{ijk} =& \frac {Pr(M_{I} =2  \&  M_J=1 \& M_K =1 | I=i , J=j , K=k)}{Pr (M_I =1 \& M_J =1 \& M_K=1 | I=i , J=j)} \\
            =& \frac {\mu_{ijk211}}{\mu_{ijk111}}\\
\end{split}
\end{equation}
\end{document}

I want to align this equation to the left. Is this possible in an equation environment?

Best Answer

I would not use the equation environment; rather, I would use flalign as such:
(notice the && at the end of each line)

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent A \hfill Z
\begin{flalign}
a_{ijk} &= \frac {Pr(M_{I} =2  \&  M_J=1 \& M_K =1 | I=i , J=j , K=k)}{Pr (M_I =1 \& M_J =1 \& M_K=1 | I=i , J=j)}&&\\\nonumber
            &= \frac {\mu_{ijk211}}{\mu_{ijk111}}&&
\end{flalign}

\noindent A \hfill Z
\end{document}

Output

Another way to go is to set the fleqn option for the document class. However, this left-aligns all of your equations and hence should not be used when you want at least some equations to remain centered.

\documentclass[fleqn]{article}
\usepackage{amsmath}
\begin{document}
\noindent A \hfill Z
\begin{equation}
\begin{aligned}
a_{ijk} &= \frac {Pr(M_{I} =2  \&  M_J=1 \& M_K =1 | I=i , J=j , K=k)}{Pr (M_I =1 \& M_J =1 \& M_K=1 | I=i , J=j)}\\
            &= \frac {\mu_{ijk211}}{\mu_{ijk111}}\\
\end{aligned}
\end{equation}
\noindent A \hfill Z
\end{document}

For this output:

Output 2

As suggested by karlkoeller, if you want to get rid of the space between the left margin and the equation (to get a result similar to the first case), you should add \setlength{\mathindent}{0pt}. If you later want to indent it back to its default value, you can use the same command with a value of 15pt, which is the amount of pt a paragraph indent shifts its text to the right.