Splitting conditions in equations

How about the amsmath environment cases? Like this:

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

Multiline conditions with cases

If desired, the line spacing between the pair of lines in each two-line condition could be tightened up a bit by using, say, \\[-2pt] in place of the first and third instance of \\


Please post full documents not fragments, I'd use parbox or aligned

enter image description here

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

A variant not mentioned in other answers, which uses tabular.

It has the advantage that you don't need to guess the width of the \parbox and avoids clumsy \text macros. The specifier @{}l@{} means one left aligned column with no padding on either side.

With alignat you have finer control over the space between the two parts.

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

enter image description here

Tags:

Equations