Alignat 无法正常工作

Alignat 无法正常工作

考虑这个最小的例子:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}  

\begin{document}
\begin{alignat}{2}
&\frac{1}{2} log(\langle d_x, d_x \rangle + \frac{1}{2} log(\langle d_y, d_y \rangle - \log(\langle d_x, d_y \rangle) &> 0  \quad| \cdot 2 \\\nonumber
\Leftrightarrow \quad &log(\langle d_x, d_x \rangle + log(\langle d_y, d_y \rangle - 2 \log(\langle d_x, d_y \rangle) &> 0   \\\nonumber
\Leftrightarrow \quad &log(\langle d_x, d_x \rangle + log(\langle d_y, d_y \rangle  &>  2 \log(\langle d_x, d_y \rangle)   \\\nonumber
\Leftrightarrow \quad &e^{log(\langle d_x, d_x \rangle + log(\langle d_y, d_y \rangle}  &>  e^{2 \log(\langle d_x, d_y \rangle)}   \\\nonumber
\end{alignat}
\end{document}

我希望线的开头和>符号对齐。但是只有线的开头对齐,而符号没有对齐>。请看:

截屏

答案1

您需要使用更多的对齐运算符,&因为周围的传统输出遵循右-左对齐:

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}  

\begin{document}
\begin{alignat*}{3}
  &\tfrac{1}{2} \log(\langle d_x, d_x \rangle + \tfrac{1}{2} \log(\langle d_y, d_y \rangle - \log(\langle d_x, d_y \rangle) &&> 0  \quad| \cdot 2 \\
  \Leftrightarrow \quad &\log(\langle d_x, d_x \rangle + \log(\langle d_y, d_y \rangle - 2 \log(\langle d_x, d_y \rangle) &&> 0 \\
  \Leftrightarrow \quad &\log(\langle d_x, d_x \rangle + \log(\langle d_y, d_y \rangle  &&>  2 \log(\langle d_x, d_y \rangle) \\
  \Leftrightarrow \quad &e^{\log(\langle d_x, d_x \rangle + \log(\langle d_y, d_y \rangle}  &&>  e^{2 \log(\langle d_x, d_y \rangle)}
\end{alignat*}
\end{document}

请注意,您可以使用alignat*来避免重复\nonumber

相关内容