我有以下代码:
\begin{align*}
&\mathbb{P}\bigl((X,\tilde{X})=(x,\tilde{x})_S,(Z,\tilde{Z})=(z,\tilde{z})_S\bigr) \\
&=\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr)\,\mathbb{P}\bigl((X,\tilde{X})=(x,\tilde{x})_S\mid (Z,\tilde{Z})=(z,\tilde{z})_S\bigr)\\
&\!\begin{aligned}[t]
&=\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr)&&\prod_{j\in S}\bigl[\mathbb{P}(X_j=\tilde{x}_j\mid Z_j=\tilde{z}_j)\,\mathbb{P}(\tilde{X}_j=x_j\mid \tilde{Z}_j=z_j)\bigr]\\
&&\cdot&\prod_{j\notin S}\bigl[\mathbb{P}(X_j=x_j\mid Z_j=z_j)\,\mathbb{P}(\tilde{X}_j=\tilde{x}_j\mid \tilde{Z}_j=\tilde{z}_j)\bigr]\\
&=\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr)&&\prod_{j\in S}\bigl[f_j(\tilde{x}_j\mid\tilde{z}_j)f_j(x_j\mid z_j)\bigr]\\
&&\cdot&\prod_{j\notin S}\bigl[f_j(x_j\mid z_j)f_j(\tilde{x}_j\mid\tilde{z}_j)\bigr]\\
&=\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr)&&\prod_{j\in [p]}\bigl[f_j(\tilde{x}_j\mid\tilde{z}_j)f_j(x_j\mid z_j)\bigr]
\end{aligned}
\end{align*}
这是我得到的:
有人能帮帮我吗?谢谢
答案1
我觉得这个看起来不错。我aligned
在每行中使用了一个分成两部分的环境。我还调整了最后一个产品中下标的宽度,因为[p]
它略大于,S
所以它稍微扰乱了对齐。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{calc}
\begin{document}
\begin{align*}
&\mathbb{P}\bigl((X,\tilde{X})=(x,\tilde{x})_S,(Z,\tilde{Z})=(z,\tilde{z})_S\bigr) \\
& = \mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr)\,\mathbb{P}\bigl((X,\tilde{X})=(x,\tilde{x})_S\mid (Z,\tilde{Z})=(z,\tilde{z})_S\bigr) \\
& = \begin{aligned}[t]
\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr) & \prod_{j\in S}\bigl[\mathbb{P}(X_j=\tilde{x}_j\mid Z_j=\tilde{z}_j)\,\mathbb{P}(\tilde{X}_j=x_j\mid \tilde{Z}_j=z_j)\bigr] \\
\cdot & \prod_{j\notin S}\bigl[\mathbb{P}(X_j=x_j\mid Z_j=z_j)\,\mathbb{P}(\tilde{X}_j=\tilde{x}_j\mid \tilde{Z}_j=\tilde{z}_j)\bigr]
\end{aligned} \\
& = \begin{aligned}[t]
\mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr) & \prod_{j\in S}\bigl[f_j(\tilde{x}_j\mid\tilde{z}_j)f_j(x_j\mid z_j)\bigr] \\
\cdot & \prod_{j\notin S}\bigl[f_j(x_j\mid z_j)f_j(\tilde{x}_j\mid\tilde{z}_j)\bigr]
\end{aligned} \\
& = \mathbb{P}\bigl((Z,\tilde{Z}=(z,\tilde{z})_S\bigr) \prod_{\makebox[\widthof{\(\scriptstyle j\in S\)}]{\(\scriptstyle j\in [p]\)}}\bigl[f_j(\tilde{x}_j\mid\tilde{z}_j)f_j(x_j\mid z_j)\bigr]
\end{align*}
\end{document}