# Rounded arrow in tikzcd

In tikzcd I would like to draw an arrow with rounded corners which goes from an entry to an entry far right from it, and passes the row below them. It should not just be bent (this works with \ar[bend right=...]), it should rather look like half of a rectangle. Here is what almost works, except that one has to join the two arrows. Also, I would like to put the text "g' \circ g" on it. Probably one has to introduce a phantom node and tell the path to pass through it?

\begin{tikzcd}[column sep=34pt]
B \ar{r}[swap]{g}
\ar[to path= |- (\tikztotarget),rounded corners=12pt]{dr}  & B'
\ar{r}[swap]{g'} & B'' \\
&  \ar[to path= -| (\tikztotarget),rounded corners=12pt]{ru} &
\end{tikzcd}


Edit: In LaRiFari's solution, how can I put text on the arrow? My attempts do not work.

You could do:

% arara: pdflatex

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

\begin{document}
\begin{tikzcd}[column sep=34pt]
B \ar{r}{g}\ar[to path={ -- ([yshift=-3ex]\tikztostart.south) -| (\tikztotarget) },rounded corners=12pt]{rr}
& B' \ar{r}{g'}
& B''
\end{tikzcd}
\end{document}

• I'd avoid swap in the upper row arrows (or use \vphantom{'} in the first label). Feb 20, 2016 at 11:35
• @LaRiFaRi: Thank you! 1) How can I put text on the arrow? My attempts do not work. 2) How to draw such an arrow which goes downwards? For some reason, my arrows point towards the wrong direction. Feb 20, 2016 at 18:43
• @MartinBrandenburg 1) this is quite difficult IMHO. See here tex.stackexchange.com/a/246340 on how to put the label on the first part of the arrow. If you want it in the middle, I would ask a new question. 2) The downwards arrow works just the same manner. Make sure that you introduce enough xshift in order to give space for your big radii. If not, the arrow head will point in the wrong direction. Feb 22, 2016 at 8:54