# writing a function between sets vertically

Could someone help me write this picture situation

I'd like to write this centrally, but I do not know where to start ...

Thank you very much in advance.

• Do you know how to write text un math mode? What about some special symbols? – manooooh Jun 15 at 16:50
• I use Tex to write texts in math. But I'm no expert on more elaborate diagrams and things. – Manoel Jun 15 at 16:53
• If I were to write this horizontally, I would know. But as it is in the photo I can not. – Manoel Jun 15 at 16:54

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd}[column sep=0pt,nodes={inner xsep=0pt,outer xsep=0pt}] \{\text{category of A--modules}\}=\, & \mathcal{C}\arrow[d] & \qquad & M \arrow[d,mapsto]\\ \{\text{category of B--modules}\}=\, & \mathcal{D} & \qquad & B\otimes_A M\\ \end{tikzcd}$
\end{document}


With edge labels:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd}[column sep=0pt,nodes={inner xsep=0pt,outer xsep=0pt}] \{\text{category of A--modules}\}=\, & \mathcal{C}\arrow[d,"f" swap] & \qquad & M \arrow[d,mapsto,"f"]\\ \{\text{category of B--modules}\}=\, & \mathcal{D} & \qquad & B\otimes_A M\\ \end{tikzcd}$
\end{document}


• would it be possible to put a letter "F" on the left side of the first arrow? As in this diagram: tex.stackexchange.com/questions/460349/making-diagrams/… – Manoel Jun 15 at 21:47
• @Manoel Sure, just replace \arrow[d] by \arrow[d,"f"] or \arrow[d,"f" swap]. – user121799 Jun 15 at 23:07
• @Manoel I added a complete example. Does it work on your machine? – user121799 Jun 15 at 23:14
• Can you compile the full example? Do you load some babel package? If so, please add \usetikzlibrary{babel} after \usepackage{tikz-cd} in the library. – user121799 Jun 15 at 23:23
• It worked! Thank you very much. It's for my MSc dissertation! – Manoel Jun 15 at 23:27

Another proposal using xy package:

\documentclass[a4paper,12pt]{article}

\usepackage[all]{xy}
\usepackage{amsmath,amssymb}
\begin{document}
\xymatrix{
*\txt{$\{$category of $A$--modules$\}$}&\mkern-20mu=e\ar[d]& M\ar@{|-{>}}[d]\\
*\txt{$\{$category of $B$--modules$\}$}&\mkern-20mu=\mathcal{D} & B\otimes_A M
}
\end{document}


A simple array with two rotations:

\documentclass{article}
\usepackage{amsmath,graphicx}

\begin{document}

$\renewcommand{\arraystretch}{1.5} \begin{array}{@{} r @{} c c @{}} \{\text{category of A-modules}\}={} & \mathcal{C} & M \\ & \rotatebox[origin=c]{-90}{\longrightarrow} & \rotatebox[origin=c]{-90}{\longmapsto} \\ \{\text{category of B-modules}\}={} & \mathcal{D} & B \otimes_A M \end{array}$

\end{document}
`