# Commutative Tikz diagrams

I am trying to draw a diagram similar to this

but my background is so basic I can not draw complected Tikz diagrams, the best I can come up with is the following:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
1 \arrow{rrr}{a}
\arrow[swap]{ ddd}{ h} & & & 2 \arrow{ddd}{g} \\
& 3 \arrow{r}{c}
\arrow{d}{d}
\arrow{ul}{0}
& 4 \arrow{d}{e}
\arrow{ur}{00}& \\
& 5 \arrow{r}{f}
\arrow{dl}{00}
& 6  \arrow{dr}{0}& \\
7 \arrow[swap]{rrr}{b} & & & 8
\end{tikzcd}
\end{document}


I'll appreciate any help, Thanks.

• Welcome to TeX SE! So basically you want the diagram to appear like the top image, but using the labels from the bottom one? Aug 13, 2016 at 10:40
• @Alenanno. Yes. Aug 13, 2016 at 10:46

Did you want something like this? The diagonal arrows in the outer rim are not like those in your first image, but since you had added them yourself, I left them as they were.

## Code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
1 \arrow{rrrrr}{a} \arrow[swap]{dddd}{h} & & & & & 2 \arrow{dddd}{g} \\
& 3 \arrow{rr}{c} \arrow{dd}{d} \arrow{ul}{0} & & 4 \arrow{dd}{e} \arrow{dl} \arrow{urr}{00}& \\
& & Y & & \\
& 5 \arrow[""{name=F, anchor=center}]{rr}{f} \arrow{ur} \arrow{dl}{00} & & 6 \arrow{drr}{0} \arrow[dashed]{ul} & \\
7 \arrow[swap]{rrrrr}{b} & & & & & 8
\arrow[to=F, dashed, -] \arrow[from=F, dashed]{uulll}
\end{tikzcd}
\end{document}