I am using to path
in order to have a better control of an arrow in a tikzcd
diagram. However, I am having trouble to placement the label.
With this code
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[labels=description, column sep=3cm]
A\arrow["a+b",sloped,rounded corners,
to path={
-| ([yshift=-1.5cm,xshift=-.7cm]\tikztostart.west)
-| ([xshift=.7cm]\tikztotarget.east)\tikztonodes
-- (\tikztotarget)} ]{r}
& B \\ C & D
\end{tikzcd}
\end{document}
Moving the \tikztonode
instruction to the first segment:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[labels=description, column sep=3cm]
A\arrow["a+b",sloped,rounded corners,
to path={
-| ([yshift=-1.5cm,xshift=-.7cm]\tikztostart.west)\tikztonodes
-| ([xshift=.7cm]\tikztotarget.east)
-- (\tikztotarget)} ]{r}
& B \\ C & D
\end{tikzcd}
\end{document}
I get this
Finally, in the last segment:
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[labels=description, column sep=3cm]
A\arrow["a+b",sloped,rounded corners,
to path={
-| ([yshift=-1.5cm,xshift=-.7cm]\tikztostart.west)
-| ([xshift=.7cm]\tikztotarget.east)
-- (\tikztotarget)\tikztonodes} ]{r}
& B \\ C & D
\end{tikzcd}
\end{document}
I get this
How do I make it appear in the long horizontal segment at the bottom?
pos=0.25
option.