![amsmath 对齐环境中的可视化方程链接](https://linux22.com/image/371031/amsmath%20%E5%AF%B9%E9%BD%90%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%9A%84%E5%8F%AF%E8%A7%86%E5%8C%96%E6%96%B9%E7%A8%8B%E9%93%BE%E6%8E%A5.png)
我想“直观地链接”方程式align
因为一张图片胜过千言万语,下面是我在 MS Paint 中制作的一个例子来说明我的意思:
如何实现这个目标?用于测试目的的 MWE:
\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks
\begin{document}
First, let us solve the following recursion formula:
$$ F_{n + 1} = \alpha F_{n} + \beta$$
\begin{align*}
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t}
\end{align*}
\end{document}
答案1
根据我的评论的解决方案:
\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks
\usepackage{tikz}
\def\tikzmark#1{\begin{tikzpicture}[remember picture]\coordinate(#1);\end{tikzpicture}}
\begin{document}
$$ F_{n + 1} = \alpha F_{n} + \beta$$
\begin{align*}
&\tikzmark{A}\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\tikzmark{C}\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\tikzmark{D}\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\tikzmark{B}\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t} \\
&\quad \\
&\quad F_{n + 1} = \alpha F_{n} + \beta \\
&\equiv \sum_{n = 0}^{\infty} F_{n + 1} t^{n} = \alpha \sum_{n = 0}^{\infty} F_{n} t^{n} + \beta t^{n} \\
&\equiv t^{-1} \sum_{n = 0}^{\infty} F_{n + 1} t^{n + 1} = \alpha \sum_{n = 0}^{\infty} F_{n}t^n + \beta t^n \\
&\equiv \phi(t) - F_{0} = \alpha t\phi(t) + \frac{\alpha t}{1 - \beta t} \\
&\equiv \phi(t) (1 - \alpha t) = \frac{\alpha t}{1 - \beta t} + F_0\frac{1 - \beta t}{1 - \beta t}
\end{align*}
\begin{tikzpicture}[remember picture,overlay]
\draw[-,red] (A)--([xshift=-0.6cm]A)|-(B);
\draw[-,blue] (C)--([xshift=-0.4cm]C)|-(D);
\end{tikzpicture}
\end{document}
输出:
请注意,线条从每行(每条数学线)的中心开始,可能需要调整以\equiv
符号为中心。
如果您有兴趣,我可以稍后自动执行此操作。(yshift=2mm
绘制命令中 tikzmark 字母前的选项可以手动修复它)