![Condiciones de división en ecuaciones.](https://rvso.com/image/348641/Condiciones%20de%20divisi%C3%B3n%20en%20ecuaciones..png)
Estoy intentando dividir la condición en un conjunto de ecuaciones; ver figura.
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
\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 amsmath
medio 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}
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 \parbox
y evita \text
macros torpes. El especificador @{}l@{}
significa una columna alineada a la izquierda sin relleno en ninguno de los lados.
Con alignat
usted 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}
Respuesta4
Me gustaría sugerirle que utilice un dcases
entorno (cortesía del mathtools
paquete) y utilice \parbox
es para albergar la información de acondicionamiento.
Si prefiere que los parboxes estén alineados en la parte superior, simplemente agregue [t]
("superior") especificadores de posicionamiento:
\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}