# Visual equation links in amsmath align environments

I would like to "visually link" equations in the align

Since a picture is worth many words, here's an example I made in MS Paint to show what I mean:

How could one achieve this? A MWE for testing purposes:

\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 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 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 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 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 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}

• It can be done easily using tikzpicture with overlay option and tikzmarks... If you want to check this idea (or any other) just add some code (a MWE) to complete Feb 23, 2018 at 4:18
• @koleygr done! i added the mwe that produced the output i used to make the example Feb 23, 2018 at 4:22

A solution according to my comment:

\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 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 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 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 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 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}


Output:

Note, that the lines starts from the center of every row (every math line) and may be have to be adjusted to be centered with \equiv symbol.

May be I can automate this later if you interested. (A yshift=2mm option before the letter of the tikzmark in the draw command can fix it manually)