5

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

7

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

  • I note that \draw[->,square arrow] (end) to (ini); would give you an arrowhead that matches the \rightarrows but how do you get it to be exactly the same size? – Thruston May 30 '14 at 15:01
  • @Thruston: you're right. Please, see my edited answer. – Claudio Fiandrino May 30 '14 at 15:19
2

We can also do this using a plain halign with no interline skips and vertical rules.

enter image description here

\documentclass{article}
\begin{document}
\begin{equation}
\vcenter{\offinterlineskip\halign{&$#$\hfil\cr
\vrule height .6ex depth 6pt\mkern-1.67mu \to & \rm \mathord{{}^1H + {}^1H} \to \mathord{{}^2H + e^+ + \nu} \cr
\vrule height  9pt depth 6pt                  & \rm \mathord{{}^2H + {}^1H} \to {}^3He +\gamma \cr
\vrule height  9pt depth 6pt                  & \rm \mathord{{}^3He+ {}^4He} \to {}^7Be\cr
\vrule height  9pt depth 6pt                  & \rm \mathord{{}^7Be+ p} \to {}^8B+\gamma\cr
\vrule height  9pt depth 6pt                  & \rm \mathord{{}^8B} \to {}^8Be+\nu+e^+\cr
\vrule height  9pt depth -.6ex\mkern-.67mu 
\vrule height .6ex depth -.5ex width 1em \ 
& \rm \mathord{{}^8Be} \to {}^4He\cr
}}
\end{equation}
\end{document}

This has the small advantage that the arrow heads look the same. Note that the final horizontal line is actually drawn by a \vrule.

1

A solution with pst-node, but you have to go the latex -> dvips -> pstopdf:

\documentclass[10pt,a4paper, pdf]{scrbook}
\usepackage[T1]{fontenc}
 \usepackage{amsmath}
 \usepackage{pst-node}

 \begin{document}

\begin{equation}
\label{eq:ppkette3}
\begin{aligned}
\pnode(0,0){F}& ^\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}^+ \\
\pnode(0,0){L}& ^\text{8}\text{Be} \rightarrow \text{2}~ ^\text{4}\text{He}
\end{aligned}
\end{equation}
\ncbar[angle = 180,nodesep = 0.5em]{->}{L}{F}

\end{document}     \documentclass[10pt,a4paper, pdf]{scrbook}
\usepackage[T1]{fontenc}
 \usepackage{amsmath}
 \usepackage{pst-node}

 \begin{document}

\begin{equation}
\label{eq:ppkette3}
\begin{aligned}
\pnode(0,0){F}& ^\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}^+ \\
\pnode(0,0){L}& ^\text{8}\text{Be} \rightarrow \text{2}~ ^\text{4}\text{He}
\end{aligned}
\end{equation}
\ncbar[angle = 180,nodesep = 0.5em]{->}{L}{F}

\end{document} 

enter image description here

1

tkz-linknodes package is another option in case you accept to place the arrow on the right side of your equations.

Package objective is to

easily create links between the lines of an environment as aligned or still align by indicating the operation made between the two lines

Only three commands/environments are used NodesList, AddNode and LinkNodes. An example taken from package documentations looks like:

\documentclass{article}
\usepackage[T1]{fontenc}
 \usepackage[english]{babel}
 \usepackage{amsmath}
\usepackage{tkz-linknodes}
\begin{document}
\begin{NodesList}
\begin{align}
\boxed{ 3(x^2-3) =4 } \AddNode\\
x^2-3 =\frac{4}{3} \AddNode\\
\intertext{\hfil isolate the term with the variable \hfil}
x^2 =\frac{13}{3} \AddNode\\
\sqrt{x^2} =\sqrt{\frac{13}{3}} \AddNode\\
|x| =\sqrt{\frac{13}{3}} \AddNode\\
x =\pm\sqrt{\frac{13}{3}} \AddNode
\end{align}
\LinkNodes[margin=1cm]{$\div 3$}%
\LinkNodes[margin=1.5cm]{$+3$}%
\LinkNodes[margin=2.5cm]{$\sqrt{\ldots}$}
\LinkNodes[margin=3cm]{$\sqrt{x^2}=|x|$}
\LinkNodes[margin=4.5cm]{we have two answers}
\end{NodesList}
\end{document}

and produces

enter image description here

Therefore, your example could be

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

\begin{NodesList}
\begin{equation}
\begin{split}
& ^\text{1}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{2}\text{H} + \text{e}^+ + \nu \AddNode \\
& ^\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}\AddNode 
\label{eq:ppkette3}
\end{split}
\end{equation}
\tikzset{ArrowStyle/.append style={<-}}
\LinkNodes[margin=4cm]{}
\end{NodesList}

\end{document}

and the result:

enter image description here

0

In case you accept to place the arrow on the right side of your equations, you can use witharrows and it's direct.

\documentclass{article}
\usepackage{amstext}
\usepackage{witharrows}
\begin{document}
\begin{DispWithArrows*}[format = l]
^\text{1}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{2}\text{H} + \text{e}^+ + \nu
\Arrow[tikz=<-,jump=5]{} \\
^\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}
\end{DispWithArrows*}
\end{document}

Result of the first code

You can change the shape of the arrow if you want (if you know the syntax of Tikz).

\documentclass{article}
\usepackage{amstext}
\usepackage{witharrows}
\begin{document}
\begin{DispWithArrows*}%
   [ format = l ,
     tikz-code = { \draw (#1) -- ++(5mm,0) |- (#2) ; } ]
^\text{1}\text{H} + {}^\text{1}\text{H}  \rightarrow {}^\text{2}\text{H} + \text{e}^+ + \nu
\Arrow[tikz=<-,jump=5]{} \\
^\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}
\end{DispWithArrows*}
\end{document}

Result of the second code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.