# How can I draw those arrows to describe the composition of two functions?

I want to draw something like this with LaTeX. I know how to draw the two straight arrows, but how can I make the bottom shaped arrow?

-
I was going to suggest using dot as an alternative, but sometimes dot has problems with where to put labels on edges. –  David Hammen May 6 '14 at 2:29

Something likes this. In particular, the anlge 30 can be changed to suit one's need.

\draw[->,>=stealth] (a) edge[bend right=zz]node[below]{C} (c);
\draw[->,>=stealth] (a) edge[out=xx, in=yy]node[below]{C} (c);


Code

\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{positioning,arrows}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (a) {a};
\node[right =1cm of a]  (b){b};
\node[right =1cm of b]  (c){c};
\draw[->,>=stealth] (a) --node[above]{A} (b);
\draw[->,>=stealth] (b) --node[above]{B} (c);
\draw[->,>=stealth] (a) edge[bend right=30]node[below]{C} (c);
\end{tikzpicture}
\end{document}

-
Exactly what I was looking for. Thank you very much. –  magu_ May 5 '14 at 12:45
You are welcome. –  Jesse May 5 '14 at 12:47

Using the powerful tikz-cd is a one-liner:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
a\ar[r,"A"]\ar[rr,out=-30,in=210,swap,"C"] & b\ar[r,"B"] & c
\end{tikzcd}

\end{document}


Another option, with the graphs and quotes libraries from TikZ as suggested by Henri Menke:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs,quotes}

\begin{document}

\tikz \graph[multi] {a->["A"] b ->["B"] c; a->[bend right,"C" below] c; };

\end{document}


-
Also a very nice way to do. It is especially saving key strokes. –  magu_ May 5 '14 at 12:46
@magu_ Besides saving key strokes, tikz-cd was specifically designed for easily drawing commutative diagrams. –  Gonzalo Medina May 5 '14 at 12:48
Can this also be done using the graph library? –  Henri Menke May 5 '14 at 12:53
@HenriMenke Yes, it can be done. I added an example to my answer (I cannot upload images right now). Thnaks for the suggestion. –  Gonzalo Medina May 5 '14 at 13:21
@GonzaloMedina Thank you! I added the picture for you in return. –  Henri Menke May 5 '14 at 13:47

Run with xelatex

\documentclass{article}
\usepackage{pst-node}
\psset{shortput=nab,arrows=->,nodesep=2pt}
\begin{document}

\ncline{a}{b}^{A}\ncline{b}{c}^{B}
\nccurve[angleA=-45,angleB=225]{a}{c}_{C}

\end{document}


-

A MetaPost solution, making use of the boxes package. More verbose, obviously, than the tikz and pstricks solutions, but efficient all the same. To be run with LuaLaTeX.

\documentclass{standalone}
\usepackage{luamplib}
\mplibsetformat{metafun}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
input boxes;
u := 2cm;
beginfig(1);
boxjoin(a.e + (u, 0) = b.w;);
boxit.a("$a$"); drawunboxed(a);
boxit.b("$b$"); drawunboxed(b);
boxit.c("$c$"); drawunboxed(c);
path ab, bc, ac;
ab = a.e -- b.w; drawarrow ab; label.top("$A$", point 0.5 of ab);
bc = b.e -- c.w; drawarrow bc; label.top("$B$", point 0.5 of bc);
ac = a.se .. c.sw{dir 30}; drawarrow ac; label.bot("$C$", point 0.5 of ac);
setbounds currentpicture to boundingbox currentpicture enlarged 3bp;
endfig;
\end{mplibcode}
\end{document}


-