130

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?

1

8 Answers 8

125

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.

0
81

Note: This doesn't answer the question exactly. But still try this solution first as it is probably the simplest.

Use align, and put & at the beginning of every line. Use \\ to separate multiple equations.

\begin{align*}
& a_{ijk} = 2 \\
&(because ||V_1-V_2|| = \max_{i \in [d]}|V^i_1 - V^i_2|)
\end{align*}

(This works if you want to left align a set of equations, but the whole equations could be at the center if your equations are short)

1
  • This helps a lot. You aren't able to \usepackage in MathJax but its really a struggle finding any information for workarounds for this kind of situation.
    – Uduru
    Commented Jul 13, 2022 at 19:19
20

Put & at the beginning of the line for left alignment and \\ at the end of the line to break line. Enclose the equation between \begin(split) and \end(split)

\begin{equation}
\begin{split}
&T_{eff}=\sum_{i=1}^n f_i.t_i \\
&=h_1t_1+(1-h_1)h_2t_2+(1-h_1)(1-h_2)h_3t_3+...+ \\
&(1-h_1)(1-h_2)...(1-h_{n-1})h_nt_n
\end{split}
\end{equation}
1
  • 2
    What if my equation already involves the split environment? Commented Apr 11, 2021 at 10:14
15

Alternatively, if one desires all equations in the document to be flushed left by default, one can also define in the preamble:

\usepackage[fleqn]{amsmath}

Then, proceed to use equation or align or similar environments.

0
7

Note flalign requires at least two groups of alignment, whence a supplementary ampersand. I wanted to point another possibility with the fleqn environment from nccmath (which loads amsmath). This environment can take an optional argument to set the distance from the left margin the equation(s) start (default is 0 pt). It works somewhat like the subequations environment in the sense that all (groups of) equations inside the environment will start at the left margin.

\documentclass{article}
\usepackage{amsmath, nccmath}
\usepackage{geometry}

\begin{document}

Some text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.

\begin{fleqn}[\parindent]
\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{fleqn}

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

\end{document} 

enter image description here

5

This answer addresses some possible misconceptions.

Note that there are two ways to interpret the questions -- if you use the wrong solution, you'll probably find that nothing works.

Summary:

Summary

The two ways to interpret the questions are:

  1. You may want to left-align the equations relative to each other, or
  2. You may want to left-align the equations relative to the page margin.

The solutions are, respectively,

  1. To left-align the equations relative to the page margin, use one of the following:

  2. To left-align the equations relative to each other, put the & before each equation.

    \begin{align*}
    &1+2 = 3 \\
    &4 = 5-2+1
    \end{align*}
    

    Again, this work mostly as a hack -- the align equation aligns the first column to the right and the second column to the left, so if the first column is empty, the whole equation are aligned to the left with respect to each other.

  3. To do both, combine the changes.

    Another method is to use gather combined with [fleqn]:

    gather with fleqn

    Or, of course, gather combined with fleqn environment from nccmath package.

    \begin{fleqn}
    \begin{gather*}
    1+2 = 3 \\
    4 = 5-2+1
    \end{gather*}
    \end{fleqn}
    
2

multline* did the trick for me

\begin{multline*}
p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ 
- 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3
\end{multline*}
0

It has been some time, but let me mention another way. You can use \hspace{10em} at the end of any line and within few try you can figure out what value (instead 10) works best.

You must log in to answer this question.

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