# Left align 3 different equations

I would like to left align three different equations of three different lengths. As of now I am using this code:

$$log_{10}M_{200} = (0.94\pm0.005)log_{10}N_{gal}+(12.11\pm0.009)\hspace{10mm} \left[for N_{gal}>20\right] \label{equation:power_law_rich20}$$

$$log_{10}M_{200} = (0.74\pm0.003)log_{10}N_{gal}+(12.46\pm0.005)\hspace{10mm} \left[for M_{200}>2X10^{13}M_{\odot}\right] \label{equation:power_law_mass2e13}$$

$$log_{10}M_{200} = (0.85\pm0.005)log_{10}N_{gal}+(12.28\pm0.008)\hspace{10mm} \left[for (N_{gal}>20+M_{200}>2X10^{13}M_{\odot})\right] \label{equation:power_law_rich20_mass2e13}$$


Which gives me this output:

I would like these three equations to be left aligned separately, in other words, the equation number (5) and (6) to be aligned with equation (7) as it is the lengthiest equation.

You want to use the align environment:

\documentclass{article}
\usepackage[margin=1cm,a4paper]{geometry}
\usepackage{amsmath}

\usepackage{lipsum} % just for the example

\begin{document}

\lipsum*[2]
\begin{align}
\log_{10}M_{200} &= (0.94\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.11\pm0.009)
&&\text{for $N_{\mathrm{gal}}>20$}
\label{equation:power_law_rich20}
\\
\log_{10}M_{200} &= (0.74\pm0.003)\log_{10}N_{\mathrm{gal}}+(12.46\pm0.005)
&&\text{for $M_{200}>2\times10^{13}M_{\odot}$}
\label{equation:power_law_mass2e13}
\\
\log_{10}M_{200} &= (0.85\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.28\pm0.008)
&&\text{for $(N_{\mathrm{gal}}>20+M_{200}>2\times10^{13}M_{\odot})$}
\label{equation:power_law_rich20_mass2e13}
\end{align}
\lipsum[3]

\end{document}


Note that \log should be used instead of log; also \times is the right symbol for the product in that case, not X.

If you have stricter space constraints, you can use multlined from mathtools:

\documentclass{article}
%\usepackage[margin=1cm,a4paper]{geometry}
\usepackage{amsmath,mathtools}

\usepackage{lipsum} % just for the example

\begin{document}

\lipsum*[2]
\begin{gather}
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.94\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.11\pm0.009)
\\\text{for $N_{\mathrm{gal}}>20$}
\end{multlined}
\label{equation:power_law_rich20}
\\
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.74\pm0.003)\log_{10}N_{\mathrm{gal}}+(12.46\pm0.005)
\\\text{for $M_{200}>2\times10^{13}M_{\odot}$}
\end{multlined}
\label{equation:power_law_mass2e13}
\\
\begin{multlined}[c][\dimexpr\displaywidth-5em]
\log_{10}M_{200} = (0.85\pm0.005)\log_{10}N_{\mathrm{gal}}+(12.28\pm0.008)
\\\text{for $(N_{\mathrm{gal}}>20+M_{200}>2\times10^{13}M_{\odot})$}
\end{multlined}
\label{equation:power_law_rich20_mass2e13}
\end{gather}
\lipsum[3]

\end{document}


• what does \mathrm{gal} do here? Commented Feb 18, 2015 at 12:04
• @ThePredator A textual subscript should be typeset upright; otherwise it would be the product of “g” times “a” times “l”, which most certainly isn't. Commented Feb 18, 2015 at 12:07