I try to make a diagram:
\[
\begin{tikzcd}[column sep=small]
&D^n \arrow{r}{e_\alpha^n} &X\arrow{r} &X/(X-e_\beta^{n-1}(B^{n-1}))\\
S^{n-1}\arrow{r}{\cong} &\partial D^n \arrow{u}[hook] &D^{n-1} \arrow{u}[swap]{e_\beta^{n-1}} \arrow{r} &D^{n-1}/\partial D^{n-1} \arrow{u}[swap,dashed]{\cong} \arrow{r}{\cong} &S^{n-1}
\end{tikzcd}
\]
But when I compile, it simply says undefined control sequence referring to the line containing \end{tikzcd}, but does not give any reason. What is wrong?
P.S. I have included the packages
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\usepackage{tikz-cd}
\tikzset{commutative diagrams/.cd}

tikz-cdandPGF/TikZ). – Gonzalo Medina Jul 17 '14 at 04:23