라텍스에서 조건부 수학 방정식 작성

라텍스에서 조건부 수학 방정식 작성

안녕하세요, 저는 이 방정식을 라텍스로 작성하고 싶습니다. 다음 줄을 작성했는데 "j"와 "and" 사이에 공백이 없습니다. 해결 방법을 알려주십시오. 감사해요.

  \begin{align}
    Y_{ij} = \left\{\begin{array}{lr}
        \sum_{k \sim i}y_{ij}, & \text{if } i = j,\\
        {-y_{ij}}, & \text{if } i \ne j   \text{and } i \sim j,\\
        0, & \text{otherwise.}
        \end{array}
  \end{align}

답변1

dcases*다음에서 환경을 사용하여 더 간단하게 입력할 수 있습니다 mathtools. d환경 이름에 있는 것은 입력됨을 의미 \displaystyle하고 별표는 두 번째 열이 텍스트 모드에 있음을 의미합니다.

\usepackage{mathtools}
...........
 \begin{align}
    Y_{ij} = \begin{dcases*}
        \sum_{k \sim i}y_{ij}, & if $ i = j $,\\
        {-y_{ij}}, & if $ i \ne j $ and $ i \sim j $,\\
        0, & otherwise. 
        \end{dcases*}
  \end{align}

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

답변2

내부적으로 로드되는 패키지 cases*의 환경을 사용할 수 있습니다 . 오른쪽 열에 일반 모드로 쓸 수 있으므로 단어 사이의 간격에 대해 걱정할 필요가 없습니다.mathtoolsamsmath

\documentclass{article}
\usepackage{mathtools}
\begin{document}

\begin{equation}
Y_{ij} = \begin{cases*}
  \sum_{k\sim i}y_{ij}, & if $i = j$,\\
  -y_{ij},              & if $i \ne j$ and $i \sim j$,\\
  0,                    & otherwise.
\end{cases*}
\end{equation}

\end{document}

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

답변3

공간 하나를 추가하면 작업이 완료되고 몇 가지 다른 수정 작업도 수행됩니다.

\begin{align}
    Y_{ij} = \Bigg\{
        \begin{array}{ll}
        \sum_{k \sim i}y_{ij}, & \text{if } i = j,\\
        -y_{ij}, & \text{if } i \ne j \text{ and } i \sim j,\\
        0, & \text{otherwise.}
        \end{array}
\end{align}

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

관련 정보