align* 中的空白来自哪里?

align* 中的空白来自哪里?

我正在尝试使用align*环境来对齐两个简单方程:

\begin{align*}
\phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) & = \gedge{v}{u} \\
\phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) & = \gedge{u}{v} & \qquad\mathrm{(z\,wl.\,2)}\\
\end{align*}

不幸的是我得到的结果很糟糕:

在此处输入图片描述

为什么第二个标志前有这么多的水平空间=?!?

不要担心\gedge,它只是一个箭头:

% graph edge
\newcommand{\gedge}[2]{%
#1 \to #2%
}%

答案1

所以你有两个选择,

  1. 使用对齐

    \begin{align*}
    \phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) = \gedge{v}{u} \\
    \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) = \gedge{u}{v}  \qquad\mathrm{(z\,wl.\,2)}\\
    \end{align*}
    
  2. 使用 alignat

    \begin{alignat*}{4}
    \phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) && = \gedge{v}{u} \\
    \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) && = \gedge{u}{v} & \qquad\mathrm{(z\,wl.\,2)}\\
    \end{alignat*}
    

    结果

相关内容