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

  • Does this equation have to be numbered? – Bernard Mar 19 '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 '19 at 10:36
  • 2
    In this case, just do as advised by @JouleV. – Bernard Mar 19 '19 at 10:38
  • @Bernard Thank you. Yeah it is working. – monalisa Mar 19 '19 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 '19 at 16:41
8

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

| improve this answer | |
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

| improve this answer | |
  • 2
    This leaves some very ugly vertical spacing, though. – Peiffap Mar 19 '19 at 11:23
  • @Peiffap Because this new environment will introduce vertical spacing for the sake of alignment itself. – Raaja is not active on TEXSE Mar 19 '19 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 '19 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 :) – Raaja is not active on TEXSE Mar 19 '19 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}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.