将 stackrel 命令中的等价箭头放在对齐环境中,一个接一个地放在下面

将 stackrel 命令中的等价箭头放在对齐环境中,一个接一个地放在下面

我试图在对齐环境中将等价箭头一个接一个地放在另一个下方。但是等价箭头在命令中\stackrel并包含引用,因此它们有点位移,因为对齐环境对齐的是\stackrel而不是等价箭头。我怎样才能在等价箭头处对齐它?

\documentclass{article}

\usepackage{amsmath,amsfonts}

\let\iff\Leftrightarrow

\begin{document}
\begin{align*}
\boxed{{z_1}} \boxed \leq \boxed{{z_2}} &\iff [(z_1, 1)] \boxed \leq [(z_2, 1)]
\\ &\stackrel{2.18(e)}{\iff} \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1, 1)] \boxed + [(n, m)]
\\ &\stackrel{2.18(a)}{\iff} \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1m + n, m)]
\\ &\stackrel{2.17}{\iff} \exists n \in \mathbb{N}_0, m \in \mathbb{N}: z_2m = z_1 m + n. \tag*{(*)}
\end{align*}
\end{document}

latex 图像

PS:我出于审美原因定义

\let\iff\Leftrightarrow

所以这些等价箭头比平常的要短。

答案1

尝试array环境:

\documentclass{article}
\usepackage{amsmath, amssymb}
\let\iff\Leftrightarrow

\begin{document}
    \[\setlength\arraycolsep{1pt}
\begin{array}[b]{rcl}
\boxed{{z_1}} \boxed \leq \boxed{{z_2}} 
&\iff & 
    [(z_1, 1)] \boxed \leq [(z_2, 1)] \\ 
&\stackrel{2.18(e)}{\iff} &
    \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1, 1)] \boxed + [(n, m)]    \\
&\stackrel{2.18(a)}{\iff} &
    \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1m + n, m)]    \\
&\stackrel{2.17}{\iff} & 
    \exists n \in \mathbb{N}_0, m \in \mathbb{N}: z_2m = z_1 m + n. \tag*{(*)}
\end{array}
    \]
\end{document}

在此处输入图片描述

答案2

使用array。我还建议在方框符号周围添加个人命令和正确的关系和操作间距。

\documentclass{article}

\usepackage{amsmath,amsfonts,array}

\renewcommand{\iff}{\Leftrightarrow}
\newcommand{\numberset}[1]{\mathbb{#1}}
\newcommand{\N}{\numberset{N}}

\newcommand{\Bleq}{\mathrel{\boxed{\leq}}}
\newcommand{\Bplus}{\mathbin{\boxed{+}}}
\newcommand{\Bobj}[1]{\boxed{#1}}

\begin{document}

\begin{equation}
\setlength{\arraycolsep}{0pt} % local setting
\begin{array}[b]{r >{{}}c<{{}} l}
\Bobj{z_1} \Bleq \Bobj{z_2}
  & \iff & [(z_1, 1)] \Bleq [(z_2, 1)]
\\[\jot]
  &\overset{2.18(e)}{\iff} & \exists n \in \N_0, m \in \N \mathpunct:
                               [(z_2, 1)] = [(z_1, 1)] \Bplus [(n, m)]
\\[\jot]
  &\overset{2.18(a)}{\iff} & \exists n \in \N_0, m \in \N \mathpunct:
                               [(z_2, 1)] = [(z_1m + n, m)]
\\[\jot]
  &\overset{2.17}{\iff}    & \exists n \in \N_0, m \in \N \mathpunct:
                                z_2m = z_1 m + n.
\end{array}
\tag*{(*)}
\end{equation}

\end{document}

在此处输入图片描述

一个不同的认识(我更喜欢):

\documentclass{article}

\usepackage{amsmath,amsfonts,array}

\renewcommand{\iff}{\Leftrightarrow}
\newcommand{\numberset}[1]{\mathbb{#1}}
\newcommand{\N}{\numberset{N}}

\newcommand{\Bleq}{\mathrel{\boxed{\leq}}}
\newcommand{\Bplus}{\mathbin{\boxed{+}}}
\newcommand{\Bobj}[1]{\boxed{#1}}

\begin{document}

\begin{align*}
\Bobj{z_1} \Bleq \Bobj{z_2}
  &\iff  [(z_1, 1)] \Bleq [(z_2, 1)]
\\
  &\iff \exists n \in \N_0, m \in \N \mathpunct: [(z_2, 1)] = [(z_1, 1)] \Bplus [(n, m)]
  &&\text{by 2.18(e)}
\\
  &\iff \exists n \in \N_0, m \in \N \mathpunct: [(z_2, 1)] = [(z_1m + n, m)]
  &&\text{by 2.18(a)} \vphantom{\Bplus}
\\
  &\iff \exists n \in \N_0, m \in \N \mathpunct: z_2m = z_1 m + n
  &&\text{by 2.17} \smash[b]{\vphantom{\Bplus}}
  \tag*{(*)}
\end{align*}

\end{document}

在此处输入图片描述

答案3

您可以将上部元素放置\stackrel在 a 中\mathclap,然后~根据需要添加其他空间。

在此处输入图片描述

\documentclass{article}

\usepackage{mathtools,amsfonts}

\let\iff\Leftrightarrow

\begin{document}

\begin{align*}
  \boxed{{z_1}} \boxed \leq \boxed{{z_2}} 
    &\iff [(z_1, 1)] \boxed \leq [(z_2, 1)] \\
    &\stackrel{\mathclap{2.18(e)}}{\iff} ~~ \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1, 1)] \boxed + [(n, m)] \\
    &\stackrel{\mathclap{2.18(a)}}{\iff} ~~ \exists n \in \mathbb{N}_0, m \in \mathbb{N}: [(z_2, 1)] = [(z_1 m + n, m)] \\
    &\stackrel{\mathclap{2.17}}{\iff}    ~~ \exists n \in \mathbb{N}_0, m \in \mathbb{N}: z_2 m = z_1 m + n.
\end{align*}

\end{document}

相关内容