Condiciones de división en ecuaciones.

Condiciones de división en ecuaciones.

Estoy intentando dividir la condición en un conjunto de ecuaciones; ver figura.

ingrese la descripción de la imagen aquí

Este es mi código:

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

Sin embargo, la primera línea de la condición no está al mismo nivel que la ecuación. No me gusta cómo se alinean las condiciones.

¿Alguien sabe cómo solucionar este problema o qué otro entorno utilizar?

Respuesta1

Publique documentos completos, no fragmentos, usaría parbox o alineado

ingrese la descripción de la imagen aquí

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

Respuesta2

¿Qué tal el amsmathmedio ambiente cases? Como esto:

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

Condiciones multilínea con casos.

Si se desea, el espacio entre líneas entre el par de líneas en cada condición de dos líneas podría ajustarse un poco usando, por ejemplo, \\[-2pt]en lugar de la primera y tercera instancia de\\

Respuesta3

Una variante no mencionada en otras respuestas, que usa tabular.

Tiene la ventaja de que no es necesario adivinar el ancho del \parboxy evita \textmacros torpes. El especificador @{}l@{}significa una columna alineada a la izquierda sin relleno en ninguno de los lados.

Con alignatusted tendrá un control más preciso sobre el espacio entre las dos partes.

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

ingrese la descripción de la imagen aquí

Respuesta4

Me gustaría sugerirle que utilice un dcasesentorno (cortesía del mathtoolspaquete) y utilice \parboxes para albergar la información de acondicionamiento.

ingrese la descripción de la imagen aquí

Si prefiere que los parboxes estén alineados en la parte superior, simplemente agregue [t]("superior") especificadores de posicionamiento:

ingrese la descripción de la imagen aquí


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

información relacionada