3

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.

Miguel
  • 381

2 Answers2

2

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"'.

enter image description here

Zarko
  • 296,517
  • @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 07 '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 07 '15 at 22:41
1

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}

enter image description here

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.

egreg
  • 1,121,712