2

I am trying to create this diagram with tikz-cd in LaTeX

enter image description here

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.

Thank you in advance.

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.

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

1 Answer 1

3

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

\documentclass{article}

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

\newcommand{\mapdesc}[2]{\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}

enter image description here

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}[2]{\underset{\text{$\displaystyle#2$}}{#1}}

the output would be

enter image description here

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .