4

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  \begin{equation}
X_r = \begin{cases}
          2r-2, & \text{for $k = 1$,}\\
          2r-3, & \text{otherwise}.
      \end{cases}
\end{equation}          
\end{enumerate}

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

enter image description here

5
  • Does this equation have to be numbered?
    – Bernard
    Mar 19, 2019 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, 2019 at 10:36
  • 2
    In this case, just do as advised by @JouleV.
    – Bernard
    Mar 19, 2019 at 10:38
  • @Bernard Thank you. Yeah it is working.
    – monalisa
    Mar 19, 2019 at 10:40
  • 2
    BTW, it's not cases causing the centering. It's the fact that you're in the equation environment.
    – Teepeemm
    Mar 19, 2019 at 16:41

3 Answers 3

9

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}

enter image description here

2

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:

enter image description here

4
  • 2
    This leaves some very ugly vertical spacing, though.
    – Peiffap
    Mar 19, 2019 at 11:23
  • @Peiffap Because this new environment will introduce vertical spacing for the sake of alignment itself. Mar 19, 2019 at 13:24
  • 2
    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, 2019 at 13:56
  • 2
    @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 :) Mar 19, 2019 at 13:57
0

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}

You must log in to answer this question.

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