# how to write a formula that branches into two?

I would like to write a formula (see the picture), how can i fix the arrows?

This is my code:

\documentclass[a4paper,12pt]{article}[12pt]
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{anysize}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{textcomp}

\frenchspacing

\newcommand{\abs}[1]{\lvert#1\rvert}

\usepackage{floatflt,epsfig}

\usepackage{multicol}

\usepackage[a4paper,top=1.0cm,bottom=1.0cm,left=1.0cm,right=1.0cm]{geometry}

\begin{document}

$\dfrac{a \pm b}{c} = \rightarrow$

$\dfrac{a+b}{c}$

$\dfrac{a-b}{c}$

\end{document}

• Can I ask a favour please? Thank you to have accepted (check) my answer, but for my opinion is not the best. Good year. Jan 2, 2019 at 23:40

Another simple possibility using .

\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\usepackage{amsmath}

\begin{document}
\begin{tikzcd}[cells={nodes={minimum height=-2cm,minimum width=1cm}},column sep=3em,row sep=-7pt]
& \dfrac{a+b}{c}  \\
\dfrac{a \pm b}{c} = \arrow[ru] \arrow[rd] &  \\
& \dfrac{a-b}{c}
\end{tikzcd}
\end{document}


Here is an adapted version from Claudio Fiandrino's answer to Joining parts of equations with lines or arrows using tikz.

\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}

\begin{document}

\begin{tikzpicture}[grow=right,
sibling distance=50pt,
level distance=2cm,
edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)},
edge from parent/.style={draw,-latex}]
\node {$\dfrac{a \pm b}{c} =$}
child {node {$\dfrac{a-b}{c}$}}
child {node {$\dfrac{a+b}{c}$}}
;
\end{tikzpicture}
\end{document}

• @ryuk: From the message you quoted, I guess that you copied my code into an existing document that was previously compiled and had used \usepackage[italian]{babel}. To get rid of the error, either recompile or add the above mentioned package back to your preamble. Jan 2, 2019 at 15:45

Without using a hammersledge to crack a nut, you already have the necessary packages for the below code.

Unrelated: epsfigure and anysize are obsolete. The functionalities of the former are achieved with graphicx and the latter can be replaced with geometry (which you use, anyway).

\documentclass[a4paper, 12pt]{article}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, margin=1.0cm]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{multicol}
\frenchspacing

\usepackage{old-arrows}

\begin{document}

$\dfrac{a \pm b}{c} = \begin{matrix} \nearrow \\[-1.5ex] \searrow \end{matrix} \: \begin{matrix} \dfrac{a+b}{c} \\[3ex] \dfrac{a-b}{c} \end{matrix}$

\end{document}


If you want to have the arrows figure centred on the math axis, and control the gap between the arrows, you can replace the matrix environment for the arrows with \Vectorstack from the stackengine package (load it with option [usestackEOL]). Here are two examples, with a different gap:

$\Lstackgap = 10pt\dfrac{a ± b}{c} = \Vectorstack{% \nearrow \\%[-1.5ex] \searrow } \: \begin{matrix} \dfrac{a+b}{c} \\[3ex] \dfrac{a-b}{c} \end{matrix}$

$\Lstackgap = 18pt\dfrac{a ± b}{c} = \Vectorstack{% \nearrow \\%[-1.5ex] \searrow } \: \begin{matrix} \dfrac{a+b}{c} \\[3ex] \dfrac{a-b}{c} \end{matrix}$


• Those arrows look uncentered in relation to the equals sign. Would there be any way of fixing that?
– AJF
Jan 2, 2019 at 18:54
• Do you mean vertically uncentred? Jan 2, 2019 at 18:57
• @AJFarmar: I've posted a variant code, which uses stackengine and is more versatile. Please see if it's OK for you. Jan 2, 2019 at 21:55
• You're welcome. We're here to help, as much as we can. Jan 2, 2019 at 21:58
• @Sebastiano: I wish you a very happy new year too. As often, I forgot to check if all the code was in the right position. Thank you for pointing it! Jan 2, 2019 at 23:35