방정식의 분할 조건

방정식의 분할 조건

조건을 일련의 방정식으로 분할하려고 합니다. 그림을 참조하세요.

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

이것은 내 코드입니다.

\begin{align*}
\rho(X,Y)&=1&
\begin{split}
\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\
\text{for some real $\alpha$ and $\beta$ with }\alpha>0,
\end{split}\\
\rho(X,Y)&=-1&
\begin{split}
\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\
\text{for some real $\alpha$ and $\beta$ with }\alpha<0.
\end{split}
\end{align*}

그러나 조건의 첫 번째 줄은 방정식과 동일한 수준에 있지 않습니다. 조건이 일치하는 방식이 마음에 들지 않습니다.

이 문제를 해결하는 방법이나 사용할 다른 환경을 아는 사람이 있습니까?

답변1

조각이 아닌 전체 문서를 게시하십시오. parbox 또는 정렬을 사용하겠습니다.

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

\documentclass{article}

\usepackage{amsmath,amsfonts}

\begin{document}

a
\begin{align*}
\rho(X,Y)&=1&&
\parbox[t]{5cm}{
if and only if $\mathbb P(Y=\alpha X+\beta)=1$\\
for some real $\alpha$ and $\beta$ with $\alpha>0$,}
\\[\jot]
\rho(X,Y)&=-1&&
\parbox[t]{5cm}{if and only if $\mathbb P(Y=\alpha X+\beta)=1$\\
for some real $\alpha$ and $\beta$ with $\alpha<0$.}
\end{align*}

or
\begin{align*}
\rho(X,Y)&=1&&
\begin{aligned}[t]\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\
\text{for some real $\alpha$ and $\beta$ with }\alpha>0,
\end{aligned}\\[\jot]
\rho(X,Y)&=-1&&
\begin{aligned}[t]\text{if and only if }\mathbb P(Y=\alpha X+\beta)=1\\
\text{for some real $\alpha$ and $\beta$ with }\alpha<0.
\end{aligned}
\end{align*}
\end{document}

답변2

amsmath환경은 어떻습니까 cases? 이와 같이:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
\rho(X,Y)=
\begin{cases}
\phantom{-}1 & \text{if and only if $\mathbb{P}(Y=\alpha X+\beta)=1$}
       \\
       &\text{for some real $\alpha$ and $\beta$ with $\alpha >0$,}
\\[4pt]
    -1 & \text{if and only if $\mathbb{P}(Y=\alpha X+\beta)=1$}
       \\
       &\text{for some real $\alpha$ and $\beta$ with $\alpha < 0$.}
\end{cases}
\end{equation*}

\end{document}

케이스가 있는 여러 줄 조건

\\[-2pt]원하는 경우 각 두 줄 조건에서 줄 쌍 사이의 줄 간격은 첫 번째와 세 번째 인스턴스 대신에 다음을 사용하여 약간 더 좁힐 수 있습니다.\\

답변3

.tabular

너비를 추측할 필요가 없고 \parbox서투른 \text매크로를 피할 수 있다는 장점이 있습니다. 지정자는 @{}l@{}양쪽에 패딩이 없는 하나의 왼쪽 정렬 열을 의미합니다.

alignat두 부분 사이의 공간을 더 세밀하게 제어할 수 있습니다 .

\documentclass{article}
\usepackage{amsmath,amssymb}

\renewcommand{\Pr}{\operatorname{\mathbb{P}}} % probability operator

\begin{document}

\begin{alignat*}{2}
\rho(X,Y) &= 1  &\qquad& \begin{tabular}[t]{@{}l@{}}
                         if and only if $\Pr(Y=\alpha X+\beta)=1$ \\
                         for some real $\alpha$ and $\beta$ with $\alpha>0$,
                         \end{tabular}
\\[1ex]
\rho(X,Y) &= -1 &&       \begin{tabular}[t]{@{}l@{}}
                         if and only if $\Pr(Y=\alpha X+\beta)=1$ \\
                         for some real $\alpha$ and $\beta$ with $\alpha<0$.
                         \end{tabular}
\end{alignat*}

\end{document}

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

답변4

dcases환경(패키지 제공 mathtools)을 사용하고 \parbox조건 정보를 저장하기 위해 es를 사용하는 것이 좋습니다 .

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

Parbox를 위쪽에 정렬하려면 간단히 [t]("top") 위치 지정자를 추가하면 됩니다.

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


\documentclass{article}
\usepackage{amsfonts,mathtools}
\let\Pr\relax
\DeclareMathOperator{\Pr}{\mathbb{P}} % probability operator
\begin{document}
\[
\rho(X,Y) =
\begin{dcases} % optional: '[t]' ("top") specifiers for the parboxes
1 & \parbox[t]{5.5cm}{if and only if $\Pr(Y=\alpha X+\beta)=1$ for some real $\alpha$ and $\beta$ with $\alpha>0$,}\\[1ex]
-1 & \parbox[t]{5.5cm}{if and only if $\Pr(Y=\alpha X+\beta)=1$ for some real $\alpha$ and $\beta$ with $\alpha<0$.}
\end{dcases}
\]
\end{document}

관련 정보