Commutative diagram for modified cube

I want to draw the attached diagram of a modified cube for a tex document using tikz-cd package, but modifying from the command for a cube does not seem to work here.

Any suggestions appreciated.

The code I tried for a cube

\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd}[row sep=1.5em, column sep = 1.5em] N \arrow[rr] \arrow[dr,dashed, swap,"f"] \arrow[dd,swap] && N_s \arrow[dd] \arrow[dr,"f_1"] \\ & M \arrow[rr] && M_s \arrow[dd,"h"] \\ N_{1+s} \arrow[rr,] \arrow[dr, "f_2"] && N_{s(1+s)} \arrow[dr] \\ & M_{1+s} \arrow[rr] \arrow[uu]&& M_{s(1+s)} \end{tikzcd}$
\end{document}


which gave me

The code I tried for my modified cube

\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd}[row sep=1.5em, column sep = 1.5em] N \arrow[rr] \arrow[dr,dashed, swap,"f"] \arrow[dd,swap] && N_s \arrow[dd, "y"] \arrow[dr,"f_1"] \\ & M \arrow[rr] && M_s \arrow[dd,"h"] \\ N_{1+s} \arrow[rr,] \arrow[dr, "f_2"] && X \arrow[rr,"x"] && N_{s(1+s)} \arrow[dl] \\ & M_{1+s} \arrow[rr] \arrow[uu]&& M_{s(1+s)} \end{tikzcd}$
\end{document}


Which is not producing the desired diagram

• Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. Jun 1 '18 at 16:04
• Apologies, I was unaware of the required format. Hope the edited version suffices. Jun 1 '18 at 16:28
• You need to push some more of the nodes further over to the right with some more &s.. Jun 1 '18 at 16:59
• Thankyou @thruston. Your tip helped me Jun 1 '18 at 17:18

\documentclass[12pt]{article}
$\begin{tikzcd}[row sep=1.5em, column sep = 1.5em] P \arrow[rrrr] \arrow[dr,dashed, swap,"f", two heads] \arrow[dd,swap] &&&& A_j[t]^n \arrow[dd] \arrow[dr,"f_1"] \\ & I \arrow[rrrr] &&&& I_j \arrow[dd,"h"] \\ (A_{1+j}[t])^n \arrow[rr] \arrow[dr, "f_2"] && (A_{j(1+j)}[t])^n \arrow[rr,"\sim", dashed ] && A_{j(1+j)}[t]^n \arrow[dr] \\ & I_{1+j} \arrow[rrrr] \arrow[uu]&&& &I_{j(1+j)} \end{tikzcd}$