[Tex/LaTex] Arrow from last line of equation to the first

arrowsequations

I would like to have something similar to the arrow in this picture:

Equation with arrow

Is this possible to include without a lot of coding? At the moment the code is:

\documentclass[10pt,a4paper]{scrbook}
\usepackage[T1]{fontenc}
 \usepackage[english]{babel}
 \usepackage{amsmath}
 \begin{document}

\begin{equation}
\begin{split}
& ^\text{1}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{2}\text{H} + \text{e}^+ + \nu \\
& ^\text{2}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{3}\text{He} + \gamma  \\
& ^\text{3}\text{He} + {}^\text{4}\text{He}  \rightarrow {}^\text{7}\text{Be} \\
& ^\text{7}\text{Be} + \text{p}  \rightarrow {}^\text{8}\text{B} + \gamma \\
& ^\text{8}\text{B}  \rightarrow {}^\text{8}\text{Be} + \nu + \text{e}^+ \\
& ^\text{8}\text{Be} \rightarrow \text{2}~ ^\text{4}\text{He}
\label{eq:ppkette3}
\end{split}
\end{equation}

\end{document}

I tried some stuff with a box but did not get any usable results.

Thanks in advance

Best Answer

A possible solution with the famous \tikzmark macro:

\documentclass[10pt,a4paper]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath}


\usepackage{tikz}
\newcommand{\tikzmark}[1]{%
\tikz[overlay,remember picture, 
 baseline=-\the\dimexpr\fontdimen22\textfont2\relax]% correct vertical alignment:
% http://tex.stackexchange.com/questions/59658/use-of-tikzpicture-matrix-in-align-or-gather-environment/59660#comment126261_59660
 \node (#1) {};%
}
\tikzset{square arrow/.style={to path={(\tikztostart)-- ++(-0.5,0) |- (\tikztotarget)}}}

\begin{document}

\begin{equation}
\begin{split}
\tikzmark{ini} & ^\text{1}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{2}\text{H} + \text{e}^+ + \nu \\
               & ^\text{2}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{3}\text{He} + \gamma  \\
               & ^\text{3}\text{He} + {}^\text{4}\text{He}  \rightarrow {}^\text{7}\text{Be} \\
               & ^\text{7}\text{Be} + \text{p}  \rightarrow {}^\text{8}\text{B} + \gamma \\
               & ^\text{8}\text{B}  \rightarrow {}^\text{8}\text{Be} + \nu + \text{e}^+ \\
\tikzmark{end} & ^\text{8}\text{Be} \rightarrow \text{2}~ ^\text{4}\text{He}
\end{split}
\begin{tikzpicture}[remember picture,overlay]
\draw[-stealth,square arrow] (end) to (ini);
\end{tikzpicture}
\label{eq:ppkette3}
\end{equation}

\end{document}

The result:

enter image description here

It requires two compilation runs.

To get an arrowhead matching with \rightarrow, it is possible to exploit the powerful arrows.meta library. Add

\usetikzlibrary{arrows.meta}

in the preamble and change:

\draw[-stealth,square arrow] (end) to (ini);

with

\draw[-{To[length=2.45pt]},square arrow] (end) to (ini);

The result will be:

enter image description here