# How to left align the cases in Latex?

I am using WinEdt. And trying to run the following code. However, the second item is coming in the middle. Can we align it to appear on the extreme left like the point (i)? Kindly help. Thanks a lot for the help.

\begin{enumerate}[(i)]
\item Statement 1.
\item  $$X_r = \begin{cases} 2r-2, & \text{for k = 1,}\\ 2r-3, & \text{otherwise}. \end{cases}$$
\end{enumerate}


I got the following ouptut after running the above tex code.

• Does this equation have to be numbered? – Bernard Mar 19 at 10:35
• @Bernard My code gave numbered equation of which I could not screenshot properly. No, it is not necessary to be a numbered equation. – monalisa Mar 19 at 10:36
• In this case, just do as advised by @JouleV. – Bernard Mar 19 at 10:38
• @Bernard Thank you. Yeah it is working. – monalisa Mar 19 at 10:40
• BTW, it's not cases causing the centering. It's the fact that you're in the equation environment. – Teepeemm Mar 19 at 16:41

Try in-line math instead. Note: this will not number your cases.

\documentclass{article}
\usepackage{enumerate}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}[(i)]
\item Statement 1.
\item $X_r = \begin{cases} 2r-2, & \text{for$k = 1$,}\\ 2r-3, & \text{otherwise}. \end{cases}$
\end{enumerate}
\end{document}


Another alternative for JouleV solution would be to use flalign from amsmath as in

\documentclass{article}
\usepackage{enumerate}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}[(i)]
\item Statement 1.
\item \begin{flalign}X_r& = \begin{cases}
2r-2, & \text{for $k = 1$,}\\
2r-3, & \text{otherwise}.
\end{cases}&\end{flalign}
\end{enumerate}
\end{document}


to get:

• This leaves some very ugly vertical spacing, though. – Peiffap Mar 19 at 11:23
• @Peiffap Because this new environment will introduce vertical spacing for the sake of alignment itself. – Raaja Mar 19 at 13:24
• I never said it was a problem with your code, I'm just pointing out that visually this answer is not the most pleasing, to me at least. – Peiffap Mar 19 at 13:56
• @Peiffap I understood that you did not tell that you had a problem with my code. However, I just wanted to give you an explanation for this occurence :) – Raaja Mar 19 at 13:57

You can define generally a left align of the math mode using fleqn in your documentclass as a option.

Afterwards you need to \setlength\mathindent{0pt}