# Problems with a commutative diagram (tag above the arrow)

I wrote the following diagram:

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

\begin{document}

\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl, dashrightarrow, "F"] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}

\end{document}


I want to know if there's a way to put the function $F$ above the dashrightarrow.

Just swap:

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

\begin{document}

\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl, dashrightarrow, "F"] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}

\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl, dashrightarrow, swap, "F"] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}

\end{document}


Imagine an arrow like a river, with the arrow tip being the mouth; then by default the label is placed along the left bank; with swap you put it along the right bank.

• @MiguelRomán You can even have two labels: \arrow[d,"a",swap,"b"] – egreg Oct 7 '15 at 22:31

Try

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

\begin{document}
\begin{tikzcd}
& D \arrow[d,"f"] \arrow[dl,dashrightarrow, "F"'] \\
M \arrow[r,"\phi"] & N
\end{tikzcd}
\end{document}


Trick is use "F"'.

• @egreg, it is shown in the example on the bottom of the second page of package documentation (probably is mentioned also later but till to now I didn't read it further :-) ). – Zarko Oct 7 '15 at 22:36
• Yes, I saw it by searching for "’ and not "'. Nice trick, but I still think swap to be more readable. I'll upvote tomorrow (votes ended for the day). – egreg Oct 7 '15 at 22:41