![如何在方程式中添加等效符号](https://linux22.com/image/333760/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%96%B9%E7%A8%8B%E5%BC%8F%E4%B8%AD%E6%B7%BB%E5%8A%A0%E7%AD%89%E6%95%88%E7%AC%A6%E5%8F%B7.png)
这是我的代码:
\begin{align*}
\smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}}
& = (\overline{\underbrace{zz\cdots z}_{n}})^2 \\
\dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9}
& = \dfrac{z^2(10^n-1)^2}{9^2}\\9x(10^n+1) - 9y
& = z^2(10^n-1)\\9x \cdot 10^n + (9x-9y)
& = z^2 \cdot 10^n - z^2
\end{align*}
答案1
或许是这个。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{4}
&\qquad&
\smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}} & = (\overline{\underbrace{zz\cdots z}_{n}})^2 \\
\Leftarrow\kern-4pt\Rightarrow&&
\dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9}
& = \dfrac{z^2(10^n-1)^2}{9^2}\\
\Leftarrow\kern-4pt\Rightarrow&&
9x(10^n+1) - 9y
& = z^2(10^n-1)\\
\Leftarrow\kern-4pt\Rightarrow&&
9x \cdot 10^n + (9x-9y)
& = z^2 \cdot 10^n - z^2
\end{alignat*}
\end{document}
正如 Zarko 所说,还提供了一个双头双线的amspackage
宏。但是,它比我上面提供的自编宏要窄得多。\Leftrightarrow
\Leftarrow\kern-4pt\Rightarrow
答案2
您还可以\ArrowBetweenLines
尝试mathtools
:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}
\begin{alignat*}{2}
& & \smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}}
& = (\overline{\underbrace{zz\cdots z}_{n}})^2 \\
\ArrowBetweenLines
& & \dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9} & = \dfrac{z^2(10^n-1)^2}{9^2}\\%
\ArrowBetweenLines
& & 9x(10^n+1) - 9y & = z^2(10^n-1)\\
\ArrowBetweenLines
& & 9x \cdot 10^n + (9x-9y) & = z^2 \cdot 10^n - z^2
\end{alignat*}
\end{document}