# Functor-Diagram in tikz-cd

I wonder how to draw the typical Functor-Diagram (picture below) in tikz-cd. I know how to draw commutative diagrams, however I don't know how to make the short \mapsto arrows as well as the mapsto arrow in between the vertical arrows. Thanks in advance for any help.

Edit (code that produces errors, namely the ngerman package):

\documentclass{amsart}

%Standardpakete
\usepackage{amsmath}
\usepackage[ngerman]{babel}
\usepackage{tikz-cd}

\begin{document}
$$\begin{tikzcd} \mathsf{C}^{\mathsf{op}} \arrow[rr, "F"] & & \mathsf{D} \\ c \arrow[dd, "f"'] & \mapsto & Fc \\ & \mapsto & \\ c' & \mapsto & Fc' \arrow[uu, "Ff"'] \end{tikzcd}$$
\end{document}


Something like this?

\documentclass[a4paper,12pt]{article}
\usepackage{newtxtext,newtxmath}
\usepackage{mathtools}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
\mathsf{C}^{\mathsf{op}} \arrow[rr, "F"] &  & \mathsf{D} \\
c \arrow[dd, "f"'] & \mapsto & Fc  \\
& \mapsto & \\
c' & \mapsto & Fc' \arrow[uu, "Ff"']
\end{tikzcd}
\end{document}


Addendum on request of the user. I think that the problem it is the ngerman babel. You can fix it putting,

\usetikzlibrary{babel}


\documentclass{amsart}

%Standardpakete
\usepackage{amsmath}
\usepackage[ngerman]{babel}
\usepackage{tikz-cd}
\usetikzlibrary{babel}

\begin{document}
$\begin{tikzcd} \mathsf{C}^{\mathsf{op}} \arrow[rr, "F"] & & \mathsf{D} \\ c \arrow[dd, "f"'] & \mapsto & Fc \\ & \mapsto & \\ c' & \mapsto & Fc' \arrow[uu, "Ff"'] \end{tikzcd}$
\end{document}

• Yes, exactly what I was looking for, thank you very much! Jun 2 at 11:13
• I am using the documentclass amsart and it appears that your code does not work in that class, do you know why or how to fix it? Jun 2 at 11:19
• @user243350 Here in this community it is necessary to add a minimal working example (a full code of your work). After I have tried with amsart class and the code work correctly. Jun 2 at 11:21
• Ok, I am sorry, I will try to extract the necessary piece of code of my document shortly. Thank you for the advice. Jun 2 at 11:22
• It appears there is nothing wrong with your code when I extract the necessary packages into a seperate argument, so there has to be some error on my side. I will try to fix it, thank you for your efforts! Jun 2 at 11:26

As an alternative to Sebastiano's great answer, it is possible to name the arrows f and Ff and add an arrow between them, then shorten the arrow:

\begin{tikzcd}[column sep=large, row sep=tiny]
\mathsf{C}^{\mathsf{op}} \arrow[r, "F"] &  \mathsf{D} \\
c \arrow[d, "f"'{name=f}]\arrow[r,mapsto] & Fc  \\[5ex]
c'\arrow[r,mapsto] & Fc' \arrow[u, "Ff"'{name=Ff}]
\arrow[mapsto,from=f, to=Ff,shorten=0.7em]
\end{tikzcd}


Another option could be add an empty arrow name in the inner part of the diagram and add the arrow as before

\begin{tikzcd}[column sep=large, row sep=tiny]
\mathsf{C}^{\mathsf{op}} \arrow[r, "F"] &  \mathsf{D} \\
c \arrow[d, "f"', ""{name=f}]\arrow[r,mapsto] & Fc  \\[5ex]
c'\arrow[r,mapsto] & Fc' \arrow[u, "Ff"', ""{name=Ff}]
\arrow[mapsto,from=f, to=Ff]
\end{tikzcd}


• Thank you very much to have cited me with....."to Sebastiano's great answer". Jun 2 at 16:00
• Well it does exactly what the OP asked, so it is great :) Jun 2 at 19:18