Latex에서 케이스를 왼쪽 정렬하는 방법은 무엇입니까?

Latex에서 케이스를 왼쪽 정렬하는 방법은 무엇입니까?

WinEdt를 사용하고 있습니다. 그리고 다음 코드를 실행하려고 합니다. 그런데 두 번째 항목이 중간에 나오네요. 점 (i)처럼 가장 왼쪽에 나타나도록 정렬할 수 있나요? 친절하게 도와주세요. 도움을 주셔서 감사합니다.

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

위의 tex 코드를 실행한 후 다음 출력을 얻었습니다.

여기에 이미지 설명을 입력하세요

답변1

대신 인라인 수학을 사용해 보세요. 참고: 이것은 귀하의 에 번호를 매기지 않습니다 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}

여기에 이미지 설명을 입력하세요

답변2

솔루션 의 또 다른 대안 은 다음과 같이 from을 JouleV사용하는 것입니다 .flalignamsmath

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

얻으려면 :

여기에 이미지 설명을 입력하세요

답변3

일반적으로 문서 클래스의 fleqn을 옵션으로 사용하여 수학 모드의 왼쪽 정렬을 정의할 수 있습니다.

그런 다음 \setlength\mathindent{0pt}를 수행해야 합니다.

관련 정보