# Creating a tikz-cd diagram with different cell sizes

I am trying to create this diagram with tikz-cd in LaTeX but the size of the cells does not fit. My will is that the height of the first, second, fourth and fifth cells being tiny and the height of the third one being big for the up/down arrow. How can I do that?

Actually, can I put two heigths in the same cell? in this way I would create 3 cells instead of 5...

I would appreciate any suggestion, I have used LaTeX a lot but I just start using the tikz-cd package. If there is another package better for this kind of diagrams please tell me.

Edit:

My code was

\begin{tikzcd}
\makebox[\widthof{$x \mapsto e^{-\pi |x|^{2}}$}]{$\Phi$} & \arrow[r, hook,
"i_{\Phi}"] & \makebox[\widthof{$\varphi \mapsto \int_{\R^{d}} \varphi(x)e^{-\pi |x|^{2}} dx$}]{$\Phi^{*}$} \\
x \mapsto e^{-\pi |x|^{2}} & & \varphi \mapsto \int_{\R^{d}} \varphi(x)e^{-\pi
|x|^{2}} dx \\
\end{tikzcd}


For me the were 5 rows and 3 columns: the first row are the phi's, second the mappings, third the arrows, fourth H and last mappings again. Columns are the couple (H, Phi), i-arrows and the couple (H*, Phi*).

I hope now is clear. Thanks.

• Welcome to TeX SX! This is not clear. What do you mean by ‘cells’, and how do you enumerate them? Apr 26, 2019 at 18:15
• Could you edit you question adding the code you've written so far? Apr 26, 2019 at 19:26

You can use \underset, so making each corner into a single cell.

\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz-cd}

\newcommand{\mapdesc}{\underset{#2}{#1}}

\begin{document}

$\begin{tikzcd} \mapdesc{\Phi}{x\mapsto e^{-x^2}} \arrow[r,hook,"i_{\Phi}"] \arrow[d,hook',"i"'] & \mapdesc{\Phi^*}{\varphi\mapsto \int\varphi e^{-x^2}} \\ \mapdesc{H}{x\mapsto e^{-x^2}} \arrow[r,tail,two heads,"i_{H}"] & \mapdesc{H^*}{\Phi\mapsto \int\Phi e^{-x^2}} \arrow[u,hook,swap,"i^*"] \end{tikzcd}$

\end{document} Why \mapdesc instead of just \underset in the diagram? For several reasons. First it's more semantic; second, if you change it to

\newcommand{\mapdesc}{\underset{\text{$\displaystyle#2$}}{#1}}


the output would be This way you can defer the decision about the formatting until the last moment and a single change to the definition will modify accordingly every usage of \mapdesc.