无间距对齐方程式

无间距对齐方程式

我有以下代码:

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

相关内容