3

Why is the following tikz-cd commutative diagram not compiling? It is giving me an error in the line \mathbb{R} \arrow{ru}{\phi\circ E^{-1}}.

\begin{tikzcd}[column sep=large, row sep=large]
    \mathcal{U}
     \arrow[swap]{d}{E}           
     \arrow{r}{\phi}  
&
    \mathbb{R} \arrow{ru}{\phi\circ E^{-1}}  \\     
%
    \mathcal{V}\subset\mathbb{R}^n
&
\end{tikzcd}

2 Answers2

3

Arrows should be declared in the cell they start from.

I add a couple of tricks: the \mathrlap to pretend that \subset\mathbb{R} takes no space and the shift of the label in the diagonal arrow towards the target.

The “new” syntax for \arrow is much more flexible and liberal.

\documentclass{article}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd}[column sep=large, row sep=large]
\mathcal{U} \arrow[d,swap,"E"] \arrow[r,"\phi"] &
\mathbb{R}
\\
\mathcal{V}\mathrlap{{}\subset\mathbb{R}^n}
  \arrow[ru,swap,"\phi\circ E^{-1}",pos=.75]
\end{tikzcd}
\]

\end{document}

enter image description here

egreg
  • 1,121,712
2

One arrow was not at the right place. I suppose this is more or less what you want:

\documentclass[border=3pt]{standalone}
\usepackage{tikz-cd, amsmath, amssymb}%

\begin{document}

\begin{tikzcd}[column sep=large, row sep=large]
    \mathcal{U}
     \arrow[swap]{d}{E}
 \arrow{r}{\phi}
& \mathbb{R} \\
  \mathcal{V}\subset\mathbb{R}^n \arrow[swap]{ru}{\phi\circ E^{-1}}
&
\end{tikzcd}

\end{document} 

enter image description here

Bernard
  • 271,350